Merge
authorysr
Thu, 12 Jun 2008 13:50:55 -0700 (2008-06-12)
changeset 1376 f7fc7a708b63
parent 1374 4c24294029a9 (current diff)
parent 617 df40623379ed (diff)
child 1377 6da60b69f90c
Merge
hotspot/src/cpu/sparc/vm/assembler_sparc.cpp
hotspot/src/cpu/sparc/vm/assembler_sparc.hpp
hotspot/src/cpu/sparc/vm/sharedRuntime_sparc.cpp
hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp
hotspot/src/cpu/x86/vm/assembler_x86_32.hpp
hotspot/src/cpu/x86/vm/assembler_x86_64.cpp
hotspot/src/cpu/x86/vm/assembler_x86_64.hpp
hotspot/src/cpu/x86/vm/interp_masm_x86_64.cpp
hotspot/src/cpu/x86/vm/templateTable_x86_64.cpp
hotspot/src/share/vm/adlc/formssel.cpp
hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp
hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp
hotspot/src/share/vm/gc_implementation/includeDB_gc_concurrentMarkSweep
hotspot/src/share/vm/gc_implementation/includeDB_gc_shared
hotspot/src/share/vm/gc_interface/collectedHeap.inline.hpp
hotspot/src/share/vm/includeDB_core
hotspot/src/share/vm/memory/space.cpp
hotspot/src/share/vm/oops/instanceKlass.hpp
hotspot/src/share/vm/oops/markOop.hpp
hotspot/src/share/vm/oops/oop.hpp
hotspot/src/share/vm/oops/oop.inline.hpp
hotspot/src/share/vm/opto/graphKit.cpp
hotspot/src/share/vm/opto/lcm.cpp
hotspot/src/share/vm/opto/macro.cpp
hotspot/src/share/vm/runtime/arguments.cpp
hotspot/src/share/vm/runtime/globals.hpp
hotspot/src/share/vm/runtime/vmStructs.cpp
jdk/src/solaris/classes/sun/java2d/SurfaceManagerFactory.java
jdk/src/windows/classes/sun/java2d/SurfaceManagerFactory.java
--- a/.hgtags	Thu Jun 05 15:57:56 2008 -0700
+++ b/.hgtags	Thu Jun 12 13:50:55 2008 -0700
@@ -1,2 +1,4 @@
 1cc8dd79fd1cd13d36b385196271a29632c67c3b jdk7-b24
 bf2517e15f0c0f950e5b3143c4ca11e2df73dcc1 jdk7-b25
+5ae7db536e3fcf6be78e45b240a9058095e0ed38 jdk7-b26
+67052ac87fc927d048e62ec54ff42adb230d3f7c jdk7-b27
--- a/.hgtags-top-repo	Thu Jun 05 15:57:56 2008 -0700
+++ b/.hgtags-top-repo	Thu Jun 12 13:50:55 2008 -0700
@@ -1,2 +1,4 @@
 cfeea66a3fa8ca3686a7cfa2d0ce8ab0169f168d jdk7-b24
 cbc8ad9dd0e085a607427ea35411990982f19a36 jdk7-b25
+9410f77cc30c604d1caf7c9fe3a57fa19e1acbe8 jdk7-b26
+11b4dc9f2be3523ef989a0db8459eb56b3045c3a jdk7-b27
--- a/README-builds.html	Thu Jun 05 15:57:56 2008 -0700
+++ b/README-builds.html	Thu Jun 12 13:50:55 2008 -0700
@@ -1,1447 +1,1587 @@
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-
 <html>
-<head><title>OpenJDK Build README</title></head>
-
-<!-- ------------------------------------------------------ -->
-<hr noshade="noshade" size="3">
-
-<center>
-    <h1>OpenJDK Build README</h1>
-</center>
-
-<!-- ------------------------------------------------------ --> 
-<hr noshade="noshade" size="3">
-
-<h2><a name="introduction">Introduction</a></h2>
-
-<blockquote>
-    <p>
-    This README file contains build instructions for the 
-    <a href="http://openjdk.java.net">OpenJDK</a>.
-    Building the source code for the 
-    OpenJDK
-    requires
-    a certain degree of technical expertise.
-</blockquote>
-
-<!-- ------------------------------------------------------ -->
-<hr noshade="noshade" size="3">
-
-<h2><a name="contents">Contents</a></h2>
-
-<blockquote>
-    <ul>
-        <li><a href="#introduction">Introduction</a></li>
-        <li><a href="#MBE">Minimum Build Environments</a></li>
-        <li><a href="#SDBE">Specific Developer Build Environments</a></li>
-        <li><a href="#directories">Source Directory Structure</a> </li>
-        <li><a href="#building">Build Information</a>
-            <ul type="disc">
-                <li><a href="#gmake">GNU Make (<tt><i>gmake</i></tt>)</a> </li>
-                <li><a href="#linux">Basic Linux System Setup</a> </li>
-                <li><a href="#solaris">Basic Solaris System Setup</a> </li>
-                <li><a href="#windows">Basic Windows System Setup</a> </li>
-                <li><a href="#dependencies">Build Dependencies</a> </li>
-                <ul type="disc">
-                    <li><a href="#bootjdk">Bootstrap JDK</a> </li>
-                    <li><a href="#binaryplugs">Binary Plugs</a> </li>
-                    <li><a href="#cacerts">Certificate Authority File (cacert)</a> </li>
-                    <li><a href="#compilers">Compilers</a> 
-                        <ul>
-                            <li><a href="#msvc">Microsoft Visual Studio</a> </li>
-                            <li><a href="#mssdk">Microsoft Platform SDK</a> </li>
-                            <li><a href="#gcc">Linux gcc/binutils</a> </li>
-                            <li><a href="#studio">Sun Studio</a> </li>
-                        </ul>
-                    </li>
-                    <li>Linux and Solaris:
-                        <ul>
-                            <li><a href="#cups">CUPS Include files</a> </li>
-                        </ul>
-                    </li>
-                    <li>Windows only:
-                        <ul>
-                            <li>Unix Command Tools (<a href="#cygwin">CYGWIN</a>)</li>
-                            <li><a href="#dxsdk">DirectX 9.0 SDK</a> </li>
-                        </ul>
-                    </li>
-                </ul>
-            </ul>
-        </li>
-        <li><a href="#creating">Creating the Build</a> </li>
-        <li><a href="#testing">Testing the Build</a> </li>
-        <li><a href="#variables">Environment/Make Variables</a></li>
-        <li><a href="#troubleshooting">Troubleshooting</a></li>
-    </ul>
-</blockquote>
-
-<!-- ------------------------------------------------------ -->
-<hr noshade="noshade" size="3">
-
-<h2><a name="MBE">Minimum Build Environments</a></h2>
-
-<blockquote>
-    <p>
-    This file often describes specific requirements for what we call the
-    "minimum build environments" (MBE) for the JDK.
-    Building with the MBE will generate the most compatible
-    bits that install on, and run correctly on, the most variations
-    of the same base OS and hardware architecture.
-    These usually represent what is often called the
-    least common denominator platforms.
-    It is understood that most developers will NOT be using these 
-    specific platforms, and in fact creating these specific platforms
-    may be difficult due to the age of some of this software.
-    <p>
-    
-    <p>
-    The minimum OS and C/C++ compiler versions needed for building the
-    OpenJDK:
-    <p>
-    <center>
-        <table border="1">
-            <thead>
-                <tr>
-                    <th>Base OS and Architecture</th>
-                    <th>OS</th>
-                    <th>Compiler</th>
-                </tr>
-            </thead>
-            <tbody>
-                <tr>
-                    <td>Linux X86 (32bit)</td>
-                    <td>Red Hat Enterprise Linux 4 </td>
-                    <td>gcc 4 </td>
-                </tr>
-                <tr>
-                    <td>Linux X64 (64bit)</td>
-                    <td>Red Hat Enterprise Linux 4 </td>
-                    <td>gcc 4 </td>
-                </tr>
-                <tr>
-                    <td>Solaris SPARC (32bit)</td>
-                    <td>Solaris 10 + patches 
-                        <br>
-                        See <a href="http://sunsolve.sun.com/pub-cgi/show.pl?target=patches/JavaSE">SunSolve</a> for patch downloads.
-                    </td>
-                    <td>Sun Studio 11 </td>
-                </tr>
-                <tr>
-                    <td>Solaris SPARCV9 (64bit)</td>
-                    <td>Solaris 10 + patches
-                        <br>
-                        See <a href="http://sunsolve.sun.com/pub-cgi/show.pl?target=patches/JavaSE">SunSolve</a> for patch downloads.
-                    </td>
-                    <td>Sun Studio 11</td>
-                </tr>
-                <tr>
-                    <td>Solaris X86 (32bit)</td>
-                    <td>Solaris 10 + patches
-                        <br>
-                        See <a href="http://sunsolve.sun.com/pub-cgi/show.pl?target=patches/JavaSE">SunSolve</a> for patch downloads.
-                    </td>
-                    <td>Sun Studio 11</td>
-                </tr>
-                <tr>
-                    <td>Solaris X64 (64bit)</td>
-                    <td>Solaris 10 + patches
-                        <br>
-                        See <a href="http://sunsolve.sun.com/pub-cgi/show.pl?target=patches/JavaSE">SunSolve</a> for patch downloads.
-                    </td>
-                    <td>Sun Studio 11</td>
-                </tr>
-                <tr>
-                    <td>Windows X86 (32bit)</td>
-                    <td>Windows XP</td>
-                    <td>Microsoft Visual Studio .NET 2003 Professional</td>
-                </tr>
-                <tr>
-                    <td>Windows X64 (64bit)</td>
-                    <td>Windows Server 2003 - Enterprise x64 Edition</td>
-                    <td>Microsoft Platform SDK - April 2005</td>
-                </tr>
-            </tbody>
+    <head>
+        <title>OpenJDK Build README</title>
+    </head>
+    <body style="background-color:lightcyan">
+        <!-- ====================================================== -->
+        <table width="100%" style="background-color:white">
+            <tr>
+                <td align="center">
+                    <a href="http://openjdk.java.net" border="0">    
+                        <img alt="OpenJDK" 
+                             src="http://openjdk.java.net/images/openjdk.png"
+                             width=256
+                             style="border-style: none"/>
+                    </a>
+                </td>
+            </tr>
+            <tr>
+                <td align=center>
+                    <h1>OpenJDK Build README</h1>
+                </td>
+            </tr>
         </table>
-    </center>
-</blockquote>
-
-<!-- ------------------------------------------------------ -->
-<hr noshade="noshade" size="3">
-
-<h2><a name="SDBE">Specific Developer Build Environments</a></h2>
-
-<blockquote>
-    <p>
-    We won't be listing all the possible environments, but
-    we will try to provide what information we have available to us.
-</blockquote>
-
-<h3><a name="fedora">Fedora</a></h3>
-
-<blockquote>
-    TBD
-</blockquote>
-
-<h3><a name="debian">Debian</a></h3>
-
-<blockquote>
-    TBD
-</blockquote>
-
-<h3><a name="ubuntu">Ubuntu</a></h3>
-
-<blockquote>
-    <p>
-    In addition to needing the Bootstrap JDK and the Binary Plugs, 
-    when building on Ubuntu you will need to
-    make sure certain packages are installed.
-    In particular, certain X11 packages, make, m4, gawk, gcc 4, 
-    binutils, cups, freetype
-    and alsa.
-    
-    <h4>Ubuntu 6.06</h4>
-    
-    <p>
-    The following list of packages for Ubuntu 6.06 is a working set that
-    does appear to work. 
-    
-    <p>
-    <b>Note that it's quite possible that some of these
-        packages are not required, so anyone discovering that some of the
-        packages listed below are NOT required,
-        please let the
-        OpenJDK
-    team know.</b>
-    <p>
-    All the packages below can be installed with the
-    Synaptic Package manager provided with the base Ubuntu 6.06 release.
-    
-    <blockquote>
-        <ul>
-            <li>binutils (2.16.1cvs20060117-1ubuntu2.1)</li>
-            <li>cpp (4:4.0.3-1)</li>
-            <li>cpp-4.0 (4.0.3-1ubuntu5)</li>
-            <li>libfreetype6-dev</li>
-            <li>g++ (4:4.0.3-1)</li>
-            <li>g++-4.0 (4.0.3-1ubuntu5)</li>
-            <li>gawk (1:3.1.5-2build1)</li>
-            <li>gcc (4:4.0.3-1)</li>
-            <li>gcc-4.0 (4.0.3-1ubuntu5)</li>
-            <li>libasound2-dev (1.0.10-2ubuntu4)</li>
-            <li>libc6 (2.3.6-0ubuntu20) to 2.3.6-0ubuntu20.4</li>
-            <li>libc6-dev (2.3.6-0ubuntu20.4)</li>
-            <li>libc6-i686 (2.3.6-0ubuntu20) to 2.3.6-0ubuntu20.4</li>
-            <li>libcupsys2-dev (1.2.2-0ubuntu0.6.06)</li>
-            <li>libgcrypt11-dev (1.2.2-1)</li>
-            <li>libgnutls-dev (1.2.9-2ubuntu1.1)</li>
-            <li>libgnutls12 (1.2.9-2ubuntu1) to 1.2.9-2ubuntu1.1</li>
-            <li>libgpg-error-dev (1.1-4)</li>
-            <li>libice-dev (2:1.0.0-0ubuntu2)</li>
-            <li>liblockfile1 (1.06.1)</li>
-            <li>libopencdk8-dev (0.5.7-2)</li>
-            <li>libpopt-dev (1.7-5)</li>
-            <li>libsm-dev (2:1.0.0-0ubuntu2)</li>
-            <li>libstdc++6-4.0-dev (4.0.3-1ubuntu5)</li>
-            <li>libtasn1-2-dev (0.2.17-1ubuntu1)</li>
-            <li>libx11-dev (2:1.0.0-0ubuntu9)</li>
-            <li>libxau-dev (1:1.0.0-0ubuntu4)</li>
-            <li>libxaw-headers (2:1.0.1-0ubuntu3)</li>
-            <li>libxaw7-dev (2:1.0.1-0ubuntu3)</li>
-            <li>libxdmcp-dev (1:1.0.0-0ubuntu2)</li>
-            <li>libxext-dev (2:1.0.0-0ubuntu4)</li>
-            <li>libxi-dev (2:1.0.0-0ubuntu3) </li>
-            <li>libxmu-dev (2:1.0.0-0ubuntu3)</li>
-            <li>libxmu-headers (2:1.0.0-0ubuntu3)</li>
-            <li>libxmuu-dev (2:1.0.0-0ubuntu3)</li>
-            <li>libxp-dev (6.8.2-11ubuntu2)</li>
-            <li>libxpm-dev (1:3.5.4.2-0ubuntu3)</li>
-            <li>libxrandr-dev (1:1.1.0.2-0ubuntu4)</li>
-            <li>libxt-dev (1:1.0.0-0ubuntu3)</li>
-            <li>libxtrap-dev (2:1.0.0-0ubuntu2)</li>
-            <li>libxtst-dev (2:1.0.1-0ubuntu2)</li>
-            <li>libxv-dev (2:1.0.1-0ubuntu3)</li>
-            <li>linux-kernel-headers (2.6.11.2-0ubuntu18)</li>
-            <li>m4 (1.4.4-1)</li>
-            <li>make (3.80+3.81.b4-1)</li>
-            <li>ssl-cert (1.0.13)</li>
-            <li>x-dev (7.0.4-0ubuntu2)</li>
-            <li>x11proto-core-dev (7.0.4-0ubuntu2)</li>
-            <li>x11proto-input-dev (1.3.2-0ubuntu2)</li>
-            <li>x11proto-kb-dev (1.0.2-0ubuntu2)</li>
-            <li>x11proto-randr-dev (1.1.2-0ubuntu2)</li>
-            <li>x11proto-record-dev (1.13.2-0ubuntu2)</li>
-            <li>x11proto-trap-dev (3.4.3-0ubuntu2)</li>
-            <li>x11proto-video-dev (2.2.2-0ubuntu2)</li>
-            <li>x11proto-xext-dev (7.0.2-0ubuntu2)</li>
-            <li>xlibs-dev (7.0.0-0ubuntu45)</li>
-            <li>zlib1g-dev (1:1.2.3-6ubuntu4)</li>
-        </ul>
-    </blockquote>
-    
-    <h4>Ubuntu 7.04</h4>
-    
-    <p>
-    Using the Synaptic Package Manager, download the following
-    packages (double indented packages are automatically aquired
-    due to package dependencies):
-    
-    <blockquote>
-        <ul>
-            <li>build-essential</li>
+        <!-- ------------------------------------------------------ --> 
+        <hr>
+        <h2><a name="introduction">Introduction</a></h2>
+        <blockquote>
+            <p>
+            This README file contains build instructions for the 
+            <a href="http://openjdk.java.net"  target="_blank">OpenJDK</a>.
+            Building the source code for the 
+            OpenJDK
+            requires
+            a certain degree of technical expertise.
+        </blockquote>
+        <!-- ------------------------------------------------------ -->
+        <hr>
+        <h2><a name="contents">Contents</a></h2>
+        <blockquote>
             <ul>
-                <li>dpkg-dev</li>
-                <li>g++</li>
-                <li>g++-4.1</li>
-                <li>libc6-dev</li>
-                <li>libstdc++6.4.1-dev</li>
-                <li>linux-libc-dev</li>
-            </ul>
-            <li>gawk</li>
-            <li>m4</li>
-            <li>libasound2-dev</li>
-            <li>libcupsys2-dev</li>
-            <ul>
-                <li>libgcrypt11-dev</li>
-                <li>lgnutls-dev</li>
-                <li>libgpg-error-dev</li>
-                <li>liblzo-dev</li>
-                <li>libopencdk8-dev</li>
-                <li>libpopt-dev</li>
-                <li>libtasn1-3-dev</li>
-                <li>zlib1g-dev</li>
-            </ul>
-            <li>sun-java6-jdk</li>
-            <ul>
-                <li>java-common</li>
-                <li>libltdl3</li>
-                <li>odbcinst1debian1</li>
-                <li>sun-java6-bin</li>
-                <li>sun-java6-jre</li>
-                <li>unixodbc</li>
-            </ul>
-            <li>xlibs-dev</li>
-            <ul>
-                <li>(many)</li>
-            </ul>
-            <li>x11proto-print-dev</li>
-            <li>libxaw7-dev</li>
-            <ul>
-                <li>libxaw-headers</li>
+                <li><a href="#introduction">Introduction</a></li>
+                <li><a href="#MBE">Minimum Build Environments</a></li>
+                <li><a href="#SDBE">Specific Developer Build Environments</a></li>
+                <li><a href="#directories">Source Directory Structure</a> </li>
+                <li><a href="#building">Build Information</a>
+                    <ul>
+                        <li><a href="#gmake">GNU Make (<tt><i>gmake</i></tt>)</a> </li>
+                        <li><a href="#linux">Basic Linux System Setup</a> </li>
+                        <li><a href="#solaris">Basic Solaris System Setup</a> </li>
+                        <li><a href="#windows">Basic Windows System Setup</a> </li>
+                        <li><a href="#dependencies">Build Dependencies</a> </li>
+                        <ul>
+                            <li><a href="#bootjdk">Bootstrap JDK</a> </li>
+                            <li><a href="#binaryplugs">Binary Plugs</a> </li>
+                            <li><a href="#importjdk">Optional Import JDK</a> </li>
+                            <li><a href="#cacerts">Certificate Authority File (cacert)</a> </li>
+                            <li><a href="#compilers">Compilers</a> 
+                                <ul>
+                                    <li><a href="#msvc">Microsoft Visual Studio</a> </li>
+                                    <li><a href="#mssdk">Microsoft Platform SDK</a> </li>
+                                    <li><a href="#gcc">Linux gcc/binutils</a> </li>
+                                    <li><a href="#studio">Sun Studio</a> </li>
+                                </ul>
+                            </li>
+                            <li><a href="#zip">Zip and Unzip</a> </li>
+                            <li><a href="#freetype">FreeType2 Fonts</a> </li>
+                            <li>Linux and Solaris:
+                                <ul>
+                                    <li><a href="#cups">CUPS Include files</a> </li>
+                                </ul>
+                            </li>
+                            <li>Linux only:
+                                <ul>
+                                    <li><a href="#alsa">ALSA files</a> </li>
+                                </ul>
+                            </li>
+                            <li>Windows only:
+                                <ul>
+                                    <li>Unix Command Tools (<a href="#cygwin">CYGWIN</a>)</li>
+                                    <li><a href="#dxsdk">DirectX 9.0 SDK</a> </li>
+                                </ul>
+                            </li>
+                        </ul>
+                    </ul>
+                </li>
+                <li><a href="#creating">Creating the Build</a> </li>
+                <li><a href="#testing">Testing the Build</a> </li>
+                <li><a href="#variables">Environment/Make Variables</a></li>
+                <li><a href="#troubleshooting">Troubleshooting</a></li>
             </ul>
-            <li>libxp-dev</li>
-            <li>libfreetype6-dev</li>
-        </ul>
-    </blockquote>
-</blockquote>
-
-<!-- ------------------------------------------------------ -->
-<hr noshade="noshade" size="3">
-
-<h2><a name="directories">Source Directory Structure</a></h2>
-
-<blockquote>
-    <p>
-    The source code for the OpenJDK is delivered in a set of
-    directories:
-    <tt>hotspot</tt>, 
-    <tt>langtools</tt>, 
-    <tt>corba</tt>, 
-    <tt>jaxws</tt>, 
-    <tt>jaxp</tt>, 
-    and
-    <tt>jdk</tt>.
-    The <tt>hotspot</tt> directory contains the source code and make
-    files for building the OpenJDK Hotspot Virtual Machine. 
-    The <tt>langtools</tt> directory contains the source code and make
-    files for building the OpenJDK javac and language tools.
-    The <tt>corba</tt> directory contains the source code and make
-    files for building the OpenJDK Corba files.
-    The <tt>jaxws</tt> directory contains the source code and make
-    files for building the OpenJDK JAXWS files.
-    The <tt>jaxp</tt> directory contains the source code and make
-    files for building the OpenJDK JAXP files.
-    The <tt>jdk</tt> directory contains the source code and make files for
-    building the OpenJDK runtime libraries and misc files.
-    The top level <tt>Makefile</tt>
-    is used to build the entire OpenJDK.
-</blockquote>
-
-<!-- ------------------------------------------------------ -->
-<hr noshade="noshade" size="3">
-
-<h2><a name="building">Build Information</a></h2>
-
-<blockquote>
-    <p>
-    Building the 
-    OpenJDK
-    is done with a <tt><i>gmake</i></tt>
-    command line and various
-    environment or make variable settings that direct the make rules
-    to where various components have been installed.
-    Where possible the makefiles will attempt to located the various
-    components in the default locations or any component specific 
-    variable settings.
-    When the normal defaults fail or components cannot be found,
-    the various
-    <tt>ALT_*</tt> variables (alternates)
-    can be used to help the makefiles locate components.
-    <p>
-    Refer to the bash/sh/ksh setup file
-    <tt>jdk/make/jdk_generic_profile.sh</tt>
-    if you need help in setting up your environment variables.
-    A build could be as simple as:
-    <blockquote>
-        <pre><tt>
+        </blockquote>
+        <!-- ------------------------------------------------------ -->
+        <hr>
+        <h2><a name="MBE">Minimum Build Environments</a></h2>
+        <blockquote>
+            This file often describes specific requirements for what we call the
+            "minimum build environments" (MBE) for the JDK.
+            Building with the MBE will generate the most compatible
+            bits that install on, and run correctly on, the most variations
+            of the same base OS and hardware architecture.
+            These usually represent what is often called the
+            least common denominator platforms.
+            It is understood that most developers will NOT be using these 
+            specific platforms, and in fact creating these specific platforms
+            may be difficult due to the age of some of this software.
+            <p>
+            The minimum OS and C/C++ compiler versions needed for building the
+            OpenJDK:
+            <p>
+            <table border="1">
+                <thead>
+                    <tr>
+                        <th>Base OS and Architecture</th>
+                        <th>OS</th>
+                        <th>Compiler</th>
+                    </tr>
+                </thead>
+                <tbody>
+                    <tr>
+                        <td>Linux X86 (32bit)</td>
+                        <td>Red Hat Enterprise Linux 4 </td>
+                        <td>gcc 4 </td>
+                    </tr>
+                    <tr>
+                        <td>Linux X64 (64bit)</td>
+                        <td>Red Hat Enterprise Linux 4 </td>
+                        <td>gcc 4 </td>
+                    </tr>
+                    <tr>
+                        <td>Solaris SPARC (32bit)</td>
+                        <td>Solaris 10 + patches 
+                            <br>
+                            See <a href="http://sunsolve.sun.com/pub-cgi/show.pl?target=patches/JavaSE" target="_blank">
+                            SunSolve</a> for patch downloads.
+                        </td>
+                        <td>Sun Studio 11 </td>
+                    </tr>
+                    <tr>
+                        <td>Solaris SPARCV9 (64bit)</td>
+                        <td>Solaris 10 + patches
+                            <br>
+                            See <a href="http://sunsolve.sun.com/pub-cgi/show.pl?target=patches/JavaSE" target="_blank">
+                            SunSolve</a> for patch downloads.
+                        </td>
+                        <td>Sun Studio 11</td>
+                    </tr>
+                    <tr>
+                        <td>Solaris X86 (32bit)</td>
+                        <td>Solaris 10 + patches
+                            <br>
+                            See <a href="http://sunsolve.sun.com/pub-cgi/show.pl?target=patches/JavaSE" target="_blank">
+                            SunSolve</a> for patch downloads.
+                        </td>
+                        <td>Sun Studio 11</td>
+                    </tr>
+                    <tr>
+                        <td>Solaris X64 (64bit)</td>
+                        <td>Solaris 10 + patches
+                            <br>
+                            See <a href="http://sunsolve.sun.com/pub-cgi/show.pl?target=patches/JavaSE" target="_blank">
+                            SunSolve</a> for patch downloads.
+                        </td>
+                        <td>Sun Studio 11</td>
+                    </tr>
+                    <tr>
+                        <td>Windows X86 (32bit)</td>
+                        <td>Windows XP</td>
+                        <td>Microsoft Visual Studio .NET 2003 Professional</td>
+                    </tr>
+                    <tr>
+                        <td>Windows X64 (64bit)</td>
+                        <td>Windows Server 2003 - Enterprise x64 Edition</td>
+                        <td>Microsoft Platform SDK - April 2005</td>
+                    </tr>
+                </tbody>
+            </table>
+        </blockquote>
+        <!-- ------------------------------------------------------ -->
+        <hr>
+        <h2><a name="SDBE">Specific Developer Build Environments</a></h2>
+        <blockquote>
+            We won't be listing all the possible environments, but
+            we will try to provide what information we have available to us.
+        </blockquote>
+        <!-- ------------------------------------------------------ -->
+        <h3><a name="fedora">Fedora</a></h3>
+        <blockquote>
+            TBD
+        </blockquote>
+        <!-- ------------------------------------------------------ -->
+        <h3><a name="debian">Debian</a></h3>
+        <blockquote>
+            TBD
+        </blockquote>
+        <!-- ------------------------------------------------------ -->
+        <h3><a name="ubuntu">Ubuntu</a></h3>
+        <blockquote>
+            In addition to needing the Bootstrap JDK and the Binary Plugs, 
+            when building on Ubuntu you will need to
+            make sure certain packages are installed.
+            In particular, certain X11 packages, make, m4, gawk, gcc 4, 
+            binutils, cups, freetype
+            and alsa.
+            <!-- ------------------------------------------------------ -->
+            <h4>Ubuntu 6.06</h4>
+            <p>
+            The following list of packages for Ubuntu 6.06 is a working set that
+            does appear to work. 
+            <p>
+            <b>Note that it's quite possible that some of these
+                packages are not required, so anyone discovering that some of the
+                packages listed below are NOT required,
+                please let the
+                OpenJDK
+            team know.</b>
+            <p>
+            All the packages below can be installed with the
+            Synaptic Package manager provided with the base Ubuntu 6.06 release.
+            <blockquote>
+                <ul>
+                    <li>binutils (2.16.1cvs20060117-1ubuntu2.1)</li>
+                    <li>cpp (4:4.0.3-1)</li>
+                    <li>cpp-4.0 (4.0.3-1ubuntu5)</li>
+                    <li>libfreetype6-dev</li>
+                    <li>g++ (4:4.0.3-1)</li>
+                    <li>g++-4.0 (4.0.3-1ubuntu5)</li>
+                    <li>gawk (1:3.1.5-2build1)</li>
+                    <li>gcc (4:4.0.3-1)</li>
+                    <li>gcc-4.0 (4.0.3-1ubuntu5)</li>
+                    <li>libasound2-dev (1.0.10-2ubuntu4)</li>
+                    <li>libc6 (2.3.6-0ubuntu20) to 2.3.6-0ubuntu20.4</li>
+                    <li>libc6-dev (2.3.6-0ubuntu20.4)</li>
+                    <li>libc6-i686 (2.3.6-0ubuntu20) to 2.3.6-0ubuntu20.4</li>
+                    <li>libcupsys2-dev (1.2.2-0ubuntu0.6.06)</li>
+                    <li>libgcrypt11-dev (1.2.2-1)</li>
+                    <li>libgnutls-dev (1.2.9-2ubuntu1.1)</li>
+                    <li>libgnutls12 (1.2.9-2ubuntu1) to 1.2.9-2ubuntu1.1</li>
+                    <li>libgpg-error-dev (1.1-4)</li>
+                    <li>libice-dev (2:1.0.0-0ubuntu2)</li>
+                    <li>liblockfile1 (1.06.1)</li>
+                    <li>libopencdk8-dev (0.5.7-2)</li>
+                    <li>libpopt-dev (1.7-5)</li>
+                    <li>libsm-dev (2:1.0.0-0ubuntu2)</li>
+                    <li>libstdc++6-4.0-dev (4.0.3-1ubuntu5)</li>
+                    <li>libtasn1-2-dev (0.2.17-1ubuntu1)</li>
+                    <li>libx11-dev (2:1.0.0-0ubuntu9)</li>
+                    <li>libxau-dev (1:1.0.0-0ubuntu4)</li>
+                    <li>libxaw-headers (2:1.0.1-0ubuntu3)</li>
+                    <li>libxaw7-dev (2:1.0.1-0ubuntu3)</li>
+                    <li>libxdmcp-dev (1:1.0.0-0ubuntu2)</li>
+                    <li>libxext-dev (2:1.0.0-0ubuntu4)</li>
+                    <li>libxi-dev (2:1.0.0-0ubuntu3) </li>
+                    <li>libxmu-dev (2:1.0.0-0ubuntu3)</li>
+                    <li>libxmu-headers (2:1.0.0-0ubuntu3)</li>
+                    <li>libxmuu-dev (2:1.0.0-0ubuntu3)</li>
+                    <li>libxp-dev (6.8.2-11ubuntu2)</li>
+                    <li>libxpm-dev (1:3.5.4.2-0ubuntu3)</li>
+                    <li>libxrandr-dev (1:1.1.0.2-0ubuntu4)</li>
+                    <li>libxt-dev (1:1.0.0-0ubuntu3)</li>
+                    <li>libxtrap-dev (2:1.0.0-0ubuntu2)</li>
+                    <li>libxtst-dev (2:1.0.1-0ubuntu2)</li>
+                    <li>libxv-dev (2:1.0.1-0ubuntu3)</li>
+                    <li>linux-kernel-headers (2.6.11.2-0ubuntu18)</li>
+                    <li>m4 (1.4.4-1)</li>
+                    <li>make (3.80+3.81.b4-1)</li>
+                    <li>ssl-cert (1.0.13)</li>
+                    <li>x-dev (7.0.4-0ubuntu2)</li>
+                    <li>x11proto-core-dev (7.0.4-0ubuntu2)</li>
+                    <li>x11proto-input-dev (1.3.2-0ubuntu2)</li>
+                    <li>x11proto-kb-dev (1.0.2-0ubuntu2)</li>
+                    <li>x11proto-randr-dev (1.1.2-0ubuntu2)</li>
+                    <li>x11proto-record-dev (1.13.2-0ubuntu2)</li>
+                    <li>x11proto-trap-dev (3.4.3-0ubuntu2)</li>
+                    <li>x11proto-video-dev (2.2.2-0ubuntu2)</li>
+                    <li>x11proto-xext-dev (7.0.2-0ubuntu2)</li>
+                    <li>xlibs-dev (7.0.0-0ubuntu45)</li>
+                    <li>zlib1g-dev (1:1.2.3-6ubuntu4)</li>
+                </ul>
+            </blockquote>
+            <!-- ------------------------------------------------------ -->
+            <h4>Ubuntu 7.04</h4>
+            <p>
+            Using the Synaptic Package Manager, download the following
+            packages (double indented packages are automatically aquired
+            due to package dependencies):
+            <blockquote>
+                <ul>
+                    <li>build-essential</li>
+                    <ul>
+                        <li>dpkg-dev</li>
+                        <li>g++</li>
+                        <li>g++-4.1</li>
+                        <li>libc6-dev</li>
+                        <li>libstdc++6.4.1-dev</li>
+                        <li>linux-libc-dev</li>
+                    </ul>
+                    <li>gawk</li>
+                    <li>m4</li>
+                    <li>libasound2-dev</li>
+                    <li>libcupsys2-dev</li>
+                    <ul>
+                        <li>libgcrypt11-dev</li>
+                        <li>lgnutls-dev</li>
+                        <li>libgpg-error-dev</li>
+                        <li>liblzo-dev</li>
+                        <li>libopencdk8-dev</li>
+                        <li>libpopt-dev</li>
+                        <li>libtasn1-3-dev</li>
+                        <li>zlib1g-dev</li>
+                    </ul>
+                    <li>sun-java6-jdk</li>
+                    <ul>
+                        <li>java-common</li>
+                        <li>libltdl3</li>
+                        <li>odbcinst1debian1</li>
+                        <li>sun-java6-bin</li>
+                        <li>sun-java6-jre</li>
+                        <li>unixodbc</li>
+                    </ul>
+                    <li>xlibs-dev</li>
+                    <ul>
+                        <li>(many)</li>
+                    </ul>
+                    <li>x11proto-print-dev</li>
+                    <li>libxaw7-dev</li>
+                    <ul>
+                        <li>libxaw-headers</li>
+                    </ul>
+                    <li>libxp-dev</li>
+                    <li>libfreetype6-dev</li>
+                </ul>
+            </blockquote>
+        </blockquote>
+        <!-- ------------------------------------------------------ -->
+        <hr>
+        <h2><a name="directories">Source Directory Structure</a></h2>
+        <blockquote>
+            <p>
+            The source code for the OpenJDK is delivered in a set of
+            directories:
+            <tt>hotspot</tt>, 
+            <tt>langtools</tt>, 
+            <tt>corba</tt>, 
+            <tt>jaxws</tt>, 
+            <tt>jaxp</tt>, 
+            and
+            <tt>jdk</tt>.
+            The <tt>hotspot</tt> directory contains the source code and make
+            files for building the OpenJDK Hotspot Virtual Machine. 
+            The <tt>langtools</tt> directory contains the source code and make
+            files for building the OpenJDK javac and language tools.
+            The <tt>corba</tt> directory contains the source code and make
+            files for building the OpenJDK Corba files.
+            The <tt>jaxws</tt> directory contains the source code and make
+            files for building the OpenJDK JAXWS files.
+            The <tt>jaxp</tt> directory contains the source code and make
+            files for building the OpenJDK JAXP files.
+            The <tt>jdk</tt> directory contains the source code and make files for
+            building the OpenJDK runtime libraries and misc files.
+            The top level <tt>Makefile</tt>
+            is used to build the entire OpenJDK.
+        </blockquote>
+        <!-- ------------------------------------------------------ -->
+        <hr>
+        <h2><a name="building">Build Information</a></h2>
+        <blockquote>
+            Building the OpenJDK
+            is done with a <tt><i>gmake</i></tt>
+            command line and various
+            environment or make variable settings that direct the make rules
+            to where various components have been installed.
+            Where possible the makefiles will attempt to located the various
+            components in the default locations or any component specific 
+            variable settings.
+            When the normal defaults fail or components cannot be found,
+            the various
+            <tt>ALT_*</tt> variables (alternates)
+            can be used to help the makefiles locate components.
+            <p>
+            Refer to the bash/sh/ksh setup file
+            <tt>jdk/make/jdk_generic_profile.sh</tt>
+            if you need help in setting up your environment variables.
+            A build could be as simple as:
+            <blockquote>
+                <pre><tt>
                 bash
                 . jdk/make/jdk_generic_profile.sh
                 <i>gmake</i> sanity &amp;&amp; <i>gmake</i>
-        </tt></pre>
-    </blockquote>
-    <p>
-    Of course ksh or sh would work too.
-    But some customization will probably be necessary.
-    The <tt>sanity</tt> rule will make some basic checks on build
-    dependencies and generate appropriate warning messages
-    regarding missing, out of date, or newer than expected components
-    found on your system.
-</blockquote>
-
-<!-- ------------------------------------------------------ -->
-<hr noshade="noshade" size="3">
-
-<h3><a name="gmake">GNU make (<tt><i>gmake</i></tt>)</a></h3>
-
-<blockquote>
-    <p>
-    The Makefiles in the 
-    OpenJDK 
-    are only valid when used with the 
-    GNU version of the utility command <tt>make</tt>
-    (<tt><i>gmake</i></tt>).
-    A few notes about using GNU make:
-    <ul>
-        <li>
-            In general, you need GNU make version 3.78.1 or newer.
-        </li>
-        <li>
-            Place the location of the GNU make binary in the <tt>PATH</tt>. 
-        </li>
-        <li>
-            <strong>Linux:</strong>
-            The <tt>/usr/bin/make</tt> command should work fine for you.
-        </li>
-        <li>
-            <strong>Solaris:</strong>
-            Do NOT use <tt>/usr/bin/make</tt> on Solaris.
-            If your Solaris system has the software
-            from the Solaris Companion CD installed, 
-            you should use <tt>gmake</tt>
-            which will be located in either the <tt>/opt/sfw/bin</tt> or 
-            <tt>/usr/sfw/bin</tt> directory.
-        </li>
-        <li>
+                </tt></pre>
+            </blockquote>
+            <p>
+            Of course ksh or sh would work too.
+            But some customization will probably be necessary.
+            The <tt>sanity</tt> rule will make some basic checks on build
+            dependencies and generate appropriate warning messages
+            regarding missing, out of date, or newer than expected components
+            found on your system.
+        </blockquote>
+        <!-- ------------------------------------------------------ -->
+        <hr>
+        <h3><a name="gmake">GNU make (<tt><i>gmake</i></tt>)</a></h3>
+        <blockquote>
+            The Makefiles in the OpenJDK are only valid when used with the 
+            GNU version of the utility command <tt>make</tt>
+            (<tt><i>gmake</i></tt>).
+            A few notes about using GNU make:
+            <ul>
+                <li>
+                    In general, you need GNU make version 3.78.1 or newer.
+                </li>
+                <li>
+                    Place the location of the GNU make binary in the <tt>PATH</tt>. 
+                </li>
+                <li>
+                    <strong>Linux:</strong>
+                    The <tt>/usr/bin/make</tt> command should work fine for you.
+                </li>
+                <li>
+                    <strong>Solaris:</strong>
+                    Do NOT use <tt>/usr/bin/make</tt> on Solaris.
+                    If your Solaris system has the software
+                    from the Solaris Companion CD installed, 
+                    you should use <tt>gmake</tt>
+                    which will be located in either the <tt>/opt/sfw/bin</tt> or 
+                    <tt>/usr/sfw/bin</tt> directory.
+                </li>
+                <li>
+                    <strong>Windows:</strong>
+                    Make sure you start your build inside a bash/sh/ksh shell.
+                    <br>
+                    <b>WARNING:</b> Watch out for make version 3.81, it may
+                    not work due to a lack of support for drive letter paths
+                    like <tt>C:/</tt>. See
+                    <a href="#gmake">section on gmake</a>.
+                    Use a 3.80 version, or find a newer
+                    version that has this problem fixed.
+                    The older 3.80 version of make.exe can be downloaded with this
+                    <a href="http://cygwin.paracoda.com/release/make/make-3.80-1.tar.bz2" target="_blank">
+                    link</a>.
+                    Also see the
+                    <a href="http://developer.mozilla.org/en/docs/Windows_build_prerequisites_using_cygwin#make" target="_blank">
+                    mozilla developer center</a>
+                    on this topic.
+                </li>
+            </ul>
+            <p>
+            Information on GNU make, and access to ftp download sites, are
+            available on the
+            <a href="http://www.gnu.org/software/make/make.html" target="_blank">
+                GNU make web site
+            </a>.
+            The latest source to GNU make is available at
+            <a href="http://ftp.gnu.org/pub/gnu/make/" target="_blank">
+            ftp.gnu.org/pub/gnu/make/</a>.
+        </blockquote>
+        <!-- ------------------------------------------------------ -->
+        <hr>
+        <h3><a name="linux">Basic Linux System Setup</a></h3>
+        <blockquote>
+            <strong>i586 only:</strong>
+            The minimum recommended hardware for building the Linux version
+            is a Pentium class processor or better, at least 256 MB of RAM, and
+            approximately 1.5 GB of free disk space.
+            <p> 
+            <strong>X64 only:</strong>
+            The minimum recommended hardware for building the Linux
+            version is an AMD Opteron class processor, at least 512 MB of RAM, and
+            approximately 4 GB of free disk space.
+            <p> 
+            The build will use the tools contained in 
+            <tt>/bin</tt> and 
+            <tt>/usr/bin</tt>
+            of a standard installation of the Linux operating environment. 
+            You should ensure that these directories are in your 
+            <tt>PATH</tt>.
+            <p>
+            Note that some Linux systems have a habit of pre-populating
+            your environment variables for you, for example <tt>JAVA_HOME</tt>
+            might get pre-defined for you to refer to the JDK installed on
+            your Linux system. 
+            You will need to unset <tt>JAVA_HOME</tt>.
+            It's a good idea to run <tt>env</tt> and verify the
+            environment variables you are getting from the default system
+            settings make sense for building the 
+            OpenJDK.
+        </blockquote>
+        <!-- ------------------------------------------------------ -->
+        <h4><a name="linux_checklist">Basic Linux Check List</a></h4>
+        <blockquote>
+            <ol>
+                <li>
+                    Install the
+                    <a href="#bootjdk">Bootstrap JDK</a>, set
+                    <tt><a href="#ALT_BOOTDIR">ALT_BOOTDIR</a></tt>.
+                </li>
+                <li>
+                    Install the
+                    <a href="#binaryplugs">Binary Plugs</a>, set
+                    <tt><a href="#ALT_BINARY_PLUGS_PATH">ALT_BINARY_PLUGS_PATH</a></tt>.
+                </li>
+                <li>
+                    <a href="#importjdk">Optional Import JDK</a>, set
+                    <tt><a href="#ALT_JDK_IMPORT_PATH">ALT_JDK_IMPORT_PATH</a></tt>.
+                </li>
+                <li>
+                    Install or upgrade the <a href="#freetype">FreeType development
+                    package</a>.
+                </li>
+            </ol>
+        </blockquote>
+        <!-- ------------------------------------------------------ -->
+        <hr>
+        <h3><a name="solaris">Basic Solaris System Setup</a></h3>
+        <blockquote>
+            The minimum recommended hardware for building the
+            Solaris SPARC version is an UltraSPARC with 512 MB of RAM. 
+            For building
+            the Solaris x86 version, a Pentium class processor or better and at
+            least 512 MB of RAM are recommended. 
+            Approximately 1.4 GB of free disk
+            space is needed for a 32-bit build.
+            <p>
+            If you are building the 64bit version, you should
+            run the command "isainfo -v" to verify that you have a
+            64-bit installation, it should say <tt>sparcv9</tt> or
+            <tt>amd64</tt>.
+            An additional 7 GB of free disk space is needed
+            for a 64-bit build.
+            <p> 
+            The build uses the tools contained in <tt>/usr/ccs/bin</tt>
+            and <tt>/usr/bin</tt> of a standard developer or full installation of
+            the Solaris operating environment.
+            <p> 
+            Solaris patches specific to the JDK can be downloaded from the 
+            <a href="http://sunsolve.sun.com/show.do?target=patches/JavaSE" target="_blank">
+            SunSolve JDK Solaris patches download page</a>.
+            You should ensure that the latest patch cluster for
+            your version of the Solaris operating environment has also
+            been installed.
+        </blockquote>
+        <!-- ------------------------------------------------------ -->
+        <h4><a name="solaris_checklist">Basic Solaris Check List</a></h4>
+        <blockquote>
+            <ol>
+                <li>
+                    Install the
+                    <a href="#bootjdk">Bootstrap JDK</a>, set
+                    <tt><a href="#ALT_BOOTDIR">ALT_BOOTDIR</a></tt>.
+                </li>
+                <li>
+                    Install the
+                    <a href="#binaryplugs">Binary Plugs</a>, set
+                    <tt><a href="#ALT_BINARY_PLUGS_PATH">ALT_BINARY_PLUGS_PATH</a></tt>.
+                </li>
+                <li>
+                    <a href="#importjdk">Optional Import JDK</a>, set
+                    <tt><a href="#ALT_JDK_IMPORT_PATH">ALT_JDK_IMPORT_PATH</a></tt>.
+                </li>
+                <li>
+                    Install the
+                    <a href="#studio">Sun Studio Compilers</a>, set
+                    <a href="#ALT_COMPILER_PATH"><tt>ALT_COMPILER_PATH</tt></a>.
+                </li>
+                <li>
+                    Install the
+                    <a href="#cups">CUPS Include files</a>, set
+                    <tt><a href="#ALT_CUPS_HEADERS_PATH">ALT_CUPS_HEADERS_PATH</a></tt>.
+                </li>
+            </ol>
+        </blockquote>
+        <!-- ------------------------------------------------------ -->
+        <hr>
+        <h3><a name="windows">Basic Windows System Setup</a></h3>
+        <blockquote> 
+            <strong>i586 only:</strong>
+            The minimum recommended hardware for building the 32bit or X86
+            Windows version is an Pentium class processor or better, at least
+            512 MB of RAM, and approximately 600 MB of free disk space.
+            <strong>
+                NOTE: The Windows 2000 build machines need to use the
+                file system NTFS. 
+                Build machines formatted to FAT32 will not work 
+                because FAT32 doesn't support case-sensitivity in file names.
+            </strong>
+            <p> 
+            <strong>X64 only:</strong>
+            The minimum recommended hardware for building
+            the Windows X64 version is an AMD Opteron class processor, at least 1
+            GB of RAM, and approximately 10 GB of free disk space.
+        </blockquote>
+        <!-- ------------------------------------------------------ -->
+        <h4><a name="paths">Windows Paths</a></h4>
+        <blockquote>
             <strong>Windows:</strong>
-            Make sure you start your build inside a bash/sh/ksh shell.
-            <br>
-            <b>WARNING:</b> Watch out for make version 3.81, it may
-            not work due to a lack of support for drive letter paths
-            like <tt>C:/</tt>. Use a 3.80 version, or find a newer
-            version that has this problem fixed.
-        </li>
-    </ul>
-    <p>
-    Information on GNU make, and access to ftp download sites, are
-    available on the
-    <a href="http://www.gnu.org/software/make/make.html">
-        GNU make web site
-    </a>.
-    The latest source to GNU make is available at
-    <a href="http://ftp.gnu.org/pub/gnu/make/">ftp.gnu.org/pub/gnu/make/</a>.
-</blockquote>
-
-<!-- ------------------------------------------------------ -->
-<hr noshade="noshade" size="3">
-
-<h3><a name="linux">Basic Linux System Setup</a></h3>
-
-<blockquote>
-    <p>
-    <strong>i586 only:</strong>
-    The minimum recommended hardware for building the Linux version
-    is a Pentium class processor or better, at least 256 MB of RAM, and
-    approximately 1.5 GB of free disk space.
-    <p> 
-    <strong>X64 only:</strong>
-    The minimum recommended hardware for building the Linux
-    version is an AMD Opteron class processor, at least 512 MB of RAM, and
-    approximately 4 GB of free disk space.
-    <p> 
-    The build will use the tools contained in 
-    <tt>/bin</tt> and 
-    <tt>/usr/bin</tt>
-    of a standard installation of the Linux operating environment. 
-    You should ensure that these directories are in your 
-    <tt>PATH</tt>.
-    <p>
-    Note that some Linux systems have a habit of pre-populating
-    your environment variables for you, for example <tt>JAVA_HOME</tt>
-    might get pre-defined for you to refer to the JDK installed on
-    your Linux system. 
-    You will need to unset <tt>JAVA_HOME</tt>.
-    It's a good idea to run <tt>env</tt> and verify the
-    environment variables you are getting from the default system
-    settings make sense for building the 
-    OpenJDK.
-</blockquote>
-
-<!-- ------------------------------------------------------ -->
-
-<h4><a name="linux_checklist">Basic Linux Check List</a></h4>
-
-<blockquote>
-    <ol>
-        <li>
-            Install the
-            <a href="#bootjdk">Bootstrap JDK</a>, set
-            <tt><a href="#ALT_BOOTDIR">ALT_BOOTDIR</a></tt>.
-        </li>
-        <li>
-            Install the
-            <a href="#binaryplugs">Binary Plugs</a>, set
-            <tt><a href="#ALT_BINARY_PLUGS_PATH">ALT_BINARY_PLUGS_PATH</a></tt>.
-        </li>
-        <li>
-            Install or upgrade the <a href="#freetype">FreeType development
-            package</a>.
-        </li>
-    </ol>
-</blockquote>
-
-<!-- ------------------------------------------------------ -->
-<hr noshade="noshade" size="3">
-
-<h3><a name="solaris">Basic Solaris System Setup</a></h3>
-
-<blockquote>
-    <p>
-    The minimum recommended hardware for building the
-    Solaris SPARC version is an UltraSPARC with 512 MB of RAM. 
-    For building
-    the Solaris x86 version, a Pentium class processor or better and at
-    least 128 MB of RAM are recommended. 
-    Approximately 1.4 GB of free disk
-    space is needed for a 32-bit build.
-    <p>
-    If you are building the 64bit version, you should
-    run the command "isainfo -v" to verify that you have a
-    64-bit installation. 
-    An additional 7 GB of free disk space is needed
-    for a 64-bit build.
-    <p> 
-    The build uses the tools contained in <tt>/usr/ccs/bin</tt>
-    and <tt>/usr/bin</tt> of a standard developer or full installation of
-    the Solaris operating environment.
-</blockquote>
-
-<!-- ------------------------------------------------------ -->
-
-<h4><a name="solaris_checklist">Basic Solaris Check List</a></h4>
-
-<blockquote>
-    <ol>
-        <li>
-            Install the
-            <a href="#bootjdk">Bootstrap JDK</a>, set
-            <tt><a href="#ALT_BOOTDIR">ALT_BOOTDIR</a></tt>.
-        </li>
-        <li>
-            Install the
-            <a href="#binaryplugs">Binary Plugs</a>, set
-            <tt><a href="#ALT_BINARY_PLUGS_PATH">ALT_BINARY_PLUGS_PATH</a></tt>.
-        </li>
-        <li>
-            Install the
-            <a href="#studio">Sun Studio Compilers</a>, set
-            <a href="#ALT_COMPILER_PATH"><tt>ALT_COMPILER_PATH</tt></a>.
-        </li>
-        <li>
-            Install the
-            <a href="#cups">CUPS Include files</a>, set
-            <tt><a href="#ALT_CUPS_HEADERS_PATH">ALT_CUPS_HEADERS_PATH</a></tt>.
-        </li>
-    </ol>
-</blockquote>
-
-<!-- ------------------------------------------------------ -->
-<hr noshade="noshade" size="3">
-
-<h3><a name="windows">Basic Windows System Setup</a></h3>
-
-<blockquote> 
-    <p>
-    <strong>i586 only:</strong>
-    The minimum recommended hardware for building the 32bit or X86
-    Windows version is an Pentium class processor or better, at least
-    512 MB of RAM, and approximately 600 MB of free disk space.
-    <strong>
-        NOTE: The Windows 2000 build machines need to use the
-        file system NTFS. 
-        Build machines formatted to FAT32 will not work 
-        because FAT32 doesn't support case-sensitivity in file names.
-    </strong>
-    <p> 
-    <strong>X64 only:</strong>
-    The minimum recommended hardware for building
-    the Windows X64 version is an AMD Opteron class processor, at least 1
-    GB of RAM, and approximately 10 GB of free disk space.
-</blockquote>
-
-<!-- ------------------------------------------------------ -->
-
-<h4><a name="paths">Windows Paths</a></h4>
-
-<blockquote>
-    <p>
-    <strong>Windows:</strong>
-    Note that GNU make is a historic utility and is based very
-    heavily on shell scripting, so it does not tolerate the Windows habit
-    of having spaces in pathnames or the use of the <tt>\</tt>characters in pathnames.
-    Luckily on most Windows systems, you can use <tt>/</tt>instead of \, and
-    there is always a 'short' pathname without spaces for any path that 
-    contains spaces.
-    Unfortunately, this short pathname can be somewhat dynamic and the
-    formula is difficult to explain.
-    You can use <tt>cygpath</tt> utility to map pathnames with spaces
-    or the <tt>\</tt>character into the <tt>C:/</tt> style of pathname
-    (called 'mixed'), e.g.
-    <tt>cygpath -s -m "<i>path</i>"</tt>.
-    <p>
-    The makefiles will try to translate any pathnames supplied
-    to it into the <tt>C:/</tt> style automatically.
-    <p>
-    Note that use of CYGWIN creates a unique problem with regards to
-    setting <a href="#path"><tt>PATH</tt></a>. Normally on Windows
-    the <tt>PATH</tt> variable contains directories
-    separated with the ";" character (Solaris and Linux uses ":").
-    With CYGWIN, it uses ":", but that means that paths like "C:/path"
-    cannot be placed in the CYGWIN version  of <tt>PATH</tt> and
-    instead CYGWIN uses something like <tt>/cygdrive/c/path</tt>
-    which CYGWIN understands, but only CYGWIN understands.
-    So be careful with paths on Windows.
-</blockquote>
-
-<!-- ------------------------------------------------------ -->
-
-<h4><a name="windows_checklist">Basic Windows Check List</a></h4>
-
-<blockquote>
-    <ol>
-        <li>
-            Install the
-            <a href="#cygwin">CYGWIN product</a>. 
-        </li>
-        <li>
-            Install the 
-            <a href="#bootjdk">Bootstrap JDK</a>, set
-            <tt><a href="#ALT_BOOTDIR">ALT_BOOTDIR</a></tt>.
-        </li>
-        <li>
-            Install the
-            <a href="#binaryplugs">Binary Plugs</a>, set
-            <tt><a href="#ALT_BINARY_PLUGS_PATH">ALT_BINARY_PLUGS_PATH</a></tt>..
-        </li>
-        <li>
-            Install the
-            <a href="#msvc">Microsoft Visual Studio .NET 2003 Professional</a> or the 
-            <a href="#mssdk">Microsoft Platform SDK</a>.
-        </li>
-        <li>
-            Setup all environment variables for compilers 
-            (see <a href="#msvc">compilers</a>).
-        </li>
-        <li>
-            Install 
-            <a href="#dxsdk">Microsoft DirectX SDK</a>.
-        </li>
-    </ol>
-</blockquote>
-
-<!-- ------------------------------------------------------ -->
-<hr noshade="noshade" size="3">
-
-<h3><a name="dependencies">Build Dependencies</a></h3>
-
-<blockquote>
-    <p>
-    Depending on the platform, the 
-    OpenJDK 
-    build process has some basic
-    dependencies on components not part of the 
-    OpenJDK 
-    sources.
-    Some of these are specific to a platform, some even specific to
-    an architecture.
-    Each dependency will have a set of ALT variables that can be set
-    to tell the makefiles where to locate the component.
-    In most cases setting these ALT variables may not be necessary
-    and the makefiles will find defaults on the system in standard
-    install locations or through component specific variables.
-    
-    <h4><a name="bootjdk">Bootstrap JDK</a></h4>
-    
-    <blockquote>
-        <p>
-        All 
-        OpenJDK 
-        builds require access to the previously released 
-        JDK 6, this is often called a bootstrap JDK.
-        The JDK 6 binaries can be downloaded from Sun's 
-        <a href="http://java.sun.com/javase/1.6.0/download.html">JDK 6 download site</a>.
-        For build performance reasons
-        is very important that this bootstrap JDK be made available on the
-        local disk of the machine doing the build.
-        You should always set 
-        <tt><a href="#ALT_BOOTDIR">ALT_BOOTDIR</a></tt>
-        to point to the location of
-        the bootstrap JDK installation, this is the directory pathname
-        that contains a <tt>bin, lib, and include</tt>
-        It's also a good idea to also place its <tt>bin</tt> directory
-        in the <tt>PATH</tt> environment variable, although it's
-        not required.
-        <p>
-        <strong>Solaris:</strong>
-        Some pre-installed JDK images may be available to you in the
-        directory <tt>/usr/jdk/instances</tt>.
-        If you don't set
-        <tt><a href="#ALT_BOOTDIR">ALT_BOOTDIR</a></tt>
-        the makefiles will look in that location for a JDK it can use.
-    </blockquote>
-    
-    <h4><a name="binaryplugs">Binary Plugs</a></h4>
-    
-    <blockquote>
-        <p>
-        Not all of the source code that makes up the JDK is available
-        under an open-source license.
-        In order to build an OpenJDK binary from source code,
-        you must first download and install the appropriate
-	binary plug bundles from the OpenJDK, go to the
-	<a href="http://openjdk.java.net">OpenJDK</a> site and select
-	the "<b>Bundles(7)</b>" link.
-        During the OpenJDK build process these "binary plugs"
-        for the encumbered components will be copied into your
-        resulting OpenJDK binary build image.
-        These binary plug files are only for the purpose of
-        building an OpenJDK binary.
-        Make sure you set
-        <tt><a href="#ALT_BINARY_PLUGS_PATH">ALT_BINARY_PLUGS_PATH</a></tt>
-        to the root of this installation.
-    </blockquote>
-    
-    <h4><a name="cacerts">Certificate Authority File (cacert)</a></h4>
-    
-    <blockquote>
-        <p>
-        See <a href="http://en.wikipedia.org/wiki/CAcert">
-        www.wikipedia.org/wiki/CAcert</a>
-        for a better understanding of the Certificate Authority (CA).
-        A certificates file named "cacerts"
-        represents a system-wide keystore with CA certificates. 
-        In JDK and JRE
-        binary bundles, the "cacerts" file contains root CA certificates from
-        several public CAs (e.g., VeriSign, Thawte, and Baltimore).
-        The source contain a cacerts file
-        without CA root certificates. 
-        Formal JDK builders will need to secure
-        permission from each public CA and include the certificates into their
-        own custom cacerts file. 
-        Failure to provide a populated cacerts file
-        will result in verification errors of a certificate chain during runtime.
-        The variable 
-        <tt><a href="#ALT_CACERTS_FILE">ALT_CACERTS_FILE</a></tt>
-        can be used to override the default location of the
-        cacerts file that will get placed in your build.
-        By default an empty cacerts file is provided and that should be
-        fine for most JDK developers.
-    </blockquote>
-    
-    <h4><a name="compilers">Compilers</a></h4>
-    
-    <blockquote>
-        
-        <a name="gcc">
-            <strong>Linux gcc/binutils</strong>
-        </a>
-        
+            Note that GNU make is a historic utility and is based very
+            heavily on shell scripting, so it does not tolerate the Windows habit
+            of having spaces in pathnames or the use of the <tt>\</tt>characters in pathnames.
+            Luckily on most Windows systems, you can use <tt>/</tt>instead of \, and
+            there is always a 'short' pathname without spaces for any path that 
+            contains spaces.
+            Unfortunately, this short pathname can be somewhat dynamic and the
+            formula is difficult to explain.
+            You can use <tt>cygpath</tt> utility to map pathnames with spaces
+            or the <tt>\</tt>character into the <tt>C:/</tt> style of pathname
+            (called 'mixed'), e.g.
+            <tt>cygpath -s -m "<i>path</i>"</tt>.
+            <p>
+            The makefiles will try to translate any pathnames supplied
+            to it into the <tt>C:/</tt> style automatically.
+            <p>
+            Note that use of CYGWIN creates a unique problem with regards to
+            setting <a href="#path"><tt>PATH</tt></a>. Normally on Windows
+            the <tt>PATH</tt> variable contains directories
+            separated with the ";" character (Solaris and Linux uses ":").
+            With CYGWIN, it uses ":", but that means that paths like "C:/path"
+            cannot be placed in the CYGWIN version  of <tt>PATH</tt> and
+            instead CYGWIN uses something like <tt>/cygdrive/c/path</tt>
+            which CYGWIN understands, but only CYGWIN understands.
+            So be careful with paths on Windows.
+        </blockquote>
+        <!-- ------------------------------------------------------ -->
+        <h4><a name="windows_checklist">Basic Windows Check List</a></h4>
+        <blockquote>
+            <ol>
+                <li>
+                    Install the
+                    <a href="#cygwin">CYGWIN product</a>. 
+                </li>
+                <li>
+                    Install the 
+                    <a href="#bootjdk">Bootstrap JDK</a>, set
+                    <tt><a href="#ALT_BOOTDIR">ALT_BOOTDIR</a></tt>.
+                </li>
+                <li>
+                    Install the
+                    <a href="#binaryplugs">Binary Plugs</a>, set
+                    <tt><a href="#ALT_BINARY_PLUGS_PATH">ALT_BINARY_PLUGS_PATH</a></tt>..
+                </li>
+                <li>
+                    <a href="#importjdk">Optional Import JDK</a>, set
+                    <tt><a href="#ALT_JDK_IMPORT_PATH">ALT_JDK_IMPORT_PATH</a></tt>.
+                </li>
+                <li>
+                    Install the
+                    <a href="#msvc">Microsoft Visual Studio .NET 2003 Professional</a> or the 
+                    <a href="#mssdk">Microsoft Platform SDK</a>.
+                </li>
+                <li>
+                    Setup all environment variables for compilers 
+                    (see <a href="#msvc">compilers</a>).
+                </li>
+                <li>
+                    Install 
+                    <a href="#dxsdk">Microsoft DirectX SDK</a>.
+                </li>
+            </ol>
+        </blockquote>
+        <!-- ------------------------------------------------------ -->
+        <hr>
+        <h3><a name="dependencies">Build Dependencies</a></h3>
         <blockquote>
-            <p>
-            The GNU gcc compiler version should be 3.2.2 or newer.
-            The binutils package should be 2.11.93.0.2-11 or newer.
-            The compiler used should be the default compiler installed
-            in <tt>/usr/bin</tt>.
-        </blockquote>
-        
-        <strong><a name="studio">Solaris: Sun Studio</a></strong>
-        
-        <blockquote>
-            <p>
-            At a minimum, the
-            <a href="http://developers.sun.com/sunstudio/index.jsp">
-            Sun Studio 11 Compilers</a>
-            (containing version 5.8 of the C and C++ compilers) is required,
-            with patches from the
-            <a href="http://sunsolve.sun.com/pub-cgi/show.pl?target=patches/patch-access">
-            SunSolve web site</a>.
-            <p> 
-            Set 
-            <a href="#ALT_COMPILER_PATH"><tt>ALT_COMPILER_PATH</tt></a>
-            to point to the location of
-            the compiler binaries, and place this location in the <tt>PATH</tt>.
-            <p>
-            The Sun Studio Express compilers at:
-            <a href="http://developers.sun.com/sunstudio/downloads/express.jsp">
-            Sun Studio Express Download site</a>
-            are also an option, although these compilers have not
-            been extensively used yet.
-        </blockquote>
-        
-        <a name="msvc">
-            <strong>Windows i586: Microsoft Visual Studio .NET 2003 Professional</strong>
-        </a>
-        
-        <blockquote>
-            <p>
-            The 32-bit 
-            OpenJDK
-            Windows build
-            requires Microsoft Visual Studio .NET 2003 (VS2003) Professional
-            Edition compiler. 
-            The compiler and other tools are expected to reside
-            in the location defined by the variable <tt>VS71COMNTOOLS</tt> which
-            is set by the Microsoft Visual Studio .NET installer.
-            <p> 
-            Once the compiler is installed, 
-            it is recommended that you run <tt>VCVARS32.BAT</tt> 
-            to set the compiler environment variables
-            <tt>MSVCDIR</tt>, 
-            <tt>INCLUDE</tt>,
-            <tt>LIB</tt>, and
-            <tt>PATH</tt> 
-            prior to building the 
-            OpenJDK.
-            The above environment variables <b>MUST</b> be set.
-            <p>
-            The Microsoft Visual Studio .NET 2005 (VS2005) compiler
-            will not work at this time due to the new runtime dll
-            and the manifest requirements.
-        </blockquote>
-        
-        <a name="mssdk">
-            <strong>Windows X64: Microsoft Platform SDK April 2005</strong>
-        </a>
-        
-        <blockquote>
-            <p>
-            On <b>X64</b>,
-            the Microsoft Platform Software
-            Development Kit (SDK), April 2005 Edition compiler, is required for
-            building the 
-            OpenJDK
-            because it contains the C/C++ compiler. 
-            You will need to minimally install the Core SDK and
-            the MDAC SDK features of this compiler.
-            <p>
-            Once the Platform SDK is installed,
-            it is recommended that you run <tt>SetEnv.Cmd /X64</tt> 
-            to set the compiler environment variables
-            <tt>MSSDK</tt>, 
-            <tt>MSTOOLS</tt>,
-            <tt>INCLUDE</tt>,
-            <tt>LIB</tt>, and
-            <tt>PATH</tt> 
-            prior to building the 
-            OpenJDK.
-            The above environment variables <b>MUST</b> be set.
-            <p>
-            Note that this compiler may say it's version is a
-            Microsoft Visual Studio .NET 2005 (VS2005), but be careful,
-            it will not match the official VS2005 product.
-            This Platform SDK compiler is only used on X64 builds.
+            Depending on the platform, the OpenJDK build process has some basic
+            dependencies on components not part of the OpenJDK sources.
+            Some of these are specific to a platform, some even specific to
+            an architecture.
+            Each dependency will have a set of ALT variables that can be set
+            to tell the makefiles where to locate the component.
+            In most cases setting these ALT variables may not be necessary
+            and the makefiles will find defaults on the system in standard
+            install locations or through component specific variables.
+            <!-- ------------------------------------------------------ -->
+            <h4><a name="bootjdk">Bootstrap JDK</a></h4>
+            <blockquote>
+                All OpenJDK builds require access to the previously released 
+                JDK 6, this is often called a bootstrap JDK.
+                The JDK 6 binaries can be downloaded from Sun's 
+                <a href="http://java.sun.com/javase/1.6.0/download.html" target="_blank">JDK 6 download site</a>.
+                For build performance reasons
+                is very important that this bootstrap JDK be made available on the
+                local disk of the machine doing the build.
+                You should always set 
+                <tt><a href="#ALT_BOOTDIR">ALT_BOOTDIR</a></tt>
+                to point to the location of
+                the bootstrap JDK installation, this is the directory pathname
+                that contains a <tt>bin, lib, and include</tt>
+                It's also a good idea to also place its <tt>bin</tt> directory
+                in the <tt>PATH</tt> environment variable, although it's
+                not required.
+                <p>
+                <strong>Solaris:</strong>
+                Some pre-installed JDK images may be available to you in the
+                directory <tt>/usr/jdk/instances</tt>.
+                If you don't set
+                <tt><a href="#ALT_BOOTDIR">ALT_BOOTDIR</a></tt>
+                the makefiles will look in that location for a JDK it can use.
+            </blockquote>
+            <!-- ------------------------------------------------------ -->
+            <h4><a name="binaryplugs">Binary Plugs</a></h4>
+            <blockquote>
+                Not all of the source code that makes up the JDK is available
+                under an open-source license.
+                This is a temporary situation and these binary plugs will be
+                replaced with fully open source replacements as soon as possible.
+                So currently, in order to build a complete OpenJDK image,
+                you must first download and install the appropriate
+                binary plug bundles for the OpenJDK, go to the
+                <a href="http://openjdk.java.net" target="_blank">OpenJDK</a> site and select
+                the "<b>Bundles(7)</b>" link and download the binaryplugs for
+                your particular platform.
+                The file downloaded is a jar file that must be extracted by running
+                the jar file with:
+                <blockquote>
+                    <pre>
+            <tt><b>java -jar jdk-7-ea-plug-b<i>nn</i>-<i>os</i>-<i>arch</i>-<i>dd</i>_<i>month</i>_<i>year</i>.jar</b></tt>
+                    </pre>
+                </blockquote>
+                A prompt will be issued for acceptance of these binary plug files.
+                During the OpenJDK build process these "binary plugs"
+                for the encumbered components will be copied into your
+                resulting OpenJDK binary build image.
+                These binary plug files are only for the purpose of
+                building an OpenJDK binary.
+                Make sure you set
+                <tt><a href="#ALT_BINARY_PLUGS_PATH">ALT_BINARY_PLUGS_PATH</a></tt>
+                to the root of this installation.
+            </blockquote>
+            <!-- ------------------------------------------------------ -->
+            <h4><a name="importjdk">Optional Import JDK</a></h4>
+            <blockquote>
+                The <tt><a href="#ALT_JDK_IMPORT_PATH">ALT_JDK_IMPORT_PATH</a></tt>
+                setting is only needed if you are not building the entire
+                JDK. For example, if you have built the entire JDK once, and
+                wanted to avoid repeatedly building the Hotspot VM, you could
+                set this to the location of the previous JDK install image
+                and the build will copy the needed files from this import area.
+            </blockquote>
+            <!-- ------------------------------------------------------ -->
+            <h4><a name="cacerts">Certificate Authority File (cacert)</a></h4>
+            <blockquote>
+                See <a href="http://en.wikipedia.org/wiki/Certificate_Authority" target="_blank">
+                http://en.wikipedia.org/wiki/Certificate_Authority</a>
+                for a better understanding of the Certificate Authority (CA).
+                A certificates file named "cacerts"
+                represents a system-wide keystore with CA certificates. 
+                In JDK and JRE
+                binary bundles, the "cacerts" file contains root CA certificates from
+                several public CAs (e.g., VeriSign, Thawte, and Baltimore).
+                The source contain a cacerts file
+                without CA root certificates. 
+                Formal JDK builders will need to secure
+                permission from each public CA and include the certificates into their
+                own custom cacerts file. 
+                Failure to provide a populated cacerts file
+                will result in verification errors of a certificate chain during runtime.
+                The variable 
+                <tt><a href="#ALT_CACERTS_FILE">ALT_CACERTS_FILE</a></tt>
+                can be used to override the default location of the
+                cacerts file that will get placed in your build.
+                By default an empty cacerts file is provided and that should be
+                fine for most JDK developers.
+            </blockquote>
+            <!-- ------------------------------------------------------ -->
+            <h4><a name="compilers">Compilers</a></h4>
+            <blockquote>
+                <strong><a name="gcc">Linux gcc/binutils</a></strong>
+                <blockquote>
+                    The GNU gcc compiler version should be 3.2.2 or newer.
+                    The binutils package should be 2.11.93.0.2-11 or newer.
+                    The compiler used should be the default compiler installed
+                    in <tt>/usr/bin</tt>.
+                    <p>
+                    Older Linux systems may require a gcc and bunutils update.
+                    The Redhat Enterprise Advanced Server 2.1 update 2 system
+                    is one of these systems.
+                    RedHat Linux users can obtain this binutils package from 
+                    <a href="http://www.redhat.com" 
+                       target="_blank">Redhat web site</a>. 
+                    You will need to remove the default compiler and binutils
+                    packages and install the required packages
+                    into the default location on the system.
+                    However if you have a new video card driver, like 
+                    Geforce 4 it is best to use
+                    the same compiler as the kernel was built with to 
+                    build the new video card driver module.
+                    So you should build the modules before making this change.
+                </blockquote>
+                <strong><a name="studio">Solaris: Sun Studio</a></strong>
+                <blockquote>
+                    At a minimum, the
+                    <a href="http://developers.sun.com/sunstudio/index.jsp" target="_blank">
+                    Sun Studio 11 Compilers</a>
+                    (containing version 5.8 of the C and C++ compilers) is required,
+                    with patches from the
+                    <a href="http://sunsolve.sun.com/pub-cgi/show.pl?target=patches/patch-access" target="_blank">
+                    SunSolve web site</a>.
+                    <p> 
+                    Set 
+                    <a href="#ALT_COMPILER_PATH"><tt>ALT_COMPILER_PATH</tt></a>
+                    to point to the location of
+                    the compiler binaries, and place this location in the <tt>PATH</tt>.
+                    <p>
+                    The Sun Studio Express compilers at:
+                    <a href="http://developers.sun.com/sunstudio/downloads/express.jsp" target="_blank">
+                    Sun Studio Express Download site</a>
+                    are also an option, although these compilers have not
+                    been extensively used yet.
+                </blockquote>
+                <strong><a name="msvc">Windows i586: Microsoft Visual Studio .NET 2003 Professional</a></strong>
+                <blockquote>
+                    The 32-bit OpenJDK Windows build
+                    requires Microsoft Visual Studio .NET 2003 (VS2003) Professional
+                    Edition compiler. 
+                    The compiler and other tools are expected to reside
+                    in the location defined by the variable <tt>VS71COMNTOOLS</tt> which
+                    is set by the Microsoft Visual Studio .NET installer.
+                    <p> 
+                    Once the compiler is installed, 
+                    it is recommended that you run <tt>VCVARS32.BAT</tt> 
+                    to set the compiler environment variables
+                    <tt>MSVCDIR</tt>, 
+                    <tt>INCLUDE</tt>,
+                    <tt>LIB</tt>, and
+                    <tt>PATH</tt> 
+                    prior to building the 
+                    OpenJDK.
+                    The above environment variables <b>MUST</b> be set.
+                    <p>
+                    The Microsoft Visual Studio .NET 2005 (VS2005) compiler
+                    will not work at this time due to the new runtime dll
+                    and the manifest requirements.
+                </blockquote>
+                <strong><a name="mssdk">Windows X64: Microsoft Platform SDK April 2005</a></strong>
+                <blockquote>
+                    On <b>X64</b>, the Microsoft Platform Software
+                    Development Kit (SDK), April 2005 Edition compiler,
+                    is required for building the OpenJDK
+                    because it contains the C/C++ compiler. 
+                    You will need to minimally install the Core SDK and
+                    the MDAC SDK features of this compiler.
+                    <p>
+                    Once the Platform SDK is installed,
+                    it is recommended that you run <tt>SetEnv.Cmd /X64</tt> 
+                    to set the compiler environment variables
+                    <tt>MSSDK</tt>, 
+                    <tt>MSTOOLS</tt>,
+                    <tt>INCLUDE</tt>,
+                    <tt>LIB</tt>, and
+                    <tt>PATH</tt> 
+                    prior to building the 
+                    OpenJDK.
+                    The above environment variables <b>MUST</b> be set.
+                    <p>
+                    Note that this compiler may say it's version is a
+                    Microsoft Visual Studio .NET 2005 (VS2005), but be careful,
+                    it will not match the official VS2005 product.
+                    This Platform SDK compiler is only used on X64 builds.
+                </blockquote>
+            </blockquote>
+            <!-- ------------------------------------------------------ --> 
+            <h4><a name="zip">Zip and Unzip</a></h4>
+            <blockquote>
+                Version 2.2 (November 3rd 1997) or newer of the zip utility 
+                and version 5.12 or newer of the unzip utility is needed 
+                to build the JDK.
+                With Solaris, Linux, and Windows CYGWIN, the zip and unzip
+                utilities installed on the system should be fine.
+                Information and the source code for
+                ZIP.EXE and UNZIP.EXE is available on the
+                <a href="http://www.info-zip.org" 
+                   target="_blank">info-zip web site</a>.
+            </blockquote>
+            <!-- ------------------------------------------------------ -->
+            <h4><a name="cups">Common UNIX Printing System (CUPS) Headers (Solaris &amp; Linux)</a></h4>
+            <blockquote>
+                <strong>Solaris:</strong>
+                CUPS header files are required for building the 
+                OpenJDK on Solaris.
+                The Solaris header files can be obtained by installing 
+                the package <strong>SFWcups</strong> from the Solaris Software
+                Companion CD/DVD, these often will be installed into 
+                <tt>/opt/sfw/cups</tt>.
+                <p>
+                <strong>Linux:</strong>
+                CUPS header files are required for building the 
+                OpenJDK on Linux.
+                The Linux header files are usually available from a "cups"
+                development package, it's recommended that you try and use
+                the package provided by the particular version of Linux that
+                you are using.
+                <p>
+                The CUPS header files can always be downloaded from 
+                <a href="http://www.cups.org" target="_blank">www.cups.org</a>.
+                The variable 
+                <tt><a href="#ALT_CUPS_HEADERS_PATH">ALT_CUPS_HEADERS_PATH</a></tt>
+                can be used to override the default location of the
+                CUPS Header files.
+            </blockquote>
+            <!-- ------------------------------------------------------ -->
+            <h4><a name="freetype">FreeType 2</a></h4>
+            <blockquote>
+                Version 2.3 or newer of FreeType is required for building the OpenJDK.
+                On Unix systems required files can be available as part of your
+                distribution (while you still may need to upgrade them).
+                Note that you need development version of package that 
+                includes both FreeType library and header files.
+                <p>
+                You can always download latest FreeType version from the
+                <a href="http://www.freetype.org" target="_blank">FreeType website</a>.
+                <p>
+                Makefiles will try to pick FreeType from /usr/lib and /usr/include.
+                In case it is installed elsewhere you will need to set environment
+                variables 
+                <tt><a href="#ALT_FREETYPE_LIB_PATH">ALT_FREETYPE_LIB_PATH</a></tt>
+                and 
+                <tt><a href="#ALT_FREETYPE_HEADERS_PATH">ALT_FREETYPE_HEADERS_PATH</a></tt>
+                to refer to place where library and header files are installed.
+            </blockquote>    
+            <!-- ------------------------------------------------------ -->
+            <h4><a name="alsa">Advanced Linux Sound Architecture (ALSA) (Linux only)</a></h4>
+            <blockquote>
+                <strong>Linux only:</strong>
+                Version 0.9.1 or newer of the ALSA files are
+                required for building the OpenJDK on Linux.
+                These Linux files are usually available from an "alsa"
+                of "libasound"
+                development package, it's highly recommended that you try and use
+                the package provided by the particular version of Linux that
+                you are using.
+                The makefiles will check this emit a sanity error if it is
+                missing or the wrong version.
+                <p>
+                In particular, older Linux systems will likely not have the
+                right version of ALSA installed, for example
+                Redhat AS 2.1 U2 and SuSE 8.1 do not include a sufficiently 
+                recent ALSA distribution.
+                On rpm-based systems, you can see if ALSA is installed by 
+                running this command:
+                <pre>
+                    <tt>rpm -qa | grep alsa</tt>
+                </pre>
+                Both <tt>alsa</tt> and <tt>alsa-devel</tt> packages are needed.
+                <p> 
+                If your distribution does not come with ALSA, and you can't
+                find ALSA packages built for your particular system,
+                you can try to install the pre-built ALSA rpm packages from
+                <a href="http://www.freshrpms.net/" target="_blank">
+                <tt>www.freshrpms.net</tt></a>. 
+                Note that installing a newer ALSA could
+                break sound output if an older version of ALSA was previously
+                installed on the system, but it will enable JDK compilation.
+                <blockquote>
+                    Installation: execute as root<br>
+                    [i586]: <code>rpm -Uv --force alsa-lib-devel-0.9.1-rh61.i386.rpm</code><br>
+                    [x64]: <code>rpm -Uv --force alsa-lib-devel-0.9.8-amd64.x86_64.rpm</code><br>
+                    Uninstallation:<br>
+                    [i586]: <code>rpm -ev alsa-lib-devel-0.9.1-rh61</code><br>
+                    [x64]:<code>rpm -ev alsa-lib-devel-0.9.8-amd64</code><br>
+                    Make sure that you do not link to the static library
+                    (<tt>libasound.a</tt>),
+                    by verifying that the dynamic library (<tt>libasound.so</tt>) is
+                    correctly installed in <tt>/usr/lib</tt>.
+                </blockquote>
+                As a last resort you can go to the
+                <a href="http://www.alsa-project.org" target="_blank">
+                Advanced Linux Sound Architecture Site</a> and build it from
+                source.
+                <blockquote>
+                    Download driver and library
+                    source tarballs from 
+                    <a href="http://www.alsa-project.org" target="_blank">ALSA's homepage</a>. 
+                    As root, execute the following
+                    commands (you may need to adapt the version number):
+                    <pre>
+                        <tt>
+                            $ tar xjf alsa-driver-0.9.1.tar.bz2
+                            $ cd alsa-driver-0.9.1
+                            $ ./configure
+                            $ make install
+                            $ cd ..
+                            $ tar xjf alsa-lib-0.9.1.tar.bz2
+                            $ cd alsa-lib-0.9.1
+                            $ ./configure
+                            $ make install
+                        </tt>
+                    </pre>
+                    Should one of the above steps fail, refer to the documentation on
+                    ALSA's home page.
+                </blockquote>
+                Note that this is a minimum install that enables
+                building the JDK platform. To actually use ALSA sound drivers, more
+                steps are necessary as outlined in the documentation on ALSA's homepage.
+                <p>
+                ALSA can be uninstalled by executing <tt>make uninstall</tt> first in
+                the <tt>alsa-lib-0.9.1</tt> directory and then in 
+                <tt>alsa-driver-0.9.1</tt>.
+            </blockquote>
+            There are no ALT* variables to change the assumed locations of ALSA,
+            the makefiles will expect to find the ALSA include files and library at:
+            <tt>/usr/include/alsa</tt> and <tt>/usr/lib/libasound.so</tt>.
         </blockquote>
-        
-    </blockquote>
-    
-    <h4><a name="cups">Common UNIX Printing System (CUPS) Headers (Solaris &amp; Linux)</a></h4>
-    
-    <blockquote>
-        <p>
-        <strong>Solaris:</strong>
-        CUPS header files are required for building the 
-        OpenJDK on Solaris.
-        The Solaris header files can be obtained by installing 
-        the package <strong>SFWcups</strong> from the Solaris Software
-        Companion CD/DVD, these often will be installed into 
-        <tt>/opt/sfw/cups</tt>.
-        <p>
-        <strong>Linux:</strong>
-        CUPS header files are required for building the 
-        OpenJDK on Linux.
-        The Linux header files are usually available from a "cups"
-        development package, it's recommended that you try and use
-        the package provided by the particular version of Linux that
-        you are using.
-        <p>
-        The CUPS header files can always be downloaded from 
-        <a href="http://www.cups.org">www.cups.org</a>.
-        The variable 
-        <tt><a href="#ALT_CUPS_HEADERS_PATH">ALT_CUPS_HEADERS_PATH</a></tt>
-        can be used to override the default location of the
-        CUPS Header files.
-    </blockquote>
-    
-    <h4><a name="freetype">FreeType 2</a></h4>
-
-    <blockquote>
-        <p>
-        Version 2.3 or newer of FreeType is required for building the OpenJDK.
-        On Unix systems required files can be available as part of your
-        distribution (while you still may need to upgrade them).
-        Note that you need development version of package that 
-        includes both FreeType library and header files.
-        </p>
-        <p>
-        You can always download latest FreeType version from the
-        <a href="http://www.freetype.org">FreeType website</a>.
-        </p>
-        <p>
-        Makefiles will try to pick FreeType from /usr/lib and /usr/include.
-        In case it is installed elsewhere you will need to set environment
-        variables 
-        <tt><a href="#ALT_FREETYPE_LIB_PATH">ALT_FREETYPE_LIB_PATH</a></tt>
-        and 
-        <tt><a href="#ALT_FREETYPE_HEADERS_PATH">ALT_FREETYPE_HEADERS_PATH</a></tt>
-        to refer to place where library and header files are installed.
-        </p>
-    </blockquote>    
-
-    <h4><a name="alsa">Advanced Linux Sound Architecture (ALSA) (Linux only)</a></h4>
-    
-    <blockquote>
-        <p>
-        <strong>Linux only:</strong>
-        Version 0.9.1 or newer of the ALSA files are
-        required for building the 
-        OpenJDK on Linux.
-        These Linux files are usually available from an "alsa"
-        of "libasound"
-        development package, it's recommended that you try and use
-        the package provided by the particular version of Linux that
-        you are using.
-        The makefiles will check this emit a sanity error if it is
-        missing or the wrong version.
-        As a last resort you can go to the
-        <a href="http://www.alsa-project.org" target="_blank">
-        Advanced Linux Sound Architecture Site</a>.
-    </blockquote>
-    
-    <h4>Windows Specific Dependencies</h4>
-    
-    <blockquote>
-        
-        <strong>Unix Command Tools (<a name="cygwin">CYGWIN</a>)</strong>
-        
-        <blockquote> 
-            <p>
-            The 
-            OpenJDK
-            requires access to a set of unix command tools
-            on Windows which can be supplied by 
-            <a href="http://www.cygwin.com">CYGWIN</a>. 
-            <p>
-            The 
-            OpenJDK 
-            build
-            requires CYGWIN version 1.5.12 or newer. 
-            Information about CYGWIN can
-            be obtained from the CYGWIN website at 
-            <a href="http://www.cygwin.com">www.cygwin.com</a>. 
-            <p>
-            By default CYGWIN doesn't install all the tools required for building
-            the OpenJDK.
-            Along with the default installation, you need to install
-            the following tools.
+        <!-- ------------------------------------------------------ -->
+        <h4>Windows Specific Dependencies</h4>
+        <blockquote>
+            <strong>Unix Command Tools (<a name="cygwin">CYGWIN</a>)</strong>
+            <blockquote> 
+                The OpenJDK requires access to a set of unix command tools
+                on Windows which can be supplied by 
+                <a href="http://www.cygwin.com" target="_blank">CYGWIN</a>. 
+                <p>
+                The OpenJDK build requires CYGWIN version 1.5.12 or newer. 
+                Information about CYGWIN can
+                be obtained from the CYGWIN website at 
+                <a href="http://www.cygwin.com" target="_blank">www.cygwin.com</a>. 
+                <p>
+                By default CYGWIN doesn't install all the tools required for building
+                the OpenJDK.
+                Along with the default installation, you need to install
+                the following tools.
+                <blockquote>
+                    <table border="1">
+                        <thead>
+                            <tr>
+                                <td>Binary Name</td>
+                                <td>Package</td>
+                                <td>Description</td>
+                            </tr>
+                        </thead>
+                        <tbody>
+                            <tr>
+                                <td>ar.exe</td>
+                                <td>Devel</td>
+                                <td>binutils: The GNU assembler, linker and binary
+                                utilities</td>
+                            </tr>
+                            <tr>
+                                <td>make.exe</td>
+                                <td>Devel</td>
+                                <td>make: The GNU version of the 'make' utility</td>
+                            </tr>
+                            <tr>
+                                <td>m4.exe</td>
+                                <td>Interpreters</td>
+                                <td>m4: GNU implementation of the traditional Unix macro
+                                processor</td>
+                            </tr>
+                            <tr>
+                                <td>cpio.exe</td>
+                                <td>Utils</td>
+                                <td>cpio: A program to manage archives of files</td>
+                            </tr>
+                            <tr>
+                                <td>awk.exe</td>
+                                <td>Utils</td>
+                                <td>awk: Pattern-directed scanning and processing language</td>
+                            </tr>
+                            <tr>
+                                <td>file.exe</td>
+                                <td>Utils</td>
+                                <td>file: Determines file type using 'magic' numbers</td>
+                            </tr>
+                            <tr>
+                                <td>zip.exe</td>
+                                <td>Utils</td>
+                                <td>zip: Package and compress (archive) files</td>
+                            </tr>
+                            <tr>
+                                <td>unzip.exe</td>
+                                <td>Utils</td>
+                                <td>unzip: Extract compressed files in a ZIP archive</td>
+                            </tr>
+                            <tr>
+                                <td>free.exe</td>
+                                <td>Utils</td>
+                                <td>free: Display amount of free and used memory in the system</td>
+                            </tr>
+                        </tbody>
+                    </table>
+                </blockquote>
+                <p>
+                Note that the CYGWIN software can conflict with other non-CYGWIN
+                software on your Windows system.
+                CYGWIN provides a
+                <a href="http://cygwin.com/faq/faq.using.html" target="_blank">FAQ</a> for
+                known issues and problems, of particular interest is the
+                section on
+                <a href="http://cygwin.com/faq/faq.using.html#faq.using.bloda" target="_blank">
+                BLODA (applications that interfere with CYGWIN)</a>.
+            </blockquote>
+            <strong><a name="dxsdk">Microsoft DirectX 9.0 SDK header files and libraries</a></strong>
             <blockquote>
-                <table border="1">
-                    <thead>
-                        <tr>
-                            <td>Binary Name</td>
-                            <td>Package</td>
-                            <td>Description</td>
-                        </tr>
-                    </thead>
-                    <tbody>
-                        <tr>
-                            <td>ar.exe</td>
-                            <td>Devel</td>
-                            <td>binutils: The GNU assembler, linker and binary
-                            utilities</td>
-                        </tr>
-                        <tr>
-                            <td>make.exe</td>
-                            <td>Devel</td>
-                            <td>make: The GNU version of the 'make' utility</td>
-                        </tr>
-                        <tr>
-                            <td>m4.exe</td>
-                            <td>Interpreters</td>
-                            <td>m4: GNU implementation of the traditional Unix macro
-                            processor</td>
-                        </tr>
-                        <tr>
-                            <td>cpio.exe</td>
-                            <td>Utils</td>
-                            <td>cpio: A program to manage archives of files</td>
-                        </tr>
-                        <tr>
-                            <td>file.exe</td>
-                            <td>Utils</td>
-                            <td>file: Determines file type using 'magic' numbers</td>
-                        </tr>
-                    </tbody>
-                </table>
+                Microsoft DirectX 9.0 SDK (Summer 2004)
+                headers are required for building
+                OpenJDK.
+                This SDK can be downloaded from 
+                <a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=FD044A42-9912-42A3-9A9E-D857199F888E&amp;displaylang=en" target="_blank">
+                Microsoft DirectX 9.0 SDK (Summer 2004)</a>.
+                If the link above becomes obsolete, the SDK can be found from 
+                <a href="http://download.microsoft.com" target="_blank">the Microsoft Download Site</a>
+                (search with "DirectX 9.0 SDK Update Summer 2004"). 
+                The location of this SDK can be set with 
+                <tt><a href="#ALT_DXSDK_PATH">ALT_DXSDK_PATH</a></tt>
+                but it's normally found via the DirectX environment variable
+                <tt>DXSDK_DIR</tt>.
+            </blockquote>
+            <strong><a name="msvcrt"><tt>MSVCRT.DLL</tt></a></strong>
+            <blockquote> 
+                <strong>i586 only:</strong>
+                The OpenJDK 32bit build requires access to
+                <tt>MSVCRT.DLL</tt> version 6.00.8337.0 or newer.
+                If the <tt>MSVCRT.DLL</tt> is not installed in 
+                the system32 directory set the 
+                <a href="#ALT_MSVCRT_DLL_PATH"><tt>ALT_MSVCRT_DLL_PATH</tt></a>
+                variable to the location.
+                <p> 
+                <strong>X64 only:</strong>
+                The OpenJDK 64bit build requires access to
+                <tt>MSVCRT.DLL</tt> version 7.0.3790.0 or newer, which is
+                usually supplied by the
+                <a href="#mssdk">Platform SDK</a>.
+                If it is not available from the Platform SDK,
+                set the 
+                <a href="#ALT_MSVCRT_DLL_PATH"><tt>ALT_MSVCRT_DLL_PATH</tt></a>
+                variable to the location.
+            </blockquote>
+            <strong><tt><a name="msvcr71">MSVCR71.DLL</a></tt></strong>
+            <blockquote>
+                <strong>i586 only:</strong>
+                The 
+                OpenJDK
+                build requires access to 
+                MSVCR71.DLL version 7.10.3052.4 or newer which should be
+                supplied by the
+                <a href="#msvc">Visual Studio product</a>
+                If the <tt>MSVCR71.DLL</tt> is not available from the
+                Visual Studio product
+                set the 
+                <a href="#ALT_MSVCR71_DLL_PATH"><tt>ALT_MSVCR71_DLL_PATH</tt></a>
+                variable to the location.
             </blockquote>
         </blockquote>
-        
-        <a name="dxsdk">
-            <strong>Microsoft DirectX 9.0 SDK header files and libraries</strong>
-        </a>
-        
+        <!-- ------------------------------------------------------ -->
+        <hr>
+        <h2><a name="creating">Creating the Build</a></h2>
         <blockquote>
-            <p>
-            Microsoft DirectX 9.0 SDK (Summer 2004)
-            headers are required for building
-            OpenJDK.
-            This SDK can be downloaded from 
-            <a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=FD044A42-9912-42A3-9A9E-D857199F888E&amp;displaylang=en">
-            Microsoft DirectX 9.0 SDK (Summer 2004)</a>.
-            If the link above becomes obsolete, the SDK can be found from 
-            <a href="http://download.microsoft.com">the Microsoft Download Site</a>
-            (search with "DirectX 9.0 SDK Update Summer 2004"). 
-            The location of this SDK can be set with 
-            <tt><a href="#ALT_DXSDK_PATH">ALT_DXSDK_PATH</a></tt>
-            but it's normally found via the DirectX environment variable
-            <tt>DXSDK_DIR</tt>.
-        </blockquote>
-        
-        <a name="msvcrt">
-            <strong><tt>MSVCRT.DLL</tt></strong>
-        </a>
-        
-        <blockquote> 
+            Once a machine is setup to build the OpenJDK,
+            the steps to create the build are fairly simple.
+            The various ALT settings can either be made into  variables
+            or can be supplied on the 
+            <a href="#gmake"><tt><i>gmake</i></tt></a> 
+            command.
+            <ol>
+                <li>Use the sanity rule to double check all the ALT settings:
+                    <blockquote>
+                        <tt>
+                            <i>gmake</i> 
+                            sanity
+                            [ARCH_DATA_MODEL=<i>32 or 64</i>]
+                            [other "ALT_" overrides]
+                        </tt>
+                    </blockquote>
+                </li>
+                <li>Start the build with the command:
+                    <blockquote>
+                        <tt>
+                            <i>gmake</i> 
+                            [ARCH_DATA_MODEL=<i>32 or 64</i>]
+                            [ALT_OUTPUTDIR=<i>output_directory</i>] 
+                            [other "ALT_" overrides] 
+                        </tt>
+                    </blockquote>
+                </li>
+            </ol>
             <p>
-            <strong>i586 only:</strong>
-            The 
-            OpenJDK
-            32bit build requires
-            access to <tt>MSVCRT.DLL</tt> 
-            version 6.00.8337.0 or newer.
-            If the <tt>MSVCRT.DLL</tt> is not installed in 
-            the system32 directory set the 
-            <a href="#ALT_MSVCRT_DLL_PATH"><tt>ALT_MSVCRT_DLL_PATH</tt></a>
-            variable to the location.
-            <p> 
-            <strong>X64 only:</strong>
-            The OpenJDK 64bit build requires access to
-            <tt>MSVCRT.DLL</tt> version 7.0.3790.0 or newer, which is
-            usually supplied by the
-            <a href="#mssdk">Platform SDK</a>.
-            If it is not available from the Platform SDK,
-            set the 
-            <a href="#ALT_MSVCRT_DLL_PATH"><tt>ALT_MSVCRT_DLL_PATH</tt></a>
-            variable to the location.
+            <strong>Solaris:</strong>
+            Note that ARCH_DATA_MODEL is really only needed on Solaris to
+            indicate you want to built the 64-bit version.
+            And before the Solaris 64-bit binaries can be used, they
+            must be merged with the binaries from a separate 32-bit build. 
+            The merged binaries may then be used in either 32-bit or 64-bit mode, with
+            the selection occurring at runtime 
+            with the <tt>-d32</tt> or <tt>-d64</tt> options. 
         </blockquote>
-        
-        <a name="msvcr71">
-            <strong><tt>MSVCR71.DLL</tt></strong>
-        </a>
-        
+        <!-- ------------------------------------------------------ -->
+        <hr>
+        <h2><a name="testing">Testing the Build</a></h2>
         <blockquote>
+            When the build is completed, you should see the generated
+            binaries and associated files in the <tt>j2sdk-image</tt> 
+            directory in the output directory. 
+            The default output directory is
+            <tt>build/<i>platform</i></tt>,
+            where <tt><i>platform</i></tt> is one of
+            <tt><ul>
+                    <li>solaris-sparc</li>
+                    <li>solaris-sparcv9</li>
+                    <li>solaris-i586</li>
+                    <li>solaris-amd64</li>
+                    <li>linux-i586</li>
+                    <li>linux-amd64</li>
+                    <li>windows-i586</li>
+                    <li>windows-amd64</li>
+            </ul></tt>
+            In particular, the 
+            <tt>build/<i>platform</i>/j2sdk-image/bin</tt>
+            directory should contain executables for the 
+            OpenJDK tools and utilities.
             <p>
-            <strong>i586 only:</strong>
-            The 
-            OpenJDK
-            build requires access to 
-            MSVCR71.DLL version 7.10.3052.4 or newer which should be
-            supplied by the
-            <a href="#msvc">Visual Studio product</a>
-            If the <tt>MSVCR71.DLL</tt> is not available from the
-            Visual Studio product
-            set the 
-            <a href="#ALT_MSVCR71_DLL_PATH"><tt>ALT_MSVCR71_DLL_PATH</tt></a>
-            variable to the location.
+            You can test that the build completed properly by using the build
+            to run the various demos that you will find in the 
+            <tt>build/<i>platform</i>/j2sdk-image/demo</tt>
+            directory.
+            <p>
+            The provided regression tests can be run with the <tt>jtreg</tt>
+            utility from 
+            <a href="http://openjdk.java.net/jtreg/" target="_blank">the jtreg site</a>.
         </blockquote>
-        
-    </blockquote>
-    
-    
-</blockquote>
-
-
-<hr noshade="noshade" size="3">
-
-<h2><a name="creating">Creating the Build</a></h2>
-
-<blockquote>
-    <p>
-    Once a machine is setup to build the 
-    OpenJDK,
-    the steps to create the
-    build are fairly simple.
-    The various ALT settings can either be made into  variables
-    or can be supplied on the 
-    <a href="#gmake"><tt><i>gmake</i></tt></a> 
-    command.
-    <p>
-    <ol>
-        <li>Use the sanity rule to double check all the ALT settings:
-            <blockquote>
-                <tt>
-                    <i>gmake</i> 
-                    sanity
-                    [ARCH_DATA_MODEL=<i>32 or 64</i>]
-                    [other "ALT_" overrides]
-                </tt>
-            </blockquote>
-        </li>
-        <li>Start the build with the command:
-            <blockquote>
-                <tt>
-                    <i>gmake</i> 
-                    [ARCH_DATA_MODEL=<i>32 or 64</i>]
-                    [ALT_OUTPUTDIR=<i>output_directory</i>] 
-                    [other "ALT_" overrides] 
-                </tt>
-            </blockquote>
-        </li>
-    </ol>
-    <p>
-    <strong>Solaris:</strong>
-    Note that ARCH_DATA_MODEL is really only needed on Solaris to
-    indicate you want to built the 64-bit version.
-    And before the Solaris 64-bit binaries can be used, they
-    must be merged with the binaries from a separate 32-bit build. 
-    The merged binaries may then be used in either 32-bit or 64-bit mode, with
-    the selection occurring at runtime 
-    with the <tt>-d32</tt> or <tt>-d64</tt> options. 
-</blockquote>
-
-<!-- ------------------------------------------------------ -->
-<hr noshade="noshade" size="3">
-
-<h2><a name="testing">Testing the Build</a></h2>
-
-<blockquote>
-    <p>
-    When the build is completed, you should see the generated
-    binaries and associated files in the <tt>j2sdk-image</tt> 
-    directory in the output directory. 
-    The default output directory is
-    <tt>build/<i>platform</i></tt>,
-    where <tt><i>platform</i></tt> is one of
-    <tt><ul>
-            <li>solaris-sparc</li>
-            <li>solaris-sparcv9</li>
-            <li>solaris-i586</li>
-            <li>solaris-amd64</li>
-            <li>linux-i586</li>
-            <li>linux-amd64</li>
-            <li>windows-i586</li>
-            <li>windows-amd64</li>
-    </ul></tt>
-    In particular, the 
-    <tt>build/<i>platform</i>/j2sdk-image/bin</tt>
-    directory should contain executables for the 
-    OpenJDK
-    tools and utilities.
-    <p>
-    You can test that the build completed properly by using the build
-    to run the various demos that you will find in the 
-    <tt>build/<i>platform</i>/j2sdk-image/demo</tt>
-    directory.
-    <p>
-    The provided regression tests can be run with the <tt>jtreg</tt>
-    utility from 
-    <a href="http://openjdk.java.net/jtreg/">the jtreg site</a>.
-</blockquote>
-
-<!-- ------------------------------------------------------ -->
-<hr noshade="noshade" size="3">
-
-<h2><a name="variables">Environment/Make Variables</a></h2>
-
-<p>
-Some of the
-environment or make variables (just called <b>variables</b> in this
-document) that can impact the build are:
-
-<blockquote>
-    
-    <dl>
-        
-        <dt><a name="path"><tt>PATH</tt></a> </dt>
-        <dd>Typically you want to set the <tt>PATH</tt> to include:
-            <ul>
-                <li>The location of the GNU make binary</li>
-                <li>The location of the JDK 6 <tt>java</tt> 
-                (see <a href="#bootjdk">Bootstrap JDK</a>)</li>
-                <li>The location of the C/C++ compilers 
-                (see <a href="#compilers"><tt>compilers</tt></a>)</li>
-                <li>The location or locations for the Unix command utilities
-                (e.g. <tt>/usr/bin</tt>)</li>
-            </ul>
-        </dd>
-        
-        <dt><a name="arch_data_model"><tt>ARCH_DATA_MODEL</tt></a></dt>
-        <dd>The <tt>ARCH_DATA_MODEL</tt> variable
-            is used to specify whether the build is to generate 32-bit or 64-bit
-            binaries. 
-            The Solaris build supports either 32-bit or 64-bit builds, but
-            Windows and Linux will support only one, depending on the specific
-            OS being used.
-            Normally, setting this variable is only necessary on Solaris.
-            Set <tt>ARCH_DATA_MODEL</tt> to <tt>32</tt> for generating 32-bit binaries, 
-            or to <tt>64</tt> for generating 64-bit binaries.
-        </dd>
-        
-        <dt><a name="ALT_BOOTDIR"><tt>ALT_BOOTDIR</tt></a></dt>
-        <dd>
-            The location of the bootstrap JDK installation. 
-            See <a href="#bootjdk">Bootstrap JDK</a> for more information.
-            You should always install your own local Bootstrap JDK and
-            always set <tt>ALT_BOOTDIR</tt> explicitly.
-        </dd>
-        
-        <dt><a name="ALT_OUTPUTDIR"><tt>ALT_OUTPUTDIR</tt></a> </dt>
-        <dd>
-            An override for specifying the (absolute) path of where the
-            build output is to go.
-            The default output directory will be build/<i>platform</i>.
-        </dd>
-        
-        <dt><a name="ALT_COMPILER_PATH"><tt>ALT_COMPILER_PATH</tt></a> </dt>
-        <dd>
-            The location of the C/C++ compiler.
-            The default varies depending on the platform. 
-        </dd>
-        
-        <dt><tt><a name="ALT_CACERTS_FILE">ALT_CACERTS_FILE</a></tt></dt>
-        <dd>
-            The location of the <a href="#cacerts">cacerts</a> file.
-            The default will refer to 
-            <tt>jdk/src/share/lib/security/cacerts</tt>.
-        </dd>
-        
-        <dt><a name="ALT_BINARY_PLUGS_PATH"><tt>ALT_BINARY_PLUGS_PATH</tt></a></dt>
-        <dd>
-            The location of the binary plugs installation.
-            See <a href="#binaryplugs">Binary Plugs</a> for more information.
-            You should always have a local copy of a
-            recent Binary Plugs install image
-            and set this variable to that location.
-        </dd>
-        
-        <dt><a name="ALT_CUPS_HEADERS_PATH"><tt>ALT_CUPS_HEADERS_PATH</tt></a> </dt>
-        <dd>
-            The location of the CUPS header files.
-            See <a href="#cups">CUPS information</a> for more information.
-            If this path does not exist the fallback path is 
-            <tt>/usr/include</tt>.
-        </dd>
-        
-        
-        <dt><a name="ALT_FREETYPE_LIB_PATH"><tt>ALT_FREETYPE_LIB_PATH</tt></a></dt>
-        <dd>
-            The location of the FreeType shared library. 
-            See <a href="#freetype">FreeType information</a> for details. 
-        </dd>
-        
-        <dt><a name="ALT_FREETYPE_HEADERS_PATH"><tt>ALT_FREETYPE_HEADERS_PATH</tt></a></dt>
-        <dd>
-            The location of the FreeType header files.
-            See <a href="#freetype">FreeType information</a> for details. 
-        </dd>
-        
-        <dt><strong>Windows specific:</strong></dt>
-        <dd>
+        <!-- ------------------------------------------------------ -->
+        <hr>
+        <h2><a name="variables">Environment/Make Variables</a></h2>
+        <p>
+        Some of the
+        environment or make variables (just called <b>variables</b> in this
+        document) that can impact the build are:
+        <blockquote>
             <dl>
-                <dt><a name="ALT_MSDEVTOOLS_PATH"><tt>ALT_MSDEVTOOLS_PATH</tt></a> </dt>
+                <dt><a name="path"><tt>PATH</tt></a> </dt>
+                <dd>Typically you want to set the <tt>PATH</tt> to include:
+                    <ul>
+                        <li>The location of the GNU make binary</li>
+                        <li>The location of the Bootstrap JDK <tt>java</tt> 
+                        (see <a href="#bootjdk">Bootstrap JDK</a>)</li>
+                        <li>The location of the C/C++ compilers 
+                        (see <a href="#compilers"><tt>compilers</tt></a>)</li>
+                        <li>The location or locations for the Unix command utilities
+                        (e.g. <tt>/usr/bin</tt>)</li>
+                    </ul>
+                </dd>
+                <dt><tt>MILESTONE</tt> </dt>
+                <dd>
+                    The milestone name for the build (<i>e.g.</i>"beta"). 
+                    The default value is "internal".
+                </dd>
+                <dt><tt>BUILD_NUMBER</tt> </dt>
+                <dd>
+                    The build number for the build (<i>e.g.</i> "b27"). 
+                    The default value is "b00".
+                </dd>
+                <dt><a name="arch_data_model"><tt>ARCH_DATA_MODEL</tt></a></dt>
+                <dd>The <tt>ARCH_DATA_MODEL</tt> variable
+                    is used to specify whether the build is to generate 32-bit or 64-bit
+                    binaries. 
+                    The Solaris build supports either 32-bit or 64-bit builds, but
+                    Windows and Linux will support only one, depending on the specific
+                    OS being used.
+                    Normally, setting this variable is only necessary on Solaris.
+                    Set <tt>ARCH_DATA_MODEL</tt> to <tt>32</tt> for generating 32-bit binaries, 
+                    or to <tt>64</tt> for generating 64-bit binaries.
+                </dd>
+                <dt><a name="ALT_BOOTDIR"><tt>ALT_BOOTDIR</tt></a></dt>
+                <dd>
+                    The location of the bootstrap JDK installation. 
+                    See <a href="#bootjdk">Bootstrap JDK</a> for more information.
+                    You should always install your own local Bootstrap JDK and
+                    always set <tt>ALT_BOOTDIR</tt> explicitly.
+                </dd>
+                <dt><a name="ALT_BINARY_PLUGS_PATH"><tt>ALT_BINARY_PLUGS_PATH</tt></a></dt>
                 <dd>
-                    The location of the Microsoft Visual Studio .NET 2003
-                    tools 'bin' directory.
-                    The default is usually derived from
-                    <a href="#ALT_COMPILER_PATH"><tt>ALT_COMPILER_PATH</tt></a>.
+                    The location of the binary plugs installation.
+                    See <a href="#binaryplugs">Binary Plugs</a> for more information.
+                    You should always have a local copy of a
+                    recent Binary Plugs install image
+                    and set this variable to that location.
+                </dd>
+                <dt><a name="ALT_JDK_IMPORT_PATH"><tt>ALT_JDK_IMPORT_PATH</tt></a></dt>
+                <dd>
+                    The location of a previously built JDK installation. 
+                    See <a href="#importjdk">Optional Import JDK</a> for more information.
+                </dd>
+                <dt><a name="ALT_OUTPUTDIR"><tt>ALT_OUTPUTDIR</tt></a> </dt>
+                <dd>
+                    An override for specifying the (absolute) path of where the
+                    build output is to go.
+                    The default output directory will be build/<i>platform</i>.
+                </dd>
+                <dt><a name="ALT_COMPILER_PATH"><tt>ALT_COMPILER_PATH</tt></a> </dt>
+                <dd>
+                    The location of the C/C++ compiler.
+                    The default varies depending on the platform. 
                 </dd>
-                
-                <dt><tt><a name="ALT_DXSDK_PATH">ALT_DXSDK_PATH</a></tt> </dt>
+                <dt><tt><a name="ALT_CACERTS_FILE">ALT_CACERTS_FILE</a></tt></dt>
+                <dd>
+                    The location of the <a href="#cacerts">cacerts</a> file.
+                    The default will refer to 
+                    <tt>jdk/src/share/lib/security/cacerts</tt>.
+                </dd>
+                <dt><a name="ALT_CUPS_HEADERS_PATH"><tt>ALT_CUPS_HEADERS_PATH</tt></a> </dt>
+                <dd>
+                    The location of the CUPS header files.
+                    See <a href="#cups">CUPS information</a> for more information.
+                    If this path does not exist the fallback path is 
+                    <tt>/usr/include</tt>.
+                </dd>
+                <dt><a name="ALT_FREETYPE_LIB_PATH"><tt>ALT_FREETYPE_LIB_PATH</tt></a></dt>
+                <dd>
+                    The location of the FreeType shared library. 
+                    See <a href="#freetype">FreeType information</a> for details. 
+                </dd>
+                <dt><a name="ALT_FREETYPE_HEADERS_PATH"><tt>ALT_FREETYPE_HEADERS_PATH</tt></a></dt>
+                <dd>
+                    The location of the FreeType header files.
+                    See <a href="#freetype">FreeType information</a> for details. 
+                </dd>
+                <dt><a name="ALT_JDK_DEVTOOLS_PATH"><tt>ALT_JDK_DEVTOOLS_PATH</tt></a></dt>
+                <dd>
+                    The default root location of the devtools.
+                    The default value is 
+                    <tt>$(ALT_SLASH_JAVA)/devtools</tt>.
+                </dd>
+                <dt><tt><a name="ALT_DEVTOOLS_PATH">ALT_DEVTOOLS_PATH</a></tt> </dt>
                 <dd>
-                    The location of the 
-                    <a href="#dxsdk">Microsoft DirectX 9 SDK</a>.
-                    The default will be to try and use the DirectX environment
-                    variable <tt>DXSDK_DIR</tt>,
-                    failing that, look in <tt>C:/DXSDK</tt>.
+                    The location of tools like the 
+                    <a href="#zip"><tt>zip</tt> and <tt>unzip</tt></a>
+                    binaries, but might also contain the GNU make utility
+                    (<tt><i>gmake</i></tt>).
+                    So this area is a bit of a grab bag, especially on Windows.
+                    The default value depends on the platform and
+                    Unix Commands being used.
+                    On Linux the default will be 
+                    <tt>$(ALT_JDK_DEVTOOLS_PATH)/linux/bin</tt>, 
+                    on Solaris
+                    <tt>$(ALT_JDK_DEVTOOLS_PATH)/<i>{sparc,i386}</i>/bin</tt>, 
+                    on Windows with MKS
+                    <tt>%SYSTEMDRIVE%/UTILS</tt>, 
+                    and on Windows with CYGWIN
+                    <tt>/usr/bin</tt>.
                 </dd>
-                
-                <dt><tt><a name="ALT_MSVCRT_DLL_PATH">ALT_MSVCRT_DLL_PATH</a></tt> </dt>
+                <dt><a name="ALT_UNIXCOMMAND_PATH"><tt>ALT_UNIXCOMMAND_PATH</tt></a> </dt>
+                <dd>
+                    An override for specifying where the
+                    Unix command set are located. 
+                    The default location varies depending on the platform,
+                    <tt>"%SYSTEMDRIVE%/MKSNT"</tt> or
+                    <tt>$(ROOTDIR)</tt> on Windows with MKS, otherwise it's 
+                    <tt>"/bin"</tt> or <tt>/usr/bin</tt>.
+                </dd>
+                <dt><a name="ALT_UNIXCCS_PATH"><tt>ALT_UNIXCCS_PATH</tt></a></dt>
+                <dd>
+                    <strong>Solaris only:</strong>
+                    An override for specifying where the Unix CCS
+                    command set are located.
+                    The default location is <tt>/usr/ccs/bin</tt> 
+                </dd>
+                <dt><a name="ALT_USRBIN_PATH"><tt>ALT_USRBIN_PATH</tt></a></dt>
+                <dd>
+                    An override for specifying where the
+                    Unix <tt>/usr/bin</tt> commands are located. You usually do not need
+                    to set this variable: the default location is <tt>/usr/bin</tt>)
+                </dd>
+                <dt><a name="ALT_SLASHJAVA"><tt>ALT_SLASHJAVA</tt></a></dt>
+                <dd>
+                    The default root location for many of the ALT path locations
+                    of the following ALT variables.
+                    The default value is 
+                    <tt>"/java"</tt> on Solaris and Linux, 
+                    <tt>"J:"</tt> on Windows.
+                </dd>
+                <dt><a name="ALT_BUILD_JDK_IMPORT_PATH"><tt>ALT_BUILD_JDK_IMPORT_PATH</tt></a></dt>
                 <dd>
-                    The location of the 
-                    <a href="#msvcrt"><tt>MSVCRT.DLL</tt></a>. 
+                    These are useful in managing builds on multiple platforms.
+                    The default network location for all of the import JDK images
+                    for all platforms. 
+                    If <tt><a href="#ALT_JDK_IMPORT_PATH">ALT_JDK_IMPORT_PATH</a></tt>
+                    is not set, this directory will be used and should contain 
+                    the following directories:
+                    <tt>solaris-sparc</tt>,
+                    <tt>solaris-i586</tt>,
+                    <tt>solaris-sparcv9</tt>,
+                    <tt>solaris-amd64</tt>,
+                    <tt>linux-i586</tt>,
+                    <tt>linux-amd64</tt>,
+                    <tt>windows-i586</tt>,
+                    and
+                    <tt>windows-amd64</tt>.
+                    Where each of these directories contain the import JDK image
+                    for that platform.
                 </dd>
-                
-                <dt><tt><a name="ALT_MSVCR71_DLL_PATH">ALT_MSVCR71_DLL_PATH</a></tt> </dt>
+                <dt><a name="ALT_BUILD_BINARY_PLUGS_PATH"><tt>ALT_BUILD_BINARY_PLUGS_PATH</tt></a></dt>
+                <dd>
+                    These are useful in managing builds on multiple platforms.
+                    The default network location for all of the binary plug images
+                    for all platforms. 
+                    If <tt><a href="#ALT_BINARY_PLUGS_PATH">ALT_BINARY_PLUGS_PATH</a></tt>
+                    is not set, this directory will be used and should contain 
+                    the following directories:
+                    <tt>solaris-sparc</tt>,
+                    <tt>solaris-i586</tt>,
+                    <tt>solaris-sparcv9</tt>,
+                    <tt>solaris-amd64</tt>,
+                    <tt>linux-i586</tt>,
+                    <tt>linux-amd64</tt>,
+                    <tt>windows-i586</tt>,
+                    and
+                    <tt>windows-amd64</tt>.
+                    Where each of these directories contain the binary plugs image
+                    for that platform.
+                </dd>
+                <dt><strong>Windows specific:</strong></dt>
                 <dd>
-                    <strong>i586 only:</strong>
-                    The location of the 
-                    <a href="#msvcr71"><tt>MSVCR71.DLL</tt></a>. 
+                    <dl>
+                        <dt><a name="ALT_MSDEVTOOLS_PATH"><tt>ALT_MSDEVTOOLS_PATH</tt></a> </dt>
+                        <dd>
+                            The location of the Microsoft Visual Studio .NET 2003
+                            tools 'bin' directory.
+                            The default is usually derived from
+                            <a href="#ALT_COMPILER_PATH"><tt>ALT_COMPILER_PATH</tt></a>.
+                        </dd>
+                        <dt><tt><a name="ALT_DXSDK_PATH">ALT_DXSDK_PATH</a></tt> </dt>
+                        <dd>
+                            The location of the 
+                            <a href="#dxsdk">Microsoft DirectX 9 SDK</a>.
+                            The default will be to try and use the DirectX environment
+                            variable <tt>DXSDK_DIR</tt>,
+                            failing that, look in <tt>C:/DXSDK</tt>.
+                        </dd>
+                        <dt><tt><a name="ALT_MSVCRT_DLL_PATH">ALT_MSVCRT_DLL_PATH</a></tt> </dt>
+                        <dd>
+                            The location of the 
+                            <a href="#msvcrt"><tt>MSVCRT.DLL</tt></a>. 
+                        </dd>
+                        <dt><tt><a name="ALT_MSVCR71_DLL_PATH">ALT_MSVCR71_DLL_PATH</a></tt> </dt>
+                        <dd>
+                            <strong>i586 only:</strong>
+                            The location of the 
+                            <a href="#msvcr71"><tt>MSVCR71.DLL</tt></a>. 
+                        </dd>
+                    </dl>
                 </dd>
             </dl>
-        </dd>
-        
-    </dl>
-</blockquote>
-
-<!-- ------------------------------------------------------ -->
-<hr noshade="noshade" size="3">
-
-<h2><a name="troubleshooting">Troubleshooting</a></h2>
-
-<blockquote>
-    <p>
-    A build can fail for any number of reasons. 
-    Most failures
-    are a result of trying to build in an environment in which all the
-    pre-build requirements have not been met. 
-    The first step in
-    troubleshooting a build failure is to recheck that you have satisfied
-    all the pre-build requirements for your platform.
-    Look for the check list of the platform you are building on in the
-    <a href="#contents">Table of Contents</a>.
-    
-    <p>
-    You can validate your build environment by using the <tt>sanity</tt>
-    target.
-    Any errors listed
-    will stop the build from starting, and any warnings may result in
-    a flawed product build.
-    We strongly encourage you to evaluate every
-    sanity check warning and fix it if required, before you proceed
-    further with your build.
-    
-    <p>
-    Some of the more common problems with builds are briefly described
-    below, with suggestions for remedies.
-    
-    <ul>
-        <li>
-            <b>Slow Builds:</b>
-            <blockquote>
-                <p>
-                If your build machine seems to be overloaded from too many
-                simultaneous C++ compiles, try setting the <tt>HOTSPOT_BUILD_JOBS</tt>
-                variable to <tt>1</tt> (if you're using a multiple CPU
-                machine, setting it to more than the the number of CPUs is probably
-                not a good idea).
-                <p>
-                Creating the javadocs can be very slow, if you are running
-                javadoc, consider skipping that step.
-                <p>
-                Faster hardware and more RAM always helps too.
-                The VM build tends to be CPU intensive (many C++ compiles),
-                and the rest of the JDK will often be disk intensive.
-                <p>
-                Faster compiles are possible using a tool called
-                <a href="http://ccache.samba.org/">ccache</a>.
-            </blockquote>
-        </li>
-        <li>
-            <b>File time issues:</b>
-            <blockquote>
-                <p>
-                If you see warnings that refer to file time stamps, e.g.
-                <blockquote>
-                    <i>Warning message:</i><tt> File `xxx' has modification time in
-                    the future.</tt>
-                    <br>
-                    <i>Warning message:</i> <tt> Clock skew detected. Your build may
-                    be incomplete.</tt> 
-                </blockquote>
-                <p>
-                These warnings can occur when the clock on the build machine is out of
-                sync with the timestamps on the source files. Other errors, apparently
-                unrelated but in fact caused by the clock skew, can occur along with
-                the clock skew warnings. These secondary errors may tend to obscure the
-                fact that the true root cause of the problem is an out-of-sync clock.
-                For example, an out-of-sync clock has been known to cause an old
-                version of javac to be used to compile some files, resulting in errors
-                when the pre-1.4 compiler ran across the new <tt>assert</tt> keyword
-                in the 1.4 source code.
-                <p>
-                If you see these warnings, reset the clock on the build
-                machine, run "<tt><i>gmake</i> clobber</tt>" or delete the directory
-                containing the build output, and restart the build from the beginning.
-            </blockquote>
-        </li>
-        <li>
-            <b>Error message: <tt>Trouble writing out table to disk</tt></b>
-            <blockquote>
-                <p>
-                Increase the amount of swap space on your build machine.
-            </blockquote>
-        </li>
-        <li>
-            <b>Error Message: <tt>libstdc++ not found:</tt></b>
-            <blockquote>
-                This is caused by a missing libstdc++.a library.
-                This is installed as part of a specific package
-                (e.g. libstdc++.so.devel.386).
-                By default some 64bit Linux versions (e.g. Fedora)
-                only install the 64bit version of the libstdc++ package.
-                Various parts of the JDK build require a static
-                link of the C++ runtime libraries to allow for maximum
-                portability of the built images.
-            </blockquote>
-        </li>
-        <li>
-            <b>Error Message: <tt>cannot restore segment prot after reloc</tt></b>
-            <blockquote>
-                This is probably an issue with SELinux (See
-                <a href="http://en.wikipedia.org/wiki/SELinux">http://en.wikipedia.org/wiki/SELinux</a>).
-                Parts of the VM is built without the <tt>-fPIC</tt> for
-                performance reasons.
-                <p>
-                To completely disable SELinux:
-                <ol><tt>
-                    
-                    <li>$ su root</li>
-                    <li># system-config-securitylevel</li>
-                    <li>In the window that appears, select the SELinux tab</li>
-                    <li>Disable SELinux</li>
-                </ol></tt>
-                <p>
-                Alternatively, instead of completely disabling it you could
-                disable just this one check.
-                <ol><tt>
-                    <li>Select System->Administration->SELinux Management</li>
-                    <li>In the SELinux Management Tool which appears, 
-                    select "Boolean" from the menu on the left</li>
-                    <li>Expand the "Memory Protection" group</li>
-                    <li>Check the first item, labeled
-                    "Allow all unconfined executables to use libraries requiring text relocation ..."</li>
-                </ol></tt>
-            </blockquote>
-        </li>
-    </ul>
-</blockquote>
-
-<hr noshade="noshade" size="3">
+        </blockquote>
+        <!-- ------------------------------------------------------ -->
+        <hr>
+        <h2><a name="troubleshooting">Troubleshooting</a></h2>
+        <blockquote>
+            A build can fail for any number of reasons. 
+            Most failures
+            are a result of trying to build in an environment in which all the
+            pre-build requirements have not been met. 
+            The first step in
+            troubleshooting a build failure is to recheck that you have satisfied
+            all the pre-build requirements for your platform.
+            Look for the check list of the platform you are building on in the
+            <a href="#contents">Table of Contents</a>.
+            <p>
+            You can validate your build environment by using the <tt>sanity</tt>
+            target.
+            Any errors listed
+            will stop the build from starting, and any warnings may result in
+            a flawed product build.
+            We strongly encourage you to evaluate every
+            sanity check warning and fix it if required, before you proceed
+            further with your build.
+            <p>
+            Some of the more common problems with builds are briefly described
+            below, with suggestions for remedies.
+            <ul>
+                <li>
+                    <b>Slow Builds:</b>
+                    <blockquote>
+                        If your build machine seems to be overloaded from too many
+                        simultaneous C++ compiles, try setting the <tt>HOTSPOT_BUILD_JOBS</tt>
+                        variable to <tt>1</tt> (if you're using a multiple CPU
+                        machine, setting it to more than the the number of CPUs is probably
+                        not a good idea).
+                        <p>
+                        Creating the javadocs can be very slow, if you are running
+                        javadoc, consider skipping that step.
+                        <p>
+                        Faster hardware and more RAM always helps too.
+                        The VM build tends to be CPU intensive (many C++ compiles),
+                        and the rest of the JDK will often be disk intensive.
+                        <p>
+                        Faster compiles are possible using a tool called
+                        <a href="http://ccache.samba.org/" target="_blank">ccache</a>.
+                    </blockquote>
+                </li>
+                <li>
+                    <b>File time issues:</b>
+                    <blockquote>
+                        If you see warnings that refer to file time stamps, e.g.
+                        <blockquote>
+                            <i>Warning message:</i><tt> File `xxx' has modification time in
+                            the future.</tt>
+                            <br>
+                            <i>Warning message:</i> <tt> Clock skew detected. Your build may
+                            be incomplete.</tt> 
+                        </blockquote>
+                        These warnings can occur when the clock on the build machine is out of
+                        sync with the timestamps on the source files. Other errors, apparently
+                        unrelated but in fact caused by the clock skew, can occur along with
+                        the clock skew warnings. These secondary errors may tend to obscure the
+                        fact that the true root cause of the problem is an out-of-sync clock.
+                        For example, an out-of-sync clock has been known to cause an old
+                        version of javac to be used to compile some files, resulting in errors
+                        when the pre-1.4 compiler ran across the new <tt>assert</tt> keyword
+                        in the 1.4 source code.
+                        <p>
+                        If you see these warnings, reset the clock on the build
+                        machine, run "<tt><i>gmake</i> clobber</tt>" or delete the directory
+                        containing the build output, and restart the build from the beginning.
+                    </blockquote>
+                </li>
+                <li>
+                    <b>Error message: <tt>Trouble writing out table to disk</tt></b>
+                    <blockquote>
+                        Increase the amount of swap space on your build machine.
+                    </blockquote>
+                </li>
+                <li>
+                    <b>Error Message: <tt>libstdc++ not found:</tt></b>
+                    <blockquote>
+                        This is caused by a missing libstdc++.a library.
+                        This is installed as part of a specific package
+                        (e.g. libstdc++.so.devel.386).
+                        By default some 64bit Linux versions (e.g. Fedora)
+                        only install the 64bit version of the libstdc++ package.
+                        Various parts of the JDK build require a static
+                        link of the C++ runtime libraries to allow for maximum
+                        portability of the built images.
+                    </blockquote>
+                </li>
+                <li>
+                    <b>Error Message: <tt>cannot restore segment prot after reloc</tt></b>
+                    <blockquote>
+                        This is probably an issue with SELinux (See
+                        <a href="http://en.wikipedia.org/wiki/SELinux" target="_blank">
+                        http://en.wikipedia.org/wiki/SELinux</a>).
+                        Parts of the VM is built without the <tt>-fPIC</tt> for
+                        performance reasons.
+                        <p>
+                        To completely disable SELinux:
+                        <tt>
+                            <ol>
+                                <li>$ su root</li>
+                                <li># system-config-securitylevel</li>
+                                <li>In the window that appears, select the SELinux tab</li>
+                                <li>Disable SELinux</li>
+                            </ol>
+                        </tt>
+                        <p>
+                        Alternatively, instead of completely disabling it you could
+                        disable just this one check.
+                        <tt>
+                            <ol>
+                                <li>Select System->Administration->SELinux Management</li>
+                                <li>In the SELinux Management Tool which appears, 
+                                select "Boolean" from the menu on the left</li>
+                                <li>Expand the "Memory Protection" group</li>
+                                <li>Check the first item, labeled
+                                "Allow all unconfined executables to use libraries requiring text relocation ..."</li>
+                            </ol>
+                        </tt>
+                    </blockquote>
+                </li>
+                <li>
+                    <b>Windows Error Message: <tt>*** fatal error - couldn't allocate heap, ... </tt></b>
+                    <blockquote>
+                        The CYGWIN software can conflict with other non-CYGWIN
+                        software. See the CYGWIN FAQ section on
+                        <a href="http://cygwin.com/faq/faq.using.html#faq.using.bloda" target="_blank">
+                        BLODA (applications that interfere with CYGWIN)</a>.
+                    </blockquote>
+                </li>
+                <li>
+                    <b>Windows Error Message: <tt>*** multiple target patterns.  Stop.</tt></b>
+                    <blockquote>
+                        The CYGWIN make version 3.81 may not like the Windows <tt>C:/</tt>
+                        style paths, it may not like the ':' character in the path
+                        when used in a makefile target definition.
+                        See the <a href="#gmake"><tt><i>gmake</i></tt></a> section.
+                    </blockquote>
+                </li>
+            </ul>
+        </blockquote>
+        <hr>
+    </body>
+</html>
--- a/corba/.hgtags	Thu Jun 05 15:57:56 2008 -0700
+++ b/corba/.hgtags	Thu Jun 12 13:50:55 2008 -0700
@@ -1,2 +1,4 @@
 55540e827aef970ecc010b7e06b912d991c8e3ce jdk7-b24
 5e61d5df62586474414d1058e9186441aa908f51 jdk7-b25
+0043eb3d4e628f049ff80a8c223b5657136085e7 jdk7-b26
+e84e9018bebbf3e5bafc5706e7882a15cb1c7d99 jdk7-b27
--- a/hotspot/.hgtags	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/.hgtags	Thu Jun 12 13:50:55 2008 -0700
@@ -1,2 +1,4 @@
 a61af66fc99eb5ec9d50c05b0c599757b1289ceb jdk7-b24
 7836be3e92d0a4f9ee7566f602c91f5609534e66 jdk7-b25
+ad0b851458ff9d1d490ed2d79bb84f75a9fdb753 jdk7-b26
+e3d2692f8442e2d951166dc9bd9a330684754438 jdk7-b27
--- a/hotspot/agent/make/Makefile	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/agent/make/Makefile	Thu Jun 12 13:50:55 2008 -0700
@@ -246,16 +246,16 @@
 all: filelist
 	@mkdir -p $(OUTPUT_DIR)
 	@echo "$(SA_BUILD_VERSION_PROP)" > $(SA_PROPERTIES)
-	@javac -source 1.4 -classpath $(CLASSPATH) -deprecation -sourcepath $(SRC_DIR) -g -d $(OUTPUT_DIR) @filelist
-	@rmic -classpath $(OUTPUT_DIR) -d $(OUTPUT_DIR) sun.jvm.hotspot.debugger.remote.RemoteDebuggerServer
+	@${JDK_HOME}/bin/javac -source 1.4 -classpath $(CLASSPATH) -deprecation -sourcepath $(SRC_DIR) -g -d $(OUTPUT_DIR) @filelist
+	@${JDK_HOME}/bin/rmic -classpath $(OUTPUT_DIR) -d $(OUTPUT_DIR) sun.jvm.hotspot.debugger.remote.RemoteDebuggerServer
 	rm -f $(OUTPUT_DIR)/sun/jvm/hotspot/utilities/soql/sa.js
 	cp $(SRC_DIR)/sun/jvm/hotspot/utilities/soql/sa.js $(OUTPUT_DIR)/sun/jvm/hotspot/utilities/soql
 
 allprof: filelist
 	@mkdir -p $(OUTPUT_DIR)
 	@echo "$(SA_BUILD_VERSION_PROP)" > $(SA_PROPERTIES)
-	@javac -source 1.4 -J-Xprof -classpath $(CLASSPATH) -deprecation -sourcepath $(SRC_DIR) -g -d $(OUTPUT_DIR) @filelist
-	@rmic -classpath $(OUTPUT_DIR) -d $(OUTPUT_DIR) sun.jvm.hotspot.debugger.remote.RemoteDebuggerServer
+	@${JDK_HOME}/bin/javac -source 1.4 -J-Xprof -classpath $(CLASSPATH) -deprecation -sourcepath $(SRC_DIR) -g -d $(OUTPUT_DIR) @filelist
+	@${JDK_HOME}/bin/rmic -classpath $(OUTPUT_DIR) -d $(OUTPUT_DIR) sun.jvm.hotspot.debugger.remote.RemoteDebuggerServer
 	rm -f $(OUTPUT_DIR)/sun/jvm/hotspot/utilities/soql/sa.js
 	cp $(SRC_DIR)/sun/jvm/hotspot/utilities/soql/sa.js $(OUTPUT_DIR)/sun/jvm/hotspot/utilities/soql
 
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/HSDB.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/HSDB.java	Thu Jun 12 13:50:55 2008 -0700
@@ -398,7 +398,7 @@
     frame.getContentPane().add(desktop);
     GraphicsUtilities.reshapeToAspectRatio(frame, 4.0f/3.0f, 0.75f, Toolkit.getDefaultToolkit().getScreenSize());
     GraphicsUtilities.centerInContainer(frame, Toolkit.getDefaultToolkit().getScreenSize());
-    frame.show();
+    frame.setVisible(true);
 
     Runtime.getRuntime().addShutdownHook(new java.lang.Thread() {
         public void run() {
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/SALauncherLoader.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/SALauncherLoader.java	Thu Jun 12 13:50:55 2008 -0700
@@ -148,7 +148,7 @@
         }
 
         try {
-            return file.toURL();
+            return file.toURI().toURL();
         } catch (MalformedURLException mue) {
             throw new InternalError(mue.getMessage());
         }
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/bugspot/Main.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/bugspot/Main.java	Thu Jun 12 13:50:55 2008 -0700
@@ -47,6 +47,6 @@
                                            4.0f/3.0f, 0.85f, Toolkit.getDefaultToolkit().getScreenSize());
     GraphicsUtilities.centerInContainer(frame,
                                         Toolkit.getDefaultToolkit().getScreenSize());
-    frame.show();
+    frame.setVisible(true);
   }
 }
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/SAJDIClassLoader.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/SAJDIClassLoader.java	Thu Jun 12 13:50:55 2008 -0700
@@ -78,7 +78,7 @@
         this(parent);
         this.classPathSet = true;
         try {
-            addURL(new File(classPath).toURL());
+            addURL(new File(classPath).toURI().toURL());
         } catch(MalformedURLException mue) {
             throw new RuntimeException(mue);
         }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/BinaryTreeDictionary.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,59 @@
+/*
+ * @(#)BinaryTreeDictionary.java
+ * Copyright 2000-2007 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.
+ *
+ * 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.jvm.hotspot.memory;
+
+import java.util.*;
+import sun.jvm.hotspot.debugger.*;
+import sun.jvm.hotspot.types.*;
+import sun.jvm.hotspot.runtime.*;
+
+public class BinaryTreeDictionary extends VMObject {
+   static {
+      VM.registerVMInitializedObserver(new Observer() {
+         public void update(Observable o, Object data) {
+            initialize(VM.getVM().getTypeDataBase());
+         }
+      });
+   }
+
+   private static synchronized void initialize(TypeDataBase db) {
+      Type type = db.lookupType("BinaryTreeDictionary");
+      totalSizeField = type.getCIntegerField("_totalSize");
+   }
+
+   // Fields
+   private static CIntegerField totalSizeField;
+
+   // Accessors
+   public long size() {
+      return totalSizeField.getValue(addr);
+   }
+
+   // Constructor
+   public BinaryTreeDictionary(Address addr) {
+      super(addr);
+   }
+}
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/CompactibleFreeListSpace.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/CompactibleFreeListSpace.java	Thu Jun 12 13:50:55 2008 -0700
@@ -35,6 +35,20 @@
 public class CompactibleFreeListSpace extends CompactibleSpace {
    private static AddressField collectorField;
 
+   // for free size, three fields
+   //       FreeBlockDictionary* _dictionary;        // ptr to dictionary for large size blocks
+   //       FreeList _indexedFreeList[IndexSetSize]; // indexed array for small size blocks
+   //       LinearAllocBlock _smallLinearAllocBlock; // small linear alloc in TLAB
+   private static AddressField indexedFreeListField;
+   private static AddressField dictionaryField;
+   private static long         smallLinearAllocBlockFieldOffset;
+   private static long indexedFreeListSizeOf;
+
+   private int    heapWordSize;     // 4 for 32bit, 8 for 64 bits
+   private int    IndexSetStart;    // for small indexed list
+   private int    IndexSetSize;
+   private int    IndexSetStride;
+
    static {
       VM.registerVMInitializedObserver(new Observer() {
          public void update(Observable o, Object data) {
@@ -51,10 +65,26 @@
 
      Type type = db.lookupType("CompactibleFreeListSpace");
      collectorField = type.getAddressField("_collector");
+     collectorField       = type.getAddressField("_collector");
+     dictionaryField      = type.getAddressField("_dictionary");
+     indexedFreeListField = type.getAddressField("_indexedFreeList[0]");
+     smallLinearAllocBlockFieldOffset = type.getField("_smallLinearAllocBlock").getOffset();
    }
 
    public CompactibleFreeListSpace(Address addr) {
       super(addr);
+      if ( VM.getVM().isLP64() ) {
+         heapWordSize = 8;
+         IndexSetStart = 1;
+         IndexSetStride = 1;
+      }
+      else {
+         heapWordSize = 4;
+         IndexSetStart = 2;
+         IndexSetStride = 2;
+      }
+
+      IndexSetSize = 257;
    }
 
    // Accessing block offset table
@@ -62,9 +92,17 @@
     return (CMSCollector) VMObjectFactory.newObject(
                                  CMSCollector.class,
                                  collectorField.getValue(addr));
-  }
+   }
+
+   public long free0() {
+     return capacity() - used0();
+   }
 
    public long used() {
+     return capacity() - free();
+   }
+
+   public long used0() {
       List regions = getLiveRegions();
       long usedSize = 0L;
       for (Iterator itr = regions.iterator(); itr.hasNext();) {
@@ -75,11 +113,41 @@
    }
 
    public long free() {
-      return capacity() - used();
-   }
+      // small chunks
+      long size = 0;
+      Address cur = addr.addOffsetTo( indexedFreeListField.getOffset() );
+      cur = cur.addOffsetTo(IndexSetStart*FreeList.sizeOf());
+      for (int i=IndexSetStart; i<IndexSetSize; i += IndexSetStride) {
+         FreeList freeList = (FreeList) VMObjectFactory.newObject(FreeList.class, cur);
+         size += i*freeList.count();
+         cur= cur.addOffsetTo(IndexSetStride*FreeList.sizeOf());
+      }
+
+      // large block
+      BinaryTreeDictionary bfbd = (BinaryTreeDictionary) VMObjectFactory.newObject(BinaryTreeDictionary.class,
+                                                                                   dictionaryField.getValue(addr));
+      size += bfbd.size();
+
+
+      // linear block in TLAB
+      LinearAllocBlock lab = (LinearAllocBlock) VMObjectFactory.newObject(LinearAllocBlock.class,
+                                                                          addr.addOffsetTo(smallLinearAllocBlockFieldOffset));
+      size += lab.word_size();
+
+      return size*heapWordSize;
+  }
 
    public void printOn(PrintStream tty) {
       tty.print("free-list-space");
+      tty.print("[ " + bottom() + " , " + end() + " ) ");
+      long cap = capacity();
+      long used_size = used();
+      long free_size = free();
+      int  used_perc = (int)((double)used_size/cap*100);
+      tty.print("space capacity = " + cap + " used(" + used_perc + "%)= " + used_size + " ");
+      tty.print("free= " + free_size );
+      tty.print("\n");
+
    }
 
    public Address skipBlockSizeUsingPrintezisBits(Address pos) {
@@ -121,7 +189,7 @@
             cur = cur.addOffsetTo(adjustObjectSizeInBytes(size));
          }
 
-         if (FreeChunk.secondWordIndicatesFreeChunk(dbg.getAddressValue(klassOop))) {
+         if (FreeChunk.indicatesFreeChunk(cur)) {
             if (! cur.equals(regionStart)) {
                res.add(new MemRegion(regionStart, cur));
             }
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/DefNewGeneration.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/DefNewGeneration.java	Thu Jun 12 13:50:55 2008 -0700
@@ -96,9 +96,9 @@
   public void printOn(PrintStream tty) {
     tty.print("  eden");
     eden().printOn(tty);
-    tty.print("  from");
+    tty.print("\n  from");
     from().printOn(tty);
-    tty.print("  to  ");
+    tty.print("\n  to  ");
     to().printOn(tty);
   }
 }
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/FreeChunk.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/FreeChunk.java	Thu Jun 12 13:50:55 2008 -0700
@@ -28,6 +28,7 @@
 import sun.jvm.hotspot.debugger.*;
 import sun.jvm.hotspot.types.*;
 import sun.jvm.hotspot.runtime.*;
+import sun.jvm.hotspot.oops.*;
 
 public class FreeChunk extends VMObject {
    static {
@@ -42,13 +43,13 @@
       Type type = db.lookupType("FreeChunk");
       nextField = type.getAddressField("_next");
       prevField = type.getAddressField("_prev");
-      sizeField = type.getCIntegerField("_size");
+      sizeField = type.getAddressField("_size");
    }
 
    // Fields
    private static AddressField nextField;
    private static AddressField prevField;
-   private static CIntegerField sizeField;
+   private static AddressField sizeField;
 
    // Accessors
    public FreeChunk next() {
@@ -61,20 +62,34 @@
    }
 
    public long size() {
-      return sizeField.getValue(addr);
+      if (VM.getVM().isCompressedOopsEnabled()) {
+        Mark mark = new Mark(sizeField.getValue(addr));
+        return mark.getSize();
+      } else {
+        Address size = sizeField.getValue(addr);
+        Debugger dbg = VM.getVM().getDebugger();
+        return dbg.getAddressValue(size);
+      }
    }
 
    public FreeChunk(Address addr) {
       super(addr);
    }
 
-   public static boolean secondWordIndicatesFreeChunk(long word) {
-      return (word & 0x1L) == 0x1L;
+   public static boolean indicatesFreeChunk(Address cur) {
+      FreeChunk f = new FreeChunk(cur);
+      return f.isFree();
    }
 
    public boolean isFree() {
-      Debugger dbg = VM.getVM().getDebugger();
-      Address prev = prevField.getValue(addr);
-      return secondWordIndicatesFreeChunk(dbg.getAddressValue(prev));
+      if (VM.getVM().isCompressedOopsEnabled()) {
+        Mark mark = new Mark(sizeField.getValue(addr));
+        return mark.isCmsFreeChunk();
+      } else {
+        Address prev = prevField.getValue(addr);
+        Debugger dbg = VM.getVM().getDebugger();
+        long word = dbg.getAddressValue(prev);
+        return (word & 0x1L) == 0x1L;
+      }
    }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/FreeList.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,72 @@
+/*
+ * @(#)FreeList.java
+ *
+ * Copyright 2000-2007 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.
+ *
+ * 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.jvm.hotspot.memory;
+
+import java.util.*;
+import sun.jvm.hotspot.debugger.*;
+import sun.jvm.hotspot.types.*;
+import sun.jvm.hotspot.runtime.*;
+
+public class FreeList extends VMObject {
+   static {
+      VM.registerVMInitializedObserver(new Observer() {
+         public void update(Observable o, Object data) {
+            initialize(VM.getVM().getTypeDataBase());
+         }
+      });
+   }
+
+   private static synchronized void initialize(TypeDataBase db) {
+      Type type = db.lookupType("FreeList");
+      sizeField = type.getCIntegerField("_size");
+      countField = type.getCIntegerField("_count");
+      headerSize = type.getSize();
+   }
+
+   // Fields
+   private static CIntegerField sizeField;
+   private static CIntegerField countField;
+   private static long          headerSize;
+
+   //Constructor
+   public FreeList(Address address) {
+     super(address);
+   }
+
+   // Accessors
+   public long size() {
+      return sizeField.getValue(addr);
+   }
+
+   public long count() {
+      return  countField.getValue(addr);
+   }
+
+   public static long sizeOf() {
+     return headerSize;
+  }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/LinearAllocBlock.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,59 @@
+/*
+ * @(#)BinaryTreeDictionary.java
+ * Copyright 2000-2007 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.
+ *
+ * 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.jvm.hotspot.memory;
+
+import java.util.*;
+import sun.jvm.hotspot.debugger.*;
+import sun.jvm.hotspot.types.*;
+import sun.jvm.hotspot.runtime.*;
+
+public class LinearAllocBlock extends VMObject {
+   static {
+      VM.registerVMInitializedObserver(new Observer() {
+         public void update(Observable o, Object data) {
+            initialize(VM.getVM().getTypeDataBase());
+         }
+      });
+   }
+
+   private static synchronized void initialize(TypeDataBase db) {
+      Type type = db.lookupType("LinearAllocBlock");
+      word_sizeField= type.getCIntegerField("_word_size");
+   }
+
+   // Fields
+   private static CIntegerField word_sizeField;
+
+   // Accessors
+   public long word_size() {
+      return word_sizeField.getValue(addr);
+   }
+
+   // Constructor
+   public LinearAllocBlock(Address addr) {
+      super(addr);
+   }
+}
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Mark.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Mark.java	Thu Jun 12 13:50:55 2008 -0700
@@ -79,6 +79,11 @@
     noHashInPlace       = db.lookupLongConstant("markOopDesc::no_hash_in_place").longValue();
     noLockInPlace       = db.lookupLongConstant("markOopDesc::no_lock_in_place").longValue();
     maxAge              = db.lookupLongConstant("markOopDesc::max_age").longValue();
+
+    /* Constants in markOop used by CMS. */
+    cmsShift            = db.lookupLongConstant("markOopDesc::cms_shift").longValue();
+    cmsMask             = db.lookupLongConstant("markOopDesc::cms_mask").longValue();
+    sizeShift           = db.lookupLongConstant("markOopDesc::size_shift").longValue();
   }
 
   // Field accessors
@@ -120,6 +125,11 @@
 
   private static long maxAge;
 
+  /* Constants in markOop used by CMS. */
+  private static long cmsShift;
+  private static long cmsMask;
+  private static long sizeShift;
+
   public Mark(Address addr) {
     super(addr);
   }
@@ -290,4 +300,11 @@
   //
   //  // Recover address of oop from encoded form used in mark
   //  inline void* decode_pointer() { return clear_lock_bits(); }
+
+  // Copy markOop methods for CMS here.
+  public boolean isCmsFreeChunk() {
+    return isUnlocked() &&
+           (Bits.maskBitsLong(value() >> cmsShift, cmsMask) & 0x1L) == 0x1L;
+  }
+  public long getSize() { return (long)(value() >> sizeShift); }
 }
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/OopUtilities.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/OopUtilities.java	Thu Jun 12 13:50:55 2008 -0700
@@ -274,10 +274,10 @@
        // hc_klass is a HotSpot magic field and hence we can't
        // find it from InstanceKlass for java.lang.Class.
        TypeDataBase db = VM.getVM().getTypeDataBase();
-       int hcKlassOffset = (int) Oop.getHeaderSize();
+       int hcKlassOffset = (int) Instance.getHeaderSize();
        try {
           hcKlassOffset += (db.lookupIntConstant("java_lang_Class::hc_klass_offset").intValue() *
-                           db.getAddressSize());
+                           VM.getVM().getHeapOopSize());
        } catch (RuntimeException re) {
           // ignore, currently java_lang_Class::hc_klass_offset is zero
        }
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/AnnotatedMemoryPanel.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/AnnotatedMemoryPanel.java	Thu Jun 12 13:50:55 2008 -0700
@@ -648,6 +648,6 @@
           System.exit(0);
         }
       });
-    frame.show();
+    frame.setVisible(true);
   }
 }
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/CommandProcessorPanel.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/CommandProcessorPanel.java	Thu Jun 12 13:50:55 2008 -0700
@@ -220,7 +220,7 @@
                 }
             });
         frame.setSize(500, 500);
-        frame.show();
+        frame.setVisible(true);
         panel.requestFocus();
     }
 }
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/DebuggerConsolePanel.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/DebuggerConsolePanel.java	Thu Jun 12 13:50:55 2008 -0700
@@ -226,7 +226,7 @@
         }
       });
     frame.setSize(500, 500);
-    frame.show();
+    frame.setVisible(true);
     panel.requestFocus();
   }
 }
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/HighPrecisionJScrollBar.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/HighPrecisionJScrollBar.java	Thu Jun 12 13:50:55 2008 -0700
@@ -424,7 +424,7 @@
         }
       });
     frame.getContentPane().add(hpsb);
-    frame.show();
+    frame.setVisible(true);
   }
 
 }
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/JFrameWrapper.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/JFrameWrapper.java	Thu Jun 12 13:50:55 2008 -0700
@@ -43,7 +43,7 @@
   public void       setVisible(boolean visible) { frame.setVisible(visible);     }
   public void       setSize(int x, int y)       { frame.setSize(x, y);           }
   public void       pack()                      { frame.pack();                  }
-  public void       show()                      { frame.show();                  }
+  public void       show()                      { frame.setVisible(true);        }
   public void       dispose()                   { frame.dispose();               }
   public void       setBackground(Color color)  { frame.setBackground(color);    }
   public void       setResizable(boolean resizable) { frame.setResizable(resizable); }
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/treetable/JTreeTable.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/treetable/JTreeTable.java	Thu Jun 12 13:50:55 2008 -0700
@@ -477,9 +477,9 @@
     static class TreeTableTextField extends JTextField {
         public int offset;
 
-        public void reshape(int x, int y, int w, int h) {
+        public void setBounds(int x, int y, int w, int h) {
             int newX = Math.max(x, offset);
-            super.reshape(newX, y, w - (newX - x), h);
+            super.setBounds(newX, y, w - (newX - x), h);
         }
     }
 
--- a/hotspot/make/hotspot_version	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/make/hotspot_version	Thu Jun 12 13:50:55 2008 -0700
@@ -35,7 +35,7 @@
 
 HS_MAJOR_VER=13
 HS_MINOR_VER=0
-HS_BUILD_NUMBER=01
+HS_BUILD_NUMBER=02
 
 JDK_MAJOR_VER=1
 JDK_MINOR_VER=7
--- a/hotspot/make/jprt.config	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/make/jprt.config	Thu Jun 12 13:50:55 2008 -0700
@@ -68,8 +68,23 @@
 	solaris_arch=i386
     fi
 
-    # Get the SS11 compilers into path (make sure it matches ALT setting)
-    compiler_path=${slashjava}/devtools/${solaris_arch}/SUNWspro/SS11/bin
+    if [ "${JPRT_SOLARIS_COMPILER_NAME}" != "" ] ; then
+        compiler_name=${JPRT_SOLARIS_COMPILER_NAME}
+    else
+        if [ "${JPRT_JOB_PRODUCT_RELEASE}" = "jdk6"      -o \
+             "${JPRT_JOB_PRODUCT_RELEASE}" = "jdk6u10"   -o \
+             "${JPRT_JOB_PRODUCT_RELEASE}" = "jdk6perf" ] ; then
+            # All jdk6 builds use SS11
+            compiler_name=SS11
+        else
+            # FIXUP: Change to SS12 once it has been validated.
+	    #compiler_name=SS12
+            compiler_name=SS11
+        fi
+    fi
+    
+    # Get into path (make sure it matches ALT setting)
+    compiler_path=${slashjava}/devtools/${solaris_arch}/SUNWspro/${compiler_name}/bin
     dirMustExist "${compiler_path}" COMPILER_PATH
     path4sdk=${compiler_path}
 
--- a/hotspot/make/jprt.properties	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/make/jprt.properties	Thu Jun 12 13:50:55 2008 -0700
@@ -24,209 +24,274 @@
 
 # Properties for jprt
 
-JPRT.tools.default.release=jdk1.7.0
+# All build result bundles are full jdks, so the 64bit testing does not 
+#    need the 32bit sibling bundle installed.
+#    Note: If the hotspot/make/Makefile changed to only bundle the 64bit files
+#          when bundling 64bit, and stripped out the 64bit files from any 32bit
+#          bundles, then this setting would be need to be "true".
+
+jprt.need.sibling.build=false
+
+# At submit time, the release supplied will be in jprt.submit.release
+#    and will be one of the official release names defined in jprt.
+#    jprt supports property value expansion using ${property.name} syntax.
 
-# Build result bundles are not partial builds| but include everything
-JPRT.need.sibling.build=false
+# This tells jprt what default release we want to build
+
+jprt.tools.default.release=${jprt.submit.release}
+
+# Define the Solaris platforms we want for the various releases
+
+jprt.my.solaris.sparc.jdk7=solaris_sparc_5.10
+jprt.my.solaris.sparc.jdk6=solaris_sparc_5.8
+jprt.my.solaris.sparc.jdk6perf=solaris_sparc_5.8
+jprt.my.solaris.sparc.jdk6u10=solaris_sparc_5.8
+jprt.my.solaris.sparc=${jprt.my.solaris.sparc.${jprt.tools.default.release}}
 
-# Directories needed to build
-JPRT.bundle.src.dirs=make src agent
-JPRT.bundle.exclude.src.dirs=build
+jprt.my.solaris.sparcv9.jdk7=solaris_sparcv9_5.10
+jprt.my.solaris.sparcv9.jdk6=solaris_sparcv9_5.8
+jprt.my.solaris.sparcv9.jdk6perf=solaris_sparcv9_5.8
+jprt.my.solaris.sparcv9.jdk6u10=solaris_sparcv9_5.8
+jprt.my.solaris.sparcv9=${jprt.my.solaris.sparcv9.${jprt.tools.default.release}}
+
+jprt.my.solaris.i586.jdk7=solaris_i586_5.10
+jprt.my.solaris.i586.jdk6=solaris_i586_5.8
+jprt.my.solaris.i586.jdk6perf=solaris_i586_5.8
+jprt.my.solaris.i586.jdk6u10=solaris_i586_5.8
+jprt.my.solaris.i586=${jprt.my.solaris.i586.${jprt.tools.default.release}}
 
+jprt.my.solaris.x64.jdk7=solaris_x64_5.10
+jprt.my.solaris.x64.jdk6=solaris_x64_5.10
+jprt.my.solaris.x64.jdk6perf=solaris_x64_5.10
+jprt.my.solaris.x64.jdk6u10=solaris_x64_5.10
+jprt.my.solaris.x64=${jprt.my.solaris.x64.${jprt.tools.default.release}}
+
+jprt.my.linux.i586=linux_i586
+jprt.my.linux.x64=linux_x64
+jprt.my.windows.i586=windows_i586
+jprt.my.windows.x64=windows_x64
+
+# Standard list of jprt build targets for this source tree
+
+jprt.build.targets= \
+    ${jprt.my.solaris.sparc}-{product|fastdebug|debug}, \
+    ${jprt.my.solaris.sparcv9}-{product|fastdebug|debug}, \
+    ${jprt.my.solaris.i586}-{product|fastdebug|debug}, \
+    ${jprt.my.solaris.x64}-{product|fastdebug|debug}, \
+    ${jprt.my.linux.i586}-{product|fastdebug|debug}, \
+    ${jprt.my.linux.x64}-{product|fastdebug}, \
+    ${jprt.my.windows.i586}-{product|fastdebug|debug}, \
+    ${jprt.my.windows.x64}-{product|fastdebug|debug}
 
-# Standard list of JPRT build targets for this workspace
-JPRT.build.targets= \
-    solaris_sparc_5.10-{product|fastdebug|debug}, \
-    solaris_sparcv9_5.10-{product|fastdebug|debug}, \
-    solaris_i586_5.10-{product|fastdebug|debug}, \
-    solaris_x64_5.10-{product|fastdebug|debug}, \
-    linux_i586-{product|fastdebug|debug}, \
-    linux_x64-{product|fastdebug}, \
-    windows_i586-{product|fastdebug|debug}, \
-    windows_x64-{product|fastdebug|debug}
+# Subset lists of test targets for this source tree
+
+jprt.my.solaris.sparc.test.targets= \
+    ${jprt.my.solaris.sparc}-{product|fastdebug}-{c1|c2}-jvm98, \
+    ${jprt.my.solaris.sparc}-{product|fastdebug}-{c1|c2}-scimark, \
+    ${jprt.my.solaris.sparc}-product-{c1|c2}-runThese, \
+    ${jprt.my.solaris.sparc}-product-{c1|c2}-runThese_Xcomp, \
+    ${jprt.my.solaris.sparc}-product-{c1|c2}-runThese_Xcomp_2, \
+    ${jprt.my.solaris.sparc}-product-{c1|c2}-runThese_Xcomp_3, \
+    ${jprt.my.solaris.sparc}-fastdebug-c1-runThese_Xshare, \
+    ${jprt.my.solaris.sparc}-{product|fastdebug}-{c1|c2}-GCBasher_default, \
+    ${jprt.my.solaris.sparc}-{product|fastdebug}-{c1|c2}-GCBasher_SerialGC, \
+    ${jprt.my.solaris.sparc}-{product|fastdebug}-{c1|c2}-GCBasher_ParallelGC, \
+    ${jprt.my.solaris.sparc}-{product|fastdebug}-{c1|c2}-GCBasher_ParNewGC, \
+    ${jprt.my.solaris.sparc}-{product|fastdebug}-{c1|c2}-GCBasher_CMS, \
+    ${jprt.my.solaris.sparc}-{product|fastdebug}-{c1|c2}-GCBasher_default_2, \
+    ${jprt.my.solaris.sparc}-{product|fastdebug}-{c1|c2}-GCBasher_SerialGC_2, \
+    ${jprt.my.solaris.sparc}-{product|fastdebug}-{c1|c2}-GCBasher_ParallelGC_2, \
+    ${jprt.my.solaris.sparc}-{product|fastdebug}-{c1|c2}-GCBasher_ParNewGC_2, \
+    ${jprt.my.solaris.sparc}-{product|fastdebug}-{c1|c2}-GCBasher_CMS_2, \
+    ${jprt.my.solaris.sparc}-{product|fastdebug}-{c1|c2}-GCOld_default, \
+    ${jprt.my.solaris.sparc}-{product|fastdebug}-{c1|c2}-GCOld_SerialGC, \
+    ${jprt.my.solaris.sparc}-{product|fastdebug}-{c1|c2}-GCOld_ParallelGC, \
+    ${jprt.my.solaris.sparc}-{product|fastdebug}-{c1|c2}-GCOld_ParNewGC, \
+    ${jprt.my.solaris.sparc}-{product|fastdebug}-{c1|c2}-GCOld_CMS, \
+    ${jprt.my.solaris.sparc}-{product|fastdebug}-{c1|c2}-jbb_default, \
+    ${jprt.my.solaris.sparc}-{product|fastdebug}-{c1|c2}-jbb_SerialGC, \
+    ${jprt.my.solaris.sparc}-{product|fastdebug}-{c1|c2}-jbb_ParallelGC, \
+    ${jprt.my.solaris.sparc}-{product|fastdebug}-{c1|c2}-jbb_CMS, \
+    ${jprt.my.solaris.sparc}-{product|fastdebug}-{c1|c2}-scimark_2, \
+    ${jprt.my.solaris.sparc}-{product|fastdebug}-{c1|c2}-scimark_3
+
+jprt.my.solaris.sparcv9.test.targets= \
+    ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-jvm98, \
+    ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-scimark, \
+    ${jprt.my.solaris.sparcv9}-product-c2-runThese, \
+    ${jprt.my.solaris.sparcv9}-product-c2-runThese_Xcomp, \
+    ${jprt.my.solaris.sparcv9}-product-c2-runThese_Xcomp_2, \
+    ${jprt.my.solaris.sparcv9}-product-c2-runThese_Xcomp_3, \
+    ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-GCBasher_default, \
+    ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-GCBasher_SerialGC, \
+    ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-GCBasher_ParallelGC, \
+    ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-GCBasher_ParNewGC, \
+    ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-GCBasher_CMS, \
+    ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-GCBasher_default_2, \
+    ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-GCBasher_SerialGC_2, \
+    ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-GCBasher_ParallelGC_2, \
+    ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-GCBasher_ParNewGC_2, \
+    ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-GCBasher_CMS_2, \
+    ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-GCOld_default, \
+    ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-GCOld_SerialGC, \
+    ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-GCOld_ParallelGC, \
+    ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-GCOld_ParNewGC, \
+    ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-GCOld_CMS, \
+    ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-jbb_default, \
+    ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-jbb_SerialGC, \
+    ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-jbb_ParallelGC, \
+    ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-jbb_CMS, \
+    ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-scimark_2, \
+    ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-scimark_3
 
-# Standard list of JPRT test targets for this workspace
-JPRT.test.targets = \
-    solaris_sparc_5.10-{product|fastdebug}-{c1|c2}-jvm98, \
-    solaris_sparc_5.10-{product|fastdebug}-{c1|c2}-scimark, \
-    solaris_sparcv9_5.10-{product|fastdebug}-c2-jvm98, \
-    solaris_sparcv9_5.10-{product|fastdebug}-c2-scimark, \
-    solaris_i586_5.10-{product|fastdebug}-{c1|c2}-jvm98, \
-    solaris_i586_5.10-{product|fastdebug}-{c1|c2}-scimark, \
-    solaris_x64_5.10-{product|fastdebug}-c2-jvm98, \
-    solaris_x64_5.10-{product|fastdebug}-c2-scimark, \
-    linux_i586-{product|fastdebug}-{c1|c2}-jvm98, \
-    linux_i586-{product|fastdebug}-{c1|c2}-scimark, \
-    linux_x64-{product|fastdebug}-c2-jvm98, \
-    linux_x64-{product|fastdebug}-c2-scimark, \
-    windows_i586-{product|fastdebug}-{c1|c2}-jvm98, \
-    windows_i586-{product|fastdebug}-{c1|c2}-scimark, \
-    windows_x64-{product|fastdebug}-c2-jvm98, \
-    windows_x64-{product|fastdebug}-c2-scimark, \
-    solaris_sparc_5.10-product-{c1|c2}-runThese, \
-    solaris_sparc_5.10-product-{c1|c2}-runThese_Xcomp, \
-    solaris_sparc_5.10-product-{c1|c2}-runThese_Xcomp_2, \
-    solaris_sparc_5.10-product-{c1|c2}-runThese_Xcomp_3, \
-    solaris_sparc_5.10-fastdebug-c1-runThese_Xshare, \
-    solaris_sparc_5.10-{product|fastdebug}-{c1|c2}-GCBasher_default, \
-    solaris_sparc_5.10-{product|fastdebug}-{c1|c2}-GCBasher_SerialGC, \
-    solaris_sparc_5.10-{product|fastdebug}-{c1|c2}-GCBasher_ParallelGC, \
-    solaris_sparc_5.10-{product|fastdebug}-{c1|c2}-GCBasher_ParNewGC, \
-    solaris_sparc_5.10-{product|fastdebug}-{c1|c2}-GCBasher_CMS, \
-    solaris_sparc_5.10-{product|fastdebug}-{c1|c2}-GCBasher_default_2, \
-    solaris_sparc_5.10-{product|fastdebug}-{c1|c2}-GCBasher_SerialGC_2, \
-    solaris_sparc_5.10-{product|fastdebug}-{c1|c2}-GCBasher_ParallelGC_2, \
-    solaris_sparc_5.10-{product|fastdebug}-{c1|c2}-GCBasher_ParNewGC_2, \
-    solaris_sparc_5.10-{product|fastdebug}-{c1|c2}-GCBasher_CMS_2, \
-    solaris_sparc_5.10-{product|fastdebug}-{c1|c2}-GCOld_default, \
-    solaris_sparc_5.10-{product|fastdebug}-{c1|c2}-GCOld_SerialGC, \
-    solaris_sparc_5.10-{product|fastdebug}-{c1|c2}-GCOld_ParallelGC, \
-    solaris_sparc_5.10-{product|fastdebug}-{c1|c2}-GCOld_ParNewGC, \
-    solaris_sparc_5.10-{product|fastdebug}-{c1|c2}-GCOld_CMS, \
-    solaris_sparc_5.10-{product|fastdebug}-{c1|c2}-jbb_default, \
-    solaris_sparc_5.10-{product|fastdebug}-{c1|c2}-jbb_SerialGC, \
-    solaris_sparc_5.10-{product|fastdebug}-{c1|c2}-jbb_ParallelGC, \
-    solaris_sparc_5.10-{product|fastdebug}-{c1|c2}-jbb_CMS, \
-    solaris_sparc_5.10-{product|fastdebug}-{c1|c2}-scimark_2, \
-    solaris_sparc_5.10-{product|fastdebug}-{c1|c2}-scimark_3, \
-    solaris_sparcv9_5.10-product-c2-runThese, \
-    solaris_sparcv9_5.10-product-c2-runThese_Xcomp, \
-    solaris_sparcv9_5.10-product-c2-runThese_Xcomp_2, \
-    solaris_sparcv9_5.10-product-c2-runThese_Xcomp_3, \
-    solaris_sparcv9_5.10-{product|fastdebug}-c2-GCBasher_default, \
-    solaris_sparcv9_5.10-{product|fastdebug}-c2-GCBasher_SerialGC, \
-    solaris_sparcv9_5.10-{product|fastdebug}-c2-GCBasher_ParallelGC, \
-    solaris_sparcv9_5.10-{product|fastdebug}-c2-GCBasher_ParNewGC, \
-    solaris_sparcv9_5.10-{product|fastdebug}-c2-GCBasher_CMS, \
-    solaris_sparcv9_5.10-{product|fastdebug}-c2-GCBasher_default_2, \
-    solaris_sparcv9_5.10-{product|fastdebug}-c2-GCBasher_SerialGC_2, \
-    solaris_sparcv9_5.10-{product|fastdebug}-c2-GCBasher_ParallelGC_2, \
-    solaris_sparcv9_5.10-{product|fastdebug}-c2-GCBasher_ParNewGC_2, \
-    solaris_sparcv9_5.10-{product|fastdebug}-c2-GCBasher_CMS_2, \
-    solaris_sparcv9_5.10-{product|fastdebug}-c2-GCOld_default, \
-    solaris_sparcv9_5.10-{product|fastdebug}-c2-GCOld_SerialGC, \
-    solaris_sparcv9_5.10-{product|fastdebug}-c2-GCOld_ParallelGC, \
-    solaris_sparcv9_5.10-{product|fastdebug}-c2-GCOld_ParNewGC, \
-    solaris_sparcv9_5.10-{product|fastdebug}-c2-GCOld_CMS, \
-    solaris_sparcv9_5.10-{product|fastdebug}-c2-jbb_default, \
-    solaris_sparcv9_5.10-{product|fastdebug}-c2-jbb_SerialGC, \
-    solaris_sparcv9_5.10-{product|fastdebug}-c2-jbb_ParallelGC, \
-    solaris_sparcv9_5.10-{product|fastdebug}-c2-jbb_CMS, \
-    solaris_sparcv9_5.10-{product|fastdebug}-c2-scimark_2, \
-    solaris_sparcv9_5.10-{product|fastdebug}-c2-scimark_3, \
-    solaris_x64-product-c2-runThese, \
-    solaris_x64-product-c2-runThese_Xcomp, \
-    solaris_x64-{product|fastdebug}-c2-GCBasher_default, \
-    solaris_x64-{product|fastdebug}-c2-GCBasher_SerialGC, \
-    solaris_x64-{product|fastdebug}-c2-GCBasher_ParallelGC, \
-    solaris_x64-{product|fastdebug}-c2-GCBasher_ParNewGC, \
-    solaris_x64-{product|fastdebug}-c2-GCBasher_CMS, \
-    solaris_x64-{product|fastdebug}-c2-GCBasher_default_2, \
-    solaris_x64-{product|fastdebug}-c2-GCBasher_SerialGC_2, \
-    solaris_x64-{product|fastdebug}-c2-GCBasher_ParallelGC_2, \
-    solaris_x64-{product|fastdebug}-c2-GCBasher_ParNewGC_2, \
-    solaris_x64-{product|fastdebug}-c2-GCBasher_CMS_2, \
-    solaris_x64-{product|fastdebug}-c2-GCOld_default, \
-    solaris_x64-{product|fastdebug}-c2-GCOld_SerialGC, \
-    solaris_x64-{product|fastdebug}-c2-GCOld_ParallelGC, \
-    solaris_x64-{product|fastdebug}-c2-GCOld_ParNewGC, \
-    solaris_x64-{product|fastdebug}-c2-GCOld_CMS, \
-    solaris_x64-{product|fastdebug}-c2-jbb_default, \
-    solaris_x64-{product|fastdebug}-c2-jbb_SerialGC, \
-    solaris_x64-{product|fastdebug}-c2-jbb_ParallelGC, \
-    solaris_x64-{product|fastdebug}-c2-jbb_CMS, \
-    solaris_i586_5.10-product-{c1|c2}-runThese_Xcomp, \
-    solaris_i586_5.10-product-c2-runThese_Xcomp_2, \
-    solaris_i586_5.10-fastdebug-c1-runThese_Xcomp_2, \
-    solaris_i586_5.10-fastdebug-c1-runThese_Xshare, \
-    solaris_i586_5.10-product-c1-GCBasher_default, \
-    solaris_i586_5.10-product-c1-GCBasher_SerialGC, \
-    solaris_i586_5.10-product-c1-GCBasher_ParallelGC, \
-    solaris_i586_5.10-product-c1-GCBasher_ParNewGC, \
-    solaris_i586_5.10-product-c1-GCBasher_CMS, \
-    solaris_i586_5.10-fastdebug-c2-GCBasher_default, \
-    solaris_i586_5.10-fastdebug-c2-GCBasher_SerialGC, \
-    solaris_i586_5.10-fastdebug-c2-GCBasher_ParallelGC, \
-    solaris_i586_5.10-fastdebug-c2-GCBasher_ParNewGC, \
-    solaris_i586_5.10-fastdebug-c2-GCBasher_CMS, \
-    solaris_i586_5.10-product-c1-GCOld_default, \
-    solaris_i586_5.10-product-c1-GCOld_SerialGC, \
-    solaris_i586_5.10-product-c1-GCOld_ParallelGC, \
-    solaris_i586_5.10-product-c1-GCOld_ParNewGC, \
-    solaris_i586_5.10-product-c1-GCOld_CMS, \
-    solaris_i586_5.10-fastdebug-c2-jbb_default, \
-    solaris_i586_5.10-fastdebug-c2-jbb_ParallelGC, \
-    solaris_i586_5.10-fastdebug-c2-jbb_CMS, \
-    solaris_i586_5.10-{product|fastdebug}-{c1|c2}-scimark_2, \
-    solaris_i586_5.10-{product|fastdebug}-{c1|c2}-scimark_3, \
-    linux_i586-product-c1-runThese_Xcomp, \
-    linux_i586-product-c1-runThese_Xcomp_2, \
-    linux_i586-product-c1-runThese_Xcomp_3, \
-    linux_i586-fastdebug-c1-runThese_Xshare, \
-    linux_i586-fastdebug-c2-runThese_Xcomp, \
-    linux_i586-fastdebug-c2-runThese_Xcomp_2, \
-    linux_i586-{product|fastdebug}-{c1|c2}-GCBasher_default, \
-    linux_i586-{product|fastdebug}-{c1|c2}-GCBasher_SerialGC, \
-    linux_i586-{product|fastdebug}-{c1|c2}-GCBasher_ParallelGC, \
-    linux_i586-{product|fastdebug}-{c1|c2}-GCBasher_ParNewGC, \
-    linux_i586-{product|fastdebug}-{c1|c2}-GCBasher_CMS, \
-    linux_i586-product-{c1|c2}-GCOld_default, \
-    linux_i586-product-{c1|c2}-GCOld_SerialGC, \
-    linux_i586-product-{c1|c2}-GCOld_ParallelGC, \
-    linux_i586-product-{c1|c2}-GCOld_ParNewGC, \
-    linux_i586-product-{c1|c2}-GCOld_CMS, \
-    linux_i586-{product|fastdebug}-c1-jbb_default, \
-    linux_i586-{product|fastdebug}-c1-jbb_ParallelGC, \
-    linux_i586-{product|fastdebug}-c1-jbb_CMS, \
-    linux_i586-{product|fastdebug}-c2-scimark_2, \
-    linux_i586-{product|fastdebug}-c2-scimark_3, \
-    linux_x64-{product|fastdebug}-c2-GCBasher_default, \
-    linux_x64-{product|fastdebug}-c2-GCBasher_SerialGC, \
-    linux_x64-{product|fastdebug}-c2-GCBasher_ParallelGC, \
-    linux_x64-{product|fastdebug}-c2-GCBasher_ParNewGC, \
-    linux_x64-{product|fastdebug}-c2-GCBasher_CMS, \
-    linux_x64-{product|fastdebug}-c2-GCOld_default, \
-    linux_x64-{product|fastdebug}-c2-GCOld_SerialGC, \
-    linux_x64-{product|fastdebug}-c2-GCOld_ParallelGC, \
-    linux_x64-{product|fastdebug}-c2-GCOld_ParNewGC, \
-    linux_x64-{product|fastdebug}-c2-GCOld_CMS, \
-    linux_x64-{product|fastdebug}-c2-jbb_default, \
-    linux_x64-{product|fastdebug}-c2-jbb_ParallelGC, \
-    linux_x64-{product|fastdebug}-c2-scimark_2, \
-    linux_x64-{product|fastdebug}-c2-scimark_3, \
-    windows_i586-product-{c1|c2}-runThese, \
-    windows_i586-product-{c1|c2}-runThese_Xcomp, \
-    windows_i586-fastdebug-c1-runThese_Xshare, \
-    windows_i586-{product|fastdebug}-{c1|c2}-GCBasher_default, \
-    windows_i586-{product|fastdebug}-{c1|c2}-GCBasher_SerialGC, \
-    windows_i586-{product|fastdebug}-{c1|c2}-GCBasher_ParallelGC, \
-    windows_i586-{product|fastdebug}-{c1|c2}-GCBasher_ParNewGC, \
-    windows_i586-{product|fastdebug}-{c1|c2}-GCBasher_CMS, \
-    windows_i586-product-{c1|c2}-GCOld_default, \
-    windows_i586-product-{c1|c2}-GCOld_SerialGC, \
-    windows_i586-product-{c1|c2}-GCOld_ParallelGC, \
-    windows_i586-product-{c1|c2}-GCOld_ParNewGC, \
-    windows_i586-product-{c1|c2}-GCOld_CMS, \
-    windows_i586-{product|fastdebug}-{c1|c2}-jbb_default, \
-    windows_i586-product-{c1|c2}-jbb_ParallelGC, \
-    windows_i586-product-{c1|c2}-jbb_CMS, \
-    windows_i586-product-{c1|c2}-scimark_2, \
-    windows_i586-product-{c1|c2}-scimark_3, \
-    windows_x64-product-c2-runThese, \
-    windows_x64-product-c2-runThese_Xcomp, \
-    windows_x64-{product|fastdebug}-c2-GCBasher_default, \
-    windows_x64-{product|fastdebug}-c2-GCBasher_SerialGC, \
-    windows_x64-{product|fastdebug}-c2-GCBasher_ParallelGC, \
-    windows_x64-{product|fastdebug}-c2-GCBasher_ParNewGC, \
-    windows_x64-{product|fastdebug}-c2-GCBasher_CMS, \
-    windows_x64-{product|fastdebug}-c2-GCOld_default, \
-    windows_x64-{product|fastdebug}-c2-GCOld_SerialGC, \
-    windows_x64-{product|fastdebug}-c2-GCOld_ParallelGC, \
-    windows_x64-{product|fastdebug}-c2-GCOld_ParNewGC, \
-    windows_x64-{product|fastdebug}-c2-GCOld_CMS, \
-    windows_x64-{product|fastdebug}-c2-jbb_default, \
-    windows_x64-product-c2-jbb_CMS, \
-    windows_x64-product-c2-jbb_ParallelGC, \
-    windows_x64-{product|fastdebug}-c2-scimark_2, \
-    windows_x64-{product|fastdebug}-c2-scimark_3
+jprt.my.solaris.x64.test.targets= \
+    ${jprt.my.solaris.x64}-{product|fastdebug}-c2-jvm98, \
+    ${jprt.my.solaris.x64}-{product|fastdebug}-c2-scimark, \
+    ${jprt.my.solaris.x64}-product-c2-runThese, \
+    ${jprt.my.solaris.x64}-product-c2-runThese_Xcomp, \
+    ${jprt.my.solaris.x64}-{product|fastdebug}-c2-GCBasher_default, \
+    ${jprt.my.solaris.x64}-{product|fastdebug}-c2-GCBasher_SerialGC, \
+    ${jprt.my.solaris.x64}-{product|fastdebug}-c2-GCBasher_ParallelGC, \
+    ${jprt.my.solaris.x64}-{product|fastdebug}-c2-GCBasher_ParNewGC, \
+    ${jprt.my.solaris.x64}-{product|fastdebug}-c2-GCBasher_CMS, \
+    ${jprt.my.solaris.x64}-{product|fastdebug}-c2-GCBasher_default_2, \
+    ${jprt.my.solaris.x64}-{product|fastdebug}-c2-GCBasher_SerialGC_2, \
+    ${jprt.my.solaris.x64}-{product|fastdebug}-c2-GCBasher_ParallelGC_2, \
+    ${jprt.my.solaris.x64}-{product|fastdebug}-c2-GCBasher_ParNewGC_2, \
+    ${jprt.my.solaris.x64}-{product|fastdebug}-c2-GCBasher_CMS_2, \
+    ${jprt.my.solaris.x64}-{product|fastdebug}-c2-GCOld_default, \
+    ${jprt.my.solaris.x64}-{product|fastdebug}-c2-GCOld_SerialGC, \
+    ${jprt.my.solaris.x64}-{product|fastdebug}-c2-GCOld_ParallelGC, \
+    ${jprt.my.solaris.x64}-{product|fastdebug}-c2-GCOld_ParNewGC, \
+    ${jprt.my.solaris.x64}-{product|fastdebug}-c2-GCOld_CMS, \
+    ${jprt.my.solaris.x64}-{product|fastdebug}-c2-jbb_default, \
+    ${jprt.my.solaris.x64}-{product|fastdebug}-c2-jbb_SerialGC, \
+    ${jprt.my.solaris.x64}-{product|fastdebug}-c2-jbb_ParallelGC, \
+    ${jprt.my.solaris.x64}-{product|fastdebug}-c2-jbb_CMS
+
+jprt.my.solaris.i586.test.targets= \
+    ${jprt.my.solaris.i586}-{product|fastdebug}-{c1|c2}-jvm98, \
+    ${jprt.my.solaris.i586}-{product|fastdebug}-{c1|c2}-scimark, \
+    ${jprt.my.solaris.i586}-product-{c1|c2}-runThese_Xcomp, \
+    ${jprt.my.solaris.i586}-product-c2-runThese_Xcomp_2, \
+    ${jprt.my.solaris.i586}-fastdebug-c1-runThese_Xcomp_2, \
+    ${jprt.my.solaris.i586}-fastdebug-c1-runThese_Xshare, \
+    ${jprt.my.solaris.i586}-product-c1-GCBasher_default, \
+    ${jprt.my.solaris.i586}-product-c1-GCBasher_SerialGC, \
+    ${jprt.my.solaris.i586}-product-c1-GCBasher_ParallelGC, \
+    ${jprt.my.solaris.i586}-product-c1-GCBasher_ParNewGC, \
+    ${jprt.my.solaris.i586}-product-c1-GCBasher_CMS, \
+    ${jprt.my.solaris.i586}-fastdebug-c2-GCBasher_default, \
+    ${jprt.my.solaris.i586}-fastdebug-c2-GCBasher_SerialGC, \
+    ${jprt.my.solaris.i586}-fastdebug-c2-GCBasher_ParallelGC, \
+    ${jprt.my.solaris.i586}-fastdebug-c2-GCBasher_ParNewGC, \
+    ${jprt.my.solaris.i586}-fastdebug-c2-GCBasher_CMS, \
+    ${jprt.my.solaris.i586}-product-c1-GCOld_default, \
+    ${jprt.my.solaris.i586}-product-c1-GCOld_SerialGC, \
+    ${jprt.my.solaris.i586}-product-c1-GCOld_ParallelGC, \
+    ${jprt.my.solaris.i586}-product-c1-GCOld_ParNewGC, \
+    ${jprt.my.solaris.i586}-product-c1-GCOld_CMS, \
+    ${jprt.my.solaris.i586}-fastdebug-c2-jbb_default, \
+    ${jprt.my.solaris.i586}-fastdebug-c2-jbb_ParallelGC, \
+    ${jprt.my.solaris.i586}-fastdebug-c2-jbb_CMS, \
+    ${jprt.my.solaris.i586}-{product|fastdebug}-{c1|c2}-scimark_2, \
+    ${jprt.my.solaris.i586}-{product|fastdebug}-{c1|c2}-scimark_3
 
+jprt.my.linux.i586.test.targets = \
+    ${jprt.my.linux.i586}-{product|fastdebug}-{c1|c2}-jvm98, \
+    ${jprt.my.linux.i586}-{product|fastdebug}-{c1|c2}-scimark, \
+    ${jprt.my.linux.i586}-product-c1-runThese_Xcomp, \
+    ${jprt.my.linux.i586}-product-c1-runThese_Xcomp_2, \
+    ${jprt.my.linux.i586}-product-c1-runThese_Xcomp_3, \
+    ${jprt.my.linux.i586}-fastdebug-c1-runThese_Xshare, \
+    ${jprt.my.linux.i586}-fastdebug-c2-runThese_Xcomp, \
+    ${jprt.my.linux.i586}-fastdebug-c2-runThese_Xcomp_2, \
+    ${jprt.my.linux.i586}-{product|fastdebug}-{c1|c2}-GCBasher_default, \
+    ${jprt.my.linux.i586}-{product|fastdebug}-{c1|c2}-GCBasher_SerialGC, \
+    ${jprt.my.linux.i586}-{product|fastdebug}-{c1|c2}-GCBasher_ParallelGC, \
+    ${jprt.my.linux.i586}-{product|fastdebug}-{c1|c2}-GCBasher_ParNewGC, \
+    ${jprt.my.linux.i586}-{product|fastdebug}-{c1|c2}-GCBasher_CMS, \
+    ${jprt.my.linux.i586}-product-{c1|c2}-GCOld_default, \
+    ${jprt.my.linux.i586}-product-{c1|c2}-GCOld_SerialGC, \
+    ${jprt.my.linux.i586}-product-{c1|c2}-GCOld_ParallelGC, \
+    ${jprt.my.linux.i586}-product-{c1|c2}-GCOld_ParNewGC, \
+    ${jprt.my.linux.i586}-product-{c1|c2}-GCOld_CMS, \
+    ${jprt.my.linux.i586}-{product|fastdebug}-c1-jbb_default, \
+    ${jprt.my.linux.i586}-{product|fastdebug}-c1-jbb_ParallelGC, \
+    ${jprt.my.linux.i586}-{product|fastdebug}-c1-jbb_CMS, \
+    ${jprt.my.linux.i586}-{product|fastdebug}-c2-scimark_2, \
+    ${jprt.my.linux.i586}-{product|fastdebug}-c2-scimark_3
+
+jprt.my.linux.x64.test.targets = \
+    ${jprt.my.linux.x64}-{product|fastdebug}-c2-jvm98, \
+    ${jprt.my.linux.x64}-{product|fastdebug}-c2-scimark, \
+    ${jprt.my.linux.x64}-{product|fastdebug}-c2-GCBasher_default, \
+    ${jprt.my.linux.x64}-{product|fastdebug}-c2-GCBasher_SerialGC, \
+    ${jprt.my.linux.x64}-{product|fastdebug}-c2-GCBasher_ParallelGC, \
+    ${jprt.my.linux.x64}-{product|fastdebug}-c2-GCBasher_ParNewGC, \
+    ${jprt.my.linux.x64}-{product|fastdebug}-c2-GCBasher_CMS, \
+    ${jprt.my.linux.x64}-{product|fastdebug}-c2-GCOld_default, \
+    ${jprt.my.linux.x64}-{product|fastdebug}-c2-GCOld_SerialGC, \
+    ${jprt.my.linux.x64}-{product|fastdebug}-c2-GCOld_ParallelGC, \
+    ${jprt.my.linux.x64}-{product|fastdebug}-c2-GCOld_ParNewGC, \
+    ${jprt.my.linux.x64}-{product|fastdebug}-c2-GCOld_CMS, \
+    ${jprt.my.linux.x64}-{product|fastdebug}-c2-jbb_default, \
+    ${jprt.my.linux.x64}-{product|fastdebug}-c2-jbb_ParallelGC, \
+    ${jprt.my.linux.x64}-{product|fastdebug}-c2-scimark_2, \
+    ${jprt.my.linux.x64}-{product|fastdebug}-c2-scimark_3
+
+jprt.my.windows.i586.test.targets = \
+    ${jprt.my.windows.i586}-{product|fastdebug}-{c1|c2}-jvm98, \
+    ${jprt.my.windows.i586}-{product|fastdebug}-{c1|c2}-scimark, \
+    ${jprt.my.windows.i586}-product-{c1|c2}-runThese, \
+    ${jprt.my.windows.i586}-product-{c1|c2}-runThese_Xcomp, \
+    ${jprt.my.windows.i586}-fastdebug-c1-runThese_Xshare, \
+    ${jprt.my.windows.i586}-{product|fastdebug}-{c1|c2}-GCBasher_default, \
+    ${jprt.my.windows.i586}-{product|fastdebug}-{c1|c2}-GCBasher_SerialGC, \
+    ${jprt.my.windows.i586}-{product|fastdebug}-{c1|c2}-GCBasher_ParallelGC, \
+    ${jprt.my.windows.i586}-{product|fastdebug}-{c1|c2}-GCBasher_ParNewGC, \
+    ${jprt.my.windows.i586}-{product|fastdebug}-{c1|c2}-GCBasher_CMS, \
+    ${jprt.my.windows.i586}-product-{c1|c2}-GCOld_default, \
+    ${jprt.my.windows.i586}-product-{c1|c2}-GCOld_SerialGC, \
+    ${jprt.my.windows.i586}-product-{c1|c2}-GCOld_ParallelGC, \
+    ${jprt.my.windows.i586}-product-{c1|c2}-GCOld_ParNewGC, \
+    ${jprt.my.windows.i586}-product-{c1|c2}-GCOld_CMS, \
+    ${jprt.my.windows.i586}-{product|fastdebug}-{c1|c2}-jbb_default, \
+    ${jprt.my.windows.i586}-product-{c1|c2}-jbb_ParallelGC, \
+    ${jprt.my.windows.i586}-product-{c1|c2}-jbb_CMS, \
+    ${jprt.my.windows.i586}-product-{c1|c2}-scimark_2, \
+    ${jprt.my.windows.i586}-product-{c1|c2}-scimark_3
+
+jprt.my.windows.x64.test.targets = \
+    ${jprt.my.windows.x64}-{product|fastdebug}-c2-jvm98, \
+    ${jprt.my.windows.x64}-{product|fastdebug}-c2-scimark, \
+    ${jprt.my.windows.x64}-product-c2-runThese, \
+    ${jprt.my.windows.x64}-product-c2-runThese_Xcomp, \
+    ${jprt.my.windows.x64}-{product|fastdebug}-c2-GCBasher_default, \
+    ${jprt.my.windows.x64}-{product|fastdebug}-c2-GCBasher_SerialGC, \
+    ${jprt.my.windows.x64}-{product|fastdebug}-c2-GCBasher_ParallelGC, \
+    ${jprt.my.windows.x64}-{product|fastdebug}-c2-GCBasher_ParNewGC, \
+    ${jprt.my.windows.x64}-{product|fastdebug}-c2-GCBasher_CMS, \
+    ${jprt.my.windows.x64}-{product|fastdebug}-c2-GCOld_default, \
+    ${jprt.my.windows.x64}-{product|fastdebug}-c2-GCOld_SerialGC, \
+    ${jprt.my.windows.x64}-{product|fastdebug}-c2-GCOld_ParallelGC, \
+    ${jprt.my.windows.x64}-{product|fastdebug}-c2-GCOld_ParNewGC, \
+    ${jprt.my.windows.x64}-{product|fastdebug}-c2-GCOld_CMS, \
+    ${jprt.my.windows.x64}-{product|fastdebug}-c2-jbb_default, \
+    ${jprt.my.windows.x64}-product-c2-jbb_CMS, \
+    ${jprt.my.windows.x64}-product-c2-jbb_ParallelGC, \
+    ${jprt.my.windows.x64}-{product|fastdebug}-c2-scimark_2, \
+    ${jprt.my.windows.x64}-{product|fastdebug}-c2-scimark_3
+
+# The complete list of test targets for jprt
+
+jprt.test.targets = \
+  ${jprt.my.solaris.sparc.test.targets}, \
+  ${jprt.my.solaris.sparcv9.test.targets}, \
+  ${jprt.my.solaris.i586.test.targets}, \
+  ${jprt.my.solaris.x64.test.targets}, \
+  ${jprt.my.linux.i586.test.targets}, \
+  ${jprt.my.linux.x64.test.targets}, \
+  ${jprt.my.windows.i586.test.targets}, \
+  ${jprt.my.windows.x64.test.targets}
+
--- a/hotspot/make/solaris/makefiles/debug.make	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/make/solaris/makefiles/debug.make	Thu Jun 12 13:50:55 2008 -0700
@@ -29,7 +29,8 @@
 DEBUG_CFLAGS/BYFILE = $(DEBUG_CFLAGS/$@)$(DEBUG_CFLAGS/DEFAULT$(DEBUG_CFLAGS/$@))
 
 ifeq ("${Platform_compiler}", "sparcWorks")
-ifeq ($(shell expr $(COMPILER_REV) \>= 5.8), 1)
+
+ifeq ($(COMPILER_REV),5.8)
   # SS11 SEGV when compiling with -g and -xarch=v8, using different backend
   DEBUG_CFLAGS/compileBroker.o = $(DEBUG_CFLAGS) -xO0
   DEBUG_CFLAGS/jvmtiTagMap.o   = $(DEBUG_CFLAGS) -xO0
--- a/hotspot/make/solaris/makefiles/dtrace.make	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/make/solaris/makefiles/dtrace.make	Thu Jun 12 13:50:55 2008 -0700
@@ -92,12 +92,12 @@
 $(XLIBJVM_DB): $(DTRACE_SRCDIR)/$(JVM_DB).c $(JVMOFFS).h $(LIBJVM_DB_MAPFILE)
 	@echo Making $@
 	$(QUIETLY) mkdir -p 64/ ; \
-	$(CC) $(SYMFLAG) -xarch=$(XARCH) -D$(TYPE) -I. -I$(GENERATED) \
+	$(CC) $(SYMFLAG) $(ARCHFLAG/$(XARCH)) -D$(TYPE) -I. -I$(GENERATED) \
 		$(SHARED_FLAG) $(LFLAGS_JVM_DB) -o $@ $(DTRACE_SRCDIR)/$(JVM_DB).c -lc
 $(XLIBJVM_DTRACE): $(DTRACE_SRCDIR)/$(JVM_DTRACE).c $(DTRACE_SRCDIR)/$(JVM_DTRACE).h $(LIBJVM_DTRACE_MAPFILE)
 	@echo Making $@
 	$(QUIETLY) mkdir -p 64/ ; \
-	$(CC) $(SYMFLAG) -xarch=$(XARCH) -D$(TYPE) -I. \
+	$(CC) $(SYMFLAG) $(ARCHFLAG/$(XARCH)) -D$(TYPE) -I. \
 		$(SHARED_FLAG) $(LFLAGS_JVM_DTRACE) -o $@ $(DTRACE_SRCDIR)/$(JVM_DTRACE).c -lc -lthread -ldoor
 endif # ifneq ("${ISA}","${BUILDARCH}")
 
--- a/hotspot/make/solaris/makefiles/fastdebug.make	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/make/solaris/makefiles/fastdebug.make	Thu Jun 12 13:50:55 2008 -0700
@@ -25,7 +25,7 @@
 # Sets make macros for making debug version of VM
 
 # Compiler specific DEBUG_CFLAGS are passed in from gcc.make, sparcWorks.make
-# They may also specify FASTDEBUG_CFLAGS, but it defaults to DEBUG_FLAGS.
+# They may also specify FASTDEBUG_CFLAGS, but it defaults to DEBUG_CFLAGS.
 
 FASTDEBUG_CFLAGS$(FASTDEBUG_CFLAGS) = $(DEBUG_CFLAGS)
 
@@ -35,15 +35,26 @@
 
 ifeq ("${Platform_compiler}", "sparcWorks")
 OPT_CFLAGS/SLOWER = -xO2
-ifeq ($(shell expr $(COMPILER_REV) \>= 5.5), 1)
-# CC 5.5 has bug 4908364 with -xO4 
+
+# Problem with SS12 compiler, dtrace doesn't like the .o files  (bug 6693876)
+ifeq ($(COMPILER_REV), 5.9)
+  # Not clear this workaround could be skipped in some cases.
+  OPT_CFLAGS/vmGCOperations.o = $(OPT_CFLAGS/SLOWER)
+  OPT_CFLAGS/java.o = $(OPT_CFLAGS/SLOWER)
+  OPT_CFLAGS/jni.o = $(OPT_CFLAGS/SLOWER)
+endif
+
+ifeq ($(COMPILER_REV), 5.5)
+# CC 5.5 has bug 4908364 with -xO4  (Fixed in 5.6)
 OPT_CFLAGS/library_call.o = $(OPT_CFLAGS/SLOWER)
-else # COMPILER_REV >= 5.5
+endif # COMPILER_REV == 5.5
+
+ifeq ($(shell expr $(COMPILER_REV) \<= 5.4), 1)
 # Compilation of *_<arch>.cpp can take an hour or more at O3.  Use O2
 # See comments at top of sparc.make.
 OPT_CFLAGS/ad_$(Platform_arch).o = $(OPT_CFLAGS/SLOWER)
 OPT_CFLAGS/dfa_$(Platform_arch).o = $(OPT_CFLAGS/SLOWER)
-endif # COMPILER_REV >= 5.5
+endif # COMPILER_REV <= 5.4
 
 ifeq (${COMPILER_REV}, 5.0)
 # Avoid a compiler bug caused by using -xO<level> -g<level>
--- a/hotspot/make/solaris/makefiles/jvmg.make	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/make/solaris/makefiles/jvmg.make	Thu Jun 12 13:50:55 2008 -0700
@@ -29,7 +29,8 @@
 DEBUG_CFLAGS/BYFILE = $(DEBUG_CFLAGS/$@)$(DEBUG_CFLAGS/DEFAULT$(DEBUG_CFLAGS/$@))
 
 ifeq ("${Platform_compiler}", "sparcWorks")
-ifeq ($(shell expr $(COMPILER_REV) \>= 5.8), 1)
+
+ifeq ($(COMPILER_REV),5.8))
   # SS11 SEGV when compiling with -g and -xarch=v8, using different backend
   DEBUG_CFLAGS/compileBroker.o = $(DEBUG_CFLAGS) -xO0
   DEBUG_CFLAGS/jvmtiTagMap.o   = $(DEBUG_CFLAGS) -xO0
--- a/hotspot/make/solaris/makefiles/optimized.make	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/make/solaris/makefiles/optimized.make	Thu Jun 12 13:50:55 2008 -0700
@@ -30,12 +30,21 @@
 OPT_CFLAGS/BYFILE = $(OPT_CFLAGS/$@)$(OPT_CFLAGS/DEFAULT$(OPT_CFLAGS/$@))
 
 # (OPT_CFLAGS/SLOWER is also available, to alter compilation of buggy files)
+ifeq ("${Platform_compiler}", "sparcWorks")
 
-# Workaround SS11 bug 6345274 (all platforms)
-ifeq ("${Platform_compiler}", "sparcWorks")
-ifeq ($(shell expr $(COMPILER_REV) \>= 5.8), 1)
+# Problem with SS12 compiler, dtrace doesn't like the .o files  (bug 6693876)
+ifeq ($(COMPILER_REV),5.9)
+  # Not clear this workaround could be skipped in some cases.
+  OPT_CFLAGS/vmGCOperations.o = $(OPT_CFLAGS/SLOWER) -g
+  OPT_CFLAGS/java.o = $(OPT_CFLAGS/SLOWER) -g
+  OPT_CFLAGS/jni.o = $(OPT_CFLAGS/SLOWER) -g
+endif
+
+# Workaround SS11 bug 6345274 (all platforms) (Fixed in SS11 patch and SS12)
+ifeq ($(COMPILER_REV),5.8))
 OPT_CFLAGS/ciTypeFlow.o = $(OPT_CFLAGS/O2)
-endif # COMPILER_REV >= 5.8
+endif # COMPILER_REV == 5.8
+
 endif # Platform_compiler == sparcWorks
 
 # If you set HOTSPARC_GENERIC=yes, you disable all OPT_CFLAGS settings
--- a/hotspot/make/solaris/makefiles/product.make	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/make/solaris/makefiles/product.make	Thu Jun 12 13:50:55 2008 -0700
@@ -38,12 +38,21 @@
 endif
 
 # (OPT_CFLAGS/SLOWER is also available, to alter compilation of buggy files)
+ifeq ("${Platform_compiler}", "sparcWorks")
 
-# Workaround SS11 bug 6345274 (all platforms)
-ifeq ("${Platform_compiler}", "sparcWorks")
-ifeq ($(shell expr $(COMPILER_REV) \>= 5.8), 1)
+# Problem with SS12 compiler, dtrace doesn't like the .o files  (bug 6693876)
+ifeq ($(COMPILER_REV),5.9)
+  # Not clear this workaround could be skipped in some cases.
+  OPT_CFLAGS/vmGCOperations.o = $(OPT_CFLAGS/SLOWER) -g
+  OPT_CFLAGS/java.o = $(OPT_CFLAGS/SLOWER) -g
+  OPT_CFLAGS/jni.o = $(OPT_CFLAGS/SLOWER) -g
+endif
+
+# Workaround SS11 bug 6345274 (all platforms) (Fixed in SS11 patch and SS12)
+ifeq ($(COMPILER_REV),5.8)
 OPT_CFLAGS/ciTypeFlow.o = $(OPT_CFLAGS/O2)
-endif # COMPILER_REV >= 5.8
+endif # COMPILER_REV == 5.8
+
 endif # Platform_compiler == sparcWorks
 
 # If you set HOTSPARC_GENERIC=yes, you disable all OPT_CFLAGS settings
--- a/hotspot/make/solaris/makefiles/sparc.make	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/make/solaris/makefiles/sparc.make	Thu Jun 12 13:50:55 2008 -0700
@@ -23,7 +23,7 @@
 #
 
 Obj_Files += solaris_sparc.o
-ASFLAGS += $(ARCHFLAG)
+ASFLAGS += $(AS_ARCHFLAG)
 
 ifeq ("${Platform_compiler}", "sparcWorks")
 ifeq ($(shell expr $(COMPILER_REV) \< 5.5), 1)
--- a/hotspot/make/solaris/makefiles/sparcWorks.make	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/make/solaris/makefiles/sparcWorks.make	Thu Jun 12 13:50:55 2008 -0700
@@ -28,6 +28,8 @@
 CC	= cc
 CPP	= CC
 
+# Note that this 'as' is an older version of the Sun Studio 'fbe', and will
+#   use the older style options. The 'fbe' options will match 'cc' and 'CC'.
 AS	= /usr/ccs/bin/as
 
 NM	= /usr/ccs/bin/nm
@@ -43,25 +45,33 @@
 C_COMPILER_REV := \
 $(shell $(CC) -V 2>&1 | grep -i "cc:" |  sed -e 's/^.*\([1-9]\.[0-9][0-9]*\).*/\1/')
 
-VALIDATED_COMPILER_REV   := 5.8
-VALIDATED_C_COMPILER_REV := 5.8
+# Pick which compiler is validated
+ifeq ($(JDK_MINOR_VERSION),6)
+  # Validated compiler for JDK6 is SS11 (5.8)
+  VALIDATED_COMPILER_REV   := 5.8
+  VALIDATED_C_COMPILER_REV := 5.8
+else
+  # FIXUP: Change to SS12 (5.9) once it has been validated.
+  # Validated compiler for JDK7 is SS12 (5.9)
+  #VALIDATED_COMPILER_REV   := 5.9
+  #VALIDATED_C_COMPILER_REV := 5.9
+  VALIDATED_COMPILER_REV   := 5.8
+  VALIDATED_C_COMPILER_REV := 5.8
+endif
 
+# Warning messages about not using the above validated version
 ENFORCE_COMPILER_REV${ENFORCE_COMPILER_REV} := ${VALIDATED_COMPILER_REV}
 ifneq (${COMPILER_REV},${ENFORCE_COMPILER_REV})
-dummy_target_to_enforce_compiler_rev:
-	@echo "Wrong ${CPP} version:  ${COMPILER_REV}. " \
-	"Use version ${ENFORCE_COMPILER_REV}, or set" \
-	"ENFORCE_COMPILER_REV=${COMPILER_REV}."
-	@exit 1
+dummy_target_to_enforce_compiler_rev:=\
+$(info WARNING: You are using CC version ${COMPILER_REV} \
+and should be using version ${ENFORCE_COMPILER_REV})
 endif
 
 ENFORCE_C_COMPILER_REV${ENFORCE_C_COMPILER_REV} := ${VALIDATED_C_COMPILER_REV}
 ifneq (${C_COMPILER_REV},${ENFORCE_C_COMPILER_REV})
-dummy_target_to_enforce_c_compiler_rev:
-	@echo "Wrong ${CC} version:  ${C_COMPILER_REV}. " \
-	"Use version ${ENFORCE_C_COMPILER_REV}, or set" \
-	"ENFORCE_C_COMPILER_REV=${C_COMPILER_REV}."
-	@exit 1
+dummy_target_to_enforce_c_compiler_rev:=\
+$(info WARNING: You are using cc version ${C_COMPILER_REV} \
+and should be using version ${ENFORCE_C_COMPILER_REV})
 endif
 
 # Fail the build if __fabsf is used.  __fabsf exists only in Solaris 8 2/04
@@ -90,20 +100,44 @@
 $(shell uname -r | awk -F. '{ if ($$2 >= 7) print "-DSOLARIS_7_OR_LATER"; }')
 CFLAGS += ${SOLARIS_7_OR_LATER}
 
-ARCHFLAG         = $(ARCHFLAG/$(BUILDARCH))
-# set ARCHFLAG/BUILDARCH which will ultimately be ARCHFLAG
+# New architecture options started in SS12 (5.9), we need both styles to build.
+#   The older arch options for SS11 (5.8) or older and also for /usr/ccs/bin/as.
+#   Note: SS12 default for 32bit sparc is now the same as v8plus, so the
+#         settings below have changed all SS12 32bit sparc builds to be v8plus.
+#         The older SS11 (5.8) settings have remained as they always have been.
 ifeq ($(TYPE),COMPILER2)
-ARCHFLAG/sparc   = -xarch=v8plus
+  ARCHFLAG_OLD/sparc   = -xarch=v8plus
 else
-ifeq ($(TYPE),TIERED)
-ARCHFLAG/sparc   = -xarch=v8plus
-else
-ARCHFLAG/sparc   = -xarch=v8
+  ifeq ($(TYPE),TIERED)
+    ARCHFLAG_OLD/sparc = -xarch=v8plus
+  else
+    ARCHFLAG_OLD/sparc = -xarch=v8
+  endif
 endif
+ARCHFLAG_NEW/sparc   = -m32 -xarch=sparc
+ARCHFLAG_OLD/sparcv9 = -xarch=v9
+ARCHFLAG_NEW/sparcv9 = -m64 -xarch=sparc
+ARCHFLAG_OLD/i486    =
+ARCHFLAG_NEW/i486    = -m32
+ARCHFLAG_OLD/amd64   = -xarch=amd64
+ARCHFLAG_NEW/amd64   = -m64
+
+# Select the ARCHFLAGs and other SS12 (5.9) options
+ifeq ($(shell expr $(COMPILER_REV) \>= 5.9), 1)
+  ARCHFLAG/sparc   = $(ARCHFLAG_NEW/sparc)
+  ARCHFLAG/sparcv9 = $(ARCHFLAG_NEW/sparcv9)
+  ARCHFLAG/i486    = $(ARCHFLAG_NEW/i486)
+  ARCHFLAG/amd64   = $(ARCHFLAG_NEW/amd64)
+else
+  ARCHFLAG/sparc   = $(ARCHFLAG_OLD/sparc)
+  ARCHFLAG/sparcv9 = $(ARCHFLAG_OLD/sparcv9)
+  ARCHFLAG/i486    = $(ARCHFLAG_OLD/i486)
+  ARCHFLAG/amd64   = $(ARCHFLAG_OLD/amd64)
 endif
-ARCHFLAG/sparcv9 = -xarch=v9
-ARCHFLAG/i486  =
-ARCHFLAG/amd64  = -xarch=amd64
+
+# ARCHFLAGS for the current build arch
+ARCHFLAG    = $(ARCHFLAG/$(BUILDARCH))
+AS_ARCHFLAG = $(ARCHFLAG_OLD/$(BUILDARCH))
 
 # Optional sub-directory in /usr/lib where BUILDARCH libraries are kept.
 ISA_DIR=$(ISA_DIR/$(BUILDARCH))
@@ -166,13 +200,13 @@
 
 ifeq ("${Platform_arch_model}", "x86_64")
 
-ASFLAGS += -xarch=amd64
-CFLAGS  += -xarch=amd64
+ASFLAGS += $(AS_ARCHFLAG)
+CFLAGS  += $(ARCHFLAG/amd64)
 # this one seemed useless
-LFLAGS_VM  += -xarch=amd64
+LFLAGS_VM  += $(ARCHFLAG/amd64)
 # this one worked
-LFLAGS  += -xarch=amd64
-AOUT_FLAGS += -xarch=amd64
+LFLAGS  += $(ARCHFLAG/amd64)
+AOUT_FLAGS += $(ARCHFLAG/amd64)
 
 # -xO3 is faster than -xO4 on specjbb with SS10 compiler
 OPT_CFLAGS=-xO4 $(EXTRA_OPT_CFLAGS)
@@ -224,7 +258,7 @@
 
 LFLAGS += -mt
 
-endif	# COMPILER_REV >= VALIDATED_COMPILER_REV
+endif	# COMPILER_REV >= 5.5
 
 ######################################
 # End 5.5 Forte compiler options     #
@@ -293,7 +327,7 @@
 LFLAGS += -library=Crun
 LIBS   += -library=Crun -lCrun
 
-endif	# COMPILER_REV >= VALIDATED_COMPILER_REV
+endif	# COMPILER_REV == 5.2
 
 ##################################
 # End 5.2 Forte compiler options #
@@ -320,6 +354,7 @@
 
 # Had to hoist this higher apparently because of other changes. Must
 # come before -xarch specification.
+#  NOTE: native says optimize for the machine doing the compile, bad news.
 CFLAGS += -xtarget=native
 
 CFLAGS     += $(ARCHFLAG)
@@ -359,7 +394,7 @@
 endif  # 32bit x86
 
 # The following options run into misaligned ldd problem (raj)
-#OPT_CFLAGS = -fast -O4 -xarch=v8 -xchip=ultra
+#OPT_CFLAGS = -fast -O4 $(ARCHFLAG/sparc) -xchip=ultra
 
 # no more exceptions
 CFLAGS/NOEX=-noex
@@ -427,6 +462,15 @@
 FASTDEBUG_CFLAGS = -g0
 # The -g0 setting allows the C++ frontend to inline, which is a big win.
 
+# Special global options for SS12
+ifeq ($(COMPILER_REV),5.9)
+  # There appears to be multiple issues with the new Dwarf2 debug format, so
+  #   we tell the compiler to use the older 'stabs' debug format all the time.
+  #   Note that this needs to be used in optimized compiles too to be 100%.
+  #   This is a workaround for SS12 (5.9) bug 6694600
+  CFLAGS += -xdebugformat=stabs
+endif
+
 # Enable the following CFLAGS additions if you need to compare the
 # built ELF objects.
 #
--- a/hotspot/make/solaris/makefiles/sparcv9.make	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/make/solaris/makefiles/sparcv9.make	Thu Jun 12 13:50:55 2008 -0700
@@ -23,7 +23,7 @@
 #
 
 Obj_Files += solaris_sparc.o
-ASFLAGS += $(ARCHFLAG)
+ASFLAGS += $(AS_ARCHFLAG)
 
 ifeq ("${Platform_compiler}", "sparcWorks")
 ifeq ($(shell expr $(COMPILER_REV) \< 5.5), 1)
--- a/hotspot/src/cpu/sparc/vm/assembler_sparc.cpp	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/src/cpu/sparc/vm/assembler_sparc.cpp	Thu Jun 12 13:50:55 2008 -0700
@@ -1525,6 +1525,21 @@
   return Address(d, address(obj), oop_Relocation::spec(oop_index));
 }
 
+void  MacroAssembler::set_narrow_oop(jobject obj, Register d) {
+  assert(oop_recorder() != NULL, "this assembler needs an OopRecorder");
+  int oop_index = oop_recorder()->find_index(obj);
+  RelocationHolder rspec = oop_Relocation::spec(oop_index);
+
+  assert_not_delayed();
+  // Relocation with special format (see relocInfo_sparc.hpp).
+  relocate(rspec, 1);
+  // Assembler::sethi(0x3fffff, d);
+  emit_long( op(branch_op) | rd(d) | op2(sethi_op2) | hi22(0x3fffff) );
+  // Don't add relocation for 'add'. Do patching during 'sethi' processing.
+  add(d, 0x3ff, d);
+
+}
+
 
 void MacroAssembler::align(int modulus) {
   while (offset() % modulus != 0) nop();
@@ -3445,13 +3460,15 @@
   set((intptr_t)markOopDesc::prototype()->copy_set_hash(0x2), t2);
   st_ptr(t2, top, oopDesc::mark_offset_in_bytes()); // set up the mark word
   // set klass to intArrayKlass
-  set((intptr_t)Universe::intArrayKlassObj_addr(), t2);
-  ld_ptr(t2, 0, t2);
-  store_klass(t2, top);
   sub(t1, typeArrayOopDesc::header_size(T_INT), t1);
   add(t1, ThreadLocalAllocBuffer::alignment_reserve(), t1);
   sll_ptr(t1, log2_intptr(HeapWordSize/sizeof(jint)), t1);
   st(t1, top, arrayOopDesc::length_offset_in_bytes());
+  set((intptr_t)Universe::intArrayKlassObj_addr(), t2);
+  ld_ptr(t2, 0, t2);
+  // store klass last.  concurrent gcs assumes klass length is valid if
+  // klass field is not null.
+  store_klass(t2, top);
   verify_oop(top);
 
   // refill the tlab with an eden allocation
@@ -4038,28 +4055,32 @@
   card_table_write(bs->byte_map_base, tmp, store_addr);
 }
 
-void MacroAssembler::load_klass(Register s, Register d) {
+void MacroAssembler::load_klass(Register src_oop, Register klass) {
   // The number of bytes in this code is used by
   // MachCallDynamicJavaNode::ret_addr_offset()
   // if this changes, change that.
   if (UseCompressedOops) {
-    lduw(s, oopDesc::klass_offset_in_bytes(), d);
-    decode_heap_oop_not_null(d);
+    lduw(src_oop, oopDesc::klass_offset_in_bytes(), klass);
+    decode_heap_oop_not_null(klass);
   } else {
-    ld_ptr(s, oopDesc::klass_offset_in_bytes(), d);
+    ld_ptr(src_oop, oopDesc::klass_offset_in_bytes(), klass);
   }
 }
 
-// ??? figure out src vs. dst!
-void MacroAssembler::store_klass(Register d, Register s1) {
+void MacroAssembler::store_klass(Register klass, Register dst_oop) {
   if (UseCompressedOops) {
-    assert(s1 != d, "not enough registers");
-    encode_heap_oop_not_null(d);
-    // Zero out entire klass field first.
-    st_ptr(G0, s1, oopDesc::klass_offset_in_bytes());
-    st(d, s1, oopDesc::klass_offset_in_bytes());
+    assert(dst_oop != klass, "not enough registers");
+    encode_heap_oop_not_null(klass);
+    st(klass, dst_oop, oopDesc::klass_offset_in_bytes());
   } else {
-    st_ptr(d, s1, oopDesc::klass_offset_in_bytes());
+    st_ptr(klass, dst_oop, oopDesc::klass_offset_in_bytes());
+  }
+}
+
+void MacroAssembler::store_klass_gap(Register s, Register d) {
+  if (UseCompressedOops) {
+    assert(s != d, "not enough registers");
+    st(s, d, oopDesc::klass_gap_offset_in_bytes());
   }
 }
 
@@ -4123,6 +4144,7 @@
 
 void MacroAssembler::encode_heap_oop(Register src, Register dst) {
   assert (UseCompressedOops, "must be compressed");
+  verify_oop(src);
   Label done;
   if (src == dst) {
     // optimize for frequent case src == dst
@@ -4144,12 +4166,14 @@
 
 void MacroAssembler::encode_heap_oop_not_null(Register r) {
   assert (UseCompressedOops, "must be compressed");
+  verify_oop(r);
   sub(r, G6_heapbase, r);
   srlx(r, LogMinObjAlignmentInBytes, r);
 }
 
 void MacroAssembler::encode_heap_oop_not_null(Register src, Register dst) {
   assert (UseCompressedOops, "must be compressed");
+  verify_oop(src);
   sub(src, G6_heapbase, dst);
   srlx(dst, LogMinObjAlignmentInBytes, dst);
 }
@@ -4162,11 +4186,13 @@
   bpr(rc_nz, true, Assembler::pt, dst, done);
   delayed() -> add(dst, G6_heapbase, dst); // annuled if not taken
   bind(done);
+  verify_oop(dst);
 }
 
 void  MacroAssembler::decode_heap_oop_not_null(Register r) {
   // Do not add assert code to this unless you change vtableStubs_sparc.cpp
   // pd_code_size_limit.
+  // Also do not verify_oop as this is called by verify_oop.
   assert (UseCompressedOops, "must be compressed");
   sllx(r, LogMinObjAlignmentInBytes, r);
   add(r, G6_heapbase, r);
@@ -4175,6 +4201,7 @@
 void  MacroAssembler::decode_heap_oop_not_null(Register src, Register dst) {
   // Do not add assert code to this unless you change vtableStubs_sparc.cpp
   // pd_code_size_limit.
+  // Also do not verify_oop as this is called by verify_oop.
   assert (UseCompressedOops, "must be compressed");
   sllx(src, LogMinObjAlignmentInBytes, dst);
   add(dst, G6_heapbase, dst);
--- a/hotspot/src/cpu/sparc/vm/assembler_sparc.hpp	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/src/cpu/sparc/vm/assembler_sparc.hpp	Thu Jun 12 13:50:55 2008 -0700
@@ -1994,8 +1994,9 @@
   inline void movbool( bool boolconst, Register d) { mov( (int) boolconst, d); }
 
   // klass oop manipulations if compressed
-  void load_klass(Register  src_oop, Register dst);
-  void store_klass(Register dst_oop, Register s1);
+  void load_klass(Register src_oop, Register klass);
+  void store_klass(Register klass, Register dst_oop);
+  void store_klass_gap(Register s, Register dst_oop);
 
    // oop manipulations
   void load_heap_oop(const Address& s, Register d, int offset = 0);
@@ -2134,6 +2135,8 @@
   inline void set_oop_constant( jobject obj, Register d ); // uses constant_oop_address
   inline void set_oop         ( Address obj_addr );        // same as load_address
 
+  void set_narrow_oop( jobject obj, Register d );
+
   // nop padding
   void align(int modulus);
 
--- a/hotspot/src/cpu/sparc/vm/relocInfo_sparc.cpp	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/src/cpu/sparc/vm/relocInfo_sparc.cpp	Thu Jun 12 13:50:55 2008 -0700
@@ -87,6 +87,17 @@
 #ifdef _LP64
     jint inst2;
     guarantee(Assembler::inv_op2(inst)==Assembler::sethi_op2, "must be sethi");
+    if (format() != 0) {
+      assert(type() == relocInfo::oop_type, "only narrow oops case");
+      jint np = oopDesc::encode_heap_oop((oop)x);
+      inst &= ~Assembler::hi22(-1);
+      inst |=  Assembler::hi22((intptr_t)np);
+      ip->set_long_at(0, inst);
+      inst2 = ip->long_at( NativeInstruction::nop_instruction_size );
+      guarantee(Assembler::inv_op(inst2)==Assembler::arith_op, "arith op");
+      ip->set_long_at(NativeInstruction::nop_instruction_size, ip->set_data32_simm13( inst2, (intptr_t)np));
+      break;
+    }
     ip->set_data64_sethi( ip->addr_at(0), (intptr_t)x );
 #ifdef COMPILER2
     // [RGV] Someone must have missed putting in a reloc entry for the
--- a/hotspot/src/cpu/sparc/vm/relocInfo_sparc.hpp	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/src/cpu/sparc/vm/relocInfo_sparc.hpp	Thu Jun 12 13:50:55 2008 -0700
@@ -31,7 +31,12 @@
 
     // There is no need for format bits; the instructions are
     // sufficiently self-identifying.
+#ifndef _LP64
     format_width       =  0
+#else
+    // Except narrow oops in 64-bits VM.
+    format_width       =  1
+#endif
   };
 
 
--- a/hotspot/src/cpu/sparc/vm/sharedRuntime_sparc.cpp	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/src/cpu/sparc/vm/sharedRuntime_sparc.cpp	Thu Jun 12 13:50:55 2008 -0700
@@ -2556,7 +2556,6 @@
   int total_strings = 0;
   int first_arg_to_pass = 0;
   int total_c_args = 0;
-  int box_offset = java_lang_boxing_object::value_offset_in_bytes();
 
   // Skip the receiver as dtrace doesn't want to see it
   if( !method->is_static() ) {
@@ -2721,7 +2720,8 @@
 #endif /* ASSERT */
 
   VMRegPair zero;
-  zero.set2(G0->as_VMReg());
+  const Register g0 = G0; // without this we get a compiler warning (why??)
+  zero.set2(g0->as_VMReg());
 
   int c_arg, j_arg;
 
@@ -2778,7 +2778,9 @@
             __ br_null(in_reg, true, Assembler::pn, skipUnbox);
             __ delayed()->mov(G0, tmp);
 
-            switch (out_sig_bt[c_arg]) {
+            BasicType bt = out_sig_bt[c_arg];
+            int box_offset = java_lang_boxing_object::value_offset_in_bytes(bt);
+            switch (bt) {
                 case T_BYTE:
                   __ ldub(in_reg, box_offset, tmp); break;
                 case T_SHORT:
--- a/hotspot/src/cpu/sparc/vm/sparc.ad	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/src/cpu/sparc/vm/sparc.ad	Thu Jun 12 13:50:55 2008 -0700
@@ -5471,7 +5471,6 @@
 // Load Klass Pointer
 instruct loadKlass(iRegP dst, memory mem) %{
   match(Set dst (LoadKlass mem));
-  predicate(!n->in(MemNode::Address)->bottom_type()->is_narrow());
   ins_cost(MEMORY_REF_COST);
   size(4);
 
@@ -5486,11 +5485,11 @@
   ins_pipe(iload_mem);
 %}
 
-// Load Klass Pointer
-instruct loadKlassComp(iRegP dst, memory mem) %{
-  match(Set dst (LoadKlass mem));
-  predicate(n->in(MemNode::Address)->bottom_type()->is_narrow());
+// Load narrow Klass Pointer
+instruct loadNKlass(iRegN dst, memory mem) %{
+  match(Set dst (LoadNKlass mem));
   ins_cost(MEMORY_REF_COST);
+  size(4);
 
   format %{ "LDUW   $mem,$dst\t! compressed klass ptr" %}
 
@@ -5503,9 +5502,6 @@
      } else {
        __ lduw(base, $mem$$disp, dst);
      }
-     // klass oop never null but this is generated for nonheader klass loads
-     // too which can be null.
-     __ decode_heap_oop(dst);
   %}
   ins_pipe(iload_mem);
 %}
@@ -5609,22 +5605,24 @@
   ins_pipe(loadConP_poll);
 %}
 
+instruct loadConN0(iRegN dst, immN0 src) %{
+  match(Set dst src);
+
+  size(4);
+  format %{ "CLR    $dst\t! compressed NULL ptr" %}
+  ins_encode( SetNull( dst ) );
+  ins_pipe(ialu_imm);
+%}
+
 instruct loadConN(iRegN dst, immN src) %{
   match(Set dst src);
-  ins_cost(DEFAULT_COST * 2);
-  format %{ "SET    $src,$dst\t!ptr" %}
+  ins_cost(DEFAULT_COST * 3/2);
+  format %{ "SET    $src,$dst\t! compressed ptr" %}
   ins_encode %{
-    address con = (address)$src$$constant;
     Register dst = $dst$$Register;
-    if (con == NULL) {
-      __ mov(G0, dst);
-    } else {
-      __ set_oop((jobject)$src$$constant, dst);
-      __ encode_heap_oop(dst);
-    }
-  %}
-  ins_pipe(loadConP);
-
+    __ set_narrow_oop((jobject)$src$$constant, dst);
+  %}
+  ins_pipe(ialu_hi_lo_reg);
 %}
 
 instruct loadConL(iRegL dst, immL src, o7RegL tmp) %{
@@ -5977,7 +5975,8 @@
 %}
 
 instruct decodeHeapOop(iRegP dst, iRegN src) %{
-  predicate(n->bottom_type()->is_oopptr()->ptr() != TypePtr::NotNull);
+  predicate(n->bottom_type()->is_oopptr()->ptr() != TypePtr::NotNull &&
+            n->bottom_type()->is_oopptr()->ptr() != TypePtr::Constant);
   match(Set dst (DecodeN src));
   format %{ "decode_heap_oop $src, $dst" %}
   ins_encode %{
@@ -5987,7 +5986,8 @@
 %}
 
 instruct decodeHeapOop_not_null(iRegP dst, iRegN src) %{
-  predicate(n->bottom_type()->is_oopptr()->ptr() == TypePtr::NotNull);
+  predicate(n->bottom_type()->is_oopptr()->ptr() == TypePtr::NotNull ||
+            n->bottom_type()->is_oopptr()->ptr() == TypePtr::Constant);
   match(Set dst (DecodeN src));
   format %{ "decode_heap_oop_not_null $src, $dst" %}
   ins_encode %{
@@ -6258,6 +6258,34 @@
   ins_pipe(ialu_imm);
 %}
 
+// Conditional move for RegN. Only cmov(reg,reg).
+instruct cmovNP_reg(cmpOpP cmp, flagsRegP pcc, iRegN dst, iRegN src) %{
+  match(Set dst (CMoveN (Binary cmp pcc) (Binary dst src)));
+  ins_cost(150);
+  format %{ "MOV$cmp $pcc,$src,$dst" %}
+  ins_encode( enc_cmov_reg(cmp,dst,src, (Assembler::ptr_cc)) );
+  ins_pipe(ialu_reg);
+%}
+
+// This instruction also works with CmpN so we don't need cmovNN_reg.
+instruct cmovNI_reg(cmpOp cmp, flagsReg icc, iRegN dst, iRegN src) %{
+  match(Set dst (CMoveN (Binary cmp icc) (Binary dst src)));
+  ins_cost(150);
+  size(4);
+  format %{ "MOV$cmp  $icc,$src,$dst" %}
+  ins_encode( enc_cmov_reg(cmp,dst,src, (Assembler::icc)) );
+  ins_pipe(ialu_reg);
+%}
+
+instruct cmovNF_reg(cmpOpF cmp, flagsRegF fcc, iRegN dst, iRegN src) %{
+  match(Set dst (CMoveN (Binary cmp fcc) (Binary dst src)));
+  ins_cost(150);
+  size(4);
+  format %{ "MOV$cmp $fcc,$src,$dst" %}
+  ins_encode( enc_cmov_reg_f(cmp,dst,src, fcc) );
+  ins_pipe(ialu_reg);
+%}
+
 // Conditional move
 instruct cmovPP_reg(cmpOpP cmp, flagsRegP pcc, iRegP dst, iRegP src) %{
   match(Set dst (CMoveP (Binary cmp pcc) (Binary dst src)));
@@ -6275,6 +6303,7 @@
   ins_pipe(ialu_imm);
 %}
 
+// This instruction also works with CmpN so we don't need cmovPN_reg.
 instruct cmovPI_reg(cmpOp cmp, flagsReg icc, iRegP dst, iRegP src) %{
   match(Set dst (CMoveP (Binary cmp icc) (Binary dst src)));
   ins_cost(150);
@@ -6650,10 +6679,9 @@
   ins_pipe( long_memory_op );
 %}
 
-instruct compareAndSwapN_bool_comp(iRegP mem_ptr, iRegN oldval, iRegN newval, iRegI res, o7RegI tmp, flagsReg ccr ) %{
+instruct compareAndSwapN_bool(iRegP mem_ptr, iRegN oldval, iRegN newval, iRegI res, o7RegI tmp1, flagsReg ccr ) %{
   match(Set res (CompareAndSwapN mem_ptr (Binary oldval newval)));
-  effect( USE mem_ptr, KILL ccr, KILL tmp);
-
+  effect( USE mem_ptr, KILL ccr, KILL tmp1);
   format %{
             "MOV    $newval,O7\n\t"
             "CASA   [$mem_ptr],$oldval,O7\t! If $oldval==[$mem_ptr] Then store O7 into [$mem_ptr], set O7=[$mem_ptr] in any case\n\t"
@@ -6661,18 +6689,8 @@
             "MOV    1,$res\n\t"
             "MOVne  icc,R_G0,$res"
   %}
-  ins_encode %{
-    Register Rmem = reg_to_register_object($mem_ptr$$reg);
-    Register Rold = reg_to_register_object($oldval$$reg);
-    Register Rnew = reg_to_register_object($newval$$reg);
-    Register Rres = reg_to_register_object($res$$reg);
-
-    __ cas(Rmem, Rold, Rnew);
-    __ cmp( Rold, Rnew );
-    __ mov(1, Rres);
-    __ movcc( Assembler::notEqual, false, Assembler::icc, G0, Rres );
-  %}
-
+  ins_encode( enc_casi(mem_ptr, oldval, newval),
+              enc_iflags_ne_to_boolean(res) );
   ins_pipe( long_memory_op );
 %}
 
@@ -8265,6 +8283,27 @@
   ins_pipe(ialu_cconly_reg_imm);
 %}
 
+// Compare Narrow oops
+instruct compN_iRegN(flagsReg icc, iRegN op1, iRegN op2 ) %{
+  match(Set icc (CmpN op1 op2));
+
+  size(4);
+  format %{ "CMP    $op1,$op2\t! compressed ptr" %}
+  opcode(Assembler::subcc_op3, Assembler::arith_op);
+  ins_encode( form3_rs1_rs2_rd( op1, op2, R_G0 ) );
+  ins_pipe(ialu_cconly_reg_reg);
+%}
+
+instruct compN_iRegN_immN0(flagsReg icc, iRegN op1, immN0 op2 ) %{
+  match(Set icc (CmpN op1 op2));
+
+  size(4);
+  format %{ "CMP    $op1,$op2\t! compressed ptr" %}
+  opcode(Assembler::subcc_op3, Assembler::arith_op);
+  ins_encode( form3_rs1_simm13_rd( op1, op2, R_G0 ) );
+  ins_pipe(ialu_cconly_reg_imm);
+%}
+
 //----------Max and Min--------------------------------------------------------
 // Min Instructions
 // Conditional move for min
@@ -8595,6 +8634,14 @@
   ins_pipe(ialu_imm);
 %}
 
+instruct cmovNL_reg(cmpOp cmp, flagsRegL xcc, iRegN dst, iRegN src) %{
+  match(Set dst (CMoveN (Binary cmp xcc) (Binary dst src)));
+  ins_cost(150);
+  format %{ "MOV$cmp  $xcc,$src,$dst" %}
+  ins_encode( enc_cmov_reg(cmp,dst,src, (Assembler::xcc)) );
+  ins_pipe(ialu_reg);
+%}
+
 instruct cmovPL_reg(cmpOp cmp, flagsRegL xcc, iRegP dst, iRegP src) %{
   match(Set dst (CMoveP (Binary cmp xcc) (Binary dst src)));
   ins_cost(150);
@@ -8826,16 +8873,6 @@
 %}
 
 
-instruct compP_iRegN_immN0(flagsRegP pcc, iRegN op1, immN0 op2 ) %{
-  match(Set pcc (CmpN op1 op2));
-
-  size(4);
-  format %{ "CMP    $op1,$op2\t! ptr" %}
-  opcode(Assembler::subcc_op3, Assembler::arith_op);
-  ins_encode( form3_rs1_simm13_rd( op1, op2, R_G0 ) );
-  ins_pipe(ialu_cconly_reg_imm);
-%}
-
 // ============================================================================
 // inlined locking and unlocking
 
--- a/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp	Thu Jun 12 13:50:55 2008 -0700
@@ -3294,7 +3294,8 @@
     __ set((intptr_t)markOopDesc::prototype(), G4_scratch);
   }
   __ st_ptr(G4_scratch, RallocatedObject, oopDesc::mark_offset_in_bytes());       // mark
-  __ store_klass(RinstanceKlass, RallocatedObject); // klass
+  __ store_klass_gap(G0, RallocatedObject);         // klass gap if compressed
+  __ store_klass(RinstanceKlass, RallocatedObject); // klass (last for cms)
 
   {
     SkipIfEqual skip_if(
--- a/hotspot/src/cpu/x86/vm/assembler_x86_32.hpp	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/src/cpu/x86/vm/assembler_x86_32.hpp	Thu Jun 12 13:50:55 2008 -0700
@@ -1057,7 +1057,7 @@
   // range (0 <= offset <= page_size).
 
   void null_check(Register reg, int offset = -1);
-  static bool needs_explicit_null_check(int offset);
+  static bool needs_explicit_null_check(intptr_t offset);
 
   // Required platform-specific helpers for Label::patch_instructions.
   // They _shadow_ the declarations in AbstractAssembler, which are undefined.
--- a/hotspot/src/cpu/x86/vm/assembler_x86_64.cpp	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/src/cpu/x86/vm/assembler_x86_64.cpp	Thu Jun 12 13:50:55 2008 -0700
@@ -683,7 +683,8 @@
 
   case REP8(0xB8): // movl/q r, #32/#64(oop?)
     if (which == end_pc_operand)  return ip + (is_64bit ? 8 : 4);
-    assert((which == call32_operand || which == imm64_operand) && is_64bit, "");
+    assert((which == call32_operand || which == imm64_operand) && is_64bit ||
+           which == narrow_oop_operand && !is_64bit, "");
     return ip;
 
   case 0x69: // imul r, a, #32
@@ -909,7 +910,8 @@
   } else if (r->is_call() || format == call32_operand) {
     opnd = locate_operand(inst, call32_operand);
   } else if (r->is_data()) {
-    assert(format == imm64_operand || format == disp32_operand, "format ok");
+    assert(format == imm64_operand || format == disp32_operand ||
+           format == narrow_oop_operand, "format ok");
     opnd = locate_operand(inst, (WhichOperand) format);
   } else {
     assert(format == 0, "cannot specify a format");
@@ -5060,6 +5062,8 @@
   movq(Address(top, arrayOopDesc::length_offset_in_bytes()), t1);
   // set klass to intArrayKlass
   movptr(t1, ExternalAddress((address) Universe::intArrayKlassObj_addr()));
+  // store klass last.  concurrent gcs assumes klass length is valid if
+  // klass field is not null.
   store_klass(top, t1);
 
   // refill the tlab with an eden allocation
@@ -5130,8 +5134,7 @@
   jcc(Assembler::notEqual, cas_label);
   // The bias pattern is present in the object's header. Need to check
   // whether the bias owner and the epoch are both still current.
-  load_klass(tmp_reg, obj_reg);
-  movq(tmp_reg, Address(tmp_reg, Klass::prototype_header_offset_in_bytes() + klassOopDesc::klass_part_offset_in_bytes()));
+  load_prototype_header(tmp_reg, obj_reg);
   orq(tmp_reg, r15_thread);
   xorq(tmp_reg, swap_reg);
   andq(tmp_reg, ~((int) markOopDesc::age_mask_in_place));
@@ -5205,8 +5208,7 @@
   //
   // FIXME: due to a lack of registers we currently blow away the age
   // bits in this situation. Should attempt to preserve them.
-  load_klass(tmp_reg, obj_reg);
-  movq(tmp_reg, Address(tmp_reg, Klass::prototype_header_offset_in_bytes() + klassOopDesc::klass_part_offset_in_bytes()));
+  load_prototype_header(tmp_reg, obj_reg);
   orq(tmp_reg, r15_thread);
   if (os::is_MP()) {
     lock();
@@ -5236,8 +5238,7 @@
   //
   // FIXME: due to a lack of registers we currently blow away the age
   // bits in this situation. Should attempt to preserve them.
-  load_klass(tmp_reg, obj_reg);
-  movq(tmp_reg, Address(tmp_reg, Klass::prototype_header_offset_in_bytes() + klassOopDesc::klass_part_offset_in_bytes()));
+  load_prototype_header(tmp_reg, obj_reg);
   if (os::is_MP()) {
     lock();
   }
@@ -5281,17 +5282,32 @@
   }
 }
 
+void MacroAssembler::load_prototype_header(Register dst, Register src) {
+  if (UseCompressedOops) {
+    movl(dst, Address(src, oopDesc::klass_offset_in_bytes()));
+    movq(dst, Address(r12_heapbase, dst, Address::times_8, Klass::prototype_header_offset_in_bytes() + klassOopDesc::klass_part_offset_in_bytes()));
+  } else {
+    movq(dst, Address(src, oopDesc::klass_offset_in_bytes()));
+    movq(dst, Address(dst, Klass::prototype_header_offset_in_bytes() + klassOopDesc::klass_part_offset_in_bytes()));
+  }
+}
+
 void MacroAssembler::store_klass(Register dst, Register src) {
   if (UseCompressedOops) {
     encode_heap_oop_not_null(src);
-    // zero the entire klass field first as the gap needs to be zeroed too.
-    movptr(Address(dst, oopDesc::klass_offset_in_bytes()), NULL_WORD);
     movl(Address(dst, oopDesc::klass_offset_in_bytes()), src);
   } else {
     movq(Address(dst, oopDesc::klass_offset_in_bytes()), src);
   }
 }
 
+void MacroAssembler::store_klass_gap(Register dst, Register src) {
+  if (UseCompressedOops) {
+    // Store to klass gap in destination
+    movl(Address(dst, oopDesc::klass_gap_offset_in_bytes()), src);
+  }
+}
+
 void MacroAssembler::load_heap_oop(Register dst, Address src) {
   if (UseCompressedOops) {
     movl(dst, src);
@@ -5315,13 +5331,15 @@
 void MacroAssembler::encode_heap_oop(Register r) {
   assert (UseCompressedOops, "should be compressed");
 #ifdef ASSERT
-  Label ok;
-  pushq(rscratch1); // cmpptr trashes rscratch1
-  cmpptr(r12_heapbase, ExternalAddress((address)Universe::heap_base_addr()));
-  jcc(Assembler::equal, ok);
-  stop("MacroAssembler::encode_heap_oop: heap base corrupted?");
-  bind(ok);
-  popq(rscratch1);
+  if (CheckCompressedOops) {
+    Label ok;
+    pushq(rscratch1); // cmpptr trashes rscratch1
+    cmpptr(r12_heapbase, ExternalAddress((address)Universe::heap_base_addr()));
+    jcc(Assembler::equal, ok);
+    stop("MacroAssembler::encode_heap_oop: heap base corrupted?");
+    bind(ok);
+    popq(rscratch1);
+  }
 #endif
   verify_oop(r, "broken oop in encode_heap_oop");
   testq(r, r);
@@ -5333,11 +5351,13 @@
 void MacroAssembler::encode_heap_oop_not_null(Register r) {
   assert (UseCompressedOops, "should be compressed");
 #ifdef ASSERT
-  Label ok;
-  testq(r, r);
-  jcc(Assembler::notEqual, ok);
-  stop("null oop passed to encode_heap_oop_not_null");
-  bind(ok);
+  if (CheckCompressedOops) {
+    Label ok;
+    testq(r, r);
+    jcc(Assembler::notEqual, ok);
+    stop("null oop passed to encode_heap_oop_not_null");
+    bind(ok);
+  }
 #endif
   verify_oop(r, "broken oop in encode_heap_oop_not_null");
   subq(r, r12_heapbase);
@@ -5347,11 +5367,13 @@
 void MacroAssembler::encode_heap_oop_not_null(Register dst, Register src) {
   assert (UseCompressedOops, "should be compressed");
 #ifdef ASSERT
-  Label ok;
-  testq(src, src);
-  jcc(Assembler::notEqual, ok);
-  stop("null oop passed to encode_heap_oop_not_null2");
-  bind(ok);
+  if (CheckCompressedOops) {
+    Label ok;
+    testq(src, src);
+    jcc(Assembler::notEqual, ok);
+    stop("null oop passed to encode_heap_oop_not_null2");
+    bind(ok);
+  }
 #endif
   verify_oop(src, "broken oop in encode_heap_oop_not_null2");
   if (dst != src) {
@@ -5364,14 +5386,16 @@
 void  MacroAssembler::decode_heap_oop(Register r) {
   assert (UseCompressedOops, "should be compressed");
 #ifdef ASSERT
-  Label ok;
-  pushq(rscratch1);
-  cmpptr(r12_heapbase,
-         ExternalAddress((address)Universe::heap_base_addr()));
-  jcc(Assembler::equal, ok);
-  stop("MacroAssembler::decode_heap_oop: heap base corrupted?");
-  bind(ok);
-  popq(rscratch1);
+  if (CheckCompressedOops) {
+    Label ok;
+    pushq(rscratch1);
+    cmpptr(r12_heapbase,
+           ExternalAddress((address)Universe::heap_base_addr()));
+    jcc(Assembler::equal, ok);
+    stop("MacroAssembler::decode_heap_oop: heap base corrupted?");
+    bind(ok);
+    popq(rscratch1);
+  }
 #endif
 
   Label done;
@@ -5392,6 +5416,7 @@
   assert (UseCompressedOops, "should only be used for compressed headers");
   // Cannot assert, unverified entry point counts instructions (see .ad file)
   // vtableStubs also counts instructions in pd_code_size_limit.
+  // Also do not verify_oop as this is called by verify_oop.
   assert(Address::times_8 == LogMinObjAlignmentInBytes, "decode alg wrong");
   leaq(r, Address(r12_heapbase, r, Address::times_8, 0));
 }
@@ -5400,10 +5425,24 @@
   assert (UseCompressedOops, "should only be used for compressed headers");
   // Cannot assert, unverified entry point counts instructions (see .ad file)
   // vtableStubs also counts instructions in pd_code_size_limit.
+  // Also do not verify_oop as this is called by verify_oop.
   assert(Address::times_8 == LogMinObjAlignmentInBytes, "decode alg wrong");
   leaq(dst, Address(r12_heapbase, src, Address::times_8, 0));
 }
 
+void  MacroAssembler::set_narrow_oop(Register dst, jobject obj) {
+  assert(oop_recorder() != NULL, "this assembler needs an OopRecorder");
+  int oop_index = oop_recorder()->find_index(obj);
+  RelocationHolder rspec = oop_Relocation::spec(oop_index);
+
+  // movl dst,obj
+  InstructionMark im(this);
+  int encode = prefix_and_encode(dst->encoding());
+  emit_byte(0xB8 | encode);
+  emit_data(oop_index, rspec, narrow_oop_operand);
+}
+
+
 Assembler::Condition MacroAssembler::negate_condition(Assembler::Condition cond) {
   switch (cond) {
     // Note some conditions are synonyms for others
--- a/hotspot/src/cpu/x86/vm/assembler_x86_64.hpp	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/src/cpu/x86/vm/assembler_x86_64.hpp	Thu Jun 12 13:50:55 2008 -0700
@@ -502,7 +502,12 @@
     imm64_operand  = 0,          // embedded 64-bit immediate operand
     disp32_operand = 1,          // embedded 32-bit displacement
     call32_operand = 2,          // embedded 32-bit self-relative displacement
+#ifndef AMD64
     _WhichOperand_limit = 3
+#else
+     narrow_oop_operand = 3,     // embedded 32-bit immediate narrow oop
+    _WhichOperand_limit = 4
+#endif
   };
 
   public:
@@ -1035,7 +1040,7 @@
   // is needed if the offset is within a certain range (0 <= offset <=
   // page_size).
   void null_check(Register reg, int offset = -1);
-  static bool needs_explicit_null_check(int offset);
+  static bool needs_explicit_null_check(intptr_t offset);
 
   // Required platform-specific helpers for Label::patch_instructions.
   // They _shadow_ the declarations in AbstractAssembler, which are undefined.
@@ -1116,6 +1121,9 @@
   // oop manipulations
   void load_klass(Register dst, Register src);
   void store_klass(Register dst, Register src);
+  void store_klass_gap(Register dst, Register src);
+
+  void load_prototype_header(Register dst, Register src);
 
   void load_heap_oop(Register dst, Address src);
   void store_heap_oop(Address dst, Register src);
@@ -1126,6 +1134,8 @@
   void encode_heap_oop_not_null(Register dst, Register src);
   void decode_heap_oop_not_null(Register dst, Register src);
 
+  void set_narrow_oop(Register dst, jobject obj);
+
   // Stack frame creation/removal
   void enter();
   void leave();
--- a/hotspot/src/cpu/x86/vm/interp_masm_x86_64.cpp	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/src/cpu/x86/vm/interp_masm_x86_64.cpp	Thu Jun 12 13:50:55 2008 -0700
@@ -223,7 +223,7 @@
   assert(Rsub_klass != rcx, "rcx holds 2ndary super array length");
   assert(Rsub_klass != rdi, "rdi holds 2ndary super array scan ptr");
 
-  Label not_subtype, loop;
+  Label not_subtype, not_subtype_pop, loop;
 
   // Profile the not-null value's klass.
   profile_typecheck(rcx, Rsub_klass, rdi); // blows rcx, rdi
@@ -262,12 +262,13 @@
   // and we store values in objArrays always encoded, thus we need to encode value
   // before repne
   if (UseCompressedOops) {
+    pushq(rax);
     encode_heap_oop(rax);
     repne_scanl();
     // Not equal?
-    jcc(Assembler::notEqual, not_subtype);
-    // decode heap oop here for movq
-    decode_heap_oop(rax);
+    jcc(Assembler::notEqual, not_subtype_pop);
+    // restore heap oop here for movq
+    popq(rax);
   } else {
     repne_scanq();
     jcc(Assembler::notEqual, not_subtype);
@@ -277,9 +278,10 @@
                Klass::secondary_super_cache_offset_in_bytes()), rax);
   jmp(ok_is_subtype);
 
+  bind(not_subtype_pop);
+  // restore heap oop here for miss
+  if (UseCompressedOops) popq(rax);
   bind(not_subtype);
-  // decode heap oop here for miss
-  if (UseCompressedOops) decode_heap_oop(rax);
   profile_typecheck_failed(rcx); // blows rcx
 }
 
--- a/hotspot/src/cpu/x86/vm/relocInfo_x86.cpp	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/src/cpu/x86/vm/relocInfo_x86.cpp	Thu Jun 12 13:50:55 2008 -0700
@@ -30,11 +30,15 @@
 #ifdef AMD64
   x += o;
   typedef Assembler::WhichOperand WhichOperand;
-  WhichOperand which = (WhichOperand) format(); // that is, disp32 or imm64, call32
+  WhichOperand which = (WhichOperand) format(); // that is, disp32 or imm64, call32, narrow oop
   assert(which == Assembler::disp32_operand ||
+         which == Assembler::narrow_oop_operand ||
          which == Assembler::imm64_operand, "format unpacks ok");
   if (which == Assembler::imm64_operand) {
     *pd_address_in_code() = x;
+  } else if (which == Assembler::narrow_oop_operand) {
+    address disp = Assembler::locate_operand(addr(), which);
+    *(int32_t*) disp = oopDesc::encode_heap_oop((oop)x);
   } else {
     // Note:  Use runtime_call_type relocations for call32_operand.
     address ip = addr();
--- a/hotspot/src/cpu/x86/vm/relocInfo_x86.hpp	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/src/cpu/x86/vm/relocInfo_x86.hpp	Thu Jun 12 13:50:55 2008 -0700
@@ -29,5 +29,10 @@
     offset_unit        =  1,
 
     // Encodes Assembler::disp32_operand vs. Assembler::imm32_operand.
+#ifndef AMD64
     format_width       =  1
+#else
+    // vs Assembler::narrow_oop_operand.
+    format_width       =  2
+#endif
   };
--- a/hotspot/src/cpu/x86/vm/sharedRuntime_x86_32.cpp	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/src/cpu/x86/vm/sharedRuntime_x86_32.cpp	Thu Jun 12 13:50:55 2008 -0700
@@ -1920,7 +1920,6 @@
   int total_strings = 0;
   int first_arg_to_pass = 0;
   int total_c_args = 0;
-  int box_offset = java_lang_boxing_object::value_offset_in_bytes();
 
   if( !method->is_static() ) {  // Pass in receiver first
     in_sig_bt[i++] = T_OBJECT;
@@ -2131,7 +2130,10 @@
           assert(dst.first()->is_stack() &&
                  (!dst.second()->is_valid() || dst.second()->is_stack()),
                  "value(s) must go into stack slots");
-          if ( out_sig_bt[c_arg] == T_LONG ) {
+
+          BasicType bt = out_sig_bt[c_arg];
+          int box_offset = java_lang_boxing_object::value_offset_in_bytes(bt);
+          if ( bt == T_LONG ) {
             __ movl(rbx, Address(in_reg,
                                  box_offset + VMRegImpl::stack_slot_size));
             __ movl(Address(rsp, reg2offset_out(dst.second())), rbx);
--- a/hotspot/src/cpu/x86/vm/sharedRuntime_x86_64.cpp	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/src/cpu/x86/vm/sharedRuntime_x86_64.cpp	Thu Jun 12 13:50:55 2008 -0700
@@ -1950,7 +1950,6 @@
   int total_strings = 0;
   int first_arg_to_pass = 0;
   int total_c_args = 0;
-  int box_offset = java_lang_boxing_object::value_offset_in_bytes();
 
   // Skip the receiver as dtrace doesn't want to see it
   if( !method->is_static() ) {
@@ -2197,8 +2196,10 @@
               __ testq(in_reg, in_reg);
               __ jcc(Assembler::zero, skipUnbox);
 
+              BasicType bt = out_sig_bt[c_arg];
+              int box_offset = java_lang_boxing_object::value_offset_in_bytes(bt);
               Address src1(in_reg, box_offset);
-              if ( out_sig_bt[c_arg] == T_LONG ) {
+              if ( bt == T_LONG ) {
                 __ movq(in_reg,  src1);
                 __ movq(stack_dst, in_reg);
                 assert(out_sig_bt[c_arg+1] == T_VOID, "must be");
@@ -2460,8 +2461,10 @@
           Label skip;
           __ testq(r, r);
           __ jcc(Assembler::equal, skip);
+          BasicType bt = out_sig_bt[c_arg];
+          int box_offset = java_lang_boxing_object::value_offset_in_bytes(bt);
           Address src1(r, box_offset);
-          if ( out_sig_bt[c_arg] == T_LONG ) {
+          if ( bt == T_LONG ) {
             __ movq(r, src1);
           } else {
             __ movl(r, src1);
--- a/hotspot/src/cpu/x86/vm/templateTable_x86_64.cpp	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/src/cpu/x86/vm/templateTable_x86_64.cpp	Thu Jun 12 13:50:55 2008 -0700
@@ -3233,7 +3233,9 @@
       __ movptr(Address(rax, oopDesc::mark_offset_in_bytes()),
                (intptr_t) markOopDesc::prototype()); // header (address 0x1)
     }
-    __ store_klass(rax, rsi);  // klass
+    __ xorl(rcx, rcx); // use zero reg to clear memory (shorter code)
+    __ store_klass_gap(rax, rcx);  // zero klass gap for compressed oops
+    __ store_klass(rax, rsi);      // store klass last
     __ jmp(done);
   }
 
--- a/hotspot/src/cpu/x86/vm/x86_32.ad	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/src/cpu/x86/vm/x86_32.ad	Thu Jun 12 13:50:55 2008 -0700
@@ -3806,6 +3806,78 @@
     masm.bind(DONE_LABEL);
   %}
 
+  enc_class enc_Array_Equals(eDIRegP ary1, eSIRegP ary2, eAXRegI tmp1, eBXRegI tmp2, eCXRegI result) %{
+    Label TRUE_LABEL, FALSE_LABEL, DONE_LABEL, COMPARE_LOOP_HDR, COMPARE_LOOP;
+    MacroAssembler masm(&cbuf);
+
+    Register ary1Reg   = as_Register($ary1$$reg);
+    Register ary2Reg   = as_Register($ary2$$reg);
+    Register tmp1Reg   = as_Register($tmp1$$reg);
+    Register tmp2Reg   = as_Register($tmp2$$reg);
+    Register resultReg = as_Register($result$$reg);
+
+    int length_offset  = arrayOopDesc::length_offset_in_bytes();
+    int base_offset    = arrayOopDesc::base_offset_in_bytes(T_CHAR);
+
+    // Check the input args
+    masm.cmpl(ary1Reg, ary2Reg);
+    masm.jcc(Assembler::equal, TRUE_LABEL);
+    masm.testl(ary1Reg, ary1Reg);
+    masm.jcc(Assembler::zero, FALSE_LABEL);
+    masm.testl(ary2Reg, ary2Reg);
+    masm.jcc(Assembler::zero, FALSE_LABEL);
+
+    // Check the lengths
+    masm.movl(tmp2Reg, Address(ary1Reg, length_offset));
+    masm.movl(resultReg, Address(ary2Reg, length_offset));
+    masm.cmpl(tmp2Reg, resultReg);
+    masm.jcc(Assembler::notEqual, FALSE_LABEL);
+    masm.testl(resultReg, resultReg);
+    masm.jcc(Assembler::zero, TRUE_LABEL);
+
+    // Get the number of 4 byte vectors to compare
+    masm.shrl(resultReg, 1);
+
+    // Check for odd-length arrays
+    masm.andl(tmp2Reg, 1);
+    masm.testl(tmp2Reg, tmp2Reg);
+    masm.jcc(Assembler::zero, COMPARE_LOOP_HDR);
+
+    // Compare 2-byte "tail" at end of arrays
+    masm.load_unsigned_word(tmp1Reg, Address(ary1Reg, resultReg, Address::times_4, base_offset));
+    masm.load_unsigned_word(tmp2Reg, Address(ary2Reg, resultReg, Address::times_4, base_offset));
+    masm.cmpl(tmp1Reg, tmp2Reg);
+    masm.jcc(Assembler::notEqual, FALSE_LABEL);
+    masm.testl(resultReg, resultReg);
+    masm.jcc(Assembler::zero, TRUE_LABEL);
+
+    // Setup compare loop
+    masm.bind(COMPARE_LOOP_HDR);
+    // Shift tmp1Reg and tmp2Reg to the last 4-byte boundary of the arrays
+    masm.leal(tmp1Reg, Address(ary1Reg, resultReg, Address::times_4, base_offset));
+    masm.leal(tmp2Reg, Address(ary2Reg, resultReg, Address::times_4, base_offset));
+    masm.negl(resultReg);
+
+    // 4-byte-wide compare loop
+    masm.bind(COMPARE_LOOP);
+    masm.movl(ary1Reg, Address(tmp1Reg, resultReg, Address::times_4, 0));
+    masm.movl(ary2Reg, Address(tmp2Reg, resultReg, Address::times_4, 0));
+    masm.cmpl(ary1Reg, ary2Reg);
+    masm.jcc(Assembler::notEqual, FALSE_LABEL);
+    masm.increment(resultReg);
+    masm.jcc(Assembler::notZero, COMPARE_LOOP);
+
+    masm.bind(TRUE_LABEL);
+    masm.movl(resultReg, 1);   // return true
+    masm.jmp(DONE_LABEL);
+
+    masm.bind(FALSE_LABEL);
+    masm.xorl(resultReg, resultReg); // return false
+
+    // That's it
+    masm.bind(DONE_LABEL);
+  %}
+
   enc_class enc_pop_rdx() %{
     emit_opcode(cbuf,0x5A);
   %}
@@ -11565,6 +11637,17 @@
   ins_pipe( pipe_slow );
 %}
 
+// fast array equals
+instruct array_equals(eDIRegP ary1, eSIRegP ary2, eAXRegI tmp1, eBXRegI tmp2, eCXRegI result, eFlagsReg cr) %{
+  match(Set result (AryEq ary1 ary2));
+  effect(USE_KILL ary1, USE_KILL ary2, KILL tmp1, KILL tmp2, KILL cr);
+  //ins_cost(300);
+
+  format %{ "Array Equals $ary1,$ary2 -> $result    // KILL EAX, EBX" %}
+  ins_encode( enc_Array_Equals(ary1, ary2, tmp1, tmp2, result) );
+  ins_pipe( pipe_slow );
+%}
+
 //----------Control Flow Instructions------------------------------------------
 // Signed compare Instructions
 instruct compI_eReg(eFlagsReg cr, eRegI op1, eRegI op2) %{
--- a/hotspot/src/cpu/x86/vm/x86_64.ad	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/src/cpu/x86/vm/x86_64.ad	Thu Jun 12 13:50:55 2008 -0700
@@ -3808,6 +3808,78 @@
     masm.bind(DONE_LABEL);
   %}
 
+  enc_class enc_Array_Equals(rdi_RegP ary1, rsi_RegP ary2, rax_RegI tmp1, rbx_RegI tmp2, rcx_RegI result) %{
+    Label TRUE_LABEL, FALSE_LABEL, DONE_LABEL, COMPARE_LOOP_HDR, COMPARE_LOOP;
+    MacroAssembler masm(&cbuf);
+
+    Register ary1Reg   = as_Register($ary1$$reg);
+    Register ary2Reg   = as_Register($ary2$$reg);
+    Register tmp1Reg   = as_Register($tmp1$$reg);
+    Register tmp2Reg   = as_Register($tmp2$$reg);
+    Register resultReg = as_Register($result$$reg);
+
+    int length_offset  = arrayOopDesc::length_offset_in_bytes();
+    int base_offset    = arrayOopDesc::base_offset_in_bytes(T_CHAR);
+
+    // Check the input args
+    masm.cmpq(ary1Reg, ary2Reg);                        
+    masm.jcc(Assembler::equal, TRUE_LABEL);
+    masm.testq(ary1Reg, ary1Reg);                       
+    masm.jcc(Assembler::zero, FALSE_LABEL);
+    masm.testq(ary2Reg, ary2Reg);                       
+    masm.jcc(Assembler::zero, FALSE_LABEL);
+
+    // Check the lengths
+    masm.movl(tmp2Reg, Address(ary1Reg, length_offset));
+    masm.movl(resultReg, Address(ary2Reg, length_offset));
+    masm.cmpl(tmp2Reg, resultReg);
+    masm.jcc(Assembler::notEqual, FALSE_LABEL);
+    masm.testl(resultReg, resultReg);
+    masm.jcc(Assembler::zero, TRUE_LABEL);
+
+    // Get the number of 4 byte vectors to compare
+    masm.shrl(resultReg, 1);
+
+    // Check for odd-length arrays
+    masm.andl(tmp2Reg, 1);
+    masm.testl(tmp2Reg, tmp2Reg);
+    masm.jcc(Assembler::zero, COMPARE_LOOP_HDR);
+
+    // Compare 2-byte "tail" at end of arrays
+    masm.load_unsigned_word(tmp1Reg, Address(ary1Reg, resultReg, Address::times_4, base_offset));
+    masm.load_unsigned_word(tmp2Reg, Address(ary2Reg, resultReg, Address::times_4, base_offset));
+    masm.cmpl(tmp1Reg, tmp2Reg);
+    masm.jcc(Assembler::notEqual, FALSE_LABEL);
+    masm.testl(resultReg, resultReg);
+    masm.jcc(Assembler::zero, TRUE_LABEL);
+
+    // Setup compare loop
+    masm.bind(COMPARE_LOOP_HDR);
+    // Shift tmp1Reg and tmp2Reg to the last 4-byte boundary of the arrays
+    masm.leaq(tmp1Reg, Address(ary1Reg, resultReg, Address::times_4, base_offset));
+    masm.leaq(tmp2Reg, Address(ary2Reg, resultReg, Address::times_4, base_offset));
+    masm.negq(resultReg);
+
+    // 4-byte-wide compare loop
+    masm.bind(COMPARE_LOOP);
+    masm.movl(ary1Reg, Address(tmp1Reg, resultReg, Address::times_4, 0));
+    masm.movl(ary2Reg, Address(tmp2Reg, resultReg, Address::times_4, 0));
+    masm.cmpl(ary1Reg, ary2Reg);
+    masm.jcc(Assembler::notEqual, FALSE_LABEL);
+    masm.incrementq(resultReg);
+    masm.jcc(Assembler::notZero, COMPARE_LOOP);
+
+    masm.bind(TRUE_LABEL);
+    masm.movl(resultReg, 1);   // return true
+    masm.jmp(DONE_LABEL);
+
+    masm.bind(FALSE_LABEL);
+    masm.xorl(resultReg, resultReg); // return false
+
+    // That's it
+    masm.bind(DONE_LABEL);
+  %}
+
   enc_class enc_rethrow()
   %{
     cbuf.set_inst_mark();
@@ -5202,15 +5274,15 @@
   %}
 %}
 
-// Indirect Memory Times Scale Plus Index Register Plus Offset Operand
-operand indIndexScaleOffsetComp(rRegN src, immL32 off, r12RegL base) %{
+// Indirect Narrow Oop Plus Offset Operand
+operand indNarrowOopOffset(rRegN src, immL32 off) %{
   constraint(ALLOC_IN_RC(ptr_reg));
-  match(AddP (DecodeN src base) off);
+  match(AddP (DecodeN src) off);
 
   op_cost(10);
-  format %{"[$base + $src << 3 + $off] (compressed)" %}
+  format %{"[R12 + $src << 3 + $off] (compressed oop addressing)" %}
   interface(MEMORY_INTER) %{
-    base($base);
+    base(0xc); // R12
     index($src);
     scale(0x3);
     disp($off);
@@ -5365,7 +5437,7 @@
 
 opclass memory(indirect, indOffset8, indOffset32, indIndexOffset, indIndex,
                indIndexScale, indIndexScaleOffset, indPosIndexScaleOffset,
-               indIndexScaleOffsetComp);
+               indNarrowOopOffset);
 
 //----------PIPELINE-----------------------------------------------------------
 // Rules which define the behavior of the target architectures pipeline.
@@ -6044,10 +6116,9 @@
 %}
 
 // Load Compressed Pointer
-instruct loadN(rRegN dst, memory mem, rFlagsReg cr)
+instruct loadN(rRegN dst, memory mem)
 %{
    match(Set dst (LoadN mem));
-   effect(KILL cr);
 
    ins_cost(125); // XXX
    format %{ "movl    $dst, $mem\t# compressed ptr" %}
@@ -6064,7 +6135,6 @@
 instruct loadKlass(rRegP dst, memory mem)
 %{
   match(Set dst (LoadKlass mem));
-  predicate(!n->in(MemNode::Address)->bottom_type()->is_narrow());
 
   ins_cost(125); // XXX
   format %{ "movq    $dst, $mem\t# class" %}
@@ -6073,22 +6143,17 @@
   ins_pipe(ialu_reg_mem); // XXX
 %}
 
-// Load Klass Pointer
-instruct loadKlassComp(rRegP dst, memory mem)
-%{
-  match(Set dst (LoadKlass mem));
-  predicate(n->in(MemNode::Address)->bottom_type()->is_narrow());
+// Load narrow Klass Pointer
+instruct loadNKlass(rRegN dst, memory mem)
+%{
+  match(Set dst (LoadNKlass mem));
 
   ins_cost(125); // XXX
-  format %{ "movl    $dst, $mem\t# compressed class\n\t"
-            "decode_heap_oop $dst,$dst" %}
+  format %{ "movl    $dst, $mem\t# compressed klass ptr" %}
   ins_encode %{
     Address addr = build_address($mem$$base, $mem$$index, $mem$$scale, $mem$$disp);
     Register dst = as_Register($dst$$reg);
     __ movl(dst, addr);
-    // klass is never null in the header but this is generated for all
-    // klass loads not just the _klass field in the header.
-    __ decode_heap_oop(dst);
   %}
   ins_pipe(ialu_reg_mem); // XXX
 %}
@@ -6362,16 +6427,14 @@
   match(Set dst src);
 
   ins_cost(125);
-  format %{ "movq    $dst, $src\t# compressed ptr\n\t"
-            "encode_heap_oop_not_null $dst,$dst" %}
+  format %{ "movl    $dst, $src\t# compressed ptr" %}
   ins_encode %{
     address con = (address)$src$$constant;
     Register dst = $dst$$Register;
     if (con == NULL) {
       ShouldNotReachHere();
     } else {
-      __ movoop(dst, (jobject)$src$$constant);
-      __ encode_heap_oop_not_null(dst);
+      __ set_narrow_oop(dst, (jobject)$src$$constant);
     }
   %}
   ins_pipe(ialu_reg_fat); // XXX
@@ -6633,13 +6696,12 @@
 %}
 
 // Store Compressed Pointer
-instruct storeN(memory mem, rRegN src, rFlagsReg cr)
+instruct storeN(memory mem, rRegN src)
 %{
   match(Set mem (StoreN mem src));
-  effect(KILL cr);
 
   ins_cost(125); // XXX
-  format %{ "movl    $mem, $src\t# ptr" %}
+  format %{ "movl    $mem, $src\t# compressed ptr" %}
   ins_encode %{
     Address addr = build_address($mem$$base, $mem$$index, $mem$$scale, $mem$$disp);
     Register src = as_Register($src$$reg);
@@ -7027,7 +7089,8 @@
 %}
 
 instruct decodeHeapOop(rRegP dst, rRegN src, rFlagsReg cr) %{
-  predicate(n->bottom_type()->is_oopptr()->ptr() != TypePtr::NotNull);
+  predicate(n->bottom_type()->is_oopptr()->ptr() != TypePtr::NotNull &&
+            n->bottom_type()->is_oopptr()->ptr() != TypePtr::Constant);
   match(Set dst (DecodeN src));
   effect(KILL cr);
   format %{ "decode_heap_oop $dst,$src" %}
@@ -7043,7 +7106,8 @@
 %}
 
 instruct decodeHeapOop_not_null(rRegP dst, rRegN src) %{
-  predicate(n->bottom_type()->is_oopptr()->ptr() == TypePtr::NotNull);
+  predicate(n->bottom_type()->is_oopptr()->ptr() == TypePtr::NotNull ||
+            n->bottom_type()->is_oopptr()->ptr() == TypePtr::Constant);
   match(Set dst (DecodeN src));
   format %{ "decode_heap_oop_not_null $dst,$src" %}
   ins_encode %{
@@ -7143,6 +7207,30 @@
 %}
 
 // Conditional move
+instruct cmovN_reg(rRegN dst, rRegN src, rFlagsReg cr, cmpOp cop)
+%{
+  match(Set dst (CMoveN (Binary cop cr) (Binary dst src)));
+
+  ins_cost(200); // XXX
+  format %{ "cmovl$cop $dst, $src\t# signed, compressed ptr" %}
+  opcode(0x0F, 0x40);
+  ins_encode(REX_reg_reg(dst, src), enc_cmov(cop), reg_reg(dst, src));
+  ins_pipe(pipe_cmov_reg);
+%}
+
+// Conditional move
+instruct cmovN_regU(rRegN dst, rRegN src, rFlagsRegU cr, cmpOpU cop)
+%{
+  match(Set dst (CMoveN (Binary cop cr) (Binary dst src)));
+
+  ins_cost(200); // XXX
+  format %{ "cmovl$cop $dst, $src\t# unsigned, compressed ptr" %}
+  opcode(0x0F, 0x40);
+  ins_encode(REX_reg_reg(dst, src), enc_cmov(cop), reg_reg(dst, src));
+  ins_pipe(pipe_cmov_reg);
+%}
+
+// Conditional move
 instruct cmovP_reg(rRegP dst, rRegP src, rFlagsReg cr, cmpOp cop)
 %{
   match(Set dst (CMoveP (Binary cop cr) (Binary dst src)));
@@ -10862,6 +10950,18 @@
   ins_pipe( pipe_slow );
 %}
 
+// fast array equals
+instruct array_equals(rdi_RegP ary1, rsi_RegP ary2, rax_RegI tmp1, 
+                      rbx_RegI tmp2, rcx_RegI result, rFlagsReg cr) %{
+  match(Set result (AryEq ary1 ary2));
+  effect(USE_KILL ary1, USE_KILL ary2, KILL tmp1, KILL tmp2, KILL cr);
+  //ins_cost(300);
+
+  format %{ "Array Equals $ary1,$ary2 -> $result    // KILL RAX, RBX" %}
+  ins_encode( enc_Array_Equals(ary1, ary2, tmp1, tmp2, result) );
+  ins_pipe( pipe_slow );
+%}
+
 //----------Control Flow Instructions------------------------------------------
 // Signed compare Instructions
 
@@ -11055,14 +11155,50 @@
   ins_pipe(ialu_cr_reg_imm);
 %}
 
+
+instruct compN_rReg(rFlagsRegU cr, rRegN op1, rRegN op2)
+%{
+  match(Set cr (CmpN op1 op2));
+
+  format %{ "cmpl    $op1, $op2\t# compressed ptr" %}
+  ins_encode %{ __ cmpl(as_Register($op1$$reg), as_Register($op2$$reg)); %}
+  ins_pipe(ialu_cr_reg_reg);
+%}
+
+instruct compN_rReg_mem(rFlagsRegU cr, rRegN src, memory mem)
+%{
+  match(Set cr (CmpN src (LoadN mem)));
+
+  ins_cost(500); // XXX
+  format %{ "cmpl    $src, mem\t# compressed ptr" %}
+  ins_encode %{
+    Address adr = build_address($mem$$base, $mem$$index, $mem$$scale, $mem$$disp);
+    __ cmpl(as_Register($src$$reg), adr);
+  %}
+  ins_pipe(ialu_cr_reg_mem);
+%}
+
 instruct testN_reg(rFlagsReg cr, rRegN src, immN0 zero) %{
   match(Set cr (CmpN src zero));
 
-  format %{ "testl   $src, $src" %}
+  format %{ "testl   $src, $src\t# compressed ptr" %}
   ins_encode %{ __ testl($src$$Register, $src$$Register); %}
   ins_pipe(ialu_cr_reg_imm);
 %}
 
+instruct testN_reg_mem(rFlagsReg cr, memory mem, immN0 zero)
+%{
+  match(Set cr (CmpN (LoadN mem) zero));
+
+  ins_cost(500); // XXX
+  format %{ "testl   $mem, 0xffffffff\t# compressed ptr" %}
+  ins_encode %{
+    Address addr = build_address($mem$$base, $mem$$index, $mem$$scale, $mem$$disp);
+    __ cmpl(addr, (int)0xFFFFFFFF);
+  %}
+  ins_pipe(ialu_cr_reg_mem);
+%}
+
 // Yanked all unsigned pointer compare operations.
 // Pointer compares are done with CmpP which is already unsigned.
 
--- a/hotspot/src/os_cpu/linux_x86/vm/assembler_linux_x86_32.cpp	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/src/os_cpu/linux_x86/vm/assembler_linux_x86_32.cpp	Thu Jun 12 13:50:55 2008 -0700
@@ -40,7 +40,7 @@
   movptr(thread, tls);
 }
 
-bool MacroAssembler::needs_explicit_null_check(int offset) {
+bool MacroAssembler::needs_explicit_null_check(intptr_t offset) {
   // Linux kernel guarantees that the first page is always unmapped. Don't
   // assume anything more than that.
   bool offset_in_first_page =   0 <= offset  &&  offset < os::vm_page_size();
--- a/hotspot/src/os_cpu/linux_x86/vm/assembler_linux_x86_64.cpp	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/src/os_cpu/linux_x86/vm/assembler_linux_x86_64.cpp	Thu Jun 12 13:50:55 2008 -0700
@@ -66,8 +66,21 @@
    }
 }
 
-// NOTE: since the linux kernel resides at the low end of
-// user address space, no null pointer check is needed.
-bool MacroAssembler::needs_explicit_null_check(int offset) {
-  return offset < 0 || offset >= 0x100000;
+bool MacroAssembler::needs_explicit_null_check(intptr_t offset) {
+  // Exception handler checks the nmethod's implicit null checks table
+  // only when this method returns false.
+  if (UseCompressedOops) {
+    // The first page after heap_base is unmapped and
+    // the 'offset' is equal to [heap_base + offset] for
+    // narrow oop implicit null checks.
+    uintptr_t heap_base = (uintptr_t)Universe::heap_base();
+    if ((uintptr_t)offset >= heap_base) {
+      // Normalize offset for the next check.
+      offset = (intptr_t)(pointer_delta((void*)offset, (void*)heap_base, 1));
+    }
+  }
+  // Linux kernel guarantees that the first page is always unmapped. Don't
+  // assume anything more than that.
+  bool offset_in_first_page =   0 <= offset  &&  offset < os::vm_page_size();
+  return !offset_in_first_page;
 }
--- a/hotspot/src/os_cpu/solaris_x86/vm/assembler_solaris_x86_32.cpp	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/src/os_cpu/solaris_x86/vm/assembler_solaris_x86_32.cpp	Thu Jun 12 13:50:55 2008 -0700
@@ -80,7 +80,7 @@
   popl(thread);
 }
 
-bool MacroAssembler::needs_explicit_null_check(int offset) {
+bool MacroAssembler::needs_explicit_null_check(intptr_t offset) {
   // Identical to Sparc/Solaris code
   bool offset_in_first_page =   0 <= offset  &&  offset < os::vm_page_size();
   return !offset_in_first_page;
--- a/hotspot/src/os_cpu/solaris_x86/vm/assembler_solaris_x86_64.cpp	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/src/os_cpu/solaris_x86/vm/assembler_solaris_x86_64.cpp	Thu Jun 12 13:50:55 2008 -0700
@@ -86,8 +86,21 @@
   }
 }
 
-bool MacroAssembler::needs_explicit_null_check(int offset) {
+bool MacroAssembler::needs_explicit_null_check(intptr_t offset) {
   // Identical to Sparc/Solaris code
+
+  // Exception handler checks the nmethod's implicit null checks table
+  // only when this method returns false.
+  if (UseCompressedOops) {
+    // The first page after heap_base is unmapped and
+    // the 'offset' is equal to [heap_base + offset] for
+    // narrow oop implicit null checks.
+    uintptr_t heap_base = (uintptr_t)Universe::heap_base();
+    if ((uintptr_t)offset >= heap_base) {
+      // Normalize offset for the next check.
+      offset = (intptr_t)(pointer_delta((void*)offset, (void*)heap_base, 1));
+    }
+  }
   bool offset_in_first_page = 0 <= offset && offset < os::vm_page_size();
   return !offset_in_first_page;
 }
--- a/hotspot/src/os_cpu/windows_x86/vm/assembler_windows_x86_32.cpp	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/src/os_cpu/windows_x86/vm/assembler_windows_x86_32.cpp	Thu Jun 12 13:50:55 2008 -0700
@@ -59,6 +59,6 @@
   movl(thread, Address(thread, ThreadLocalStorage::get_thread_ptr_offset()));
 }
 
-bool MacroAssembler::needs_explicit_null_check(int offset) {
+bool MacroAssembler::needs_explicit_null_check(intptr_t offset) {
   return offset < 0 || (int)os::vm_page_size() <= offset;
 }
--- a/hotspot/src/os_cpu/windows_x86/vm/assembler_windows_x86_64.cpp	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/src/os_cpu/windows_x86/vm/assembler_windows_x86_64.cpp	Thu Jun 12 13:50:55 2008 -0700
@@ -66,6 +66,18 @@
    }
 }
 
-bool MacroAssembler::needs_explicit_null_check(int offset) {
-  return offset < 0 || (int)os::vm_page_size() <= offset;
+bool MacroAssembler::needs_explicit_null_check(intptr_t offset) {
+  // Exception handler checks the nmethod's implicit null checks table
+  // only when this method returns false.
+  if (UseCompressedOops) {
+    // The first page after heap_base is unmapped and
+    // the 'offset' is equal to [heap_base + offset] for
+    // narrow oop implicit null checks.
+    uintptr_t heap_base = (uintptr_t)Universe::heap_base();
+    if ((uintptr_t)offset >= heap_base) {
+      // Normalize offset for the next check.
+      offset = (intptr_t)(pointer_delta((void*)offset, (void*)heap_base, 1));
+    }
+  }
+  return offset < 0 || os::vm_page_size() <= offset;
 }
--- a/hotspot/src/share/vm/adlc/forms.cpp	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/src/share/vm/adlc/forms.cpp	Thu Jun 12 13:50:55 2008 -0700
@@ -252,6 +252,7 @@
   if( strcmp(opType,"LoadF")==0 )  return Form::idealF;
   if( strcmp(opType,"LoadI")==0 )  return Form::idealI;
   if( strcmp(opType,"LoadKlass")==0 )  return Form::idealP;
+  if( strcmp(opType,"LoadNKlass")==0 ) return Form::idealN;
   if( strcmp(opType,"LoadL")==0 )  return Form::idealL;
   if( strcmp(opType,"LoadL_unaligned")==0 )  return Form::idealL;
   if( strcmp(opType,"LoadPLocked")==0 )  return Form::idealP;
--- a/hotspot/src/share/vm/adlc/formssel.cpp	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/src/share/vm/adlc/formssel.cpp	Thu Jun 12 13:50:55 2008 -0700
@@ -3313,7 +3313,7 @@
     "Store8B","Store4B","Store8C","Store4C","Store2C",
     "Load4I" ,"Load2I" ,"Load2L" ,"Load2D" ,"Load4F" ,"Load2F" ,"Load16B" ,
     "Load8B" ,"Load4B" ,"Load8C" ,"Load4C" ,"Load2C" ,"Load8S", "Load4S","Load2S",
-    "LoadRange", "LoadKlass", "LoadL_unaligned", "LoadD_unaligned",
+    "LoadRange", "LoadKlass", "LoadNKlass", "LoadL_unaligned", "LoadD_unaligned",
     "LoadPLocked", "LoadLLocked",
     "StorePConditional", "StoreLConditional",
     "CompareAndSwapI", "CompareAndSwapL", "CompareAndSwapP", "CompareAndSwapN",
--- a/hotspot/src/share/vm/ci/bcEscapeAnalyzer.cpp	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/src/share/vm/ci/bcEscapeAnalyzer.cpp	Thu Jun 12 13:50:55 2008 -0700
@@ -218,6 +218,13 @@
   ciInstanceKlass* callee_holder = ciEnv::get_instance_klass_for_declared_method_holder(holder);
   ciInstanceKlass* actual_recv = callee_holder;
 
+  // some methods are obviously bindable without any type checks so
+  // convert them directly to an invokespecial.
+  if (target->is_loaded() && !target->is_abstract() &&
+      target->can_be_statically_bound() && code == Bytecodes::_invokevirtual) {
+    code = Bytecodes::_invokespecial;
+  }
+
   // compute size of arguments
   int arg_size = target->arg_size();
   if (!target->is_loaded() && code == Bytecodes::_invokestatic) {
--- a/hotspot/src/share/vm/ci/ciInstanceKlass.cpp	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/src/share/vm/ci/ciInstanceKlass.cpp	Thu Jun 12 13:50:55 2008 -0700
@@ -392,12 +392,12 @@
   assert(!is_java_lang_Object(), "bootstrap OK");
 
   // Size in bytes of my fields, including inherited fields.
-  int fsize = nonstatic_field_size() * wordSize;
+  int fsize = nonstatic_field_size() * heapOopSize;
 
   ciInstanceKlass* super = this->super();
   GrowableArray<ciField*>* super_fields = NULL;
   if (super != NULL && super->has_nonstatic_fields()) {
-    int super_fsize  = super->nonstatic_field_size() * wordSize;
+    int super_fsize  = super->nonstatic_field_size() * heapOopSize;
     int super_flen   = super->nof_nonstatic_fields();
     super_fields = super->_nonstatic_fields;
     assert(super_flen == 0 || super_fields != NULL, "first get nof_fields");
@@ -438,7 +438,7 @@
     // This is a minor inefficiency classFileParser.cpp.
     last_offset = offset + size;
   }
-  assert(last_offset <= (int)sizeof(oopDesc) + fsize, "no overflow");
+  assert(last_offset <= (int)instanceOopDesc::base_offset_in_bytes() + fsize, "no overflow");
 #endif
 
   _nonstatic_fields = fields;
--- a/hotspot/src/share/vm/ci/ciMethod.cpp	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/src/share/vm/ci/ciMethod.cpp	Thu Jun 12 13:50:55 2008 -0700
@@ -878,7 +878,7 @@
         (TieredCompilation && code->compiler() != NULL && code->compiler()->is_c1())) {
       return 0;
     }
-    return code->code_size();
+    return code->code_end() - code->verified_entry_point();
   )
 }
 
--- a/hotspot/src/share/vm/classfile/classFileParser.cpp	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/src/share/vm/classfile/classFileParser.cpp	Thu Jun 12 13:50:55 2008 -0700
@@ -44,6 +44,7 @@
 
 // Used for backward compatibility reasons:
 // - to check for javac bug fixes that happened after 1.5
+// - also used as the max version when running in jdk6
 #define JAVA_6_VERSION                    50
 
 
@@ -2664,8 +2665,8 @@
                                   fac.static_byte_count ), wordSize );
     static_field_size           = (next_static_type_offset -
                                   next_static_oop_offset) / wordSize;
-    first_nonstatic_field_offset = (instanceOopDesc::header_size() +
-                                    nonstatic_field_size) * wordSize;
+    first_nonstatic_field_offset = instanceOopDesc::base_offset_in_bytes() +
+                                   nonstatic_field_size * heapOopSize;
     next_nonstatic_field_offset = first_nonstatic_field_offset;
 
     // Add fake fields for java.lang.Class instances (also see below)
@@ -2734,9 +2735,9 @@
       next_nonstatic_byte_offset  = next_nonstatic_short_offset +
                                     (nonstatic_short_count * BytesPerShort);
       next_nonstatic_type_offset  = align_size_up((next_nonstatic_byte_offset +
-                                    nonstatic_byte_count ), wordSize );
+                                    nonstatic_byte_count ), heapOopSize );
       orig_nonstatic_field_size   = nonstatic_field_size +
-        ((next_nonstatic_type_offset - first_nonstatic_field_offset)/wordSize);
+      ((next_nonstatic_type_offset - first_nonstatic_field_offset)/heapOopSize);
     }
 #endif
     bool compact_fields   = CompactFields;
@@ -2791,18 +2792,8 @@
     int nonstatic_short_space_offset;
     int nonstatic_byte_space_offset;
 
-    bool compact_into_header = (UseCompressedOops &&
-                                allocation_style == 1 && compact_fields &&
-                                !super_has_nonstatic_fields);
-
-    if( compact_into_header || nonstatic_double_count > 0 ) {
-      int offset;
-      // Pack something in with the header if no super klass has done so.
-      if (compact_into_header) {
-        offset = oopDesc::klass_gap_offset_in_bytes();
-      } else {
-        offset = next_nonstatic_double_offset;
-      }
+    if( nonstatic_double_count > 0 ) {
+      int offset = next_nonstatic_double_offset;
       next_nonstatic_double_offset = align_size_up(offset, BytesPerLong);
       if( compact_fields && offset != next_nonstatic_double_offset ) {
         // Allocate available fields into the gap before double field.
@@ -2830,8 +2821,7 @@
         }
         // Allocate oop field in the gap if there are no other fields for that.
         nonstatic_oop_space_offset = offset;
-        if(!compact_into_header && length >= heapOopSize &&
-            nonstatic_oop_count > 0 &&
+        if( length >= heapOopSize && nonstatic_oop_count > 0 &&
             allocation_style != 0 ) { // when oop fields not first
           nonstatic_oop_count      -= 1;
           nonstatic_oop_space_count = 1; // Only one will fit
@@ -2854,14 +2844,13 @@
     } else { // allocation_style == 1
       next_nonstatic_oop_offset = next_nonstatic_byte_offset + nonstatic_byte_count;
       if( nonstatic_oop_count > 0 ) {
-        notaligned_offset = next_nonstatic_oop_offset;
         next_nonstatic_oop_offset = align_size_up(next_nonstatic_oop_offset, heapOopSize);
       }
       notaligned_offset = next_nonstatic_oop_offset + (nonstatic_oop_count * heapOopSize);
     }
-    next_nonstatic_type_offset = align_size_up(notaligned_offset, wordSize );
+    next_nonstatic_type_offset = align_size_up(notaligned_offset, heapOopSize );
     nonstatic_field_size = nonstatic_field_size + ((next_nonstatic_type_offset
-                                      - first_nonstatic_field_offset)/wordSize);
+                                   - first_nonstatic_field_offset)/heapOopSize);
 
     // Iterate over fields again and compute correct offsets.
     // The field allocation type was temporarily stored in the offset slot.
@@ -2962,9 +2951,10 @@
     // Size of instances
     int instance_size;
 
+    next_nonstatic_type_offset = align_size_up(notaligned_offset, wordSize );
     instance_size = align_object_size(next_nonstatic_type_offset / wordSize);
 
-    assert(instance_size == align_object_size(instanceOopDesc::header_size() + nonstatic_field_size), "consistent layout helper value");
+    assert(instance_size == align_object_size(align_size_up((instanceOopDesc::base_offset_in_bytes() + nonstatic_field_size*heapOopSize), wordSize) / wordSize), "consistent layout helper value");
 
     // Size of non-static oop map blocks (in words) allocated at end of klass
     int nonstatic_oop_map_size = compute_oop_map_size(super_klass, nonstatic_oop_map_count, first_nonstatic_oop_offset);
@@ -3122,13 +3112,15 @@
 #ifndef PRODUCT
     if( PrintCompactFieldsSavings ) {
       if( nonstatic_field_size < orig_nonstatic_field_size ) {
-        tty->print("[Saved %d of %3d words in %s]\n",
-                 orig_nonstatic_field_size - nonstatic_field_size,
-                 orig_nonstatic_field_size, this_klass->external_name());
+        tty->print("[Saved %d of %d bytes in %s]\n",
+                 (orig_nonstatic_field_size - nonstatic_field_size)*heapOopSize,
+                 orig_nonstatic_field_size*heapOopSize,
+                 this_klass->external_name());
       } else if( nonstatic_field_size > orig_nonstatic_field_size ) {
-        tty->print("[Wasted %d over %3d words in %s]\n",
-                 nonstatic_field_size - orig_nonstatic_field_size,
-                 orig_nonstatic_field_size, this_klass->external_name());
+        tty->print("[Wasted %d over %d bytes in %s]\n",
+                 (nonstatic_field_size - orig_nonstatic_field_size)*heapOopSize,
+                 orig_nonstatic_field_size*heapOopSize,
+                 this_klass->external_name());
       }
     }
 #endif
@@ -3516,9 +3508,11 @@
 }
 
 bool ClassFileParser::is_supported_version(u2 major, u2 minor) {
+  u2 max_version = JDK_Version::is_gte_jdk17x_version() ?
+    JAVA_MAX_SUPPORTED_VERSION : JAVA_6_VERSION;
   return (major >= JAVA_MIN_SUPPORTED_VERSION) &&
-         (major <= JAVA_MAX_SUPPORTED_VERSION) &&
-         ((major != JAVA_MAX_SUPPORTED_VERSION) ||
+         (major <= max_version) &&
+         ((major != max_version) ||
           (minor <= JAVA_MAX_SUPPORTED_MINOR_VERSION));
 }
 
--- a/hotspot/src/share/vm/classfile/javaClasses.cpp	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/src/share/vm/classfile/javaClasses.cpp	Thu Jun 12 13:50:55 2008 -0700
@@ -1872,7 +1872,7 @@
       box->float_field_put(value_offset, value->f);
       break;
     case T_DOUBLE:
-      box->double_field_put(value_offset, value->d);
+      box->double_field_put(long_value_offset, value->d);
       break;
     case T_BYTE:
       box->byte_field_put(value_offset, value->b);
@@ -1884,7 +1884,7 @@
       box->int_field_put(value_offset, value->i);
       break;
     case T_LONG:
-      box->long_field_put(value_offset, value->j);
+      box->long_field_put(long_value_offset, value->j);
       break;
     default:
       return NULL;
@@ -1915,7 +1915,7 @@
     value->f = box->float_field(value_offset);
     break;
   case T_DOUBLE:
-    value->d = box->double_field(value_offset);
+    value->d = box->double_field(long_value_offset);
     break;
   case T_BYTE:
     value->b = box->byte_field(value_offset);
@@ -1927,7 +1927,7 @@
     value->i = box->int_field(value_offset);
     break;
   case T_LONG:
-    value->j = box->long_field(value_offset);
+    value->j = box->long_field(long_value_offset);
     break;
   default:
     return T_ILLEGAL;
@@ -1949,7 +1949,7 @@
     box->float_field_put(value_offset, value->f);
     break;
   case T_DOUBLE:
-    box->double_field_put(value_offset, value->d);
+    box->double_field_put(long_value_offset, value->d);
     break;
   case T_BYTE:
     box->byte_field_put(value_offset, value->b);
@@ -1961,7 +1961,7 @@
     box->int_field_put(value_offset, value->i);
     break;
   case T_LONG:
-    box->long_field_put(value_offset, value->j);
+    box->long_field_put(long_value_offset, value->j);
     break;
   default:
     return T_ILLEGAL;
@@ -2163,6 +2163,7 @@
 int java_lang_reflect_Field::signature_offset;
 int java_lang_reflect_Field::annotations_offset;
 int java_lang_boxing_object::value_offset;
+int java_lang_boxing_object::long_value_offset;
 int java_lang_ref_Reference::referent_offset;
 int java_lang_ref_Reference::queue_offset;
 int java_lang_ref_Reference::next_offset;
@@ -2282,10 +2283,7 @@
 // are not available to determine the offset_of_static_fields.
 void JavaClasses::compute_hard_coded_offsets() {
   const int x = heapOopSize;
-  // Objects don't get allocated in the gap in the header with compressed oops
-  // for these special classes because hard coded offsets can't be conditional
-  // so base_offset_in_bytes() is wrong here, allocate after the header.
-  const int header = sizeof(instanceOopDesc);
+  const int header = instanceOopDesc::base_offset_in_bytes();
 
   // Do the String Class
   java_lang_String::value_offset  = java_lang_String::hc_value_offset  * x + header;
@@ -2308,7 +2306,8 @@
   java_lang_Throwable::stackTrace_offset = java_lang_Throwable::hc_stackTrace_offset * x + header;
 
   // java_lang_boxing_object
-  java_lang_boxing_object::value_offset = java_lang_boxing_object::hc_value_offset * x + header;
+  java_lang_boxing_object::value_offset = java_lang_boxing_object::hc_value_offset + header;
+  java_lang_boxing_object::long_value_offset = align_size_up((java_lang_boxing_object::hc_value_offset + header), BytesPerLong);
 
   // java_lang_ref_Reference:
   java_lang_ref_Reference::referent_offset = java_lang_ref_Reference::hc_referent_offset * x + header;
@@ -2322,7 +2321,7 @@
   java_lang_ref_Reference::number_of_fake_oop_fields = 1;
 
   // java_lang_ref_SoftReference Class
-  java_lang_ref_SoftReference::timestamp_offset = java_lang_ref_SoftReference::hc_timestamp_offset * x + header;
+  java_lang_ref_SoftReference::timestamp_offset = align_size_up((java_lang_ref_SoftReference::hc_timestamp_offset * x + header), BytesPerLong);
   // Don't multiply static fields because they are always in wordSize units
   java_lang_ref_SoftReference::static_clock_offset = java_lang_ref_SoftReference::hc_static_clock_offset * x;
 
@@ -2469,6 +2468,9 @@
 #define CHECK_OFFSET(klass_name, cpp_klass_name, field_name, field_sig) \
   valid &= check_offset(klass_name, cpp_klass_name :: field_name ## _offset, #field_name, field_sig)
 
+#define CHECK_LONG_OFFSET(klass_name, cpp_klass_name, field_name, field_sig) \
+  valid &= check_offset(klass_name, cpp_klass_name :: long_ ## field_name ## _offset, #field_name, field_sig)
+
 #define CHECK_STATIC_OFFSET(klass_name, cpp_klass_name, field_name, field_sig) \
   valid &= check_static_offset(klass_name, cpp_klass_name :: static_ ## field_name ## _offset, #field_name, field_sig)
 
@@ -2501,11 +2503,11 @@
   CHECK_OFFSET("java/lang/Boolean",   java_lang_boxing_object, value, "Z");
   CHECK_OFFSET("java/lang/Character", java_lang_boxing_object, value, "C");
   CHECK_OFFSET("java/lang/Float",     java_lang_boxing_object, value, "F");
-  CHECK_OFFSET("java/lang/Double",    java_lang_boxing_object, value, "D");
+  CHECK_LONG_OFFSET("java/lang/Double", java_lang_boxing_object, value, "D");
   CHECK_OFFSET("java/lang/Byte",      java_lang_boxing_object, value, "B");
   CHECK_OFFSET("java/lang/Short",     java_lang_boxing_object, value, "S");
   CHECK_OFFSET("java/lang/Integer",   java_lang_boxing_object, value, "I");
-  CHECK_OFFSET("java/lang/Long",      java_lang_boxing_object, value, "J");
+  CHECK_LONG_OFFSET("java/lang/Long", java_lang_boxing_object, value, "J");
 
   // java.lang.ClassLoader
 
--- a/hotspot/src/share/vm/classfile/javaClasses.hpp	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/src/share/vm/classfile/javaClasses.hpp	Thu Jun 12 13:50:55 2008 -0700
@@ -653,6 +653,7 @@
    hc_value_offset = 0
   };
   static int value_offset;
+  static int long_value_offset;
 
   static oop initialize_and_allocate(BasicType type, TRAPS);
  public:
@@ -665,7 +666,10 @@
   static bool is_instance(oop box)                 { return basic_type(box) != T_ILLEGAL; }
   static bool is_instance(oop box, BasicType type) { return basic_type(box) == type; }
 
-  static int value_offset_in_bytes() { return value_offset; }
+  static int value_offset_in_bytes(BasicType type) {
+    return ( type == T_LONG || type == T_DOUBLE ) ? long_value_offset :
+                                                    value_offset;
+  }
 
   // Debugging
   friend class JavaClasses;
@@ -747,7 +751,7 @@
  public:
   enum {
    // The timestamp is a long field and may need to be adjusted for alignment.
-   hc_timestamp_offset    = align_object_offset_(hc_discovered_offset + 1)
+   hc_timestamp_offset  = hc_discovered_offset + 1
   };
   enum {
    hc_static_clock_offset = 0
--- a/hotspot/src/share/vm/classfile/vmSymbols.hpp	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/src/share/vm/classfile/vmSymbols.hpp	Thu Jun 12 13:50:55 2008 -0700
@@ -564,6 +564,10 @@
    do_name(     copyOfRange_name,                                "copyOfRange")                                         \
    do_signature(copyOfRange_signature,        "([Ljava/lang/Object;IILjava/lang/Class;)[Ljava/lang/Object;")            \
                                                                                                                         \
+  do_intrinsic(_equalsC,                  java_util_Arrays,       equals_name,    equalsC_signature,             F_S)   \
+   do_name(     equals_name,                                     "equals")                                              \
+   do_signature(equalsC_signature,                               "([C[C)Z")                                             \
+                                                                                                                        \
   do_intrinsic(_invoke,                   java_lang_reflect_Method, invoke_name, object_array_object_object_signature, F_R) \
   /*   (symbols invoke_name and invoke_signature defined above) */                                                      \
                                                                                                                         \
--- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/binaryTreeDictionary.hpp	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/binaryTreeDictionary.hpp	Thu Jun 12 13:50:55 2008 -0700
@@ -130,6 +130,7 @@
 const size_t MIN_TREE_CHUNK_SIZE  = sizeof(TreeChunk)/HeapWordSize;
 
 class BinaryTreeDictionary: public FreeBlockDictionary {
+  friend class VMStructs;
   bool       _splay;
   size_t     _totalSize;
   size_t     _totalFreeBlocks;
--- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp	Thu Jun 12 13:50:55 2008 -0700
@@ -805,28 +805,30 @@
   // This must be volatile, or else there is a danger that the compiler
   // will compile the code below into a sometimes-infinite loop, by keeping
   // the value read the first time in a register.
-  oop o = (oop)p;
-  volatile oop* second_word_addr = o->klass_addr();
   while (true) {
-    klassOop k = (klassOop)(*second_word_addr);
     // We must do this until we get a consistent view of the object.
-    if (FreeChunk::secondWordIndicatesFreeChunk((intptr_t)k)) {
-      FreeChunk* fc = (FreeChunk*)p;
-      volatile size_t* sz_addr = (volatile size_t*)(fc->size_addr());
-      size_t res = (*sz_addr);
-      klassOop k2 = (klassOop)(*second_word_addr);  // Read to confirm.
-      if (k == k2) {
+    if (FreeChunk::indicatesFreeChunk(p)) {
+      volatile FreeChunk* fc = (volatile FreeChunk*)p;
+      size_t res = fc->size();
+      // If the object is still a free chunk, return the size, else it
+      // has been allocated so try again.
+      if (FreeChunk::indicatesFreeChunk(p)) {
         assert(res != 0, "Block size should not be 0");
         return res;
       }
-    } else if (k != NULL) {
-      assert(k->is_oop(true /* ignore mark word */), "Should really be klass oop.");
-      assert(o->is_parsable(), "Should be parsable");
-      assert(o->is_oop(true /* ignore mark word */), "Should be an oop.");
-      size_t res = o->size_given_klass(k->klass_part());
-      res = adjustObjectSize(res);
-      assert(res != 0, "Block size should not be 0");
-      return res;
+    } else {
+      // must read from what 'p' points to in each loop.
+      klassOop k = ((volatile oopDesc*)p)->klass_or_null();
+      if (k != NULL) {
+        assert(k->is_oop(true /* ignore mark word */), "Should really be klass oop.");
+        oop o = (oop)p;
+        assert(o->is_parsable(), "Should be parsable");
+        assert(o->is_oop(true /* ignore mark word */), "Should be an oop.");
+        size_t res = o->size_given_klass(k->klass_part());
+        res = adjustObjectSize(res);
+        assert(res != 0, "Block size should not be 0");
+        return res;
+      }
     }
   }
 }
@@ -845,31 +847,31 @@
   // This must be volatile, or else there is a danger that the compiler
   // will compile the code below into a sometimes-infinite loop, by keeping
   // the value read the first time in a register.
-  oop o = (oop)p;
-  volatile oop* second_word_addr = o->klass_addr();
   DEBUG_ONLY(uint loops = 0;)
   while (true) {
-    klassOop k = (klassOop)(*second_word_addr);
     // We must do this until we get a consistent view of the object.
-    if (FreeChunk::secondWordIndicatesFreeChunk((intptr_t)k)) {
-      FreeChunk* fc = (FreeChunk*)p;
-      volatile size_t* sz_addr = (volatile size_t*)(fc->size_addr());
-      size_t res = (*sz_addr);
-      klassOop k2 = (klassOop)(*second_word_addr);  // Read to confirm.
-      if (k == k2) {
+    if (FreeChunk::indicatesFreeChunk(p)) {
+      volatile FreeChunk* fc = (volatile FreeChunk*)p;
+      size_t res = fc->size();
+      if (FreeChunk::indicatesFreeChunk(p)) {
         assert(res != 0, "Block size should not be 0");
         assert(loops == 0, "Should be 0");
         return res;
       }
-    } else if (k != NULL && o->is_parsable()) {
-      assert(k->is_oop(), "Should really be klass oop.");
-      assert(o->is_oop(), "Should be an oop");
-      size_t res = o->size_given_klass(k->klass_part());
-      res = adjustObjectSize(res);
-      assert(res != 0, "Block size should not be 0");
-      return res;
     } else {
-      return c->block_size_if_printezis_bits(p);
+      // must read from what 'p' points to in each loop.
+      klassOop k = ((volatile oopDesc*)p)->klass_or_null();
+      if (k != NULL && ((oopDesc*)p)->is_parsable()) {
+        assert(k->is_oop(), "Should really be klass oop.");
+        oop o = (oop)p;
+        assert(o->is_oop(), "Should be an oop");
+        size_t res = o->size_given_klass(k->klass_part());
+        res = adjustObjectSize(res);
+        assert(res != 0, "Block size should not be 0");
+        return res;
+      } else {
+        return c->block_size_if_printezis_bits(p);
+      }
     }
     assert(loops == 0, "Can loop at most once");
     DEBUG_ONLY(loops++;)
@@ -907,9 +909,8 @@
   // and those objects (if garbage) may have been modified to hold
   // live range information.
   // assert(ParallelGCThreads > 0 || _bt.block_start(p) == p, "Should be a block boundary");
-  klassOop k = oop(p)->klass();
-  intptr_t ki = (intptr_t)k;
-  if (FreeChunk::secondWordIndicatesFreeChunk(ki)) return false;
+  if (FreeChunk::indicatesFreeChunk(p)) return false;
+  klassOop k = oop(p)->klass_or_null();
   if (k != NULL) {
     // Ignore mark word because it may have been used to
     // chain together promoted objects (the last one
@@ -1027,7 +1028,7 @@
     FreeChunk* fc = (FreeChunk*)res;
     fc->markNotFree();
     assert(!fc->isFree(), "shouldn't be marked free");
-    assert(oop(fc)->klass() == NULL, "should look uninitialized");
+    assert(oop(fc)->klass_or_null() == NULL, "should look uninitialized");
     // Verify that the block offset table shows this to
     // be a single block, but not one which is unallocated.
     _bt.verify_single_block(res, size);
@@ -2593,7 +2594,7 @@
   }
   res->markNotFree();
   assert(!res->isFree(), "shouldn't be marked free");
-  assert(oop(res)->klass() == NULL, "should look uninitialized");
+  assert(oop(res)->klass_or_null() == NULL, "should look uninitialized");
   // mangle a just allocated object with a distinct pattern.
   debug_only(res->mangleAllocated(word_sz));
   return (HeapWord*)res;
--- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp	Thu Jun 12 13:50:55 2008 -0700
@@ -190,7 +190,8 @@
   // depends on this property.
   debug_only(
     FreeChunk* junk = NULL;
-    assert(junk->prev_addr() == (void*)(oop(junk)->klass_addr()),
+    assert(UseCompressedOops ||
+           junk->prev_addr() == (void*)(oop(junk)->klass_addr()),
            "Offset of FreeChunk::_prev within FreeChunk must match"
            "  that of OopDesc::_klass within OopDesc");
   )
@@ -1039,7 +1040,7 @@
                                       // mark end of object
   }
   // check that oop looks uninitialized
-  assert(oop(start)->klass() == NULL, "_klass should be NULL");
+  assert(oop(start)->klass_or_null() == NULL, "_klass should be NULL");
 }
 
 void CMSCollector::promoted(bool par, HeapWord* start,
@@ -1309,17 +1310,25 @@
      }
   }
   oop obj = oop(obj_ptr);
-  assert(obj->klass() == NULL, "Object should be uninitialized here.");
+  assert(obj->klass_or_null() == NULL, "Object should be uninitialized here.");
   // Otherwise, copy the object.  Here we must be careful to insert the
   // klass pointer last, since this marks the block as an allocated object.
+  // Except with compressed oops it's the mark word.
   HeapWord* old_ptr = (HeapWord*)old;
   if (word_sz > (size_t)oopDesc::header_size()) {
     Copy::aligned_disjoint_words(old_ptr + oopDesc::header_size(),
                                  obj_ptr + oopDesc::header_size(),
                                  word_sz - oopDesc::header_size());
   }
+
+  if (UseCompressedOops) {
+    // Copy gap missed by (aligned) header size calculation above
+    obj->set_klass_gap(old->klass_gap());
+  }
+
   // Restore the mark word copied above.
   obj->set_mark(m);
+
   // Now we can track the promoted object, if necessary.  We take care
   // To delay the transition from uninitialized to full object
   // (i.e., insertion of klass pointer) until after, so that it
@@ -1327,7 +1336,8 @@
   if (promoInfo->tracking()) {
     promoInfo->track((PromotedObject*)obj, old->klass());
   }
-  // Finally, install the klass pointer.
+
+  // Finally, install the klass pointer (this should be volatile).
   obj->set_klass(old->klass());
 
   assert(old->is_oop(), "Will dereference klass ptr below");
@@ -6169,7 +6179,7 @@
 HeapWord* CMSCollector::next_card_start_after_block(HeapWord* addr) const {
   size_t sz = 0;
   oop p = (oop)addr;
-  if (p->klass() != NULL && p->is_parsable()) {
+  if (p->klass_or_null() != NULL && p->is_parsable()) {
     sz = CompactibleFreeListSpace::adjustObjectSize(p->size());
   } else {
     sz = block_size_using_printezis_bits(addr);
@@ -6606,7 +6616,7 @@
   }
   if (_bitMap->isMarked(addr)) {
     // it's marked; is it potentially uninitialized?
-    if (p->klass() != NULL) {
+    if (p->klass_or_null() != NULL) {
       if (CMSPermGenPrecleaningEnabled && !p->is_parsable()) {
         // Signal precleaning to redirty the card since
         // the klass pointer is already installed.
@@ -6619,11 +6629,8 @@
         if (p->is_objArray()) {
           // objArrays are precisely marked; restrict scanning
           // to dirty cards only.
-          size = p->oop_iterate(_scanningClosure, mr);
-          assert(size == CompactibleFreeListSpace::adjustObjectSize(size),
-                 "adjustObjectSize should be the identity for array sizes, "
-                 "which are necessarily larger than minimum object size of "
-                 "two heap words");
+          size = CompactibleFreeListSpace::adjustObjectSize(
+                   p->oop_iterate(_scanningClosure, mr));
         } else {
           // A non-array may have been imprecisely marked; we need
           // to scan object in its entirety.
@@ -6657,7 +6664,7 @@
     }
   } else {
     // Either a not yet marked object or an uninitialized object
-    if (p->klass() == NULL || !p->is_parsable()) {
+    if (p->klass_or_null() == NULL || !p->is_parsable()) {
       // An uninitialized object, skip to the next card, since
       // we may not be able to read its P-bits yet.
       assert(size == 0, "Initial value");
@@ -6714,7 +6721,7 @@
   HeapWord* addr = (HeapWord*)p;
   DEBUG_ONLY(_collector->verify_work_stacks_empty();)
   assert(!_span.contains(addr), "we are scanning the survivor spaces");
-  assert(p->klass() != NULL, "object should be initializd");
+  assert(p->klass_or_null() != NULL, "object should be initializd");
   assert(p->is_parsable(), "must be parsable.");
   // an initialized object; ignore mark word in verification below
   // since we are running concurrent with mutators
@@ -6872,7 +6879,7 @@
     assert(_skipBits == 0, "tautology");
     _skipBits = 2;  // skip next two marked bits ("Printezis-marks")
     oop p = oop(addr);
-    if (p->klass() == NULL || !p->is_parsable()) {
+    if (p->klass_or_null() == NULL || !p->is_parsable()) {
       DEBUG_ONLY(if (!_verifying) {)
         // We re-dirty the cards on which this object lies and increase
         // the _threshold so that we'll come back to scan this object
@@ -6894,7 +6901,7 @@
           if (_threshold < end_card_addr) {
             _threshold = end_card_addr;
           }
-          if (p->klass() != NULL) {
+          if (p->klass_or_null() != NULL) {
             // Redirty the range of cards...
             _mut->mark_range(redirty_range);
           } // ...else the setting of klass will dirty the card anyway.
@@ -7053,7 +7060,7 @@
     assert(_skip_bits == 0, "tautology");
     _skip_bits = 2;  // skip next two marked bits ("Printezis-marks")
     oop p = oop(addr);
-    if (p->klass() == NULL || !p->is_parsable()) {
+    if (p->klass_or_null() == NULL || !p->is_parsable()) {
       // in the case of Clean-on-Enter optimization, redirty card
       // and avoid clearing card by increasing  the threshold.
       return true;
@@ -8034,7 +8041,7 @@
            "alignment problem");
 
     #ifdef DEBUG
-      if (oop(addr)->klass() != NULL &&
+      if (oop(addr)->klass_or_null() != NULL &&
           (   !_collector->should_unload_classes()
            || oop(addr)->is_parsable())) {
         // Ignore mark word because we are running concurrent with mutators
@@ -8047,7 +8054,7 @@
 
   } else {
     // This should be an initialized object that's alive.
-    assert(oop(addr)->klass() != NULL &&
+    assert(oop(addr)->klass_or_null() != NULL &&
            (!_collector->should_unload_classes()
             || oop(addr)->is_parsable()),
            "Should be an initialized object");
--- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/freeBlockDictionary.hpp	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/freeBlockDictionary.hpp	Thu Jun 12 13:50:55 2008 -0700
@@ -22,88 +22,6 @@
  *
  */
 
-//
-// Free block maintenance for Concurrent Mark Sweep Generation
-//
-// The main data structure for free blocks are
-// . an indexed array of small free blocks, and
-// . a dictionary of large free blocks
-//
-
-// No virtuals in FreeChunk (don't want any vtables).
-
-// A FreeChunk is merely a chunk that can be in a doubly linked list
-// and has a size field. NOTE: FreeChunks are distinguished from allocated
-// objects in two ways (by the sweeper). The second word (prev) has the
-// LSB set to indicate a free chunk; allocated objects' klass() pointers
-// don't have their LSB set. The corresponding bit in the CMSBitMap is
-// set when the chunk is allocated. There are also blocks that "look free"
-// but are not part of the free list and should not be coalesced into larger
-// free blocks. These free blocks have their two LSB's set.
-
-class FreeChunk VALUE_OBJ_CLASS_SPEC {
-  friend class VMStructs;
-  FreeChunk* _next;
-  FreeChunk* _prev;
-  size_t     _size;
-
- public:
-  NOT_PRODUCT(static const size_t header_size();)
-  // Returns "true" if the "wrd", which is required to be the second word
-  // of a block, indicates that the block represents a free chunk.
-  static bool secondWordIndicatesFreeChunk(intptr_t wrd) {
-    return (wrd & 0x1) == 0x1;
-  }
-  bool isFree()       const {
-    return secondWordIndicatesFreeChunk((intptr_t)_prev);
-  }
-  bool cantCoalesce() const { return (((intptr_t)_prev) & 0x3) == 0x3; }
-  FreeChunk* next()   const { return _next; }
-  FreeChunk* prev()   const { return (FreeChunk*)(((intptr_t)_prev) & ~(0x3)); }
-  debug_only(void* prev_addr() const { return (void*)&_prev; })
-
-  void linkAfter(FreeChunk* ptr) {
-    linkNext(ptr);
-    if (ptr != NULL) ptr->linkPrev(this);
-  }
-  void linkAfterNonNull(FreeChunk* ptr) {
-    assert(ptr != NULL, "precondition violation");
-    linkNext(ptr);
-    ptr->linkPrev(this);
-  }
-  void linkNext(FreeChunk* ptr) { _next = ptr; }
-  void linkPrev(FreeChunk* ptr) { _prev = (FreeChunk*)((intptr_t)ptr | 0x1); }
-  void clearPrev()              { _prev = NULL; }
-  void clearNext()              { _next = NULL; }
-  void dontCoalesce()      {
-    // the block should be free
-    assert(isFree(), "Should look like a free block");
-    _prev = (FreeChunk*)(((intptr_t)_prev) | 0x2);
-  }
-  void markFree()    { _prev = (FreeChunk*)((intptr_t)_prev | 0x1);    }
-  void markNotFree() { _prev = NULL; }
-
-  size_t size()           const { return _size; }
-  void setSize(size_t size)     { _size = size; }
-
-  // For volatile reads:
-  size_t* size_addr()           { return &_size; }
-
-  // Return the address past the end of this chunk
-  HeapWord* end() const { return ((HeapWord*) this) + _size; }
-
-  // debugging
-  void verify()             const PRODUCT_RETURN;
-  void verifyList()         const PRODUCT_RETURN;
-  void mangleAllocated(size_t size) PRODUCT_RETURN;
-  void mangleFreed(size_t size)     PRODUCT_RETURN;
-};
-
-// Alignment helpers etc.
-#define numQuanta(x,y) ((x+y-1)/y)
-enum AlignmentConstants {
-  MinChunkSize = numQuanta(sizeof(FreeChunk), MinObjAlignmentInBytes) * MinObjAlignment
-};
 
 // A FreeBlockDictionary is an abstract superclass that will allow
 // a number of alternative implementations in the future.
--- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/freeChunk.cpp	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/freeChunk.cpp	Thu Jun 12 13:50:55 2008 -0700
@@ -47,15 +47,15 @@
   Copy::fill_to_words(addr + hdr, size - hdr, baadbabeHeapWord);
 }
 
-void FreeChunk::mangleFreed(size_t size) {
+void FreeChunk::mangleFreed(size_t sz) {
   assert(baadbabeHeapWord != deadbeefHeapWord, "Need distinct patterns");
   // mangle all but the header of a just-freed block of storage
   // just prior to passing it to the storage dictionary
-  assert(size >= MinChunkSize, "smallest size of object");
-  assert(size == _size, "just checking");
+  assert(sz >= MinChunkSize, "smallest size of object");
+  assert(sz == size(), "just checking");
   HeapWord* addr = (HeapWord*)this;
   size_t hdr = header_size();
-  Copy::fill_to_words(addr + hdr, size - hdr, deadbeefHeapWord);
+  Copy::fill_to_words(addr + hdr, sz - hdr, deadbeefHeapWord);
 }
 
 void FreeChunk::verifyList() const {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/freeChunk.hpp	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,137 @@
+/*
+ * Copyright 2001-2005 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.
+ *
+ * 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.
+ *
+ */
+
+//
+// Free block maintenance for Concurrent Mark Sweep Generation
+//
+// The main data structure for free blocks are
+// . an indexed array of small free blocks, and
+// . a dictionary of large free blocks
+//
+
+// No virtuals in FreeChunk (don't want any vtables).
+
+// A FreeChunk is merely a chunk that can be in a doubly linked list
+// and has a size field. NOTE: FreeChunks are distinguished from allocated
+// objects in two ways (by the sweeper), depending on whether the VM is 32 or
+// 64 bits.
+// In 32 bits or 64 bits without CompressedOops, the second word (prev) has the
+// LSB set to indicate a free chunk; allocated objects' klass() pointers
+// don't have their LSB set. The corresponding bit in the CMSBitMap is
+// set when the chunk is allocated. There are also blocks that "look free"
+// but are not part of the free list and should not be coalesced into larger
+// free blocks. These free blocks have their two LSB's set.
+
+class FreeChunk VALUE_OBJ_CLASS_SPEC {
+  friend class VMStructs;
+  // For 64 bit compressed oops, the markOop encodes both the size and the
+  // indication that this is a FreeChunk and not an object.
+  volatile size_t   _size;
+  FreeChunk* _prev;
+  FreeChunk* _next;
+
+  markOop mark()     const volatile { return (markOop)_size; }
+  void set_mark(markOop m)          { _size = (size_t)m; }
+
+ public:
+  NOT_PRODUCT(static const size_t header_size();)
+
+  // Returns "true" if the address indicates that the block represents
+  // a free chunk.
+  static bool indicatesFreeChunk(const HeapWord* addr) {
+    // Force volatile read from addr because value might change between
+    // calls.  We really want the read of _mark and _prev from this pointer
+    // to be volatile but making the fields volatile causes all sorts of
+    // compilation errors.
+    return ((volatile FreeChunk*)addr)->isFree();
+  }
+
+  bool isFree() const volatile {
+    LP64_ONLY(if (UseCompressedOops) return mark()->is_cms_free_chunk(); else)
+    return (((intptr_t)_prev) & 0x1) == 0x1;
+  }
+  bool cantCoalesce() const {
+    assert(isFree(), "can't get coalesce bit on not free");
+    return (((intptr_t)_prev) & 0x2) == 0x2;
+  }
+  void dontCoalesce() {
+    // the block should be free
+    assert(isFree(), "Should look like a free block");
+    _prev = (FreeChunk*)(((intptr_t)_prev) | 0x2);
+  }
+  FreeChunk* prev() const {
+    return (FreeChunk*)(((intptr_t)_prev) & ~(0x3));
+  }
+
+  debug_only(void* prev_addr() const { return (void*)&_prev; })
+
+  size_t size() const volatile {
+    LP64_ONLY(if (UseCompressedOops) return mark()->get_size(); else )
+    return _size;
+  }
+  void setSize(size_t sz) {
+    LP64_ONLY(if (UseCompressedOops) set_mark(markOopDesc::set_size_and_free(sz)); else )
+    _size = sz;
+  }
+
+  FreeChunk* next()   const { return _next; }
+
+  void linkAfter(FreeChunk* ptr) {
+    linkNext(ptr);
+    if (ptr != NULL) ptr->linkPrev(this);
+  }
+  void linkAfterNonNull(FreeChunk* ptr) {
+    assert(ptr != NULL, "precondition violation");
+    linkNext(ptr);
+    ptr->linkPrev(this);
+  }
+  void linkNext(FreeChunk* ptr) { _next = ptr; }
+  void linkPrev(FreeChunk* ptr) {
+     LP64_ONLY(if (UseCompressedOops) _prev = ptr; else)
+     _prev = (FreeChunk*)((intptr_t)ptr | 0x1);
+  }
+  void clearPrev()              { _prev = NULL; }
+  void clearNext()              { _next = NULL; }
+  void markNotFree() {
+   LP64_ONLY(if (UseCompressedOops) set_mark(markOopDesc::prototype());)
+   // Also set _prev to null
+   _prev = NULL;
+  }
+
+  // Return the address past the end of this chunk
+  HeapWord* end() const { return ((HeapWord*) this) + size(); }
+
+  // debugging
+  void verify()             const PRODUCT_RETURN;
+  void verifyList()         const PRODUCT_RETURN;
+  void mangleAllocated(size_t size) PRODUCT_RETURN;
+  void mangleFreed(size_t size)     PRODUCT_RETURN;
+};
+
+// Alignment helpers etc.
+#define numQuanta(x,y) ((x+y-1)/y)
+enum AlignmentConstants {
+  MinChunkSize = numQuanta(sizeof(FreeChunk), MinObjAlignmentInBytes) * MinObjAlignment
+};
+
--- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/freeList.hpp	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/freeList.hpp	Thu Jun 12 13:50:55 2008 -0700
@@ -38,6 +38,7 @@
 
 class FreeList VALUE_OBJ_CLASS_SPEC {
   friend class CompactibleFreeListSpace;
+  friend class VMStructs;
   friend class printTreeCensusClosure;
   FreeChunk*    _head;          // List of free chunks
   FreeChunk*    _tail;          // Tail of list of free chunks
--- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/vmStructs_cms.hpp	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/vmStructs_cms.hpp	Thu Jun 12 13:50:55 2008 -0700
@@ -23,6 +23,7 @@
  */
 
 #define VM_STRUCTS_CMS(nonstatic_field, \
+                   volatile_nonstatic_field, \
                    static_field) \
   nonstatic_field(CompactibleFreeListSpace,    _collector,                                    CMSCollector*)                         \
   nonstatic_field(CompactibleFreeListSpace,    _bt,                                           BlockOffsetArrayNonContigSpace)        \
@@ -36,9 +37,17 @@
   nonstatic_field(CMSCollector,                _markBitMap,                                   CMSBitMap)                             \
   nonstatic_field(ConcurrentMarkSweepGeneration, _cmsSpace,                                   CompactibleFreeListSpace*)             \
      static_field(ConcurrentMarkSweepThread,   _collector,                                    CMSCollector*)                         \
+  volatile_nonstatic_field(FreeChunk,          _size,                                         size_t)                                \
   nonstatic_field(FreeChunk,                   _next,                                         FreeChunk*)                            \
   nonstatic_field(FreeChunk,                   _prev,                                         FreeChunk*)                            \
-  nonstatic_field(FreeChunk,                   _size,                                         size_t)
+  nonstatic_field(LinearAllocBlock,            _word_size,                                    size_t)                                \
+  nonstatic_field(FreeList,                    _size,                                         size_t)                                \
+  nonstatic_field(FreeList,                    _count,                                        ssize_t)                               \
+  nonstatic_field(BinaryTreeDictionary,        _totalSize,                                    size_t)                                \
+  nonstatic_field(CompactibleFreeListSpace,    _dictionary,                                   FreeBlockDictionary*)                  \
+  nonstatic_field(CompactibleFreeListSpace,    _indexedFreeList[0],                           FreeList)                              \
+  nonstatic_field(CompactibleFreeListSpace,    _smallLinearAllocBlock,                        LinearAllocBlock)
+
 
 #define VM_TYPES_CMS(declare_type,                                        \
                      declare_toplevel_type)                               \
@@ -57,7 +66,14 @@
   declare_toplevel_type(SurrogateLockerThread*)                           \
   declare_toplevel_type(CompactibleFreeListSpace*)                        \
   declare_toplevel_type(CMSCollector*)                                    \
-  declare_toplevel_type(FreeChunk*)
+  declare_toplevel_type(FreeChunk*)                                       \
+  declare_toplevel_type(BinaryTreeDictionary*)                            \
+  declare_toplevel_type(FreeBlockDictionary*)                             \
+  declare_toplevel_type(FreeList*)                                        \
+  declare_toplevel_type(FreeList)                                         \
+  declare_toplevel_type(LinearAllocBlock)                                 \
+  declare_toplevel_type(FreeBlockDictionary)                              \
+            declare_type(BinaryTreeDictionary,        FreeBlockDictionary)
 
 #define VM_INT_CONSTANTS_CMS(declare_constant)                            \
   declare_constant(Generation::ConcurrentMarkSweep)                       \
--- a/hotspot/src/share/vm/gc_implementation/includeDB_gc_concurrentMarkSweep	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/src/share/vm/gc_implementation/includeDB_gc_concurrentMarkSweep	Thu Jun 12 13:50:55 2008 -0700
@@ -195,6 +195,7 @@
 
 freeBlockDictionary.hpp                 allocation.hpp
 freeBlockDictionary.hpp                 debug.hpp
+freeBlockDictionary.hpp                 freeChunk.hpp
 freeBlockDictionary.hpp                 globalDefinitions.hpp
 freeBlockDictionary.hpp                 memRegion.hpp
 freeBlockDictionary.hpp                 mutex.hpp
@@ -203,6 +204,14 @@
 freeChunk.cpp                           copy.hpp
 freeChunk.cpp                           freeBlockDictionary.hpp
 
+freeChunk.hpp                           allocation.hpp
+freeChunk.hpp                           debug.hpp
+freeChunk.hpp                           globalDefinitions.hpp
+freeChunk.hpp                           markOop.hpp
+freeChunk.hpp                           memRegion.hpp
+freeChunk.hpp                           mutex.hpp
+freeChunk.hpp                           ostream.hpp
+
 freeList.cpp                            freeBlockDictionary.hpp
 freeList.cpp                            freeList.hpp
 freeList.cpp                            globals.hpp
--- a/hotspot/src/share/vm/gc_implementation/includeDB_gc_shared	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/src/share/vm/gc_implementation/includeDB_gc_shared	Thu Jun 12 13:50:55 2008 -0700
@@ -78,6 +78,7 @@
 markSweep.inline.hpp                    psParallelCompact.hpp
 
 mutableNUMASpace.cpp                    mutableNUMASpace.hpp
+mutableNUMASpace.cpp                    oop.inline.hpp
 mutableNUMASpace.cpp                    sharedHeap.hpp
 mutableNUMASpace.cpp                    thread_<os_family>.inline.hpp
 
--- a/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp	Thu Jun 12 13:50:55 2008 -0700
@@ -1169,18 +1169,18 @@
   // Trim off a prefix of at most objsFromOverflow items
   int i = 1;
   oop cur = prefix;
-  while (i < objsFromOverflow && cur->klass() != NULL) {
+  while (i < objsFromOverflow && cur->klass_or_null() != NULL) {
     i++; cur = oop(cur->klass());
   }
 
   // Reattach remaining (suffix) to overflow list
-  if (cur->klass() != NULL) {
+  if (cur->klass_or_null() != NULL) {
     oop suffix = oop(cur->klass());
     cur->set_klass_to_list_ptr(NULL);
 
     // Find last item of suffix list
     oop last = suffix;
-    while (last->klass() != NULL) {
+    while (last->klass_or_null() != NULL) {
       last = oop(last->klass());
     }
     // Atomically prepend suffix to current overflow list
--- a/hotspot/src/share/vm/gc_implementation/shared/immutableSpace.cpp	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/src/share/vm/gc_implementation/shared/immutableSpace.cpp	Thu Jun 12 13:50:55 2008 -0700
@@ -66,7 +66,7 @@
 
 #endif
 
-void ImmutableSpace::verify(bool allow_dirty) const {
+void ImmutableSpace::verify(bool allow_dirty) {
   HeapWord* p = bottom();
   HeapWord* t = end();
   HeapWord* prev_p = NULL;
--- a/hotspot/src/share/vm/gc_implementation/shared/immutableSpace.hpp	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/src/share/vm/gc_implementation/shared/immutableSpace.hpp	Thu Jun 12 13:50:55 2008 -0700
@@ -59,5 +59,5 @@
   // Debugging
   virtual void print() const            PRODUCT_RETURN;
   virtual void print_short() const      PRODUCT_RETURN;
-  virtual void verify(bool allow_dirty) const;
+  virtual void verify(bool allow_dirty);
 };
--- a/hotspot/src/share/vm/gc_implementation/shared/mutableNUMASpace.cpp	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/src/share/vm/gc_implementation/shared/mutableNUMASpace.cpp	Thu Jun 12 13:50:55 2008 -0700
@@ -599,12 +599,28 @@
 // Mark the the holes in chunks below the top() as invalid.
 void MutableNUMASpace::set_top(HeapWord* value) {
   bool found_top = false;
-  for (int i = 0; i < lgrp_spaces()->length(); i++) {
+  for (int i = 0; i < lgrp_spaces()->length();) {
     LGRPSpace *ls = lgrp_spaces()->at(i);
     MutableSpace *s = ls->space();
     HeapWord *top = MAX2((HeapWord*)round_down((intptr_t)s->top(), page_size()), s->bottom());
 
     if (s->contains(value)) {
+      // Check if setting the chunk's top to a given value would create a hole less than
+      // a minimal object; assuming that's not the last chunk in which case we don't care.
+      if (i < lgrp_spaces()->length() - 1) {
+        size_t remainder = pointer_delta(s->end(), value);
+        const size_t minimal_object_size = oopDesc::header_size();
+        if (remainder < minimal_object_size && remainder > 0) {
+          // Add a filler object of a minimal size, it will cross the chunk boundary.
+          SharedHeap::fill_region_with_object(MemRegion(value, minimal_object_size));
+          value += minimal_object_size;
+          assert(!s->contains(value), "Should be in the next chunk");
+          // Restart the loop from the same chunk, since the value has moved
+          // to the next one.
+          continue;
+        }
+      }
+
       if (!os::numa_has_static_binding() && top < value && top < s->end()) {
         ls->add_invalid_region(MemRegion(top, value));
       }
@@ -620,6 +636,7 @@
           s->set_top(s->end());
         }
     }
+    i++;
   }
   MutableSpace::set_top(value);
 }
@@ -700,12 +717,14 @@
   MutableSpace *s = lgrp_spaces()->at(i)->space();
   HeapWord *p = s->cas_allocate(size);
   if (p != NULL) {
-    size_t remainder = pointer_delta(s->end(), p);
+    size_t remainder = pointer_delta(s->end(), p + size);
     if (remainder < (size_t)oopDesc::header_size() && remainder > 0) {
       if (s->cas_deallocate(p, size)) {
         // We were the last to allocate and created a fragment less than
         // a minimal object.
         p = NULL;
+      } else {
+        guarantee(false, "Deallocation should always succeed");
       }
     }
   }
@@ -761,10 +780,12 @@
   }
 }
 
-void MutableNUMASpace::verify(bool allow_dirty) const {
- for (int i = 0; i < lgrp_spaces()->length(); i++) {
-    lgrp_spaces()->at(i)->space()->verify(allow_dirty);
-  }
+void MutableNUMASpace::verify(bool allow_dirty) {
+  // This can be called after setting an arbitary value to the space's top,
+  // so an object can cross the chunk boundary. We ensure the parsablity
+  // of the space and just walk the objects in linear fashion.
+  ensure_parsability();
+  MutableSpace::verify(allow_dirty);
 }
 
 // Scan pages and gather stats about page placement and size.
--- a/hotspot/src/share/vm/gc_implementation/shared/mutableNUMASpace.hpp	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/src/share/vm/gc_implementation/shared/mutableNUMASpace.hpp	Thu Jun 12 13:50:55 2008 -0700
@@ -192,7 +192,7 @@
   // Debugging
   virtual void print_on(outputStream* st) const;
   virtual void print_short_on(outputStream* st) const;
-  virtual void verify(bool allow_dirty) const;
+  virtual void verify(bool allow_dirty);
 
   virtual void set_top(HeapWord* value);
 };
--- a/hotspot/src/share/vm/gc_implementation/shared/mutableSpace.cpp	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/src/share/vm/gc_implementation/shared/mutableSpace.cpp	Thu Jun 12 13:50:55 2008 -0700
@@ -118,7 +118,7 @@
                  bottom(), top(), end());
 }
 
-void MutableSpace::verify(bool allow_dirty) const {
+void MutableSpace::verify(bool allow_dirty) {
   HeapWord* p = bottom();
   HeapWord* t = top();
   HeapWord* prev_p = NULL;
--- a/hotspot/src/share/vm/gc_implementation/shared/mutableSpace.hpp	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/src/share/vm/gc_implementation/shared/mutableSpace.hpp	Thu Jun 12 13:50:55 2008 -0700
@@ -98,5 +98,5 @@
   virtual void print_on(outputStream* st) const;
   virtual void print_short() const;
   virtual void print_short_on(outputStream* st) const;
-  virtual void verify(bool allow_dirty) const;
+  virtual void verify(bool allow_dirty);
 };
--- a/hotspot/src/share/vm/gc_interface/collectedHeap.inline.hpp	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/src/share/vm/gc_interface/collectedHeap.inline.hpp	Thu Jun 12 13:50:55 2008 -0700
@@ -90,11 +90,12 @@
                                                 HeapWord* obj,
                                                 size_t size,
                                                 int length) {
+  // Set array length before setting the _klass field
+  // in post_allocation_setup_common() because the klass field
+  // indicates that the object is parsable by concurrent GC.
   assert(length >= 0, "length should be non-negative");
+  ((arrayOop)obj)->set_length(length);
   post_allocation_setup_common(klass, obj, size);
-  // Must set length after installing klass as set_klass zeros the length
-  // field in UseCompressedOops
-  ((arrayOop)obj)->set_length(length);
   assert(((oop)obj)->blueprint()->oop_is_array(), "must be an array");
   // notify jvmti and dtrace (must be after length is set for dtrace)
   post_allocation_notify(klass, (oop)obj);
@@ -224,6 +225,7 @@
   assert(obj != NULL, "cannot initialize NULL object");
   const size_t hs = oopDesc::header_size();
   assert(size >= hs, "unexpected object size");
+  ((oop)obj)->set_klass_gap(0);
   Copy::fill_to_aligned_words(obj + hs, size - hs);
 }
 
--- a/hotspot/src/share/vm/includeDB_core	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/src/share/vm/includeDB_core	Thu Jun 12 13:50:55 2008 -0700
@@ -3507,6 +3507,7 @@
 relocInfo_<arch>.cpp                    assembler.inline.hpp
 relocInfo_<arch>.cpp                    assembler_<arch_model>.inline.hpp
 relocInfo_<arch>.cpp                    nativeInst_<arch>.hpp
+relocInfo_<arch>.cpp                    oop.inline.hpp
 relocInfo_<arch>.cpp                    relocInfo.hpp
 relocInfo_<arch>.cpp                    safepoint.hpp
 
--- a/hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp	Thu Jun 12 13:50:55 2008 -0700
@@ -1931,6 +1931,7 @@
               } else {
                 result->set_mark(markOopDesc::prototype());
               }
+              result->set_klass_gap(0);
               result->set_klass(k_entry);
               SET_STACK_OBJECT(result, 0);
               UPDATE_PC_AND_TOS_AND_CONTINUE(3, 1);
--- a/hotspot/src/share/vm/interpreter/bytecodeInterpreterWithChecks.xml	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/src/share/vm/interpreter/bytecodeInterpreterWithChecks.xml	Thu Jun 12 13:50:55 2008 -0700
@@ -1,7 +1,25 @@
 <?xml version="1.0"?> 
 <!-- 
-     Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
-     SUN PROPRIETARY/CONFIDENTIAL.  Use is subject to license terms.
+     Copyright 1997-2000 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.
+
+     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.
 -->
 <!DOCTYPE processcode [
   <!ELEMENT processcode ANY>
--- a/hotspot/src/share/vm/interpreter/bytecodeInterpreterWithChecks.xsl	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/src/share/vm/interpreter/bytecodeInterpreterWithChecks.xsl	Thu Jun 12 13:50:55 2008 -0700
@@ -1,10 +1,29 @@
 <?xml version="1.0"?> 
 <!-- 
-     Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
-     SUN PROPRIETARY/CONFIDENTIAL.  Use is subject to license terms.
+     Copyright 1997-2000 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.
+
+     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.
 -->
 
 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+<xsl:output method="text" indent="no" omit-xml-declaration="yes"/>
 
 <xsl:template match="processcode">
 <xsl:text>
@@ -15,7 +34,6 @@
 
 </xsl:text>
 
-<xsl:output method="text" indent="no" omit-xml-declaration="yes"/>
 </xsl:template>
 
 </xsl:stylesheet>
--- a/hotspot/src/share/vm/memory/space.cpp	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/src/share/vm/memory/space.cpp	Thu Jun 12 13:50:55 2008 -0700
@@ -844,6 +844,7 @@
            "size for smallest fake object doesn't match");
     instanceOop obj = (instanceOop) allocate(size);
     obj->set_mark(markOopDesc::prototype());
+    obj->set_klass_gap(0);
     obj->set_klass(SystemDictionary::object_klass());
   }
 }
--- a/hotspot/src/share/vm/oops/arrayOop.hpp	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/src/share/vm/oops/arrayOop.hpp	Thu Jun 12 13:50:55 2008 -0700
@@ -41,11 +41,10 @@
   // Header size computation.
   // The header is considered the oop part of this type plus the length.
   // Returns the aligned header_size_in_bytes.  This is not equivalent to
-  // sizeof(arrayOopDesc) which should not appear in the code, except here.
+  // sizeof(arrayOopDesc) which should not appear in the code.
   static int header_size_in_bytes() {
-    size_t hs = UseCompressedOops ?
-            sizeof(arrayOopDesc) :
-            align_size_up(sizeof(arrayOopDesc) + sizeof(int), HeapWordSize);
+    size_t hs = align_size_up(length_offset_in_bytes() + sizeof(int),
+                              HeapWordSize);
 #ifdef ASSERT
     // make sure it isn't called before UseCompressedOops is initialized.
     static size_t arrayoopdesc_hs = 0;
--- a/hotspot/src/share/vm/oops/instanceKlass.hpp	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/src/share/vm/oops/instanceKlass.hpp	Thu Jun 12 13:50:55 2008 -0700
@@ -180,9 +180,8 @@
   // End of the oop block.
   //
 
-  // number of words used by non-static fields in this klass (including
-  // inherited fields but after header_size()).  If fields are compressed into
-  // header, this can be zero so it's not the same as number of static fields.
+  // Number of heapOopSize words used by non-static fields in this klass
+  // (including inherited fields but after header_size()).
   int             _nonstatic_field_size;
   int             _static_field_size;    // number words used by static fields (oop and non-oop) in this klass
   int             _static_oop_field_size;// number of static oop fields in this klass
--- a/hotspot/src/share/vm/oops/instanceKlassKlass.cpp	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/src/share/vm/oops/instanceKlassKlass.cpp	Thu Jun 12 13:50:55 2008 -0700
@@ -581,7 +581,7 @@
   OopMapBlock* map     = ik->start_of_nonstatic_oop_maps();
   OopMapBlock* end_map = map + ik->nonstatic_oop_map_size();
   while (map < end_map) {
-    st->print("%d-%d ", map->offset(), map->offset() + oopSize*(map->length() - 1));
+    st->print("%d-%d ", map->offset(), map->offset() + heapOopSize*(map->length() - 1));
     map++;
   }
   st->cr();
--- a/hotspot/src/share/vm/oops/instanceOop.hpp	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/src/share/vm/oops/instanceOop.hpp	Thu Jun 12 13:50:55 2008 -0700
@@ -39,14 +39,7 @@
 
   static bool contains_field_offset(int offset, int nonstatic_field_size) {
     int base_in_bytes = base_offset_in_bytes();
-    if (UseCompressedOops) {
-      return (offset >= base_in_bytes &&
-              // field can be embedded in header, or is after header.
-              (offset < (int)sizeof(instanceOopDesc) ||
-              (offset-(int)sizeof(instanceOopDesc))/wordSize < nonstatic_field_size));
-    } else {
-      return (offset >= base_in_bytes &&
-              (offset-base_in_bytes)/wordSize < nonstatic_field_size);
-    }
+    return (offset >= base_in_bytes &&
+            (offset-base_in_bytes) < nonstatic_field_size * heapOopSize);
   }
 };
--- a/hotspot/src/share/vm/oops/markOop.hpp	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/src/share/vm/oops/markOop.hpp	Thu Jun 12 13:50:55 2008 -0700
@@ -29,8 +29,10 @@
 //
 // Bit-format of an object header (most significant first):
 //
-//
-//  unused:0/25 hash:25/31 age:4 biased_lock:1 lock:2 = 32/64 bits
+//  32 bits: unused:0  hash:25 age:4 biased_lock:1 lock:2
+//  64 bits: unused:24 hash:31 cms:2 age:4 biased_lock:1 lock:2
+//           unused:20 size:35 cms:2 age:4 biased_lock:1 lock:2 (if cms
+//                                                               free chunk)
 //
 //  - hash contains the identity hash value: largest value is
 //    31 bits, see os::random().  Also, 64-bit vm's require
@@ -91,6 +93,7 @@
          biased_lock_bits         = 1,
          max_hash_bits            = BitsPerWord - age_bits - lock_bits - biased_lock_bits,
          hash_bits                = max_hash_bits > 31 ? 31 : max_hash_bits,
+         cms_bits                 = LP64_ONLY(1) NOT_LP64(0),
          epoch_bits               = 2
   };
 
@@ -106,7 +109,8 @@
   enum { lock_shift               = 0,
          biased_lock_shift        = lock_bits,
          age_shift                = lock_bits + biased_lock_bits,
-         hash_shift               = lock_bits + biased_lock_bits + age_bits,
+         cms_shift                = age_shift + age_bits,
+         hash_shift               = cms_shift + cms_bits,
          epoch_shift              = hash_shift
   };
 
@@ -118,7 +122,9 @@
          age_mask                 = right_n_bits(age_bits),
          age_mask_in_place        = age_mask << age_shift,
          epoch_mask               = right_n_bits(epoch_bits),
-         epoch_mask_in_place      = epoch_mask << epoch_shift
+         epoch_mask_in_place      = epoch_mask << epoch_shift,
+         cms_mask                 = right_n_bits(cms_bits),
+         cms_mask_in_place        = cms_mask << cms_shift
 #ifndef _WIN64
          ,hash_mask               = right_n_bits(hash_bits),
          hash_mask_in_place       = (address_word)hash_mask << hash_shift
@@ -348,4 +354,40 @@
 
   // see the definition in markOop.cpp for the gory details
   bool should_not_be_cached() const;
+
+  // These markOops indicate cms free chunk blocks and not objects.
+  // In 64 bit, the markOop is set to distinguish them from oops.
+  // These are defined in 32 bit mode for vmStructs.
+  const static uintptr_t cms_free_chunk_pattern  = 0x1;
+
+  // Constants for the size field.
+  enum { size_shift                = cms_shift + cms_bits,
+         size_bits                 = 35    // need for compressed oops 32G
+       };
+  // These values are too big for Win64
+  const static uintptr_t size_mask = LP64_ONLY(right_n_bits(size_bits))
+                                     NOT_LP64(0);
+  const static uintptr_t size_mask_in_place =
+                                     (address_word)size_mask << size_shift;
+
+#ifdef _LP64
+  static markOop cms_free_prototype() {
+    return markOop(((intptr_t)prototype() & ~cms_mask_in_place) |
+                   ((cms_free_chunk_pattern & cms_mask) << cms_shift));
+  }
+  uintptr_t cms_encoding() const {
+    return mask_bits(value() >> cms_shift, cms_mask);
+  }
+  bool is_cms_free_chunk() const {
+    return is_neutral() &&
+           (cms_encoding() & cms_free_chunk_pattern) == cms_free_chunk_pattern;
+  }
+
+  size_t get_size() const       { return (size_t)(value() >> size_shift); }
+  static markOop set_size_and_free(size_t size) {
+    assert((size & ~size_mask) == 0, "shouldn't overflow size field");
+    return markOop(((intptr_t)cms_free_prototype() & ~size_mask_in_place) |
+                   (((intptr_t)size & size_mask) << size_shift));
+  }
+#endif // _LP64
 };
--- a/hotspot/src/share/vm/oops/oop.hpp	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/src/share/vm/oops/oop.hpp	Thu Jun 12 13:50:55 2008 -0700
@@ -77,10 +77,15 @@
   void init_mark();
 
   klassOop klass() const;
+  klassOop klass_or_null() const volatile;
   oop* klass_addr();
   narrowOop* compressed_klass_addr();
 
   void set_klass(klassOop k);
+
+  // For klass field compression
+  int klass_gap() const;
+  void set_klass_gap(int z);
   // For when the klass pointer is being used as a linked list "next" field.
   void set_klass_to_list_ptr(oop k);
 
--- a/hotspot/src/share/vm/oops/oop.inline.hpp	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/src/share/vm/oops/oop.inline.hpp	Thu Jun 12 13:50:55 2008 -0700
@@ -36,7 +36,15 @@
 inline klassOop oopDesc::klass() const {
   if (UseCompressedOops) {
     return (klassOop)decode_heap_oop_not_null(_metadata._compressed_klass);
-      // can be NULL in CMS, but isn't supported on CMS yet.
+  } else {
+    return _metadata._klass;
+  }
+}
+
+inline klassOop oopDesc::klass_or_null() const volatile {
+  // can be NULL in CMS
+  if (UseCompressedOops) {
+    return (klassOop)decode_heap_oop(_metadata._compressed_klass);
   } else {
     return _metadata._klass;
   }
@@ -64,15 +72,22 @@
   assert(Universe::is_bootstrapping() || k != NULL, "must be a real klassOop");
   assert(Universe::is_bootstrapping() || k->is_klass(), "not a klassOop");
   if (UseCompressedOops) {
-    // zero the gap when the klass is set, by zeroing the pointer sized
-    // part of the union.
-    _metadata._klass = NULL;
     oop_store_without_check(compressed_klass_addr(), (oop)k);
   } else {
     oop_store_without_check(klass_addr(), (oop) k);
   }
 }
 
+inline int oopDesc::klass_gap() const {
+  return *(int*)(((intptr_t)this) + klass_gap_offset_in_bytes());
+}
+
+inline void oopDesc::set_klass_gap(int v) {
+  if (UseCompressedOops) {
+    *(int*)(((intptr_t)this) + klass_gap_offset_in_bytes()) = v;
+  }
+}
+
 inline void oopDesc::set_klass_to_list_ptr(oop k) {
   // This is only to be used during GC, for from-space objects, so no
   // barrier is needed.
@@ -510,7 +525,7 @@
   // try to find metaclass cycle safely without seg faulting on bad input
   // we should reach klassKlassObj by following klass link at most 3 times
   for (int i = 0; i < 3; i++) {
-    obj = obj->klass();
+    obj = obj->klass_or_null();
     // klass should be aligned and in permspace
     if (!check_obj_alignment(obj)) return false;
     if (!Universe::heap()->is_in_permanent(obj)) return false;
--- a/hotspot/src/share/vm/opto/c2_globals.hpp	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/src/share/vm/opto/c2_globals.hpp	Thu Jun 12 13:50:55 2008 -0700
@@ -390,5 +390,8 @@
                                                                             \
   product(intx, MaxLabelRootDepth, 1100,                                    \
           "Maximum times call Label_Root to prevent stack overflow")        \
+                                                                            \
+  diagnostic(intx, DominatorSearchLimit, 1000,                              \
+          "Iterations limit in Node::dominates")                            \
 
 C2_FLAGS(DECLARE_DEVELOPER_FLAG, DECLARE_PD_DEVELOPER_FLAG, DECLARE_PRODUCT_FLAG, DECLARE_PD_PRODUCT_FLAG, DECLARE_DIAGNOSTIC_FLAG, DECLARE_NOTPRODUCT_FLAG)
--- a/hotspot/src/share/vm/opto/callnode.cpp	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/src/share/vm/opto/callnode.cpp	Thu Jun 12 13:50:55 2008 -0700
@@ -637,7 +637,7 @@
   }
   Compile *C = phase->C;
   int offset = adrInst_t->offset();
-  assert(offset >= 0, "should be valid offset");
+  assert(adrInst_t->klass_is_exact() && offset >= 0, "should be valid offset");
   ciKlass* adr_k = adrInst_t->klass();
   assert(adr_k->is_loaded() &&
          adr_k->is_java_klass() &&
@@ -674,12 +674,11 @@
       ciKlass* at_k = at_ptr->klass();
       if ((adrInst_t->base() == at_ptr->base()) &&
           at_k->is_loaded() &&
-          at_k->is_java_klass() &&
-          !at_k->is_interface()) {
+          at_k->is_java_klass()) {
         // If we have found an argument matching addr_t, check if the field
         // at the specified offset is modified.
-        int at_idx = C->get_alias_index(at_ptr->add_offset(offset)->isa_oopptr());
-        if (base_idx == at_idx &&
+        if ((at_k->is_interface() || adr_k == at_k ||
+             adr_k->is_subclass_of(at_k) && !at_ptr->klass_is_exact()) &&
             (bcea == NULL ||
              bcea->is_arg_modified(i - TypeFunc::Parms, offset, size))) {
           return true;
--- a/hotspot/src/share/vm/opto/callnode.hpp	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/src/share/vm/opto/callnode.hpp	Thu Jun 12 13:50:55 2008 -0700
@@ -388,9 +388,6 @@
   void               set_next_exception(SafePointNode* n);
   bool                   has_exceptions() const { return next_exception() != NULL; }
 
-  // Does this node have a use of n other than in debug information?
-  virtual bool           has_non_debug_use(Node *n)  {return false; }
-
   // Standard Node stuff
   virtual int            Opcode() const;
   virtual bool           pinned() const { return true; }
@@ -497,7 +494,7 @@
   // Returns true if the call may modify n
   virtual bool        may_modify(const TypePtr *addr_t, PhaseTransform *phase);
   // Does this node have a use of n other than in debug information?
-  virtual bool        has_non_debug_use(Node *n);
+  bool                has_non_debug_use(Node *n);
   // Returns the unique CheckCastPP of a call
   // or result projection is there are several CheckCastPP
   // or returns NULL if there is no one.
--- a/hotspot/src/share/vm/opto/cfgnode.cpp	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/src/share/vm/opto/cfgnode.cpp	Thu Jun 12 13:50:55 2008 -0700
@@ -707,8 +707,14 @@
 //------------------------split_out_instance-----------------------------------
 // Split out an instance type from a bottom phi.
 PhiNode* PhiNode::split_out_instance(const TypePtr* at, PhaseIterGVN *igvn) const {
-  assert(type() == Type::MEMORY && (adr_type() == TypePtr::BOTTOM ||
-         adr_type() == TypeRawPtr::BOTTOM) , "bottom or raw memory required");
+  const TypeOopPtr *t_oop = at->isa_oopptr();
+  assert(t_oop != NULL && t_oop->is_instance(), "expecting instance oopptr");
+  const TypePtr *t = adr_type();
+  assert(type() == Type::MEMORY &&
+         (t == TypePtr::BOTTOM || t == TypeRawPtr::BOTTOM ||
+          t->isa_oopptr() && !t->is_oopptr()->is_instance() &&
+          t->is_oopptr()->cast_to_instance(t_oop->instance_id()) == t_oop),
+         "bottom or raw memory required");
 
   // Check if an appropriate node already exists.
   Node *region = in(0);
@@ -1342,7 +1348,7 @@
     Node *n = phi->in(i);
     if( !n ) return NULL;
     if( phase->type(n) == Type::TOP ) return NULL;
-    if( n->Opcode() == Op_ConP )
+    if( n->Opcode() == Op_ConP || n->Opcode() == Op_ConN )
       break;
   }
   if( i >= phi->req() )         // Only split for constants
@@ -1615,64 +1621,6 @@
     if (opt != NULL)  return opt;
   }
 
-  if (in(1) != NULL && in(1)->Opcode() == Op_AddP && can_reshape) {
-    // Try to undo Phi of AddP:
-    //   (Phi (AddP base base y) (AddP base2 base2 y))
-    // becomes:
-    //   newbase := (Phi base base2)
-    //   (AddP newbase newbase y)
-    //
-    // This occurs as a result of unsuccessful split_thru_phi and
-    // interferes with taking advantage of addressing modes.  See the
-    // clone_shift_expressions code in matcher.cpp
-    Node* addp = in(1);
-    const Type* type = addp->in(AddPNode::Base)->bottom_type();
-    Node* y = addp->in(AddPNode::Offset);
-    if (y != NULL && addp->in(AddPNode::Base) == addp->in(AddPNode::Address)) {
-      // make sure that all the inputs are similar to the first one,
-      // i.e. AddP with base == address and same offset as first AddP
-      bool doit = true;
-      for (uint i = 2; i < req(); i++) {
-        if (in(i) == NULL ||
-            in(i)->Opcode() != Op_AddP ||
-            in(i)->in(AddPNode::Base) != in(i)->in(AddPNode::Address) ||
-            in(i)->in(AddPNode::Offset) != y) {
-          doit = false;
-          break;
-        }
-        // Accumulate type for resulting Phi
-        type = type->meet(in(i)->in(AddPNode::Base)->bottom_type());
-      }
-      Node* base = NULL;
-      if (doit) {
-        // Check for neighboring AddP nodes in a tree.
-        // If they have a base, use that it.
-        for (DUIterator_Fast kmax, k = this->fast_outs(kmax); k < kmax; k++) {
-          Node* u = this->fast_out(k);
-          if (u->is_AddP()) {
-            Node* base2 = u->in(AddPNode::Base);
-            if (base2 != NULL && !base2->is_top()) {
-              if (base == NULL)
-                base = base2;
-              else if (base != base2)
-                { doit = false; break; }
-            }
-          }
-        }
-      }
-      if (doit) {
-        if (base == NULL) {
-          base = new (phase->C, in(0)->req()) PhiNode(in(0), type, NULL);
-          for (uint i = 1; i < req(); i++) {
-            base->init_req(i, in(i)->in(AddPNode::Base));
-          }
-          phase->is_IterGVN()->register_new_node_with_optimizer(base);
-        }
-        return new (phase->C, 4) AddPNode(base, base, y);
-      }
-    }
-  }
-
   // Split phis through memory merges, so that the memory merges will go away.
   // Piggy-back this transformation on the search for a unique input....
   // It will be as if the merged memory is the unique value of the phi.
--- a/hotspot/src/share/vm/opto/chaitin.cpp	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/src/share/vm/opto/chaitin.cpp	Thu Jun 12 13:50:55 2008 -0700
@@ -1385,7 +1385,7 @@
             cisc->ins_req(1,src);         // Requires a memory edge
           }
           b->_nodes.map(j,cisc);          // Insert into basic block
-          n->replace_by(cisc); // Correct graph
+          n->subsume_by(cisc); // Correct graph
           //
           ++_used_cisc_instructions;
 #ifndef PRODUCT
--- a/hotspot/src/share/vm/opto/classes.hpp	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/src/share/vm/opto/classes.hpp	Thu Jun 12 13:50:55 2008 -0700
@@ -37,6 +37,7 @@
 macro(AllocateArray)
 macro(AndI)
 macro(AndL)
+macro(AryEq)
 macro(AtanD)
 macro(Binary)
 macro(Bool)
@@ -64,6 +65,7 @@
 macro(CMoveI)
 macro(CMoveL)
 macro(CMoveP)
+macro(CMoveN)
 macro(CmpN)
 macro(CmpD)
 macro(CmpD3)
@@ -133,6 +135,7 @@
 macro(LoadF)
 macro(LoadI)
 macro(LoadKlass)
+macro(LoadNKlass)
 macro(LoadL)
 macro(LoadL_unaligned)
 macro(LoadPLocked)
--- a/hotspot/src/share/vm/opto/compile.cpp	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/src/share/vm/opto/compile.cpp	Thu Jun 12 13:50:55 2008 -0700
@@ -368,7 +368,12 @@
   BufferBlob* blob = BufferBlob::create("Compile::scratch_buffer", size);
   // Record the buffer blob for next time.
   set_scratch_buffer_blob(blob);
-  guarantee(scratch_buffer_blob() != NULL, "Need BufferBlob for code generation");
+  // Have we run out of code space?
+  if (scratch_buffer_blob() == NULL) {
+    // Let CompilerBroker disable further compilations.
+    record_failure("Not enough space for scratch buffer in CodeCache");
+    return;
+  }
 
   // Initialize the relocation buffers
   relocInfo* locs_buf = (relocInfo*) blob->instructions_end() - MAX_locs_size;
@@ -1065,6 +1070,8 @@
       // No constant oop pointers (such as Strings); they alias with
       // unknown strings.
       tj = to = TypeInstPtr::make(TypePtr::BotPTR,to->klass(),false,0,offset);
+    } else if( to->is_instance_field() ) {
+      tj = to; // Keep NotNull and klass_is_exact for instance type
     } else if( ptr == TypePtr::NotNull || to->klass_is_exact() ) {
       // During the 2nd round of IterGVN, NotNull castings are removed.
       // Make sure the Bottom and NotNull variants alias the same.
@@ -1084,7 +1091,7 @@
     } else {
       ciInstanceKlass *canonical_holder = k->get_canonical_holder(offset);
       if (!k->equals(canonical_holder) || tj->offset() != offset) {
-        tj = to = TypeInstPtr::make(TypePtr::BotPTR, canonical_holder, false, NULL, offset, to->instance_id());
+        tj = to = TypeInstPtr::make(to->ptr(), canonical_holder, false, NULL, offset, to->instance_id());
       }
     }
   }
@@ -1835,6 +1842,7 @@
 // Implement items 1-5 from final_graph_reshaping below.
 static void final_graph_reshaping_impl( Node *n, Final_Reshape_Counts &fpu ) {
 
+  if ( n->outcnt() == 0 ) return; // dead node
   uint nop = n->Opcode();
 
   // Check for 2-input instruction with "last use" on right input.
@@ -1901,7 +1909,7 @@
     break;
   case Op_Opaque1:              // Remove Opaque Nodes before matching
   case Op_Opaque2:              // Remove Opaque Nodes before matching
-    n->replace_by(n->in(1));
+    n->subsume_by(n->in(1));
     break;
   case Op_CallStaticJava:
   case Op_CallJava:
@@ -1961,6 +1969,7 @@
   case Op_LoadC:
   case Op_LoadI:
   case Op_LoadKlass:
+  case Op_LoadNKlass:
   case Op_LoadL:
   case Op_LoadL_unaligned:
   case Op_LoadPLocked:
@@ -1983,14 +1992,94 @@
   }
 
   case Op_AddP: {               // Assert sane base pointers
-    const Node *addp = n->in(AddPNode::Address);
+    Node *addp = n->in(AddPNode::Address);
     assert( !addp->is_AddP() ||
             addp->in(AddPNode::Base)->is_top() || // Top OK for allocation
             addp->in(AddPNode::Base) == n->in(AddPNode::Base),
             "Base pointers must match" );
+#ifdef _LP64
+    if (UseCompressedOops &&
+        addp->Opcode() == Op_ConP &&
+        addp == n->in(AddPNode::Base) &&
+        n->in(AddPNode::Offset)->is_Con()) {
+      // Use addressing with narrow klass to load with offset on x86.
+      // On sparc loading 32-bits constant and decoding it have less
+      // instructions (4) then load 64-bits constant (7).
+      // Do this transformation here since IGVN will convert ConN back to ConP.
+      const Type* t = addp->bottom_type();
+      if (t->isa_oopptr()) {
+        Node* nn = NULL;
+
+        // Look for existing ConN node of the same exact type.
+        Compile* C = Compile::current();
+        Node* r  = C->root();
+        uint cnt = r->outcnt();
+        for (uint i = 0; i < cnt; i++) {
+          Node* m = r->raw_out(i);
+          if (m!= NULL && m->Opcode() == Op_ConN &&
+              m->bottom_type()->is_narrowoop()->make_oopptr() == t) {
+            nn = m;
+            break;
+          }
+        }
+        if (nn != NULL) {
+          // Decode a narrow oop to match address
+          // [R12 + narrow_oop_reg<<3 + offset]
+          nn = new (C,  2) DecodeNNode(nn, t);
+          n->set_req(AddPNode::Base, nn);
+          n->set_req(AddPNode::Address, nn);
+          if (addp->outcnt() == 0) {
+            addp->disconnect_inputs(NULL);
+          }
+        }
+      }
+    }
+#endif
     break;
   }
 
+#ifdef _LP64
+  case Op_CmpP:
+    // Do this transformation here to preserve CmpPNode::sub() and
+    // other TypePtr related Ideal optimizations (for example, ptr nullness).
+    if( n->in(1)->is_DecodeN() ) {
+      Compile* C = Compile::current();
+      Node* in2 = NULL;
+      if( n->in(2)->is_DecodeN() ) {
+        in2 = n->in(2)->in(1);
+      } else if ( n->in(2)->Opcode() == Op_ConP ) {
+        const Type* t = n->in(2)->bottom_type();
+        if (t == TypePtr::NULL_PTR) {
+          Node *in1 = n->in(1);
+          if (Matcher::clone_shift_expressions) {
+            // x86, ARM and friends can handle 2 adds in addressing mode.
+            // Decode a narrow oop and do implicit NULL check in address
+            // [R12 + narrow_oop_reg<<3 + offset]
+            in2 = ConNode::make(C, TypeNarrowOop::NULL_PTR);
+          } else {
+            // Don't replace CmpP(o ,null) if 'o' is used in AddP
+            // to generate implicit NULL check on Sparc where
+            // narrow oops can't be used in address.
+            uint i = 0;
+            for (; i < in1->outcnt(); i++) {
+              if (in1->raw_out(i)->is_AddP())
+                break;
+            }
+            if (i >= in1->outcnt()) {
+              in2 = ConNode::make(C, TypeNarrowOop::NULL_PTR);
+            }
+          }
+        } else if (t->isa_oopptr()) {
+          in2 = ConNode::make(C, t->is_oopptr()->make_narrowoop());
+        }
+      }
+      if( in2 != NULL ) {
+        Node* cmpN = new (C, 3) CmpNNode(n->in(1)->in(1), in2);
+        n->subsume_by( cmpN );
+      }
+    }
+#endif
+
   case Op_ModI:
     if (UseDivMod) {
       // Check if a%b and a/b both exist
@@ -2000,13 +2089,13 @@
         Compile* C = Compile::current();
         if (Matcher::has_match_rule(Op_DivModI)) {
           DivModINode* divmod = DivModINode::make(C, n);
-          d->replace_by(divmod->div_proj());
-          n->replace_by(divmod->mod_proj());
+          d->subsume_by(divmod->div_proj());
+          n->subsume_by(divmod->mod_proj());
         } else {
           // replace a%b with a-((a/b)*b)
           Node* mult = new (C, 3) MulINode(d, d->in(2));
           Node* sub  = new (C, 3) SubINode(d->in(1), mult);
-          n->replace_by( sub );
+          n->subsume_by( sub );
         }
       }
     }
@@ -2021,13 +2110,13 @@
         Compile* C = Compile::current();
         if (Matcher::has_match_rule(Op_DivModL)) {
           DivModLNode* divmod = DivModLNode::make(C, n);
-          d->replace_by(divmod->div_proj());
-          n->replace_by(divmod->mod_proj());
+          d->subsume_by(divmod->div_proj());
+          n->subsume_by(divmod->mod_proj());
         } else {
           // replace a%b with a-((a/b)*b)
           Node* mult = new (C, 3) MulLNode(d, d->in(2));
           Node* sub  = new (C, 3) SubLNode(d->in(1), mult);
-          n->replace_by( sub );
+          n->subsume_by( sub );
         }
       }
     }
@@ -2073,7 +2162,7 @@
       // Replace many operand PackNodes with a binary tree for matching
       PackNode* p = (PackNode*) n;
       Node* btp = p->binaryTreePack(Compile::current(), 1, n->req());
-      n->replace_by(btp);
+      n->subsume_by(btp);
     }
     break;
   default:
--- a/hotspot/src/share/vm/opto/connode.cpp	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/src/share/vm/opto/connode.cpp	Thu Jun 12 13:50:55 2008 -0700
@@ -35,16 +35,16 @@
 
 //------------------------------make-------------------------------------------
 ConNode *ConNode::make( Compile* C, const Type *t ) {
-  if (t->isa_narrowoop()) return new (C, 1) ConNNode( t->is_narrowoop() );
   switch( t->basic_type() ) {
   case T_INT:       return new (C, 1) ConINode( t->is_int() );
-  case T_ARRAY:     return new (C, 1) ConPNode( t->is_aryptr() );
   case T_LONG:      return new (C, 1) ConLNode( t->is_long() );
   case T_FLOAT:     return new (C, 1) ConFNode( t->is_float_constant() );
   case T_DOUBLE:    return new (C, 1) ConDNode( t->is_double_constant() );
   case T_VOID:      return new (C, 1) ConNode ( Type::TOP );
   case T_OBJECT:    return new (C, 1) ConPNode( t->is_oopptr() );
+  case T_ARRAY:     return new (C, 1) ConPNode( t->is_aryptr() );
   case T_ADDRESS:   return new (C, 1) ConPNode( t->is_ptr() );
+  case T_NARROWOOP: return new (C, 1) ConNNode( t->is_narrowoop() );
     // Expected cases:  TypePtr::NULL_PTR, any is_rawptr()
     // Also seen: AnyPtr(TopPTR *+top); from command line:
     //   r -XX:+PrintOpto -XX:CIStart=285 -XX:+CompileTheWorld -XX:CompileTheWorldStartAt=660
@@ -185,6 +185,7 @@
   case T_LONG:    return new (C, 4) CMoveLNode( bol, left, right, t->is_long() );
   case T_OBJECT:  return new (C, 4) CMovePNode( c, bol, left, right, t->is_oopptr() );
   case T_ADDRESS: return new (C, 4) CMovePNode( c, bol, left, right, t->is_ptr() );
+  case T_NARROWOOP: return new (C, 4) CMoveNNode( c, bol, left, right, t );
   default:
     ShouldNotReachHere();
     return NULL;
@@ -556,7 +557,7 @@
   const Type *t = phase->type( in(1) );
   if( t == Type::TOP ) return in(1);
 
-  if (in(1)->Opcode() == Op_EncodeP) {
+  if (in(1)->is_EncodeP()) {
     // (DecodeN (EncodeP p)) -> p
     return in(1)->in(1);
   }
@@ -570,16 +571,19 @@
   return bottom_type();
 }
 
-Node* DecodeNNode::decode(PhaseGVN* phase, Node* value) {
-  if (value->Opcode() == Op_EncodeP) {
+Node* DecodeNNode::decode(PhaseTransform* phase, Node* value) {
+  if (value->is_EncodeP()) {
     // (DecodeN (EncodeP p)) -> p
     return value->in(1);
   }
   const Type* newtype = value->bottom_type();
   if (newtype == TypeNarrowOop::NULL_PTR) {
     return phase->transform(new (phase->C, 1) ConPNode(TypePtr::NULL_PTR));
+  } else if (newtype->isa_narrowoop()) {
+    return phase->transform(new (phase->C, 2) DecodeNNode(value, newtype->is_narrowoop()->make_oopptr()));
   } else {
-    return phase->transform(new (phase->C, 2) DecodeNNode(value, newtype->is_narrowoop()->make_oopptr()));
+    ShouldNotReachHere();
+    return NULL; // to make C++ compiler happy.
   }
 }
 
@@ -587,7 +591,7 @@
   const Type *t = phase->type( in(1) );
   if( t == Type::TOP ) return in(1);
 
-  if (in(1)->Opcode() == Op_DecodeN) {
+  if (in(1)->is_DecodeN()) {
     // (EncodeP (DecodeN p)) -> p
     return in(1)->in(1);
   }
@@ -601,8 +605,8 @@
   return bottom_type();
 }
 
-Node* EncodePNode::encode(PhaseGVN* phase, Node* value) {
-  if (value->Opcode() == Op_DecodeN) {
+Node* EncodePNode::encode(PhaseTransform* phase, Node* value) {
+  if (value->is_DecodeN()) {
     // (EncodeP (DecodeN p)) -> p
     return value->in(1);
   }
@@ -617,6 +621,9 @@
   }
 }
 
+Node *EncodePNode::Ideal_DU_postCCP( PhaseCCP *ccp ) {
+  return MemNode::Ideal_common_DU_postCCP(ccp, this, in(1));
+}
 
 //=============================================================================
 //------------------------------Identity---------------------------------------
--- a/hotspot/src/share/vm/opto/connode.hpp	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/src/share/vm/opto/connode.hpp	Thu Jun 12 13:50:55 2008 -0700
@@ -70,11 +70,6 @@
     else
       return new (C, 1) ConPNode( TypeRawPtr::make(con) );
   }
-
-  static ConPNode* make( Compile *C, ciObject* con ) {
-    return new (C, 1) ConPNode( TypeOopPtr::make_from_constant(con) );
-  }
-
 };
 
 
@@ -84,11 +79,6 @@
 public:
   ConNNode( const TypeNarrowOop *t ) : ConNode(t) {}
   virtual int Opcode() const;
-
-  static ConNNode* make( Compile *C, ciObject* con ) {
-    return new (C, 1) ConNNode( TypeNarrowOop::make_from_constant(con) );
-  }
-
 };
 
 
@@ -210,7 +200,14 @@
   virtual int Opcode() const;
 };
 
-//------------------------------ConstraintCastNode-------------------------------------
+//------------------------------CMoveNNode-------------------------------------
+class CMoveNNode : public CMoveNode {
+public:
+  CMoveNNode( Node *c, Node *bol, Node *left, Node *right, const Type* t ) : CMoveNode(bol,left,right,t) { init_req(Control,c); }
+  virtual int Opcode() const;
+};
+
+//------------------------------ConstraintCastNode-----------------------------
 // cast to a different range
 class ConstraintCastNode: public TypeNode {
 public:
@@ -274,6 +271,7 @@
  public:
   EncodePNode(Node* value, const Type* type):
     TypeNode(type, 2) {
+    init_class_id(Class_EncodeP);
     init_req(0, NULL);
     init_req(1, value);
   }
@@ -282,7 +280,8 @@
   virtual const Type *Value( PhaseTransform *phase ) const;
   virtual uint  ideal_reg() const { return Op_RegN; }
 
-  static Node* encode(PhaseGVN* phase, Node* value);
+  static Node* encode(PhaseTransform* phase, Node* value);
+  virtual Node *Ideal_DU_postCCP( PhaseCCP *ccp );
 };
 
 //------------------------------DecodeN--------------------------------
@@ -293,6 +292,7 @@
  public:
   DecodeNNode(Node* value, const Type* type):
     TypeNode(type, 2) {
+    init_class_id(Class_DecodeN);
     init_req(0, NULL);
     init_req(1, value);
   }
@@ -301,7 +301,7 @@
   virtual const Type *Value( PhaseTransform *phase ) const;
   virtual uint  ideal_reg() const { return Op_RegP; }
 
-  static Node* decode(PhaseGVN* phase, Node* value);
+  static Node* decode(PhaseTransform* phase, Node* value);
 };
 
 //------------------------------Conv2BNode-------------------------------------
--- a/hotspot/src/share/vm/opto/doCall.cpp	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/src/share/vm/opto/doCall.cpp	Thu Jun 12 13:50:55 2008 -0700
@@ -580,7 +580,7 @@
   Node* ex_klass_node = NULL;
   if (has_ex_handler() && !ex_type->klass_is_exact()) {
     Node* p = basic_plus_adr( ex_node, ex_node, oopDesc::klass_offset_in_bytes());
-    ex_klass_node = _gvn.transform(new (C, 3) LoadKlassNode(NULL, immutable_memory(), p, TypeInstPtr::KLASS, TypeKlassPtr::OBJECT));
+    ex_klass_node = _gvn.transform( LoadKlassNode::make(_gvn, immutable_memory(), p, TypeInstPtr::KLASS, TypeKlassPtr::OBJECT) );
 
     // Compute the exception klass a little more cleverly.
     // Obvious solution is to simple do a LoadKlass from the 'ex_node'.
@@ -592,7 +592,7 @@
       ex_klass_node = new (C, ex_node->req()) PhiNode( ex_node->in(0), TypeKlassPtr::OBJECT );
       for( uint i = 1; i < ex_node->req(); i++ ) {
         Node* p = basic_plus_adr( ex_node->in(i), ex_node->in(i), oopDesc::klass_offset_in_bytes() );
-        Node* k = _gvn.transform(new (C, 3) LoadKlassNode(0, immutable_memory(), p, TypeInstPtr::KLASS, TypeKlassPtr::OBJECT));
+        Node* k = _gvn.transform( LoadKlassNode::make(_gvn, immutable_memory(), p, TypeInstPtr::KLASS, TypeKlassPtr::OBJECT) );
         ex_klass_node->init_req( i, k );
       }
       _gvn.set_type(ex_klass_node, TypeKlassPtr::OBJECT);
--- a/hotspot/src/share/vm/opto/escape.cpp	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/src/share/vm/opto/escape.cpp	Thu Jun 12 13:50:55 2008 -0700
@@ -417,11 +417,18 @@
   //       | |
   //       AddP  ( base == address )
   //
+  // case #8. narrow Klass's field reference.
+  //      LoadNKlass
+  //       |
+  //      DecodeN
+  //       | |
+  //       AddP  ( base == address )
+  //
   Node *base = addp->in(AddPNode::Base)->uncast();
   if (base->is_top()) { // The AddP case #3 and #6.
     base = addp->in(AddPNode::Address)->uncast();
     assert(base->Opcode() == Op_ConP || base->Opcode() == Op_ThreadLocal ||
-           base->Opcode() == Op_CastX2P ||
+           base->Opcode() == Op_CastX2P || base->is_DecodeN() ||
            (base->is_Mem() && base->bottom_type() == TypeRawPtr::NOTNULL) ||
            (base->is_Proj() && base->in(0)->is_Allocate()), "sanity");
   }
@@ -888,6 +895,23 @@
       record_for_optimizer(n);
       if (alloc->is_Allocate() && ptn->_scalar_replaceable &&
           (t->isa_instptr() || t->isa_aryptr())) {
+
+        // First, put on the worklist all Field edges from Connection Graph
+        // which is more accurate then putting immediate users from Ideal Graph.
+        for (uint e = 0; e < ptn->edge_count(); e++) {
+          Node *use = _nodes->adr_at(ptn->edge_target(e))->_node;
+          assert(ptn->edge_type(e) == PointsToNode::FieldEdge && use->is_AddP(),
+                 "only AddP nodes are Field edges in CG");
+          if (use->outcnt() > 0) { // Don't process dead nodes
+            Node* addp2 = find_second_addp(use, use->in(AddPNode::Base));
+            if (addp2 != NULL) {
+              assert(alloc->is_AllocateArray(),"array allocation was expected");
+              alloc_worklist.append_if_missing(addp2);
+            }
+            alloc_worklist.append_if_missing(use);
+          }
+        }
+
         // An allocation may have an Initialize which has raw stores. Scan
         // the users of the raw allocation result and push AddP users
         // on alloc_worklist.
@@ -919,6 +943,8 @@
       tinst = igvn->type(base)->isa_oopptr();
     } else if (n->is_Phi() ||
                n->is_CheckCastPP() ||
+               n->is_EncodeP() ||
+               n->is_DecodeN() ||
                (n->is_ConstraintCast() && n->Opcode() == Op_CastPP)) {
       if (visited.test_set(n->_idx)) {
         assert(n->is_Phi(), "loops only through Phi's");
@@ -935,13 +961,25 @@
         tinst = igvn->type(val)->isa_oopptr();
         assert(tinst != NULL && tinst->is_instance() &&
                tinst->instance_id() == elem , "instance type expected.");
-        const TypeOopPtr *tn_t = igvn->type(tn)->isa_oopptr();
+
+        const TypeOopPtr *tn_t = NULL;
+        const Type *tn_type = igvn->type(tn);
+        if (tn_type->isa_narrowoop()) {
+          tn_t = tn_type->is_narrowoop()->make_oopptr()->isa_oopptr();
+        } else {
+          tn_t = tn_type->isa_oopptr();
+        }
 
         if (tn_t != NULL &&
  tinst->cast_to_instance(TypeOopPtr::UNKNOWN_INSTANCE)->higher_equal(tn_t)) {
+          if (tn_type->isa_narrowoop()) {
+            tn_type = tinst->make_narrowoop();
+          } else {
+            tn_type = tinst;
+          }
           igvn->hash_delete(tn);
-          igvn->set_type(tn, tinst);
-          tn->set_type(tinst);
+          igvn->set_type(tn, tn_type);
+          tn->set_type(tn_type);
           igvn->hash_insert(tn);
           record_for_optimizer(n);
         }
@@ -978,6 +1016,8 @@
         alloc_worklist.append_if_missing(use);
       } else if (use->is_Phi() ||
                  use->is_CheckCastPP() ||
+                 use->is_EncodeP() ||
+                 use->is_DecodeN() ||
                  (use->is_ConstraintCast() && use->Opcode() == Op_CastPP)) {
         alloc_worklist.append_if_missing(use);
       }
@@ -1199,7 +1239,7 @@
 
 void ConnectionGraph::compute_escape() {
 
-  // 1. Populate Connection Graph with Ideal nodes.
+  // 1. Populate Connection Graph (CG) with Ideal nodes.
 
   Unique_Node_List worklist_init;
   worklist_init.map(_compile->unique(), NULL);  // preallocate space
@@ -1281,11 +1321,13 @@
       remove_deferred(ni, &deferred_edges, &visited);
       if (n->is_AddP()) {
         // If this AddP computes an address which may point to more that one
-        // object, nothing the address points to can be scalar replaceable.
+        // object or more then one field (array's element), nothing the address
+        // points to can be scalar replaceable.
         Node *base = get_addp_base(n);
         ptset.Clear();
         PointsTo(ptset, base, igvn);
-        if (ptset.Size() > 1) {
+        if (ptset.Size() > 1 ||
+            (ptset.Size() != 0 && ptn->offset() == Type::OffsetBot)) {
           for( VectorSetI j(&ptset); j.test(); ++j ) {
             uint pt = j.elem;
             ptnode_adr(pt)->_scalar_replaceable = false;
@@ -1538,6 +1580,7 @@
       if (k->Opcode() == Op_LoadKlass) {
         kt = k->as_Load()->type()->isa_klassptr();
       } else {
+        // Also works for DecodeN(LoadNKlass).
         kt = k->as_Type()->type()->isa_klassptr();
       }
       assert(kt != NULL, "TypeKlassPtr  required.");
@@ -1776,6 +1819,7 @@
       break;
     }
     case Op_LoadKlass:
+    case Op_LoadNKlass:
     {
       add_node(n, PointsToNode::JavaObject, PointsToNode::GlobalEscape, true);
       break;
@@ -1979,12 +2023,18 @@
       assert(false, "Op_ConP");
       break;
     }
+    case Op_ConN:
+    {
+      assert(false, "Op_ConN");
+      break;
+    }
     case Op_CreateEx:
     {
       assert(false, "Op_CreateEx");
       break;
     }
     case Op_LoadKlass:
+    case Op_LoadNKlass:
     {
       assert(false, "Op_LoadKlass");
       break;
--- a/hotspot/src/share/vm/opto/graphKit.cpp	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/src/share/vm/opto/graphKit.cpp	Thu Jun 12 13:50:55 2008 -0700
@@ -532,7 +532,7 @@
         C->log()->elem("hot_throw preallocated='1' reason='%s'",
                        Deoptimization::trap_reason_name(reason));
       const TypeInstPtr* ex_con  = TypeInstPtr::make(ex_obj);
-      Node*              ex_node = _gvn.transform(new (C, 1) ConPNode(ex_con));
+      Node*              ex_node = _gvn.transform( ConNode::make(C, ex_con) );
 
       // Clear the detail message of the preallocated exception object.
       // Weblogic sometimes mutates the detail message of exceptions
@@ -1043,7 +1043,7 @@
   Node* akls = AllocateNode::Ideal_klass(obj, &_gvn);
   if (akls != NULL)  return akls;
   Node* k_adr = basic_plus_adr(obj, oopDesc::klass_offset_in_bytes());
-  return _gvn.transform( new (C, 3) LoadKlassNode(0, immutable_memory(), k_adr, TypeInstPtr::KLASS) );
+  return _gvn.transform( LoadKlassNode::make(_gvn, immutable_memory(), k_adr, TypeInstPtr::KLASS) );
 }
 
 //-------------------------load_array_length-----------------------------------
@@ -2224,7 +2224,7 @@
   // cache which is mutable so can't use immutable memory.  Other
   // types load from the super-class display table which is immutable.
   Node *kmem = might_be_cache ? memory(p2) : immutable_memory();
-  Node *nkls = _gvn.transform( new (C, 3) LoadKlassNode( NULL, kmem, p2, _gvn.type(p2)->is_ptr(), TypeKlassPtr::OBJECT_OR_NULL ) );
+  Node *nkls = _gvn.transform( LoadKlassNode::make( _gvn, kmem, p2, _gvn.type(p2)->is_ptr(), TypeKlassPtr::OBJECT_OR_NULL ) );
 
   // Compile speed common case: ARE a subtype and we canNOT fail
   if( superklass == nkls )
@@ -2815,7 +2815,6 @@
     // initialization, and source them from the new InitializeNode.
     // This will allow us to observe initializations when they occur,
     // and link them properly (as a group) to the InitializeNode.
-    Node* klass_node = alloc->in(AllocateNode::KlassNode);
     assert(init->in(InitializeNode::Memory) == malloc, "");
     MergeMemNode* minit_in = MergeMemNode::make(C, malloc);
     init->set_req(InitializeNode::Memory, minit_in);
--- a/hotspot/src/share/vm/opto/lcm.cpp	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/src/share/vm/opto/lcm.cpp	Thu Jun 12 13:50:55 2008 -0700
@@ -113,6 +113,7 @@
     case Op_LoadN:
     case Op_LoadS:
     case Op_LoadKlass:
+    case Op_LoadNKlass:
     case Op_LoadRange:
     case Op_LoadD_unaligned:
     case Op_LoadL_unaligned:
@@ -133,6 +134,7 @@
       if( mach->in(2) != val ) continue;
       break;                    // Found a memory op?
     case Op_StrComp:
+    case Op_AryEq:
       // Not a legit memory op for implicit null check regardless of
       // embedded loads
       continue;
--- a/hotspot/src/share/vm/opto/library_call.cpp	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/src/share/vm/opto/library_call.cpp	Thu Jun 12 13:50:55 2008 -0700
@@ -163,6 +163,7 @@
   bool inline_native_newArray();
   bool inline_native_getLength();
   bool inline_array_copyOf(bool is_copyOfRange);
+  bool inline_array_equals();
   bool inline_native_clone(bool is_virtual);
   bool inline_native_Reflection_getCallerClass();
   bool inline_native_AtomicLong_get();
@@ -259,6 +260,7 @@
     switch (id) {
     case vmIntrinsics::_indexOf:
     case vmIntrinsics::_compareTo:
+    case vmIntrinsics::_equalsC:
       break;  // InlineNatives does not control String.compareTo
     default:
       return NULL;
@@ -272,6 +274,9 @@
   case vmIntrinsics::_indexOf:
     if (!SpecialStringIndexOf)  return NULL;
     break;
+  case vmIntrinsics::_equalsC:
+    if (!SpecialArraysEquals)  return NULL;
+    break;
   case vmIntrinsics::_arraycopy:
     if (!InlineArrayCopy)  return NULL;
     break;
@@ -586,6 +591,8 @@
     return inline_array_copyOf(false);
   case vmIntrinsics::_copyOfRange:
     return inline_array_copyOf(true);
+  case vmIntrinsics::_equalsC:
+    return inline_array_equals();
   case vmIntrinsics::_clone:
     return inline_native_clone(intrinsic()->is_virtual());
 
@@ -813,6 +820,24 @@
   return true;
 }
 
+//------------------------------inline_array_equals----------------------------
+bool LibraryCallKit::inline_array_equals() {
+
+  if (!Matcher::has_match_rule(Op_AryEq)) return false;
+
+  _sp += 2;
+  Node *argument2 = pop();
+  Node *argument1 = pop();
+
+  Node* equals =
+    _gvn.transform(new (C, 3) AryEqNode(control(),
+                                        argument1,
+                                        argument2)
+                   );
+  push(equals);
+  return true;
+}
+
 // Java version of String.indexOf(constant string)
 // class StringDecl {
 //   StringDecl(char[] ca) {
@@ -896,7 +921,7 @@
   Node* sourcea       = basic_plus_adr(string_object, string_object, value_offset);
   Node* source        = make_load(no_ctrl, sourcea, source_type, T_OBJECT, string_type->add_offset(value_offset));
 
-  Node* target = _gvn.transform(ConPNode::make(C, target_array));
+  Node* target = _gvn.transform( makecon(TypeOopPtr::make_from_constant(target_array)) );
   jint target_length = target_array->length();
   const TypeAry* target_array_type = TypeAry::make(TypeInt::CHAR, TypeInt::make(0, target_length, Type::WidenMin));
   const TypeAryPtr* target_type = TypeAryPtr::make(TypePtr::BotPTR, target_array_type, target_array->klass(), true, Type::OffsetBot);
@@ -2168,7 +2193,7 @@
     // (They don't if CAS fails, but it isn't worth checking.)
     pre_barrier(control(), base, adr, alias_idx, newval, value_type, T_OBJECT);
 #ifdef _LP64
-    if (adr->bottom_type()->is_narrow()) {
+    if (adr->bottom_type()->is_ptr_to_narrowoop()) {
       cas = _gvn.transform(new (C, 5) CompareAndSwapNNode(control(), mem, adr,
                                                            EncodePNode::encode(&_gvn, newval),
                                                            EncodePNode::encode(&_gvn, oldval)));
@@ -2454,7 +2479,7 @@
   if (region == NULL)  never_see_null = true;
   Node* p = basic_plus_adr(mirror, offset);
   const TypeKlassPtr*  kls_type = TypeKlassPtr::OBJECT_OR_NULL;
-  Node* kls = _gvn.transform(new (C, 3) LoadKlassNode(0, immutable_memory(), p, TypeRawPtr::BOTTOM, kls_type));
+  Node* kls = _gvn.transform( LoadKlassNode::make(_gvn, immutable_memory(), p, TypeRawPtr::BOTTOM, kls_type) );
   _sp += nargs; // any deopt will start just before call to enclosing method
   Node* null_ctl = top();
   kls = null_check_oop(kls, &null_ctl, never_see_null);
@@ -2634,7 +2659,7 @@
       phi->add_req(makecon(TypeInstPtr::make(env()->Object_klass()->java_mirror())));
     // If we fall through, it's a plain class.  Get its _super.
     p = basic_plus_adr(kls, Klass::super_offset_in_bytes() + sizeof(oopDesc));
-    kls = _gvn.transform(new (C, 3) LoadKlassNode(0, immutable_memory(), p, TypeRawPtr::BOTTOM, TypeKlassPtr::OBJECT_OR_NULL));
+    kls = _gvn.transform( LoadKlassNode::make(_gvn, immutable_memory(), p, TypeRawPtr::BOTTOM, TypeKlassPtr::OBJECT_OR_NULL) );
     null_ctl = top();
     kls = null_check_oop(kls, &null_ctl);
     if (null_ctl != top()) {
@@ -2720,7 +2745,7 @@
     args[which_arg] = _gvn.transform(arg);
 
     Node* p = basic_plus_adr(arg, class_klass_offset);
-    Node* kls = new (C, 3) LoadKlassNode(0, immutable_memory(), p, adr_type, kls_type);
+    Node* kls = LoadKlassNode::make(_gvn, immutable_memory(), p, adr_type, kls_type);
     klasses[which_arg] = _gvn.transform(kls);
   }
 
@@ -2838,6 +2863,8 @@
   _sp += nargs;  // set original stack for use by uncommon_trap
   mirror = do_null_check(mirror, T_OBJECT);
   _sp -= nargs;
+  // If mirror or obj is dead, only null-path is taken.
+  if (stopped())  return true;
 
   enum { _normal_path = 1, _slow_path = 2, PATH_LIMIT };
   RegionNode* result_reg = new(C, PATH_LIMIT) RegionNode(PATH_LIMIT);
@@ -3827,24 +3854,22 @@
   if (!stopped()) {
     // Copy the fastest available way.
     // (No need for PreserveJVMState, since we're using it all up now.)
+    // TODO: generate fields/elements copies for small objects instead.
     Node* src  = obj;
     Node* dest = raw_obj;
-    Node* end  = dest;
     Node* size = _gvn.transform(alloc_siz);
 
     // Exclude the header.
     int base_off = instanceOopDesc::base_offset_in_bytes();
     if (UseCompressedOops) {
-      // copy the header gap though.
-      Node* sptr = basic_plus_adr(src,  base_off);
-      Node* dptr = basic_plus_adr(dest, base_off);
-      Node* sval = make_load(control(), sptr, TypeInt::INT, T_INT, raw_adr_type);
-      store_to_memory(control(), dptr, sval, T_INT, raw_adr_type);
-      base_off += sizeof(int);
+      assert(base_off % BytesPerLong != 0, "base with compressed oops");
+      // With compressed oops base_offset_in_bytes is 12 which creates
+      // the gap since countx is rounded by 8 bytes below.
+      // Copy klass and the gap.
+      base_off = instanceOopDesc::klass_offset_in_bytes();
     }
     src  = basic_plus_adr(src,  base_off);
     dest = basic_plus_adr(dest, base_off);
-    end  = basic_plus_adr(end,  size);
 
     // Compute the length also, if needed:
     Node* countx = size;
@@ -4388,7 +4413,7 @@
       // (At this point we can assume disjoint_bases, since types differ.)
       int ek_offset = objArrayKlass::element_klass_offset_in_bytes() + sizeof(oopDesc);
       Node* p1 = basic_plus_adr(dest_klass, ek_offset);
-      Node* n1 = new (C, 3) LoadKlassNode(0, immutable_memory(), p1, TypeRawPtr::BOTTOM);
+      Node* n1 = LoadKlassNode::make(_gvn, immutable_memory(), p1, TypeRawPtr::BOTTOM);
       Node* dest_elem_klass = _gvn.transform(n1);
       Node* cv = generate_checkcast_arraycopy(adr_type,
                                               dest_elem_klass,
--- a/hotspot/src/share/vm/opto/loopnode.cpp	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/src/share/vm/opto/loopnode.cpp	Thu Jun 12 13:50:55 2008 -0700
@@ -2632,6 +2632,7 @@
     case Op_LoadD_unaligned:
     case Op_LoadL_unaligned:
     case Op_StrComp:            // Does a bunch of load-like effects
+    case Op_AryEq:
       pinned = false;
     }
     if( pinned ) {
--- a/hotspot/src/share/vm/opto/loopopts.cpp	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/src/share/vm/opto/loopopts.cpp	Thu Jun 12 13:50:55 2008 -0700
@@ -464,6 +464,7 @@
     case T_FLOAT:
     case T_DOUBLE:
     case T_ADDRESS:             // (RawPtr)
+    case T_NARROWOOP:
       cost++;
       break;
     case T_OBJECT: {            // Base oops are OK, but not derived oops
--- a/hotspot/src/share/vm/opto/macro.cpp	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/src/share/vm/opto/macro.cpp	Thu Jun 12 13:50:55 2008 -0700
@@ -458,7 +458,7 @@
         }
       } else if (use->is_SafePoint()) {
         SafePointNode* sfpt = use->as_SafePoint();
-        if (sfpt->has_non_debug_use(res)) {
+        if (sfpt->is_Call() && sfpt->as_Call()->has_non_debug_use(res)) {
           // Object is passed as argument.
           DEBUG_ONLY(disq_node = use;)
           NOT_PRODUCT(fail_eliminate = "Object is passed as argument";)
@@ -1288,12 +1288,6 @@
   }
   rawmem = make_store(control, rawmem, object, oopDesc::mark_offset_in_bytes(), mark_node, T_ADDRESS);
 
-  if (UseCompressedOops) {
-    Node *zeronode = makecon(TypeInt::ZERO);
-    // store uncompressed 0 into klass ptr to zero out gap.  The gap is
-    // used for primitive fields and has to be zeroed.
-    rawmem = make_store(control, rawmem, object, oopDesc::klass_gap_offset_in_bytes(), zeronode, T_INT);
-  }
   rawmem = make_store(control, rawmem, object, oopDesc::klass_offset_in_bytes(), klass_node, T_OBJECT);
   int header_size = alloc->minimum_header_size();  // conservatively small
 
--- a/hotspot/src/share/vm/opto/matcher.cpp	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/src/share/vm/opto/matcher.cpp	Thu Jun 12 13:50:55 2008 -0700
@@ -52,7 +52,7 @@
 #ifdef ASSERT
   _old2new_map(C->comp_arena()),
 #endif
-  _shared_constants(C->comp_arena()),
+  _shared_nodes(C->comp_arena()),
   _reduceOp(reduceOp), _leftOp(leftOp), _rightOp(rightOp),
   _swallowed(swallowed),
   _begin_inst_chain_rule(_BEGIN_INST_CHAIN_RULE),
@@ -744,6 +744,7 @@
   if (nidx == Compile::AliasIdxBot && midx == Compile::AliasIdxTop) {
     switch (n->Opcode()) {
     case Op_StrComp:
+    case Op_AryEq:
     case Op_MemBarVolatile:
     case Op_MemBarCPUOrder: // %%% these ideals should have narrower adr_type?
       nidx = Compile::AliasIdxTop;
@@ -880,7 +881,7 @@
         Node *m = n->in(i);          // Get input
         int op = m->Opcode();
         assert((op == Op_BoxLock) == jvms->is_monitor_use(i), "boxes only at monitor sites");
-        if( op == Op_ConI || op == Op_ConP ||
+        if( op == Op_ConI || op == Op_ConP || op == Op_ConN ||
             op == Op_ConF || op == Op_ConD || op == Op_ConL
             // || op == Op_BoxLock  // %%%% enable this and remove (+++) in chaitin.cpp
             ) {
@@ -1191,7 +1192,7 @@
   uint cnt = n->req();
   uint start = 1;
   if( mem != (Node*)1 ) start = MemNode::Memory+1;
-  if( n->Opcode() == Op_AddP ) {
+  if( n->is_AddP() ) {
     assert( mem == (Node*)1, "" );
     start = AddPNode::Base+1;
   }
@@ -1219,7 +1220,7 @@
   if( t->singleton() ) {
     // Never force constants into registers.  Allow them to match as
     // constants or registers.  Copies of the same value will share
-    // the same register.  See find_shared_constant.
+    // the same register.  See find_shared_node.
     return false;
   } else {                      // Not a constant
     // Stop recursion if they have different Controls.
@@ -1243,12 +1244,10 @@
       if( j == max_scan )       // No post-domination before scan end?
         return true;            // Then break the match tree up
     }
-
-    if (m->Opcode() == Op_DecodeN && m->outcnt() == 2) {
+    if (m->is_DecodeN() && Matcher::clone_shift_expressions) {
       // These are commonly used in address expressions and can
-      // efficiently fold into them in some cases but because they are
-      // consumed by AddP they commonly have two users.
-      if (m->raw_out(0) == m->raw_out(1) && m->raw_out(0)->Opcode() == Op_AddP) return false;
+      // efficiently fold into them on X64 in some cases.
+      return false;
     }
   }
 
@@ -1368,13 +1367,16 @@
 // which reduces the number of copies of a constant in the final
 // program.  The register allocator is free to split uses later to
 // split live ranges.
-MachNode* Matcher::find_shared_constant(Node* leaf, uint rule) {
-  if (!leaf->is_Con()) return NULL;
+MachNode* Matcher::find_shared_node(Node* leaf, uint rule) {
+  if (!leaf->is_Con() && !leaf->is_DecodeN()) return NULL;
 
   // See if this Con has already been reduced using this rule.
-  if (_shared_constants.Size() <= leaf->_idx) return NULL;
-  MachNode* last = (MachNode*)_shared_constants.at(leaf->_idx);
+  if (_shared_nodes.Size() <= leaf->_idx) return NULL;
+  MachNode* last = (MachNode*)_shared_nodes.at(leaf->_idx);
   if (last != NULL && rule == last->rule()) {
+    // Don't expect control change for DecodeN
+    if (leaf->is_DecodeN())
+      return last;
     // Get the new space root.
     Node* xroot = new_node(C->root());
     if (xroot == NULL) {
@@ -1420,9 +1422,9 @@
 MachNode *Matcher::ReduceInst( State *s, int rule, Node *&mem ) {
   assert( rule >= NUM_OPERANDS, "called with operand rule" );
 
-  MachNode* shared_con = find_shared_constant(s->_leaf, rule);
-  if (shared_con != NULL) {
-    return shared_con;
+  MachNode* shared_node = find_shared_node(s->_leaf, rule);
+  if (shared_node != NULL) {
+    return shared_node;
   }
 
   // Build the object to represent this state & prepare for recursive calls
@@ -1447,7 +1449,7 @@
     mach->ins_req(MemNode::Memory,mem);
 
   // If the _leaf is an AddP, insert the base edge
-  if( leaf->Opcode() == Op_AddP )
+  if( leaf->is_AddP() )
     mach->ins_req(AddPNode::Base,leaf->in(AddPNode::Base));
 
   uint num_proj = _proj_list.size();
@@ -1475,9 +1477,9 @@
     guarantee(_proj_list.size() == num_proj, "no allocation during spill generation");
   }
 
-  if (leaf->is_Con()) {
+  if (leaf->is_Con() || leaf->is_DecodeN()) {
     // Record the con for sharing
-    _shared_constants.map(leaf->_idx, ex);
+    _shared_nodes.map(leaf->_idx, ex);
   }
 
   return ex;
@@ -1716,6 +1718,7 @@
         mstack.push(n->in(0), Pre_Visit);     // Visit Control input
         continue;                             // while (mstack.is_nonempty())
       case Op_StrComp:
+      case Op_AryEq:
         set_shared(n); // Force result into register (it will be anyways)
         break;
       case Op_ConP: {  // Convert pointers above the centerline to NUL
@@ -1726,6 +1729,14 @@
         }
         break;
       }
+      case Op_ConN: {  // Convert narrow pointers above the centerline to NUL
+        TypeNode *tn = n->as_Type(); // Constants derive from type nodes
+        const TypePtr* tp = tn->type()->is_narrowoop()->make_oopptr();
+        if (tp->_ptr == TypePtr::AnyNull) {
+          tn->set_type(TypeNarrowOop::NULL_PTR);
+        }
+        break;
+      }
       case Op_Binary:         // These are introduced in the Post_Visit state.
         ShouldNotReachHere();
         break;
@@ -1760,6 +1771,7 @@
       case Op_LoadF:
       case Op_LoadI:
       case Op_LoadKlass:
+      case Op_LoadNKlass:
       case Op_LoadL:
       case Op_LoadS:
       case Op_LoadP:
@@ -1817,7 +1829,7 @@
             Node *adr = m->in(AddPNode::Address);
 
             // Intel, ARM and friends can handle 2 adds in addressing mode
-            if( clone_shift_expressions && adr->Opcode() == Op_AddP &&
+            if( clone_shift_expressions && adr->is_AddP() &&
                 // AtomicAdd is not an addressing expression.
                 // Cheap to find it by looking for screwy base.
                 !adr->in(AddPNode::Base)->is_top() ) {
@@ -1891,6 +1903,7 @@
       case Op_CMoveF:
       case Op_CMoveI:
       case Op_CMoveL:
+      case Op_CMoveN:
       case Op_CMoveP: {
         // Restructure into a binary tree for Matching.  It's possible that
         // we could move this code up next to the graph reshaping for IfNodes
--- a/hotspot/src/share/vm/opto/matcher.hpp	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/src/share/vm/opto/matcher.hpp	Thu Jun 12 13:50:55 2008 -0700
@@ -48,7 +48,7 @@
   void ReduceOper( State *s, int newrule, Node *&mem, MachNode *mach );
 
   // If this node already matched using "rule", return the MachNode for it.
-  MachNode* find_shared_constant(Node* con, uint rule);
+  MachNode* find_shared_node(Node* n, uint rule);
 
   // Convert a dense opcode number to an expanded rule number
   const int *_reduceOp;
@@ -81,7 +81,7 @@
 
   Node_List &_proj_list;        // For Machine nodes killing many values
 
-  Node_Array _shared_constants;
+  Node_Array _shared_nodes;
 
   debug_only(Node_Array _old2new_map;)   // Map roots of ideal-trees to machine-roots
 
--- a/hotspot/src/share/vm/opto/memnode.cpp	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/src/share/vm/opto/memnode.cpp	Thu Jun 12 13:50:55 2008 -0700
@@ -133,7 +133,9 @@
     PhiNode *mphi = result->as_Phi();
     assert(mphi->bottom_type() == Type::MEMORY, "memory phi required");
     const TypePtr *t = mphi->adr_type();
-    if (t == TypePtr::BOTTOM || t == TypeRawPtr::BOTTOM) {
+    if (t == TypePtr::BOTTOM || t == TypeRawPtr::BOTTOM ||
+        t->isa_oopptr() && !t->is_oopptr()->is_instance() &&
+        t->is_oopptr()->cast_to_instance(t_oop->instance_id()) == t_oop) {
       // clone the Phi with our address type
       result = mphi->split_out_instance(t_adr, igvn);
     } else {
@@ -154,7 +156,7 @@
                        phase->C->must_alias(adr_check, alias_idx );
     // Sometimes dead array references collapse to a[-1], a[-2], or a[-3]
     if( !consistent && adr_check != NULL && !adr_check->empty() &&
-           tp->isa_aryptr() &&    tp->offset() == Type::OffsetBot &&
+               tp->isa_aryptr() &&        tp->offset() == Type::OffsetBot &&
         adr_check->isa_aryptr() && adr_check->offset() != Type::OffsetBot &&
         ( adr_check->offset() == arrayOopDesc::length_offset_in_bytes() ||
           adr_check->offset() == oopDesc::klass_offset_in_bytes() ||
@@ -256,14 +258,17 @@
   if (dom == NULL || dom->is_top())
     return false; // Conservative answer for dead code
 
-  if (dom->is_Start() || dom->is_Root() || dom == sub)
+  if (dom->is_Con() || dom->is_Start() || dom->is_Root() || dom == sub)
     return true;
 
   // 'dom' dominates 'sub' if its control edge and control edges
   // of all its inputs dominate or equal to sub's control edge.
 
   // Currently 'sub' is either Allocate, Initialize or Start nodes.
-  assert(sub->is_Allocate() || sub->is_Initialize() || sub->is_Start(), "expecting only these nodes");
+  // Or Region for the check in LoadNode::Ideal();
+  // 'sub' should have sub->in(0) != NULL.
+  assert(sub->is_Allocate() || sub->is_Initialize() || sub->is_Start() ||
+         sub->is_Region(), "expecting only these nodes");
 
   // Get control edge of 'sub'.
   sub = sub->find_exact_control(sub->in(0));
@@ -298,7 +303,7 @@
           return false; // Conservative answer for dead code
         assert(n->is_CFG(), "expecting control");
       }
-      if (n->is_Start() || n->is_Root()) {
+      if (n->is_Con() || n->is_Start() || n->is_Root()) {
         only_dominating_controls = true;
       } else if (n->is_CFG()) {
         if (n->dominates(sub, nlist))
@@ -308,12 +313,11 @@
       } else {
         // First, own control edge.
         Node* m = n->find_exact_control(n->in(0));
-        if (m == NULL)
-          continue;
-        if (m->is_top())
-          return false; // Conservative answer for dead code
-        dom_list.push(m);
-
+        if (m != NULL) {
+          if (m->is_top())
+            return false; // Conservative answer for dead code
+          dom_list.push(m);
+        }
         // Now, the rest of edges.
         uint cnt = n->req();
         for (uint i = 1; i < cnt; i++) {
@@ -577,6 +581,9 @@
 // Find any cast-away of null-ness and keep its control.  Null cast-aways are
 // going away in this pass and we need to make this memory op depend on the
 // gating null check.
+Node *MemNode::Ideal_DU_postCCP( PhaseCCP *ccp ) {
+  return Ideal_common_DU_postCCP(ccp, this, in(MemNode::Address));
+}
 
 // I tried to leave the CastPP's in.  This makes the graph more accurate in
 // some sense; we get to keep around the knowledge that an oop is not-null
@@ -586,15 +593,14 @@
 // some of the more trivial cases in the optimizer.  Removing more useless
 // Phi's started allowing Loads to illegally float above null checks.  I gave
 // up on this approach.  CNC 10/20/2000
-Node *MemNode::Ideal_DU_postCCP( PhaseCCP *ccp ) {
-  Node *ctr = in(MemNode::Control);
-  Node *mem = in(MemNode::Memory);
-  Node *adr = in(MemNode::Address);
+// This static method may be called not from MemNode (EncodePNode calls it).
+// Only the control edge of the node 'n' might be updated.
+Node *MemNode::Ideal_common_DU_postCCP( PhaseCCP *ccp, Node* n, Node* adr ) {
   Node *skipped_cast = NULL;
   // Need a null check?  Regular static accesses do not because they are
   // from constant addresses.  Array ops are gated by the range check (which
   // always includes a NULL check).  Just check field ops.
-  if( !ctr ) {
+  if( n->in(MemNode::Control) == NULL ) {
     // Scan upwards for the highest location we can place this memory op.
     while( true ) {
       switch( adr->Opcode() ) {
@@ -619,10 +625,10 @@
         }
         // CastPP is going away in this pass!  We need this memory op to be
         // control-dependent on the test that is guarding the CastPP.
-        ccp->hash_delete(this);
-        set_req(MemNode::Control, adr->in(0));
-        ccp->hash_insert(this);
-        return this;
+        ccp->hash_delete(n);
+        n->set_req(MemNode::Control, adr->in(0));
+        ccp->hash_insert(n);
+        return n;
 
       case Op_Phi:
         // Attempt to float above a Phi to some dominating point.
@@ -653,10 +659,10 @@
           adr = adr->in(1);
           continue;
         }
-        ccp->hash_delete(this);
-        set_req(MemNode::Control, adr->in(0));
-        ccp->hash_insert(this);
-        return this;
+        ccp->hash_delete(n);
+        n->set_req(MemNode::Control, adr->in(0));
+        ccp->hash_insert(n);
+        return n;
 
         // List of "safe" opcodes; those that implicitly block the memory
         // op below any null check.
@@ -665,10 +671,13 @@
       case Op_LoadP:            // Loading from within a klass
       case Op_LoadN:            // Loading from within a klass
       case Op_LoadKlass:        // Loading from within a klass
+      case Op_LoadNKlass:       // Loading from within a klass
       case Op_ConP:             // Loading from a klass
+      case Op_ConN:             // Loading from a klass
       case Op_CreateEx:         // Sucking up the guts of an exception oop
       case Op_Con:              // Reading from TLS
       case Op_CMoveP:           // CMoveP is pinned
+      case Op_CMoveN:           // CMoveN is pinned
         break;                  // No progress
 
       case Op_Proj:             // Direct call to an allocation routine
@@ -677,8 +686,8 @@
         {
           assert(adr->as_Proj()->_con == TypeFunc::Parms, "must be return value");
           const Node* call = adr->in(0);
-          if (call->is_CallStaticJava()) {
-            const CallStaticJavaNode* call_java = call->as_CallStaticJava();
+          if (call->is_CallJava()) {
+            const CallJavaNode* call_java = call->as_CallJava();
             const TypeTuple *r = call_java->tf()->range();
             assert(r->cnt() > TypeFunc::Parms, "must return value");
             const Type* ret_type = r->field_at(TypeFunc::Parms);
@@ -750,7 +759,7 @@
   case T_ADDRESS: return new (C, 3) LoadPNode(ctl, mem, adr, adr_type, rt->is_ptr()    );
   case T_OBJECT:
 #ifdef _LP64
-    if (adr->bottom_type()->is_narrow()) {
+    if (adr->bottom_type()->is_ptr_to_narrowoop()) {
       const TypeNarrowOop* narrowtype;
       if (rt->isa_narrowoop()) {
         narrowtype = rt->is_narrowoop();
@@ -762,10 +771,10 @@
       return DecodeNNode::decode(&gvn, load);
     } else
 #endif
-      {
-        assert(!adr->bottom_type()->is_narrow(), "should have got back a narrow oop");
-        return new (C, 3) LoadPNode(ctl, mem, adr, adr_type, rt->is_oopptr());
-      }
+    {
+      assert(!adr->bottom_type()->is_ptr_to_narrowoop(), "should have got back a narrow oop");
+      return new (C, 3) LoadPNode(ctl, mem, adr, adr_type, rt->is_oopptr());
+    }
   }
   ShouldNotReachHere();
   return (LoadNode*)NULL;
@@ -1119,6 +1128,127 @@
   return NULL;
 }
 
+//------------------------------split_through_phi------------------------------
+// Split instance field load through Phi.
+Node *LoadNode::split_through_phi(PhaseGVN *phase) {
+  Node* mem     = in(MemNode::Memory);
+  Node* address = in(MemNode::Address);
+  const TypePtr *addr_t = phase->type(address)->isa_ptr();
+  const TypeOopPtr *t_oop = addr_t->isa_oopptr();
+
+  assert(mem->is_Phi() && (t_oop != NULL) &&
+         t_oop->is_instance_field(), "invalide conditions");
+
+  Node *region = mem->in(0);
+  if (region == NULL) {
+    return NULL; // Wait stable graph
+  }
+  uint cnt = mem->req();
+  for( uint i = 1; i < cnt; i++ ) {
+    Node *in = mem->in(i);
+    if( in == NULL ) {
+      return NULL; // Wait stable graph
+    }
+  }
+  // Check for loop invariant.
+  if (cnt == 3) {
+    for( uint i = 1; i < cnt; i++ ) {
+      Node *in = mem->in(i);
+      Node* m = MemNode::optimize_memory_chain(in, addr_t, phase);
+      if (m == mem) {
+        set_req(MemNode::Memory, mem->in(cnt - i)); // Skip this phi.
+        return this;
+      }
+    }
+  }
+  // Split through Phi (see original code in loopopts.cpp).
+  assert(phase->C->have_alias_type(addr_t), "instance should have alias type");
+
+  // Do nothing here if Identity will find a value
+  // (to avoid infinite chain of value phis generation).
+  if ( !phase->eqv(this, this->Identity(phase)) )
+    return NULL;
+
+  // Skip the split if the region dominates some control edge of the address.
+  if (cnt == 3 && !MemNode::all_controls_dominate(address, region))
+    return NULL;
+
+  const Type* this_type = this->bottom_type();
+  int this_index  = phase->C->get_alias_index(addr_t);
+  int this_offset = addr_t->offset();
+  int this_iid    = addr_t->is_oopptr()->instance_id();
+  int wins = 0;
+  PhaseIterGVN *igvn = phase->is_IterGVN();
+  Node *phi = new (igvn->C, region->req()) PhiNode(region, this_type, NULL, this_iid, this_index, this_offset);
+  for( uint i = 1; i < region->req(); i++ ) {
+    Node *x;
+    Node* the_clone = NULL;
+    if( region->in(i) == phase->C->top() ) {
+      x = phase->C->top();      // Dead path?  Use a dead data op
+    } else {
+      x = this->clone();        // Else clone up the data op
+      the_clone = x;            // Remember for possible deletion.
+      // Alter data node to use pre-phi inputs
+      if( this->in(0) == region ) {
+        x->set_req( 0, region->in(i) );
+      } else {
+        x->set_req( 0, NULL );
+      }
+      for( uint j = 1; j < this->req(); j++ ) {
+        Node *in = this->in(j);
+        if( in->is_Phi() && in->in(0) == region )
+          x->set_req( j, in->in(i) ); // Use pre-Phi input for the clone
+      }
+    }
+    // Check for a 'win' on some paths
+    const Type *t = x->Value(igvn);
+
+    bool singleton = t->singleton();
+
+    // See comments in PhaseIdealLoop::split_thru_phi().
+    if( singleton && t == Type::TOP ) {
+      singleton &= region->is_Loop() && (i != LoopNode::EntryControl);
+    }
+
+    if( singleton ) {
+      wins++;
+      x = igvn->makecon(t);
+    } else {
+      // We now call Identity to try to simplify the cloned node.
+      // Note that some Identity methods call phase->type(this).
+      // Make sure that the type array is big enough for
+      // our new node, even though we may throw the node away.
+      // (This tweaking with igvn only works because x is a new node.)
+      igvn->set_type(x, t);
+      Node *y = x->Identity(igvn);
+      if( y != x ) {
+        wins++;
+        x = y;
+      } else {
+        y = igvn->hash_find(x);
+        if( y ) {
+          wins++;
+          x = y;
+        } else {
+          // Else x is a new node we are keeping
+          // We do not need register_new_node_with_optimizer
+          // because set_type has already been called.
+          igvn->_worklist.push(x);
+        }
+      }
+    }
+    if (x != the_clone && the_clone != NULL)
+      igvn->remove_dead_node(the_clone);
+    phi->set_req(i, x);
+  }
+  if( wins > 0 ) {
+    // Record Phi
+    igvn->register_new_node_with_optimizer(phi);
+    return phi;
+  }
+  igvn->remove_dead_node(phi);
+  return NULL;
+}
 
 //------------------------------Ideal------------------------------------------
 // If the load is from Field memory and the pointer is non-null, we can
@@ -1176,112 +1306,9 @@
     const TypeOopPtr *t_oop = addr_t->isa_oopptr();
     if (can_reshape && opt_mem->is_Phi() &&
         (t_oop != NULL) && t_oop->is_instance_field()) {
-      assert(t_oop->offset() != Type::OffsetBot && t_oop->offset() != Type::OffsetTop, "");
-      Node *region = opt_mem->in(0);
-      uint cnt = opt_mem->req();
-      for( uint i = 1; i < cnt; i++ ) {
-        Node *in = opt_mem->in(i);
-        if( in == NULL ) {
-          region = NULL; // Wait stable graph
-          break;
-        }
-      }
-      if (region != NULL) {
-        // Check for loop invariant.
-        if (cnt == 3) {
-          for( uint i = 1; i < cnt; i++ ) {
-            Node *in = opt_mem->in(i);
-            Node* m = MemNode::optimize_memory_chain(in, addr_t, phase);
-            if (m == opt_mem) {
-              set_req(MemNode::Memory, opt_mem->in(cnt - i)); // Skip this phi.
-              return this;
-            }
-          }
-        }
-        // Split through Phi (see original code in loopopts.cpp).
-        assert(phase->C->have_alias_type(addr_t), "instance should have alias type");
-
-        // Do nothing here if Identity will find a value
-        // (to avoid infinite chain of value phis generation).
-        if ( !phase->eqv(this, this->Identity(phase)) )
-          return NULL;
-
-        const Type* this_type = this->bottom_type();
-        int this_index  = phase->C->get_alias_index(addr_t);
-        int this_offset = addr_t->offset();
-        int this_iid    = addr_t->is_oopptr()->instance_id();
-        int wins = 0;
-        PhaseIterGVN *igvn = phase->is_IterGVN();
-        Node *phi = new (igvn->C, region->req()) PhiNode(region, this_type, NULL, this_iid, this_index, this_offset);
-        for( uint i = 1; i < region->req(); i++ ) {
-          Node *x;
-          Node* the_clone = NULL;
-          if( region->in(i) == phase->C->top() ) {
-            x = phase->C->top();      // Dead path?  Use a dead data op
-          } else {
-            x = this->clone();        // Else clone up the data op
-            the_clone = x;            // Remember for possible deletion.
-            // Alter data node to use pre-phi inputs
-            if( this->in(0) == region ) {
-              x->set_req( 0, region->in(i) );
-            } else {
-              x->set_req( 0, NULL );
-            }
-            for( uint j = 1; j < this->req(); j++ ) {
-              Node *in = this->in(j);
-              if( in->is_Phi() && in->in(0) == region )
-                x->set_req( j, in->in(i) ); // Use pre-Phi input for the clone
-            }
-          }
-          // Check for a 'win' on some paths
-          const Type *t = x->Value(igvn);
-
-          bool singleton = t->singleton();
-
-          // See comments in PhaseIdealLoop::split_thru_phi().
-          if( singleton && t == Type::TOP ) {
-            singleton &= region->is_Loop() && (i != LoopNode::EntryControl);
-          }
-
-          if( singleton ) {
-            wins++;
-            x = igvn->makecon(t);
-          } else {
-            // We now call Identity to try to simplify the cloned node.
-            // Note that some Identity methods call phase->type(this).
-            // Make sure that the type array is big enough for
-            // our new node, even though we may throw the node away.
-            // (This tweaking with igvn only works because x is a new node.)
-            igvn->set_type(x, t);
-            Node *y = x->Identity(igvn);
-            if( y != x ) {
-              wins++;
-              x = y;
-            } else {
-              y = igvn->hash_find(x);
-              if( y ) {
-                wins++;
-                x = y;
-              } else {
-                // Else x is a new node we are keeping
-                // We do not need register_new_node_with_optimizer
-                // because set_type has already been called.
-                igvn->_worklist.push(x);
-              }
-            }
-          }
-          if (x != the_clone && the_clone != NULL)
-            igvn->remove_dead_node(the_clone);
-          phi->set_req(i, x);
-        }
-        if( wins > 0 ) {
-          // Record Phi
-          igvn->register_new_node_with_optimizer(phi);
-          return phi;
-        } else {
-          igvn->remove_dead_node(phi);
-        }
-      }
+      // Split instance field load through Phi.
+      Node* result = split_through_phi(phase);
+      if (result != NULL) return result;
     }
   }
 
@@ -1585,8 +1612,31 @@
 }
 
 //=============================================================================
+//----------------------------LoadKlassNode::make------------------------------
+// Polymorphic factory method:
+Node *LoadKlassNode::make( PhaseGVN& gvn, Node *mem, Node *adr, const TypePtr* at, const TypeKlassPtr *tk ) {
+  Compile* C = gvn.C;
+  Node *ctl = NULL;
+  // sanity check the alias category against the created node type
+  const TypeOopPtr *adr_type = adr->bottom_type()->isa_oopptr();
+  assert(adr_type != NULL, "expecting TypeOopPtr");
+#ifdef _LP64
+  if (adr_type->is_ptr_to_narrowoop()) {
+    const TypeNarrowOop* narrowtype = tk->is_oopptr()->make_narrowoop();
+    Node* load_klass = gvn.transform(new (C, 3) LoadNKlassNode(ctl, mem, adr, at, narrowtype));
+    return DecodeNNode::decode(&gvn, load_klass);
+  }
+#endif
+  assert(!adr_type->is_ptr_to_narrowoop(), "should have got back a narrow oop");
+  return new (C, 3) LoadKlassNode(ctl, mem, adr, at, tk);
+}
+
 //------------------------------Value------------------------------------------
 const Type *LoadKlassNode::Value( PhaseTransform *phase ) const {
+  return klass_value_common(phase);
+}
+
+const Type *LoadNode::klass_value_common( PhaseTransform *phase ) const {
   // Either input is TOP ==> the result is TOP
   const Type *t1 = phase->type( in(MemNode::Memory) );
   if (t1 == Type::TOP)  return Type::TOP;
@@ -1718,6 +1768,10 @@
 // To clean up reflective code, simplify k.java_mirror.as_klass to plain k.
 // Also feed through the klass in Allocate(...klass...)._klass.
 Node* LoadKlassNode::Identity( PhaseTransform *phase ) {
+  return klass_identity_common(phase);
+}
+
+Node* LoadNode::klass_identity_common(PhaseTransform *phase ) {
   Node* x = LoadNode::Identity(phase);
   if (x != this)  return x;
 
@@ -1776,6 +1830,34 @@
   return this;
 }
 
+
+//------------------------------Value------------------------------------------
+const Type *LoadNKlassNode::Value( PhaseTransform *phase ) const {
+  const Type *t = klass_value_common(phase);
+
+  if (t == TypePtr::NULL_PTR) {
+    return TypeNarrowOop::NULL_PTR;
+  }
+  if (t != Type::TOP && !t->isa_narrowoop()) {
+    assert(t->is_oopptr(), "sanity");
+    t = t->is_oopptr()->make_narrowoop();
+  }
+  return t;
+}
+
+//------------------------------Identity---------------------------------------
+// To clean up reflective code, simplify k.java_mirror.as_klass to narrow k.
+// Also feed through the klass in Allocate(...klass...)._klass.
+Node* LoadNKlassNode::Identity( PhaseTransform *phase ) {
+  Node *x = klass_identity_common(phase);
+
+  const Type *t = phase->type( x );
+  if( t == Type::TOP ) return x;
+  if( t->isa_narrowoop()) return x;
+
+  return EncodePNode::encode(phase, x);
+}
+
 //------------------------------Value-----------------------------------------
 const Type *LoadRangeNode::Value( PhaseTransform *phase ) const {
   // Either input is TOP ==> the result is TOP
@@ -1836,7 +1918,7 @@
   case T_ADDRESS:
   case T_OBJECT:
 #ifdef _LP64
-    if (adr->bottom_type()->is_narrow() ||
+    if (adr->bottom_type()->is_ptr_to_narrowoop() ||
         (UseCompressedOops && val->bottom_type()->isa_klassptr() &&
          adr->bottom_type()->isa_rawptr())) {
       const TypePtr* type = val->bottom_type()->is_ptr();
@@ -2312,6 +2394,13 @@
   return remove_dead_region(phase, can_reshape) ? this : NULL;
 }
 
+//------------------------------Ideal------------------------------------------
+// Return a node which is more "ideal" than the current node.  Strip out
+// control copies
+Node *AryEqNode::Ideal(PhaseGVN *phase, bool can_reshape){
+  return remove_dead_region(phase, can_reshape) ? this : NULL;
+}
+
 
 //=============================================================================
 MemBarNode::MemBarNode(Compile* C, int alias_idx, Node* precedent)
--- a/hotspot/src/share/vm/opto/memnode.hpp	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/src/share/vm/opto/memnode.hpp	Thu Jun 12 13:50:55 2008 -0700
@@ -72,7 +72,8 @@
   // This one should probably be a phase-specific function:
   static bool all_controls_dominate(Node* dom, Node* sub);
 
-  // Is this Node a MemNode or some descendent?  Default is YES.
+  // Find any cast-away of null-ness and keep its control.
+  static  Node *Ideal_common_DU_postCCP( PhaseCCP *ccp, Node* n, Node* adr );
   virtual Node *Ideal_DU_postCCP( PhaseCCP *ccp );
 
   virtual const class TypePtr *adr_type() const;  // returns bottom_type of address
@@ -150,6 +151,9 @@
   // zero out the control input.
   virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
 
+  // Split instance field load through Phi.
+  Node* split_through_phi(PhaseGVN *phase);
+
   // Recover original value from boxed values
   Node *eliminate_autobox(PhaseGVN *phase);
 
@@ -157,6 +161,10 @@
   // then call the virtual add() to set the type.
   virtual const Type *Value( PhaseTransform *phase ) const;
 
+  // Common methods for LoadKlass and LoadNKlass nodes.
+  const Type *klass_value_common( PhaseTransform *phase ) const;
+  Node *klass_identity_common( PhaseTransform *phase );
+
   virtual uint ideal_reg() const;
   virtual const Type *bottom_type() const;
   // Following method is copied from TypeNode:
@@ -358,14 +366,35 @@
 // Load a Klass from an object
 class LoadKlassNode : public LoadPNode {
 public:
-  LoadKlassNode( Node *c, Node *mem, Node *adr, const TypePtr *at, const TypeKlassPtr *tk = TypeKlassPtr::OBJECT )
+  LoadKlassNode( Node *c, Node *mem, Node *adr, const TypePtr *at, const TypeKlassPtr *tk )
     : LoadPNode(c,mem,adr,at,tk) {}
   virtual int Opcode() const;
   virtual const Type *Value( PhaseTransform *phase ) const;
   virtual Node *Identity( PhaseTransform *phase );
   virtual bool depends_only_on_test() const { return true; }
+
+  // Polymorphic factory method:
+  static Node* make( PhaseGVN& gvn, Node *mem, Node *adr, const TypePtr* at,
+                     const TypeKlassPtr *tk = TypeKlassPtr::OBJECT );
 };
 
+//------------------------------LoadNKlassNode---------------------------------
+// Load a narrow Klass from an object.
+class LoadNKlassNode : public LoadNNode {
+public:
+  LoadNKlassNode( Node *c, Node *mem, Node *adr, const TypePtr *at, const TypeNarrowOop *tk )
+    : LoadNNode(c,mem,adr,at,tk) {}
+  virtual int Opcode() const;
+  virtual uint ideal_reg() const { return Op_RegN; }
+  virtual int store_Opcode() const { return Op_StoreN; }
+  virtual BasicType memory_type() const { return T_NARROWOOP; }
+
+  virtual const Type *Value( PhaseTransform *phase ) const;
+  virtual Node *Identity( PhaseTransform *phase );
+  virtual bool depends_only_on_test() const { return true; }
+};
+
+
 //------------------------------LoadSNode--------------------------------------
 // Load a short (16bits signed) from memory
 class LoadSNode : public LoadNode {
@@ -696,6 +725,18 @@
   virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
 };
 
+//------------------------------AryEq---------------------------------------
+class AryEqNode: public Node {
+public:
+  AryEqNode(Node *control, Node* s1, Node* s2): Node(control, s1, s2) {};
+  virtual int Opcode() const;
+  virtual bool depends_only_on_test() const { return false; }
+  virtual const Type* bottom_type() const { return TypeInt::BOOL; }
+  virtual const TypePtr* adr_type() const { return TypeAryPtr::CHARS; }
+  virtual uint ideal_reg() const { return Op_RegI; }
+  virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
+};
+
 //------------------------------MemBar-----------------------------------------
 // There are different flavors of Memory Barriers to match the Java Memory
 // Model.  Monitor-enter and volatile-load act as Aquires: no following ref
--- a/hotspot/src/share/vm/opto/node.cpp	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/src/share/vm/opto/node.cpp	Thu Jun 12 13:50:55 2008 -0700
@@ -1043,52 +1043,86 @@
   assert(this->is_CFG(), "expecting control");
   assert(sub != NULL && sub->is_CFG(), "expecting control");
 
+  // detect dead cycle without regions
+  int iterations_without_region_limit = DominatorSearchLimit;
+
   Node* orig_sub = sub;
   nlist.clear();
   bool this_dominates = false;
-  uint region_input = 0;
+  bool result = false; // Conservative answer
+
   while (sub != NULL) {        // walk 'sub' up the chain to 'this'
     if (sub == this) {
       if (nlist.size() == 0) {
         // No Region nodes except loops were visited before and the EntryControl
         // path was taken for loops: it did not walk in a cycle.
-        return true;
-      } else if (!this_dominates) {
+        result = true;
+        break;
+      } else if (this_dominates) {
+        result = false;          // already met before: walk in a cycle
+        break;
+      } else {
         // Region nodes were visited. Continue walk up to Start or Root
         // to make sure that it did not walk in a cycle.
         this_dominates = true; // first time meet
-      } else {
-        return false;          // already met before: walk in a cycle
-      }
+        iterations_without_region_limit = DominatorSearchLimit; // Reset
+     }
+    }
+    if (sub->is_Start() || sub->is_Root()) {
+      result = this_dominates;
+      break;
     }
-    if (sub->is_Start() || sub->is_Root())
-      return this_dominates;
-
     Node* up = sub->find_exact_control(sub->in(0));
-    if (up == NULL || up->is_top())
-      return false; // Conservative answer for dead code
+    if (up == NULL || up->is_top()) {
+      result = false; // Conservative answer for dead code
+      break;
+    }
+    if (sub == up && (sub->is_Loop() || sub->is_Region() && sub->req() != 3)) {
+      // Take first valid path on the way up to 'this'.
+      up = sub->in(1); // in(LoopNode::EntryControl);
+    } else if (sub == up && sub->is_Region()) {
+      assert(sub->req() == 3, "sanity");
+      iterations_without_region_limit = DominatorSearchLimit; // Reset
 
-    if (sub == up && sub->is_Loop()) {
-      up = sub->in(0); // in(LoopNode::EntryControl);
-    } else if (sub == up && sub->is_Region()) {
+      // Try both paths for such Regions.
+      // It is not accurate without regions dominating information.
+      // With such information the other path should be checked for
+      // the most dominating Region which was visited before.
+      bool region_was_visited_before = false;
       uint i = 1;
-      if (nlist.size() == 0) {
-        // No Region nodes (except Loops) were visited before.
+      uint size = nlist.size();
+      if (size == 0) {
+        // No such Region nodes were visited before.
         // Take first valid path on the way up to 'this'.
-      } else if (nlist.at(nlist.size() - 1) == sub) {
-        // This Region node was just visited. Take other path.
-        i = region_input + 1;
-        nlist.pop();
       } else {
         // Was this Region node visited before?
-        uint size = nlist.size();
-        for (uint j = 0; j < size; j++) {
-          if (nlist.at(j) == sub) {
-            return false; // The Region node was visited before. Give up.
+        intptr_t ni;
+        int j = size - 1;
+        for (; j >= 0; j--) {
+          ni = (intptr_t)nlist.at(j);
+          if ((Node*)(ni & ~1) == sub) {
+            if ((ni & 1) != 0) {
+              break; // Visited 2 paths. Give up.
+            } else {
+              // The Region node was visited before only once.
+              nlist.remove(j);
+              region_was_visited_before = true;
+              for (; i < sub->req(); i++) {
+                Node* in = sub->in(i);
+                if (in != NULL && !in->is_top() && in != sub) {
+                  break;
+                }
+              }
+              i++; // Take other path.
+              break;
+            }
           }
         }
+        if (j >= 0 && (ni & 1) != 0) {
+          result = false; // Visited 2 paths. Give up.
+          break;
+        }
         // The Region node was not visited before.
-        // Take first valid path on the way up to 'this'.
       }
       for (; i < sub->req(); i++) {
         Node* in = sub->in(i);
@@ -1097,19 +1131,26 @@
         }
       }
       if (i < sub->req()) {
-        nlist.push(sub);
         up = sub->in(i);
-        region_input = i;
+        if (region_was_visited_before && sub != up) {
+          // Set 0 bit to indicate that both paths were taken.
+          nlist.push((Node*)((intptr_t)sub + 1));
+        } else {
+          nlist.push(sub);
+        }
       }
     }
-    if (sub == up)
-      return false;    // some kind of tight cycle
-    if (orig_sub == up)
-      return false;    // walk in a cycle
-
+    if (sub == up) {
+      result = false;    // some kind of tight cycle
+      break;
+    }
+    if (--iterations_without_region_limit < 0) {
+      result = false;    // dead cycle
+      break;
+    }
     sub = up;
   }
-  return false;
+  return result;
 }
 
 //------------------------------remove_dead_region-----------------------------
--- a/hotspot/src/share/vm/opto/node.hpp	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/src/share/vm/opto/node.hpp	Thu Jun 12 13:50:55 2008 -0700
@@ -53,6 +53,8 @@
 class ConNode;
 class CountedLoopNode;
 class CountedLoopEndNode;
+class DecodeNNode;
+class EncodePNode;
 class FastLockNode;
 class FastUnlockNode;
 class IfNode;
@@ -438,6 +440,12 @@
 public:
   // Globally replace this node by a given new node, updating all uses.
   void replace_by(Node* new_node);
+  // Globally replace this node by a given new node, updating all uses
+  // and cutting input edges of old node.
+  void subsume_by(Node* new_node) {
+    replace_by(new_node);
+    disconnect_inputs(NULL);
+  }
   void set_req_X( uint i, Node *n, PhaseIterGVN *igvn );
   // Find the one non-null required input.  RegionNode only
   Node *nonnull_req() const;
@@ -577,6 +585,8 @@
       DEFINE_CLASS_ID(CheckCastPP, Type, 2)
       DEFINE_CLASS_ID(CMove, Type, 3)
       DEFINE_CLASS_ID(SafePointScalarObject, Type, 4)
+      DEFINE_CLASS_ID(DecodeN, Type, 5)
+      DEFINE_CLASS_ID(EncodeP, Type, 6)
 
     DEFINE_CLASS_ID(Mem,   Node, 6)
       DEFINE_CLASS_ID(Load,  Mem, 0)
@@ -685,6 +695,8 @@
   DEFINE_CLASS_QUERY(Cmp)
   DEFINE_CLASS_QUERY(CountedLoop)
   DEFINE_CLASS_QUERY(CountedLoopEnd)
+  DEFINE_CLASS_QUERY(DecodeN)
+  DEFINE_CLASS_QUERY(EncodeP)
   DEFINE_CLASS_QUERY(FastLock)
   DEFINE_CLASS_QUERY(FastUnlock)
   DEFINE_CLASS_QUERY(If)
--- a/hotspot/src/share/vm/opto/output.cpp	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/src/share/vm/opto/output.cpp	Thu Jun 12 13:50:55 2008 -0700
@@ -48,6 +48,7 @@
   // Initialize the space for the BufferBlob used to find and verify
   // instruction size in MachNode::emit_size()
   init_scratch_buffer_blob();
+  if (failing())  return; // Out of memory
 
   // Make sure I can find the Start Node
   Block_Array& bbs = _cfg->_bbs;
--- a/hotspot/src/share/vm/opto/parse1.cpp	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/src/share/vm/opto/parse1.cpp	Thu Jun 12 13:50:55 2008 -0700
@@ -1901,7 +1901,7 @@
   // finalization.  In general this will fold up since the concrete
   // class is often visible so the access flags are constant.
   Node* klass_addr = basic_plus_adr( receiver, receiver, oopDesc::klass_offset_in_bytes() );
-  Node* klass = _gvn.transform(new (C, 3) LoadKlassNode(NULL, immutable_memory(), klass_addr, TypeInstPtr::KLASS));
+  Node* klass = _gvn.transform( LoadKlassNode::make(_gvn, immutable_memory(), klass_addr, TypeInstPtr::KLASS) );
 
   Node* access_flags_addr = basic_plus_adr(klass, klass, Klass::access_flags_offset_in_bytes() + sizeof(oopDesc));
   Node* access_flags = make_load(NULL, access_flags_addr, TypeInt::INT, T_INT);
--- a/hotspot/src/share/vm/opto/parseHelper.cpp	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/src/share/vm/opto/parseHelper.cpp	Thu Jun 12 13:50:55 2008 -0700
@@ -38,7 +38,7 @@
 
   // Get method
   const TypeInstPtr* method_type = TypeInstPtr::make(TypePtr::Constant, method->klass(), true, method, 0);
-  Node *method_node = _gvn.transform( new (C, 1) ConPNode(method_type) );
+  Node *method_node = _gvn.transform( ConNode::make(C, method_type) );
 
   kill_dead_locals();
 
@@ -143,7 +143,7 @@
   int klass_offset = oopDesc::klass_offset_in_bytes();
   Node* p = basic_plus_adr( ary, ary, klass_offset );
   // p's type is array-of-OOPS plus klass_offset
-  Node* array_klass = _gvn.transform(new (C, 3) LoadKlassNode(0, immutable_memory(), p, TypeInstPtr::KLASS));
+  Node* array_klass = _gvn.transform( LoadKlassNode::make(_gvn, immutable_memory(), p, TypeInstPtr::KLASS) );
   // Get the array klass
   const TypeKlassPtr *tak = _gvn.type(array_klass)->is_klassptr();
 
@@ -189,7 +189,7 @@
   // Extract the array element class
   int element_klass_offset = objArrayKlass::element_klass_offset_in_bytes() + sizeof(oopDesc);
   Node *p2 = basic_plus_adr(array_klass, array_klass, element_klass_offset);
-  Node *a_e_klass = _gvn.transform(new (C, 3) LoadKlassNode(0, immutable_memory(), p2, tak));
+  Node *a_e_klass = _gvn.transform( LoadKlassNode::make(_gvn, immutable_memory(), p2, tak) );
 
   // Check (the hard way) and throw if not a subklass.
   // Result is ignored, we just need the CFG effects.
--- a/hotspot/src/share/vm/opto/type.cpp	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/src/share/vm/opto/type.cpp	Thu Jun 12 13:50:55 2008 -0700
@@ -311,8 +311,18 @@
   mreg2type[Op_RegFlags] = TypeInt::CC;
 
   TypeAryPtr::RANGE   = TypeAryPtr::make( TypePtr::BotPTR, TypeAry::make(Type::BOTTOM,TypeInt::POS), current->env()->Object_klass(), false, arrayOopDesc::length_offset_in_bytes());
-  // There is no shared klass for Object[].  See note in TypeAryPtr::klass().
-  TypeAryPtr::OOPS    = TypeAryPtr::make(TypePtr::BotPTR, TypeAry::make(TypeInstPtr::BOTTOM,TypeInt::POS), NULL /*ciArrayKlass::make(o)*/,  false,  Type::OffsetBot);
+
+  TypeAryPtr::NARROWOOPS = TypeAryPtr::make(TypePtr::BotPTR, TypeAry::make(TypeNarrowOop::BOTTOM, TypeInt::POS), NULL /*ciArrayKlass::make(o)*/,  false,  Type::OffsetBot);
+
+#ifdef _LP64
+  if (UseCompressedOops) {
+    TypeAryPtr::OOPS  = TypeAryPtr::NARROWOOPS;
+  } else
+#endif
+  {
+    // There is no shared klass for Object[].  See note in TypeAryPtr::klass().
+    TypeAryPtr::OOPS  = TypeAryPtr::make(TypePtr::BotPTR, TypeAry::make(TypeInstPtr::BOTTOM,TypeInt::POS), NULL /*ciArrayKlass::make(o)*/,  false,  Type::OffsetBot);
+  }
   TypeAryPtr::BYTES   = TypeAryPtr::make(TypePtr::BotPTR, TypeAry::make(TypeInt::BYTE      ,TypeInt::POS), ciTypeArrayKlass::make(T_BYTE),   true,  Type::OffsetBot);
   TypeAryPtr::SHORTS  = TypeAryPtr::make(TypePtr::BotPTR, TypeAry::make(TypeInt::SHORT     ,TypeInt::POS), ciTypeArrayKlass::make(T_SHORT),  true,  Type::OffsetBot);
   TypeAryPtr::CHARS   = TypeAryPtr::make(TypePtr::BotPTR, TypeAry::make(TypeInt::CHAR      ,TypeInt::POS), ciTypeArrayKlass::make(T_CHAR),   true,  Type::OffsetBot);
@@ -321,9 +331,10 @@
   TypeAryPtr::FLOATS  = TypeAryPtr::make(TypePtr::BotPTR, TypeAry::make(Type::FLOAT        ,TypeInt::POS), ciTypeArrayKlass::make(T_FLOAT),  true,  Type::OffsetBot);
   TypeAryPtr::DOUBLES = TypeAryPtr::make(TypePtr::BotPTR, TypeAry::make(Type::DOUBLE       ,TypeInt::POS), ciTypeArrayKlass::make(T_DOUBLE), true,  Type::OffsetBot);
 
-  TypeAryPtr::_array_body_type[T_NARROWOOP] = NULL; // what should this be?
+  // Nobody should ask _array_body_type[T_NARROWOOP]. Use NULL as assert.
+  TypeAryPtr::_array_body_type[T_NARROWOOP] = NULL;
   TypeAryPtr::_array_body_type[T_OBJECT]  = TypeAryPtr::OOPS;
-  TypeAryPtr::_array_body_type[T_ARRAY]   = TypeAryPtr::OOPS;   // arrays are stored in oop arrays
+  TypeAryPtr::_array_body_type[T_ARRAY]   = TypeAryPtr::OOPS; // arrays are stored in oop arrays
   TypeAryPtr::_array_body_type[T_BYTE]    = TypeAryPtr::BYTES;
   TypeAryPtr::_array_body_type[T_BOOLEAN] = TypeAryPtr::BYTES;  // boolean[] is a byte array
   TypeAryPtr::_array_body_type[T_SHORT]   = TypeAryPtr::SHORTS;
@@ -696,7 +707,7 @@
   ResourceMark rm;
   Dict d(cmpkey,hashkey);       // Stop recursive type dumping
   dump2(d,1, st);
-  if (isa_ptr() && is_ptr()->is_narrow()) {
+  if (is_ptr_to_narrowoop()) {
     st->print(" [narrow]");
   }
 }
@@ -929,6 +940,7 @@
   case InstPtr:
   case KlassPtr:
   case AryPtr:
+  case NarrowOop:
   case Int:
   case Long:
   case FloatTop:
@@ -1075,6 +1087,7 @@
   case InstPtr:
   case KlassPtr:
   case AryPtr:
+  case NarrowOop:
   case Long:
   case FloatTop:
   case FloatCon:
@@ -1082,7 +1095,6 @@
   case DoubleTop:
   case DoubleCon:
   case DoubleBot:
-  case NarrowOop:
   case Bottom:                  // Ye Olde Default
     return Type::BOTTOM;
   default:                      // All else is a mistake
@@ -1317,6 +1329,7 @@
   case InstPtr:
   case KlassPtr:
   case AryPtr:
+  case NarrowOop:
   case Int:
   case FloatTop:
   case FloatCon:
@@ -2146,6 +2159,67 @@
 // Convenience common pre-built type.
 const TypeOopPtr *TypeOopPtr::BOTTOM;
 
+//------------------------------TypeOopPtr-------------------------------------
+TypeOopPtr::TypeOopPtr( TYPES t, PTR ptr, ciKlass* k, bool xk, ciObject* o, int offset, int instance_id )
+  : TypePtr(t, ptr, offset),
+    _const_oop(o), _klass(k),
+    _klass_is_exact(xk),
+    _is_ptr_to_narrowoop(false),
+    _instance_id(instance_id) {
+#ifdef _LP64
+  if (UseCompressedOops && _offset != 0) {
+    if (klass() == NULL) {
+      assert(this->isa_aryptr(), "only arrays without klass");
+      _is_ptr_to_narrowoop = true;
+    } else if (_offset == oopDesc::klass_offset_in_bytes()) {
+      _is_ptr_to_narrowoop = true;
+    } else if (this->isa_aryptr()) {
+      _is_ptr_to_narrowoop = (klass()->is_obj_array_klass() &&
+                             _offset != arrayOopDesc::length_offset_in_bytes());
+    } else if (klass() == ciEnv::current()->Class_klass() &&
+               (_offset == java_lang_Class::klass_offset_in_bytes() ||
+                _offset == java_lang_Class::array_klass_offset_in_bytes())) {
+      // Special hidden fields from the Class.
+      assert(this->isa_instptr(), "must be an instance ptr.");
+      _is_ptr_to_narrowoop = true;
+    } else if (klass()->is_instance_klass()) {
+      ciInstanceKlass* ik = klass()->as_instance_klass();
+      ciField* field = NULL;
+      if (this->isa_klassptr()) {
+        // Perm objects don't use compressed references, except for
+        // static fields which are currently compressed.
+        field = ik->get_field_by_offset(_offset, true);
+        if (field != NULL) {
+          BasicType basic_elem_type = field->layout_type();
+          _is_ptr_to_narrowoop = (basic_elem_type == T_OBJECT ||
+                                  basic_elem_type == T_ARRAY);
+        }
+      } else if (_offset == OffsetBot || _offset == OffsetTop) {
+        // unsafe access
+        _is_ptr_to_narrowoop = true;
+      } else { // exclude unsafe ops
+        assert(this->isa_instptr(), "must be an instance ptr.");
+        // Field which contains a compressed oop references.
+        field = ik->get_field_by_offset(_offset, false);
+        if (field != NULL) {
+          BasicType basic_elem_type = field->layout_type();
+          _is_ptr_to_narrowoop = (basic_elem_type == T_OBJECT ||
+                                  basic_elem_type == T_ARRAY);
+        } else if (klass()->equals(ciEnv::current()->Object_klass())) {
+          // Compile::find_alias_type() cast exactness on all types to verify
+          // that it does not affect alias type.
+          _is_ptr_to_narrowoop = true;
+        } else {
+          // Type for the copy start in LibraryCallKit::inline_native_clone().
+          assert(!klass_is_exact(), "only non-exact klass");
+          _is_ptr_to_narrowoop = true;
+        }
+      }
+    }
+  }
+#endif
+}
+
 //------------------------------make-------------------------------------------
 const TypeOopPtr *TypeOopPtr::make(PTR ptr,
                                    int offset) {
@@ -2593,9 +2667,13 @@
 //-----------------------------cast_to_instance-------------------------------
 const TypeOopPtr *TypeInstPtr::cast_to_instance(int instance_id) const {
   if( instance_id == _instance_id) return this;
-  bool exact = (instance_id == UNKNOWN_INSTANCE) ? _klass_is_exact : true;
-
-  return make(ptr(), klass(), exact, const_oop(), _offset, instance_id);
+  bool exact = true;
+  PTR  ptr_t = NotNull;
+  if (instance_id == UNKNOWN_INSTANCE) {
+    exact = _klass_is_exact;
+    ptr_t = _ptr;
+  }
+  return make(ptr_t, klass(), exact, const_oop(), _offset, instance_id);
 }
 
 //------------------------------xmeet_unloaded---------------------------------
@@ -3014,6 +3092,7 @@
 // Convenience common pre-built types.
 const TypeAryPtr *TypeAryPtr::RANGE;
 const TypeAryPtr *TypeAryPtr::OOPS;
+const TypeAryPtr *TypeAryPtr::NARROWOOPS;
 const TypeAryPtr *TypeAryPtr::BYTES;
 const TypeAryPtr *TypeAryPtr::SHORTS;
 const TypeAryPtr *TypeAryPtr::CHARS;
@@ -3063,8 +3142,13 @@
 //-----------------------------cast_to_instance-------------------------------
 const TypeOopPtr *TypeAryPtr::cast_to_instance(int instance_id) const {
   if( instance_id == _instance_id) return this;
-  bool exact = (instance_id == UNKNOWN_INSTANCE) ? _klass_is_exact : true;
-  return make(ptr(), const_oop(), _ary, klass(), exact, _offset, instance_id);
+  bool exact = true;
+  PTR  ptr_t = NotNull;
+  if (instance_id == UNKNOWN_INSTANCE) {
+    exact = _klass_is_exact;
+    ptr_t = _ptr;
+  }
+  return make(ptr_t, const_oop(), _ary, klass(), exact, _offset, instance_id);
 }
 
 //-----------------------------narrow_size_type-------------------------------
@@ -3547,7 +3631,7 @@
     k_ary = ciTypeArrayKlass::make(el->basic_type());
   }
 
-  if( this != TypeAryPtr::OOPS )
+  if( this != TypeAryPtr::OOPS ) {
     // The _klass field acts as a cache of the underlying
     // ciKlass for this array type.  In order to set the field,
     // we need to cast away const-ness.
@@ -3562,6 +3646,11 @@
     // a bit less efficient than caching, but calls to
     // TypeAryPtr::OOPS->klass() are not common enough to matter.
     ((TypeAryPtr*)this)->_klass = k_ary;
+    if (UseCompressedOops && k_ary != NULL && k_ary->is_obj_array_klass() &&
+        _offset != 0 && _offset != arrayOopDesc::length_offset_in_bytes()) {
+      ((TypeAryPtr*)this)->_is_ptr_to_narrowoop = true;
+    }
+  }
   return k_ary;
 }
 
--- a/hotspot/src/share/vm/opto/type.hpp	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/src/share/vm/opto/type.hpp	Thu Jun 12 13:50:55 2008 -0700
@@ -191,9 +191,8 @@
   virtual const Type *filter( const Type *kills ) const;
 
   // Returns true if this pointer points at memory which contains a
-  // compressed oop references.  In 32-bit builds it's non-virtual
-  // since we don't support compressed oops at all in the mode.
-  LP64_ONLY(virtual) bool is_narrow() const { return false; }
+  // compressed oop references.
+  bool is_ptr_to_narrowoop() const;
 
   // Convenience access
   float getf() const;
@@ -213,8 +212,8 @@
   const TypePtr    *isa_ptr() const;             // Returns NULL if not ptr type
   const TypeRawPtr *isa_rawptr() const;          // NOT Java oop
   const TypeRawPtr *is_rawptr() const;           // Asserts is rawptr
-  const TypeNarrowOop  *is_narrowoop() const;        // Java-style GC'd pointer
-  const TypeNarrowOop  *isa_narrowoop() const;       // Returns NULL if not oop ptr type
+  const TypeNarrowOop  *is_narrowoop() const;    // Java-style GC'd pointer
+  const TypeNarrowOop  *isa_narrowoop() const;   // Returns NULL if not oop ptr type
   const TypeOopPtr   *isa_oopptr() const;        // Returns NULL if not oop ptr type
   const TypeOopPtr   *is_oopptr() const;         // Java-style GC'd pointer
   const TypeKlassPtr *isa_klassptr() const;      // Returns NULL if not KlassPtr
@@ -643,7 +642,7 @@
 // Some kind of oop (Java pointer), either klass or instance or array.
 class TypeOopPtr : public TypePtr {
 protected:
-  TypeOopPtr( TYPES t, PTR ptr, ciKlass* k, bool xk, ciObject* o, int offset, int instance_id ) : TypePtr(t, ptr, offset), _const_oop(o), _klass(k), _klass_is_exact(xk), _instance_id(instance_id) { }
+  TypeOopPtr( TYPES t, PTR ptr, ciKlass* k, bool xk, ciObject* o, int offset, int instance_id );
 public:
   virtual bool eq( const Type *t ) const;
   virtual int  hash() const;             // Type specific hashing
@@ -660,8 +659,9 @@
   ciKlass*      _klass;       // Klass object
   // Does the type exclude subclasses of the klass?  (Inexact == polymorphic.)
   bool          _klass_is_exact;
+  bool          _is_ptr_to_narrowoop;
 
-  int          _instance_id;   // if not UNKNOWN_INSTANCE, indicates that this is a particular instance
+  int           _instance_id;  // if not UNKNOWN_INSTANCE, indicates that this is a particular instance
                                // of this type which is distinct.  This is the  the node index of the
                                // node creating this instance
 
@@ -696,6 +696,11 @@
   ciObject* const_oop()    const { return _const_oop; }
   virtual ciKlass* klass() const { return _klass;     }
   bool klass_is_exact()    const { return _klass_is_exact; }
+
+  // Returns true if this pointer points at memory which contains a
+  // compressed oop references.
+  bool is_ptr_to_narrowoop_nv() const { return _is_ptr_to_narrowoop; }
+
   bool is_instance()       const { return _instance_id != UNKNOWN_INSTANCE; }
   uint instance_id()       const { return _instance_id; }
   bool is_instance_field() const { return _instance_id != UNKNOWN_INSTANCE && _offset >= 0; }
@@ -716,12 +721,6 @@
   // returns the equivalent compressed version of this pointer type
   virtual const TypeNarrowOop* make_narrowoop() const;
 
-#ifdef _LP64
-  virtual bool is_narrow() const {
-    return (UseCompressedOops && _offset != 0);
-  }
-#endif
-
   virtual const Type *xmeet( const Type *t ) const;
   virtual const Type *xdual() const;    // Compute dual right now.
 
@@ -843,15 +842,10 @@
   virtual const Type *xmeet( const Type *t ) const;
   virtual const Type *xdual() const;    // Compute dual right now.
 
-#ifdef _LP64
-  virtual bool is_narrow() const {
-    return (UseCompressedOops && klass() != NULL && _offset != 0);
-  }
-#endif
-
   // Convenience common pre-built types.
   static const TypeAryPtr *RANGE;
   static const TypeAryPtr *OOPS;
+  static const TypeAryPtr *NARROWOOPS;
   static const TypeAryPtr *BYTES;
   static const TypeAryPtr *SHORTS;
   static const TypeAryPtr *CHARS;
@@ -901,18 +895,6 @@
   virtual const Type    *xmeet( const Type *t ) const;
   virtual const Type    *xdual() const;      // Compute dual right now.
 
-#ifdef _LP64
-  // Perm objects don't use compressed references, except for static fields
-  // which are currently compressed
-  virtual bool is_narrow() const {
-    if (UseCompressedOops && _offset != 0 && _klass->is_instance_klass()) {
-      ciInstanceKlass* ik = _klass->as_instance_klass();
-      return ik != NULL && ik->get_field_by_offset(_offset, true) != NULL;
-    }
-    return false;
-  }
-#endif
-
   // Convenience common pre-built types.
   static const TypeKlassPtr* OBJECT; // Not-null object klass or below
   static const TypeKlassPtr* OBJECT_OR_NULL; // Maybe-null version of same
@@ -921,7 +903,7 @@
 #endif
 };
 
-//------------------------------TypeNarrowOop----------------------------------------
+//------------------------------TypeNarrowOop----------------------------------
 // A compressed reference to some kind of Oop.  This type wraps around
 // a preexisting TypeOopPtr and forwards most of it's operations to
 // the underlying type.  It's only real purpose is to track the
@@ -1013,6 +995,14 @@
 };
 
 //------------------------------accessors--------------------------------------
+inline bool Type::is_ptr_to_narrowoop() const {
+#ifdef _LP64
+  return (isa_oopptr() != NULL && is_oopptr()->is_ptr_to_narrowoop_nv());
+#else
+  return false;
+#endif
+}
+
 inline float Type::getf() const {
   assert( _base == FloatCon, "Not a FloatCon" );
   return ((TypeF*)this)->_f;
--- a/hotspot/src/share/vm/runtime/arguments.cpp	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/src/share/vm/runtime/arguments.cpp	Thu Jun 12 13:50:55 2008 -0700
@@ -1171,21 +1171,18 @@
   // field offset to determine free list chunk markers.
   // Check that UseCompressedOops can be set with the max heap size allocated
   // by ergonomics.
-  if (!UseG1GC && !UseConcMarkSweepGC && MaxHeapSize <= max_heap_for_compressed_oops()) {
-    if (FLAG_IS_DEFAULT(UseCompressedOops)) {
-      FLAG_SET_ERGO(bool, UseCompressedOops, true);
+  if (MaxHeapSize <= max_heap_for_compressed_oops()) {
+    if (FLAG_IS_DEFAULT(UseCompressedOops) && !UseG1GC) {
+      // Leave compressed oops off by default. Uncomment
+      // the following line to return it to default status.
+      // FLAG_SET_ERGO(bool, UseCompressedOops, true);
+    } else if (UseCompressedOops && UseG1GC) {
+      warning(" UseCompressedOops does not currently work with UseG1GC; switching off UseCompressedOops. ");
+      FLAG_SET_DEFAULT(UseCompressedOops, false);
     }
   } else {
     if (UseCompressedOops && !FLAG_IS_DEFAULT(UseCompressedOops)) {
-      // If specified, give a warning
-      if (UseConcMarkSweepGC){
-        warning("Compressed Oops does not work with CMS");
-      } else if (UseG1GC) {
-        warning("Compressed Oops does not work with UseG1GC");
-      } else {
-        warning(
-          "Max heap size too large for Compressed Oops");
-      }
+      warning("Max heap size too large for Compressed Oops");
       FLAG_SET_DEFAULT(UseCompressedOops, false);
     }
   }
@@ -1333,6 +1330,9 @@
   if (AggressiveOpts && FLAG_IS_DEFAULT(DoEscapeAnalysis)) {
     FLAG_SET_DEFAULT(DoEscapeAnalysis, true);
   }
+  if (AggressiveOpts && FLAG_IS_DEFAULT(SpecialArraysEquals)) {
+    FLAG_SET_DEFAULT(SpecialArraysEquals, true);
+  }
 #endif
 
   if (AggressiveOpts) {
--- a/hotspot/src/share/vm/runtime/globals.hpp	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/src/share/vm/runtime/globals.hpp	Thu Jun 12 13:50:55 2008 -0700
@@ -291,6 +291,9 @@
             "Use 32-bit object references in 64-bit VM. "                   \
             "lp64_product means flag is always constant in 32 bit VM")      \
                                                                             \
+  lp64_product(bool, CheckCompressedOops, trueInDebug,                      \
+            "generate checks in encoding/decoding code")                    \
+                                                                            \
   /* UseMembar is theoretically a temp flag used for memory barrier         \
    * removal testing.  It was supposed to be removed before FCS but has     \
    * been re-added (see 6401008) */                                         \
@@ -457,6 +460,9 @@
   develop(bool, SpecialStringIndexOf, true,                                 \
           "special version of string indexOf")                              \
                                                                             \
+  product(bool, SpecialArraysEquals, false,                                 \
+          "special version of Arrays.equals(char[],char[])")                \
+                                                                            \
   develop(bool, TraceCallFixup, false,                                      \
           "traces all call fixups")                                         \
                                                                             \
--- a/hotspot/src/share/vm/runtime/java.hpp	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/src/share/vm/runtime/java.hpp	Thu Jun 12 13:50:55 2008 -0700
@@ -68,8 +68,24 @@
   static bool is_jdk13x_version()           { assert(is_jdk_version_initialized(), "must have been initialized"); return _jdk_version == 3; }
   static bool is_jdk14x_version()           { assert(is_jdk_version_initialized(), "must have been initialized"); return _jdk_version == 4; }
   static bool is_jdk15x_version()           { assert(is_jdk_version_initialized(), "must have been initialized"); return _jdk_version == 5; }
-  static bool is_jdk16x_version()           { assert(is_jdk_version_initialized(), "must have been initialized"); return _jdk_version == 6; }
-  static bool is_jdk17x_version()           { assert(is_jdk_version_initialized(), "must have been initialized"); return _jdk_version == 7; }
+
+  static bool is_jdk16x_version() {
+    if (is_jdk_version_initialized()) {
+      return _jdk_version == 6;
+    } else {
+      assert(is_pre_jdk16_version(), "must have been initialized");
+      return false;
+    }
+  }
+
+  static bool is_jdk17x_version() {
+    if (is_jdk_version_initialized()) {
+      return _jdk_version == 7;
+    } else {
+      assert(is_pre_jdk16_version(), "must have been initialized");
+      return false;
+    }
+  }
 
   static bool supports_thread_park_blocker() { return _version_info.thread_park_blocker; }
 
@@ -85,14 +101,22 @@
   }
   static bool is_gte_jdk16x_version() {
     // Keep the semantics of this that the version number is >= 1.6
-    assert(is_jdk_version_initialized(), "Not initialized");
-    return _jdk_version >= 6;
+    if (is_jdk_version_initialized()) {
+      return _jdk_version >= 6;
+    } else {
+      assert(is_pre_jdk16_version(), "Not initialized");
+      return false;
+    }
   }
 
   static bool is_gte_jdk17x_version() {
     // Keep the semantics of this that the version number is >= 1.7
-    assert(is_jdk_version_initialized(), "Not initialized");
-    return _jdk_version >= 7;
+    if (is_jdk_version_initialized()) {
+      return _jdk_version >= 7;
+    } else {
+      assert(is_pre_jdk16_version(), "Not initialized");
+      return false;
+    }
   }
 
   static bool is_jdk_version_initialized() {
--- a/hotspot/src/share/vm/runtime/vmStructs.cpp	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/src/share/vm/runtime/vmStructs.cpp	Thu Jun 12 13:50:55 2008 -0700
@@ -894,6 +894,7 @@
   /*******************************************************************/   \
                                                                           \
   declare_unsigned_integer_type(size_t)                                   \
+  declare_integer_type(ssize_t)                                           \
   declare_unsigned_integer_type(const size_t)                             \
   declare_integer_type(intx)                                              \
   declare_integer_type(intptr_t)                                          \
@@ -1699,7 +1700,12 @@
   declare_constant(markOopDesc::no_hash)                                  \
   declare_constant(markOopDesc::no_hash_in_place)                         \
   declare_constant(markOopDesc::no_lock_in_place)                         \
-  declare_constant(markOopDesc::max_age)
+  declare_constant(markOopDesc::max_age)                                  \
+                                                                          \
+  /* Constants in markOop used by CMS. */                                 \
+  declare_constant(markOopDesc::cms_shift)                                \
+  declare_constant(markOopDesc::cms_mask)                                 \
+  declare_constant(markOopDesc::size_shift)                               \
 
   /* NOTE that we do not use the last_entry() macro here; it is used   */
   /* in vmStructs_<os>_<cpu>.hpp's VM_LONG_CONSTANTS_OS_CPU macro (and */
@@ -1963,6 +1969,7 @@
                         GENERATE_STATIC_VM_STRUCT_ENTRY)
 
   VM_STRUCTS_CMS(GENERATE_NONSTATIC_VM_STRUCT_ENTRY, \
+                 GENERATE_NONSTATIC_VM_STRUCT_ENTRY, \
                  GENERATE_STATIC_VM_STRUCT_ENTRY)
 #endif // SERIALGC
 
@@ -2104,6 +2111,7 @@
              CHECK_STATIC_VM_STRUCT_ENTRY);
 
   VM_STRUCTS_CMS(CHECK_NONSTATIC_VM_STRUCT_ENTRY,
+             CHECK_VOLATILE_NONSTATIC_VM_STRUCT_ENTRY,
              CHECK_STATIC_VM_STRUCT_ENTRY);
 #endif // SERIALGC
 
@@ -2208,6 +2216,7 @@
   debug_only(VM_STRUCTS_PARALLELGC(ENSURE_FIELD_TYPE_PRESENT, \
                                    ENSURE_FIELD_TYPE_PRESENT));
   debug_only(VM_STRUCTS_CMS(ENSURE_FIELD_TYPE_PRESENT, \
+                            ENSURE_FIELD_TYPE_PRESENT, \
                             ENSURE_FIELD_TYPE_PRESENT));
 #endif // SERIALGC
   debug_only(VM_STRUCTS_CPU(ENSURE_FIELD_TYPE_PRESENT, \
--- a/hotspot/test/compiler/6659207/Test.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/test/compiler/6659207/Test.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,23 +1,24 @@
 /*
- * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
- * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
- *
+ * Copyright 1997-2002 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.
  *
- *
- *
- *
- *
+ * 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.
  *
  */
 
--- a/hotspot/test/compiler/6661247/Test.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/test/compiler/6661247/Test.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,23 +1,24 @@
 /*
- * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
- * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
- *
+ * Copyright 1997-2002 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.
  *
- *
- *
- *
- *
+ * 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.
  *
  */
 
--- a/hotspot/test/compiler/6663621/IVTest.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/hotspot/test/compiler/6663621/IVTest.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,23 +1,24 @@
 /*
- * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
- * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
- *
+ * Copyright 1997-2002 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.
  *
- *
- *
- *
- *
+ * 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.
  *
  */
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/compiler/6689060/Test.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,577 @@
+/*
+ * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ */
+
+/*
+ * @test
+ * @bug 6689060
+ * @summary Escape Analysis does not work with Compressed Oops
+ * @run main/othervm -Xbatch -XX:CompileCommand=exclude,Test.dummy -XX:+AggressiveOpts Test
+ */
+
+import java.lang.reflect.Array;
+
+class Point {
+  int x;
+  int y;
+  Point next;
+  int ax[];
+  int ay[];
+  Point pax[];
+  Point pay[];
+  public Point getNext() {
+    return next;
+  }
+}
+
+public class Test {
+
+  void dummy() {
+    // Empty method to verify correctness of DebugInfo.
+    // Use -XX:CompileCommand=exclude,Test.dummy
+  }
+
+  int ival(int i) {
+    return i*2;
+  }
+
+  int test80(int y, int l, int i) {
+    Point p = new Point();
+    p.ax = new int[2];
+    p.ay = new int[2];
+    int x = 3;
+    p.ax[0] = x;
+    p.ay[1] = 3 * x + y;
+    dummy();
+    return p.ax[0] * p.ay[1];
+  }
+
+  int test81(int y, int l, int i) {
+    Point p = new Point();
+    p.ax = new int[2];
+    p.ay = new int[2];
+    int x = 3;
+    p.ax[0] = x;
+    p.ay[1] = 3 * x + y;
+    dummy();
+    return p.ax[0] * p.ay[1];
+  }
+
+
+  int test44(int y) {
+    Point p1 = new Point();
+    p1.x = ival(3);
+    dummy();
+    p1.y = 3 * p1.x + y;
+    return p1.y;
+  }
+
+  int test43(int y) {
+    Point p1 = new Point();
+    if ( (y & 1) == 1 ) {
+      p1.x = ival(3);
+    } else {
+      p1.x = ival(5);
+    }
+    dummy();
+    p1.y = 3 * p1.x + y;
+    return p1.y;
+  }
+
+  int test42(int y) {
+    Point p1 = new Point();
+    p1.x = 3;
+    for (int i = 0; i < y; i++) {
+      if ( (i & 1) == 1 ) {
+        p1.x += 4;
+      }
+    }
+    p1.y = 3 * y + p1.x;
+    return p1.y;
+  }
+
+  int test40(int y) {
+    Point p1 = new Point();
+    if ( (y & 1) == 1 ) {
+      p1.x = 3;
+    } else {
+      p1.x = 5;
+    }
+    p1.y = 3 * p1.x + y;
+    return p1.y;
+  }
+
+  int test41(int y) {
+    Point p1 = new Point();
+    if ( (y & 1) == 1 ) {
+      p1.x += 4;
+    } else {
+      p1.x += 5;
+    }
+    p1.y = 3 * p1.x + y;
+    return p1.y;
+  }
+
+  Point test00(int y) {
+    int x = 3;
+    Point p = new Point();
+    p.x = x;
+    p.y = 3 * x + y;
+    return p;
+  }
+
+  Point test01(int y) {
+    int x = 3;
+    Point p = new Point();
+    p.x = x;
+    p.y = 3 * x + y;
+    dummy();
+    return p;
+  }
+
+  Point test02(int y) {
+    int x = 3;
+    Point p1 = null;
+    for (int i = 0; i < y; i++) {
+      Point p2 = new Point();
+      p2.x = x;
+      p2.y = 3 * y + x;
+      p2.next = p1;
+      p1 = p2;
+    }
+    return p1;
+  }
+
+  Point test03(int y) {
+    int x = 3;
+    Point p1 = null;
+    for (int i = 0; i < y; i++) {
+      Point p2 = new Point();
+      p2.x = x;
+      p2.y = 3 * y + x;
+      p2.next = p1;
+      p1 = p2;
+    }
+    dummy();
+    return p1;
+  }
+
+  Point test04(int y) {
+    int x = 3;
+    Point p1 = null;
+    for (int i = 0; i < y; i++) {
+      Point p2 = new Point();
+      p2.x = x;
+      p2.y = 3 * y + x;
+      p2.next = p1;
+      dummy();
+      p1 = p2;
+    }
+    return p1;
+  }
+
+  int test05(int y) {
+    int x = 3;
+    Point p1 = new Point();
+    for (int i = 0; i < y; i++) {
+      Point p2 = new Point();
+      p2.x = x;
+      p2.y = 3 * y + x;
+      p1.next = p2;
+      p1 = p2;
+    }
+    return p1.y;
+  }
+
+  int test0(int y) {
+    int x = 3;
+    Point p = new Point();
+    p.x = x;
+    p.y = 3 * x + y;
+    dummy();
+    return p.x * p.y;
+  }
+
+  int test1(int y) {
+    Point p = new Point();
+    if ( (y & 1) == 1 ) {
+      p = new Point(); // Kill previous
+    }
+    int x = 3;
+    p.x = x;
+    p.y = 3 * x + y;
+    dummy();
+    return p.x * p.y;
+  }
+
+  int test2(int y) {
+    Point p1 = new Point();
+    Point p2 = new Point();
+    p1.x = 3;
+    p2.x = 4;
+    p1.y = 3 * p2.x + y;
+    p2.y = 3 * p1.x + y;
+    dummy();
+    return p1.y * p2.y;
+  }
+
+  int test3(int y, Point p1) {
+    Point p2 = new Point();
+    p1.x = 3;
+    p2.x = 4;
+    p1.y = 3 * p2.x + y;
+    p2.y = 3 * p1.x + y;
+    dummy();
+    return p1.y * p2.y;
+  }
+
+  int test4(int y) {
+    Point p1 = new Point();
+    Point p2 = new Point();
+    if ( (y & 1) == 1 ) {
+      p1.x = 3;
+      p2.x = 4;
+    } else {
+      p1.x = 5;
+      p2.x = 6;
+    }
+    p1.y = 3 * p2.x + y;
+    p2.y = 3 * p1.x + y;
+    dummy();
+    return p1.y * p2.y;
+  }
+
+  int test5(int y, Point p1) {
+    Point p2 = new Point();
+    if ( (y & 1) == 1 ) {
+      p1.x = 3;
+      p2.x = 4;
+    } else {
+      p1.x = 5;
+      p2.x = 6;
+    }
+    p1.y = 3 * p2.x + y;
+    p2.y = 3 * p1.x + y;
+    dummy();
+    return p1.y * p2.y;
+  }
+
+  int test6(int y) {
+    Point p1 = new Point();
+    Point p2 = new Point();
+    p1.next = p2;
+    if ( (y & 1) == 1 ) {
+      p1.x = 3;
+      p1.getNext().x = 4;
+    } else {
+      p1.x = 5;
+      p1.getNext().x = 6;
+    }
+    p1.y = 3 * p2.x + y;
+    p2.y = 3 * p1.x + y;
+    dummy();
+    return p1.y * p2.y;
+  }
+
+  int test7(int y, Point p1) {
+    Point p2 = new Point();
+    p1.next = p2;
+    if ( (y & 1) == 1 ) {
+      p1.x = 3;
+      p1.getNext().x = 4;
+    } else {
+      p1.x = 5;
+      p1.getNext().x = 6;
+    }
+    p1.y = 3 * p2.x + y;
+    p2.y = 3 * p1.x + y;
+    dummy();
+    return p1.y * p2.y;
+  }
+
+  int test8(int y, int l, int i) {
+    Point p = new Point();
+    p.ax = new int[l];
+    p.ay = new int[l];
+    int x = 3;
+    p.ax[i] = x;
+    p.ay[i] = 3 * x + y;
+    dummy();
+    return p.ax[i] * p.ay[i];
+  }
+
+  int test9(int y, int l, int i) {
+    Point p = new Point();
+    p.pax = new Point[l];
+    p.pay = new Point[l];
+    p.pax[i] = new Point();
+    p.pay[i] = new Point();
+    p.pax[i].x = 3;
+    p.pay[i].x = 4;
+    p.pax[i].y = 3 * p.pay[i].x + y;
+    p.pay[i].y = 3 * p.pax[i].x + y;
+    dummy();
+    return p.pax[i].y * p.pay[i].y;
+  }
+
+  int test10(int y, int l, int i, Class cls) {
+    Point p = new Point();
+    try {
+      p.pax = (Point[])Array.newInstance(cls, l);
+      p.pax[i] = (Point)cls.newInstance();
+    }
+    catch(java.lang.InstantiationException ex) {
+      return 0;
+    }
+    catch(java.lang.IllegalAccessException ex) {
+      return 0;
+    }
+    p.pax[i].x = 3;
+    p.pax[i].y = 3 * p.pax[i].x + y;
+    dummy();
+    return p.pax[i].x * p.pax[i].y;
+  }
+
+  int test11(int y) {
+    Point p1 = new Point();
+    Point p2 = new Point();
+    p1.next = p2;
+    if ( (y & 1) == 1 ) {
+      p1.x = 3;
+      p1.next.x = 4;
+    } else {
+      p1.x = 5;
+      p1.next.x = 6;
+    }
+    p1.y = 3 * p1.next.x + y;
+    p1.next.y = 3 * p1.x + y;
+    dummy();
+    return p1.y * p1.next.y;
+  }
+
+  int test12(int y) {
+    Point p1 = new Point();
+    p1.next = p1;
+    if ( (y & 1) == 1 ) {
+      p1.x = 3;
+      p1.next.x = 4;
+    } else {
+      p1.x = 5;
+      p1.next.x = 6;
+    }
+    p1.y = 3 * p1.next.x + y;
+    p1.next.y = 3 * p1.x + y;
+    dummy();
+    return p1.y * p1.next.y;
+  }
+
+
+  public static void main(String args[]) {
+    Test tsr    = new Test();
+    Point p     = new Point();
+    Point ptmp  = p;
+    Class cls   = Point.class;
+    int y = 0;
+    for (int i=0; i<10000; i++) {
+      ptmp.next = tsr.test00(1);
+      ptmp.next = tsr.test01(1);
+      ptmp.next = tsr.test02(1);
+      ptmp.next = tsr.test03(1);
+      ptmp.next = tsr.test04(1);
+
+      y = tsr.test05(1);
+
+      y = tsr.test80(y, 1, 0);
+      y = tsr.test81(y, 1, 0);
+
+      y = tsr.test44(y);
+      y = tsr.test43(y);
+      y = tsr.test42(y);
+      y = tsr.test40(y);
+      y = tsr.test41(y);
+
+      y = tsr.test0(y);
+      y = tsr.test1(y);
+      y = tsr.test2(y);
+      y = tsr.test3(y, p);
+      y = tsr.test4(y);
+      y = tsr.test5(y, p);
+      y = tsr.test6(y);
+      y = tsr.test7(y, p);
+      y = tsr.test8(y, 1, 0);
+      y = tsr.test9(y, 1, 0);
+      y = tsr.test10(y, 1, 0, cls);
+      y = tsr.test11(y);
+      y = tsr.test12(y);
+    }
+    for (int i=0; i<10000; i++) {
+      ptmp.next = tsr.test00(1);
+      ptmp.next = tsr.test01(1);
+      ptmp.next = tsr.test02(1);
+      ptmp.next = tsr.test03(1);
+      ptmp.next = tsr.test04(1);
+
+      y = tsr.test05(1);
+
+      y = tsr.test80(y, 1, 0);
+      y = tsr.test81(y, 1, 0);
+
+      y = tsr.test44(y);
+      y = tsr.test43(y);
+      y = tsr.test42(y);
+      y = tsr.test40(y);
+      y = tsr.test41(y);
+
+      y = tsr.test0(y);
+      y = tsr.test1(y);
+      y = tsr.test2(y);
+      y = tsr.test3(y, p);
+      y = tsr.test4(y);
+      y = tsr.test5(y, p);
+      y = tsr.test6(y);
+      y = tsr.test7(y, p);
+      y = tsr.test8(y, 1, 0);
+      y = tsr.test9(y, 1, 0);
+      y = tsr.test10(y, 1, 0, cls);
+      y = tsr.test11(y);
+      y = tsr.test12(y);
+    }
+    for (int i=0; i<10000; i++) {
+      ptmp.next = tsr.test00(1);
+      ptmp.next = tsr.test01(1);
+      ptmp.next = tsr.test02(1);
+      ptmp.next = tsr.test03(1);
+      ptmp.next = tsr.test04(1);
+
+      y = tsr.test05(1);
+
+      y = tsr.test80(y, 1, 0);
+      y = tsr.test81(y, 1, 0);
+
+      y = tsr.test44(y);
+      y = tsr.test43(y);
+      y = tsr.test42(y);
+      y = tsr.test40(y);
+      y = tsr.test41(y);
+
+      y = tsr.test0(y);
+      y = tsr.test1(y);
+      y = tsr.test2(y);
+      y = tsr.test3(y, p);
+      y = tsr.test4(y);
+      y = tsr.test5(y, p);
+      y = tsr.test6(y);
+      y = tsr.test7(y, p);
+      y = tsr.test8(y, 1, 0);
+      y = tsr.test9(y, 1, 0);
+      y = tsr.test10(y, 1, 0, cls);
+      y = tsr.test11(y);
+      y = tsr.test12(y);
+    }
+
+    int z = 0;
+    y = tsr.test80(0, 1, 0);
+    z += y;
+    System.out.println("After 'test80' y=" + y);
+    y = tsr.test81(0, 1, 0);
+    z += y;
+    System.out.println("After 'test81' y=" + y);
+
+    y = tsr.test44(0);
+    z += y;
+    System.out.println("After 'test44' y=" + y);
+    y = tsr.test43(0);
+    z += y;
+    System.out.println("After 'test43' y=" + y);
+    y = tsr.test42(0);
+    z += y;
+    System.out.println("After 'test42' y=" + y);
+    y = tsr.test40(0);
+    z += y;
+    System.out.println("After 'test40' y=" + y);
+    y = tsr.test41(0);
+    z += y;
+    System.out.println("After 'test41' y=" + y);
+
+    ptmp.next = tsr.test00(1);
+    z += y;
+    System.out.println("After 'test00' p.y=" + ptmp.next.y);
+    ptmp.next = tsr.test01(1);
+    z += y;
+    System.out.println("After 'test01' p.y=" + ptmp.next.y);
+    ptmp.next = tsr.test02(1);
+    z += y;
+    System.out.println("After 'test02' p.y=" + ptmp.next.y);
+    ptmp.next = tsr.test03(1);
+    z += y;
+    System.out.println("After 'test03' p.y=" + ptmp.next.y);
+    ptmp.next = tsr.test04(1);
+    z += y;
+    System.out.println("After 'test04' p.y=" + ptmp.next.y);
+
+    y = tsr.test05(1);
+    z += y;
+    System.out.println("After 'test05' y=" + y);
+
+    y = tsr.test0(0);
+    z += y;
+    System.out.println("After 'test0' y=" + y);
+    y = tsr.test1(0);
+    z += y;
+    System.out.println("After 'test1' y=" + y);
+    y = tsr.test2(0);
+    z += y;
+    System.out.println("After 'test2' y=" + y);
+    y = tsr.test3(0, new Point());
+    z += y;
+    System.out.println("After 'test3' y=" + y);
+    y = tsr.test4(0);
+    z += y;
+    System.out.println("After 'test4' y=" + y);
+    y = tsr.test5(0, new Point());
+    z += y;
+    System.out.println("After 'test5' y=" + y);
+    y = tsr.test6(0);
+    z += y;
+    System.out.println("After 'test6' y=" + y);
+    y = tsr.test7(0, new Point());
+    z += y;
+    System.out.println("After 'test7' y=" + y);
+    y = tsr.test8(0, 1, 0);
+    z += y;
+    System.out.println("After 'test8' y=" + y);
+    y = tsr.test9(0, 1, 0);
+    z += y;
+    System.out.println("After 'test9' y=" + y);
+    y = tsr.test10(0, 1, 0, cls);
+    z += y;
+    System.out.println("After 'test10' y=" + y);
+    y = tsr.test11(0);
+    z += y;
+    System.out.println("After 'test11' y=" + y);
+    y = tsr.test12(0);
+    z += y;
+    System.out.println("After 'test12' y=" + y);
+    System.out.println("Sum of y =" + z);
+  }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/compiler/6695810/Test.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,56 @@
+/*
+ * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
+ * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ */
+
+/*
+ * @test
+ * @bug 6695810
+ * @summary null oop passed to encode_heap_oop_not_null
+ * @run main/othervm -Xbatch Test
+ */
+
+public class Test {
+    Test _t;
+
+    static void test(Test t1, Test t2) {
+        if (t2 != null)
+            t1._t = t2;
+
+        if (t2 != null)
+            t1._t = t2;
+    }
+
+    public static void main(String[] args) {
+        Test t = new Test();
+        for (int i = 0; i < 50; i++) {
+            for (int j = 0; j < 100; j++) {
+                test(t, t);
+            }
+            test(t, null);
+        }
+        for (int i = 0; i < 10000; i++) {
+            test(t, t);
+        }
+        test(t, null);
+    }
+}
--- a/jaxp/.hgtags	Thu Jun 05 15:57:56 2008 -0700
+++ b/jaxp/.hgtags	Thu Jun 12 13:50:55 2008 -0700
@@ -1,2 +1,4 @@
 6ce5f4757bde08f7470cbb9f0b46da8f2f3d4f56 jdk7-b24
 a3b3ba7d6034dc754b51ddc3d281399ac1cae5f1 jdk7-b25
+da43cb85fac1646d6f97e4a35e510bbfdff97bdb jdk7-b26
+bafed478d67c3acf7744aaad88b9404261ea6739 jdk7-b27
--- a/jaxws/.hgtags	Thu Jun 05 15:57:56 2008 -0700
+++ b/jaxws/.hgtags	Thu Jun 12 13:50:55 2008 -0700
@@ -1,2 +1,4 @@
 0961a4a211765fea071b8dac419003ee0c3d5973 jdk7-b24
 59fd8224ba2da5c2d8d4c68e33cf33ab41ce8de0 jdk7-b25
+debd37e1a422e580edb086c95d6e89199133a39c jdk7-b26
+27d8f42862c11b4ddc4af2dd2d2a3cd86cda04c2 jdk7-b27
--- a/jdk/.hgtags	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/.hgtags	Thu Jun 12 13:50:55 2008 -0700
@@ -1,2 +1,4 @@
 37a05a11f281b4d238e2f9e7ebb67c63f64d0e77 jdk7-b24
 75fca0b0ab83ab1392e615910cea020f66535390 jdk7-b25
+fb57027902e04ecafceae31a605e69b436c23d57 jdk7-b26
+3e599d98875ddf919c8ea11cff9b3a99ba631a9b jdk7-b27
--- a/jdk/make/com/sun/Makefile	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/make/com/sun/Makefile	Thu Jun 12 13:50:55 2008 -0700
@@ -41,7 +41,7 @@
 # Omit mirror since it's built with the apt tool.
 SUBDIRS = $(SCRIPT_SUBDIR) image security crypto/provider jndi jmx \
     java inputmethods org xml rowset net/httpserver net/ssl demo \
-    tools jarsigner
+    tools jarsigner tracing
 
 all build clean clobber::
 	$(SUBDIRS-loop)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/make/com/sun/tracing/Makefile	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,46 @@
+#
+# Copyright 2008 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.
+#
+
+#
+# Makefile for building tracing classes
+#
+
+BUILDDIR = ../../..
+PACKAGE = com.sun.tracing
+PRODUCT = sun
+include $(BUILDDIR)/common/Defs.gmk
+
+SUBDIRS = dtrace
+all build:
+	$(SUBDIRS-loop)
+clean clobber::
+	$(SUBDIRS-loop)
+
+AUTO_FILES_JAVA_DIRS = com/sun/tracing
+
+#
+# Rules.
+#
+include $(BUILDDIR)/common/Classes.gmk
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/make/com/sun/tracing/dtrace/Makefile	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,39 @@
+#
+# Copyright 2008 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.
+#
+
+#
+# Makefile for building dtrace extension
+#
+BUILDDIR = ../../../..
+PACKAGE = com.sun.tracing.dtrace
+PRODUCT = sun
+include $(BUILDDIR)/common/Defs.gmk
+
+AUTO_FILES_JAVA_DIRS = com/sun/tracing/dtrace
+
+#
+# Rules.
+#
+include $(BUILDDIR)/common/Classes.gmk
--- a/jdk/make/common/internal/BinaryPlugs.gmk	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/make/common/internal/BinaryPlugs.gmk	Thu Jun 12 13:50:55 2008 -0700
@@ -126,44 +126,10 @@
 com/sun/media/sound/SimpleInputDeviceProvider\$$InputDeviceInfo.class \
 com/sun/media/sound/SimpleInputDeviceProvider.class
 
-PLUG_AWT_CLASS_NAMES = \
-java/awt/color/CMMException.class \
-java/awt/color/ColorSpace.class \
-java/awt/color/ICC_ColorSpace.class \
-java/awt/color/ICC_Profile\$$1.class \
-java/awt/color/ICC_Profile\$$2.class \
-java/awt/color/ICC_Profile\$$3.class \
-java/awt/color/ICC_Profile.class \
-java/awt/color/ICC_ProfileGray.class \
-java/awt/color/ICC_ProfileRGB.class \
-java/awt/image/BandedSampleModel.class \
-java/awt/image/ColorConvertOp.class \
-java/awt/image/ComponentSampleModel.class \
-java/awt/image/DataBuffer\$$1.class \
-java/awt/image/DataBuffer.class \
-java/awt/image/DataBufferByte.class \
-java/awt/image/DataBufferInt.class \
-java/awt/image/DataBufferShort.class \
-java/awt/image/DataBufferUShort.class \
-java/awt/image/MultiPixelPackedSampleModel.class \
-java/awt/image/Raster.class \
-java/awt/image/RenderedImage.class \
-java/awt/image/SampleModel.class \
-java/awt/image/SinglePixelPackedSampleModel.class \
-java/awt/image/WritableRaster.class \
-java/awt/image/WritableRenderedImage.class \
-java/awt/image/renderable/ContextualRenderedImageFactory.class \
-java/awt/image/renderable/ParameterBlock.class \
-java/awt/image/renderable/RenderContext.class \
-java/awt/image/renderable/RenderableImage.class \
-java/awt/image/renderable/RenderableImageOp.class \
-java/awt/image/renderable/RenderableImageProducer.class \
-java/awt/image/renderable/RenderedImageFactory.class
-
 # Class list temp files (used by both import and export of plugs)
 
 PLUG_TEMPDIR=$(ABS_TEMPDIR)/plugs
-PLUG_CLASS_AREAS = jmf sound awt
+PLUG_CLASS_AREAS = jmf sound
 PLUG_CLISTS = $(PLUG_CLASS_AREAS:%=$(PLUG_TEMPDIR)/%.clist)
 
 # Create jargs file command
@@ -186,11 +152,6 @@
 	@for i in $(PLUG_SOUND_CLASS_NAMES) ; do \
 	  $(ECHO) "$$i" >> $@ ; \
 	done
-$(PLUG_TEMPDIR)/awt.clist:
-	@$(prep-target)
-	@for i in $(PLUG_AWT_CLASS_NAMES) ; do \
-	  $(ECHO) "$$i" >> $@ ; \
-	done
 $(PLUG_TEMPDIR)/all.clist: $(PLUG_CLISTS)
 	@$(prep-target)
 	$(CAT) $(PLUG_CLISTS) > $@
@@ -198,8 +159,6 @@
 	$(plug-create-jargs)
 $(PLUG_TEMPDIR)/sound.jargs: $(PLUG_TEMPDIR)/sound.clist
 	$(plug-create-jargs)
-$(PLUG_TEMPDIR)/awt.jargs: $(PLUG_TEMPDIR)/awt.clist
-	$(plug-create-jargs)
 $(PLUG_TEMPDIR)/all.jargs: $(PLUG_TEMPDIR)/all.clist
 	$(plug-create-jargs)
 
@@ -235,15 +194,12 @@
 	$(call import-binary-plug-classes,$(PLUG_TEMPDIR)/jmf.clist)
 import-binary-plug-sound-classes: $(PLUG_IMPORT_JARFILE) $(PLUG_TEMPDIR)/sound.clist
 	$(call import-binary-plug-classes,$(PLUG_TEMPDIR)/sound.clist)
-import-binary-plug-awt-classes: $(PLUG_IMPORT_JARFILE) $(PLUG_TEMPDIR)/awt.clist
-	$(call import-binary-plug-classes,$(PLUG_TEMPDIR)/awt.clist)
 
 # Import all classes from the jar file
 
 import-binary-plug-jar: \
 	     import-binary-plug-jmf-classes \
-	     import-binary-plug-sound-classes \
-	     import-binary-plug-awt-classes
+	     import-binary-plug-sound-classes
 
 # Import native libraries
 
@@ -286,7 +242,6 @@
 	import-binary-plug-jar \
         import-binary-plug-jmf-classes \
         import-binary-plug-sound-classes \
-	import-binary-plug-awt-classes \
         import-binary-plug-jsound-library
 
 else # !OPENJDK
--- a/jdk/make/common/shared/Defs-utils.gmk	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/make/common/shared/Defs-utils.gmk	Thu Jun 12 13:50:55 2008 -0700
@@ -148,13 +148,15 @@
     ECHO = $(UNIXCOMMAND_PATH)echo -e
     ZIPEXE = $(UNIXCOMMAND_PATH)zip
     UNZIP  = $(UNIXCOMMAND_PATH)unzip
+    # Some CYGWIN nawk versions require BINMODE=w for proper '\r' interpretation
+    NAWK   = $(UNIXCOMMAND_PATH)awk -v BINMODE=w
   else
     ZIPEXE = $(UTILS_DEVTOOL_PATH)zip
     UNZIP  = $(UTILS_DEVTOOL_PATH)unzip
+    NAWK   = $(UNIXCOMMAND_PATH)awk
   endif
   # Re-define some utilities
   LEX            =# override GNU Make intrinsic: no lex on windows
-  NAWK           = $(UNIXCOMMAND_PATH)awk
 endif
 
 # Linux specific
--- a/jdk/make/docs/Makefile	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/make/docs/Makefile	Thu Jun 12 13:50:55 2008 -0700
@@ -273,6 +273,28 @@
 # SMARTCARDIO_PKGS is located in NON_CORE_PKGS.gmk
 
 #
+# Variables used by TRACING target
+#
+
+TRACING_SOURCEPATH  = $(TOPDIR)/src/share/classes
+TRACING_DOCDIR	 = $(DOCSDIR)/jre/api/tracing
+
+TRACING_JAVADOCFLAGS = $(COMMON_JAVADOCFLAGS)			    \
+		   -encoding ascii			            \
+                   -nodeprecatedlist                                \
+                   -d $(TRACING_DOCDIR)				    \
+                   -sourcepath $(TRACING_SOURCEPATH)                \
+                   -windowtitle $(TRACING_WINDOWTITLE)              \
+                   -doctitle $(TRACING_DOCTITLE)                    \
+                   -header $(TRACING_JAVADOCHEADER)                 \
+                   -linkoffline ../../../../../api $(DOCSDIR)/api/
+
+TRACING_WINDOWTITLE = "Tracing"
+TRACING_DOCTITLE    = "Java$(TRADEMARK) Platform Tracing"
+TRACING_JAVADOCHEADER      = "Platform Tracing"
+# TRACING_PKGS is located in NON_CORE_PKGS.gmk
+
+#
 # Variables used by HTTPSERVER target
 #
 
@@ -420,6 +442,7 @@
     jaasdocs \
     jgssdocs \
     smartcardiodocs \
+    tracingdocs \
     httpserverdocs  \
     mgmtdocs \
     attachdocs \
@@ -585,6 +608,14 @@
 	$(JAVADOC_CMD) $(SMARTCARDIO_JAVADOCFLAGS)                     \
 		   $(SMARTCARDIO_PKGS)
 
+.PHONY: tracingdocs
+tracingdocs:
+	@# ######## api-tracing ############################
+	$(RM) -r $(TRACING_DOCDIR)
+	$(MKDIR) -p $(TRACING_DOCDIR)
+	$(JAVADOC) $(TRACING_JAVADOCFLAGS)                     \
+		   $(TRACING_PKGS)
+
 .PHONY: httpserverdocs
 httpserverdocs:
 	@# ######## api-httpserver #######################
--- a/jdk/make/docs/NON_CORE_PKGS.gmk	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/make/docs/NON_CORE_PKGS.gmk	Thu Jun 12 13:50:55 2008 -0700
@@ -84,6 +84,9 @@
 
 SMARTCARDIO_PKGS = javax.smartcardio
 
+TRACING_PKGS     = com.sun.tracing         \
+                   com.sun.tracing.dtrace
+
 # non-core packages in rt.jar
 NON_CORE_PKGS    = $(DOMAPI_PKGS) \
                    $(MGMT_PKGS) \
@@ -91,4 +94,5 @@
                    $(JGSS_PKGS) \
                    $(OLD_JSSE_PKGS) \
                    $(HTTPSERVER_PKGS) \
-                   $(SMARTCARDIO_PKGS)
+                   $(SMARTCARDIO_PKGS) \
+                   $(TRACING_PKGS)
--- a/jdk/make/java/awt/Makefile	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/make/java/awt/Makefile	Thu Jun 12 13:50:55 2008 -0700
@@ -28,24 +28,12 @@
 PRODUCT = sun
 include $(BUILDDIR)/common/Defs.gmk
 
-# WARNING: Make sure the OPENJDK plugs are up-to-date, see make/common/internal/BinaryPlugs.gmk
 
 #
 # Files
 #
 AUTO_FILES_JAVA_DIRS = java/awt sun/awt/geom
 
-#
-# Specific to OPENJDK
-#
-ifdef OPENJDK
-
-build: import-binary-plug-awt-classes
-
-include $(BUILDDIR)/common/internal/BinaryPlugs.gmk
-
-endif
-
 build: properties cursors
 
 #
--- a/jdk/make/java/java/Makefile	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/make/java/java/Makefile	Thu Jun 12 13:50:55 2008 -0700
@@ -394,7 +394,7 @@
 $(GENSRCDIR)/sun/util/CoreResourceBundleControl.java: \
 	$(SHARE_SRC)/classes/sun/util/CoreResourceBundleControl-XLocales.java $(LOCALES_GEN_SH)
 	@$(prep-target) 
-	NAWK=$(NAWK) SED=$(SED) $(SH) $(LOCALES_GEN_SH) "$(JRE_NONEXIST_LOCALES)" \
+	NAWK="$(NAWK)" SED="$(SED)" $(SH) $(LOCALES_GEN_SH) "$(JRE_NONEXIST_LOCALES)" \
 		$< $@ 
 clean::
 	$(RM) $(GENSRCDIR)/sun/util/CoreResourceBundleControl.java
--- a/jdk/make/java/nio/Makefile	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/make/java/nio/Makefile	Thu Jun 12 13:50:55 2008 -0700
@@ -191,7 +191,7 @@
 
 GEN_BUFFER_SH = genBuffer.sh
 
-GEN_BUFFER_CMD = SPP="$(SPP_CMD)" NAWK=$(NAWK) SED=$(SED) SH=$(SH) \
+GEN_BUFFER_CMD = SPP="$(SPP_CMD)" NAWK="$(NAWK)" SED="$(SED)" SH="$(SH)" \
                  $(SH) $(GEN_BUFFER_SH)
 
 # Public abstract buffer classes
@@ -582,7 +582,7 @@
 
 GEN_CODER_SH = genCoder.sh
 
-GEN_CODER_CMD = SPP="$(SPP_CMD)" SED=$(SED) NAWK=$(NAWK) SH=$(SH) $(SH) $(GEN_CODER_SH)
+GEN_CODER_CMD = SPP="$(SPP_CMD)" SED="$(SED)" NAWK="$(NAWK)" SH="$(SH)" $(SH) $(GEN_CODER_SH)
 
 $(CS_GEN)/CharsetDecoder.java: $(CS_SRC)/Charset-X-Coder.java $(GEN_CODER_SH)
 	$(prep-target)
@@ -602,7 +602,7 @@
 
 GEN_EX_SH = genExceptions.sh
  
-GEN_EX_CMD = NAWK=$(NAWK) SH=$(SH) $(SH) $(GEN_EX_SH)
+GEN_EX_CMD = NAWK="$(NAWK)" SH="$(SH)" $(SH) $(GEN_EX_SH)
 
 $(CH_GEN)/%Exception.java: genExceptions.sh $(CH_SRC)/exceptions
 	$(prep-target)
@@ -635,7 +635,7 @@
     $(HASHER_JARFILE) $(SCS_SRC)/standard-charsets
 	$(prep-target)
 	@$(RM) $@.temp
-	NAWK=$(NAWK) TEMPDIR=$(TEMPDIR) SH=$(SH) \
+	NAWK="$(NAWK)" TEMPDIR="$(TEMPDIR)" SH="$(SH)" \
 	  HASHER="$(BOOT_JAVA_CMD) -jar $(HASHER_JARFILE)" \
 	  $(SH) -e genCharsetProvider.sh $(SCS_SRC)/standard-charsets $(SCS_GEN)
 
--- a/jdk/make/java/sun_nio/FILES_java.gmk	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/make/java/sun_nio/FILES_java.gmk	Thu Jun 12 13:50:55 2008 -0700
@@ -33,6 +33,7 @@
     sun/nio/cs/AbstractCharsetProvider.java \
     sun/nio/cs/HistoricallyNamedCharset.java \
     sun/nio/cs/Surrogate.java \
+    sun/nio/cs/CharsetMapping.java \
     sun/nio/cs/SingleByteEncoder.java \
     sun/nio/cs/SingleByteDecoder.java \
     sun/nio/cs/UnicodeEncoder.java \
--- a/jdk/make/sun/Makefile	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/make/sun/Makefile	Thu Jun 12 13:50:55 2008 -0700
@@ -63,7 +63,7 @@
           $(HEADLESS_SUBDIR) $(DGA_SUBDIR) \
 	  font jpeg cmm applet rmi beans $(JDBC_SUBDIR) \
 	  jawt text nio launcher management $(ORG_SUBDIR) \
-          native2ascii serialver tools jconsole
+          native2ascii serialver tools jconsole tracing
 
 all build clean clobber::
 	$(SUBDIRS-loop)
--- a/jdk/make/sun/cmm/Makefile	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/make/sun/cmm/Makefile	Thu Jun 12 13:50:55 2008 -0700
@@ -41,12 +41,8 @@
 ICCPROFILE_DEST_DIR = $(LIBDIR)/cmm
 
 iccprofiles: $(ICCPROFILE_DEST_DIR)/sRGB.pf $(ICCPROFILE_DEST_DIR)/GRAY.pf \
-	     $(ICCPROFILE_DEST_DIR)/CIEXYZ.pf
-
-ifndef OPENJDK
-iccprofiles:  $(ICCPROFILE_DEST_DIR)/PYCC.pf \
-	      $(ICCPROFILE_DEST_DIR)/LINEAR_RGB.pf
-endif
+	     $(ICCPROFILE_DEST_DIR)/CIEXYZ.pf $(ICCPROFILE_DEST_DIR)/PYCC.pf \
+	     $(ICCPROFILE_DEST_DIR)/LINEAR_RGB.pf
 
 $(ICCPROFILE_DEST_DIR)/sRGB.pf: $(ICCPROFILE_SRC_DIR)/sRGB.pf
 	$(RM) $(ICCPROFILE_DEST_DIR)/sRGB.pf
--- a/jdk/make/sun/font/FILES_c.gmk	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/make/sun/font/FILES_c.gmk	Thu Jun 12 13:50:55 2008 -0700
@@ -113,7 +113,9 @@
 
 
 ifeq ($(PLATFORM),windows)
-FILES_c_platform = fontpath.c
+FILES_c_platform = fontpath.c \
+                   lcdglyph.c
+
 FILES_cpp_platform = D3DTextRenderer.cpp
 else
 FILES_c_platform = X11FontScaler.c \
--- a/jdk/make/sun/font/Makefile	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/make/sun/font/Makefile	Thu Jun 12 13:50:55 2008 -0700
@@ -63,6 +63,7 @@
     java/awt/Font.java \
     java/text/Bidi.java \
     sun/font/FileFont.java \
+    sun/font/FileFontStrike.java \
     sun/font/FontManager.java \
     sun/font/GlyphList.java \
     sun/font/NativeFont.java \
--- a/jdk/make/sun/nio/Makefile	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/make/sun/nio/Makefile	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright 1996-2006 Sun Microsystems, Inc.  All Rights Reserved.
+# Copyright 1996-2008 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
@@ -73,11 +73,21 @@
 SERVICE_DESCRIPTION = java.nio.charset.spi.CharsetProvider
 SERVICE_DESCRIPTION_PATH = META-INF/services/$(SERVICE_DESCRIPTION)
 
+GENCSDATASRC = $(BUILDDIR)/tools/CharsetMapping
+FILES_MAP = $(GENCSDATASRC)/sjis0213.map
+FILES_DAT = $(CLASSDESTDIR)/sun/nio/cs/ext/sjis0213.dat
+CHARSETMAPPING_JARFILE = $(BUILDTOOLJARDIR)/charsetmapping.jar
+
+$(FILES_DAT): $(FILES_MAP)
+	@$(prep-target)
+	$(BOOT_JAVA_CMD) -jar $(CHARSETMAPPING_JARFILE) \
+		$(FILES_MAP) $(FILES_DAT)
+
 $(CLASSDESTDIR)/$(SERVICE_DESCRIPTION_PATH): \
   $(SHARE_SRC)/classes/sun/nio/cs/ext/$(SERVICE_DESCRIPTION_PATH)
 	$(install-file)
 
-$(CHARSETS_JAR): $(FILES_class) $(CLASSDESTDIR)/$(SERVICE_DESCRIPTION_PATH)
+$(CHARSETS_JAR): $(FILES_class) $(CLASSDESTDIR)/$(SERVICE_DESCRIPTION_PATH) $(FILES_DAT)
 	$(BOOT_JAR_CMD) cf $(CHARSETS_JAR) \
 	      -C $(CLASSDESTDIR) sun \
 	      -C $(CLASSDESTDIR) $(SERVICE_DESCRIPTION_PATH)  \
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/make/sun/tracing/Makefile	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,46 @@
+#
+# Copyright 2008 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.
+#
+
+#
+# Makefile for building tracing package implementation classes
+#
+
+BUILDDIR = ../..
+PACKAGE = sun.tracing
+PRODUCT = sun
+include $(BUILDDIR)/common/Defs.gmk
+
+SUBDIRS = dtrace
+all build:
+	$(SUBDIRS-loop)
+clean clobber::
+	$(SUBDIRS-loop)
+
+AUTO_FILES_JAVA_DIRS = sun/tracing
+
+#
+# Rules.
+#
+include $(BUILDDIR)/common/Classes.gmk
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/make/sun/tracing/dtrace/Makefile	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,79 @@
+#
+# Copyright 2008 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.
+#
+
+#
+# Makefile for building dtrace extension
+#
+BUILDDIR = ../../..
+PACKAGE = sun.tracing.dtrace
+LIBRARY = jsdt
+PRODUCT = sun
+include $(BUILDDIR)/common/Defs.gmk
+
+#
+# Use mapfile
+#
+FILES_m = mapfile-vers
+include $(BUILDDIR)/common/Mapfile-vers.gmk
+
+NATIVE_DTRACE_DIR=native/sun/tracing/dtrace
+
+SRCDIR=$(SHARE_SRC)/$(NATIVE_DTRACE_DIR)
+PSRCDIR=$(PLATFORM_SRC)/$(NATIVE_DTRACE_DIR)
+
+FILES_c = JVM.c jvm_symbols_md.c
+
+FILES_java = \
+    sun/tracing/dtrace/Activation.java \
+    sun/tracing/dtrace/DTraceProvider.java \
+    sun/tracing/dtrace/DTraceProbe.java \
+    sun/tracing/dtrace/DTraceProviderFactory.java \
+    sun/tracing/dtrace/JVM.java
+
+FILES_export = $(FILES_java)
+
+ifeq ($(PLATFORM), linux)
+OTHER_LDLIBS += -ldl
+endif
+
+#
+# Use JNI for generating header files
+#
+JAVAHFLAGS += -jni
+
+#
+# Don't need to link against -ljava
+#
+JAVALIB=
+
+#
+# Rules.
+#
+include $(BUILDDIR)/common/Library.gmk
+
+#
+# Add to ambient vpath so we pick up the library files
+#
+vpath %.c $(SRCDIR):$(PSRCDIR)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/make/sun/tracing/dtrace/mapfile-vers	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,37 @@
+#
+# Copyright 2008 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.
+#
+
+# Define library interface.
+
+SUNWprivate_1.1 {
+    global:
+        Java_sun_tracing_dtrace_JVM_isSupported0;
+        Java_sun_tracing_dtrace_JVM_activate0;
+        Java_sun_tracing_dtrace_JVM_dispose0;
+        Java_sun_tracing_dtrace_JVM_isEnabled0;
+        Java_sun_tracing_dtrace_JVM_defineClass0;
+    local:
+        *;
+};
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/make/tools/CharsetMapping/Makefile	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,43 @@
+#
+# Copyright 2008 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.
+#
+
+#
+# Makefile for building the charsetmapping tool
+#
+
+BUILDDIR = ../..
+PACKAGE = build.tools.charsetmapping
+PRODUCT = tools
+PROGRAM = charsetmapping
+include $(BUILDDIR)/common/Defs.gmk
+
+BUILDTOOL_SOURCE_ROOT = $(BUILDDIR)/tools/src
+BUILDTOOL_MAIN        = $(PKGDIR)/GenerateMapping.java
+
+#
+# Build tool jar rules.
+#
+include $(BUILDDIR)/common/BuildToolJar.gmk
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/make/tools/CharsetMapping/sjis0213.map	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,11471 @@
+## Shift_JIS-2004 (JIS X 0213:2004 Appendix 1) vs Unicode mapping table
+## 
+## Date: 13 May 2006
+## License:
+## 	Copyright (C) 2001 earthian@tama.or.jp, All Rights Reserved.
+## 	Copyright (C) 2001 I'O, All Rights Reserved.
+## 	Copyright (C) 2006 Project X0213, All Rights Reserved.
+## 	You can use, modify, distribute this table freely.
+## Note:
+## 	[1983]	JIS codepoint defined by JIS X 0208-1983
+## 	[1990]	JIS codepoint defined by JIS X 0208-1990
+## 	[2000]	JIS codepoint defined by JIS X 0213:2000
+## 	[2004]	JIS codepoint defined by JIS X 0213:2004
+## 	[Unicode3.1]	UCS codepoint defined by Unicode 3.1
+## 	[Unicode3.2]	UCS codepoint defined by Unicode 3.2
+## 	Fullwidth	UCS fullwidth form (U+Fxxx)
+## 	Windows 	Windows (CP932) mapping
+## 	Some 0213 character can't represent by one UCS character.
+## 	In this table, such characters are described as 'U+xxxx+xxxx'.
+##
+##
+##	(1)Added JIS0213 entries
+##	(2)Updated 2 entries
+##	   0x81b0 -> u+ff5e
+## 	   0x815f -> u+ff3c
+##
+## JIS	Unicode	Name	Note
+##
+## Note: Block f09f--f0fc has been moved to the correct(sorted) position
+##
+## <RegEx Pattern="0x(\p{XDigit}++)\s++U\+(\p{XDigit}++)(?:\+(\p{XDigit}++))?\s++#.*"> GDB=1 GC=2 GCC=3>
+##
+#
+#  sjis0201
+#
+0x20	U+0020	# SPACE
+0x21	U+0021	# EXCLAMATION MARK
+0x22	U+0022	# QUOTATION MARK
+0x23	U+0023	# NUMBER SIGN
+0x24	U+0024	# DOLLAR SIGN
+0x25	U+0025	# PERCENT SIGN
+0x26	U+0026	# AMPERSAND
+0x27	U+0027	# APOSTROPHE
+0x28	U+0028	# LEFT PARENTHESIS
+0x29	U+0029	# RIGHT PARENTHESIS
+0x2A	U+002A	# ASTERISK
+0x2B	U+002B	# PLUS SIGN
+0x2C	U+002C	# COMMA
+0x2D	U+002D	# HYPHEN-MINUS
+0x2E	U+002E	# FULL STOP
+0x2F	U+002F	# SOLIDUS
+0x30	U+0030	# DIGIT ZERO
+0x31	U+0031	# DIGIT ONE
+0x32	U+0032	# DIGIT TWO
+0x33	U+0033	# DIGIT THREE
+0x34	U+0034	# DIGIT FOUR
+0x35	U+0035	# DIGIT FIVE
+0x36	U+0036	# DIGIT SIX
+0x37	U+0037	# DIGIT SEVEN
+0x38	U+0038	# DIGIT EIGHT
+0x39	U+0039	# DIGIT NINE
+0x3A	U+003A	# COLON
+0x3B	U+003B	# SEMICOLON
+0x3C	U+003C	# LESS-THAN SIGN
+0x3D	U+003D	# EQUALS SIGN
+0x3E	U+003E	# GREATER-THAN SIGN
+0x3F	U+003F	# QUESTION MARK
+0x40	U+0040	# COMMERCIAL AT
+0x41	U+0041	# LATIN CAPITAL LETTER A
+0x42	U+0042	# LATIN CAPITAL LETTER B
+0x43	U+0043	# LATIN CAPITAL LETTER C
+0x44	U+0044	# LATIN CAPITAL LETTER D
+0x45	U+0045	# LATIN CAPITAL LETTER E
+0x46	U+0046	# LATIN CAPITAL LETTER F
+0x47	U+0047	# LATIN CAPITAL LETTER G
+0x48	U+0048	# LATIN CAPITAL LETTER H
+0x49	U+0049	# LATIN CAPITAL LETTER I
+0x4A	U+004A	# LATIN CAPITAL LETTER J
+0x4B	U+004B	# LATIN CAPITAL LETTER K
+0x4C	U+004C	# LATIN CAPITAL LETTER L
+0x4D	U+004D	# LATIN CAPITAL LETTER M
+0x4E	U+004E	# LATIN CAPITAL LETTER N
+0x4F	U+004F	# LATIN CAPITAL LETTER O
+0x50	U+0050	# LATIN CAPITAL LETTER P
+0x51	U+0051	# LATIN CAPITAL LETTER Q
+0x52	U+0052	# LATIN CAPITAL LETTER R
+0x53	U+0053	# LATIN CAPITAL LETTER S
+0x54	U+0054	# LATIN CAPITAL LETTER T
+0x55	U+0055	# LATIN CAPITAL LETTER U
+0x56	U+0056	# LATIN CAPITAL LETTER V
+0x57	U+0057	# LATIN CAPITAL LETTER W
+0x58	U+0058	# LATIN CAPITAL LETTER X
+0x59	U+0059	# LATIN CAPITAL LETTER Y
+0x5A	U+005A	# LATIN CAPITAL LETTER Z
+0x5B	U+005B	# LEFT SQUARE BRACKET
+0x5C	U+005C	# YEN SIGN
+0x5D	U+005D	# RIGHT SQUARE BRACKET
+0x5E	U+005E	# CIRCUMFLEX ACCENT
+0x5F	U+005F	# LOW LINE
+0x60	U+0060	# GRAVE ACCENT
+0x61	U+0061	# LATIN SMALL LETTER A
+0x62	U+0062	# LATIN SMALL LETTER B
+0x63	U+0063	# LATIN SMALL LETTER C
+0x64	U+0064	# LATIN SMALL LETTER D
+0x65	U+0065	# LATIN SMALL LETTER E
+0x66	U+0066	# LATIN SMALL LETTER F
+0x67	U+0067	# LATIN SMALL LETTER G
+0x68	U+0068	# LATIN SMALL LETTER H
+0x69	U+0069	# LATIN SMALL LETTER I
+0x6A	U+006A	# LATIN SMALL LETTER J
+0x6B	U+006B	# LATIN SMALL LETTER K
+0x6C	U+006C	# LATIN SMALL LETTER L
+0x6D	U+006D	# LATIN SMALL LETTER M
+0x6E	U+006E	# LATIN SMALL LETTER N
+0x6F	U+006F	# LATIN SMALL LETTER O
+0x70	U+0070	# LATIN SMALL LETTER P
+0x71	U+0071	# LATIN SMALL LETTER Q
+0x72	U+0072	# LATIN SMALL LETTER R
+0x73	U+0073	# LATIN SMALL LETTER S
+0x74	U+0074	# LATIN SMALL LETTER T
+0x75	U+0075	# LATIN SMALL LETTER U
+0x76	U+0076	# LATIN SMALL LETTER V
+0x77	U+0077	# LATIN SMALL LETTER W
+0x78	U+0078	# LATIN SMALL LETTER X
+0x79	U+0079	# LATIN SMALL LETTER Y
+0x7A	U+007A	# LATIN SMALL LETTER Z
+0x7B	U+007B	# LEFT CURLY BRACKET
+0x7C	U+007C	# VERTICAL LINE
+0x7D	U+007D	# RIGHT CURLY BRACKET
+0x7E	U+007E	# OVERLINE
+0x7F	U+007F	# DELETE
+0xA1	U+FF61	# HALFWIDTH IDEOGRAPHIC FULL STOP
+0xA2	U+FF62	# HALFWIDTH LEFT CORNER BRACKET
+0xA3	U+FF63	# HALFWIDTH RIGHT CORNER BRACKET
+0xA4	U+FF64	# HALFWIDTH IDEOGRAPHIC COMMA
+0xA5	U+FF65	# HALFWIDTH KATAKANA MIDDLE DOT
+0xA6	U+FF66	# HALFWIDTH KATAKANA LETTER WO
+0xA7	U+FF67	# HALFWIDTH KATAKANA LETTER SMALL A
+0xA8	U+FF68	# HALFWIDTH KATAKANA LETTER SMALL I
+0xA9	U+FF69	# HALFWIDTH KATAKANA LETTER SMALL U
+0xAA	U+FF6A	# HALFWIDTH KATAKANA LETTER SMALL E
+0xAB	U+FF6B	# HALFWIDTH KATAKANA LETTER SMALL O
+0xAC	U+FF6C	# HALFWIDTH KATAKANA LETTER SMALL YA
+0xAD	U+FF6D	# HALFWIDTH KATAKANA LETTER SMALL YU
+0xAE	U+FF6E	# HALFWIDTH KATAKANA LETTER SMALL YO
+0xAF	U+FF6F	# HALFWIDTH KATAKANA LETTER SMALL TU
+0xB0	U+FF70	# HALFWIDTH KATAKANA-HIRAGANA PROLONGED SOUND MARK
+0xB1	U+FF71	# HALFWIDTH KATAKANA LETTER A
+0xB2	U+FF72	# HALFWIDTH KATAKANA LETTER I
+0xB3	U+FF73	# HALFWIDTH KATAKANA LETTER U
+0xB4	U+FF74	# HALFWIDTH KATAKANA LETTER E
+0xB5	U+FF75	# HALFWIDTH KATAKANA LETTER O
+0xB6	U+FF76	# HALFWIDTH KATAKANA LETTER KA
+0xB7	U+FF77	# HALFWIDTH KATAKANA LETTER KI
+0xB8	U+FF78	# HALFWIDTH KATAKANA LETTER KU
+0xB9	U+FF79	# HALFWIDTH KATAKANA LETTER KE
+0xBA	U+FF7A	# HALFWIDTH KATAKANA LETTER KO
+0xBB	U+FF7B	# HALFWIDTH KATAKANA LETTER SA
+0xBC	U+FF7C	# HALFWIDTH KATAKANA LETTER SI
+0xBD	U+FF7D	# HALFWIDTH KATAKANA LETTER SU
+0xBE	U+FF7E	# HALFWIDTH KATAKANA LETTER SE
+0xBF	U+FF7F	# HALFWIDTH KATAKANA LETTER SO
+0xC0	U+FF80	# HALFWIDTH KATAKANA LETTER TA
+0xC1	U+FF81	# HALFWIDTH KATAKANA LETTER TI
+0xC2	U+FF82	# HALFWIDTH KATAKANA LETTER TU
+0xC3	U+FF83	# HALFWIDTH KATAKANA LETTER TE
+0xC4	U+FF84	# HALFWIDTH KATAKANA LETTER TO
+0xC5	U+FF85	# HALFWIDTH KATAKANA LETTER NA
+0xC6	U+FF86	# HALFWIDTH KATAKANA LETTER NI
+0xC7	U+FF87	# HALFWIDTH KATAKANA LETTER NU
+0xC8	U+FF88	# HALFWIDTH KATAKANA LETTER NE
+0xC9	U+FF89	# HALFWIDTH KATAKANA LETTER NO
+0xCA	U+FF8A	# HALFWIDTH KATAKANA LETTER HA
+0xCB	U+FF8B	# HALFWIDTH KATAKANA LETTER HI
+0xCC	U+FF8C	# HALFWIDTH KATAKANA LETTER HU
+0xCD	U+FF8D	# HALFWIDTH KATAKANA LETTER HE
+0xCE	U+FF8E	# HALFWIDTH KATAKANA LETTER HO
+0xCF	U+FF8F	# HALFWIDTH KATAKANA LETTER MA
+0xD0	U+FF90	# HALFWIDTH KATAKANA LETTER MI
+0xD1	U+FF91	# HALFWIDTH KATAKANA LETTER MU
+0xD2	U+FF92	# HALFWIDTH KATAKANA LETTER ME
+0xD3	U+FF93	# HALFWIDTH KATAKANA LETTER MO
+0xD4	U+FF94	# HALFWIDTH KATAKANA LETTER YA
+0xD5	U+FF95	# HALFWIDTH KATAKANA LETTER YU
+0xD6	U+FF96	# HALFWIDTH KATAKANA LETTER YO
+0xD7	U+FF97	# HALFWIDTH KATAKANA LETTER RA
+0xD8	U+FF98	# HALFWIDTH KATAKANA LETTER RI
+0xD9	U+FF99	# HALFWIDTH KATAKANA LETTER RU
+0xDA	U+FF9A	# HALFWIDTH KATAKANA LETTER RE
+0xDB	U+FF9B	# HALFWIDTH KATAKANA LETTER RO
+0xDC	U+FF9C	# HALFWIDTH KATAKANA LETTER WA
+0xDD	U+FF9D	# HALFWIDTH KATAKANA LETTER N
+0xDE	U+FF9E	# HALFWIDTH KATAKANA VOICED SOUND MARK
+0xDF	U+FF9F	# HALFWIDTH KATAKANA SEMI-VOICED SOUND MARK
+#
+#  sjis0213    
+#
+0x8140	U+3000	# IDEOGRAPHIC SPACE
+0x8141	U+3001	# IDEOGRAPHIC COMMA
+0x8142	U+3002	# IDEOGRAPHIC FULL STOP
+0x8143	U+FF0C	# FULLWIDTH COMMA
+0x8144	U+FF0E	# FULLWIDTH FULL STOP
+0x8145	U+30FB	# KATAKANA MIDDLE DOT
+0x8146	U+FF1A	# FULLWIDTH COLON
+0x8147	U+FF1B	# FULLWIDTH SEMICOLON
+0x8148	U+FF1F	# FULLWIDTH QUESTION MARK
+0x8149	U+FF01	# FULLWIDTH EXCLAMATION MARK
+0x814A	U+309B	# KATAKANA-HIRAGANA VOICED SOUND MARK
+0x814B	U+309C	# KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK
+0x814C	U+00B4	# ACUTE ACCENT
+0x814D	U+FF40	# FULLWIDTH GRAVE ACCENT
+0x814E	U+00A8	# DIAERESIS
+0x814F	U+FF3E	# FULLWIDTH CIRCUMFLEX ACCENT
+0x8150	U+FFE3	# FULLWIDTH MACRON 
+0x8151	U+FF3F	# FULLWIDTH LOW LINE
+0x8152	U+30FD	# KATAKANA ITERATION MARK
+0x8153	U+30FE	# KATAKANA VOICED ITERATION MARK
+0x8154	U+309D	# HIRAGANA ITERATION MARK
+0x8155	U+309E	# HIRAGANA VOICED ITERATION MARK
+0x8156	U+3003	# DITTO MARK
+0x8157	U+4EDD	# <cjk>
+0x8158	U+3005	# IDEOGRAPHIC ITERATION MARK
+0x8159	U+3006	# IDEOGRAPHIC CLOSING MARK
+0x815A	U+3007	# IDEOGRAPHIC NUMBER ZERO
+0x815B	U+30FC	# KATAKANA-HIRAGANA PROLONGED SOUND MARK
+0x815C	U+2014	# EM DASH	Windows: U+2015
+0x815D	U+2010	# HYPHEN
+0x815E	U+FF0F	# FULLWIDTH SOLIDUS
+#0x815F	U+005C	# REVERSE SOLIDUS	Fullwidth: U+FF3C
+0x815F	U+FF3C	# REVERSE SOLIDUS	Fullwidth: U+FF3C
+0x8160	U+301C	# WAVE DASH	Windows: U+FF5E
+0x8161	U+2016	# DOUBLE VERTICAL LINE	Windows: U+2225
+0x8162	U+FF5C	# FULLWIDTH VERTICAL LINE
+0x8163	U+2026	# HORIZONTAL ELLIPSIS
+0x8164	U+2025	# TWO DOT LEADER
+0x8165	U+2018	# LEFT SINGLE QUOTATION MARK
+0x8166	U+2019	# RIGHT SINGLE QUOTATION MARK
+0x8167	U+201C	# LEFT DOUBLE QUOTATION MARK
+0x8168	U+201D	# RIGHT DOUBLE QUOTATION MARK
+0x8169	U+FF08	# FULLWIDTH LEFT PARENTHESIS
+0x816A	U+FF09	# FULLWIDTH RIGHT PARENTHESIS
+0x816B	U+3014	# LEFT TORTOISE SHELL BRACKET
+0x816C	U+3015	# RIGHT TORTOISE SHELL BRACKET
+0x816D	U+FF3B	# FULLWIDTH LEFT SQUARE BRACKET
+0x816E	U+FF3D	# FULLWIDTH RIGHT SQUARE BRACKET
+0x816F	U+FF5B	# FULLWIDTH LEFT CURLY BRACKET
+0x8170	U+FF5D	# FULLWIDTH RIGHT CURLY BRACKET
+0x8171	U+3008	# LEFT ANGLE BRACKET
+0x8172	U+3009	# RIGHT ANGLE BRACKET
+0x8173	U+300A	# LEFT DOUBLE ANGLE BRACKET
+0x8174	U+300B	# RIGHT DOUBLE ANGLE BRACKET
+0x8175	U+300C	# LEFT CORNER BRACKET
+0x8176	U+300D	# RIGHT CORNER BRACKET
+0x8177	U+300E	# LEFT WHITE CORNER BRACKET
+0x8178	U+300F	# RIGHT WHITE CORNER BRACKET
+0x8179	U+3010	# LEFT BLACK LENTICULAR BRACKET
+0x817A	U+3011	# RIGHT BLACK LENTICULAR BRACKET
+0x817B	U+FF0B	# FULLWIDTH PLUS SIGN
+0x817C	U+2212	# MINUS SIGN	Windows: U+FF0D
+0x817D	U+00B1	# PLUS-MINUS SIGN
+0x817E	U+00D7	# MULTIPLICATION SIGN
+0x8180	U+00F7	# DIVISION SIGN
+0x8181	U+FF1D	# FULLWIDTH EQUALS SIGN
+0x8182	U+2260	# NOT EQUAL TO
+0x8183	U+FF1C	# FULLWIDTH LESS-THAN SIGN
+0x8184	U+FF1E	# FULLWIDTH GREATER-THAN SIGN
+0x8185	U+2266	# LESS-THAN OVER EQUAL TO
+0x8186	U+2267	# GREATER-THAN OVER EQUAL TO
+0x8187	U+221E	# INFINITY
+0x8188	U+2234	# THEREFORE
+0x8189	U+2642	# MALE SIGN
+0x818A	U+2640	# FEMALE SIGN
+0x818B	U+00B0	# DEGREE SIGN
+0x818C	U+2032	# PRIME
+0x818D	U+2033	# DOUBLE PRIME
+0x818E	U+2103	# DEGREE CELSIUS
+0x818F	U+FFE5	# FULLWIDTH YEN SIGN
+0x8190	U+FF04	# FULLWIDTH DOLLAR SIGN
+0x8191	U+00A2	# CENT SIGN	Windows: U+FFE0
+0x8192	U+00A3	# POUND SIGN	Windows: U+FFE1
+0x8193	U+FF05	# FULLWIDTH PERCENT SIGN
+0x8194	U+FF03	# FULLWIDTH NUMBER SIGN
+0x8195	U+FF06	# FULLWIDTH AMPERSAND
+0x8196	U+FF0A	# FULLWIDTH ASTERISK
+0x8197	U+FF20	# FULLWIDTH COMMERCIAL AT
+0x8198	U+00A7	# SECTION SIGN
+0x8199	U+2606	# WHITE STAR
+0x819A	U+2605	# BLACK STAR
+0x819B	U+25CB	# WHITE CIRCLE
+0x819C	U+25CF	# BLACK CIRCLE
+0x819D	U+25CE	# BULLSEYE
+0x819E	U+25C7	# WHITE DIAMOND
+0x819F	U+25C6	# BLACK DIAMOND
+0x81A0	U+25A1	# WHITE SQUARE
+0x81A1	U+25A0	# BLACK SQUARE
+0x81A2	U+25B3	# WHITE UP-POINTING TRIANGLE
+0x81A3	U+25B2	# BLACK UP-POINTING TRIANGLE
+0x81A4	U+25BD	# WHITE DOWN-POINTING TRIANGLE
+0x81A5	U+25BC	# BLACK DOWN-POINTING TRIANGLE
+0x81A6	U+203B	# REFERENCE MARK
+0x81A7	U+3012	# POSTAL MARK
+0x81A8	U+2192	# RIGHTWARDS ARROW
+0x81A9	U+2190	# LEFTWARDS ARROW
+0x81AA	U+2191	# UPWARDS ARROW
+0x81AB	U+2193	# DOWNWARDS ARROW
+0x81AC	U+3013	# GETA MARK
+0x81AD	U+FF07	# FULLWIDTH APOSTROPHE
+0x81AE	U+FF02	# FULLWIDTH QUOTATION MARK	[2000]
+0x81AF	U+FF0D	# FULLWIDTH HYPHEN-MINUS	[2000]
+#0x81B0	U+007E	# TILDE	[2000]	Fullwidth: U+FF5E
+0x81B0	U+FF5E	# TILDE	[2000]	Fullwidth: U+FF5E
+0x81B1	U+3033	# VERTICAL KANA REPEAT MARK UPPER HALF	[2000]
+0x81B2	U+3034	# VERTICAL KANA REPEAT WITH VOICED SOUND MARK UPPER HALF	[2000]
+0x81B3	U+3035	# VERTICAL KANA REPEAT MARK LOWER HALF	[2000]
+0x81B4	U+303B	# VERTICAL IDEOGRAPHIC ITERATION MARK	[2000]	[Unicode3.2]
+0x81B5	U+303C	# MASU MARK	[2000]	[Unicode3.2]
+0x81B6	U+30FF	# KATAKANA DIGRAPH KOTO	[2000]	[Unicode3.2]
+0x81B7	U+309F	# HIRAGANA DIGRAPH YORI	[2000]	[Unicode3.2]
+0x81B8	U+2208	# ELEMENT OF	[1983]
+0x81B9	U+220B	# CONTAINS AS MEMBER	[1983]
+0x81BA	U+2286	# SUBSET OF OR EQUAL TO	[1983]
+0x81BB	U+2287	# SUPERSET OF OR EQUAL TO	[1983]
+0x81BC	U+2282	# SUBSET OF	[1983]
+0x81BD	U+2283	# SUPERSET OF	[1983]
+0x81BE	U+222A	# UNION	[1983]
+0x81BF	U+2229	# INTERSECTION	[1983]
+0x81C0	U+2284	# NOT A SUBSET OF	[2000]
+0x81C1	U+2285	# NOT A SUPERSET OF	[2000]
+0x81C2	U+228A	# SUBSET OF WITH NOT EQUAL TO	[2000]
+0x81C3	U+228B	# SUPERSET OF WITH NOT EQUAL TO	[2000]
+0x81C4	U+2209	# NOT AN ELEMENT OF	[2000]
+0x81C5	U+2205	# EMPTY SET	[2000]
+0x81C6	U+2305	# PROJECTIVE	[2000]
+0x81C7	U+2306	# PERSPECTIVE	[2000]
+0x81C8	U+2227	# LOGICAL AND	[1983]
+0x81C9	U+2228	# LOGICAL OR	[1983]
+0x81CA	U+00AC	# NOT SIGN	[1983]	Windows: U+FFE2
+0x81CB	U+21D2	# RIGHTWARDS DOUBLE ARROW	[1983]
+0x81CC	U+21D4	# LEFT RIGHT DOUBLE ARROW	[1983]
+0x81CD	U+2200	# FOR ALL	[1983]
+0x81CE	U+2203	# THERE EXISTS	[1983]
+0x81CF	U+2295	# CIRCLED PLUS	[2000]
+0x81D0	U+2296	# CIRCLED MINUS	[2000]
+0x81D1	U+2297	# CIRCLED TIMES	[2000]
+0x81D2	U+2225	# PARALLEL TO	[2000]
+0x81D3	U+2226	# NOT PARALLEL TO	[2000]
+0x81D4	U+FF5F	# FULLWIDTH LEFT WHITE PARENTHESIS	[2000]	[Unicode3.2]
+0x81D5	U+FF60	# FULLWIDTH RIGHT WHITE PARENTHESIS	[2000]	[Unicode3.2]
+0x81D6	U+3018	# LEFT WHITE TORTOISE SHELL BRACKET	[2000]
+0x81D7	U+3019	# RIGHT WHITE TORTOISE SHELL BRACKET	[2000]
+0x81D8	U+3016	# LEFT WHITE LENTICULAR BRACKET	[2000]
+0x81D9	U+3017	# RIGHT WHITE LENTICULAR BRACKET	[2000]
+0x81DA	U+2220	# ANGLE	[1983]
+0x81DB	U+22A5	# UP TACK	[1983]
+0x81DC	U+2312	# ARC	[1983]
+0x81DD	U+2202	# PARTIAL DIFFERENTIAL	[1983]
+0x81DE	U+2207	# NABLA	[1983]
+0x81DF	U+2261	# IDENTICAL TO	[1983]
+0x81E0	U+2252	# APPROXIMATELY EQUAL TO OR THE IMAGE OF	[1983]
+0x81E1	U+226A	# MUCH LESS-THAN	[1983]
+0x81E2	U+226B	# MUCH GREATER-THAN	[1983]
+0x81E3	U+221A	# SQUARE ROOT	[1983]
+0x81E4	U+223D	# REVERSED TILDE 	[1983]
+0x81E5	U+221D	# PROPORTIONAL TO	[1983]
+0x81E6	U+2235	# BECAUSE	[1983]
+0x81E7	U+222B	# INTEGRAL	[1983]
+0x81E8	U+222C	# DOUBLE INTEGRAL	[1983]
+0x81E9	U+2262	# NOT IDENTICAL TO	[2000]
+0x81EA	U+2243	# ASYMPTOTICALLY EQUAL TO	[2000]
+0x81EB	U+2245	# APPROXIMATELY EQUAL TO	[2000]
+0x81EC	U+2248	# ALMOST EQUAL TO	[2000]
+0x81ED	U+2276	# LESS-THAN OR GREATER-THAN	[2000]
+0x81EE	U+2277	# GREATER-THAN OR LESS-THAN	[2000]
+0x81EF	U+2194	# LEFT RIGHT ARROW	[2000]
+0x81F0	U+212B	# ANGSTROM SIGN	[1983]
+0x81F1	U+2030	# PER MILLE SIGN	[1983]
+0x81F2	U+266F	# MUSIC SHARP SIGN	[1983]
+0x81F3	U+266D	# MUSIC FLAT SIGN	[1983]
+0x81F4	U+266A	# EIGHTH NOTE	[1983]
+0x81F5	U+2020	# DAGGER	[1983]
+0x81F6	U+2021	# DOUBLE DAGGER	[1983]
+0x81F7	U+00B6	# PILCROW SIGN	[1983]
+0x81F8	U+266E	# MUSIC NATURAL SIGN	[2000]
+0x81F9	U+266B	# BEAMED EIGHTH NOTES	[2000]
+0x81FA	U+266C	# BEAMED SIXTEENTH NOTES	[2000]
+0x81FB	U+2669	# QUARTER NOTE	[2000]
+0x81FC	U+25EF	# LARGE CIRCLE	[1983]
+0x8240	U+25B7	# WHITE RIGHT-POINTING TRIANGLE	[2000]
+0x8241	U+25B6	# BLACK RIGHT-POINTING TRIANGLE	[2000]
+0x8242	U+25C1	# WHITE LEFT-POINTING TRIANGLE	[2000]
+0x8243	U+25C0	# BLACK LEFT-POINTING TRIANGLE	[2000]
+0x8244	U+2197	# NORTH EAST ARROW	[2000]
+0x8245	U+2198	# SOUTH EAST ARROW	[2000]
+0x8246	U+2196	# NORTH WEST ARROW	[2000]
+0x8247	U+2199	# SOUTH WEST ARROW	[2000]
+0x8248	U+21C4	# RIGHTWARDS ARROW OVER LEFTWARDS ARROW	[2000]
+0x8249	U+21E8	# RIGHTWARDS WHITE ARROW	[2000]
+0x824A	U+21E6	# LEFTWARDS WHITE ARROW	[2000]
+0x824B	U+21E7	# UPWARDS WHITE ARROW	[2000]
+0x824C	U+21E9	# DOWNWARDS WHITE ARROW	[2000]
+0x824D	U+2934	# ARROW POINTING RIGHTWARDS THEN CURVING UPWARDS	[2000]	[Unicode3.2]
+0x824E	U+2935	# ARROW POINTING RIGHTWARDS THEN CURVING DOWNWARDS	[2000]	[Unicode3.2]
+0x824F	U+FF10	# FULLWIDTH DIGIT ZERO
+0x8250	U+FF11	# FULLWIDTH DIGIT ONE
+0x8251	U+FF12	# FULLWIDTH DIGIT TWO
+0x8252	U+FF13	# FULLWIDTH DIGIT THREE
+0x8253	U+FF14	# FULLWIDTH DIGIT FOUR
+0x8254	U+FF15	# FULLWIDTH DIGIT FIVE
+0x8255	U+FF16	# FULLWIDTH DIGIT SIX
+0x8256	U+FF17	# FULLWIDTH DIGIT SEVEN
+0x8257	U+FF18	# FULLWIDTH DIGIT EIGHT
+0x8258	U+FF19	# FULLWIDTH DIGIT NINE
+0x8259	U+29BF	# CIRCLED BULLET	[2000]	[Unicode3.2]
+0x825A	U+25C9	# FISHEYE	[2000]
+0x825B	U+303D	# PART ALTERNATION MARK	[2000]	[Unicode3.2]
+0x825C	U+FE46	# WHITE SESAME DOT	[2000]	[Unicode3.2]
+0x825D	U+FE45	# SESAME DOT	[2000]	[Unicode3.2]
+0x825E	U+25E6	# WHITE BULLET	[2000]
+0x825F	U+2022	# BULLET	[2000]
+0x8260	U+FF21	# FULLWIDTH LATIN CAPITAL LETTER A
+0x8261	U+FF22	# FULLWIDTH LATIN CAPITAL LETTER B
+0x8262	U+FF23	# FULLWIDTH LATIN CAPITAL LETTER C
+0x8263	U+FF24	# FULLWIDTH LATIN CAPITAL LETTER D
+0x8264	U+FF25	# FULLWIDTH LATIN CAPITAL LETTER E
+0x8265	U+FF26	# FULLWIDTH LATIN CAPITAL LETTER F
+0x8266	U+FF27	# FULLWIDTH LATIN CAPITAL LETTER G
+0x8267	U+FF28	# FULLWIDTH LATIN CAPITAL LETTER H
+0x8268	U+FF29	# FULLWIDTH LATIN CAPITAL LETTER I
+0x8269	U+FF2A	# FULLWIDTH LATIN CAPITAL LETTER J
+0x826A	U+FF2B	# FULLWIDTH LATIN CAPITAL LETTER K
+0x826B	U+FF2C	# FULLWIDTH LATIN CAPITAL LETTER L
+0x826C	U+FF2D	# FULLWIDTH LATIN CAPITAL LETTER M
+0x826D	U+FF2E	# FULLWIDTH LATIN CAPITAL LETTER N
+0x826E	U+FF2F	# FULLWIDTH LATIN CAPITAL LETTER O
+0x826F	U+FF30	# FULLWIDTH LATIN CAPITAL LETTER P
+0x8270	U+FF31	# FULLWIDTH LATIN CAPITAL LETTER Q
+0x8271	U+FF32	# FULLWIDTH LATIN CAPITAL LETTER R
+0x8272	U+FF33	# FULLWIDTH LATIN CAPITAL LETTER S
+0x8273	U+FF34	# FULLWIDTH LATIN CAPITAL LETTER T
+0x8274	U+FF35	# FULLWIDTH LATIN CAPITAL LETTER U
+0x8275	U+FF36	# FULLWIDTH LATIN CAPITAL LETTER V
+0x8276	U+FF37	# FULLWIDTH LATIN CAPITAL LETTER W
+0x8277	U+FF38	# FULLWIDTH LATIN CAPITAL LETTER X
+0x8278	U+FF39	# FULLWIDTH LATIN CAPITAL LETTER Y
+0x8279	U+FF3A	# FULLWIDTH LATIN CAPITAL LETTER Z
+0x827A	U+2213	# MINUS-OR-PLUS SIGN	[2000]
+0x827B	U+2135	# ALEF SYMBOL	[2000]
+0x827C	U+210F	# PLANCK CONSTANT OVER TWO PI	[2000]
+0x827D	U+33CB	# SQUARE HP	[2000]
+0x827E	U+2113	# SCRIPT SMALL L	[2000]
+0x8280	U+2127	# INVERTED OHM SIGN	[2000]
+0x8281	U+FF41	# FULLWIDTH LATIN SMALL LETTER A
+0x8282	U+FF42	# FULLWIDTH LATIN SMALL LETTER B
+0x8283	U+FF43	# FULLWIDTH LATIN SMALL LETTER C
+0x8284	U+FF44	# FULLWIDTH LATIN SMALL LETTER D
+0x8285	U+FF45	# FULLWIDTH LATIN SMALL LETTER E
+0x8286	U+FF46	# FULLWIDTH LATIN SMALL LETTER F
+0x8287	U+FF47	# FULLWIDTH LATIN SMALL LETTER G
+0x8288	U+FF48	# FULLWIDTH LATIN SMALL LETTER H
+0x8289	U+FF49	# FULLWIDTH LATIN SMALL LETTER I
+0x828A	U+FF4A	# FULLWIDTH LATIN SMALL LETTER J
+0x828B	U+FF4B	# FULLWIDTH LATIN SMALL LETTER K
+0x828C	U+FF4C	# FULLWIDTH LATIN SMALL LETTER L
+0x828D	U+FF4D	# FULLWIDTH LATIN SMALL LETTER M
+0x828E	U+FF4E	# FULLWIDTH LATIN SMALL LETTER N
+0x828F	U+FF4F	# FULLWIDTH LATIN SMALL LETTER O
+0x8290	U+FF50	# FULLWIDTH LATIN SMALL LETTER P
+0x8291	U+FF51	# FULLWIDTH LATIN SMALL LETTER Q
+0x8292	U+FF52	# FULLWIDTH LATIN SMALL LETTER R
+0x8293	U+FF53	# FULLWIDTH LATIN SMALL LETTER S
+0x8294	U+FF54	# FULLWIDTH LATIN SMALL LETTER T
+0x8295	U+FF55	# FULLWIDTH LATIN SMALL LETTER U
+0x8296	U+FF56	# FULLWIDTH LATIN SMALL LETTER V
+0x8297	U+FF57	# FULLWIDTH LATIN SMALL LETTER W
+0x8298	U+FF58	# FULLWIDTH LATIN SMALL LETTER X
+0x8299	U+FF59	# FULLWIDTH LATIN SMALL LETTER Y
+0x829A	U+FF5A	# FULLWIDTH LATIN SMALL LETTER Z
+0x829B	U+30A0	# KATAKANA-HIRAGANA DOUBLE HYPHEN	[2000]	[Unicode3.2]
+0x829C	U+2013	# EN DASH	[2000]
+0x829D	U+29FA	# DOUBLE PLUS	[2000]	[Unicode3.2]
+0x829E	U+29FB	# TRIPLE PLUS	[2000]	[Unicode3.2]
+0x829F	U+3041	# HIRAGANA LETTER SMALL A
+0x82A0	U+3042	# HIRAGANA LETTER A
+0x82A1	U+3043	# HIRAGANA LETTER SMALL I
+0x82A2	U+3044	# HIRAGANA LETTER I
+0x82A3	U+3045	# HIRAGANA LETTER SMALL U
+0x82A4	U+3046	# HIRAGANA LETTER U
+0x82A5	U+3047	# HIRAGANA LETTER SMALL E
+0x82A6	U+3048	# HIRAGANA LETTER E
+0x82A7	U+3049	# HIRAGANA LETTER SMALL O
+0x82A8	U+304A	# HIRAGANA LETTER O
+0x82A9	U+304B	# HIRAGANA LETTER KA
+0x82AA	U+304C	# HIRAGANA LETTER GA
+0x82AB	U+304D	# HIRAGANA LETTER KI
+0x82AC	U+304E	# HIRAGANA LETTER GI
+0x82AD	U+304F	# HIRAGANA LETTER KU
+0x82AE	U+3050	# HIRAGANA LETTER GU
+0x82AF	U+3051	# HIRAGANA LETTER KE
+0x82B0	U+3052	# HIRAGANA LETTER GE
+0x82B1	U+3053	# HIRAGANA LETTER KO
+0x82B2	U+3054	# HIRAGANA LETTER GO
+0x82B3	U+3055	# HIRAGANA LETTER SA
+0x82B4	U+3056	# HIRAGANA LETTER ZA
+0x82B5	U+3057	# HIRAGANA LETTER SI
+0x82B6	U+3058	# HIRAGANA LETTER ZI
+0x82B7	U+3059	# HIRAGANA LETTER SU
+0x82B8	U+305A	# HIRAGANA LETTER ZU
+0x82B9	U+305B	# HIRAGANA LETTER SE
+0x82BA	U+305C	# HIRAGANA LETTER ZE
+0x82BB	U+305D	# HIRAGANA LETTER SO
+0x82BC	U+305E	# HIRAGANA LETTER ZO
+0x82BD	U+305F	# HIRAGANA LETTER TA
+0x82BE	U+3060	# HIRAGANA LETTER DA
+0x82BF	U+3061	# HIRAGANA LETTER TI
+0x82C0	U+3062	# HIRAGANA LETTER DI
+0x82C1	U+3063	# HIRAGANA LETTER SMALL TU
+0x82C2	U+3064	# HIRAGANA LETTER TU
+0x82C3	U+3065	# HIRAGANA LETTER DU
+0x82C4	U+3066	# HIRAGANA LETTER TE
+0x82C5	U+3067	# HIRAGANA LETTER DE
+0x82C6	U+3068	# HIRAGANA LETTER TO
+0x82C7	U+3069	# HIRAGANA LETTER DO
+0x82C8	U+306A	# HIRAGANA LETTER NA
+0x82C9	U+306B	# HIRAGANA LETTER NI
+0x82CA	U+306C	# HIRAGANA LETTER NU
+0x82CB	U+306D	# HIRAGANA LETTER NE
+0x82CC	U+306E	# HIRAGANA LETTER NO
+0x82CD	U+306F	# HIRAGANA LETTER HA
+0x82CE	U+3070	# HIRAGANA LETTER BA
+0x82CF	U+3071	# HIRAGANA LETTER PA
+0x82D0	U+3072	# HIRAGANA LETTER HI
+0x82D1	U+3073	# HIRAGANA LETTER BI
+0x82D2	U+3074	# HIRAGANA LETTER PI
+0x82D3	U+3075	# HIRAGANA LETTER HU
+0x82D4	U+3076	# HIRAGANA LETTER BU
+0x82D5	U+3077	# HIRAGANA LETTER PU
+0x82D6	U+3078	# HIRAGANA LETTER HE
+0x82D7	U+3079	# HIRAGANA LETTER BE
+0x82D8	U+307A	# HIRAGANA LETTER PE
+0x82D9	U+307B	# HIRAGANA LETTER HO
+0x82DA	U+307C	# HIRAGANA LETTER BO
+0x82DB	U+307D	# HIRAGANA LETTER PO
+0x82DC	U+307E	# HIRAGANA LETTER MA
+0x82DD	U+307F	# HIRAGANA LETTER MI
+0x82DE	U+3080	# HIRAGANA LETTER MU
+0x82DF	U+3081	# HIRAGANA LETTER ME
+0x82E0	U+3082	# HIRAGANA LETTER MO
+0x82E1	U+3083	# HIRAGANA LETTER SMALL YA
+0x82E2	U+3084	# HIRAGANA LETTER YA
+0x82E3	U+3085	# HIRAGANA LETTER SMALL YU
+0x82E4	U+3086	# HIRAGANA LETTER YU
+0x82E5	U+3087	# HIRAGANA LETTER SMALL YO
+0x82E6	U+3088	# HIRAGANA LETTER YO
+0x82E7	U+3089	# HIRAGANA LETTER RA
+0x82E8	U+308A	# HIRAGANA LETTER RI
+0x82E9	U+308B	# HIRAGANA LETTER RU
+0x82EA	U+308C	# HIRAGANA LETTER RE
+0x82EB	U+308D	# HIRAGANA LETTER RO
+0x82EC	U+308E	# HIRAGANA LETTER SMALL WA
+0x82ED	U+308F	# HIRAGANA LETTER WA
+0x82EE	U+3090	# HIRAGANA LETTER WI
+0x82EF	U+3091	# HIRAGANA LETTER WE
+0x82F0	U+3092	# HIRAGANA LETTER WO
+0x82F1	U+3093	# HIRAGANA LETTER N
+0x82F2	U+3094	# HIRAGANA LETTER VU	[2000]
+0x82F3	U+3095	# HIRAGANA LETTER SMALL KA	[2000]	[Unicode3.2]
+0x82F4	U+3096	# HIRAGANA LETTER SMALL KE	[2000]	[Unicode3.2]
+0x82F5	U+304B+309A	# 	[2000]
+0x82F6	U+304D+309A	# 	[2000]
+0x82F7	U+304F+309A	# 	[2000]
+0x82F8	U+3051+309A	# 	[2000]
+0x82F9	U+3053+309A	# 	[2000]
+0x82FA		# <reserved>
+0x82FB		# <reserved>
+0x82FC		# <reserved>
+0x8340	U+30A1	# KATAKANA LETTER SMALL A
+0x8341	U+30A2	# KATAKANA LETTER A
+0x8342	U+30A3	# KATAKANA LETTER SMALL I
+0x8343	U+30A4	# KATAKANA LETTER I
+0x8344	U+30A5	# KATAKANA LETTER SMALL U
+0x8345	U+30A6	# KATAKANA LETTER U
+0x8346	U+30A7	# KATAKANA LETTER SMALL E
+0x8347	U+30A8	# KATAKANA LETTER E
+0x8348	U+30A9	# KATAKANA LETTER SMALL O
+0x8349	U+30AA	# KATAKANA LETTER O
+0x834A	U+30AB	# KATAKANA LETTER KA
+0x834B	U+30AC	# KATAKANA LETTER GA
+0x834C	U+30AD	# KATAKANA LETTER KI
+0x834D	U+30AE	# KATAKANA LETTER GI
+0x834E	U+30AF	# KATAKANA LETTER KU
+0x834F	U+30B0	# KATAKANA LETTER GU
+0x8350	U+30B1	# KATAKANA LETTER KE
+0x8351	U+30B2	# KATAKANA LETTER GE
+0x8352	U+30B3	# KATAKANA LETTER KO
+0x8353	U+30B4	# KATAKANA LETTER GO
+0x8354	U+30B5	# KATAKANA LETTER SA
+0x8355	U+30B6	# KATAKANA LETTER ZA
+0x8356	U+30B7	# KATAKANA LETTER SI
+0x8357	U+30B8	# KATAKANA LETTER ZI
+0x8358	U+30B9	# KATAKANA LETTER SU
+0x8359	U+30BA	# KATAKANA LETTER ZU
+0x835A	U+30BB	# KATAKANA LETTER SE
+0x835B	U+30BC	# KATAKANA LETTER ZE
+0x835C	U+30BD	# KATAKANA LETTER SO
+0x835D	U+30BE	# KATAKANA LETTER ZO
+0x835E	U+30BF	# KATAKANA LETTER TA
+0x835F	U+30C0	# KATAKANA LETTER DA
+0x8360	U+30C1	# KATAKANA LETTER TI
+0x8361	U+30C2	# KATAKANA LETTER DI
+0x8362	U+30C3	# KATAKANA LETTER SMALL TU
+0x8363	U+30C4	# KATAKANA LETTER TU
+0x8364	U+30C5	# KATAKANA LETTER DU
+0x8365	U+30C6	# KATAKANA LETTER TE
+0x8366	U+30C7	# KATAKANA LETTER DE
+0x8367	U+30C8	# KATAKANA LETTER TO
+0x8368	U+30C9	# KATAKANA LETTER DO
+0x8369	U+30CA	# KATAKANA LETTER NA
+0x836A	U+30CB	# KATAKANA LETTER NI
+0x836B	U+30CC	# KATAKANA LETTER NU
+0x836C	U+30CD	# KATAKANA LETTER NE
+0x836D	U+30CE	# KATAKANA LETTER NO
+0x836E	U+30CF	# KATAKANA LETTER HA
+0x836F	U+30D0	# KATAKANA LETTER BA
+0x8370	U+30D1	# KATAKANA LETTER PA
+0x8371	U+30D2	# KATAKANA LETTER HI
+0x8372	U+30D3	# KATAKANA LETTER BI
+0x8373	U+30D4	# KATAKANA LETTER PI
+0x8374	U+30D5	# KATAKANA LETTER HU
+0x8375	U+30D6	# KATAKANA LETTER BU
+0x8376	U+30D7	# KATAKANA LETTER PU
+0x8377	U+30D8	# KATAKANA LETTER HE
+0x8378	U+30D9	# KATAKANA LETTER BE
+0x8379	U+30DA	# KATAKANA LETTER PE
+0x837A	U+30DB	# KATAKANA LETTER HO
+0x837B	U+30DC	# KATAKANA LETTER BO
+0x837C	U+30DD	# KATAKANA LETTER PO
+0x837D	U+30DE	# KATAKANA LETTER MA
+0x837E	U+30DF	# KATAKANA LETTER MI
+0x8380	U+30E0	# KATAKANA LETTER MU
+0x8381	U+30E1	# KATAKANA LETTER ME
+0x8382	U+30E2	# KATAKANA LETTER MO
+0x8383	U+30E3	# KATAKANA LETTER SMALL YA
+0x8384	U+30E4	# KATAKANA LETTER YA
+0x8385	U+30E5	# KATAKANA LETTER SMALL YU
+0x8386	U+30E6	# KATAKANA LETTER YU
+0x8387	U+30E7	# KATAKANA LETTER SMALL YO
+0x8388	U+30E8	# KATAKANA LETTER YO
+0x8389	U+30E9	# KATAKANA LETTER RA
+0x838A	U+30EA	# KATAKANA LETTER RI
+0x838B	U+30EB	# KATAKANA LETTER RU
+0x838C	U+30EC	# KATAKANA LETTER RE
+0x838D	U+30ED	# KATAKANA LETTER RO
+0x838E	U+30EE	# KATAKANA LETTER SMALL WA
+0x838F	U+30EF	# KATAKANA LETTER WA
+0x8390	U+30F0	# KATAKANA LETTER WI
+0x8391	U+30F1	# KATAKANA LETTER WE
+0x8392	U+30F2	# KATAKANA LETTER WO
+0x8393	U+30F3	# KATAKANA LETTER N
+0x8394	U+30F4	# KATAKANA LETTER VU
+0x8395	U+30F5	# KATAKANA LETTER SMALL KA
+0x8396	U+30F6	# KATAKANA LETTER SMALL KE
+0x8397	U+30AB+309A	# 	[2000]
+0x8398	U+30AD+309A	# 	[2000]
+0x8399	U+30AF+309A	# 	[2000]
+0x839A	U+30B1+309A	# 	[2000]
+0x839B	U+30B3+309A	# 	[2000]
+0x839C	U+30BB+309A	# 	[2000]
+0x839D	U+30C4+309A	# 	[2000]
+0x839E	U+30C8+309A	# 	[2000]
+0x839F	U+0391	# GREEK CAPITAL LETTER ALPHA
+0x83A0	U+0392	# GREEK CAPITAL LETTER BETA
+0x83A1	U+0393	# GREEK CAPITAL LETTER GAMMA
+0x83A2	U+0394	# GREEK CAPITAL LETTER DELTA
+0x83A3	U+0395	# GREEK CAPITAL LETTER EPSILON
+0x83A4	U+0396	# GREEK CAPITAL LETTER ZETA
+0x83A5	U+0397	# GREEK CAPITAL LETTER ETA
+0x83A6	U+0398	# GREEK CAPITAL LETTER THETA
+0x83A7	U+0399	# GREEK CAPITAL LETTER IOTA
+0x83A8	U+039A	# GREEK CAPITAL LETTER KAPPA
+0x83A9	U+039B	# GREEK CAPITAL LETTER LAMDA
+0x83AA	U+039C	# GREEK CAPITAL LETTER MU
+0x83AB	U+039D	# GREEK CAPITAL LETTER NU
+0x83AC	U+039E	# GREEK CAPITAL LETTER XI
+0x83AD	U+039F	# GREEK CAPITAL LETTER OMICRON
+0x83AE	U+03A0	# GREEK CAPITAL LETTER PI
+0x83AF	U+03A1	# GREEK CAPITAL LETTER RHO
+0x83B0	U+03A3	# GREEK CAPITAL LETTER SIGMA
+0x83B1	U+03A4	# GREEK CAPITAL LETTER TAU
+0x83B2	U+03A5	# GREEK CAPITAL LETTER UPSILON
+0x83B3	U+03A6	# GREEK CAPITAL LETTER PHI
+0x83B4	U+03A7	# GREEK CAPITAL LETTER CHI
+0x83B5	U+03A8	# GREEK CAPITAL LETTER PSI
+0x83B6	U+03A9	# GREEK CAPITAL LETTER OMEGA
+0x83B7	U+2664	# WHITE SPADE SUIT	[2000]
+0x83B8	U+2660	# BLACK SPADE SUIT	[2000]
+0x83B9	U+2662	# WHITE DIAMOND SUIT	[2000]
+0x83BA	U+2666	# BLACK DIAMOND SUIT	[2000]
+0x83BB	U+2661	# WHITE HEART SUIT	[2000]
+0x83BC	U+2665	# BLACK HEART SUIT	[2000]
+0x83BD	U+2667	# WHITE CLUB SUIT	[2000]
+0x83BE	U+2663	# BLACK CLUB SUIT	[2000]
+0x83BF	U+03B1	# GREEK SMALL LETTER ALPHA
+0x83C0	U+03B2	# GREEK SMALL LETTER BETA
+0x83C1	U+03B3	# GREEK SMALL LETTER GAMMA
+0x83C2	U+03B4	# GREEK SMALL LETTER DELTA
+0x83C3	U+03B5	# GREEK SMALL LETTER EPSILON
+0x83C4	U+03B6	# GREEK SMALL LETTER ZETA
+0x83C5	U+03B7	# GREEK SMALL LETTER ETA
+0x83C6	U+03B8	# GREEK SMALL LETTER THETA
+0x83C7	U+03B9	# GREEK SMALL LETTER IOTA
+0x83C8	U+03BA	# GREEK SMALL LETTER KAPPA
+0x83C9	U+03BB	# GREEK SMALL LETTER LAMDA
+0x83CA	U+03BC	# GREEK SMALL LETTER MU
+0x83CB	U+03BD	# GREEK SMALL LETTER NU
+0x83CC	U+03BE	# GREEK SMALL LETTER XI
+0x83CD	U+03BF	# GREEK SMALL LETTER OMICRON
+0x83CE	U+03C0	# GREEK SMALL LETTER PI
+0x83CF	U+03C1	# GREEK SMALL LETTER RHO
+0x83D0	U+03C3	# GREEK SMALL LETTER SIGMA
+0x83D1	U+03C4	# GREEK SMALL LETTER TAU
+0x83D2	U+03C5	# GREEK SMALL LETTER UPSILON
+0x83D3	U+03C6	# GREEK SMALL LETTER PHI
+0x83D4	U+03C7	# GREEK SMALL LETTER CHI
+0x83D5	U+03C8	# GREEK SMALL LETTER PSI
+0x83D6	U+03C9	# GREEK SMALL LETTER OMEGA
+0x83D7	U+03C2	# GREEK SMALL LETTER FINAL SIGMA	[2000]
+0x83D8	U+24F5	# DOUBLE CIRCLED DIGIT ONE	[2000]	[Unicode3.2]
+0x83D9	U+24F6	# DOUBLE CIRCLED DIGIT TWO	[2000]	[Unicode3.2]
+0x83DA	U+24F7	# DOUBLE CIRCLED DIGIT THREE	[2000]	[Unicode3.2]
+0x83DB	U+24F8	# DOUBLE CIRCLED DIGIT FOUR	[2000]	[Unicode3.2]
+0x83DC	U+24F9	# DOUBLE CIRCLED DIGIT FIVE	[2000]	[Unicode3.2]
+0x83DD	U+24FA	# DOUBLE CIRCLED DIGIT SIX	[2000]	[Unicode3.2]
+0x83DE	U+24FB	# DOUBLE CIRCLED DIGIT SEVEN	[2000]	[Unicode3.2]
+0x83DF	U+24FC	# DOUBLE CIRCLED DIGIT EIGHT	[2000]	[Unicode3.2]
+0x83E0	U+24FD	# DOUBLE CIRCLED DIGIT NINE	[2000]	[Unicode3.2]
+0x83E1	U+24FE	# DOUBLE CIRCLED NUMBER TEN	[2000]	[Unicode3.2]
+0x83E2	U+2616	# WHITE SHOGI PIECE	[2000]	[Unicode3.2]
+0x83E3	U+2617	# BLACK SHOGI PIECE	[2000]	[Unicode3.2]
+0x83E4	U+3020	# POSTAL MARK FACE	[2000]
+0x83E5	U+260E	# BLACK TELEPHONE	[2000]
+0x83E6	U+2600	# BLACK SUN WITH RAYS	[2000]
+0x83E7	U+2601	# CLOUD	[2000]
+0x83E8	U+2602	# UMBRELLA	[2000]
+0x83E9	U+2603	# SNOWMAN	[2000]
+0x83EA	U+2668	# HOT SPRINGS	[2000]
+0x83EB	U+25B1	# WHITE PARALLELOGRAM	[2000]
+0x83EC	U+31F0	# KATAKANA LETTER SMALL KU	[2000]	[Unicode3.2]
+0x83ED	U+31F1	# KATAKANA LETTER SMALL SI	[2000]	[Unicode3.2]
+0x83EE	U+31F2	# KATAKANA LETTER SMALL SU	[2000]	[Unicode3.2]
+0x83EF	U+31F3	# KATAKANA LETTER SMALL TO	[2000]	[Unicode3.2]
+0x83F0	U+31F4	# KATAKANA LETTER SMALL NU	[2000]	[Unicode3.2]
+0x83F1	U+31F5	# KATAKANA LETTER SMALL HA	[2000]	[Unicode3.2]
+0x83F2	U+31F6	# KATAKANA LETTER SMALL HI	[2000]	[Unicode3.2]
+0x83F3	U+31F7	# KATAKANA LETTER SMALL HU	[2000]	[Unicode3.2]
+0x83F4	U+31F8	# KATAKANA LETTER SMALL HE	[2000]	[Unicode3.2]
+0x83F5	U+31F9	# KATAKANA LETTER SMALL HO	[2000]	[Unicode3.2]
+0x83F6	U+31F7+309A	# 	[2000]
+0x83F7	U+31FA	# KATAKANA LETTER SMALL MU	[2000]	[Unicode3.2]
+0x83F8	U+31FB	# KATAKANA LETTER SMALL RA	[2000]	[Unicode3.2]
+0x83F9	U+31FC	# KATAKANA LETTER SMALL RI	[2000]	[Unicode3.2]
+0x83FA	U+31FD	# KATAKANA LETTER SMALL RU	[2000]	[Unicode3.2]
+0x83FB	U+31FE	# KATAKANA LETTER SMALL RE	[2000]	[Unicode3.2]
+0x83FC	U+31FF	# KATAKANA LETTER SMALL RO	[2000]	[Unicode3.2]
+0x8440	U+0410	# CYRILLIC CAPITAL LETTER A
+0x8441	U+0411	# CYRILLIC CAPITAL LETTER BE
+0x8442	U+0412	# CYRILLIC CAPITAL LETTER VE
+0x8443	U+0413	# CYRILLIC CAPITAL LETTER GHE
+0x8444	U+0414	# CYRILLIC CAPITAL LETTER DE
+0x8445	U+0415	# CYRILLIC CAPITAL LETTER IE
+0x8446	U+0401	# CYRILLIC CAPITAL LETTER IO
+0x8447	U+0416	# CYRILLIC CAPITAL LETTER ZHE
+0x8448	U+0417	# CYRILLIC CAPITAL LETTER ZE
+0x8449	U+0418	# CYRILLIC CAPITAL LETTER I
+0x844A	U+0419	# CYRILLIC CAPITAL LETTER SHORT I
+0x844B	U+041A	# CYRILLIC CAPITAL LETTER KA
+0x844C	U+041B	# CYRILLIC CAPITAL LETTER EL
+0x844D	U+041C	# CYRILLIC CAPITAL LETTER EM
+0x844E	U+041D	# CYRILLIC CAPITAL LETTER EN
+0x844F	U+041E	# CYRILLIC CAPITAL LETTER O
+0x8450	U+041F	# CYRILLIC CAPITAL LETTER PE
+0x8451	U+0420	# CYRILLIC CAPITAL LETTER ER
+0x8452	U+0421	# CYRILLIC CAPITAL LETTER ES
+0x8453	U+0422	# CYRILLIC CAPITAL LETTER TE
+0x8454	U+0423	# CYRILLIC CAPITAL LETTER U
+0x8455	U+0424	# CYRILLIC CAPITAL LETTER EF
+0x8456	U+0425	# CYRILLIC CAPITAL LETTER HA
+0x8457	U+0426	# CYRILLIC CAPITAL LETTER TSE
+0x8458	U+0427	# CYRILLIC CAPITAL LETTER CHE
+0x8459	U+0428	# CYRILLIC CAPITAL LETTER SHA
+0x845A	U+0429	# CYRILLIC CAPITAL LETTER SHCHA
+0x845B	U+042A	# CYRILLIC CAPITAL LETTER HARD SIGN
+0x845C	U+042B	# CYRILLIC CAPITAL LETTER YERU
+0x845D	U+042C	# CYRILLIC CAPITAL LETTER SOFT SIGN
+0x845E	U+042D	# CYRILLIC CAPITAL LETTER E
+0x845F	U+042E	# CYRILLIC CAPITAL LETTER YU
+0x8460	U+042F	# CYRILLIC CAPITAL LETTER YA
+0x8461	U+23BE	# DENTISTRY SYMBOL LIGHT VERTICAL AND TOP RIGHT	[2000]	[Unicode3.2]
+0x8462	U+23BF	# DENTISTRY SYMBOL LIGHT VERTICAL AND BOTTOM RIGHT	[2000]	[Unicode3.2]
+0x8463	U+23C0	# DENTISTRY SYMBOL LIGHT VERTICAL WITH CIRCLE	[2000]	[Unicode3.2]
+0x8464	U+23C1	# DENTISTRY SYMBOL LIGHT DOWN AND HORIZONTAL WITH CIRCLE	[2000]	[Unicode3.2]
+0x8465	U+23C2	# DENTISTRY SYMBOL LIGHT UP AND HORIZONTAL WITH CIRCLE	[2000]	[Unicode3.2]
+0x8466	U+23C3	# DENTISTRY SYMBOL LIGHT VERTICAL WITH TRIANGLE	[2000]	[Unicode3.2]
+0x8467	U+23C4	# DENTISTRY SYMBOL LIGHT DOWN AND HORIZONTAL WITH TRIANGLE	[2000]	[Unicode3.2]
+0x8468	U+23C5	# DENTISTRY SYMBOL LIGHT UP AND HORIZONTAL WITH TRIANGLE	[2000]	[Unicode3.2]
+0x8469	U+23C6	# DENTISTRY SYMBOL LIGHT VERTICAL AND WAVE	[2000]	[Unicode3.2]
+0x846A	U+23C7	# DENTISTRY SYMBOL LIGHT DOWN AND HORIZONTAL WITH WAVE	[2000]	[Unicode3.2]
+0x846B	U+23C8	# DENTISTRY SYMBOL LIGHT UP AND HORIZONTAL WITH WAVE	[2000]	[Unicode3.2]
+0x846C	U+23C9	# DENTISTRY SYMBOL LIGHT DOWN AND HORIZONTAL	[2000]	[Unicode3.2]
+0x846D	U+23CA	# DENTISTRY SYMBOL LIGHT UP AND HORIZONTAL	[2000]	[Unicode3.2]
+0x846E	U+23CB	# DENTISTRY SYMBOL LIGHT VERTICAL AND TOP LEFT	[2000]	[Unicode3.2]
+0x846F	U+23CC	# DENTISTRY SYMBOL LIGHT VERTICAL AND BOTTOM LEFT	[2000]	[Unicode3.2]
+0x8470	U+0430	# CYRILLIC SMALL LETTER A
+0x8471	U+0431	# CYRILLIC SMALL LETTER BE
+0x8472	U+0432	# CYRILLIC SMALL LETTER VE
+0x8473	U+0433	# CYRILLIC SMALL LETTER GHE
+0x8474	U+0434	# CYRILLIC SMALL LETTER DE
+0x8475	U+0435	# CYRILLIC SMALL LETTER IE
+0x8476	U+0451	# CYRILLIC SMALL LETTER IO
+0x8477	U+0436	# CYRILLIC SMALL LETTER ZHE
+0x8478	U+0437	# CYRILLIC SMALL LETTER ZE
+0x8479	U+0438	# CYRILLIC SMALL LETTER I
+0x847A	U+0439	# CYRILLIC SMALL LETTER SHORT I
+0x847B	U+043A	# CYRILLIC SMALL LETTER KA
+0x847C	U+043B	# CYRILLIC SMALL LETTER EL
+0x847D	U+043C	# CYRILLIC SMALL LETTER EM
+0x847E	U+043D	# CYRILLIC SMALL LETTER EN
+0x8480	U+043E	# CYRILLIC SMALL LETTER O
+0x8481	U+043F	# CYRILLIC SMALL LETTER PE
+0x8482	U+0440	# CYRILLIC SMALL LETTER ER
+0x8483	U+0441	# CYRILLIC SMALL LETTER ES
+0x8484	U+0442	# CYRILLIC SMALL LETTER TE
+0x8485	U+0443	# CYRILLIC SMALL LETTER U
+0x8486	U+0444	# CYRILLIC SMALL LETTER EF
+0x8487	U+0445	# CYRILLIC SMALL LETTER HA
+0x8488	U+0446	# CYRILLIC SMALL LETTER TSE
+0x8489	U+0447	# CYRILLIC SMALL LETTER CHE
+0x848A	U+0448	# CYRILLIC SMALL LETTER SHA
+0x848B	U+0449	# CYRILLIC SMALL LETTER SHCHA
+0x848C	U+044A	# CYRILLIC SMALL LETTER HARD SIGN
+0x848D	U+044B	# CYRILLIC SMALL LETTER YERU
+0x848E	U+044C	# CYRILLIC SMALL LETTER SOFT SIGN
+0x848F	U+044D	# CYRILLIC SMALL LETTER E
+0x8490	U+044E	# CYRILLIC SMALL LETTER YU
+0x8491	U+044F	# CYRILLIC SMALL LETTER YA
+0x8492	U+30F7	# KATAKANA LETTER VA	[2000]
+0x8493	U+30F8	# KATAKANA LETTER VI	[2000]
+0x8494	U+30F9	# KATAKANA LETTER VE	[2000]
+0x8495	U+30FA	# KATAKANA LETTER VO	[2000]
+0x8496	U+22DA	# LESS-THAN EQUAL TO OR GREATER-THAN	[2000]
+0x8497	U+22DB	# GREATER-THAN EQUAL TO OR LESS-THAN	[2000]
+0x8498	U+2153	# VULGAR FRACTION ONE THIRD	[2000]
+0x8499	U+2154	# VULGAR FRACTION TWO THIRDS	[2000]
+0x849A	U+2155	# VULGAR FRACTION ONE FIFTH	[2000]
+0x849B	U+2713	# CHECK MARK	[2000]
+0x849C	U+2318	# PLACE OF INTEREST SIGN	[2000]
+0x849D	U+2423	# OPEN BOX	[2000]
+0x849E	U+23CE	# RETURN SYMBOL	[2000]	[Unicode3.2]
+0x849F	U+2500	# BOX DRAWINGS LIGHT HORIZONTAL	[1983]
+0x84A0	U+2502	# BOX DRAWINGS LIGHT VERTICAL	[1983]
+0x84A1	U+250C	# BOX DRAWINGS LIGHT DOWN AND RIGHT	[1983]
+0x84A2	U+2510	# BOX DRAWINGS LIGHT DOWN AND LEFT	[1983]
+0x84A3	U+2518	# BOX DRAWINGS LIGHT UP AND LEFT	[1983]
+0x84A4	U+2514	# BOX DRAWINGS LIGHT UP AND RIGHT	[1983]
+0x84A5	U+251C	# BOX DRAWINGS LIGHT VERTICAL AND RIGHT	[1983]
+0x84A6	U+252C	# BOX DRAWINGS LIGHT DOWN AND HORIZONTAL	[1983]
+0x84A7	U+2524	# BOX DRAWINGS LIGHT VERTICAL AND LEFT	[1983]
+0x84A8	U+2534	# BOX DRAWINGS LIGHT UP AND HORIZONTAL	[1983]
+0x84A9	U+253C	# BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL	[1983]
+0x84AA	U+2501	# BOX DRAWINGS HEAVY HORIZONTAL	[1983]
+0x84AB	U+2503	# BOX DRAWINGS HEAVY VERTICAL	[1983]
+0x84AC	U+250F	# BOX DRAWINGS HEAVY DOWN AND RIGHT	[1983]
+0x84AD	U+2513	# BOX DRAWINGS HEAVY DOWN AND LEFT	[1983]
+0x84AE	U+251B	# BOX DRAWINGS HEAVY UP AND LEFT	[1983]
+0x84AF	U+2517	# BOX DRAWINGS HEAVY UP AND RIGHT	[1983]
+0x84B0	U+2523	# BOX DRAWINGS HEAVY VERTICAL AND RIGHT	[1983]
+0x84B1	U+2533	# BOX DRAWINGS HEAVY DOWN AND HORIZONTAL	[1983]
+0x84B2	U+252B	# BOX DRAWINGS HEAVY VERTICAL AND LEFT	[1983]
+0x84B3	U+253B	# BOX DRAWINGS HEAVY UP AND HORIZONTAL	[1983]
+0x84B4	U+254B	# BOX DRAWINGS HEAVY VERTICAL AND HORIZONTAL	[1983]
+0x84B5	U+2520	# BOX DRAWINGS VERTICAL HEAVY AND RIGHT LIGHT	[1983]
+0x84B6	U+252F	# BOX DRAWINGS DOWN LIGHT AND HORIZONTAL HEAVY	[1983]
+0x84B7	U+2528	# BOX DRAWINGS VERTICAL HEAVY AND LEFT LIGHT	[1983]
+0x84B8	U+2537	# BOX DRAWINGS UP LIGHT AND HORIZONTAL HEAVY	[1983]
+0x84B9	U+253F	# BOX DRAWINGS VERTICAL LIGHT AND HORIZONTAL HEAVY	[1983]
+0x84BA	U+251D	# BOX DRAWINGS VERTICAL LIGHT AND RIGHT HEAVY	[1983]
+0x84BB	U+2530	# BOX DRAWINGS DOWN HEAVY AND HORIZONTAL LIGHT	[1983]
+0x84BC	U+2525	# BOX DRAWINGS VERTICAL LIGHT AND LEFT HEAVY	[1983]
+0x84BD	U+2538	# BOX DRAWINGS UP HEAVY AND HORIZONTAL LIGHT	[1983]
+0x84BE	U+2542	# BOX DRAWINGS VERTICAL HEAVY AND HORIZONTAL LIGHT	[1983]
+0x84BF	U+3251	# CIRCLED NUMBER TWENTY ONE	[2000]	[Unicode3.2]
+0x84C0	U+3252	# CIRCLED NUMBER TWENTY TWO	[2000]	[Unicode3.2]
+0x84C1	U+3253	# CIRCLED NUMBER TWENTY THREE	[2000]	[Unicode3.2]
+0x84C2	U+3254	# CIRCLED NUMBER TWENTY FOUR	[2000]	[Unicode3.2]
+0x84C3	U+3255	# CIRCLED NUMBER TWENTY FIVE	[2000]	[Unicode3.2]
+0x84C4	U+3256	# CIRCLED NUMBER TWENTY SIX	[2000]	[Unicode3.2]
+0x84C5	U+3257	# CIRCLED NUMBER TWENTY SEVEN	[2000]	[Unicode3.2]
+0x84C6	U+3258	# CIRCLED NUMBER TWENTY EIGHT	[2000]	[Unicode3.2]
+0x84C7	U+3259	# CIRCLED NUMBER TWENTY NINE	[2000]	[Unicode3.2]
+0x84C8	U+325A	# CIRCLED NUMBER THIRTY	[2000]	[Unicode3.2]
+0x84C9	U+325B	# CIRCLED NUMBER THIRTY ONE	[2000]	[Unicode3.2]
+0x84CA	U+325C	# CIRCLED NUMBER THIRTY TWO	[2000]	[Unicode3.2]
+0x84CB	U+325D	# CIRCLED NUMBER THIRTY THREE	[2000]	[Unicode3.2]
+0x84CC	U+325E	# CIRCLED NUMBER THIRTY FOUR	[2000]	[Unicode3.2]
+0x84CD	U+325F	# CIRCLED NUMBER THIRTY FIVE	[2000]	[Unicode3.2]
+0x84CE	U+32B1	# CIRCLED NUMBER THIRTY SIX	[2000]	[Unicode3.2]
+0x84CF	U+32B2	# CIRCLED NUMBER THIRTY SEVEN	[2000]	[Unicode3.2]
+0x84D0	U+32B3	# CIRCLED NUMBER THIRTY EIGHT	[2000]	[Unicode3.2]
+0x84D1	U+32B4	# CIRCLED NUMBER THIRTY NINE	[2000]	[Unicode3.2]
+0x84D2	U+32B5	# CIRCLED NUMBER FORTY	[2000]	[Unicode3.2]
+0x84D3	U+32B6	# CIRCLED NUMBER FORTY ONE	[2000]	[Unicode3.2]
+0x84D4	U+32B7	# CIRCLED NUMBER FORTY TWO	[2000]	[Unicode3.2]
+0x84D5	U+32B8	# CIRCLED NUMBER FORTY THREE	[2000]	[Unicode3.2]
+0x84D6	U+32B9	# CIRCLED NUMBER FORTY FOUR	[2000]	[Unicode3.2]
+0x84D7	U+32BA	# CIRCLED NUMBER FORTY FIVE	[2000]	[Unicode3.2]
+0x84D8	U+32BB	# CIRCLED NUMBER FORTY SIX	[2000]	[Unicode3.2]
+0x84D9	U+32BC	# CIRCLED NUMBER FORTY SEVEN	[2000]	[Unicode3.2]
+0x84DA	U+32BD	# CIRCLED NUMBER FORTY EIGHT	[2000]	[Unicode3.2]
+0x84DB	U+32BE	# CIRCLED NUMBER FORTY NINE	[2000]	[Unicode3.2]
+0x84DC	U+32BF	# CIRCLED NUMBER FIFTY	[2000]	[Unicode3.2]
+0x84DD		# <reserved>
+0x84DE		# <reserved>
+0x84DF		# <reserved>
+0x84E0		# <reserved>
+0x84E1		# <reserved>
+0x84E2		# <reserved>
+0x84E3		# <reserved>
+0x84E4		# <reserved>
+0x84E5	U+25D0	# CIRCLE WITH LEFT HALF BLACK	[2000]
+0x84E6	U+25D1	# CIRCLE WITH RIGHT HALF BLACK	[2000]
+0x84E7	U+25D2	# CIRCLE WITH LOWER HALF BLACK	[2000]
+0x84E8	U+25D3	# CIRCLE WITH UPPER HALF BLACK	[2000]
+0x84E9	U+203C	# DOUBLE EXCLAMATION MARK	[2000]
+0x84EA	U+2047	# DOUBLE QUESTION MARK	[2000]	[Unicode3.2]
+0x84EB	U+2048	# QUESTION EXCLAMATION MARK	[2000]
+0x84EC	U+2049	# EXCLAMATION QUESTION MARK	[2000]
+0x84ED	U+01CD	# LATIN CAPITAL LETTER A WITH CARON	[2000]
+0x84EE	U+01CE	# LATIN SMALL LETTER A WITH CARON	[2000]
+0x84EF	U+01D0	# LATIN SMALL LETTER I WITH CARON	[2000]
+0x84F0	U+1E3E	# LATIN CAPITAL LETTER M WITH ACUTE	[2000]
+0x84F1	U+1E3F	# LATIN SMALL LETTER M WITH ACUTE	[2000]
+0x84F2	U+01F8	# LATIN CAPITAL LETTER N WITH GRAVE	[2000]
+0x84F3	U+01F9	# LATIN SMALL LETTER N WITH GRAVE	[2000]
+0x84F4	U+01D1	# LATIN CAPITAL LETTER O WITH CARON	[2000]
+0x84F5	U+01D2	# LATIN SMALL LETTER O WITH CARON	[2000]
+0x84F6	U+01D4	# LATIN SMALL LETTER U WITH CARON	[2000]
+0x84F7	U+01D6	# LATIN SMALL LETTER U WITH DIAERESIS AND MACRON	[2000]
+0x84F8	U+01D8	# LATIN SMALL LETTER U WITH DIAERESIS AND ACUTE	[2000]
+0x84F9	U+01DA	# LATIN SMALL LETTER U WITH DIAERESIS AND CARON	[2000]
+0x84FA	U+01DC	# LATIN SMALL LETTER U WITH DIAERESIS AND GRAVE	[2000]
+0x84FB		# <reserved>
+0x84FC		# <reserved>
+0x8540	U+20AC	# EURO SIGN	[2000]
+0x8541	U+00A0	# NO-BREAK SPACE	[2000]
+0x8542	U+00A1	# INVERTED EXCLAMATION MARK	[2000]
+0x8543	U+00A4	# CURRENCY SIGN	[2000]
+0x8544	U+00A6	# BROKEN BAR	[2000]
+0x8545	U+00A9	# COPYRIGHT SIGN	[2000]
+0x8546	U+00AA	# FEMININE ORDINAL INDICATOR	[2000]
+0x8547	U+00AB	# LEFT-POINTING DOUBLE ANGLE QUOTATION MARK 	[2000]
+0x8548	U+00AD	# SOFT HYPHEN	[2000]
+0x8549	U+00AE	# REGISTERED SIGN	[2000]
+0x854A	U+00AF	# MACRON	[2000]
+0x854B	U+00B2	# SUPERSCRIPT TWO	[2000]
+0x854C	U+00B3	# SUPERSCRIPT THREE	[2000]
+0x854D	U+00B7	# MIDDLE DOT	[2000]
+0x854E	U+00B8	# CEDILLA	[2000]
+0x854F	U+00B9	# SUPERSCRIPT ONE	[2000]
+0x8550	U+00BA	# MASCULINE ORDINAL INDICATOR	[2000]
+0x8551	U+00BB	# RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK 	[2000]
+0x8552	U+00BC	# VULGAR FRACTION ONE QUARTER	[2000]
+0x8553	U+00BD	# VULGAR FRACTION ONE HALF	[2000]
+0x8554	U+00BE	# VULGAR FRACTION THREE QUARTERS	[2000]
+0x8555	U+00BF	# INVERTED QUESTION MARK	[2000]
+0x8556	U+00C0	# LATIN CAPITAL LETTER A WITH GRAVE	[2000]
+0x8557	U+00C1	# LATIN CAPITAL LETTER A WITH ACUTE	[2000]
+0x8558	U+00C2	# LATIN CAPITAL LETTER A WITH CIRCUMFLEX	[2000]
+0x8559	U+00C3	# LATIN CAPITAL LETTER A WITH TILDE	[2000]
+0x855A	U+00C4	# LATIN CAPITAL LETTER A WITH DIAERESIS	[2000]
+0x855B	U+00C5	# LATIN CAPITAL LETTER A WITH RING ABOVE	[2000]
+0x855C	U+00C6	# LATIN CAPITAL LETTER AE 	[2000]
+0x855D	U+00C7	# LATIN CAPITAL LETTER C WITH CEDILLA	[2000]
+0x855E	U+00C8	# LATIN CAPITAL LETTER E WITH GRAVE	[2000]
+0x855F	U+00C9	# LATIN CAPITAL LETTER E WITH ACUTE	[2000]
+0x8560	U+00CA	# LATIN CAPITAL LETTER E WITH CIRCUMFLEX	[2000]
+0x8561	U+00CB	# LATIN CAPITAL LETTER E WITH DIAERESIS	[2000]
+0x8562	U+00CC	# LATIN CAPITAL LETTER I WITH GRAVE	[2000]
+0x8563	U+00CD	# LATIN CAPITAL LETTER I WITH ACUTE	[2000]
+0x8564	U+00CE	# LATIN CAPITAL LETTER I WITH CIRCUMFLEX	[2000]
+0x8565	U+00CF	# LATIN CAPITAL LETTER I WITH DIAERESIS	[2000]
+0x8566	U+00D0	# LATIN CAPITAL LETTER ETH 	[2000]
+0x8567	U+00D1	# LATIN CAPITAL LETTER N WITH TILDE	[2000]
+0x8568	U+00D2	# LATIN CAPITAL LETTER O WITH GRAVE	[2000]
+0x8569	U+00D3	# LATIN CAPITAL LETTER O WITH ACUTE	[2000]
+0x856A	U+00D4	# LATIN CAPITAL LETTER O WITH CIRCUMFLEX	[2000]
+0x856B	U+00D5	# LATIN CAPITAL LETTER O WITH TILDE	[2000]
+0x856C	U+00D6	# LATIN CAPITAL LETTER O WITH DIAERESIS	[2000]
+0x856D	U+00D8	# LATIN CAPITAL LETTER O WITH STROKE	[2000]
+0x856E	U+00D9	# LATIN CAPITAL LETTER U WITH GRAVE	[2000]
+0x856F	U+00DA	# LATIN CAPITAL LETTER U WITH ACUTE	[2000]
+0x8570	U+00DB	# LATIN CAPITAL LETTER U WITH CIRCUMFLEX	[2000]
+0x8571	U+00DC	# LATIN CAPITAL LETTER U WITH DIAERESIS	[2000]
+0x8572	U+00DD	# LATIN CAPITAL LETTER Y WITH ACUTE	[2000]
+0x8573	U+00DE	# LATIN CAPITAL LETTER THORN 	[2000]
+0x8574	U+00DF	# LATIN SMALL LETTER SHARP S 	[2000]
+0x8575	U+00E0	# LATIN SMALL LETTER A WITH GRAVE	[2000]
+0x8576	U+00E1	# LATIN SMALL LETTER A WITH ACUTE	[2000]
+0x8577	U+00E2	# LATIN SMALL LETTER A WITH CIRCUMFLEX	[2000]
+0x8578	U+00E3	# LATIN SMALL LETTER A WITH TILDE	[2000]
+0x8579	U+00E4	# LATIN SMALL LETTER A WITH DIAERESIS	[2000]
+0x857A	U+00E5	# LATIN SMALL LETTER A WITH RING ABOVE	[2000]
+0x857B	U+00E6	# LATIN SMALL LETTER AE 	[2000]
+0x857C	U+00E7	# LATIN SMALL LETTER C WITH CEDILLA	[2000]
+0x857D	U+00E8	# LATIN SMALL LETTER E WITH GRAVE	[2000]
+0x857E	U+00E9	# LATIN SMALL LETTER E WITH ACUTE	[2000]
+0x8580	U+00EA	# LATIN SMALL LETTER E WITH CIRCUMFLEX	[2000]
+0x8581	U+00EB	# LATIN SMALL LETTER E WITH DIAERESIS	[2000]
+0x8582	U+00EC	# LATIN SMALL LETTER I WITH GRAVE	[2000]
+0x8583	U+00ED	# LATIN SMALL LETTER I WITH ACUTE	[2000]
+0x8584	U+00EE	# LATIN SMALL LETTER I WITH CIRCUMFLEX	[2000]
+0x8585	U+00EF	# LATIN SMALL LETTER I WITH DIAERESIS	[2000]
+0x8586	U+00F0	# LATIN SMALL LETTER ETH 	[2000]
+0x8587	U+00F1	# LATIN SMALL LETTER N WITH TILDE	[2000]
+0x8588	U+00F2	# LATIN SMALL LETTER O WITH GRAVE	[2000]
+0x8589	U+00F3	# LATIN SMALL LETTER O WITH ACUTE	[2000]
+0x858A	U+00F4	# LATIN SMALL LETTER O WITH CIRCUMFLEX	[2000]
+0x858B	U+00F5	# LATIN SMALL LETTER O WITH TILDE	[2000]
+0x858C	U+00F6	# LATIN SMALL LETTER O WITH DIAERESIS	[2000]
+0x858D	U+00F8	# LATIN SMALL LETTER O WITH STROKE	[2000]
+0x858E	U+00F9	# LATIN SMALL LETTER U WITH GRAVE	[2000]
+0x858F	U+00FA	# LATIN SMALL LETTER U WITH ACUTE	[2000]
+0x8590	U+00FB	# LATIN SMALL LETTER U WITH CIRCUMFLEX	[2000]
+0x8591	U+00FC	# LATIN SMALL LETTER U WITH DIAERESIS	[2000]
+0x8592	U+00FD	# LATIN SMALL LETTER Y WITH ACUTE	[2000]
+0x8593	U+00FE	# LATIN SMALL LETTER THORN 	[2000]
+0x8594	U+00FF	# LATIN SMALL LETTER Y WITH DIAERESIS	[2000]
+0x8595	U+0100	# LATIN CAPITAL LETTER A WITH MACRON	[2000]
+0x8596	U+012A	# LATIN CAPITAL LETTER I WITH MACRON	[2000]
+0x8597	U+016A	# LATIN CAPITAL LETTER U WITH MACRON	[2000]
+0x8598	U+0112	# LATIN CAPITAL LETTER E WITH MACRON	[2000]
+0x8599	U+014C	# LATIN CAPITAL LETTER O WITH MACRON	[2000]
+0x859A	U+0101	# LATIN SMALL LETTER A WITH MACRON	[2000]
+0x859B	U+012B	# LATIN SMALL LETTER I WITH MACRON	[2000]
+0x859C	U+016B	# LATIN SMALL LETTER U WITH MACRON	[2000]
+0x859D	U+0113	# LATIN SMALL LETTER E WITH MACRON	[2000]
+0x859E	U+014D	# LATIN SMALL LETTER O WITH MACRON	[2000]
+0x859F	U+0104	# LATIN CAPITAL LETTER A WITH OGONEK	[2000]
+0x85A0	U+02D8	# BREVE	[2000]
+0x85A1	U+0141	# LATIN CAPITAL LETTER L WITH STROKE	[2000]
+0x85A2	U+013D	# LATIN CAPITAL LETTER L WITH CARON	[2000]
+0x85A3	U+015A	# LATIN CAPITAL LETTER S WITH ACUTE	[2000]
+0x85A4	U+0160	# LATIN CAPITAL LETTER S WITH CARON	[2000]
+0x85A5	U+015E	# LATIN CAPITAL LETTER S WITH CEDILLA 	[2000]
+0x85A6	U+0164	# LATIN CAPITAL LETTER T WITH CARON	[2000]
+0x85A7	U+0179	# LATIN CAPITAL LETTER Z WITH ACUTE	[2000]
+0x85A8	U+017D	# LATIN CAPITAL LETTER Z WITH CARON	[2000]
+0x85A9	U+017B	# LATIN CAPITAL LETTER Z WITH DOT ABOVE	[2000]
+0x85AA	U+0105	# LATIN SMALL LETTER A WITH OGONEK	[2000]
+0x85AB	U+02DB	# OGONEK	[2000]
+0x85AC	U+0142	# LATIN SMALL LETTER L WITH STROKE	[2000]
+0x85AD	U+013E	# LATIN SMALL LETTER L WITH CARON	[2000]
+0x85AE	U+015B	# LATIN SMALL LETTER S WITH ACUTE	[2000]
+0x85AF	U+02C7	# CARON 	[2000]
+0x85B0	U+0161	# LATIN SMALL LETTER S WITH CARON	[2000]
+0x85B1	U+015F	# LATIN SMALL LETTER S WITH CEDILLA 	[2000]
+0x85B2	U+0165	# LATIN SMALL LETTER T WITH CARON	[2000]
+0x85B3	U+017A	# LATIN SMALL LETTER Z WITH ACUTE	[2000]
+0x85B4	U+02DD	# DOUBLE ACUTE ACCENT	[2000]
+0x85B5	U+017E	# LATIN SMALL LETTER Z WITH CARON	[2000]
+0x85B6	U+017C	# LATIN SMALL LETTER Z WITH DOT ABOVE	[2000]
+0x85B7	U+0154	# LATIN CAPITAL LETTER R WITH ACUTE	[2000]
+0x85B8	U+0102	# LATIN CAPITAL LETTER A WITH BREVE	[2000]
+0x85B9	U+0139	# LATIN CAPITAL LETTER L WITH ACUTE	[2000]
+0x85BA	U+0106	# LATIN CAPITAL LETTER C WITH ACUTE	[2000]
+0x85BB	U+010C	# LATIN CAPITAL LETTER C WITH CARON	[2000]
+0x85BC	U+0118	# LATIN CAPITAL LETTER E WITH OGONEK	[2000]
+0x85BD	U+011A	# LATIN CAPITAL LETTER E WITH CARON	[2000]
+0x85BE	U+010E	# LATIN CAPITAL LETTER D WITH CARON	[2000]
+0x85BF	U+0143	# LATIN CAPITAL LETTER N WITH ACUTE	[2000]
+0x85C0	U+0147	# LATIN CAPITAL LETTER N WITH CARON	[2000]
+0x85C1	U+0150	# LATIN CAPITAL LETTER O WITH DOUBLE ACUTE	[2000]
+0x85C2	U+0158	# LATIN CAPITAL LETTER R WITH CARON	[2000]
+0x85C3	U+016E	# LATIN CAPITAL LETTER U WITH RING ABOVE	[2000]
+0x85C4	U+0170	# LATIN CAPITAL LETTER U WITH DOUBLE ACUTE	[2000]
+0x85C5	U+0162	# LATIN CAPITAL LETTER T WITH CEDILLA 	[2000]
+0x85C6	U+0155	# LATIN SMALL LETTER R WITH ACUTE	[2000]
+0x85C7	U+0103	# LATIN SMALL LETTER A WITH BREVE	[2000]
+0x85C8	U+013A	# LATIN SMALL LETTER L WITH ACUTE	[2000]
+0x85C9	U+0107	# LATIN SMALL LETTER C WITH ACUTE	[2000]
+0x85CA	U+010D	# LATIN SMALL LETTER C WITH CARON	[2000]
+0x85CB	U+0119	# LATIN SMALL LETTER E WITH OGONEK	[2000]
+0x85CC	U+011B	# LATIN SMALL LETTER E WITH CARON	[2000]
+0x85CD	U+010F	# LATIN SMALL LETTER D WITH CARON	[2000]
+0x85CE	U+0111	# LATIN SMALL LETTER D WITH STROKE	[2000]
+0x85CF	U+0144	# LATIN SMALL LETTER N WITH ACUTE	[2000]
+0x85D0	U+0148	# LATIN SMALL LETTER N WITH CARON	[2000]
+0x85D1	U+0151	# LATIN SMALL LETTER O WITH DOUBLE ACUTE	[2000]
+0x85D2	U+0159	# LATIN SMALL LETTER R WITH CARON	[2000]
+0x85D3	U+016F	# LATIN SMALL LETTER U WITH RING ABOVE	[2000]
+0x85D4	U+0171	# LATIN SMALL LETTER U WITH DOUBLE ACUTE	[2000]
+0x85D5	U+0163	# LATIN SMALL LETTER T WITH CEDILLA 	[2000]
+0x85D6	U+02D9	# DOT ABOVE 	[2000]
+0x85D7	U+0108	# LATIN CAPITAL LETTER C WITH CIRCUMFLEX	[2000]
+0x85D8	U+011C	# LATIN CAPITAL LETTER G WITH CIRCUMFLEX	[2000]
+0x85D9	U+0124	# LATIN CAPITAL LETTER H WITH CIRCUMFLEX	[2000]
+0x85DA	U+0134	# LATIN CAPITAL LETTER J WITH CIRCUMFLEX	[2000]
+0x85DB	U+015C	# LATIN CAPITAL LETTER S WITH CIRCUMFLEX	[2000]
+0x85DC	U+016C	# LATIN CAPITAL LETTER U WITH BREVE	[2000]
+0x85DD	U+0109	# LATIN SMALL LETTER C WITH CIRCUMFLEX	[2000]
+0x85DE	U+011D	# LATIN SMALL LETTER G WITH CIRCUMFLEX	[2000]
+0x85DF	U+0125	# LATIN SMALL LETTER H WITH CIRCUMFLEX	[2000]
+0x85E0	U+0135	# LATIN SMALL LETTER J WITH CIRCUMFLEX	[2000]
+0x85E1	U+015D	# LATIN SMALL LETTER S WITH CIRCUMFLEX	[2000]
+0x85E2	U+016D	# LATIN SMALL LETTER U WITH BREVE	[2000]
+0x85E3	U+0271	# LATIN SMALL LETTER M WITH HOOK	[2000]
+0x85E4	U+028B	# LATIN SMALL LETTER V WITH HOOK	[2000]
+0x85E5	U+027E	# LATIN SMALL LETTER R WITH FISHHOOK	[2000]
+0x85E6	U+0283	# LATIN SMALL LETTER ESH	[2000]
+0x85E7	U+0292	# LATIN SMALL LETTER EZH	[2000]
+0x85E8	U+026C	# LATIN SMALL LETTER L WITH BELT	[2000]
+0x85E9	U+026E	# LATIN SMALL LETTER LEZH	[2000]
+0x85EA	U+0279	# LATIN SMALL LETTER TURNED R	[2000]
+0x85EB	U+0288	# LATIN SMALL LETTER T WITH RETROFLEX HOOK	[2000]
+0x85EC	U+0256	# LATIN SMALL LETTER D WITH TAIL	[2000]
+0x85ED	U+0273	# LATIN SMALL LETTER N WITH RETROFLEX HOOK	[2000]
+0x85EE	U+027D	# LATIN SMALL LETTER R WITH TAIL	[2000]
+0x85EF	U+0282	# LATIN SMALL LETTER S WITH HOOK	[2000]
+0x85F0	U+0290	# LATIN SMALL LETTER Z WITH RETROFLEX HOOK	[2000]
+0x85F1	U+027B	# LATIN SMALL LETTER TURNED R WITH HOOK	[2000]
+0x85F2	U+026D	# LATIN SMALL LETTER L WITH RETROFLEX HOOK	[2000]
+0x85F3	U+025F	# LATIN SMALL LETTER DOTLESS J WITH STROKE	[2000]
+0x85F4	U+0272	# LATIN SMALL LETTER N WITH LEFT HOOK	[2000]
+0x85F5	U+029D	# LATIN SMALL LETTER J WITH CROSSED-TAIL	[2000]
+0x85F6	U+028E	# LATIN SMALL LETTER TURNED Y	[2000]
+0x85F7	U+0261	# LATIN SMALL LETTER SCRIPT G	[2000]
+0x85F8	U+014B	# LATIN SMALL LETTER ENG 	[2000]
+0x85F9	U+0270	# LATIN SMALL LETTER TURNED M WITH LONG LEG	[2000]
+0x85FA	U+0281	# LATIN LETTER SMALL CAPITAL INVERTED R	[2000]
+0x85FB	U+0127	# LATIN SMALL LETTER H WITH STROKE	[2000]
+0x85FC	U+0295	# LATIN LETTER PHARYNGEAL VOICED FRICATIVE	[2000]
+0x8640	U+0294	# LATIN LETTER GLOTTAL STOP	[2000]
+0x8641	U+0266	# LATIN SMALL LETTER H WITH HOOK	[2000]
+0x8642	U+0298	# LATIN LETTER BILABIAL CLICK	[2000]
+0x8643	U+01C2	# LATIN LETTER ALVEOLAR CLICK	[2000]
+0x8644	U+0253	# LATIN SMALL LETTER B WITH HOOK	[2000]
+0x8645	U+0257	# LATIN SMALL LETTER D WITH HOOK	[2000]
+0x8646	U+0284	# LATIN SMALL LETTER DOTLESS J WITH STROKE AND HOOK	[2000]
+0x8647	U+0260	# LATIN SMALL LETTER G WITH HOOK	[2000]
+0x8648	U+0193	# LATIN CAPITAL LETTER G WITH HOOK	[2000]
+0x8649	U+0153	# LATIN SMALL LIGATURE OE	[2000]
+0x864A	U+0152	# LATIN CAPITAL LIGATURE OE	[2000]
+0x864B	U+0268	# LATIN SMALL LETTER I WITH STROKE	[2000]
+0x864C	U+0289	# LATIN SMALL LETTER U BAR	[2000]
+0x864D	U+0258	# LATIN SMALL LETTER REVERSED E	[2000]
+0x864E	U+0275	# LATIN SMALL LETTER BARRED O	[2000]
+0x864F	U+0259	# LATIN SMALL LETTER SCHWA	[2000]
+0x8650	U+025C	# LATIN SMALL LETTER REVERSED OPEN E	[2000]
+0x8651	U+025E	# LATIN SMALL LETTER CLOSED REVERSED OPEN E	[2000]
+0x8652	U+0250	# LATIN SMALL LETTER TURNED A	[2000]
+0x8653	U+026F	# LATIN SMALL LETTER TURNED M	[2000]
+0x8654	U+028A	# LATIN SMALL LETTER UPSILON	[2000]
+0x8655	U+0264	# LATIN SMALL LETTER RAMS HORN	[2000]
+0x8656	U+028C	# LATIN SMALL LETTER TURNED V	[2000]
+0x8657	U+0254	# LATIN SMALL LETTER OPEN O	[2000]
+0x8658	U+0251	# LATIN SMALL LETTER ALPHA	[2000]
+0x8659	U+0252	# LATIN SMALL LETTER TURNED ALPHA	[2000]
+0x865A	U+028D	# LATIN SMALL LETTER TURNED W	[2000]
+0x865B	U+0265	# LATIN SMALL LETTER TURNED H	[2000]
+0x865C	U+02A2	# LATIN LETTER REVERSED GLOTTAL STOP WITH STROKE	[2000]
+0x865D	U+02A1	# LATIN LETTER GLOTTAL STOP WITH STROKE	[2000]
+0x865E	U+0255	# LATIN SMALL LETTER C WITH CURL	[2000]
+0x865F	U+0291	# LATIN SMALL LETTER Z WITH CURL	[2000]
+0x8660	U+027A	# LATIN SMALL LETTER TURNED R WITH LONG LEG	[2000]
+0x8661	U+0267	# LATIN SMALL LETTER HENG WITH HOOK	[2000]
+0x8662	U+025A	# LATIN SMALL LETTER SCHWA WITH HOOK	[2000]
+0x8663	U+00E6+0300	# 	[2000]
+0x8664	U+01FD	# LATIN SMALL LETTER AE WITH ACUTE 	[2000]
+0x8665	U+1F70	# GREEK SMALL LETTER ALPHA WITH VARIA	[2000]
+0x8666	U+1F71	# GREEK SMALL LETTER ALPHA WITH OXIA	[2000]
+0x8667	U+0254+0300	# 	[2000]
+0x8668	U+0254+0301	# 	[2000]
+0x8669	U+028C+0300	# 	[2000]
+0x866A	U+028C+0301	# 	[2000]
+0x866B	U+0259+0300	# 	[2000]
+0x866C	U+0259+0301	# 	[2000]
+0x866D	U+025A+0300	# 	[2000]
+0x866E	U+025A+0301	# 	[2000]
+0x866F	U+1F72	# GREEK SMALL LETTER EPSILON WITH VARIA	[2000]
+0x8670	U+1F73	# GREEK SMALL LETTER EPSILON WITH OXIA	[2000]
+0x8671	U+0361	# COMBINING DOUBLE INVERTED BREVE	[2000]
+0x8672	U+02C8	# MODIFIER LETTER VERTICAL LINE	[2000]
+0x8673	U+02CC	# MODIFIER LETTER LOW VERTICAL LINE	[2000]
+0x8674	U+02D0	# MODIFIER LETTER TRIANGULAR COLON	[2000]
+0x8675	U+02D1	# MODIFIER LETTER HALF TRIANGULAR COLON	[2000]
+0x8676	U+0306	# COMBINING BREVE 	[2000]
+0x8677	U+203F	# UNDERTIE 	[2000]
+0x8678	U+030B	# COMBINING DOUBLE ACUTE ACCENT	[2000]
+0x8679	U+0301	# COMBINING ACUTE ACCENT 	[2000]
+0x867A	U+0304	# COMBINING MACRON	[2000]
+0x867B	U+0300	# COMBINING GRAVE ACCENT 	[2000]
+0x867C	U+030F	# COMBINING DOUBLE GRAVE ACCENT	[2000]
+0x867D	U+030C	# COMBINING CARON	[2000]
+0x867E	U+0302	# COMBINING CIRCUMFLEX ACCENT	[2000]
+0x8680	U+02E5	# MODIFIER LETTER EXTRA-HIGH TONE BAR	[2000]
+0x8681	U+02E6	# MODIFIER LETTER HIGH TONE BAR	[2000]
+0x8682	U+02E7	# MODIFIER LETTER MID TONE BAR	[2000]
+0x8683	U+02E8	# MODIFIER LETTER LOW TONE BAR	[2000]
+0x8684	U+02E9	# MODIFIER LETTER EXTRA-LOW TONE BAR	[2000]
+0x8685	U+02E9+02E5	# 	[2000]
+0x8686	U+02E5+02E9	# 	[2000]
+0x8687	U+0325	# COMBINING RING BELOW	[2000]
+0x8688	U+032C	# COMBINING CARON BELOW	[2000]
+0x8689	U+0339	# COMBINING RIGHT HALF RING BELOW	[2000]
+0x868A	U+031C	# COMBINING LEFT HALF RING BELOW	[2000]
+0x868B	U+031F	# COMBINING PLUS SIGN BELOW	[2000]
+0x868C	U+0320	# COMBINING MINUS SIGN BELOW	[2000]
+0x868D	U+0308	# COMBINING DIAERESIS 	[2000]
+0x868E	U+033D	# COMBINING X ABOVE	[2000]
+0x868F	U+0329	# COMBINING VERTICAL LINE BELOW	[2000]
+0x8690	U+032F	# COMBINING INVERTED BREVE BELOW	[2000]
+0x8691	U+02DE	# MODIFIER LETTER RHOTIC HOOK	[2000]
+0x8692	U+0324	# COMBINING DIAERESIS BELOW	[2000]
+0x8693	U+0330	# COMBINING TILDE BELOW	[2000]
+0x8694	U+033C	# COMBINING SEAGULL BELOW	[2000]
+0x8695	U+0334	# COMBINING TILDE OVERLAY	[2000]
+0x8696	U+031D	# COMBINING UP TACK BELOW	[2000]
+0x8697	U+031E	# COMBINING DOWN TACK BELOW	[2000]
+0x8698	U+0318	# COMBINING LEFT TACK BELOW	[2000]
+0x8699	U+0319	# COMBINING RIGHT TACK BELOW	[2000]
+0x869A	U+032A	# COMBINING BRIDGE BELOW	[2000]
+0x869B	U+033A	# COMBINING INVERTED BRIDGE BELOW	[2000]
+0x869C	U+033B	# COMBINING SQUARE BELOW	[2000]
+0x869D	U+0303	# COMBINING TILDE	[2000]
+0x869E	U+031A	# COMBINING LEFT ANGLE ABOVE	[2000]
+0x869F	U+2776	# DINGBAT NEGATIVE CIRCLED DIGIT ONE	[2000]
+0x86A0	U+2777	# DINGBAT NEGATIVE CIRCLED DIGIT TWO	[2000]
+0x86A1	U+2778	# DINGBAT NEGATIVE CIRCLED DIGIT THREE	[2000]
+0x86A2	U+2779	# DINGBAT NEGATIVE CIRCLED DIGIT FOUR	[2000]
+0x86A3	U+277A	# DINGBAT NEGATIVE CIRCLED DIGIT FIVE	[2000]
+0x86A4	U+277B	# DINGBAT NEGATIVE CIRCLED DIGIT SIX	[2000]
+0x86A5	U+277C	# DINGBAT NEGATIVE CIRCLED DIGIT SEVEN	[2000]
+0x86A6	U+277D	# DINGBAT NEGATIVE CIRCLED DIGIT EIGHT	[2000]
+0x86A7	U+277E	# DINGBAT NEGATIVE CIRCLED DIGIT NINE	[2000]
+0x86A8	U+277F	# DINGBAT NEGATIVE CIRCLED NUMBER TEN	[2000]
+0x86A9	U+24EB	# NEGATIVE CIRCLED NUMBER ELEVEN	[2000]	[Unicode3.2]
+0x86AA	U+24EC	# NEGATIVE CIRCLED NUMBER TWELVE	[2000]	[Unicode3.2]
+0x86AB	U+24ED	# NEGATIVE CIRCLED NUMBER THIRTEEN	[2000]	[Unicode3.2]
+0x86AC	U+24EE	# NEGATIVE CIRCLED NUMBER FOURTEEN	[2000]	[Unicode3.2]
+0x86AD	U+24EF	# NEGATIVE CIRCLED NUMBER FIFTEEN	[2000]	[Unicode3.2]
+0x86AE	U+24F0	# NEGATIVE CIRCLED NUMBER SIXTEEN	[2000]	[Unicode3.2]
+0x86AF	U+24F1	# NEGATIVE CIRCLED NUMBER SEVENTEEN	[2000]	[Unicode3.2]
+0x86B0	U+24F2	# NEGATIVE CIRCLED NUMBER EIGHTEEN	[2000]	[Unicode3.2]
+0x86B1	U+24F3	# NEGATIVE CIRCLED NUMBER NINETEEN	[2000]	[Unicode3.2]
+0x86B2	U+24F4	# NEGATIVE CIRCLED NUMBER TWENTY	[2000]	[Unicode3.2]
+0x86B3	U+2170	# SMALL ROMAN NUMERAL ONE	[2000]
+0x86B4	U+2171	# SMALL ROMAN NUMERAL TWO	[2000]
+0x86B5	U+2172	# SMALL ROMAN NUMERAL THREE	[2000]
+0x86B6	U+2173	# SMALL ROMAN NUMERAL FOUR	[2000]
+0x86B7	U+2174	# SMALL ROMAN NUMERAL FIVE	[2000]
+0x86B8	U+2175	# SMALL ROMAN NUMERAL SIX	[2000]
+0x86B9	U+2176	# SMALL ROMAN NUMERAL SEVEN	[2000]
+0x86BA	U+2177	# SMALL ROMAN NUMERAL EIGHT	[2000]
+0x86BB	U+2178	# SMALL ROMAN NUMERAL NINE	[2000]
+0x86BC	U+2179	# SMALL ROMAN NUMERAL TEN	[2000]
+0x86BD	U+217A	# SMALL ROMAN NUMERAL ELEVEN	[2000]
+0x86BE	U+217B	# SMALL ROMAN NUMERAL TWELVE	[2000]
+0x86BF	U+24D0	# CIRCLED LATIN SMALL LETTER A	[2000]
+0x86C0	U+24D1	# CIRCLED LATIN SMALL LETTER B	[2000]
+0x86C1	U+24D2	# CIRCLED LATIN SMALL LETTER C	[2000]
+0x86C2	U+24D3	# CIRCLED LATIN SMALL LETTER D	[2000]
+0x86C3	U+24D4	# CIRCLED LATIN SMALL LETTER E	[2000]
+0x86C4	U+24D5	# CIRCLED LATIN SMALL LETTER F	[2000]
+0x86C5	U+24D6	# CIRCLED LATIN SMALL LETTER G	[2000]
+0x86C6	U+24D7	# CIRCLED LATIN SMALL LETTER H	[2000]
+0x86C7	U+24D8	# CIRCLED LATIN SMALL LETTER I	[2000]
+0x86C8	U+24D9	# CIRCLED LATIN SMALL LETTER J	[2000]
+0x86C9	U+24DA	# CIRCLED LATIN SMALL LETTER K	[2000]
+0x86CA	U+24DB	# CIRCLED LATIN SMALL LETTER L	[2000]
+0x86CB	U+24DC	# CIRCLED LATIN SMALL LETTER M	[2000]
+0x86CC	U+24DD	# CIRCLED LATIN SMALL LETTER N	[2000]
+0x86CD	U+24DE	# CIRCLED LATIN SMALL LETTER O	[2000]
+0x86CE	U+24DF	# CIRCLED LATIN SMALL LETTER P	[2000]
+0x86CF	U+24E0	# CIRCLED LATIN SMALL LETTER Q	[2000]
+0x86D0	U+24E1	# CIRCLED LATIN SMALL LETTER R	[2000]
+0x86D1	U+24E2	# CIRCLED LATIN SMALL LETTER S	[2000]
+0x86D2	U+24E3	# CIRCLED LATIN SMALL LETTER T	[2000]
+0x86D3	U+24E4	# CIRCLED LATIN SMALL LETTER U	[2000]
+0x86D4	U+24E5	# CIRCLED LATIN SMALL LETTER V	[2000]
+0x86D5	U+24E6	# CIRCLED LATIN SMALL LETTER W	[2000]
+0x86D6	U+24E7	# CIRCLED LATIN SMALL LETTER X	[2000]
+0x86D7	U+24E8	# CIRCLED LATIN SMALL LETTER Y	[2000]
+0x86D8	U+24E9	# CIRCLED LATIN SMALL LETTER Z	[2000]
+0x86D9	U+32D0	# CIRCLED KATAKANA A	[2000]
+0x86DA	U+32D1	# CIRCLED KATAKANA I	[2000]
+0x86DB	U+32D2	# CIRCLED KATAKANA U	[2000]
+0x86DC	U+32D3	# CIRCLED KATAKANA E	[2000]
+0x86DD	U+32D4	# CIRCLED KATAKANA O	[2000]
+0x86DE	U+32D5	# CIRCLED KATAKANA KA	[2000]
+0x86DF	U+32D6	# CIRCLED KATAKANA KI	[2000]
+0x86E0	U+32D7	# CIRCLED KATAKANA KU	[2000]
+0x86E1	U+32D8	# CIRCLED KATAKANA KE	[2000]
+0x86E2	U+32D9	# CIRCLED KATAKANA KO	[2000]
+0x86E3	U+32DA	# CIRCLED KATAKANA SA	[2000]
+0x86E4	U+32DB	# CIRCLED KATAKANA SI	[2000]
+0x86E5	U+32DC	# CIRCLED KATAKANA SU	[2000]
+0x86E6	U+32DD	# CIRCLED KATAKANA SE	[2000]
+0x86E7	U+32DE	# CIRCLED KATAKANA SO	[2000]
+0x86E8	U+32DF	# CIRCLED KATAKANA TA	[2000]
+0x86E9	U+32E0	# CIRCLED KATAKANA TI	[2000]
+0x86EA	U+32E1	# CIRCLED KATAKANA TU	[2000]
+0x86EB	U+32E2	# CIRCLED KATAKANA TE	[2000]
+0x86EC	U+32E3	# CIRCLED KATAKANA TO	[2000]
+0x86ED	U+32FA	# CIRCLED KATAKANA RO	[2000]
+0x86EE	U+32E9	# CIRCLED KATAKANA HA	[2000]
+0x86EF	U+32E5	# CIRCLED KATAKANA NI	[2000]
+0x86F0	U+32ED	# CIRCLED KATAKANA HO	[2000]
+0x86F1	U+32EC	# CIRCLED KATAKANA HE	[2000]
+0x86F2		# <reserved>
+0x86F3		# <reserved>
+0x86F4		# <reserved>
+0x86F5		# <reserved>
+0x86F6		# <reserved>
+0x86F7		# <reserved>
+0x86F8		# <reserved>
+0x86F9		# <reserved>
+0x86FA		# <reserved>
+0x86FB	U+2051	# TWO ASTERISKS ALIGNED VERTICALLY	[2000]	[Unicode3.2]
+0x86FC	U+2042	# ASTERISM	[2000]
+0x8740	U+2460	# CIRCLED DIGIT ONE	[2000]
+0x8741	U+2461	# CIRCLED DIGIT TWO	[2000]
+0x8742	U+2462	# CIRCLED DIGIT THREE	[2000]
+0x8743	U+2463	# CIRCLED DIGIT FOUR	[2000]
+0x8744	U+2464	# CIRCLED DIGIT FIVE	[2000]
+0x8745	U+2465	# CIRCLED DIGIT SIX	[2000]
+0x8746	U+2466	# CIRCLED DIGIT SEVEN	[2000]
+0x8747	U+2467	# CIRCLED DIGIT EIGHT	[2000]
+0x8748	U+2468	# CIRCLED DIGIT NINE	[2000]
+0x8749	U+2469	# CIRCLED NUMBER TEN	[2000]
+0x874A	U+246A	# CIRCLED NUMBER ELEVEN	[2000]
+0x874B	U+246B	# CIRCLED NUMBER TWELVE	[2000]
+0x874C	U+246C	# CIRCLED NUMBER THIRTEEN	[2000]
+0x874D	U+246D	# CIRCLED NUMBER FOURTEEN	[2000]
+0x874E	U+246E	# CIRCLED NUMBER FIFTEEN	[2000]
+0x874F	U+246F	# CIRCLED NUMBER SIXTEEN	[2000]
+0x8750	U+2470	# CIRCLED NUMBER SEVENTEEN	[2000]
+0x8751	U+2471	# CIRCLED NUMBER EIGHTEEN	[2000]
+0x8752	U+2472	# CIRCLED NUMBER NINETEEN	[2000]
+0x8753	U+2473	# CIRCLED NUMBER TWENTY	[2000]
+0x8754	U+2160	# ROMAN NUMERAL ONE	[2000]
+0x8755	U+2161	# ROMAN NUMERAL TWO	[2000]
+0x8756	U+2162	# ROMAN NUMERAL THREE	[2000]
+0x8757	U+2163	# ROMAN NUMERAL FOUR	[2000]
+0x8758	U+2164	# ROMAN NUMERAL FIVE	[2000]
+0x8759	U+2165	# ROMAN NUMERAL SIX	[2000]
+0x875A	U+2166	# ROMAN NUMERAL SEVEN	[2000]
+0x875B	U+2167	# ROMAN NUMERAL EIGHT	[2000]
+0x875C	U+2168	# ROMAN NUMERAL NINE	[2000]
+0x875D	U+2169	# ROMAN NUMERAL TEN	[2000]
+0x875E	U+216A	# ROMAN NUMERAL ELEVEN	[2000]
+0x875F	U+3349	# SQUARE MIRI	[2000]
+0x8760	U+3314	# SQUARE KIRO	[2000]
+0x8761	U+3322	# SQUARE SENTI	[2000]
+0x8762	U+334D	# SQUARE MEETORU	[2000]
+0x8763	U+3318	# SQUARE GURAMU	[2000]
+0x8764	U+3327	# SQUARE TON	[2000]
+0x8765	U+3303	# SQUARE AARU	[2000]
+0x8766	U+3336	# SQUARE HEKUTAARU	[2000]
+0x8767	U+3351	# SQUARE RITTORU	[2000]
+0x8768	U+3357	# SQUARE WATTO	[2000]
+0x8769	U+330D	# SQUARE KARORII	[2000]
+0x876A	U+3326	# SQUARE DORU	[2000]
+0x876B	U+3323	# SQUARE SENTO	[2000]
+0x876C	U+332B	# SQUARE PAASENTO	[2000]
+0x876D	U+334A	# SQUARE MIRIBAARU	[2000]
+0x876E	U+333B	# SQUARE PEEZI	[2000]
+0x876F	U+339C	# SQUARE MM	[2000]
+0x8770	U+339D	# SQUARE CM	[2000]
+0x8771	U+339E	# SQUARE KM	[2000]
+0x8772	U+338E	# SQUARE MG	[2000]
+0x8773	U+338F	# SQUARE KG	[2000]
+0x8774	U+33C4	# SQUARE CC	[2000]
+0x8775	U+33A1	# SQUARE M SQUARED	[2000]
+0x8776	U+216B	# ROMAN NUMERAL TWELVE	[2000]
+0x8777		# <reserved>
+0x8778		# <reserved>
+0x8779		# <reserved>
+0x877A		# <reserved>
+0x877B		# <reserved>
+0x877C		# <reserved>
+0x877D		# <reserved>
+0x877E	U+337B	# SQUARE ERA NAME HEISEI	[2000]
+0x8780	U+301D	# REVERSED DOUBLE PRIME QUOTATION MARK	[2000]
+0x8781	U+301F	# LOW DOUBLE PRIME QUOTATION MARK	[2000]
+0x8782	U+2116	# NUMERO SIGN	[2000]
+0x8783	U+33CD	# SQUARE KK	[2000]
+0x8784	U+2121	# TELEPHONE SIGN	[2000]
+0x8785	U+32A4	# CIRCLED IDEOGRAPH HIGH	[2000]
+0x8786	U+32A5	# CIRCLED IDEOGRAPH CENTRE	[2000]
+0x8787	U+32A6	# CIRCLED IDEOGRAPH LOW	[2000]
+0x8788	U+32A7	# CIRCLED IDEOGRAPH LEFT	[2000]
+0x8789	U+32A8	# CIRCLED IDEOGRAPH RIGHT	[2000]
+0x878A	U+3231	# PARENTHESIZED IDEOGRAPH STOCK	[2000]
+0x878B	U+3232	# PARENTHESIZED IDEOGRAPH HAVE	[2000]
+0x878C	U+3239	# PARENTHESIZED IDEOGRAPH REPRESENT	[2000]
+0x878D	U+337E	# SQUARE ERA NAME MEIZI	[2000]
+0x878E	U+337D	# SQUARE ERA NAME TAISYOU	[2000]
+0x878F	U+337C	# SQUARE ERA NAME SYOUWA	[2000]
+0x8790		# <reserved>	Windows: U+2252
+0x8791		# <reserved>	Windows: U+2261
+0x8792		# <reserved>	Windows: U+222B
+0x8793	U+222E	# CONTOUR INTEGRAL	[2000]
+0x8794		# <reserved>	Windows: U+2211
+0x8795		# <reserved>	Windows: U+221A
+0x8796		# <reserved>	Windows: U+22A5
+0x8797		# <reserved>	Windows: U+2220
+0x8798	U+221F	# RIGHT ANGLE	[2000]
+0x8799	U+22BF	# RIGHT TRIANGLE	[2000]
+0x879A		# <reserved>	Windows: U+2235
+0x879B		# <reserved>	Windows: U+2229
+0x879C		# <reserved>	Windows: U+222A
+0x879D	U+2756	# BLACK DIAMOND MINUS WHITE X	[2000]
+0x879E	U+261E	# WHITE RIGHT POINTING INDEX	[2000]
+0x879F	U+4FF1	# <cjk>	[2004]
+0x87A0	U+2000B	# <cjk>	[2000]	[Unicode3.1]
+0x87A1	U+3402	# <cjk>	[2000]
+0x87A2	U+4E28	# <cjk>	[2000]
+0x87A3	U+4E2F	# <cjk>	[2000]
+0x87A4	U+4E30	# <cjk>	[2000]
+0x87A5	U+4E8D	# <cjk>	[2000]
+0x87A6	U+4EE1	# <cjk>	[2000]
+0x87A7	U+4EFD	# <cjk>	[2000]
+0x87A8	U+4EFF	# <cjk>	[2000]
+0x87A9	U+4F03	# <cjk>	[2000]
+0x87AA	U+4F0B	# <cjk>	[2000]
+0x87AB	U+4F60	# <cjk>	[2000]
+0x87AC	U+4F48	# <cjk>	[2000]
+0x87AD	U+4F49	# <cjk>	[2000]
+0x87AE	U+4F56	# <cjk>	[2000]
+0x87AF	U+4F5F	# <cjk>	[2000]
+0x87B0	U+4F6A	# <cjk>	[2000]
+0x87B1	U+4F6C	# <cjk>	[2000]
+0x87B2	U+4F7E	# <cjk>	[2000]
+0x87B3	U+4F8A	# <cjk>	[2000]
+0x87B4	U+4F94	# <cjk>	[2000]
+0x87B5	U+4F97	# <cjk>	[2000]
+0x87B6	U+FA30	# CJK COMPATIBILITY IDEOGRAPH-FA30	[2000]	[Unicode3.2]
+0x87B7	U+4FC9	# <cjk>	[2000]
+0x87B8	U+4FE0	# <cjk>	[2000]
+0x87B9	U+5001	# <cjk>	[2000]
+0x87BA	U+5002	# <cjk>	[2000]
+0x87BB	U+500E	# <cjk>	[2000]
+0x87BC	U+5018	# <cjk>	[2000]
+0x87BD	U+5027	# <cjk>	[2000]
+0x87BE	U+502E	# <cjk>	[2000]
+0x87BF	U+5040	# <cjk>	[2000]
+0x87C0	U+503B	# <cjk>	[2000]
+0x87C1	U+5041	# <cjk>	[2000]
+0x87C2	U+5094	# <cjk>	[2000]
+0x87C3	U+50CC	# <cjk>	[2000]
+0x87C4	U+50F2	# <cjk>	[2000]
+0x87C5	U+50D0	# <cjk>	[2000]
+0x87C6	U+50E6	# <cjk>	[2000]
+0x87C7	U+FA31	# CJK COMPATIBILITY IDEOGRAPH-FA31	[2000]	[Unicode3.2]
+0x87C8	U+5106	# <cjk>	[2000]
+0x87C9	U+5103	# <cjk>	[2000]
+0x87CA	U+510B	# <cjk>	[2000]
+0x87CB	U+511E	# <cjk>	[2000]
+0x87CC	U+5135	# <cjk>	[2000]
+0x87CD	U+514A	# <cjk>	[2000]
+0x87CE	U+FA32	# CJK COMPATIBILITY IDEOGRAPH-FA32	[2000]	[Unicode3.2]
+0x87CF	U+5155	# <cjk>	[2000]
+0x87D0	U+5157	# <cjk>	[2000]
+0x87D1	U+34B5	# <cjk>	[2000]
+0x87D2	U+519D	# <cjk>	[2000]
+0x87D3	U+51C3	# <cjk>	[2000]
+0x87D4	U+51CA	# <cjk>	[2000]
+0x87D5	U+51DE	# <cjk>	[2000]
+0x87D6	U+51E2	# <cjk>	[2000]
+0x87D7	U+51EE	# <cjk>	[2000]
+0x87D8	U+5201	# <cjk>	[2000]
+0x87D9	U+34DB	# <cjk>	[2000]
+0x87DA	U+5213	# <cjk>	[2000]
+0x87DB	U+5215	# <cjk>	[2000]
+0x87DC	U+5249	# <cjk>	[2000]
+0x87DD	U+5257	# <cjk>	[2000]
+0x87DE	U+5261	# <cjk>	[2000]
+0x87DF	U+5293	# <cjk>	[2000]
+0x87E0	U+52C8	# <cjk>	[2000]
+0x87E1	U+FA33	# CJK COMPATIBILITY IDEOGRAPH-FA33	[2000]	[Unicode3.2]
+0x87E2	U+52CC	# <cjk>	[2000]
+0x87E3	U+52D0	# <cjk>	[2000]
+0x87E4	U+52D6	# <cjk>	[2000]
+0x87E5	U+52DB	# <cjk>	[2000]
+0x87E6	U+FA34	# CJK COMPATIBILITY IDEOGRAPH-FA34	[2000]	[Unicode3.2]
+0x87E7	U+52F0	# <cjk>	[2000]
+0x87E8	U+52FB	# <cjk>	[2000]
+0x87E9	U+5300	# <cjk>	[2000]
+0x87EA	U+5307	# <cjk>	[2000]
+0x87EB	U+531C	# <cjk>	[2000]
+0x87EC	U+FA35	# CJK COMPATIBILITY IDEOGRAPH-FA35	[2000]	[Unicode3.2]
+0x87ED	U+5361	# <cjk>	[2000]
+0x87EE	U+5363	# <cjk>	[2000]
+0x87EF	U+537D	# <cjk>	[2000]
+0x87F0	U+5393	# <cjk>	[2000]
+0x87F1	U+539D	# <cjk>	[2000]
+0x87F2	U+53B2	# <cjk>	[2000]
+0x87F3	U+5412	# <cjk>	[2000]
+0x87F4	U+5427	# <cjk>	[2000]
+0x87F5	U+544D	# <cjk>	[2000]
+0x87F6	U+549C	# <cjk>	[2000]
+0x87F7	U+546B	# <cjk>	[2000]
+0x87F8	U+5474	# <cjk>	[2000]
+0x87F9	U+547F	# <cjk>	[2000]
+0x87FA	U+5488	# <cjk>	[2000]
+0x87FB	U+5496	# <cjk>	[2000]
+0x87FC	U+54A1	# <cjk>	[2000]
+0x8840	U+54A9	# <cjk>	[2000]
+0x8841	U+54C6	# <cjk>	[2000]
+0x8842	U+54FF	# <cjk>	[2000]
+0x8843	U+550E	# <cjk>	[2000]
+0x8844	U+552B	# <cjk>	[2000]
+0x8845	U+5535	# <cjk>	[2000]
+0x8846	U+5550	# <cjk>	[2000]
+0x8847	U+555E	# <cjk>	[2000]
+0x8848	U+5581	# <cjk>	[2000]
+0x8849	U+5586	# <cjk>	[2000]
+0x884A	U+558E	# <cjk>	[2000]
+0x884B	U+FA36	# CJK COMPATIBILITY IDEOGRAPH-FA36	[2000]	[Unicode3.2]
+0x884C	U+55AD	# <cjk>	[2000]
+0x884D	U+55CE	# <cjk>	[2000]
+0x884E	U+FA37	# CJK COMPATIBILITY IDEOGRAPH-FA37	[2000]	[Unicode3.2]
+0x884F	U+5608	# <cjk>	[2000]
+0x8850	U+560E	# <cjk>	[2000]
+0x8851	U+563B	# <cjk>	[2000]
+0x8852	U+5649	# <cjk>	[2000]
+0x8853	U+5676	# <cjk>	[2000]
+0x8854	U+5666	# <cjk>	[2000]
+0x8855	U+FA38	# CJK COMPATIBILITY IDEOGRAPH-FA38	[2000]	[Unicode3.2]
+0x8856	U+566F	# <cjk>	[2000]
+0x8857	U+5671	# <cjk>	[2000]
+0x8858	U+5672	# <cjk>	[2000]
+0x8859	U+5699	# <cjk>	[2000]
+0x885A	U+569E	# <cjk>	[2000]
+0x885B	U+56A9	# <cjk>	[2000]
+0x885C	U+56AC	# <cjk>	[2000]
+0x885D	U+56B3	# <cjk>	[2000]
+0x885E	U+56C9	# <cjk>	[2000]
+0x885F	U+56CA	# <cjk>	[2000]
+0x8860	U+570A	# <cjk>	[2000]
+0x8861	U+2123D	# <cjk>	[2000]	[Unicode3.1]
+0x8862	U+5721	# <cjk>	[2000]
+0x8863	U+572F	# <cjk>	[2000]
+0x8864	U+5733	# <cjk>	[2000]
+0x8865	U+5734	# <cjk>	[2000]
+0x8866	U+5770	# <cjk>	[2000]
+0x8867	U+5777	# <cjk>	[2000]
+0x8868	U+577C	# <cjk>	[2000]
+0x8869	U+579C	# <cjk>	[2000]
+0x886A	U+FA0F	# CJK COMPATIBILITY IDEOGRAPH-FA0F	[2000]
+0x886B	U+2131B	# <cjk>	[2000]	[Unicode3.1]
+0x886C	U+57B8	# <cjk>	[2000]
+0x886D	U+57C7	# <cjk>	[2000]
+0x886E	U+57C8	# <cjk>	[2000]
+0x886F	U+57CF	# <cjk>	[2000]
+0x8870	U+57E4	# <cjk>	[2000]
+0x8871	U+57ED	# <cjk>	[2000]
+0x8872	U+57F5	# <cjk>	[2000]
+0x8873	U+57F6	# <cjk>	[2000]
+0x8874	U+57FF	# <cjk>	[2000]
+0x8875	U+5809	# <cjk>	[2000]
+0x8876	U+FA10	# CJK COMPATIBILITY IDEOGRAPH-FA10	[2000]
+0x8877	U+5861	# <cjk>	[2000]
+0x8878	U+5864	# <cjk>	[2000]
+0x8879	U+FA39	# CJK COMPATIBILITY IDEOGRAPH-FA39	[2000]	[Unicode3.2]
+0x887A	U+587C	# <cjk>	[2000]
+0x887B	U+5889	# <cjk>	[2000]
+0x887C	U+589E	# <cjk>	[2000]
+0x887D	U+FA3A	# CJK COMPATIBILITY IDEOGRAPH-FA3A	[2000]	[Unicode3.2]
+0x887E	U+58A9	# <cjk>	[2000]
+0x8880	U+2146E	# <cjk>	[2000]	[Unicode3.1]
+0x8881	U+58D2	# <cjk>	[2000]
+0x8882	U+58CE	# <cjk>	[2000]
+0x8883	U+58D4	# <cjk>	[2000]
+0x8884	U+58DA	# <cjk>	[2000]
+0x8885	U+58E0	# <cjk>	[2000]
+0x8886	U+58E9	# <cjk>	[2000]
+0x8887	U+590C	# <cjk>	[2000]
+0x8888	U+8641	# <cjk>	[2000]
+0x8889	U+595D	# <cjk>	[2000]
+0x888A	U+596D	# <cjk>	[2000]
+0x888B	U+598B	# <cjk>	[2000]
+0x888C	U+5992	# <cjk>	[2000]
+0x888D	U+59A4	# <cjk>	[2000]
+0x888E	U+59C3	# <cjk>	[2000]
+0x888F	U+59D2	# <cjk>	[2000]
+0x8890	U+59DD	# <cjk>	[2000]
+0x8891	U+5A13	# <cjk>	[2000]
+0x8892	U+5A23	# <cjk>	[2000]
+0x8893	U+5A67	# <cjk>	[2000]
+0x8894	U+5A6D	# <cjk>	[2000]
+0x8895	U+5A77	# <cjk>	[2000]
+0x8896	U+5A7E	# <cjk>	[2000]
+0x8897	U+5A84	# <cjk>	[2000]
+0x8898	U+5A9E	# <cjk>	[2000]
+0x8899	U+5AA7	# <cjk>	[2000]
+0x889A	U+5AC4	# <cjk>	[2000]
+0x889B	U+218BD	# <cjk>	[2000]	[Unicode3.1]
+0x889C	U+5B19	# <cjk>	[2000]
+0x889D	U+5B25	# <cjk>	[2000]
+0x889E	U+525D	# <cjk>	[2004]
+0x889F	U+4E9C	# <cjk>
+0x88A0	U+5516	# <cjk>
+0x88A1	U+5A03	# <cjk>
+0x88A2	U+963F	# <cjk>
+0x88A3	U+54C0	# <cjk>
+0x88A4	U+611B	# <cjk>
+0x88A5	U+6328	# <cjk>
+0x88A6	U+59F6	# <cjk>
+0x88A7	U+9022	# <cjk>
+0x88A8	U+8475	# <cjk>
+0x88A9	U+831C	# <cjk>
+0x88AA	U+7A50	# <cjk>
+0x88AB	U+60AA	# <cjk>
+0x88AC	U+63E1	# <cjk>
+0x88AD	U+6E25	# <cjk>
+0x88AE	U+65ED	# <cjk>
+0x88AF	U+8466	# <cjk>
+0x88B0	U+82A6	# <cjk>
+0x88B1	U+9BF5	# <cjk>
+0x88B2	U+6893	# <cjk>
+0x88B3	U+5727	# <cjk>
+0x88B4	U+65A1	# <cjk>
+0x88B5	U+6271	# <cjk>
+0x88B6	U+5B9B	# <cjk>
+0x88B7	U+59D0	# <cjk>
+0x88B8	U+867B	# <cjk>
+0x88B9	U+98F4	# <cjk>
+0x88BA	U+7D62	# <cjk>
+0x88BB	U+7DBE	# <cjk>
+0x88BC	U+9B8E	# <cjk>
+0x88BD	U+6216	# <cjk>
+0x88BE	U+7C9F	# <cjk>
+0x88BF	U+88B7	# <cjk>
+0x88C0	U+5B89	# <cjk>
+0x88C1	U+5EB5	# <cjk>
+0x88C2	U+6309	# <cjk>
+0x88C3	U+6697	# <cjk>
+0x88C4	U+6848	# <cjk>
+0x88C5	U+95C7	# <cjk>
+0x88C6	U+978D	# <cjk>
+0x88C7	U+674F	# <cjk>
+0x88C8	U+4EE5	# <cjk>
+0x88C9	U+4F0A	# <cjk>
+0x88CA	U+4F4D	# <cjk>
+0x88CB	U+4F9D	# <cjk>
+0x88CC	U+5049	# <cjk>
+0x88CD	U+56F2	# <cjk>
+0x88CE	U+5937	# <cjk>
+0x88CF	U+59D4	# <cjk>
+0x88D0	U+5A01	# <cjk>
+0x88D1	U+5C09	# <cjk>
+0x88D2	U+60DF	# <cjk>
+0x88D3	U+610F	# <cjk>
+0x88D4	U+6170	# <cjk>
+0x88D5	U+6613	# <cjk>
+0x88D6	U+6905	# <cjk>
+0x88D7	U+70BA	# <cjk>
+0x88D8	U+754F	# <cjk>
+0x88D9	U+7570	# <cjk>
+0x88DA	U+79FB	# <cjk>
+0x88DB	U+7DAD	# <cjk>
+0x88DC	U+7DEF	# <cjk>
+0x88DD	U+80C3	# <cjk>
+0x88DE	U+840E	# <cjk>
+0x88DF	U+8863	# <cjk>
+0x88E0	U+8B02	# <cjk>
+0x88E1	U+9055	# <cjk>
+0x88E2	U+907A	# <cjk>
+0x88E3	U+533B	# <cjk>
+0x88E4	U+4E95	# <cjk>
+0x88E5	U+4EA5	# <cjk>
+0x88E6	U+57DF	# <cjk>
+0x88E7	U+80B2	# <cjk>
+0x88E8	U+90C1	# <cjk>
+0x88E9	U+78EF	# <cjk>
+0x88EA	U+4E00	# <cjk>
+0x88EB	U+58F1	# <cjk>
+0x88EC	U+6EA2	# <cjk>
+0x88ED	U+9038	# <cjk>
+0x88EE	U+7A32	# <cjk>
+0x88EF	U+8328	# <cjk>
+0x88F0	U+828B	# <cjk>
+0x88F1	U+9C2F	# <cjk>
+0x88F2	U+5141	# <cjk>
+0x88F3	U+5370	# <cjk>
+0x88F4	U+54BD	# <cjk>
+0x88F5	U+54E1	# <cjk>
+0x88F6	U+56E0	# <cjk>
+0x88F7	U+59FB	# <cjk>
+0x88F8	U+5F15	# <cjk>
+0x88F9	U+98F2	# <cjk>
+0x88FA	U+6DEB	# <cjk>
+0x88FB	U+80E4	# <cjk>
+0x88FC	U+852D	# <cjk>
+0x8940	U+9662	# <cjk>
+0x8941	U+9670	# <cjk>
+0x8942	U+96A0	# <cjk>
+0x8943	U+97FB	# <cjk>
+0x8944	U+540B	# <cjk>
+0x8945	U+53F3	# <cjk>
+0x8946	U+5B87	# <cjk>
+0x8947	U+70CF	# <cjk>
+0x8948	U+7FBD	# <cjk>
+0x8949	U+8FC2	# <cjk>
+0x894A	U+96E8	# <cjk>
+0x894B	U+536F	# <cjk>
+0x894C	U+9D5C	# <cjk>
+0x894D	U+7ABA	# <cjk>
+0x894E	U+4E11	# <cjk>
+0x894F	U+7893	# <cjk>
+0x8950	U+81FC	# <cjk>
+0x8951	U+6E26	# <cjk>
+0x8952	U+5618	# <cjk>
+0x8953	U+5504	# <cjk>
+0x8954	U+6B1D	# <cjk>
+0x8955	U+851A	# <cjk>
+0x8956	U+9C3B	# <cjk>
+0x8957	U+59E5	# <cjk>
+0x8958	U+53A9	# <cjk>
+0x8959	U+6D66	# <cjk>
+0x895A	U+74DC	# <cjk>
+0x895B	U+958F	# <cjk>
+0x895C	U+5642	# <cjk>
+0x895D	U+4E91	# <cjk>
+0x895E	U+904B	# <cjk>
+0x895F	U+96F2	# <cjk>
+0x8960	U+834F	# <cjk>
+0x8961	U+990C	# <cjk>
+0x8962	U+53E1	# <cjk>
+0x8963	U+55B6	# <cjk>
+0x8964	U+5B30	# <cjk>
+0x8965	U+5F71	# <cjk>
+0x8966	U+6620	# <cjk>
+0x8967	U+66F3	# <cjk>
+0x8968	U+6804	# <cjk>
+0x8969	U+6C38	# <cjk>
+0x896A	U+6CF3	# <cjk>
+0x896B	U+6D29	# <cjk>
+0x896C	U+745B	# <cjk>
+0x896D	U+76C8	# <cjk>
+0x896E	U+7A4E	# <cjk>
+0x896F	U+9834	# <cjk>
+0x8970	U+82F1	# <cjk>
+0x8971	U+885B	# <cjk>
+0x8972	U+8A60	# <cjk>
+0x8973	U+92ED	# <cjk>
+0x8974	U+6DB2	# <cjk>
+0x8975	U+75AB	# <cjk>
+0x8976	U+76CA	# <cjk>
+0x8977	U+99C5	# <cjk>
+0x8978	U+60A6	# <cjk>
+0x8979	U+8B01	# <cjk>
+0x897A	U+8D8A	# <cjk>
+0x897B	U+95B2	# <cjk>
+0x897C	U+698E	# <cjk>
+0x897D	U+53AD	# <cjk>
+0x897E	U+5186	# <cjk>
+0x8980	U+5712	# <cjk>
+0x8981	U+5830	# <cjk>
+0x8982	U+5944	# <cjk>
+0x8983	U+5BB4	# <cjk>
+0x8984	U+5EF6	# <cjk>
+0x8985	U+6028	# <cjk>
+0x8986	U+63A9	# <cjk>
+0x8987	U+63F4	# <cjk>
+0x8988	U+6CBF	# <cjk>
+0x8989	U+6F14	# <cjk>
+0x898A	U+708E	# <cjk>
+0x898B	U+7114	# <cjk>
+0x898C	U+7159	# <cjk>
+0x898D	U+71D5	# <cjk>
+0x898E	U+733F	# <cjk>
+0x898F	U+7E01	# <cjk>
+0x8990	U+8276	# <cjk>
+0x8991	U+82D1	# <cjk>
+0x8992	U+8597	# <cjk>
+0x8993	U+9060	# <cjk>
+0x8994	U+925B	# <cjk>
+0x8995	U+9D1B	# <cjk>
+0x8996	U+5869	# <cjk>
+0x8997	U+65BC	# <cjk>
+0x8998	U+6C5A	# <cjk>
+0x8999	U+7525	# <cjk>
+0x899A	U+51F9	# <cjk>
+0x899B	U+592E	# <cjk>
+0x899C	U+5965	# <cjk>
+0x899D	U+5F80	# <cjk>
+0x899E	U+5FDC	# <cjk>
+0x899F	U+62BC	# <cjk>
+0x89A0	U+65FA	# <cjk>
+0x89A1	U+6A2A	# <cjk>
+0x89A2	U+6B27	# <cjk>
+0x89A3	U+6BB4	# <cjk>
+0x89A4	U+738B	# <cjk>
+0x89A5	U+7FC1	# <cjk>
+0x89A6	U+8956	# <cjk>
+0x89A7	U+9D2C	# <cjk>
+0x89A8	U+9D0E	# <cjk>
+0x89A9	U+9EC4	# <cjk>
+0x89AA	U+5CA1	# <cjk>
+0x89AB	U+6C96	# <cjk>
+0x89AC	U+837B	# <cjk>
+0x89AD	U+5104	# <cjk>
+0x89AE	U+5C4B	# <cjk>
+0x89AF	U+61B6	# <cjk>
+0x89B0	U+81C6	# <cjk>
+0x89B1	U+6876	# <cjk>
+0x89B2	U+7261	# <cjk>
+0x89B3	U+4E59	# <cjk>
+0x89B4	U+4FFA	# <cjk>
+0x89B5	U+5378	# <cjk>
+0x89B6	U+6069	# <cjk>
+0x89B7	U+6E29	# <cjk>
+0x89B8	U+7A4F	# <cjk>
+0x89B9	U+97F3	# <cjk>
+0x89BA	U+4E0B	# <cjk>
+0x89BB	U+5316	# <cjk>
+0x89BC	U+4EEE	# <cjk>
+0x89BD	U+4F55	# <cjk>
+0x89BE	U+4F3D	# <cjk>
+0x89BF	U+4FA1	# <cjk>
+0x89C0	U+4F73	# <cjk>
+0x89C1	U+52A0	# <cjk>
+0x89C2	U+53EF	# <cjk>
+0x89C3	U+5609	# <cjk>
+0x89C4	U+590F	# <cjk>
+0x89C5	U+5AC1	# <cjk>
+0x89C6	U+5BB6	# <cjk>
+0x89C7	U+5BE1	# <cjk>
+0x89C8	U+79D1	# <cjk>
+0x89C9	U+6687	# <cjk>
+0x89CA	U+679C	# <cjk>
+0x89CB	U+67B6	# <cjk>
+0x89CC	U+6B4C	# <cjk>
+0x89CD	U+6CB3	# <cjk>
+0x89CE	U+706B	# <cjk>
+0x89CF	U+73C2	# <cjk>
+0x89D0	U+798D	# <cjk>
+0x89D1	U+79BE	# <cjk>
+0x89D2	U+7A3C	# <cjk>
+0x89D3	U+7B87	# <cjk>
+0x89D4	U+82B1	# <cjk>
+0x89D5	U+82DB	# <cjk>
+0x89D6	U+8304	# <cjk>
+0x89D7	U+8377	# <cjk>
+0x89D8	U+83EF	# <cjk>
+0x89D9	U+83D3	# <cjk>
+0x89DA	U+8766	# <cjk>
+0x89DB	U+8AB2	# <cjk>
+0x89DC	U+5629	# <cjk>
+0x89DD	U+8CA8	# <cjk>
+0x89DE	U+8FE6	# <cjk>
+0x89DF	U+904E	# <cjk>
+0x89E0	U+971E	# <cjk>
+0x89E1	U+868A	# <cjk>
+0x89E2	U+4FC4	# <cjk>
+0x89E3	U+5CE8	# <cjk>
+0x89E4	U+6211	# <cjk>
+0x89E5	U+7259	# <cjk>
+0x89E6	U+753B	# <cjk>
+0x89E7	U+81E5	# <cjk>
+0x89E8	U+82BD	# <cjk>
+0x89E9	U+86FE	# <cjk>
+0x89EA	U+8CC0	# <cjk>
+0x89EB	U+96C5	# <cjk>
+0x89EC	U+9913	# <cjk>
+0x89ED	U+99D5	# <cjk>
+0x89EE	U+4ECB	# <cjk>
+0x89EF	U+4F1A	# <cjk>
+0x89F0	U+89E3	# <cjk>
+0x89F1	U+56DE	# <cjk>
+0x89F2	U+584A	# <cjk>
+0x89F3	U+58CA	# <cjk>
+0x89F4	U+5EFB	# <cjk>
+0x89F5	U+5FEB	# <cjk>
+0x89F6	U+602A	# <cjk>
+0x89F7	U+6094	# <cjk>
+0x89F8	U+6062	# <cjk>
+0x89F9	U+61D0	# <cjk>
+0x89FA	U+6212	# <cjk>
+0x89FB	U+62D0	# <cjk>
+0x89FC	U+6539	# <cjk>
+0x8A40	U+9B41	# <cjk>
+0x8A41	U+6666	# <cjk>
+0x8A42	U+68B0	# <cjk>
+0x8A43	U+6D77	# <cjk>
+0x8A44	U+7070	# <cjk>
+0x8A45	U+754C	# <cjk>
+0x8A46	U+7686	# <cjk>
+0x8A47	U+7D75	# <cjk>
+0x8A48	U+82A5	# <cjk>
+0x8A49	U+87F9	# <cjk>
+0x8A4A	U+958B	# <cjk>
+0x8A4B	U+968E	# <cjk>
+0x8A4C	U+8C9D	# <cjk>
+0x8A4D	U+51F1	# <cjk>
+0x8A4E	U+52BE	# <cjk>
+0x8A4F	U+5916	# <cjk>
+0x8A50	U+54B3	# <cjk>
+0x8A51	U+5BB3	# <cjk>
+0x8A52	U+5D16	# <cjk>
+0x8A53	U+6168	# <cjk>
+0x8A54	U+6982	# <cjk>
+0x8A55	U+6DAF	# <cjk>
+0x8A56	U+788D	# <cjk>
+0x8A57	U+84CB	# <cjk>
+0x8A58	U+8857	# <cjk>
+0x8A59	U+8A72	# <cjk>
+0x8A5A	U+93A7	# <cjk>
+0x8A5B	U+9AB8	# <cjk>
+0x8A5C	U+6D6C	# <cjk>
+0x8A5D	U+99A8	# <cjk>
+0x8A5E	U+86D9	# <cjk>
+0x8A5F	U+57A3	# <cjk>
+0x8A60	U+67FF	# <cjk>
+0x8A61	U+86CE	# <cjk>
+0x8A62	U+920E	# <cjk>
+0x8A63	U+5283	# <cjk>
+0x8A64	U+5687	# <cjk>
+0x8A65	U+5404	# <cjk>
+0x8A66	U+5ED3	# <cjk>
+0x8A67	U+62E1	# <cjk>
+0x8A68	U+64B9	# <cjk>
+0x8A69	U+683C	# <cjk>
+0x8A6A	U+6838	# <cjk>
+0x8A6B	U+6BBB	# <cjk>
+0x8A6C	U+7372	# <cjk>
+0x8A6D	U+78BA	# <cjk>
+0x8A6E	U+7A6B	# <cjk>
+0x8A6F	U+899A	# <cjk>
+0x8A70	U+89D2	# <cjk>
+0x8A71	U+8D6B	# <cjk>
+0x8A72	U+8F03	# <cjk>
+0x8A73	U+90ED	# <cjk>
+0x8A74	U+95A3	# <cjk>
+0x8A75	U+9694	# <cjk>
+0x8A76	U+9769	# <cjk>
+0x8A77	U+5B66	# <cjk>
+0x8A78	U+5CB3	# <cjk>
+0x8A79	U+697D	# <cjk>
+0x8A7A	U+984D	# <cjk>
+0x8A7B	U+984E	# <cjk>
+0x8A7C	U+639B	# <cjk>
+0x8A7D	U+7B20	# <cjk>
+0x8A7E	U+6A2B	# <cjk>
+0x8A80	U+6A7F	# <cjk>
+0x8A81	U+68B6	# <cjk>
+0x8A82	U+9C0D	# <cjk>
+0x8A83	U+6F5F	# <cjk>
+0x8A84	U+5272	# <cjk>
+0x8A85	U+559D	# <cjk>
+0x8A86	U+6070	# <cjk>
+0x8A87	U+62EC	# <cjk>
+0x8A88	U+6D3B	# <cjk>
+0x8A89	U+6E07	# <cjk>
+0x8A8A	U+6ED1	# <cjk>
+0x8A8B	U+845B	# <cjk>
+0x8A8C	U+8910	# <cjk>
+0x8A8D	U+8F44	# <cjk>
+0x8A8E	U+4E14	# <cjk>
+0x8A8F	U+9C39	# <cjk>
+0x8A90	U+53F6	# <cjk>
+0x8A91	U+691B	# <cjk>
+0x8A92	U+6A3A	# <cjk>
+0x8A93	U+9784	# <cjk>
+0x8A94	U+682A	# <cjk>
+0x8A95	U+515C	# <cjk>
+0x8A96	U+7AC3	# <cjk>
+0x8A97	U+84B2	# <cjk>
+0x8A98	U+91DC	# <cjk>
+0x8A99	U+938C	# <cjk>
+0x8A9A	U+565B	# <cjk>
+0x8A9B	U+9D28	# <cjk>
+0x8A9C	U+6822	# <cjk>
+0x8A9D	U+8305	# <cjk>
+0x8A9E	U+8431	# <cjk>
+0x8A9F	U+7CA5	# <cjk>
+0x8AA0	U+5208	# <cjk>
+0x8AA1	U+82C5	# <cjk>
+0x8AA2	U+74E6	# <cjk>
+0x8AA3	U+4E7E	# <cjk>
+0x8AA4	U+4F83	# <cjk>
+0x8AA5	U+51A0	# <cjk>
+0x8AA6	U+5BD2	# <cjk>
+0x8AA7	U+520A	# <cjk>
+0x8AA8	U+52D8	# <cjk>
+0x8AA9	U+52E7	# <cjk>
+0x8AAA	U+5DFB	# <cjk>
+0x8AAB	U+559A	# <cjk>
+0x8AAC	U+582A	# <cjk>
+0x8AAD	U+59E6	# <cjk>
+0x8AAE	U+5B8C	# <cjk>
+0x8AAF	U+5B98	# <cjk>
+0x8AB0	U+5BDB	# <cjk>
+0x8AB1	U+5E72	# <cjk>
+0x8AB2	U+5E79	# <cjk>
+0x8AB3	U+60A3	# <cjk>
+0x8AB4	U+611F	# <cjk>
+0x8AB5	U+6163	# <cjk>
+0x8AB6	U+61BE	# <cjk>
+0x8AB7	U+63DB	# <cjk>
+0x8AB8	U+6562	# <cjk>
+0x8AB9	U+67D1	# <cjk>
+0x8ABA	U+6853	# <cjk>
+0x8ABB	U+68FA	# <cjk>
+0x8ABC	U+6B3E	# <cjk>
+0x8ABD	U+6B53	# <cjk>
+0x8ABE	U+6C57	# <cjk>
+0x8ABF	U+6F22	# <cjk>
+0x8AC0	U+6F97	# <cjk>
+0x8AC1	U+6F45	# <cjk>
+0x8AC2	U+74B0	# <cjk>
+0x8AC3	U+7518	# <cjk>
+0x8AC4	U+76E3	# <cjk>
+0x8AC5	U+770B	# <cjk>
+0x8AC6	U+7AFF	# <cjk>
+0x8AC7	U+7BA1	# <cjk>
+0x8AC8	U+7C21	# <cjk>
+0x8AC9	U+7DE9	# <cjk>
+0x8ACA	U+7F36	# <cjk>
+0x8ACB	U+7FF0	# <cjk>
+0x8ACC	U+809D	# <cjk>
+0x8ACD	U+8266	# <cjk>
+0x8ACE	U+839E	# <cjk>
+0x8ACF	U+89B3	# <cjk>
+0x8AD0	U+8ACC	# <cjk>
+0x8AD1	U+8CAB	# <cjk>
+0x8AD2	U+9084	# <cjk>
+0x8AD3	U+9451	# <cjk>
+0x8AD4	U+9593	# <cjk>
+0x8AD5	U+9591	# <cjk>
+0x8AD6	U+95A2	# <cjk>
+0x8AD7	U+9665	# <cjk>
+0x8AD8	U+97D3	# <cjk>
+0x8AD9	U+9928	# <cjk>
+0x8ADA	U+8218	# <cjk>
+0x8ADB	U+4E38	# <cjk>
+0x8ADC	U+542B	# <cjk>
+0x8ADD	U+5CB8	# <cjk>
+0x8ADE	U+5DCC	# <cjk>
+0x8ADF	U+73A9	# <cjk>
+0x8AE0	U+764C	# <cjk>
+0x8AE1	U+773C	# <cjk>
+0x8AE2	U+5CA9	# <cjk>
+0x8AE3	U+7FEB	# <cjk>
+0x8AE4	U+8D0B	# <cjk>
+0x8AE5	U+96C1	# <cjk>
+0x8AE6	U+9811	# <cjk>
+0x8AE7	U+9854	# <cjk>
+0x8AE8	U+9858	# <cjk>
+0x8AE9	U+4F01	# <cjk>
+0x8AEA	U+4F0E	# <cjk>
+0x8AEB	U+5371	# <cjk>
+0x8AEC	U+559C	# <cjk>
+0x8AED	U+5668	# <cjk>
+0x8AEE	U+57FA	# <cjk>
+0x8AEF	U+5947	# <cjk>
+0x8AF0	U+5B09	# <cjk>
+0x8AF1	U+5BC4	# <cjk>
+0x8AF2	U+5C90	# <cjk>
+0x8AF3	U+5E0C	# <cjk>
+0x8AF4	U+5E7E	# <cjk>
+0x8AF5	U+5FCC	# <cjk>
+0x8AF6	U+63EE	# <cjk>
+0x8AF7	U+673A	# <cjk>
+0x8AF8	U+65D7	# <cjk>
+0x8AF9	U+65E2	# <cjk>
+0x8AFA	U+671F	# <cjk>
+0x8AFB	U+68CB	# <cjk>
+0x8AFC	U+68C4	# <cjk>
+0x8B40	U+6A5F	# <cjk>
+0x8B41	U+5E30	# <cjk>
+0x8B42	U+6BC5	# <cjk>
+0x8B43	U+6C17	# <cjk>
+0x8B44	U+6C7D	# <cjk>
+0x8B45	U+757F	# <cjk>
+0x8B46	U+7948	# <cjk>
+0x8B47	U+5B63	# <cjk>
+0x8B48	U+7A00	# <cjk>
+0x8B49	U+7D00	# <cjk>
+0x8B4A	U+5FBD	# <cjk>
+0x8B4B	U+898F	# <cjk>
+0x8B4C	U+8A18	# <cjk>
+0x8B4D	U+8CB4	# <cjk>
+0x8B4E	U+8D77	# <cjk>
+0x8B4F	U+8ECC	# <cjk>
+0x8B50	U+8F1D	# <cjk>
+0x8B51	U+98E2	# <cjk>
+0x8B52	U+9A0E	# <cjk>
+0x8B53	U+9B3C	# <cjk>
+0x8B54	U+4E80	# <cjk>
+0x8B55	U+507D	# <cjk>
+0x8B56	U+5100	# <cjk>
+0x8B57	U+5993	# <cjk>
+0x8B58	U+5B9C	# <cjk>
+0x8B59	U+622F	# <cjk>
+0x8B5A	U+6280	# <cjk>
+0x8B5B	U+64EC	# <cjk>
+0x8B5C	U+6B3A	# <cjk>
+0x8B5D	U+72A0	# <cjk>
+0x8B5E	U+7591	# <cjk>
+0x8B5F	U+7947	# <cjk>
+0x8B60	U+7FA9	# <cjk>
+0x8B61	U+87FB	# <cjk>
+0x8B62	U+8ABC	# <cjk>
+0x8B63	U+8B70	# <cjk>
+0x8B64	U+63AC	# <cjk>
+0x8B65	U+83CA	# <cjk>
+0x8B66	U+97A0	# <cjk>
+0x8B67	U+5409	# <cjk>
+0x8B68	U+5403	# <cjk>
+0x8B69	U+55AB	# <cjk>
+0x8B6A	U+6854	# <cjk>
+0x8B6B	U+6A58	# <cjk>
+0x8B6C	U+8A70	# <cjk>
+0x8B6D	U+7827	# <cjk>
+0x8B6E	U+6775	# <cjk>
+0x8B6F	U+9ECD	# <cjk>
+0x8B70	U+5374	# <cjk>
+0x8B71	U+5BA2	# <cjk>
+0x8B72	U+811A	# <cjk>
+0x8B73	U+8650	# <cjk>
+0x8B74	U+9006	# <cjk>
+0x8B75	U+4E18	# <cjk>
+0x8B76	U+4E45	# <cjk>
+0x8B77	U+4EC7	# <cjk>
+0x8B78	U+4F11	# <cjk>
+0x8B79	U+53CA	# <cjk>
+0x8B7A	U+5438	# <cjk>
+0x8B7B	U+5BAE	# <cjk>
+0x8B7C	U+5F13	# <cjk>
+0x8B7D	U+6025	# <cjk>
+0x8B7E	U+6551	# <cjk>
+0x8B80	U+673D	# <cjk>
+0x8B81	U+6C42	# <cjk>
+0x8B82	U+6C72	# <cjk>
+0x8B83	U+6CE3	# <cjk>
+0x8B84	U+7078	# <cjk>
+0x8B85	U+7403	# <cjk>
+0x8B86	U+7A76	# <cjk>
+0x8B87	U+7AAE	# <cjk>
+0x8B88	U+7B08	# <cjk>
+0x8B89	U+7D1A	# <cjk>
+0x8B8A	U+7CFE	# <cjk>
+0x8B8B	U+7D66	# <cjk>
+0x8B8C	U+65E7	# <cjk>
+0x8B8D	U+725B	# <cjk>
+0x8B8E	U+53BB	# <cjk>
+0x8B8F	U+5C45	# <cjk>
+0x8B90	U+5DE8	# <cjk>
+0x8B91	U+62D2	# <cjk>
+0x8B92	U+62E0	# <cjk>
+0x8B93	U+6319	# <cjk>
+0x8B94	U+6E20	# <cjk>
+0x8B95	U+865A	# <cjk>
+0x8B96	U+8A31	# <cjk>
+0x8B97	U+8DDD	# <cjk>
+0x8B98	U+92F8	# <cjk>
+0x8B99	U+6F01	# <cjk>
+0x8B9A	U+79A6	# <cjk>
+0x8B9B	U+9B5A	# <cjk>
+0x8B9C	U+4EA8	# <cjk>
+0x8B9D	U+4EAB	# <cjk>
+0x8B9E	U+4EAC	# <cjk>
+0x8B9F	U+4F9B	# <cjk>
+0x8BA0	U+4FA0	# <cjk>
+0x8BA1	U+50D1	# <cjk>
+0x8BA2	U+5147	# <cjk>
+0x8BA3	U+7AF6	# <cjk>
+0x8BA4	U+5171	# <cjk>
+0x8BA5	U+51F6	# <cjk>
+0x8BA6	U+5354	# <cjk>
+0x8BA7	U+5321	# <cjk>
+0x8BA8	U+537F	# <cjk>
+0x8BA9	U+53EB	# <cjk>
+0x8BAA	U+55AC	# <cjk>
+0x8BAB	U+5883	# <cjk>
+0x8BAC	U+5CE1	# <cjk>
+0x8BAD	U+5F37	# <cjk>
+0x8BAE	U+5F4A	# <cjk>
+0x8BAF	U+602F	# <cjk>
+0x8BB0	U+6050	# <cjk>
+0x8BB1	U+606D	# <cjk>
+0x8BB2	U+631F	# <cjk>
+0x8BB3	U+6559	# <cjk>
+0x8BB4	U+6A4B	# <cjk>
+0x8BB5	U+6CC1	# <cjk>
+0x8BB6	U+72C2	# <cjk>
+0x8BB7	U+72ED	# <cjk>
+0x8BB8	U+77EF	# <cjk>
+0x8BB9	U+80F8	# <cjk>
+0x8BBA	U+8105	# <cjk>
+0x8BBB	U+8208	# <cjk>
+0x8BBC	U+854E	# <cjk>
+0x8BBD	U+90F7	# <cjk>
+0x8BBE	U+93E1	# <cjk>
+0x8BBF	U+97FF	# <cjk>
+0x8BC0	U+9957	# <cjk>
+0x8BC1	U+9A5A	# <cjk>
+0x8BC2	U+4EF0	# <cjk>
+0x8BC3	U+51DD	# <cjk>
+0x8BC4	U+5C2D	# <cjk>
+0x8BC5	U+6681	# <cjk>
+0x8BC6	U+696D	# <cjk>
+0x8BC7	U+5C40	# <cjk>
+0x8BC8	U+66F2	# <cjk>
+0x8BC9	U+6975	# <cjk>
+0x8BCA	U+7389	# <cjk>
+0x8BCB	U+6850	# <cjk>
+0x8BCC	U+7C81	# <cjk>
+0x8BCD	U+50C5	# <cjk>
+0x8BCE	U+52E4	# <cjk>
+0x8BCF	U+5747	# <cjk>
+0x8BD0	U+5DFE	# <cjk>
+0x8BD1	U+9326	# <cjk>
+0x8BD2	U+65A4	# <cjk>
+0x8BD3	U+6B23	# <cjk>
+0x8BD4	U+6B3D	# <cjk>
+0x8BD5	U+7434	# <cjk>
+0x8BD6	U+7981	# <cjk>
+0x8BD7	U+79BD	# <cjk>
+0x8BD8	U+7B4B	# <cjk>
+0x8BD9	U+7DCA	# <cjk>
+0x8BDA	U+82B9	# <cjk>
+0x8BDB	U+83CC	# <cjk>
+0x8BDC	U+887F	# <cjk>
+0x8BDD	U+895F	# <cjk>
+0x8BDE	U+8B39	# <cjk>
+0x8BDF	U+8FD1	# <cjk>
+0x8BE0	U+91D1	# <cjk>
+0x8BE1	U+541F	# <cjk>
+0x8BE2	U+9280	# <cjk>
+0x8BE3	U+4E5D	# <cjk>
+0x8BE4	U+5036	# <cjk>
+0x8BE5	U+53E5	# <cjk>
+0x8BE6	U+533A	# <cjk>
+0x8BE7	U+72D7	# <cjk>
+0x8BE8	U+7396	# <cjk>
+0x8BE9	U+77E9	# <cjk>
+0x8BEA	U+82E6	# <cjk>
+0x8BEB	U+8EAF	# <cjk>
+0x8BEC	U+99C6	# <cjk>
+0x8BED	U+99C8	# <cjk>
+0x8BEE	U+99D2	# <cjk>
+0x8BEF	U+5177	# <cjk>
+0x8BF0	U+611A	# <cjk>
+0x8BF1	U+865E	# <cjk>
+0x8BF2	U+55B0	# <cjk>
+0x8BF3	U+7A7A	# <cjk>
+0x8BF4	U+5076	# <cjk>
+0x8BF5	U+5BD3	# <cjk>
+0x8BF6	U+9047	# <cjk>
+0x8BF7	U+9685	# <cjk>
+0x8BF8	U+4E32	# <cjk>
+0x8BF9	U+6ADB	# <cjk>
+0x8BFA	U+91E7	# <cjk>
+0x8BFB	U+5C51	# <cjk>
+0x8BFC	U+5C48	# <cjk>
+0x8C40	U+6398	# <cjk>
+0x8C41	U+7A9F	# <cjk>
+0x8C42	U+6C93	# <cjk>
+0x8C43	U+9774	# <cjk>
+0x8C44	U+8F61	# <cjk>
+0x8C45	U+7AAA	# <cjk>
+0x8C46	U+718A	# <cjk>
+0x8C47	U+9688	# <cjk>
+0x8C48	U+7C82	# <cjk>
+0x8C49	U+6817	# <cjk>
+0x8C4A	U+7E70	# <cjk>
+0x8C4B	U+6851	# <cjk>
+0x8C4C	U+936C	# <cjk>
+0x8C4D	U+52F2	# <cjk>
+0x8C4E	U+541B	# <cjk>
+0x8C4F	U+85AB	# <cjk>
+0x8C50	U+8A13	# <cjk>
+0x8C51	U+7FA4	# <cjk>
+0x8C52	U+8ECD	# <cjk>
+0x8C53	U+90E1	# <cjk>
+0x8C54	U+5366	# <cjk>
+0x8C55	U+8888	# <cjk>
+0x8C56	U+7941	# <cjk>
+0x8C57	U+4FC2	# <cjk>
+0x8C58	U+50BE	# <cjk>
+0x8C59	U+5211	# <cjk>
+0x8C5A	U+5144	# <cjk>
+0x8C5B	U+5553	# <cjk>
+0x8C5C	U+572D	# <cjk>
+0x8C5D	U+73EA	# <cjk>
+0x8C5E	U+578B	# <cjk>
+0x8C5F	U+5951	# <cjk>
+0x8C60	U+5F62	# <cjk>
+0x8C61	U+5F84	# <cjk>
+0x8C62	U+6075	# <cjk>
+0x8C63	U+6176	# <cjk>
+0x8C64	U+6167	# <cjk>
+0x8C65	U+61A9	# <cjk>
+0x8C66	U+63B2	# <cjk>
+0x8C67	U+643A	# <cjk>
+0x8C68	U+656C	# <cjk>
+0x8C69	U+666F	# <cjk>
+0x8C6A	U+6842	# <cjk>
+0x8C6B	U+6E13	# <cjk>
+0x8C6C	U+7566	# <cjk>
+0x8C6D	U+7A3D	# <cjk>
+0x8C6E	U+7CFB	# <cjk>
+0x8C6F	U+7D4C	# <cjk>
+0x8C70	U+7D99	# <cjk>
+0x8C71	U+7E4B	# <cjk>
+0x8C72	U+7F6B	# <cjk>
+0x8C73	U+830E	# <cjk>
+0x8C74	U+834A	# <cjk>
+0x8C75	U+86CD	# <cjk>
+0x8C76	U+8A08	# <cjk>
+0x8C77	U+8A63	# <cjk>
+0x8C78	U+8B66	# <cjk>
+0x8C79	U+8EFD	# <cjk>
+0x8C7A	U+981A	# <cjk>
+0x8C7B	U+9D8F	# <cjk>
+0x8C7C	U+82B8	# <cjk>
+0x8C7D	U+8FCE	# <cjk>
+0x8C7E	U+9BE8	# <cjk>
+0x8C80	U+5287	# <cjk>
+0x8C81	U+621F	# <cjk>
+0x8C82	U+6483	# <cjk>
+0x8C83	U+6FC0	# <cjk>
+0x8C84	U+9699	# <cjk>
+0x8C85	U+6841	# <cjk>
+0x8C86	U+5091	# <cjk>
+0x8C87	U+6B20	# <cjk>
+0x8C88	U+6C7A	# <cjk>
+0x8C89	U+6F54	# <cjk>
+0x8C8A	U+7A74	# <cjk>
+0x8C8B	U+7D50	# <cjk>
+0x8C8C	U+8840	# <cjk>
+0x8C8D	U+8A23	# <cjk>
+0x8C8E	U+6708	# <cjk>
+0x8C8F	U+4EF6	# <cjk>
+0x8C90	U+5039	# <cjk>
+0x8C91	U+5026	# <cjk>
+0x8C92	U+5065	# <cjk>
+0x8C93	U+517C	# <cjk>
+0x8C94	U+5238	# <cjk>
+0x8C95	U+5263	# <cjk>
+0x8C96	U+55A7	# <cjk>
+0x8C97	U+570F	# <cjk>
+0x8C98	U+5805	# <cjk>
+0x8C99	U+5ACC	# <cjk>
+0x8C9A	U+5EFA	# <cjk>
+0x8C9B	U+61B2	# <cjk>
+0x8C9C	U+61F8	# <cjk>
+0x8C9D	U+62F3	# <cjk>
+0x8C9E	U+6372	# <cjk>
+0x8C9F	U+691C	# <cjk>
+0x8CA0	U+6A29	# <cjk>
+0x8CA1	U+727D	# <cjk>
+0x8CA2	U+72AC	# <cjk>
+0x8CA3	U+732E	# <cjk>
+0x8CA4	U+7814	# <cjk>
+0x8CA5	U+786F	# <cjk>
+0x8CA6	U+7D79	# <cjk>
+0x8CA7	U+770C	# <cjk>
+0x8CA8	U+80A9	# <cjk>
+0x8CA9	U+898B	# <cjk>
+0x8CAA	U+8B19	# <cjk>
+0x8CAB	U+8CE2	# <cjk>
+0x8CAC	U+8ED2	# <cjk>
+0x8CAD	U+9063	# <cjk>
+0x8CAE	U+9375	# <cjk>
+0x8CAF	U+967A	# <cjk>
+0x8CB0	U+9855	# <cjk>
+0x8CB1	U+9A13	# <cjk>
+0x8CB2	U+9E78	# <cjk>
+0x8CB3	U+5143	# <cjk>
+0x8CB4	U+539F	# <cjk>
+0x8CB5	U+53B3	# <cjk>
+0x8CB6	U+5E7B	# <cjk>
+0x8CB7	U+5F26	# <cjk>
+0x8CB8	U+6E1B	# <cjk>
+0x8CB9	U+6E90	# <cjk>
+0x8CBA	U+7384	# <cjk>
+0x8CBB	U+73FE	# <cjk>
+0x8CBC	U+7D43	# <cjk>
+0x8CBD	U+8237	# <cjk>
+0x8CBE	U+8A00	# <cjk>
+0x8CBF	U+8AFA	# <cjk>
+0x8CC0	U+9650	# <cjk>
+0x8CC1	U+4E4E	# <cjk>
+0x8CC2	U+500B	# <cjk>
+0x8CC3	U+53E4	# <cjk>
+0x8CC4	U+547C	# <cjk>
+0x8CC5	U+56FA	# <cjk>
+0x8CC6	U+59D1	# <cjk>
+0x8CC7	U+5B64	# <cjk>
+0x8CC8	U+5DF1	# <cjk>
+0x8CC9	U+5EAB	# <cjk>
+0x8CCA	U+5F27	# <cjk>
+0x8CCB	U+6238	# <cjk>
+0x8CCC	U+6545	# <cjk>
+0x8CCD	U+67AF	# <cjk>
+0x8CCE	U+6E56	# <cjk>
+0x8CCF	U+72D0	# <cjk>
+0x8CD0	U+7CCA	# <cjk>
+0x8CD1	U+88B4	# <cjk>
+0x8CD2	U+80A1	# <cjk>
+0x8CD3	U+80E1	# <cjk>
+0x8CD4	U+83F0	# <cjk>
+0x8CD5	U+864E	# <cjk>
+0x8CD6	U+8A87	# <cjk>
+0x8CD7	U+8DE8	# <cjk>
+0x8CD8	U+9237	# <cjk>
+0x8CD9	U+96C7	# <cjk>
+0x8CDA	U+9867	# <cjk>
+0x8CDB	U+9F13	# <cjk>
+0x8CDC	U+4E94	# <cjk>
+0x8CDD	U+4E92	# <cjk>
+0x8CDE	U+4F0D	# <cjk>
+0x8CDF	U+5348	# <cjk>
+0x8CE0	U+5449	# <cjk>
+0x8CE1	U+543E	# <cjk>
+0x8CE2	U+5A2F	# <cjk>
+0x8CE3	U+5F8C	# <cjk>
+0x8CE4	U+5FA1	# <cjk>
+0x8CE5	U+609F	# <cjk>
+0x8CE6	U+68A7	# <cjk>
+0x8CE7	U+6A8E	# <cjk>
+0x8CE8	U+745A	# <cjk>
+0x8CE9	U+7881	# <cjk>
+0x8CEA	U+8A9E	# <cjk>
+0x8CEB	U+8AA4	# <cjk>
+0x8CEC	U+8B77	# <cjk>
+0x8CED	U+9190	# <cjk>
+0x8CEE	U+4E5E	# <cjk>
+0x8CEF	U+9BC9	# <cjk>
+0x8CF0	U+4EA4	# <cjk>
+0x8CF1	U+4F7C	# <cjk>
+0x8CF2	U+4FAF	# <cjk>
+0x8CF3	U+5019	# <cjk>
+0x8CF4	U+5016	# <cjk>
+0x8CF5	U+5149	# <cjk>
+0x8CF6	U+516C	# <cjk>
+0x8CF7	U+529F	# <cjk>
+0x8CF8	U+52B9	# <cjk>
+0x8CF9	U+52FE	# <cjk>
+0x8CFA	U+539A	# <cjk>
+0x8CFB	U+53E3	# <cjk>
+0x8CFC	U+5411	# <cjk>
+0x8D40	U+540E	# <cjk>
+0x8D41	U+5589	# <cjk>
+0x8D42	U+5751	# <cjk>
+0x8D43	U+57A2	# <cjk>
+0x8D44	U+597D	# <cjk>
+0x8D45	U+5B54	# <cjk>
+0x8D46	U+5B5D	# <cjk>
+0x8D47	U+5B8F	# <cjk>
+0x8D48	U+5DE5	# <cjk>
+0x8D49	U+5DE7	# <cjk>
+0x8D4A	U+5DF7	# <cjk>
+0x8D4B	U+5E78	# <cjk>
+0x8D4C	U+5E83	# <cjk>
+0x8D4D	U+5E9A	# <cjk>
+0x8D4E	U+5EB7	# <cjk>
+0x8D4F	U+5F18	# <cjk>
+0x8D50	U+6052	# <cjk>
+0x8D51	U+614C	# <cjk>
+0x8D52	U+6297	# <cjk>
+0x8D53	U+62D8	# <cjk>
+0x8D54	U+63A7	# <cjk>
+0x8D55	U+653B	# <cjk>
+0x8D56	U+6602	# <cjk>
+0x8D57	U+6643	# <cjk>
+0x8D58	U+66F4	# <cjk>
+0x8D59	U+676D	# <cjk>
+0x8D5A	U+6821	# <cjk>
+0x8D5B	U+6897	# <cjk>
+0x8D5C	U+69CB	# <cjk>
+0x8D5D	U+6C5F	# <cjk>
+0x8D5E	U+6D2A	# <cjk>
+0x8D5F	U+6D69	# <cjk>
+0x8D60	U+6E2F	# <cjk>
+0x8D61	U+6E9D	# <cjk>
+0x8D62	U+7532	# <cjk>
+0x8D63	U+7687	# <cjk>
+0x8D64	U+786C	# <cjk>
+0x8D65	U+7A3F	# <cjk>
+0x8D66	U+7CE0	# <cjk>
+0x8D67	U+7D05	# <cjk>
+0x8D68	U+7D18	# <cjk>
+0x8D69	U+7D5E	# <cjk>
+0x8D6A	U+7DB1	# <cjk>
+0x8D6B	U+8015	# <cjk>
+0x8D6C	U+8003	# <cjk>
+0x8D6D	U+80AF	# <cjk>
+0x8D6E	U+80B1	# <cjk>
+0x8D6F	U+8154	# <cjk>
+0x8D70	U+818F	# <cjk>
+0x8D71	U+822A	# <cjk>
+0x8D72	U+8352	# <cjk>
+0x8D73	U+884C	# <cjk>
+0x8D74	U+8861	# <cjk>
+0x8D75	U+8B1B	# <cjk>
+0x8D76	U+8CA2	# <cjk>
+0x8D77	U+8CFC	# <cjk>
+0x8D78	U+90CA	# <cjk>
+0x8D79	U+9175	# <cjk>
+0x8D7A	U+9271	# <cjk>
+0x8D7B	U+783F	# <cjk>
+0x8D7C	U+92FC	# <cjk>
+0x8D7D	U+95A4	# <cjk>
+0x8D7E	U+964D	# <cjk>
+0x8D80	U+9805	# <cjk>
+0x8D81	U+9999	# <cjk>
+0x8D82	U+9AD8	# <cjk>
+0x8D83	U+9D3B	# <cjk>
+0x8D84	U+525B	# <cjk>
+0x8D85	U+52AB	# <cjk>
+0x8D86	U+53F7	# <cjk>
+0x8D87	U+5408	# <cjk>
+0x8D88	U+58D5	# <cjk>
+0x8D89	U+62F7	# <cjk>
+0x8D8A	U+6FE0	# <cjk>
+0x8D8B	U+8C6A	# <cjk>
+0x8D8C	U+8F5F	# <cjk>
+0x8D8D	U+9EB9	# <cjk>
+0x8D8E	U+514B	# <cjk>
+0x8D8F	U+523B	# <cjk>
+0x8D90	U+544A	# <cjk>
+0x8D91	U+56FD	# <cjk>
+0x8D92	U+7A40	# <cjk>
+0x8D93	U+9177	# <cjk>
+0x8D94	U+9D60	# <cjk>
+0x8D95	U+9ED2	# <cjk>
+0x8D96	U+7344	# <cjk>
+0x8D97	U+6F09	# <cjk>
+0x8D98	U+8170	# <cjk>
+0x8D99	U+7511	# <cjk>
+0x8D9A	U+5FFD	# <cjk>
+0x8D9B	U+60DA	# <cjk>
+0x8D9C	U+9AA8	# <cjk>
+0x8D9D	U+72DB	# <cjk>
+0x8D9E	U+8FBC	# <cjk>
+0x8D9F	U+6B64	# <cjk>
+0x8DA0	U+9803	# <cjk>
+0x8DA1	U+4ECA	# <cjk>
+0x8DA2	U+56F0	# <cjk>
+0x8DA3	U+5764	# <cjk>
+0x8DA4	U+58BE	# <cjk>
+0x8DA5	U+5A5A	# <cjk>
+0x8DA6	U+6068	# <cjk>
+0x8DA7	U+61C7	# <cjk>
+0x8DA8	U+660F	# <cjk>
+0x8DA9	U+6606	# <cjk>
+0x8DAA	U+6839	# <cjk>
+0x8DAB	U+68B1	# <cjk>
+0x8DAC	U+6DF7	# <cjk>
+0x8DAD	U+75D5	# <cjk>
+0x8DAE	U+7D3A	# <cjk>
+0x8DAF	U+826E	# <cjk>
+0x8DB0	U+9B42	# <cjk>
+0x8DB1	U+4E9B	# <cjk>
+0x8DB2	U+4F50	# <cjk>
+0x8DB3	U+53C9	# <cjk>
+0x8DB4	U+5506	# <cjk>
+0x8DB5	U+5D6F	# <cjk>
+0x8DB6	U+5DE6	# <cjk>
+0x8DB7	U+5DEE	# <cjk>
+0x8DB8	U+67FB	# <cjk>
+0x8DB9	U+6C99	# <cjk>
+0x8DBA	U+7473	# <cjk>
+0x8DBB	U+7802	# <cjk>
+0x8DBC	U+8A50	# <cjk>
+0x8DBD	U+9396	# <cjk>
+0x8DBE	U+88DF	# <cjk>
+0x8DBF	U+5750	# <cjk>
+0x8DC0	U+5EA7	# <cjk>
+0x8DC1	U+632B	# <cjk>
+0x8DC2	U+50B5	# <cjk>
+0x8DC3	U+50AC	# <cjk>
+0x8DC4	U+518D	# <cjk>
+0x8DC5	U+6700	# <cjk>
+0x8DC6	U+54C9	# <cjk>
+0x8DC7	U+585E	# <cjk>
+0x8DC8	U+59BB	# <cjk>
+0x8DC9	U+5BB0	# <cjk>
+0x8DCA	U+5F69	# <cjk>
+0x8DCB	U+624D	# <cjk>
+0x8DCC	U+63A1	# <cjk>
+0x8DCD	U+683D	# <cjk>
+0x8DCE	U+6B73	# <cjk>
+0x8DCF	U+6E08	# <cjk>
+0x8DD0	U+707D	# <cjk>
+0x8DD1	U+91C7	# <cjk>
+0x8DD2	U+7280	# <cjk>
+0x8DD3	U+7815	# <cjk>
+0x8DD4	U+7826	# <cjk>
+0x8DD5	U+796D	# <cjk>
+0x8DD6	U+658E	# <cjk>
+0x8DD7	U+7D30	# <cjk>
+0x8DD8	U+83DC	# <cjk>
+0x8DD9	U+88C1	# <cjk>
+0x8DDA	U+8F09	# <cjk>
+0x8DDB	U+969B	# <cjk>
+0x8DDC	U+5264	# <cjk>
+0x8DDD	U+5728	# <cjk>
+0x8DDE	U+6750	# <cjk>
+0x8DDF	U+7F6A	# <cjk>
+0x8DE0	U+8CA1	# <cjk>
+0x8DE1	U+51B4	# <cjk>
+0x8DE2	U+5742	# <cjk>
+0x8DE3	U+962A	# <cjk>
+0x8DE4	U+583A	# <cjk>
+0x8DE5	U+698A	# <cjk>
+0x8DE6	U+80B4	# <cjk>
+0x8DE7	U+54B2	# <cjk>
+0x8DE8	U+5D0E	# <cjk>
+0x8DE9	U+57FC	# <cjk>
+0x8DEA	U+7895	# <cjk>
+0x8DEB	U+9DFA	# <cjk>
+0x8DEC	U+4F5C	# <cjk>
+0x8DED	U+524A	# <cjk>
+0x8DEE	U+548B	# <cjk>
+0x8DEF	U+643E	# <cjk>
+0x8DF0	U+6628	# <cjk>
+0x8DF1	U+6714	# <cjk>
+0x8DF2	U+67F5	# <cjk>
+0x8DF3	U+7A84	# <cjk>
+0x8DF4	U+7B56	# <cjk>
+0x8DF5	U+7D22	# <cjk>
+0x8DF6	U+932F	# <cjk>
+0x8DF7	U+685C	# <cjk>
+0x8DF8	U+9BAD	# <cjk>
+0x8DF9	U+7B39	# <cjk>
+0x8DFA	U+5319	# <cjk>
+0x8DFB	U+518A	# <cjk>
+0x8DFC	U+5237	# <cjk>
+0x8E40	U+5BDF	# <cjk>
+0x8E41	U+62F6	# <cjk>
+0x8E42	U+64AE	# <cjk>
+0x8E43	U+64E6	# <cjk>
+0x8E44	U+672D	# <cjk>
+0x8E45	U+6BBA	# <cjk>
+0x8E46	U+85A9	# <cjk>
+0x8E47	U+96D1	# <cjk>
+0x8E48	U+7690	# <cjk>
+0x8E49	U+9BD6	# <cjk>
+0x8E4A	U+634C	# <cjk>
+0x8E4B	U+9306	# <cjk>
+0x8E4C	U+9BAB	# <cjk>
+0x8E4D	U+76BF	# <cjk>
+0x8E4E	U+6652	# <cjk>
+0x8E4F	U+4E09	# <cjk>
+0x8E50	U+5098	# <cjk>
+0x8E51	U+53C2	# <cjk>
+0x8E52	U+5C71	# <cjk>
+0x8E53	U+60E8	# <cjk>
+0x8E54	U+6492	# <cjk>
+0x8E55	U+6563	# <cjk>
+0x8E56	U+685F	# <cjk>
+0x8E57	U+71E6	# <cjk>
+0x8E58	U+73CA	# <cjk>
+0x8E59	U+7523	# <cjk>
+0x8E5A	U+7B97	# <cjk>
+0x8E5B	U+7E82	# <cjk>
+0x8E5C	U+8695	# <cjk>
+0x8E5D	U+8B83	# <cjk>
+0x8E5E	U+8CDB	# <cjk>
+0x8E5F	U+9178	# <cjk>
+0x8E60	U+9910	# <cjk>
+0x8E61	U+65AC	# <cjk>
+0x8E62	U+66AB	# <cjk>
+0x8E63	U+6B8B	# <cjk>
+0x8E64	U+4ED5	# <cjk>
+0x8E65	U+4ED4	# <cjk>
+0x8E66	U+4F3A	# <cjk>
+0x8E67	U+4F7F	# <cjk>
+0x8E68	U+523A	# <cjk>
+0x8E69	U+53F8	# <cjk>
+0x8E6A	U+53F2	# <cjk>
+0x8E6B	U+55E3	# <cjk>
+0x8E6C	U+56DB	# <cjk>
+0x8E6D	U+58EB	# <cjk>
+0x8E6E	U+59CB	# <cjk>
+0x8E6F	U+59C9	# <cjk>
+0x8E70	U+59FF	# <cjk>
+0x8E71	U+5B50	# <cjk>
+0x8E72	U+5C4D	# <cjk>
+0x8E73	U+5E02	# <cjk>
+0x8E74	U+5E2B	# <cjk>
+0x8E75	U+5FD7	# <cjk>
+0x8E76	U+601D	# <cjk>
+0x8E77	U+6307	# <cjk>
+0x8E78	U+652F	# <cjk>
+0x8E79	U+5B5C	# <cjk>
+0x8E7A	U+65AF	# <cjk>
+0x8E7B	U+65BD	# <cjk>
+0x8E7C	U+65E8	# <cjk>
+0x8E7D	U+679D	# <cjk>
+0x8E7E	U+6B62	# <cjk>
+0x8E80	U+6B7B	# <cjk>
+0x8E81	U+6C0F	# <cjk>
+0x8E82	U+7345	# <cjk>
+0x8E83	U+7949	# <cjk>
+0x8E84	U+79C1	# <cjk>
+0x8E85	U+7CF8	# <cjk>
+0x8E86	U+7D19	# <cjk>
+0x8E87	U+7D2B	# <cjk>
+0x8E88	U+80A2	# <cjk>
+0x8E89	U+8102	# <cjk>
+0x8E8A	U+81F3	# <cjk>
+0x8E8B	U+8996	# <cjk>
+0x8E8C	U+8A5E	# <cjk>
+0x8E8D	U+8A69	# <cjk>
+0x8E8E	U+8A66	# <cjk>
+0x8E8F	U+8A8C	# <cjk>
+0x8E90	U+8AEE	# <cjk>
+0x8E91	U+8CC7	# <cjk>
+0x8E92	U+8CDC	# <cjk>
+0x8E93	U+96CC	# <cjk>
+0x8E94	U+98FC	# <cjk>
+0x8E95	U+6B6F	# <cjk>
+0x8E96	U+4E8B	# <cjk>
+0x8E97	U+4F3C	# <cjk>
+0x8E98	U+4F8D	# <cjk>
+0x8E99	U+5150	# <cjk>
+0x8E9A	U+5B57	# <cjk>
+0x8E9B	U+5BFA	# <cjk>
+0x8E9C	U+6148	# <cjk>
+0x8E9D	U+6301	# <cjk>
+0x8E9E	U+6642	# <cjk>
+0x8E9F	U+6B21	# <cjk>
+0x8EA0	U+6ECB	# <cjk>
+0x8EA1	U+6CBB	# <cjk>
+0x8EA2	U+723E	# <cjk>
+0x8EA3	U+74BD	# <cjk>
+0x8EA4	U+75D4	# <cjk>
+0x8EA5	U+78C1	# <cjk>
+0x8EA6	U+793A	# <cjk>
+0x8EA7	U+800C	# <cjk>
+0x8EA8	U+8033	# <cjk>
+0x8EA9	U+81EA	# <cjk>
+0x8EAA	U+8494	# <cjk>
+0x8EAB	U+8F9E	# <cjk>
+0x8EAC	U+6C50	# <cjk>
+0x8EAD	U+9E7F	# <cjk>
+0x8EAE	U+5F0F	# <cjk>
+0x8EAF	U+8B58	# <cjk>
+0x8EB0	U+9D2B	# <cjk>
+0x8EB1	U+7AFA	# <cjk>
+0x8EB2	U+8EF8	# <cjk>
+0x8EB3	U+5B8D	# <cjk>
+0x8EB4	U+96EB	# <cjk>
+0x8EB5	U+4E03	# <cjk>
+0x8EB6	U+53F1	# <cjk>
+0x8EB7	U+57F7	# <cjk>
+0x8EB8	U+5931	# <cjk>
+0x8EB9	U+5AC9	# <cjk>
+0x8EBA	U+5BA4	# <cjk>
+0x8EBB	U+6089	# <cjk>
+0x8EBC	U+6E7F	# <cjk>
+0x8EBD	U+6F06	# <cjk>
+0x8EBE	U+75BE	# <cjk>
+0x8EBF	U+8CEA	# <cjk>
+0x8EC0	U+5B9F	# <cjk>
+0x8EC1	U+8500	# <cjk>
+0x8EC2	U+7BE0	# <cjk>
+0x8EC3	U+5072	# <cjk>
+0x8EC4	U+67F4	# <cjk>
+0x8EC5	U+829D	# <cjk>
+0x8EC6	U+5C61	# <cjk>
+0x8EC7	U+854A	# <cjk>
+0x8EC8	U+7E1E	# <cjk>
+0x8EC9	U+820E	# <cjk>
+0x8ECA	U+5199	# <cjk>
+0x8ECB	U+5C04	# <cjk>
+0x8ECC	U+6368	# <cjk>
+0x8ECD	U+8D66	# <cjk>
+0x8ECE	U+659C	# <cjk>
+0x8ECF	U+716E	# <cjk>
+0x8ED0	U+793E	# <cjk>
+0x8ED1	U+7D17	# <cjk>
+0x8ED2	U+8005	# <cjk>
+0x8ED3	U+8B1D	# <cjk>
+0x8ED4	U+8ECA	# <cjk>
+0x8ED5	U+906E	# <cjk>
+0x8ED6	U+86C7	# <cjk>
+0x8ED7	U+90AA	# <cjk>
+0x8ED8	U+501F	# <cjk>
+0x8ED9	U+52FA	# <cjk>
+0x8EDA	U+5C3A	# <cjk>
+0x8EDB	U+6753	# <cjk>
+0x8EDC	U+707C	# <cjk>
+0x8EDD	U+7235	# <cjk>
+0x8EDE	U+914C	# <cjk>
+0x8EDF	U+91C8	# <cjk>
+0x8EE0	U+932B	# <cjk>
+0x8EE1	U+82E5	# <cjk>
+0x8EE2	U+5BC2	# <cjk>
+0x8EE3	U+5F31	# <cjk>
+0x8EE4	U+60F9	# <cjk>
+0x8EE5	U+4E3B	# <cjk>
+0x8EE6	U+53D6	# <cjk>
+0x8EE7	U+5B88	# <cjk>
+0x8EE8	U+624B	# <cjk>
+0x8EE9	U+6731	# <cjk>
+0x8EEA	U+6B8A	# <cjk>
+0x8EEB	U+72E9	# <cjk>
+0x8EEC	U+73E0	# <cjk>
+0x8EED	U+7A2E	# <cjk>
+0x8EEE	U+816B	# <cjk>
+0x8EEF	U+8DA3	# <cjk>
+0x8EF0	U+9152	# <cjk>
+0x8EF1	U+9996	# <cjk>
+0x8EF2	U+5112	# <cjk>
+0x8EF3	U+53D7	# <cjk>
+0x8EF4	U+546A	# <cjk>
+0x8EF5	U+5BFF	# <cjk>
+0x8EF6	U+6388	# <cjk>
+0x8EF7	U+6A39	# <cjk>
+0x8EF8	U+7DAC	# <cjk>
+0x8EF9	U+9700	# <cjk>
+0x8EFA	U+56DA	# <cjk>
+0x8EFB	U+53CE	# <cjk>
+0x8EFC	U+5468	# <cjk>
+0x8F40	U+5B97	# <cjk>
+0x8F41	U+5C31	# <cjk>
+0x8F42	U+5DDE	# <cjk>
+0x8F43	U+4FEE	# <cjk>
+0x8F44	U+6101	# <cjk>
+0x8F45	U+62FE	# <cjk>
+0x8F46	U+6D32	# <cjk>
+0x8F47	U+79C0	# <cjk>
+0x8F48	U+79CB	# <cjk>
+0x8F49	U+7D42	# <cjk>
+0x8F4A	U+7E4D	# <cjk>
+0x8F4B	U+7FD2	# <cjk>
+0x8F4C	U+81ED	# <cjk>
+0x8F4D	U+821F	# <cjk>
+0x8F4E	U+8490	# <cjk>
+0x8F4F	U+8846	# <cjk>
+0x8F50	U+8972	# <cjk>
+0x8F51	U+8B90	# <cjk>
+0x8F52	U+8E74	# <cjk>
+0x8F53	U+8F2F	# <cjk>
+0x8F54	U+9031	# <cjk>
+0x8F55	U+914B	# <cjk>
+0x8F56	U+916C	# <cjk>
+0x8F57	U+96C6	# <cjk>
+0x8F58	U+919C	# <cjk>
+0x8F59	U+4EC0	# <cjk>
+0x8F5A	U+4F4F	# <cjk>
+0x8F5B	U+5145	# <cjk>
+0x8F5C	U+5341	# <cjk>
+0x8F5D	U+5F93	# <cjk>
+0x8F5E	U+620E	# <cjk>
+0x8F5F	U+67D4	# <cjk>
+0x8F60	U+6C41	# <cjk>
+0x8F61	U+6E0B	# <cjk>
+0x8F62	U+7363	# <cjk>
+0x8F63	U+7E26	# <cjk>
+0x8F64	U+91CD	# <cjk>
+0x8F65	U+9283	# <cjk>
+0x8F66	U+53D4	# <cjk>
+0x8F67	U+5919	# <cjk>
+0x8F68	U+5BBF	# <cjk>
+0x8F69	U+6DD1	# <cjk>
+0x8F6A	U+795D	# <cjk>
+0x8F6B	U+7E2E	# <cjk>
+0x8F6C	U+7C9B	# <cjk>
+0x8F6D	U+587E	# <cjk>
+0x8F6E	U+719F	# <cjk>
+0x8F6F	U+51FA	# <cjk>
+0x8F70	U+8853	# <cjk>
+0x8F71	U+8FF0	# <cjk>
+0x8F72	U+4FCA	# <cjk>
+0x8F73	U+5CFB	# <cjk>
+0x8F74	U+6625	# <cjk>
+0x8F75	U+77AC	# <cjk>
+0x8F76	U+7AE3	# <cjk>
+0x8F77	U+821C	# <cjk>
+0x8F78	U+99FF	# <cjk>
+0x8F79	U+51C6	# <cjk>
+0x8F7A	U+5FAA	# <cjk>
+0x8F7B	U+65EC	# <cjk>
+0x8F7C	U+696F	# <cjk>
+0x8F7D	U+6B89	# <cjk>
+0x8F7E	U+6DF3	# <cjk>
+0x8F80	U+6E96	# <cjk>
+0x8F81	U+6F64	# <cjk>
+0x8F82	U+76FE	# <cjk>
+0x8F83	U+7D14	# <cjk>
+0x8F84	U+5DE1	# <cjk>
+0x8F85	U+9075	# <cjk>
+0x8F86	U+9187	# <cjk>
+0x8F87	U+9806	# <cjk>
+0x8F88	U+51E6	# <cjk>
+0x8F89	U+521D	# <cjk>
+0x8F8A	U+6240	# <cjk>
+0x8F8B	U+6691	# <cjk>
+0x8F8C	U+66D9	# <cjk>
+0x8F8D	U+6E1A	# <cjk>
+0x8F8E	U+5EB6	# <cjk>
+0x8F8F	U+7DD2	# <cjk>
+0x8F90	U+7F72	# <cjk>
+0x8F91	U+66F8	# <cjk>
+0x8F92	U+85AF	# <cjk>
+0x8F93	U+85F7	# <cjk>
+0x8F94	U+8AF8	# <cjk>
+0x8F95	U+52A9	# <cjk>
+0x8F96	U+53D9	# <cjk>
+0x8F97	U+5973	# <cjk>
+0x8F98	U+5E8F	# <cjk>
+0x8F99	U+5F90	# <cjk>
+0x8F9A	U+6055	# <cjk>
+0x8F9B	U+92E4	# <cjk>
+0x8F9C	U+9664	# <cjk>
+0x8F9D	U+50B7	# <cjk>
+0x8F9E	U+511F	# <cjk>
+0x8F9F	U+52DD	# <cjk>
+0x8FA0	U+5320	# <cjk>
+0x8FA1	U+5347	# <cjk>
+0x8FA2	U+53EC	# <cjk>
+0x8FA3	U+54E8	# <cjk>
+0x8FA4	U+5546	# <cjk>
+0x8FA5	U+5531	# <cjk>
+0x8FA6	U+5617	# <cjk>
+0x8FA7	U+5968	# <cjk>
+0x8FA8	U+59BE	# <cjk>
+0x8FA9	U+5A3C	# <cjk>
+0x8FAA	U+5BB5	# <cjk>
+0x8FAB	U+5C06	# <cjk>
+0x8FAC	U+5C0F	# <cjk>
+0x8FAD	U+5C11	# <cjk>
+0x8FAE	U+5C1A	# <cjk>
+0x8FAF	U+5E84	# <cjk>
+0x8FB0	U+5E8A	# <cjk>
+0x8FB1	U+5EE0	# <cjk>
+0x8FB2	U+5F70	# <cjk>
+0x8FB3	U+627F	# <cjk>
+0x8FB4	U+6284	# <cjk>
+0x8FB5	U+62DB	# <cjk>
+0x8FB6	U+638C	# <cjk>
+0x8FB7	U+6377	# <cjk>
+0x8FB8	U+6607	# <cjk>
+0x8FB9	U+660C	# <cjk>
+0x8FBA	U+662D	# <cjk>
+0x8FBB	U+6676	# <cjk>
+0x8FBC	U+677E	# <cjk>
+0x8FBD	U+68A2	# <cjk>
+0x8FBE	U+6A1F	# <cjk>
+0x8FBF	U+6A35	# <cjk>
+0x8FC0	U+6CBC	# <cjk>
+0x8FC1	U+6D88	# <cjk>
+0x8FC2	U+6E09	# <cjk>
+0x8FC3	U+6E58	# <cjk>
+0x8FC4	U+713C	# <cjk>
+0x8FC5	U+7126	# <cjk>
+0x8FC6	U+7167	# <cjk>
+0x8FC7	U+75C7	# <cjk>
+0x8FC8	U+7701	# <cjk>
+0x8FC9	U+785D	# <cjk>
+0x8FCA	U+7901	# <cjk>
+0x8FCB	U+7965	# <cjk>
+0x8FCC	U+79F0	# <cjk>
+0x8FCD	U+7AE0	# <cjk>
+0x8FCE	U+7B11	# <cjk>
+0x8FCF	U+7CA7	# <cjk>
+0x8FD0	U+7D39	# <cjk>
+0x8FD1	U+8096	# <cjk>
+0x8FD2	U+83D6	# <cjk>
+0x8FD3	U+848B	# <cjk>
+0x8FD4	U+8549	# <cjk>
+0x8FD5	U+885D	# <cjk>
+0x8FD6	U+88F3	# <cjk>
+0x8FD7	U+8A1F	# <cjk>
+0x8FD8	U+8A3C	# <cjk>
+0x8FD9	U+8A54	# <cjk>
+0x8FDA	U+8A73	# <cjk>
+0x8FDB	U+8C61	# <cjk>
+0x8FDC	U+8CDE	# <cjk>
+0x8FDD	U+91A4	# <cjk>
+0x8FDE	U+9266	# <cjk>
+0x8FDF	U+937E	# <cjk>
+0x8FE0	U+9418	# <cjk>
+0x8FE1	U+969C	# <cjk>
+0x8FE2	U+9798	# <cjk>
+0x8FE3	U+4E0A	# <cjk>
+0x8FE4	U+4E08	# <cjk>
+0x8FE5	U+4E1E	# <cjk>
+0x8FE6	U+4E57	# <cjk>
+0x8FE7	U+5197	# <cjk>
+0x8FE8	U+5270	# <cjk>
+0x8FE9	U+57CE	# <cjk>
+0x8FEA	U+5834	# <cjk>
+0x8FEB	U+58CC	# <cjk>
+0x8FEC	U+5B22	# <cjk>
+0x8FED	U+5E38	# <cjk>
+0x8FEE	U+60C5	# <cjk>
+0x8FEF	U+64FE	# <cjk>
+0x8FF0	U+6761	# <cjk>
+0x8FF1	U+6756	# <cjk>
+0x8FF2	U+6D44	# <cjk>
+0x8FF3	U+72B6	# <cjk>
+0x8FF4	U+7573	# <cjk>
+0x8FF5	U+7A63	# <cjk>
+0x8FF6	U+84B8	# <cjk>
+0x8FF7	U+8B72	# <cjk>
+0x8FF8	U+91B8	# <cjk>
+0x8FF9	U+9320	# <cjk>
+0x8FFA	U+5631	# <cjk>
+0x8FFB	U+57F4	# <cjk>
+0x8FFC	U+98FE	# <cjk>
+0x9040	U+62ED	# <cjk>
+0x9041	U+690D	# <cjk>
+0x9042	U+6B96	# <cjk>
+0x9043	U+71ED	# <cjk>
+0x9044	U+7E54	# <cjk>
+0x9045	U+8077	# <cjk>
+0x9046	U+8272	# <cjk>
+0x9047	U+89E6	# <cjk>
+0x9048	U+98DF	# <cjk>
+0x9049	U+8755	# <cjk>
+0x904A	U+8FB1	# <cjk>
+0x904B	U+5C3B	# <cjk>
+0x904C	U+4F38	# <cjk>
+0x904D	U+4FE1	# <cjk>
+0x904E	U+4FB5	# <cjk>
+0x904F	U+5507	# <cjk>
+0x9050	U+5A20	# <cjk>
+0x9051	U+5BDD	# <cjk>
+0x9052	U+5BE9	# <cjk>
+0x9053	U+5FC3	# <cjk>
+0x9054	U+614E	# <cjk>
+0x9055	U+632F	# <cjk>
+0x9056	U+65B0	# <cjk>
+0x9057	U+664B	# <cjk>
+0x9058	U+68EE	# <cjk>
+0x9059	U+699B	# <cjk>
+0x905A	U+6D78	# <cjk>
+0x905B	U+6DF1	# <cjk>
+0x905C	U+7533	# <cjk>
+0x905D	U+75B9	# <cjk>
+0x905E	U+771F	# <cjk>
+0x905F	U+795E	# <cjk>
+0x9060	U+79E6	# <cjk>
+0x9061	U+7D33	# <cjk>
+0x9062	U+81E3	# <cjk>
+0x9063	U+82AF	# <cjk>
+0x9064	U+85AA	# <cjk>
+0x9065	U+89AA	# <cjk>
+0x9066	U+8A3A	# <cjk>
+0x9067	U+8EAB	# <cjk>
+0x9068	U+8F9B	# <cjk>
+0x9069	U+9032	# <cjk>
+0x906A	U+91DD	# <cjk>
+0x906B	U+9707	# <cjk>
+0x906C	U+4EBA	# <cjk>
+0x906D	U+4EC1	# <cjk>
+0x906E	U+5203	# <cjk>
+0x906F	U+5875	# <cjk>
+0x9070	U+58EC	# <cjk>
+0x9071	U+5C0B	# <cjk>
+0x9072	U+751A	# <cjk>
+0x9073	U+5C3D	# <cjk>
+0x9074	U+814E	# <cjk>
+0x9075	U+8A0A	# <cjk>
+0x9076	U+8FC5	# <cjk>
+0x9077	U+9663	# <cjk>
+0x9078	U+976D	# <cjk>
+0x9079	U+7B25	# <cjk>
+0x907A	U+8ACF	# <cjk>
+0x907B	U+9808	# <cjk>
+0x907C	U+9162	# <cjk>
+0x907D	U+56F3	# <cjk>
+0x907E	U+53A8	# <cjk>
+0x9080	U+9017	# <cjk>
+0x9081	U+5439	# <cjk>
+0x9082	U+5782	# <cjk>
+0x9083	U+5E25	# <cjk>
+0x9084	U+63A8	# <cjk>
+0x9085	U+6C34	# <cjk>
+0x9086	U+708A	# <cjk>
+0x9087	U+7761	# <cjk>
+0x9088	U+7C8B	# <cjk>
+0x9089	U+7FE0	# <cjk>
+0x908A	U+8870	# <cjk>
+0x908B	U+9042	# <cjk>
+0x908C	U+9154	# <cjk>
+0x908D	U+9310	# <cjk>
+0x908E	U+9318	# <cjk>
+0x908F	U+968F	# <cjk>
+0x9090	U+745E	# <cjk>
+0x9091	U+9AC4	# <cjk>
+0x9092	U+5D07	# <cjk>
+0x9093	U+5D69	# <cjk>
+0x9094	U+6570	# <cjk>
+0x9095	U+67A2	# <cjk>
+0x9096	U+8DA8	# <cjk>
+0x9097	U+96DB	# <cjk>
+0x9098	U+636E	# <cjk>
+0x9099	U+6749	# <cjk>
+0x909A	U+6919	# <cjk>
+0x909B	U+83C5	# <cjk>
+0x909C	U+9817	# <cjk>
+0x909D	U+96C0	# <cjk>
+0x909E	U+88FE	# <cjk>
+0x909F	U+6F84	# <cjk>
+0x90A0	U+647A	# <cjk>
+0x90A1	U+5BF8	# <cjk>
+0x90A2	U+4E16	# <cjk>
+0x90A3	U+702C	# <cjk>
+0x90A4	U+755D	# <cjk>
+0x90A5	U+662F	# <cjk>
+0x90A6	U+51C4	# <cjk>
+0x90A7	U+5236	# <cjk>
+0x90A8	U+52E2	# <cjk>
+0x90A9	U+59D3	# <cjk>
+0x90AA	U+5F81	# <cjk>
+0x90AB	U+6027	# <cjk>
+0x90AC	U+6210	# <cjk>
+0x90AD	U+653F	# <cjk>
+0x90AE	U+6574	# <cjk>
+0x90AF	U+661F	# <cjk>
+0x90B0	U+6674	# <cjk>
+0x90B1	U+68F2	# <cjk>
+0x90B2	U+6816	# <cjk>
+0x90B3	U+6B63	# <cjk>
+0x90B4	U+6E05	# <cjk>
+0x90B5	U+7272	# <cjk>
+0x90B6	U+751F	# <cjk>
+0x90B7	U+76DB	# <cjk>
+0x90B8	U+7CBE	# <cjk>
+0x90B9	U+8056	# <cjk>
+0x90BA	U+58F0	# <cjk>
+0x90BB	U+88FD	# <cjk>
+0x90BC	U+897F	# <cjk>
+0x90BD	U+8AA0	# <cjk>
+0x90BE	U+8A93	# <cjk>
+0x90BF	U+8ACB	# <cjk>
+0x90C0	U+901D	# <cjk>
+0x90C1	U+9192	# <cjk>
+0x90C2	U+9752	# <cjk>
+0x90C3	U+9759	# <cjk>
+0x90C4	U+6589	# <cjk>
+0x90C5	U+7A0E	# <cjk>
+0x90C6	U+8106	# <cjk>
+0x90C7	U+96BB	# <cjk>
+0x90C8	U+5E2D	# <cjk>
+0x90C9	U+60DC	# <cjk>
+0x90CA	U+621A	# <cjk>
+0x90CB	U+65A5	# <cjk>
+0x90CC	U+6614	# <cjk>
+0x90CD	U+6790	# <cjk>
+0x90CE	U+77F3	# <cjk>
+0x90CF	U+7A4D	# <cjk>
+0x90D0	U+7C4D	# <cjk>
+0x90D1	U+7E3E	# <cjk>
+0x90D2	U+810A	# <cjk>
+0x90D3	U+8CAC	# <cjk>
+0x90D4	U+8D64	# <cjk>
+0x90D5	U+8DE1	# <cjk>
+0x90D6	U+8E5F	# <cjk>
+0x90D7	U+78A9	# <cjk>
+0x90D8	U+5207	# <cjk>
+0x90D9	U+62D9	# <cjk>
+0x90DA	U+63A5	# <cjk>
+0x90DB	U+6442	# <cjk>
+0x90DC	U+6298	# <cjk>
+0x90DD	U+8A2D	# <cjk>
+0x90DE	U+7A83	# <cjk>
+0x90DF	U+7BC0	# <cjk>
+0x90E0	U+8AAC	# <cjk>
+0x90E1	U+96EA	# <cjk>
+0x90E2	U+7D76	# <cjk>
+0x90E3	U+820C	# <cjk>
+0x90E4	U+8749	# <cjk>
+0x90E5	U+4ED9	# <cjk>
+0x90E6	U+5148	# <cjk>
+0x90E7	U+5343	# <cjk>
+0x90E8	U+5360	# <cjk>
+0x90E9	U+5BA3	# <cjk>
+0x90EA	U+5C02	# <cjk>
+0x90EB	U+5C16	# <cjk>
+0x90EC	U+5DDD	# <cjk>
+0x90ED	U+6226	# <cjk>
+0x90EE	U+6247	# <cjk>
+0x90EF	U+64B0	# <cjk>
+0x90F0	U+6813	# <cjk>
+0x90F1	U+6834	# <cjk>
+0x90F2	U+6CC9	# <cjk>
+0x90F3	U+6D45	# <cjk>
+0x90F4	U+6D17	# <cjk>
+0x90F5	U+67D3	# <cjk>
+0x90F6	U+6F5C	# <cjk>
+0x90F7	U+714E	# <cjk>
+0x90F8	U+717D	# <cjk>
+0x90F9	U+65CB	# <cjk>
+0x90FA	U+7A7F	# <cjk>
+0x90FB	U+7BAD	# <cjk>
+0x90FC	U+7DDA	# <cjk>
+0x9140	U+7E4A	# <cjk>
+0x9141	U+7FA8	# <cjk>
+0x9142	U+817A	# <cjk>
+0x9143	U+821B	# <cjk>
+0x9144	U+8239	# <cjk>
+0x9145	U+85A6	# <cjk>
+0x9146	U+8A6E	# <cjk>
+0x9147	U+8CCE	# <cjk>
+0x9148	U+8DF5	# <cjk>
+0x9149	U+9078	# <cjk>
+0x914A	U+9077	# <cjk>
+0x914B	U+92AD	# <cjk>
+0x914C	U+9291	# <cjk>
+0x914D	U+9583	# <cjk>
+0x914E	U+9BAE	# <cjk>
+0x914F	U+524D	# <cjk>
+0x9150	U+5584	# <cjk>
+0x9151	U+6F38	# <cjk>
+0x9152	U+7136	# <cjk>
+0x9153	U+5168	# <cjk>
+0x9154	U+7985	# <cjk>
+0x9155	U+7E55	# <cjk>
+0x9156	U+81B3	# <cjk>
+0x9157	U+7CCE	# <cjk>
+0x9158	U+564C	# <cjk>
+0x9159	U+5851	# <cjk>
+0x915A	U+5CA8	# <cjk>
+0x915B	U+63AA	# <cjk>
+0x915C	U+66FE	# <cjk>
+0x915D	U+66FD	# <cjk>
+0x915E	U+695A	# <cjk>
+0x915F	U+72D9	# <cjk>
+0x9160	U+758F	# <cjk>
+0x9161	U+758E	# <cjk>
+0x9162	U+790E	# <cjk>
+0x9163	U+7956	# <cjk>
+0x9164	U+79DF	# <cjk>
+0x9165	U+7C97	# <cjk>
+0x9166	U+7D20	# <cjk>
+0x9167	U+7D44	# <cjk>
+0x9168	U+8607	# <cjk>
+0x9169	U+8A34	# <cjk>
+0x916A	U+963B	# <cjk>
+0x916B	U+9061	# <cjk>
+0x916C	U+9F20	# <cjk>
+0x916D	U+50E7	# <cjk>
+0x916E	U+5275	# <cjk>
+0x916F	U+53CC	# <cjk>
+0x9170	U+53E2	# <cjk>
+0x9171	U+5009	# <cjk>
+0x9172	U+55AA	# <cjk>
+0x9173	U+58EE	# <cjk>
+0x9174	U+594F	# <cjk>
+0x9175	U+723D	# <cjk>
+0x9176	U+5B8B	# <cjk>
+0x9177	U+5C64	# <cjk>
+0x9178	U+531D	# <cjk>
+0x9179	U+60E3	# <cjk>
+0x917A	U+60F3	# <cjk>
+0x917B	U+635C	# <cjk>
+0x917C	U+6383	# <cjk>
+0x917D	U+633F	# <cjk>
+0x917E	U+63BB	# <cjk>
+0x9180	U+64CD	# <cjk>
+0x9181	U+65E9	# <cjk>
+0x9182	U+66F9	# <cjk>
+0x9183	U+5DE3	# <cjk>
+0x9184	U+69CD	# <cjk>
+0x9185	U+69FD	# <cjk>
+0x9186	U+6F15	# <cjk>
+0x9187	U+71E5	# <cjk>
+0x9188	U+4E89	# <cjk>
+0x9189	U+75E9	# <cjk>
+0x918A	U+76F8	# <cjk>
+0x918B	U+7A93	# <cjk>
+0x918C	U+7CDF	# <cjk>
+0x918D	U+7DCF	# <cjk>
+0x918E	U+7D9C	# <cjk>
+0x918F	U+8061	# <cjk>
+0x9190	U+8349	# <cjk>
+0x9191	U+8358	# <cjk>
+0x9192	U+846C	# <cjk>
+0x9193	U+84BC	# <cjk>
+0x9194	U+85FB	# <cjk>
+0x9195	U+88C5	# <cjk>
+0x9196	U+8D70	# <cjk>
+0x9197	U+9001	# <cjk>
+0x9198	U+906D	# <cjk>
+0x9199	U+9397	# <cjk>
+0x919A	U+971C	# <cjk>
+0x919B	U+9A12	# <cjk>
+0x919C	U+50CF	# <cjk>
+0x919D	U+5897	# <cjk>
+0x919E	U+618E	# <cjk>
+0x919F	U+81D3	# <cjk>
+0x91A0	U+8535	# <cjk>
+0x91A1	U+8D08	# <cjk>
+0x91A2	U+9020	# <cjk>
+0x91A3	U+4FC3	# <cjk>
+0x91A4	U+5074	# <cjk>
+0x91A5	U+5247	# <cjk>
+0x91A6	U+5373	# <cjk>
+0x91A7	U+606F	# <cjk>
+0x91A8	U+6349	# <cjk>
+0x91A9	U+675F	# <cjk>
+0x91AA	U+6E2C	# <cjk>
+0x91AB	U+8DB3	# <cjk>
+0x91AC	U+901F	# <cjk>
+0x91AD	U+4FD7	# <cjk>
+0x91AE	U+5C5E	# <cjk>
+0x91AF	U+8CCA	# <cjk>
+0x91B0	U+65CF	# <cjk>
+0x91B1	U+7D9A	# <cjk>
+0x91B2	U+5352	# <cjk>
+0x91B3	U+8896	# <cjk>
+0x91B4	U+5176	# <cjk>
+0x91B5	U+63C3	# <cjk>
+0x91B6	U+5B58	# <cjk>
+0x91B7	U+5B6B	# <cjk>
+0x91B8	U+5C0A	# <cjk>
+0x91B9	U+640D	# <cjk>
+0x91BA	U+6751	# <cjk>
+0x91BB	U+905C	# <cjk>
+0x91BC	U+4ED6	# <cjk>
+0x91BD	U+591A	# <cjk>
+0x91BE	U+592A	# <cjk>
+0x91BF	U+6C70	# <cjk>
+0x91C0	U+8A51	# <cjk>
+0x91C1	U+553E	# <cjk>
+0x91C2	U+5815	# <cjk>
+0x91C3	U+59A5	# <cjk>
+0x91C4	U+60F0	# <cjk>
+0x91C5	U+6253	# <cjk>
+0x91C6	U+67C1	# <cjk>
+0x91C7	U+8235	# <cjk>
+0x91C8	U+6955	# <cjk>
+0x91C9	U+9640	# <cjk>
+0x91CA	U+99C4	# <cjk>
+0x91CB	U+9A28	# <cjk>
+0x91CC	U+4F53	# <cjk>
+0x91CD	U+5806	# <cjk>
+0x91CE	U+5BFE	# <cjk>
+0x91CF	U+8010	# <cjk>
+0x91D0	U+5CB1	# <cjk>
+0x91D1	U+5E2F	# <cjk>
+0x91D2	U+5F85	# <cjk>
+0x91D3	U+6020	# <cjk>
+0x91D4	U+614B	# <cjk>
+0x91D5	U+6234	# <cjk>
+0x91D6	U+66FF	# <cjk>
+0x91D7	U+6CF0	# <cjk>
+0x91D8	U+6EDE	# <cjk>
+0x91D9	U+80CE	# <cjk>
+0x91DA	U+817F	# <cjk>
+0x91DB	U+82D4	# <cjk>
+0x91DC	U+888B	# <cjk>
+0x91DD	U+8CB8	# <cjk>
+0x91DE	U+9000	# <cjk>
+0x91DF	U+902E	# <cjk>
+0x91E0	U+968A	# <cjk>
+0x91E1	U+9EDB	# <cjk>
+0x91E2	U+9BDB	# <cjk>
+0x91E3	U+4EE3	# <cjk>
+0x91E4	U+53F0	# <cjk>
+0x91E5	U+5927	# <cjk>
+0x91E6	U+7B2C	# <cjk>
+0x91E7	U+918D	# <cjk>
+0x91E8	U+984C	# <cjk>
+0x91E9	U+9DF9	# <cjk>
+0x91EA	U+6EDD	# <cjk>
+0x91EB	U+7027	# <cjk>
+0x91EC	U+5353	# <cjk>
+0x91ED	U+5544	# <cjk>
+0x91EE	U+5B85	# <cjk>
+0x91EF	U+6258	# <cjk>
+0x91F0	U+629E	# <cjk>
+0x91F1	U+62D3	# <cjk>
+0x91F2	U+6CA2	# <cjk>
+0x91F3	U+6FEF	# <cjk>
+0x91F4	U+7422	# <cjk>
+0x91F5	U+8A17	# <cjk>
+0x91F6	U+9438	# <cjk>
+0x91F7	U+6FC1	# <cjk>
+0x91F8	U+8AFE	# <cjk>
+0x91F9	U+8338	# <cjk>
+0x91FA	U+51E7	# <cjk>
+0x91FB	U+86F8	# <cjk>
+0x91FC	U+53EA	# <cjk>
+0x9240	U+53E9	# <cjk>
+0x9241	U+4F46	# <cjk>
+0x9242	U+9054	# <cjk>
+0x9243	U+8FB0	# <cjk>
+0x9244	U+596A	# <cjk>
+0x9245	U+8131	# <cjk>
+0x9246	U+5DFD	# <cjk>
+0x9247	U+7AEA	# <cjk>
+0x9248	U+8FBF	# <cjk>
+0x9249	U+68DA	# <cjk>
+0x924A	U+8C37	# <cjk>
+0x924B	U+72F8	# <cjk>
+0x924C	U+9C48	# <cjk>
+0x924D	U+6A3D	# <cjk>
+0x924E	U+8AB0	# <cjk>
+0x924F	U+4E39	# <cjk>
+0x9250	U+5358	# <cjk>
+0x9251	U+5606	# <cjk>
+0x9252	U+5766	# <cjk>
+0x9253	U+62C5	# <cjk>
+0x9254	U+63A2	# <cjk>
+0x9255	U+65E6	# <cjk>
+0x9256	U+6B4E	# <cjk>
+0x9257	U+6DE1	# <cjk>
+0x9258	U+6E5B	# <cjk>
+0x9259	U+70AD	# <cjk>
+0x925A	U+77ED	# <cjk>
+0x925B	U+7AEF	# <cjk>
+0x925C	U+7BAA	# <cjk>
+0x925D	U+7DBB	# <cjk>
+0x925E	U+803D	# <cjk>
+0x925F	U+80C6	# <cjk>
+0x9260	U+86CB	# <cjk>
+0x9261	U+8A95	# <cjk>
+0x9262	U+935B	# <cjk>
+0x9263	U+56E3	# <cjk>
+0x9264	U+58C7	# <cjk>
+0x9265	U+5F3E	# <cjk>
+0x9266	U+65AD	# <cjk>
+0x9267	U+6696	# <cjk>
+0x9268	U+6A80	# <cjk>
+0x9269	U+6BB5	# <cjk>
+0x926A	U+7537	# <cjk>
+0x926B	U+8AC7	# <cjk>
+0x926C	U+5024	# <cjk>
+0x926D	U+77E5	# <cjk>
+0x926E	U+5730	# <cjk>
+0x926F	U+5F1B	# <cjk>
+0x9270	U+6065	# <cjk>
+0x9271	U+667A	# <cjk>
+0x9272	U+6C60	# <cjk>
+0x9273	U+75F4	# <cjk>
+0x9274	U+7A1A	# <cjk>
+0x9275	U+7F6E	# <cjk>
+0x9276	U+81F4	# <cjk>
+0x9277	U+8718	# <cjk>
+0x9278	U+9045	# <cjk>
+0x9279	U+99B3	# <cjk>
+0x927A	U+7BC9	# <cjk>
+0x927B	U+755C	# <cjk>
+0x927C	U+7AF9	# <cjk>
+0x927D	U+7B51	# <cjk>
+0x927E	U+84C4	# <cjk>
+0x9280	U+9010	# <cjk>
+0x9281	U+79E9	# <cjk>
+0x9282	U+7A92	# <cjk>
+0x9283	U+8336	# <cjk>
+0x9284	U+5AE1	# <cjk>
+0x9285	U+7740	# <cjk>
+0x9286	U+4E2D	# <cjk>
+0x9287	U+4EF2	# <cjk>
+0x9288	U+5B99	# <cjk>
+0x9289	U+5FE0	# <cjk>
+0x928A	U+62BD	# <cjk>
+0x928B	U+663C	# <cjk>
+0x928C	U+67F1	# <cjk>
+0x928D	U+6CE8	# <cjk>
+0x928E	U+866B	# <cjk>
+0x928F	U+8877	# <cjk>
+0x9290	U+8A3B	# <cjk>
+0x9291	U+914E	# <cjk>
+0x9292	U+92F3	# <cjk>
+0x9293	U+99D0	# <cjk>
+0x9294	U+6A17	# <cjk>
+0x9295	U+7026	# <cjk>
+0x9296	U+732A	# <cjk>
+0x9297	U+82E7	# <cjk>
+0x9298	U+8457	# <cjk>
+0x9299	U+8CAF	# <cjk>
+0x929A	U+4E01	# <cjk>
+0x929B	U+5146	# <cjk>
+0x929C	U+51CB	# <cjk>
+0x929D	U+558B	# <cjk>
+0x929E	U+5BF5	# <cjk>
+0x929F	U+5E16	# <cjk>
+0x92A0	U+5E33	# <cjk>
+0x92A1	U+5E81	# <cjk>
+0x92A2	U+5F14	# <cjk>
+0x92A3	U+5F35	# <cjk>
+0x92A4	U+5F6B	# <cjk>
+0x92A5	U+5FB4	# <cjk>
+0x92A6	U+61F2	# <cjk>
+0x92A7	U+6311	# <cjk>
+0x92A8	U+66A2	# <cjk>
+0x92A9	U+671D	# <cjk>
+0x92AA	U+6F6E	# <cjk>
+0x92AB	U+7252	# <cjk>
+0x92AC	U+753A	# <cjk>
+0x92AD	U+773A	# <cjk>
+0x92AE	U+8074	# <cjk>
+0x92AF	U+8139	# <cjk>
+0x92B0	U+8178	# <cjk>
+0x92B1	U+8776	# <cjk>
+0x92B2	U+8ABF	# <cjk>
+0x92B3	U+8ADC	# <cjk>
+0x92B4	U+8D85	# <cjk>
+0x92B5	U+8DF3	# <cjk>
+0x92B6	U+929A	# <cjk>
+0x92B7	U+9577	# <cjk>
+0x92B8	U+9802	# <cjk>
+0x92B9	U+9CE5	# <cjk>
+0x92BA	U+52C5	# <cjk>
+0x92BB	U+6357	# <cjk>
+0x92BC	U+76F4	# <cjk>
+0x92BD	U+6715	# <cjk>
+0x92BE	U+6C88	# <cjk>
+0x92BF	U+73CD	# <cjk>
+0x92C0	U+8CC3	# <cjk>
+0x92C1	U+93AE	# <cjk>
+0x92C2	U+9673	# <cjk>
+0x92C3	U+6D25	# <cjk>
+0x92C4	U+589C	# <cjk>
+0x92C5	U+690E	# <cjk>
+0x92C6	U+69CC	# <cjk>
+0x92C7	U+8FFD	# <cjk>
+0x92C8	U+939A	# <cjk>
+0x92C9	U+75DB	# <cjk>
+0x92CA	U+901A	# <cjk>
+0x92CB	U+585A	# <cjk>
+0x92CC	U+6802	# <cjk>
+0x92CD	U+63B4	# <cjk>
+0x92CE	U+69FB	# <cjk>
+0x92CF	U+4F43	# <cjk>
+0x92D0	U+6F2C	# <cjk>
+0x92D1	U+67D8	# <cjk>
+0x92D2	U+8FBB	# <cjk>
+0x92D3	U+8526	# <cjk>
+0x92D4	U+7DB4	# <cjk>
+0x92D5	U+9354	# <cjk>
+0x92D6	U+693F	# <cjk>
+0x92D7	U+6F70	# <cjk>
+0x92D8	U+576A	# <cjk>
+0x92D9	U+58F7	# <cjk>
+0x92DA	U+5B2C	# <cjk>
+0x92DB	U+7D2C	# <cjk>
+0x92DC	U+722A	# <cjk>
+0x92DD	U+540A	# <cjk>
+0x92DE	U+91E3	# <cjk>
+0x92DF	U+9DB4	# <cjk>
+0x92E0	U+4EAD	# <cjk>
+0x92E1	U+4F4E	# <cjk>
+0x92E2	U+505C	# <cjk>
+0x92E3	U+5075	# <cjk>
+0x92E4	U+5243	# <cjk>
+0x92E5	U+8C9E	# <cjk>
+0x92E6	U+5448	# <cjk>
+0x92E7	U+5824	# <cjk>
+0x92E8	U+5B9A	# <cjk>
+0x92E9	U+5E1D	# <cjk>
+0x92EA	U+5E95	# <cjk>
+0x92EB	U+5EAD	# <cjk>
+0x92EC	U+5EF7	# <cjk>
+0x92ED	U+5F1F	# <cjk>
+0x92EE	U+608C	# <cjk>
+0x92EF	U+62B5	# <cjk>
+0x92F0	U+633A	# <cjk>
+0x92F1	U+63D0	# <cjk>
+0x92F2	U+68AF	# <cjk>
+0x92F3	U+6C40	# <cjk>
+0x92F4	U+7887	# <cjk>
+0x92F5	U+798E	# <cjk>
+0x92F6	U+7A0B	# <cjk>
+0x92F7	U+7DE0	# <cjk>
+0x92F8	U+8247	# <cjk>
+0x92F9	U+8A02	# <cjk>
+0x92FA	U+8AE6	# <cjk>
+0x92FB	U+8E44	# <cjk>
+0x92FC	U+9013	# <cjk>
+0x9340	U+90B8	# <cjk>
+0x9341	U+912D	# <cjk>
+0x9342	U+91D8	# <cjk>
+0x9343	U+9F0E	# <cjk>
+0x9344	U+6CE5	# <cjk>
+0x9345	U+6458	# <cjk>
+0x9346	U+64E2	# <cjk>
+0x9347	U+6575	# <cjk>
+0x9348	U+6EF4	# <cjk>
+0x9349	U+7684	# <cjk>
+0x934A	U+7B1B	# <cjk>
+0x934B	U+9069	# <cjk>
+0x934C	U+93D1	# <cjk>
+0x934D	U+6EBA	# <cjk>
+0x934E	U+54F2	# <cjk>
+0x934F	U+5FB9	# <cjk>
+0x9350	U+64A4	# <cjk>
+0x9351	U+8F4D	# <cjk>
+0x9352	U+8FED	# <cjk>
+0x9353	U+9244	# <cjk>
+0x9354	U+5178	# <cjk>
+0x9355	U+586B	# <cjk>
+0x9356	U+5929	# <cjk>
+0x9357	U+5C55	# <cjk>
+0x9358	U+5E97	# <cjk>
+0x9359	U+6DFB	# <cjk>
+0x935A	U+7E8F	# <cjk>
+0x935B	U+751C	# <cjk>
+0x935C	U+8CBC	# <cjk>
+0x935D	U+8EE2	# <cjk>
+0x935E	U+985B	# <cjk>
+0x935F	U+70B9	# <cjk>
+0x9360	U+4F1D	# <cjk>
+0x9361	U+6BBF	# <cjk>
+0x9362	U+6FB1	# <cjk>
+0x9363	U+7530	# <cjk>
+0x9364	U+96FB	# <cjk>
+0x9365	U+514E	# <cjk>
+0x9366	U+5410	# <cjk>
+0x9367	U+5835	# <cjk>
+0x9368	U+5857	# <cjk>
+0x9369	U+59AC	# <cjk>
+0x936A	U+5C60	# <cjk>
+0x936B	U+5F92	# <cjk>
+0x936C	U+6597	# <cjk>
+0x936D	U+675C	# <cjk>
+0x936E	U+6E21	# <cjk>
+0x936F	U+767B	# <cjk>
+0x9370	U+83DF	# <cjk>
+0x9371	U+8CED	# <cjk>
+0x9372	U+9014	# <cjk>
+0x9373	U+90FD	# <cjk>
+0x9374	U+934D	# <cjk>
+0x9375	U+7825	# <cjk>
+0x9376	U+783A	# <cjk>
+0x9377	U+52AA	# <cjk>
+0x9378	U+5EA6	# <cjk>
+0x9379	U+571F	# <cjk>
+0x937A	U+5974	# <cjk>
+0x937B	U+6012	# <cjk>
+0x937C	U+5012	# <cjk>
+0x937D	U+515A	# <cjk>
+0x937E	U+51AC	# <cjk>
+0x9380	U+51CD	# <cjk>
+0x9381	U+5200	# <cjk>
+0x9382	U+5510	# <cjk>
+0x9383	U+5854	# <cjk>
+0x9384	U+5858	# <cjk>
+0x9385	U+5957	# <cjk>
+0x9386	U+5B95	# <cjk>
+0x9387	U+5CF6	# <cjk>
+0x9388	U+5D8B	# <cjk>
+0x9389	U+60BC	# <cjk>
+0x938A	U+6295	# <cjk>
+0x938B	U+642D	# <cjk>
+0x938C	U+6771	# <cjk>
+0x938D	U+6843	# <cjk>
+0x938E	U+68BC	# <cjk>
+0x938F	U+68DF	# <cjk>
+0x9390	U+76D7	# <cjk>
+0x9391	U+6DD8	# <cjk>
+0x9392	U+6E6F	# <cjk>
+0x9393	U+6D9B	# <cjk>
+0x9394	U+706F	# <cjk>
+0x9395	U+71C8	# <cjk>
+0x9396	U+5F53	# <cjk>
+0x9397	U+75D8	# <cjk>
+0x9398	U+7977	# <cjk>
+0x9399	U+7B49	# <cjk>
+0x939A	U+7B54	# <cjk>
+0x939B	U+7B52	# <cjk>
+0x939C	U+7CD6	# <cjk>
+0x939D	U+7D71	# <cjk>
+0x939E	U+5230	# <cjk>
+0x939F	U+8463	# <cjk>
+0x93A0	U+8569	# <cjk>
+0x93A1	U+85E4	# <cjk>
+0x93A2	U+8A0E	# <cjk>
+0x93A3	U+8B04	# <cjk>
+0x93A4	U+8C46	# <cjk>
+0x93A5	U+8E0F	# <cjk>
+0x93A6	U+9003	# <cjk>
+0x93A7	U+900F	# <cjk>
+0x93A8	U+9419	# <cjk>
+0x93A9	U+9676	# <cjk>
+0x93AA	U+982D	# <cjk>
+0x93AB	U+9A30	# <cjk>
+0x93AC	U+95D8	# <cjk>
+0x93AD	U+50CD	# <cjk>
+0x93AE	U+52D5	# <cjk>
+0x93AF	U+540C	# <cjk>
+0x93B0	U+5802	# <cjk>
+0x93B1	U+5C0E	# <cjk>
+0x93B2	U+61A7	# <cjk>
+0x93B3	U+649E	# <cjk>
+0x93B4	U+6D1E	# <cjk>
+0x93B5	U+77B3	# <cjk>
+0x93B6	U+7AE5	# <cjk>
+0x93B7	U+80F4	# <cjk>
+0x93B8	U+8404	# <cjk>
+0x93B9	U+9053	# <cjk>
+0x93BA	U+9285	# <cjk>
+0x93BB	U+5CE0	# <cjk>
+0x93BC	U+9D07	# <cjk>
+0x93BD	U+533F	# <cjk>
+0x93BE	U+5F97	# <cjk>
+0x93BF	U+5FB3	# <cjk>
+0x93C0	U+6D9C	# <cjk>
+0x93C1	U+7279	# <cjk>
+0x93C2	U+7763	# <cjk>
+0x93C3	U+79BF	# <cjk>
+0x93C4	U+7BE4	# <cjk>
+0x93C5	U+6BD2	# <cjk>
+0x93C6	U+72EC	# <cjk>
+0x93C7	U+8AAD	# <cjk>
+0x93C8	U+6803	# <cjk>
+0x93C9	U+6A61	# <cjk>
+0x93CA	U+51F8	# <cjk>
+0x93CB	U+7A81	# <cjk>
+0x93CC	U+6934	# <cjk>
+0x93CD	U+5C4A	# <cjk>
+0x93CE	U+9CF6	# <cjk>
+0x93CF	U+82EB	# <cjk>
+0x93D0	U+5BC5	# <cjk>
+0x93D1	U+9149	# <cjk>
+0x93D2	U+701E	# <cjk>
+0x93D3	U+5678	# <cjk>
+0x93D4	U+5C6F	# <cjk>
+0x93D5	U+60C7	# <cjk>
+0x93D6	U+6566	# <cjk>
+0x93D7	U+6C8C	# <cjk>
+0x93D8	U+8C5A	# <cjk>
+0x93D9	U+9041	# <cjk>
+0x93DA	U+9813	# <cjk>
+0x93DB	U+5451	# <cjk>
+0x93DC	U+66C7	# <cjk>
+0x93DD	U+920D	# <cjk>
+0x93DE	U+5948	# <cjk>
+0x93DF	U+90A3	# <cjk>
+0x93E0	U+5185	# <cjk>
+0x93E1	U+4E4D	# <cjk>
+0x93E2	U+51EA	# <cjk>
+0x93E3	U+8599	# <cjk>
+0x93E4	U+8B0E	# <cjk>
+0x93E5	U+7058	# <cjk>
+0x93E6	U+637A	# <cjk>
+0x93E7	U+934B	# <cjk>
+0x93E8	U+6962	# <cjk>
+0x93E9	U+99B4	# <cjk>
+0x93EA	U+7E04	# <cjk>
+0x93EB	U+7577	# <cjk>
+0x93EC	U+5357	# <cjk>
+0x93ED	U+6960	# <cjk>
+0x93EE	U+8EDF	# <cjk>
+0x93EF	U+96E3	# <cjk>
+0x93F0	U+6C5D	# <cjk>
+0x93F1	U+4E8C	# <cjk>
+0x93F2	U+5C3C	# <cjk>
+0x93F3	U+5F10	# <cjk>
+0x93F4	U+8FE9	# <cjk>
+0x93F5	U+5302	# <cjk>
+0x93F6	U+8CD1	# <cjk>
+0x93F7	U+8089	# <cjk>
+0x93F8	U+8679	# <cjk>
+0x93F9	U+5EFF	# <cjk>
+0x93FA	U+65E5	# <cjk>
+0x93FB	U+4E73	# <cjk>
+0x93FC	U+5165	# <cjk>
+0x9440	U+5982	# <cjk>
+0x9441	U+5C3F	# <cjk>
+0x9442	U+97EE	# <cjk>
+0x9443	U+4EFB	# <cjk>
+0x9444	U+598A	# <cjk>
+0x9445	U+5FCD	# <cjk>
+0x9446	U+8A8D	# <cjk>
+0x9447	U+6FE1	# <cjk>
+0x9448	U+79B0	# <cjk>
+0x9449	U+7962	# <cjk>
+0x944A	U+5BE7	# <cjk>
+0x944B	U+8471	# <cjk>
+0x944C	U+732B	# <cjk>
+0x944D	U+71B1	# <cjk>
+0x944E	U+5E74	# <cjk>
+0x944F	U+5FF5	# <cjk>
+0x9450	U+637B	# <cjk>
+0x9451	U+649A	# <cjk>
+0x9452	U+71C3	# <cjk>
+0x9453	U+7C98	# <cjk>
+0x9454	U+4E43	# <cjk>
+0x9455	U+5EFC	# <cjk>
+0x9456	U+4E4B	# <cjk>
+0x9457	U+57DC	# <cjk>
+0x9458	U+56A2	# <cjk>
+0x9459	U+60A9	# <cjk>
+0x945A	U+6FC3	# <cjk>
+0x945B	U+7D0D	# <cjk>
+0x945C	U+80FD	# <cjk>
+0x945D	U+8133	# <cjk>
+0x945E	U+81BF	# <cjk>
+0x945F	U+8FB2	# <cjk>
+0x9460	U+8997	# <cjk>
+0x9461	U+86A4	# <cjk>
+0x9462	U+5DF4	# <cjk>
+0x9463	U+628A	# <cjk>
+0x9464	U+64AD	# <cjk>
+0x9465	U+8987	# <cjk>
+0x9466	U+6777	# <cjk>
+0x9467	U+6CE2	# <cjk>
+0x9468	U+6D3E	# <cjk>
+0x9469	U+7436	# <cjk>
+0x946A	U+7834	# <cjk>
+0x946B	U+5A46	# <cjk>
+0x946C	U+7F75	# <cjk>
+0x946D	U+82AD	# <cjk>
+0x946E	U+99AC	# <cjk>
+0x946F	U+4FF3	# <cjk>
+0x9470	U+5EC3	# <cjk>
+0x9471	U+62DD	# <cjk>
+0x9472	U+6392	# <cjk>
+0x9473	U+6557	# <cjk>
+0x9474	U+676F	# <cjk>
+0x9475	U+76C3	# <cjk>
+0x9476	U+724C	# <cjk>
+0x9477	U+80CC	# <cjk>
+0x9478	U+80BA	# <cjk>
+0x9479	U+8F29	# <cjk>
+0x947A	U+914D	# <cjk>
+0x947B	U+500D	# <cjk>
+0x947C	U+57F9	# <cjk>
+0x947D	U+5A92	# <cjk>
+0x947E	U+6885	# <cjk>
+0x9480	U+6973	# <cjk>
+0x9481	U+7164	# <cjk>
+0x9482	U+72FD	# <cjk>
+0x9483	U+8CB7	# <cjk>
+0x9484	U+58F2	# <cjk>
+0x9485	U+8CE0	# <cjk>
+0x9486	U+966A	# <cjk>
+0x9487	U+9019	# <cjk>
+0x9488	U+877F	# <cjk>
+0x9489	U+79E4	# <cjk>
+0x948A	U+77E7	# <cjk>
+0x948B	U+8429	# <cjk>
+0x948C	U+4F2F	# <cjk>
+0x948D	U+5265	# <cjk>
+0x948E	U+535A	# <cjk>
+0x948F	U+62CD	# <cjk>
+0x9490	U+67CF	# <cjk>
+0x9491	U+6CCA	# <cjk>
+0x9492	U+767D	# <cjk>
+0x9493	U+7B94	# <cjk>
+0x9494	U+7C95	# <cjk>
+0x9495	U+8236	# <cjk>
+0x9496	U+8584	# <cjk>
+0x9497	U+8FEB	# <cjk>
+0x9498	U+66DD	# <cjk>
+0x9499	U+6F20	# <cjk>
+0x949A	U+7206	# <cjk>
+0x949B	U+7E1B	# <cjk>
+0x949C	U+83AB	# <cjk>
+0x949D	U+99C1	# <cjk>
+0x949E	U+9EA6	# <cjk>
+0x949F	U+51FD	# <cjk>
+0x94A0	U+7BB1	# <cjk>
+0x94A1	U+7872	# <cjk>
+0x94A2	U+7BB8	# <cjk>
+0x94A3	U+8087	# <cjk>
+0x94A4	U+7B48	# <cjk>
+0x94A5	U+6AE8	# <cjk>
+0x94A6	U+5E61	# <cjk>
+0x94A7	U+808C	# <cjk>
+0x94A8	U+7551	# <cjk>
+0x94A9	U+7560	# <cjk>
+0x94AA	U+516B	# <cjk>
+0x94AB	U+9262	# <cjk>
+0x94AC	U+6E8C	# <cjk>
+0x94AD	U+767A	# <cjk>
+0x94AE	U+9197	# <cjk>
+0x94AF	U+9AEA	# <cjk>
+0x94B0	U+4F10	# <cjk>
+0x94B1	U+7F70	# <cjk>
+0x94B2	U+629C	# <cjk>
+0x94B3	U+7B4F	# <cjk>
+0x94B4	U+95A5	# <cjk>
+0x94B5	U+9CE9	# <cjk>
+0x94B6	U+567A	# <cjk>
+0x94B7	U+5859	# <cjk>
+0x94B8	U+86E4	# <cjk>
+0x94B9	U+96BC	# <cjk>
+0x94BA	U+4F34	# <cjk>
+0x94BB	U+5224	# <cjk>
+0x94BC	U+534A	# <cjk>
+0x94BD	U+53CD	# <cjk>
+0x94BE	U+53DB	# <cjk>
+0x94BF	U+5E06	# <cjk>
+0x94C0	U+642C	# <cjk>
+0x94C1	U+6591	# <cjk>
+0x94C2	U+677F	# <cjk>
+0x94C3	U+6C3E	# <cjk>
+0x94C4	U+6C4E	# <cjk>
+0x94C5	U+7248	# <cjk>
+0x94C6	U+72AF	# <cjk>
+0x94C7	U+73ED	# <cjk>
+0x94C8	U+7554	# <cjk>
+0x94C9	U+7E41	# <cjk>
+0x94CA	U+822C	# <cjk>
+0x94CB	U+85E9	# <cjk>
+0x94CC	U+8CA9	# <cjk>
+0x94CD	U+7BC4	# <cjk>
+0x94CE	U+91C6	# <cjk>
+0x94CF	U+7169	# <cjk>
+0x94D0	U+9812	# <cjk>
+0x94D1	U+98EF	# <cjk>
+0x94D2	U+633D	# <cjk>
+0x94D3	U+6669	# <cjk>
+0x94D4	U+756A	# <cjk>
+0x94D5	U+76E4	# <cjk>
+0x94D6	U+78D0	# <cjk>
+0x94D7	U+8543	# <cjk>
+0x94D8	U+86EE	# <cjk>
+0x94D9	U+532A	# <cjk>
+0x94DA	U+5351	# <cjk>
+0x94DB	U+5426	# <cjk>
+0x94DC	U+5983	# <cjk>
+0x94DD	U+5E87	# <cjk>
+0x94DE	U+5F7C	# <cjk>
+0x94DF	U+60B2	# <cjk>
+0x94E0	U+6249	# <cjk>
+0x94E1	U+6279	# <cjk>
+0x94E2	U+62AB	# <cjk>
+0x94E3	U+6590	# <cjk>
+0x94E4	U+6BD4	# <cjk>
+0x94E5	U+6CCC	# <cjk>
+0x94E6	U+75B2	# <cjk>
+0x94E7	U+76AE	# <cjk>
+0x94E8	U+7891	# <cjk>
+0x94E9	U+79D8	# <cjk>
+0x94EA	U+7DCB	# <cjk>
+0x94EB	U+7F77	# <cjk>
+0x94EC	U+80A5	# <cjk>
+0x94ED	U+88AB	# <cjk>
+0x94EE	U+8AB9	# <cjk>
+0x94EF	U+8CBB	# <cjk>
+0x94F0	U+907F	# <cjk>
+0x94F1	U+975E	# <cjk>
+0x94F2	U+98DB	# <cjk>
+0x94F3	U+6A0B	# <cjk>
+0x94F4	U+7C38	# <cjk>
+0x94F5	U+5099	# <cjk>
+0x94F6	U+5C3E	# <cjk>
+0x94F7	U+5FAE	# <cjk>
+0x94F8	U+6787	# <cjk>
+0x94F9	U+6BD8	# <cjk>
+0x94FA	U+7435	# <cjk>
+0x94FB	U+7709	# <cjk>
+0x94FC	U+7F8E	# <cjk>
+0x9540	U+9F3B	# <cjk>
+0x9541	U+67CA	# <cjk>
+0x9542	U+7A17	# <cjk>
+0x9543	U+5339	# <cjk>
+0x9544	U+758B	# <cjk>
+0x9545	U+9AED	# <cjk>
+0x9546	U+5F66	# <cjk>
+0x9547	U+819D	# <cjk>
+0x9548	U+83F1	# <cjk>
+0x9549	U+8098	# <cjk>
+0x954A	U+5F3C	# <cjk>
+0x954B	U+5FC5	# <cjk>
+0x954C	U+7562	# <cjk>
+0x954D	U+7B46	# <cjk>
+0x954E	U+903C	# <cjk>
+0x954F	U+6867	# <cjk>
+0x9550	U+59EB	# <cjk>
+0x9551	U+5A9B	# <cjk>
+0x9552	U+7D10	# <cjk>
+0x9553	U+767E	# <cjk>
+0x9554	U+8B2C	# <cjk>
+0x9555	U+4FF5	# <cjk>
+0x9556	U+5F6A	# <cjk>
+0x9557	U+6A19	# <cjk>
+0x9558	U+6C37	# <cjk>
+0x9559	U+6F02	# <cjk>
+0x955A	U+74E2	# <cjk>
+0x955B	U+7968	# <cjk>
+0x955C	U+8868	# <cjk>
+0x955D	U+8A55	# <cjk>
+0x955E	U+8C79	# <cjk>
+0x955F	U+5EDF	# <cjk>
+0x9560	U+63CF	# <cjk>
+0x9561	U+75C5	# <cjk>
+0x9562	U+79D2	# <cjk>
+0x9563	U+82D7	# <cjk>
+0x9564	U+9328	# <cjk>
+0x9565	U+92F2	# <cjk>
+0x9566	U+849C	# <cjk>
+0x9567	U+86ED	# <cjk>
+0x9568	U+9C2D	# <cjk>
+0x9569	U+54C1	# <cjk>
+0x956A	U+5F6C	# <cjk>
+0x956B	U+658C	# <cjk>
+0x956C	U+6D5C	# <cjk>
+0x956D	U+7015	# <cjk>
+0x956E	U+8CA7	# <cjk>
+0x956F	U+8CD3	# <cjk>
+0x9570	U+983B	# <cjk>
+0x9571	U+654F	# <cjk>
+0x9572	U+74F6	# <cjk>
+0x9573	U+4E0D	# <cjk>
+0x9574	U+4ED8	# <cjk>
+0x9575	U+57E0	# <cjk>
+0x9576	U+592B	# <cjk>
+0x9577	U+5A66	# <cjk>
+0x9578	U+5BCC	# <cjk>
+0x9579	U+51A8	# <cjk>
+0x957A	U+5E03	# <cjk>
+0x957B	U+5E9C	# <cjk>
+0x957C	U+6016	# <cjk>
+0x957D	U+6276	# <cjk>
+0x957E	U+6577	# <cjk>
+0x9580	U+65A7	# <cjk>
+0x9581	U+666E	# <cjk>
+0x9582	U+6D6E	# <cjk>
+0x9583	U+7236	# <cjk>
+0x9584	U+7B26	# <cjk>
+0x9585	U+8150	# <cjk>
+0x9586	U+819A	# <cjk>
+0x9587	U+8299	# <cjk>
+0x9588	U+8B5C	# <cjk>
+0x9589	U+8CA0	# <cjk>
+0x958A	U+8CE6	# <cjk>
+0x958B	U+8D74	# <cjk>
+0x958C	U+961C	# <cjk>
+0x958D	U+9644	# <cjk>
+0x958E	U+4FAE	# <cjk>
+0x958F	U+64AB	# <cjk>
+0x9590	U+6B66	# <cjk>
+0x9591	U+821E	# <cjk>
+0x9592	U+8461	# <cjk>
+0x9593	U+856A	# <cjk>
+0x9594	U+90E8	# <cjk>
+0x9595	U+5C01	# <cjk>
+0x9596	U+6953	# <cjk>
+0x9597	U+98A8	# <cjk>
+0x9598	U+847A	# <cjk>
+0x9599	U+8557	# <cjk>
+0x959A	U+4F0F	# <cjk>
+0x959B	U+526F	# <cjk>
+0x959C	U+5FA9	# <cjk>
+0x959D	U+5E45	# <cjk>
+0x959E	U+670D	# <cjk>
+0x959F	U+798F	# <cjk>
+0x95A0	U+8179	# <cjk>
+0x95A1	U+8907	# <cjk>
+0x95A2	U+8986	# <cjk>
+0x95A3	U+6DF5	# <cjk>
+0x95A4	U+5F17	# <cjk>
+0x95A5	U+6255	# <cjk>
+0x95A6	U+6CB8	# <cjk>
+0x95A7	U+4ECF	# <cjk>
+0x95A8	U+7269	# <cjk>
+0x95A9	U+9B92	# <cjk>
+0x95AA	U+5206	# <cjk>
+0x95AB	U+543B	# <cjk>
+0x95AC	U+5674	# <cjk>
+0x95AD	U+58B3	# <cjk>
+0x95AE	U+61A4	# <cjk>
+0x95AF	U+626E	# <cjk>
+0x95B0	U+711A	# <cjk>
+0x95B1	U+596E	# <cjk>
+0x95B2	U+7C89	# <cjk>
+0x95B3	U+7CDE	# <cjk>
+0x95B4	U+7D1B	# <cjk>
+0x95B5	U+96F0	# <cjk>
+0x95B6	U+6587	# <cjk>
+0x95B7	U+805E	# <cjk>
+0x95B8	U+4E19	# <cjk>
+0x95B9	U+4F75	# <cjk>
+0x95BA	U+5175	# <cjk>
+0x95BB	U+5840	# <cjk>
+0x95BC	U+5E63	# <cjk>
+0x95BD	U+5E73	# <cjk>
+0x95BE	U+5F0A	# <cjk>
+0x95BF	U+67C4	# <cjk>
+0x95C0	U+4E26	# <cjk>
+0x95C1	U+853D	# <cjk>
+0x95C2	U+9589	# <cjk>
+0x95C3	U+965B	# <cjk>
+0x95C4	U+7C73	# <cjk>
+0x95C5	U+9801	# <cjk>
+0x95C6	U+50FB	# <cjk>
+0x95C7	U+58C1	# <cjk>
+0x95C8	U+7656	# <cjk>
+0x95C9	U+78A7	# <cjk>
+0x95CA	U+5225	# <cjk>
+0x95CB	U+77A5	# <cjk>
+0x95CC	U+8511	# <cjk>
+0x95CD	U+7B86	# <cjk>
+0x95CE	U+504F	# <cjk>
+0x95CF	U+5909	# <cjk>
+0x95D0	U+7247	# <cjk>
+0x95D1	U+7BC7	# <cjk>
+0x95D2	U+7DE8	# <cjk>
+0x95D3	U+8FBA	# <cjk>
+0x95D4	U+8FD4	# <cjk>
+0x95D5	U+904D	# <cjk>
+0x95D6	U+4FBF	# <cjk>
+0x95D7	U+52C9	# <cjk>
+0x95D8	U+5A29	# <cjk>
+0x95D9	U+5F01	# <cjk>
+0x95DA	U+97AD	# <cjk>
+0x95DB	U+4FDD	# <cjk>
+0x95DC	U+8217	# <cjk>
+0x95DD	U+92EA	# <cjk>
+0x95DE	U+5703	# <cjk>
+0x95DF	U+6355	# <cjk>
+0x95E0	U+6B69	# <cjk>
+0x95E1	U+752B	# <cjk>
+0x95E2	U+88DC	# <cjk>
+0x95E3	U+8F14	# <cjk>
+0x95E4	U+7A42	# <cjk>
+0x95E5	U+52DF	# <cjk>
+0x95E6	U+5893	# <cjk>
+0x95E7	U+6155	# <cjk>
+0x95E8	U+620A	# <cjk>
+0x95E9	U+66AE	# <cjk>
+0x95EA	U+6BCD	# <cjk>
+0x95EB	U+7C3F	# <cjk>
+0x95EC	U+83E9	# <cjk>
+0x95ED	U+5023	# <cjk>
+0x95EE	U+4FF8	# <cjk>
+0x95EF	U+5305	# <cjk>
+0x95F0	U+5446	# <cjk>
+0x95F1	U+5831	# <cjk>
+0x95F2	U+5949	# <cjk>
+0x95F3	U+5B9D	# <cjk>
+0x95F4	U+5CF0	# <cjk>
+0x95F5	U+5CEF	# <cjk>
+0x95F6	U+5D29	# <cjk>
+0x95F7	U+5E96	# <cjk>
+0x95F8	U+62B1	# <cjk>
+0x95F9	U+6367	# <cjk>
+0x95FA	U+653E	# <cjk>
+0x95FB	U+65B9	# <cjk>
+0x95FC	U+670B	# <cjk>
+0x9640	U+6CD5	# <cjk>
+0x9641	U+6CE1	# <cjk>
+0x9642	U+70F9	# <cjk>
+0x9643	U+7832	# <cjk>
+0x9644	U+7E2B	# <cjk>
+0x9645	U+80DE	# <cjk>
+0x9646	U+82B3	# <cjk>
+0x9647	U+840C	# <cjk>
+0x9648	U+84EC	# <cjk>
+0x9649	U+8702	# <cjk>
+0x964A	U+8912	# <cjk>
+0x964B	U+8A2A	# <cjk>
+0x964C	U+8C4A	# <cjk>
+0x964D	U+90A6	# <cjk>
+0x964E	U+92D2	# <cjk>
+0x964F	U+98FD	# <cjk>
+0x9650	U+9CF3	# <cjk>
+0x9651	U+9D6C	# <cjk>
+0x9652	U+4E4F	# <cjk>
+0x9653	U+4EA1	# <cjk>
+0x9654	U+508D	# <cjk>
+0x9655	U+5256	# <cjk>
+0x9656	U+574A	# <cjk>
+0x9657	U+59A8	# <cjk>
+0x9658	U+5E3D	# <cjk>
+0x9659	U+5FD8	# <cjk>
+0x965A	U+5FD9	# <cjk>
+0x965B	U+623F	# <cjk>
+0x965C	U+66B4	# <cjk>
+0x965D	U+671B	# <cjk>
+0x965E	U+67D0	# <cjk>
+0x965F	U+68D2	# <cjk>
+0x9660	U+5192	# <cjk>
+0x9661	U+7D21	# <cjk>
+0x9662	U+80AA	# <cjk>
+0x9663	U+81A8	# <cjk>
+0x9664	U+8B00	# <cjk>
+0x9665	U+8C8C	# <cjk>
+0x9666	U+8CBF	# <cjk>
+0x9667	U+927E	# <cjk>
+0x9668	U+9632	# <cjk>
+0x9669	U+5420	# <cjk>
+0x966A	U+982C	# <cjk>
+0x966B	U+5317	# <cjk>
+0x966C	U+50D5	# <cjk>
+0x966D	U+535C	# <cjk>
+0x966E	U+58A8	# <cjk>
+0x966F	U+64B2	# <cjk>
+0x9670	U+6734	# <cjk>
+0x9671	U+7267	# <cjk>
+0x9672	U+7766	# <cjk>
+0x9673	U+7A46	# <cjk>
+0x9674	U+91E6	# <cjk>
+0x9675	U+52C3	# <cjk>
+0x9676	U+6CA1	# <cjk>
+0x9677	U+6B86	# <cjk>
+0x9678	U+5800	# <cjk>
+0x9679	U+5E4C	# <cjk>
+0x967A	U+5954	# <cjk>
+0x967B	U+672C	# <cjk>
+0x967C	U+7FFB	# <cjk>
+0x967D	U+51E1	# <cjk>
+0x967E	U+76C6	# <cjk>
+0x9680	U+6469	# <cjk>
+0x9681	U+78E8	# <cjk>
+0x9682	U+9B54	# <cjk>
+0x9683	U+9EBB	# <cjk>
+0x9684	U+57CB	# <cjk>
+0x9685	U+59B9	# <cjk>
+0x9686	U+6627	# <cjk>
+0x9687	U+679A	# <cjk>
+0x9688	U+6BCE	# <cjk>
+0x9689	U+54E9	# <cjk>
+0x968A	U+69D9	# <cjk>
+0x968B	U+5E55	# <cjk>
+0x968C	U+819C	# <cjk>
+0x968D	U+6795	# <cjk>
+0x968E	U+9BAA	# <cjk>
+0x968F	U+67FE	# <cjk>
+0x9690	U+9C52	# <cjk>
+0x9691	U+685D	# <cjk>
+0x9692	U+4EA6	# <cjk>
+0x9693	U+4FE3	# <cjk>
+0x9694	U+53C8	# <cjk>
+0x9695	U+62B9	# <cjk>
+0x9696	U+672B	# <cjk>
+0x9697	U+6CAB	# <cjk>
+0x9698	U+8FC4	# <cjk>
+0x9699	U+4FAD	# <cjk>
+0x969A	U+7E6D	# <cjk>
+0x969B	U+9EBF	# <cjk>
+0x969C	U+4E07	# <cjk>
+0x969D	U+6162	# <cjk>
+0x969E	U+6E80	# <cjk>
+0x969F	U+6F2B	# <cjk>
+0x96A0	U+8513	# <cjk>
+0x96A1	U+5473	# <cjk>
+0x96A2	U+672A	# <cjk>
+0x96A3	U+9B45	# <cjk>
+0x96A4	U+5DF3	# <cjk>
+0x96A5	U+7B95	# <cjk>
+0x96A6	U+5CAC	# <cjk>
+0x96A7	U+5BC6	# <cjk>
+0x96A8	U+871C	# <cjk>
+0x96A9	U+6E4A	# <cjk>
+0x96AA	U+84D1	# <cjk>
+0x96AB	U+7A14	# <cjk>
+0x96AC	U+8108	# <cjk>
+0x96AD	U+5999	# <cjk>
+0x96AE	U+7C8D	# <cjk>
+0x96AF	U+6C11	# <cjk>
+0x96B0	U+7720	# <cjk>
+0x96B1	U+52D9	# <cjk>
+0x96B2	U+5922	# <cjk>
+0x96B3	U+7121	# <cjk>
+0x96B4	U+725F	# <cjk>
+0x96B5	U+77DB	# <cjk>
+0x96B6	U+9727	# <cjk>
+0x96B7	U+9D61	# <cjk>
+0x96B8	U+690B	# <cjk>
+0x96B9	U+5A7F	# <cjk>
+0x96BA	U+5A18	# <cjk>
+0x96BB	U+51A5	# <cjk>
+0x96BC	U+540D	# <cjk>
+0x96BD	U+547D	# <cjk>
+0x96BE	U+660E	# <cjk>
+0x96BF	U+76DF	# <cjk>
+0x96C0	U+8FF7	# <cjk>
+0x96C1	U+9298	# <cjk>
+0x96C2	U+9CF4	# <cjk>
+0x96C3	U+59EA	# <cjk>
+0x96C4	U+725D	# <cjk>
+0x96C5	U+6EC5	# <cjk>
+0x96C6	U+514D	# <cjk>
+0x96C7	U+68C9	# <cjk>
+0x96C8	U+7DBF	# <cjk>
+0x96C9	U+7DEC	# <cjk>
+0x96CA	U+9762	# <cjk>
+0x96CB	U+9EBA	# <cjk>
+0x96CC	U+6478	# <cjk>
+0x96CD	U+6A21	# <cjk>
+0x96CE	U+8302	# <cjk>
+0x96CF	U+5984	# <cjk>
+0x96D0	U+5B5F	# <cjk>
+0x96D1	U+6BDB	# <cjk>
+0x96D2	U+731B	# <cjk>
+0x96D3	U+76F2	# <cjk>
+0x96D4	U+7DB2	# <cjk>
+0x96D5	U+8017	# <cjk>
+0x96D6	U+8499	# <cjk>
+0x96D7	U+5132	# <cjk>
+0x96D8	U+6728	# <cjk>
+0x96D9	U+9ED9	# <cjk>
+0x96DA	U+76EE	# <cjk>
+0x96DB	U+6762	# <cjk>
+0x96DC	U+52FF	# <cjk>
+0x96DD	U+9905	# <cjk>
+0x96DE	U+5C24	# <cjk>
+0x96DF	U+623B	# <cjk>
+0x96E0	U+7C7E	# <cjk>
+0x96E1	U+8CB0	# <cjk>
+0x96E2	U+554F	# <cjk>
+0x96E3	U+60B6	# <cjk>
+0x96E4	U+7D0B	# <cjk>
+0x96E5	U+9580	# <cjk>
+0x96E6	U+5301	# <cjk>
+0x96E7	U+4E5F	# <cjk>
+0x96E8	U+51B6	# <cjk>
+0x96E9	U+591C	# <cjk>
+0x96EA	U+723A	# <cjk>
+0x96EB	U+8036	# <cjk>
+0x96EC	U+91CE	# <cjk>
+0x96ED	U+5F25	# <cjk>
+0x96EE	U+77E2	# <cjk>
+0x96EF	U+5384	# <cjk>
+0x96F0	U+5F79	# <cjk>
+0x96F1	U+7D04	# <cjk>
+0x96F2	U+85AC	# <cjk>
+0x96F3	U+8A33	# <cjk>
+0x96F4	U+8E8D	# <cjk>
+0x96F5	U+9756	# <cjk>
+0x96F6	U+67F3	# <cjk>
+0x96F7	U+85AE	# <cjk>
+0x96F8	U+9453	# <cjk>
+0x96F9	U+6109	# <cjk>
+0x96FA	U+6108	# <cjk>
+0x96FB	U+6CB9	# <cjk>
+0x96FC	U+7652	# <cjk>
+0x9740	U+8AED	# <cjk>
+0x9741	U+8F38	# <cjk>
+0x9742	U+552F	# <cjk>
+0x9743	U+4F51	# <cjk>
+0x9744	U+512A	# <cjk>
+0x9745	U+52C7	# <cjk>
+0x9746	U+53CB	# <cjk>
+0x9747	U+5BA5	# <cjk>
+0x9748	U+5E7D	# <cjk>
+0x9749	U+60A0	# <cjk>
+0x974A	U+6182	# <cjk>
+0x974B	U+63D6	# <cjk>
+0x974C	U+6709	# <cjk>
+0x974D	U+67DA	# <cjk>
+0x974E	U+6E67	# <cjk>
+0x974F	U+6D8C	# <cjk>
+0x9750	U+7336	# <cjk>
+0x9751	U+7337	# <cjk>
+0x9752	U+7531	# <cjk>
+0x9753	U+7950	# <cjk>
+0x9754	U+88D5	# <cjk>
+0x9755	U+8A98	# <cjk>
+0x9756	U+904A	# <cjk>
+0x9757	U+9091	# <cjk>
+0x9758	U+90F5	# <cjk>
+0x9759	U+96C4	# <cjk>
+0x975A	U+878D	# <cjk>
+0x975B	U+5915	# <cjk>
+0x975C	U+4E88	# <cjk>
+0x975D	U+4F59	# <cjk>
+0x975E	U+4E0E	# <cjk>
+0x975F	U+8A89	# <cjk>
+0x9760	U+8F3F	# <cjk>
+0x9761	U+9810	# <cjk>
+0x9762	U+50AD	# <cjk>
+0x9763	U+5E7C	# <cjk>
+0x9764	U+5996	# <cjk>
+0x9765	U+5BB9	# <cjk>
+0x9766	U+5EB8	# <cjk>
+0x9767	U+63DA	# <cjk>
+0x9768	U+63FA	# <cjk>
+0x9769	U+64C1	# <cjk>
+0x976A	U+66DC	# <cjk>
+0x976B	U+694A	# <cjk>
+0x976C	U+69D8	# <cjk>
+0x976D	U+6D0B	# <cjk>
+0x976E	U+6EB6	# <cjk>
+0x976F	U+7194	# <cjk>
+0x9770	U+7528	# <cjk>
+0x9771	U+7AAF	# <cjk>
+0x9772	U+7F8A	# <cjk>
+0x9773	U+8000	# <cjk>
+0x9774	U+8449	# <cjk>
+0x9775	U+84C9	# <cjk>
+0x9776	U+8981	# <cjk>
+0x9777	U+8B21	# <cjk>
+0x9778	U+8E0A	# <cjk>
+0x9779	U+9065	# <cjk>
+0x977A	U+967D	# <cjk>
+0x977B	U+990A	# <cjk>
+0x977C	U+617E	# <cjk>
+0x977D	U+6291	# <cjk>
+0x977E	U+6B32	# <cjk>
+0x9780	U+6C83	# <cjk>
+0x9781	U+6D74	# <cjk>
+0x9782	U+7FCC	# <cjk>
+0x9783	U+7FFC	# <cjk>
+0x9784	U+6DC0	# <cjk>
+0x9785	U+7F85	# <cjk>
+0x9786	U+87BA	# <cjk>
+0x9787	U+88F8	# <cjk>
+0x9788	U+6765	# <cjk>
+0x9789	U+83B1	# <cjk>
+0x978A	U+983C	# <cjk>
+0x978B	U+96F7	# <cjk>
+0x978C	U+6D1B	# <cjk>
+0x978D	U+7D61	# <cjk>
+0x978E	U+843D	# <cjk>
+0x978F	U+916A	# <cjk>
+0x9790	U+4E71	# <cjk>
+0x9791	U+5375	# <cjk>
+0x9792	U+5D50	# <cjk>
+0x9793	U+6B04	# <cjk>
+0x9794	U+6FEB	# <cjk>
+0x9795	U+85CD	# <cjk>
+0x9796	U+862D	# <cjk>
+0x9797	U+89A7	# <cjk>
+0x9798	U+5229	# <cjk>
+0x9799	U+540F	# <cjk>
+0x979A	U+5C65	# <cjk>
+0x979B	U+674E	# <cjk>
+0x979C	U+68A8	# <cjk>
+0x979D	U+7406	# <cjk>
+0x979E	U+7483	# <cjk>
+0x979F	U+75E2	# <cjk>
+0x97A0	U+88CF	# <cjk>
+0x97A1	U+88E1	# <cjk>
+0x97A2	U+91CC	# <cjk>
+0x97A3	U+96E2	# <cjk>
+0x97A4	U+9678	# <cjk>
+0x97A5	U+5F8B	# <cjk>
+0x97A6	U+7387	# <cjk>
+0x97A7	U+7ACB	# <cjk>
+0x97A8	U+844E	# <cjk>
+0x97A9	U+63A0	# <cjk>
+0x97AA	U+7565	# <cjk>
+0x97AB	U+5289	# <cjk>
+0x97AC	U+6D41	# <cjk>
+0x97AD	U+6E9C	# <cjk>
+0x97AE	U+7409	# <cjk>
+0x97AF	U+7559	# <cjk>
+0x97B0	U+786B	# <cjk>
+0x97B1	U+7C92	# <cjk>
+0x97B2	U+9686	# <cjk>
+0x97B3	U+7ADC	# <cjk>
+0x97B4	U+9F8D	# <cjk>
+0x97B5	U+4FB6	# <cjk>
+0x97B6	U+616E	# <cjk>
+0x97B7	U+65C5	# <cjk>
+0x97B8	U+865C	# <cjk>
+0x97B9	U+4E86	# <cjk>
+0x97BA	U+4EAE	# <cjk>
+0x97BB	U+50DA	# <cjk>
+0x97BC	U+4E21	# <cjk>
+0x97BD	U+51CC	# <cjk>
+0x97BE	U+5BEE	# <cjk>
+0x97BF	U+6599	# <cjk>
+0x97C0	U+6881	# <cjk>
+0x97C1	U+6DBC	# <cjk>
+0x97C2	U+731F	# <cjk>
+0x97C3	U+7642	# <cjk>
+0x97C4	U+77AD	# <cjk>
+0x97C5	U+7A1C	# <cjk>
+0x97C6	U+7CE7	# <cjk>
+0x97C7	U+826F	# <cjk>
+0x97C8	U+8AD2	# <cjk>
+0x97C9	U+907C	# <cjk>
+0x97CA	U+91CF	# <cjk>
+0x97CB	U+9675	# <cjk>
+0x97CC	U+9818	# <cjk>
+0x97CD	U+529B	# <cjk>
+0x97CE	U+7DD1	# <cjk>
+0x97CF	U+502B	# <cjk>
+0x97D0	U+5398	# <cjk>
+0x97D1	U+6797	# <cjk>
+0x97D2	U+6DCB	# <cjk>
+0x97D3	U+71D0	# <cjk>
+0x97D4	U+7433	# <cjk>
+0x97D5	U+81E8	# <cjk>
+0x97D6	U+8F2A	# <cjk>
+0x97D7	U+96A3	# <cjk>
+0x97D8	U+9C57	# <cjk>
+0x97D9	U+9E9F	# <cjk>
+0x97DA	U+7460	# <cjk>
+0x97DB	U+5841	# <cjk>
+0x97DC	U+6D99	# <cjk>
+0x97DD	U+7D2F	# <cjk>
+0x97DE	U+985E	# <cjk>
+0x97DF	U+4EE4	# <cjk>
+0x97E0	U+4F36	# <cjk>
+0x97E1	U+4F8B	# <cjk>
+0x97E2	U+51B7	# <cjk>
+0x97E3	U+52B1	# <cjk>
+0x97E4	U+5DBA	# <cjk>
+0x97E5	U+601C	# <cjk>
+0x97E6	U+73B2	# <cjk>
+0x97E7	U+793C	# <cjk>
+0x97E8	U+82D3	# <cjk>
+0x97E9	U+9234	# <cjk>
+0x97EA	U+96B7	# <cjk>
+0x97EB	U+96F6	# <cjk>
+0x97EC	U+970A	# <cjk>
+0x97ED	U+9E97	# <cjk>
+0x97EE	U+9F62	# <cjk>
+0x97EF	U+66A6	# <cjk>
+0x97F0	U+6B74	# <cjk>
+0x97F1	U+5217	# <cjk>
+0x97F2	U+52A3	# <cjk>
+0x97F3	U+70C8	# <cjk>
+0x97F4	U+88C2	# <cjk>
+0x97F5	U+5EC9	# <cjk>
+0x97F6	U+604B	# <cjk>
+0x97F7	U+6190	# <cjk>
+0x97F8	U+6F23	# <cjk>
+0x97F9	U+7149	# <cjk>
+0x97FA	U+7C3E	# <cjk>
+0x97FB	U+7DF4	# <cjk>
+0x97FC	U+806F	# <cjk>
+0x9840	U+84EE	# <cjk>
+0x9841	U+9023	# <cjk>
+0x9842	U+932C	# <cjk>
+0x9843	U+5442	# <cjk>
+0x9844	U+9B6F	# <cjk>
+0x9845	U+6AD3	# <cjk>
+0x9846	U+7089	# <cjk>
+0x9847	U+8CC2	# <cjk>
+0x9848	U+8DEF	# <cjk>
+0x9849	U+9732	# <cjk>
+0x984A	U+52B4	# <cjk>
+0x984B	U+5A41	# <cjk>
+0x984C	U+5ECA	# <cjk>
+0x984D	U+5F04	# <cjk>
+0x984E	U+6717	# <cjk>
+0x984F	U+697C	# <cjk>
+0x9850	U+6994	# <cjk>
+0x9851	U+6D6A	# <cjk>
+0x9852	U+6F0F	# <cjk>
+0x9853	U+7262	# <cjk>
+0x9854	U+72FC	# <cjk>
+0x9855	U+7BED	# <cjk>
+0x9856	U+8001	# <cjk>
+0x9857	U+807E	# <cjk>
+0x9858	U+874B	# <cjk>
+0x9859	U+90CE	# <cjk>
+0x985A	U+516D	# <cjk>
+0x985B	U+9E93	# <cjk>
+0x985C	U+7984	# <cjk>
+0x985D	U+808B	# <cjk>
+0x985E	U+9332	# <cjk>
+0x985F	U+8AD6	# <cjk>
+0x9860	U+502D	# <cjk>
+0x9861	U+548C	# <cjk>
+0x9862	U+8A71	# <cjk>
+0x9863	U+6B6A	# <cjk>
+0x9864	U+8CC4	# <cjk>
+0x9865	U+8107	# <cjk>
+0x9866	U+60D1	# <cjk>
+0x9867	U+67A0	# <cjk>
+0x9868	U+9DF2	# <cjk>
+0x9869	U+4E99	# <cjk>
+0x986A	U+4E98	# <cjk>
+0x986B	U+9C10	# <cjk>
+0x986C	U+8A6B	# <cjk>
+0x986D	U+85C1	# <cjk>
+0x986E	U+8568	# <cjk>
+0x986F	U+6900	# <cjk>
+0x9870	U+6E7E	# <cjk>
+0x9871	U+7897	# <cjk>
+0x9872	U+8155	# <cjk>
+0x9873	U+20B9F	# <cjk>	[2004]	[Unicode3.1]
+0x9874	U+5B41	# <cjk>	[2000]
+0x9875	U+5B56	# <cjk>	[2000]
+0x9876	U+5B7D	# <cjk>	[2000]
+0x9877	U+5B93	# <cjk>	[2000]
+0x9878	U+5BD8	# <cjk>	[2000]
+0x9879	U+5BEC	# <cjk>	[2000]
+0x987A	U+5C12	# <cjk>	[2000]
+0x987B	U+5C1E	# <cjk>	[2000]
+0x987C	U+5C23	# <cjk>	[2000]
+0x987D	U+5C2B	# <cjk>	[2000]
+0x987E	U+378D	# <cjk>	[2000]
+0x9880	U+5C62	# <cjk>	[2000]
+0x9881	U+FA3B	# CJK COMPATIBILITY IDEOGRAPH-FA3B	[2000]	[Unicode3.2]
+0x9882	U+FA3C	# CJK COMPATIBILITY IDEOGRAPH-FA3C	[2000]	[Unicode3.2]
+0x9883	U+216B4	# <cjk>	[2000]	[Unicode3.1]
+0x9884	U+5C7A	# <cjk>	[2000]
+0x9885	U+5C8F	# <cjk>	[2000]
+0x9886	U+5C9F	# <cjk>	[2000]
+0x9887	U+5CA3	# <cjk>	[2000]
+0x9888	U+5CAA	# <cjk>	[2000]
+0x9889	U+5CBA	# <cjk>	[2000]
+0x988A	U+5CCB	# <cjk>	[2000]
+0x988B	U+5CD0	# <cjk>	[2000]
+0x988C	U+5CD2	# <cjk>	[2000]
+0x988D	U+5CF4	# <cjk>	[2000]
+0x988E	U+21E34	# <cjk>	[2000]	[Unicode3.1]
+0x988F	U+37E2	# <cjk>	[2000]
+0x9890	U+5D0D	# <cjk>	[2000]
+0x9891	U+5D27	# <cjk>	[2000]
+0x9892	U+FA11	# CJK COMPATIBILITY IDEOGRAPH-FA11	[2000]
+0x9893	U+5D46	# <cjk>	[2000]
+0x9894	U+5D47	# <cjk>	[2000]
+0x9895	U+5D53	# <cjk>	[2000]
+0x9896	U+5D4A	# <cjk>	[2000]
+0x9897	U+5D6D	# <cjk>	[2000]
+0x9898	U+5D81	# <cjk>	[2000]
+0x9899	U+5DA0	# <cjk>	[2000]
+0x989A	U+5DA4	# <cjk>	[2000]
+0x989B	U+5DA7	# <cjk>	[2000]
+0x989C	U+5DB8	# <cjk>	[2000]
+0x989D	U+5DCB	# <cjk>	[2000]
+0x989E	U+541E	# <cjk>	[2004]
+0x989F	U+5F0C	# <cjk>
+0x98A0	U+4E10	# <cjk>
+0x98A1	U+4E15	# <cjk>
+0x98A2	U+4E2A	# <cjk>
+0x98A3	U+4E31	# <cjk>
+0x98A4	U+4E36	# <cjk>
+0x98A5	U+4E3C	# <cjk>
+0x98A6	U+4E3F	# <cjk>
+0x98A7	U+4E42	# <cjk>
+0x98A8	U+4E56	# <cjk>
+0x98A9	U+4E58	# <cjk>
+0x98AA	U+4E82	# <cjk>
+0x98AB	U+4E85	# <cjk>
+0x98AC	U+8C6B	# <cjk>
+0x98AD	U+4E8A	# <cjk>
+0x98AE	U+8212	# <cjk>
+0x98AF	U+5F0D	# <cjk>
+0x98B0	U+4E8E	# <cjk>
+0x98B1	U+4E9E	# <cjk>
+0x98B2	U+4E9F	# <cjk>
+0x98B3	U+4EA0	# <cjk>
+0x98B4	U+4EA2	# <cjk>
+0x98B5	U+4EB0	# <cjk>
+0x98B6	U+4EB3	# <cjk>
+0x98B7	U+4EB6	# <cjk>
+0x98B8	U+4ECE	# <cjk>
+0x98B9	U+4ECD	# <cjk>
+0x98BA	U+4EC4	# <cjk>
+0x98BB	U+4EC6	# <cjk>
+0x98BC	U+4EC2	# <cjk>
+0x98BD	U+4ED7	# <cjk>
+0x98BE	U+4EDE	# <cjk>
+0x98BF	U+4EED	# <cjk>
+0x98C0	U+4EDF	# <cjk>
+0x98C1	U+4EF7	# <cjk>
+0x98C2	U+4F09	# <cjk>
+0x98C3	U+4F5A	# <cjk>
+0x98C4	U+4F30	# <cjk>
+0x98C5	U+4F5B	# <cjk>
+0x98C6	U+4F5D	# <cjk>
+0x98C7	U+4F57	# <cjk>
+0x98C8	U+4F47	# <cjk>
+0x98C9	U+4F76	# <cjk>
+0x98CA	U+4F88	# <cjk>
+0x98CB	U+4F8F	# <cjk>
+0x98CC	U+4F98	# <cjk>
+0x98CD	U+4F7B	# <cjk>
+0x98CE	U+4F69	# <cjk>
+0x98CF	U+4F70	# <cjk>
+0x98D0	U+4F91	# <cjk>
+0x98D1	U+4F6F	# <cjk>
+0x98D2	U+4F86	# <cjk>
+0x98D3	U+4F96	# <cjk>
+0x98D4	U+5118	# <cjk>
+0x98D5	U+4FD4	# <cjk>
+0x98D6	U+4FDF	# <cjk>
+0x98D7	U+4FCE	# <cjk>
+0x98D8	U+4FD8	# <cjk>
+0x98D9	U+4FDB	# <cjk>
+0x98DA	U+4FD1	# <cjk>
+0x98DB	U+4FDA	# <cjk>
+0x98DC	U+4FD0	# <cjk>
+0x98DD	U+4FE4	# <cjk>
+0x98DE	U+4FE5	# <cjk>
+0x98DF	U+501A	# <cjk>
+0x98E0	U+5028	# <cjk>
+0x98E1	U+5014	# <cjk>
+0x98E2	U+502A	# <cjk>
+0x98E3	U+5025	# <cjk>
+0x98E4	U+5005	# <cjk>
+0x98E5	U+4F1C	# <cjk>
+0x98E6	U+4FF6	# <cjk>
+0x98E7	U+5021	# <cjk>
+0x98E8	U+5029	# <cjk>
+0x98E9	U+502C	# <cjk>
+0x98EA	U+4FFE	# <cjk>
+0x98EB	U+4FEF	# <cjk>
+0x98EC	U+5011	# <cjk>
+0x98ED	U+5006	# <cjk>
+0x98EE	U+5043	# <cjk>
+0x98EF	U+5047	# <cjk>
+0x98F0	U+6703	# <cjk>
+0x98F1	U+5055	# <cjk>
+0x98F2	U+5050	# <cjk>
+0x98F3	U+5048	# <cjk>
+0x98F4	U+505A	# <cjk>
+0x98F5	U+5056	# <cjk>
+0x98F6	U+506C	# <cjk>
+0x98F7	U+5078	# <cjk>
+0x98F8	U+5080	# <cjk>
+0x98F9	U+509A	# <cjk>
+0x98FA	U+5085	# <cjk>
+0x98FB	U+50B4	# <cjk>
+0x98FC	U+50B2	# <cjk>
+0x9940	U+50C9	# <cjk>
+0x9941	U+50CA	# <cjk>
+0x9942	U+50B3	# <cjk>
+0x9943	U+50C2	# <cjk>
+0x9944	U+50D6	# <cjk>
+0x9945	U+50DE	# <cjk>
+0x9946	U+50E5	# <cjk>
+0x9947	U+50ED	# <cjk>
+0x9948	U+50E3	# <cjk>
+0x9949	U+50EE	# <cjk>
+0x994A	U+50F9	# <cjk>
+0x994B	U+50F5	# <cjk>
+0x994C	U+5109	# <cjk>
+0x994D	U+5101	# <cjk>
+0x994E	U+5102	# <cjk>
+0x994F	U+5116	# <cjk>
+0x9950	U+5115	# <cjk>
+0x9951	U+5114	# <cjk>
+0x9952	U+511A	# <cjk>
+0x9953	U+5121	# <cjk>
+0x9954	U+513A	# <cjk>
+0x9955	U+5137	# <cjk>
+0x9956	U+513C	# <cjk>
+0x9957	U+513B	# <cjk>
+0x9958	U+513F	# <cjk>
+0x9959	U+5140	# <cjk>
+0x995A	U+5152	# <cjk>
+0x995B	U+514C	# <cjk>
+0x995C	U+5154	# <cjk>
+0x995D	U+5162	# <cjk>
+0x995E	U+7AF8	# <cjk>
+0x995F	U+5169	# <cjk>
+0x9960	U+516A	# <cjk>
+0x9961	U+516E	# <cjk>
+0x9962	U+5180	# <cjk>
+0x9963	U+5182	# <cjk>
+0x9964	U+56D8	# <cjk>
+0x9965	U+518C	# <cjk>
+0x9966	U+5189	# <cjk>
+0x9967	U+518F	# <cjk>
+0x9968	U+5191	# <cjk>
+0x9969	U+5193	# <cjk>
+0x996A	U+5195	# <cjk>
+0x996B	U+5196	# <cjk>
+0x996C	U+51A4	# <cjk>
+0x996D	U+51A6	# <cjk>
+0x996E	U+51A2	# <cjk>
+0x996F	U+51A9	# <cjk>
+0x9970	U+51AA	# <cjk>
+0x9971	U+51AB	# <cjk>
+0x9972	U+51B3	# <cjk>
+0x9973	U+51B1	# <cjk>
+0x9974	U+51B2	# <cjk>
+0x9975	U+51B0	# <cjk>
+0x9976	U+51B5	# <cjk>
+0x9977	U+51BD	# <cjk>
+0x9978	U+51C5	# <cjk>
+0x9979	U+51C9	# <cjk>
+0x997A	U+51DB	# <cjk>
+0x997B	U+51E0	# <cjk>
+0x997C	U+8655	# <cjk>
+0x997D	U+51E9	# <cjk>
+0x997E	U+51ED	# <cjk>
+0x9980	U+51F0	# <cjk>
+0x9981	U+51F5	# <cjk>
+0x9982	U+51FE	# <cjk>
+0x9983	U+5204	# <cjk>
+0x9984	U+520B	# <cjk>
+0x9985	U+5214	# <cjk>
+0x9986	U+520E	# <cjk>
+0x9987	U+5227	# <cjk>
+0x9988	U+522A	# <cjk>
+0x9989	U+522E	# <cjk>
+0x998A	U+5233	# <cjk>
+0x998B	U+5239	# <cjk>
+0x998C	U+524F	# <cjk>
+0x998D	U+5244	# <cjk>
+0x998E	U+524B	# <cjk>
+0x998F	U+524C	# <cjk>
+0x9990	U+525E	# <cjk>
+0x9991	U+5254	# <cjk>
+0x9992	U+526A	# <cjk>
+0x9993	U+5274	# <cjk>
+0x9994	U+5269	# <cjk>
+0x9995	U+5273	# <cjk>
+0x9996	U+527F	# <cjk>
+0x9997	U+527D	# <cjk>
+0x9998	U+528D	# <cjk>
+0x9999	U+5294	# <cjk>
+0x999A	U+5292	# <cjk>
+0x999B	U+5271	# <cjk>
+0x999C	U+5288	# <cjk>
+0x999D	U+5291	# <cjk>
+0x999E	U+8FA8	# <cjk>
+0x999F	U+8FA7	# <cjk>
+0x99A0	U+52AC	# <cjk>
+0x99A1	U+52AD	# <cjk>
+0x99A2	U+52BC	# <cjk>
+0x99A3	U+52B5	# <cjk>
+0x99A4	U+52C1	# <cjk>
+0x99A5	U+52CD	# <cjk>
+0x99A6	U+52D7	# <cjk>
+0x99A7	U+52DE	# <cjk>
+0x99A8	U+52E3	# <cjk>
+0x99A9	U+52E6	# <cjk>
+0x99AA	U+98ED	# <cjk>
+0x99AB	U+52E0	# <cjk>
+0x99AC	U+52F3	# <cjk>
+0x99AD	U+52F5	# <cjk>
+0x99AE	U+52F8	# <cjk>
+0x99AF	U+52F9	# <cjk>
+0x99B0	U+5306	# <cjk>
+0x99B1	U+5308	# <cjk>
+0x99B2	U+7538	# <cjk>
+0x99B3	U+530D	# <cjk>
+0x99B4	U+5310	# <cjk>
+0x99B5	U+530F	# <cjk>
+0x99B6	U+5315	# <cjk>
+0x99B7	U+531A	# <cjk>
+0x99B8	U+5323	# <cjk>
+0x99B9	U+532F	# <cjk>
+0x99BA	U+5331	# <cjk>
+0x99BB	U+5333	# <cjk>
+0x99BC	U+5338	# <cjk>
+0x99BD	U+5340	# <cjk>
+0x99BE	U+5346	# <cjk>
+0x99BF	U+5345	# <cjk>
+0x99C0	U+4E17	# <cjk>
+0x99C1	U+5349	# <cjk>
+0x99C2	U+534D	# <cjk>
+0x99C3	U+51D6	# <cjk>
+0x99C4	U+535E	# <cjk>
+0x99C5	U+5369	# <cjk>
+0x99C6	U+536E	# <cjk>
+0x99C7	U+5918	# <cjk>
+0x99C8	U+537B	# <cjk>
+0x99C9	U+5377	# <cjk>
+0x99CA	U+5382	# <cjk>
+0x99CB	U+5396	# <cjk>
+0x99CC	U+53A0	# <cjk>
+0x99CD	U+53A6	# <cjk>
+0x99CE	U+53A5	# <cjk>
+0x99CF	U+53AE	# <cjk>
+0x99D0	U+53B0	# <cjk>
+0x99D1	U+53B6	# <cjk>
+0x99D2	U+53C3	# <cjk>
+0x99D3	U+7C12	# <cjk>
+0x99D4	U+96D9	# <cjk>
+0x99D5	U+53DF	# <cjk>
+0x99D6	U+66FC	# <cjk>
+0x99D7	U+71EE	# <cjk>
+0x99D8	U+53EE	# <cjk>
+0x99D9	U+53E8	# <cjk>
+0x99DA	U+53ED	# <cjk>
+0x99DB	U+53FA	# <cjk>
+0x99DC	U+5401	# <cjk>
+0x99DD	U+543D	# <cjk>
+0x99DE	U+5440	# <cjk>
+0x99DF	U+542C	# <cjk>
+0x99E0	U+542D	# <cjk>
+0x99E1	U+543C	# <cjk>
+0x99E2	U+542E	# <cjk>
+0x99E3	U+5436	# <cjk>
+0x99E4	U+5429	# <cjk>
+0x99E5	U+541D	# <cjk>
+0x99E6	U+544E	# <cjk>
+0x99E7	U+548F	# <cjk>
+0x99E8	U+5475	# <cjk>
+0x99E9	U+548E	# <cjk>
+0x99EA	U+545F	# <cjk>
+0x99EB	U+5471	# <cjk>
+0x99EC	U+5477	# <cjk>
+0x99ED	U+5470	# <cjk>
+0x99EE	U+5492	# <cjk>
+0x99EF	U+547B	# <cjk>
+0x99F0	U+5480	# <cjk>
+0x99F1	U+5476	# <cjk>
+0x99F2	U+5484	# <cjk>
+0x99F3	U+5490	# <cjk>
+0x99F4	U+5486	# <cjk>
+0x99F5	U+54C7	# <cjk>
+0x99F6	U+54A2	# <cjk>
+0x99F7	U+54B8	# <cjk>
+0x99F8	U+54A5	# <cjk>
+0x99F9	U+54AC	# <cjk>
+0x99FA	U+54C4	# <cjk>
+0x99FB	U+54C8	# <cjk>
+0x99FC	U+54A8	# <cjk>
+0x9A40	U+54AB	# <cjk>
+0x9A41	U+54C2	# <cjk>
+0x9A42	U+54A4	# <cjk>
+0x9A43	U+54BE	# <cjk>
+0x9A44	U+54BC	# <cjk>
+0x9A45	U+54D8	# <cjk>
+0x9A46	U+54E5	# <cjk>
+0x9A47	U+54E6	# <cjk>
+0x9A48	U+550F	# <cjk>
+0x9A49	U+5514	# <cjk>
+0x9A4A	U+54FD	# <cjk>
+0x9A4B	U+54EE	# <cjk>
+0x9A4C	U+54ED	# <cjk>
+0x9A4D	U+54FA	# <cjk>
+0x9A4E	U+54E2	# <cjk>
+0x9A4F	U+5539	# <cjk>
+0x9A50	U+5540	# <cjk>
+0x9A51	U+5563	# <cjk>
+0x9A52	U+554C	# <cjk>
+0x9A53	U+552E	# <cjk>
+0x9A54	U+555C	# <cjk>
+0x9A55	U+5545	# <cjk>
+0x9A56	U+5556	# <cjk>
+0x9A57	U+5557	# <cjk>
+0x9A58	U+5538	# <cjk>
+0x9A59	U+5533	# <cjk>
+0x9A5A	U+555D	# <cjk>
+0x9A5B	U+5599	# <cjk>
+0x9A5C	U+5580	# <cjk>
+0x9A5D	U+54AF	# <cjk>
+0x9A5E	U+558A	# <cjk>
+0x9A5F	U+559F	# <cjk>
+0x9A60	U+557B	# <cjk>
+0x9A61	U+557E	# <cjk>
+0x9A62	U+5598	# <cjk>
+0x9A63	U+559E	# <cjk>
+0x9A64	U+55AE	# <cjk>
+0x9A65	U+557C	# <cjk>
+0x9A66	U+5583	# <cjk>
+0x9A67	U+55A9	# <cjk>
+0x9A68	U+5587	# <cjk>
+0x9A69	U+55A8	# <cjk>
+0x9A6A	U+55DA	# <cjk>
+0x9A6B	U+55C5	# <cjk>
+0x9A6C	U+55DF	# <cjk>
+0x9A6D	U+55C4	# <cjk>
+0x9A6E	U+55DC	# <cjk>
+0x9A6F	U+55E4	# <cjk>
+0x9A70	U+55D4	# <cjk>
+0x9A71	U+5614	# <cjk>
+0x9A72	U+55F7	# <cjk>
+0x9A73	U+5616	# <cjk>
+0x9A74	U+55FE	# <cjk>
+0x9A75	U+55FD	# <cjk>
+0x9A76	U+561B	# <cjk>
+0x9A77	U+55F9	# <cjk>
+0x9A78	U+564E	# <cjk>
+0x9A79	U+5650	# <cjk>
+0x9A7A	U+71DF	# <cjk>
+0x9A7B	U+5634	# <cjk>
+0x9A7C	U+5636	# <cjk>
+0x9A7D	U+5632	# <cjk>
+0x9A7E	U+5638	# <cjk>
+0x9A80	U+566B	# <cjk>
+0x9A81	U+5664	# <cjk>
+0x9A82	U+562F	# <cjk>
+0x9A83	U+566C	# <cjk>
+0x9A84	U+566A	# <cjk>
+0x9A85	U+5686	# <cjk>
+0x9A86	U+5680	# <cjk>
+0x9A87	U+568A	# <cjk>
+0x9A88	U+56A0	# <cjk>
+0x9A89	U+5694	# <cjk>
+0x9A8A	U+568F	# <cjk>
+0x9A8B	U+56A5	# <cjk>
+0x9A8C	U+56AE	# <cjk>
+0x9A8D	U+56B6	# <cjk>
+0x9A8E	U+56B4	# <cjk>
+0x9A8F	U+56C2	# <cjk>
+0x9A90	U+56BC	# <cjk>
+0x9A91	U+56C1	# <cjk>
+0x9A92	U+56C3	# <cjk>
+0x9A93	U+56C0	# <cjk>
+0x9A94	U+56C8	# <cjk>
+0x9A95	U+56CE	# <cjk>
+0x9A96	U+56D1	# <cjk>
+0x9A97	U+56D3	# <cjk>
+0x9A98	U+56D7	# <cjk>
+0x9A99	U+56EE	# <cjk>
+0x9A9A	U+56F9	# <cjk>
+0x9A9B	U+5700	# <cjk>
+0x9A9C	U+56FF	# <cjk>
+0x9A9D	U+5704	# <cjk>
+0x9A9E	U+5709	# <cjk>
+0x9A9F	U+5708	# <cjk>
+0x9AA0	U+570B	# <cjk>
+0x9AA1	U+570D	# <cjk>
+0x9AA2	U+5713	# <cjk>
+0x9AA3	U+5718	# <cjk>
+0x9AA4	U+5716	# <cjk>
+0x9AA5	U+55C7	# <cjk>
+0x9AA6	U+571C	# <cjk>
+0x9AA7	U+5726	# <cjk>
+0x9AA8	U+5737	# <cjk>
+0x9AA9	U+5738	# <cjk>
+0x9AAA	U+574E	# <cjk>
+0x9AAB	U+573B	# <cjk>
+0x9AAC	U+5740	# <cjk>
+0x9AAD	U+574F	# <cjk>
+0x9AAE	U+5769	# <cjk>
+0x9AAF	U+57C0	# <cjk>
+0x9AB0	U+5788	# <cjk>
+0x9AB1	U+5761	# <cjk>
+0x9AB2	U+577F	# <cjk>
+0x9AB3	U+5789	# <cjk>
+0x9AB4	U+5793	# <cjk>
+0x9AB5	U+57A0	# <cjk>
+0x9AB6	U+57B3	# <cjk>
+0x9AB7	U+57A4	# <cjk>
+0x9AB8	U+57AA	# <cjk>
+0x9AB9	U+57B0	# <cjk>
+0x9ABA	U+57C3	# <cjk>
+0x9ABB	U+57C6	# <cjk>
+0x9ABC	U+57D4	# <cjk>
+0x9ABD	U+57D2	# <cjk>
+0x9ABE	U+57D3	# <cjk>
+0x9ABF	U+580A	# <cjk>
+0x9AC0	U+57D6	# <cjk>
+0x9AC1	U+57E3	# <cjk>
+0x9AC2	U+580B	# <cjk>
+0x9AC3	U+5819	# <cjk>
+0x9AC4	U+581D	# <cjk>
+0x9AC5	U+5872	# <cjk>
+0x9AC6	U+5821	# <cjk>
+0x9AC7	U+5862	# <cjk>
+0x9AC8	U+584B	# <cjk>
+0x9AC9	U+5870	# <cjk>
+0x9ACA	U+6BC0	# <cjk>
+0x9ACB	U+5852	# <cjk>
+0x9ACC	U+583D	# <cjk>
+0x9ACD	U+5879	# <cjk>
+0x9ACE	U+5885	# <cjk>
+0x9ACF	U+58B9	# <cjk>
+0x9AD0	U+589F	# <cjk>
+0x9AD1	U+58AB	# <cjk>
+0x9AD2	U+58BA	# <cjk>
+0x9AD3	U+58DE	# <cjk>
+0x9AD4	U+58BB	# <cjk>
+0x9AD5	U+58B8	# <cjk>
+0x9AD6	U+58AE	# <cjk>
+0x9AD7	U+58C5	# <cjk>
+0x9AD8	U+58D3	# <cjk>
+0x9AD9	U+58D1	# <cjk>
+0x9ADA	U+58D7	# <cjk>
+0x9ADB	U+58D9	# <cjk>
+0x9ADC	U+58D8	# <cjk>
+0x9ADD	U+58E5	# <cjk>
+0x9ADE	U+58DC	# <cjk>
+0x9ADF	U+58E4	# <cjk>
+0x9AE0	U+58DF	# <cjk>
+0x9AE1	U+58EF	# <cjk>
+0x9AE2	U+58FA	# <cjk>
+0x9AE3	U+58F9	# <cjk>
+0x9AE4	U+58FB	# <cjk>
+0x9AE5	U+58FC	# <cjk>
+0x9AE6	U+58FD	# <cjk>
+0x9AE7	U+5902	# <cjk>
+0x9AE8	U+590A	# <cjk>
+0x9AE9	U+5910	# <cjk>
+0x9AEA	U+591B	# <cjk>
+0x9AEB	U+68A6	# <cjk>
+0x9AEC	U+5925	# <cjk>
+0x9AED	U+592C	# <cjk>
+0x9AEE	U+592D	# <cjk>
+0x9AEF	U+5932	# <cjk>
+0x9AF0	U+5938	# <cjk>
+0x9AF1	U+593E	# <cjk>
+0x9AF2	U+7AD2	# <cjk>
+0x9AF3	U+5955	# <cjk>
+0x9AF4	U+5950	# <cjk>
+0x9AF5	U+594E	# <cjk>
+0x9AF6	U+595A	# <cjk>
+0x9AF7	U+5958	# <cjk>
+0x9AF8	U+5962	# <cjk>
+0x9AF9	U+5960	# <cjk>
+0x9AFA	U+5967	# <cjk>
+0x9AFB	U+596C	# <cjk>
+0x9AFC	U+5969	# <cjk>
+0x9B40	U+5978	# <cjk>
+0x9B41	U+5981	# <cjk>
+0x9B42	U+599D	# <cjk>
+0x9B43	U+4F5E	# <cjk>
+0x9B44	U+4FAB	# <cjk>
+0x9B45	U+59A3	# <cjk>
+0x9B46	U+59B2	# <cjk>
+0x9B47	U+59C6	# <cjk>
+0x9B48	U+59E8	# <cjk>
+0x9B49	U+59DC	# <cjk>
+0x9B4A	U+598D	# <cjk>
+0x9B4B	U+59D9	# <cjk>
+0x9B4C	U+59DA	# <cjk>
+0x9B4D	U+5A25	# <cjk>
+0x9B4E	U+5A1F	# <cjk>
+0x9B4F	U+5A11	# <cjk>
+0x9B50	U+5A1C	# <cjk>
+0x9B51	U+5A09	# <cjk>
+0x9B52	U+5A1A	# <cjk>
+0x9B53	U+5A40	# <cjk>
+0x9B54	U+5A6C	# <cjk>
+0x9B55	U+5A49	# <cjk>
+0x9B56	U+5A35	# <cjk>
+0x9B57	U+5A36	# <cjk>
+0x9B58	U+5A62	# <cjk>
+0x9B59	U+5A6A	# <cjk>
+0x9B5A	U+5A9A	# <cjk>
+0x9B5B	U+5ABC	# <cjk>
+0x9B5C	U+5ABE	# <cjk>
+0x9B5D	U+5ACB	# <cjk>
+0x9B5E	U+5AC2	# <cjk>
+0x9B5F	U+5ABD	# <cjk>
+0x9B60	U+5AE3	# <cjk>
+0x9B61	U+5AD7	# <cjk>
+0x9B62	U+5AE6	# <cjk>
+0x9B63	U+5AE9	# <cjk>
+0x9B64	U+5AD6	# <cjk>
+0x9B65	U+5AFA	# <cjk>
+0x9B66	U+5AFB	# <cjk>
+0x9B67	U+5B0C	# <cjk>
+0x9B68	U+5B0B	# <cjk>
+0x9B69	U+5B16	# <cjk>
+0x9B6A	U+5B32	# <cjk>
+0x9B6B	U+5AD0	# <cjk>
+0x9B6C	U+5B2A	# <cjk>
+0x9B6D	U+5B36	# <cjk>
+0x9B6E	U+5B3E	# <cjk>
+0x9B6F	U+5B43	# <cjk>
+0x9B70	U+5B45	# <cjk>
+0x9B71	U+5B40	# <cjk>
+0x9B72	U+5B51	# <cjk>
+0x9B73	U+5B55	# <cjk>
+0x9B74	U+5B5A	# <cjk>
+0x9B75	U+5B5B	# <cjk>
+0x9B76	U+5B65	# <cjk>
+0x9B77	U+5B69	# <cjk>
+0x9B78	U+5B70	# <cjk>
+0x9B79	U+5B73	# <cjk>
+0x9B7A	U+5B75	# <cjk>
+0x9B7B	U+5B78	# <cjk>
+0x9B7C	U+6588	# <cjk>
+0x9B7D	U+5B7A	# <cjk>
+0x9B7E	U+5B80	# <cjk>
+0x9B80	U+5B83	# <cjk>
+0x9B81	U+5BA6	# <cjk>
+0x9B82	U+5BB8	# <cjk>
+0x9B83	U+5BC3	# <cjk>
+0x9B84	U+5BC7	# <cjk>
+0x9B85	U+5BC9	# <cjk>
+0x9B86	U+5BD4	# <cjk>
+0x9B87	U+5BD0	# <cjk>
+0x9B88	U+5BE4	# <cjk>
+0x9B89	U+5BE6	# <cjk>
+0x9B8A	U+5BE2	# <cjk>
+0x9B8B	U+5BDE	# <cjk>
+0x9B8C	U+5BE5	# <cjk>
+0x9B8D	U+5BEB	# <cjk>
+0x9B8E	U+5BF0	# <cjk>
+0x9B8F	U+5BF6	# <cjk>
+0x9B90	U+5BF3	# <cjk>
+0x9B91	U+5C05	# <cjk>
+0x9B92	U+5C07	# <cjk>
+0x9B93	U+5C08	# <cjk>
+0x9B94	U+5C0D	# <cjk>
+0x9B95	U+5C13	# <cjk>
+0x9B96	U+5C20	# <cjk>
+0x9B97	U+5C22	# <cjk>
+0x9B98	U+5C28	# <cjk>
+0x9B99	U+5C38	# <cjk>
+0x9B9A	U+5C39	# <cjk>
+0x9B9B	U+5C41	# <cjk>
+0x9B9C	U+5C46	# <cjk>
+0x9B9D	U+5C4E	# <cjk>
+0x9B9E	U+5C53	# <cjk>
+0x9B9F	U+5C50	# <cjk>
+0x9BA0	U+5C4F	# <cjk>
+0x9BA1	U+5B71	# <cjk>
+0x9BA2	U+5C6C	# <cjk>
+0x9BA3	U+5C6E	# <cjk>
+0x9BA4	U+4E62	# <cjk>
+0x9BA5	U+5C76	# <cjk>
+0x9BA6	U+5C79	# <cjk>
+0x9BA7	U+5C8C	# <cjk>
+0x9BA8	U+5C91	# <cjk>
+0x9BA9	U+5C94	# <cjk>
+0x9BAA	U+599B	# <cjk>
+0x9BAB	U+5CAB	# <cjk>
+0x9BAC	U+5CBB	# <cjk>
+0x9BAD	U+5CB6	# <cjk>
+0x9BAE	U+5CBC	# <cjk>
+0x9BAF	U+5CB7	# <cjk>
+0x9BB0	U+5CC5	# <cjk>
+0x9BB1	U+5CBE	# <cjk>
+0x9BB2	U+5CC7	# <cjk>
+0x9BB3	U+5CD9	# <cjk>
+0x9BB4	U+5CE9	# <cjk>
+0x9BB5	U+5CFD	# <cjk>
+0x9BB6	U+5CFA	# <cjk>
+0x9BB7	U+5CED	# <cjk>
+0x9BB8	U+5D8C	# <cjk>
+0x9BB9	U+5CEA	# <cjk>
+0x9BBA	U+5D0B	# <cjk>
+0x9BBB	U+5D15	# <cjk>
+0x9BBC	U+5D17	# <cjk>
+0x9BBD	U+5D5C	# <cjk>
+0x9BBE	U+5D1F	# <cjk>
+0x9BBF	U+5D1B	# <cjk>
+0x9BC0	U+5D11	# <cjk>
+0x9BC1	U+5D14	# <cjk>
+0x9BC2	U+5D22	# <cjk>
+0x9BC3	U+5D1A	# <cjk>
+0x9BC4	U+5D19	# <cjk>
+0x9BC5	U+5D18	# <cjk>
+0x9BC6	U+5D4C	# <cjk>
+0x9BC7	U+5D52	# <cjk>
+0x9BC8	U+5D4E	# <cjk>
+0x9BC9	U+5D4B	# <cjk>
+0x9BCA	U+5D6C	# <cjk>
+0x9BCB	U+5D73	# <cjk>
+0x9BCC	U+5D76	# <cjk>
+0x9BCD	U+5D87	# <cjk>
+0x9BCE	U+5D84	# <cjk>
+0x9BCF	U+5D82	# <cjk>
+0x9BD0	U+5DA2	# <cjk>
+0x9BD1	U+5D9D	# <cjk>
+0x9BD2	U+5DAC	# <cjk>
+0x9BD3	U+5DAE	# <cjk>
+0x9BD4	U+5DBD	# <cjk>
+0x9BD5	U+5D90	# <cjk>
+0x9BD6	U+5DB7	# <cjk>
+0x9BD7	U+5DBC	# <cjk>
+0x9BD8	U+5DC9	# <cjk>
+0x9BD9	U+5DCD	# <cjk>
+0x9BDA	U+5DD3	# <cjk>
+0x9BDB	U+5DD2	# <cjk>
+0x9BDC	U+5DD6	# <cjk>
+0x9BDD	U+5DDB	# <cjk>
+0x9BDE	U+5DEB	# <cjk>
+0x9BDF	U+5DF2	# <cjk>
+0x9BE0	U+5DF5	# <cjk>
+0x9BE1	U+5E0B	# <cjk>
+0x9BE2	U+5E1A	# <cjk>
+0x9BE3	U+5E19	# <cjk>
+0x9BE4	U+5E11	# <cjk>
+0x9BE5	U+5E1B	# <cjk>
+0x9BE6	U+5E36	# <cjk>
+0x9BE7	U+5E37	# <cjk>
+0x9BE8	U+5E44	# <cjk>
+0x9BE9	U+5E43	# <cjk>
+0x9BEA	U+5E40	# <cjk>
+0x9BEB	U+5E4E	# <cjk>
+0x9BEC	U+5E57	# <cjk>
+0x9BED	U+5E54	# <cjk>
+0x9BEE	U+5E5F	# <cjk>
+0x9BEF	U+5E62	# <cjk>
+0x9BF0	U+5E64	# <cjk>
+0x9BF1	U+5E47	# <cjk>
+0x9BF2	U+5E75	# <cjk>
+0x9BF3	U+5E76	# <cjk>
+0x9BF4	U+5E7A	# <cjk>
+0x9BF5	U+9EBC	# <cjk>
+0x9BF6	U+5E7F	# <cjk>
+0x9BF7	U+5EA0	# <cjk>
+0x9BF8	U+5EC1	# <cjk>
+0x9BF9	U+5EC2	# <cjk>
+0x9BFA	U+5EC8	# <cjk>
+0x9BFB	U+5ED0	# <cjk>
+0x9BFC	U+5ECF	# <cjk>
+0x9C40	U+5ED6	# <cjk>
+0x9C41	U+5EE3	# <cjk>
+0x9C42	U+5EDD	# <cjk>
+0x9C43	U+5EDA	# <cjk>
+0x9C44	U+5EDB	# <cjk>
+0x9C45	U+5EE2	# <cjk>
+0x9C46	U+5EE1	# <cjk>
+0x9C47	U+5EE8	# <cjk>
+0x9C48	U+5EE9	# <cjk>
+0x9C49	U+5EEC	# <cjk>
+0x9C4A	U+5EF1	# <cjk>
+0x9C4B	U+5EF3	# <cjk>
+0x9C4C	U+5EF0	# <cjk>
+0x9C4D	U+5EF4	# <cjk>
+0x9C4E	U+5EF8	# <cjk>
+0x9C4F	U+5EFE	# <cjk>
+0x9C50	U+5F03	# <cjk>
+0x9C51	U+5F09	# <cjk>
+0x9C52	U+5F5D	# <cjk>
+0x9C53	U+5F5C	# <cjk>
+0x9C54	U+5F0B	# <cjk>
+0x9C55	U+5F11	# <cjk>
+0x9C56	U+5F16	# <cjk>
+0x9C57	U+5F29	# <cjk>
+0x9C58	U+5F2D	# <cjk>
+0x9C59	U+5F38	# <cjk>
+0x9C5A	U+5F41	# <cjk>
+0x9C5B	U+5F48	# <cjk>
+0x9C5C	U+5F4C	# <cjk>
+0x9C5D	U+5F4E	# <cjk>
+0x9C5E	U+5F2F	# <cjk>
+0x9C5F	U+5F51	# <cjk>
+0x9C60	U+5F56	# <cjk>
+0x9C61	U+5F57	# <cjk>
+0x9C62	U+5F59	# <cjk>
+0x9C63	U+5F61	# <cjk>
+0x9C64	U+5F6D	# <cjk>
+0x9C65	U+5F73	# <cjk>
+0x9C66	U+5F77	# <cjk>
+0x9C67	U+5F83	# <cjk>
+0x9C68	U+5F82	# <cjk>
+0x9C69	U+5F7F	# <cjk>
+0x9C6A	U+5F8A	# <cjk>
+0x9C6B	U+5F88	# <cjk>
+0x9C6C	U+5F91	# <cjk>
+0x9C6D	U+5F87	# <cjk>
+0x9C6E	U+5F9E	# <cjk>
+0x9C6F	U+5F99	# <cjk>
+0x9C70	U+5F98	# <cjk>
+0x9C71	U+5FA0	# <cjk>
+0x9C72	U+5FA8	# <cjk>
+0x9C73	U+5FAD	# <cjk>
+0x9C74	U+5FBC	# <cjk>
+0x9C75	U+5FD6	# <cjk>
+0x9C76	U+5FFB	# <cjk>
+0x9C77	U+5FE4	# <cjk>
+0x9C78	U+5FF8	# <cjk>
+0x9C79	U+5FF1	# <cjk>
+0x9C7A	U+5FDD	# <cjk>
+0x9C7B	U+60B3	# <cjk>
+0x9C7C	U+5FFF	# <cjk>
+0x9C7D	U+6021	# <cjk>
+0x9C7E	U+6060	# <cjk>
+0x9C80	U+6019	# <cjk>
+0x9C81	U+6010	# <cjk>
+0x9C82	U+6029	# <cjk>
+0x9C83	U+600E	# <cjk>
+0x9C84	U+6031	# <cjk>
+0x9C85	U+601B	# <cjk>
+0x9C86	U+6015	# <cjk>
+0x9C87	U+602B	# <cjk>
+0x9C88	U+6026	# <cjk>
+0x9C89	U+600F	# <cjk>
+0x9C8A	U+603A	# <cjk>
+0x9C8B	U+605A	# <cjk>
+0x9C8C	U+6041	# <cjk>
+0x9C8D	U+606A	# <cjk>
+0x9C8E	U+6077	# <cjk>
+0x9C8F	U+605F	# <cjk>
+0x9C90	U+604A	# <cjk>
+0x9C91	U+6046	# <cjk>
+0x9C92	U+604D	# <cjk>
+0x9C93	U+6063	# <cjk>
+0x9C94	U+6043	# <cjk>
+0x9C95	U+6064	# <cjk>
+0x9C96	U+6042	# <cjk>
+0x9C97	U+606C	# <cjk>
+0x9C98	U+606B	# <cjk>
+0x9C99	U+6059	# <cjk>
+0x9C9A	U+6081	# <cjk>
+0x9C9B	U+608D	# <cjk>
+0x9C9C	U+60E7	# <cjk>
+0x9C9D	U+6083	# <cjk>
+0x9C9E	U+609A	# <cjk>
+0x9C9F	U+6084	# <cjk>
+0x9CA0	U+609B	# <cjk>
+0x9CA1	U+6096	# <cjk>
+0x9CA2	U+6097	# <cjk>
+0x9CA3	U+6092	# <cjk>
+0x9CA4	U+60A7	# <cjk>
+0x9CA5	U+608B	# <cjk>
+0x9CA6	U+60E1	# <cjk>
+0x9CA7	U+60B8	# <cjk>
+0x9CA8	U+60E0	# <cjk>
+0x9CA9	U+60D3	# <cjk>
+0x9CAA	U+60B4	# <cjk>
+0x9CAB	U+5FF0	# <cjk>
+0x9CAC	U+60BD	# <cjk>
+0x9CAD	U+60C6	# <cjk>
+0x9CAE	U+60B5	# <cjk>
+0x9CAF	U+60D8	# <cjk>
+0x9CB0	U+614D	# <cjk>
+0x9CB1	U+6115	# <cjk>
+0x9CB2	U+6106	# <cjk>
+0x9CB3	U+60F6	# <cjk>
+0x9CB4	U+60F7	# <cjk>
+0x9CB5	U+6100	# <cjk>
+0x9CB6	U+60F4	# <cjk>
+0x9CB7	U+60FA	# <cjk>
+0x9CB8	U+6103	# <cjk>
+0x9CB9	U+6121	# <cjk>
+0x9CBA	U+60FB	# <cjk>
+0x9CBB	U+60F1	# <cjk>
+0x9CBC	U+610D	# <cjk>
+0x9CBD	U+610E	# <cjk>
+0x9CBE	U+6147	# <cjk>
+0x9CBF	U+613E	# <cjk>
+0x9CC0	U+6128	# <cjk>
+0x9CC1	U+6127	# <cjk>
+0x9CC2	U+614A	# <cjk>
+0x9CC3	U+613F	# <cjk>
+0x9CC4	U+613C	# <cjk>
+0x9CC5	U+612C	# <cjk>
+0x9CC6	U+6134	# <cjk>
+0x9CC7	U+613D	# <cjk>
+0x9CC8	U+6142	# <cjk>
+0x9CC9	U+6144	# <cjk>
+0x9CCA	U+6173	# <cjk>
+0x9CCB	U+6177	# <cjk>
+0x9CCC	U+6158	# <cjk>
+0x9CCD	U+6159	# <cjk>
+0x9CCE	U+615A	# <cjk>
+0x9CCF	U+616B	# <cjk>
+0x9CD0	U+6174	# <cjk>
+0x9CD1	U+616F	# <cjk>
+0x9CD2	U+6165	# <cjk>
+0x9CD3	U+6171	# <cjk>
+0x9CD4	U+615F	# <cjk>
+0x9CD5	U+615D	# <cjk>
+0x9CD6	U+6153	# <cjk>
+0x9CD7	U+6175	# <cjk>
+0x9CD8	U+6199	# <cjk>
+0x9CD9	U+6196	# <cjk>
+0x9CDA	U+6187	# <cjk>
+0x9CDB	U+61AC	# <cjk>
+0x9CDC	U+6194	# <cjk>
+0x9CDD	U+619A	# <cjk>
+0x9CDE	U+618A	# <cjk>
+0x9CDF	U+6191	# <cjk>
+0x9CE0	U+61AB	# <cjk>
+0x9CE1	U+61AE	# <cjk>
+0x9CE2	U+61CC	# <cjk>
+0x9CE3	U+61CA	# <cjk>
+0x9CE4	U+61C9	# <cjk>
+0x9CE5	U+61F7	# <cjk>
+0x9CE6	U+61C8	# <cjk>
+0x9CE7	U+61C3	# <cjk>
+0x9CE8	U+61C6	# <cjk>
+0x9CE9	U+61BA	# <cjk>
+0x9CEA	U+61CB	# <cjk>
+0x9CEB	U+7F79	# <cjk>
+0x9CEC	U+61CD	# <cjk>
+0x9CED	U+61E6	# <cjk>
+0x9CEE	U+61E3	# <cjk>
+0x9CEF	U+61F6	# <cjk>
+0x9CF0	U+61FA	# <cjk>
+0x9CF1	U+61F4	# <cjk>
+0x9CF2	U+61FF	# <cjk>
+0x9CF3	U+61FD	# <cjk>
+0x9CF4	U+61FC	# <cjk>
+0x9CF5	U+61FE	# <cjk>
+0x9CF6	U+6200	# <cjk>
+0x9CF7	U+6208	# <cjk>
+0x9CF8	U+6209	# <cjk>
+0x9CF9	U+620D	# <cjk>
+0x9CFA	U+620C	# <cjk>
+0x9CFB	U+6214	# <cjk>
+0x9CFC	U+621B	# <cjk>
+0x9D40	U+621E	# <cjk>
+0x9D41	U+6221	# <cjk>
+0x9D42	U+622A	# <cjk>
+0x9D43	U+622E	# <cjk>
+0x9D44	U+6230	# <cjk>
+0x9D45	U+6232	# <cjk>
+0x9D46	U+6233	# <cjk>
+0x9D47	U+6241	# <cjk>
+0x9D48	U+624E	# <cjk>
+0x9D49	U+625E	# <cjk>
+0x9D4A	U+6263	# <cjk>
+0x9D4B	U+625B	# <cjk>
+0x9D4C	U+6260	# <cjk>
+0x9D4D	U+6268	# <cjk>
+0x9D4E	U+627C	# <cjk>
+0x9D4F	U+6282	# <cjk>
+0x9D50	U+6289	# <cjk>
+0x9D51	U+627E	# <cjk>
+0x9D52	U+6292	# <cjk>
+0x9D53	U+6293	# <cjk>
+0x9D54	U+6296	# <cjk>
+0x9D55	U+62D4	# <cjk>
+0x9D56	U+6283	# <cjk>
+0x9D57	U+6294	# <cjk>
+0x9D58	U+62D7	# <cjk>
+0x9D59	U+62D1	# <cjk>
+0x9D5A	U+62BB	# <cjk>
+0x9D5B	U+62CF	# <cjk>
+0x9D5C	U+62FF	# <cjk>
+0x9D5D	U+62C6	# <cjk>
+0x9D5E	U+64D4	# <cjk>
+0x9D5F	U+62C8	# <cjk>
+0x9D60	U+62DC	# <cjk>
+0x9D61	U+62CC	# <cjk>
+0x9D62	U+62CA	# <cjk>
+0x9D63	U+62C2	# <cjk>
+0x9D64	U+62C7	# <cjk>
+0x9D65	U+629B	# <cjk>
+0x9D66	U+62C9	# <cjk>
+0x9D67	U+630C	# <cjk>
+0x9D68	U+62EE	# <cjk>
+0x9D69	U+62F1	# <cjk>
+0x9D6A	U+6327	# <cjk>
+0x9D6B	U+6302	# <cjk>
+0x9D6C	U+6308	# <cjk>
+0x9D6D	U+62EF	# <cjk>
+0x9D6E	U+62F5	# <cjk>
+0x9D6F	U+6350	# <cjk>
+0x9D70	U+633E	# <cjk>
+0x9D71	U+634D	# <cjk>
+0x9D72	U+641C	# <cjk>
+0x9D73	U+634F	# <cjk>
+0x9D74	U+6396	# <cjk>
+0x9D75	U+638E	# <cjk>
+0x9D76	U+6380	# <cjk>
+0x9D77	U+63AB	# <cjk>
+0x9D78	U+6376	# <cjk>
+0x9D79	U+63A3	# <cjk>
+0x9D7A	U+638F	# <cjk>
+0x9D7B	U+6389	# <cjk>
+0x9D7C	U+639F	# <cjk>
+0x9D7D	U+63B5	# <cjk>
+0x9D7E	U+636B	# <cjk>
+0x9D80	U+6369	# <cjk>
+0x9D81	U+63BE	# <cjk>
+0x9D82	U+63E9	# <cjk>
+0x9D83	U+63C0	# <cjk>
+0x9D84	U+63C6	# <cjk>
+0x9D85	U+63E3	# <cjk>
+0x9D86	U+63C9	# <cjk>
+0x9D87	U+63D2	# <cjk>
+0x9D88	U+63F6	# <cjk>
+0x9D89	U+63C4	# <cjk>
+0x9D8A	U+6416	# <cjk>
+0x9D8B	U+6434	# <cjk>
+0x9D8C	U+6406	# <cjk>
+0x9D8D	U+6413	# <cjk>
+0x9D8E	U+6426	# <cjk>
+0x9D8F	U+6436	# <cjk>
+0x9D90	U+651D	# <cjk>
+0x9D91	U+6417	# <cjk>
+0x9D92	U+6428	# <cjk>
+0x9D93	U+640F	# <cjk>
+0x9D94	U+6467	# <cjk>
+0x9D95	U+646F	# <cjk>
+0x9D96	U+6476	# <cjk>
+0x9D97	U+644E	# <cjk>
+0x9D98	U+652A	# <cjk>
+0x9D99	U+6495	# <cjk>
+0x9D9A	U+6493	# <cjk>
+0x9D9B	U+64A5	# <cjk>
+0x9D9C	U+64A9	# <cjk>
+0x9D9D	U+6488	# <cjk>
+0x9D9E	U+64BC	# <cjk>
+0x9D9F	U+64DA	# <cjk>
+0x9DA0	U+64D2	# <cjk>
+0x9DA1	U+64C5	# <cjk>
+0x9DA2	U+64C7	# <cjk>
+0x9DA3	U+64BB	# <cjk>
+0x9DA4	U+64D8	# <cjk>
+0x9DA5	U+64C2	# <cjk>
+0x9DA6	U+64F1	# <cjk>
+0x9DA7	U+64E7	# <cjk>
+0x9DA8	U+8209	# <cjk>
+0x9DA9	U+64E0	# <cjk>
+0x9DAA	U+64E1	# <cjk>
+0x9DAB	U+62AC	# <cjk>
+0x9DAC	U+64E3	# <cjk>
+0x9DAD	U+64EF	# <cjk>
+0x9DAE	U+652C	# <cjk>
+0x9DAF	U+64F6	# <cjk>
+0x9DB0	U+64F4	# <cjk>
+0x9DB1	U+64F2	# <cjk>
+0x9DB2	U+64FA	# <cjk>
+0x9DB3	U+6500	# <cjk>
+0x9DB4	U+64FD	# <cjk>
+0x9DB5	U+6518	# <cjk>
+0x9DB6	U+651C	# <cjk>
+0x9DB7	U+6505	# <cjk>
+0x9DB8	U+6524	# <cjk>
+0x9DB9	U+6523	# <cjk>
+0x9DBA	U+652B	# <cjk>
+0x9DBB	U+6534	# <cjk>
+0x9DBC	U+6535	# <cjk>
+0x9DBD	U+6537	# <cjk>
+0x9DBE	U+6536	# <cjk>
+0x9DBF	U+6538	# <cjk>
+0x9DC0	U+754B	# <cjk>
+0x9DC1	U+6548	# <cjk>
+0x9DC2	U+6556	# <cjk>
+0x9DC3	U+6555	# <cjk>
+0x9DC4	U+654D	# <cjk>
+0x9DC5	U+6558	# <cjk>
+0x9DC6	U+655E	# <cjk>
+0x9DC7	U+655D	# <cjk>
+0x9DC8	U+6572	# <cjk>
+0x9DC9	U+6578	# <cjk>
+0x9DCA	U+6582	# <cjk>
+0x9DCB	U+6583	# <cjk>
+0x9DCC	U+8B8A	# <cjk>
+0x9DCD	U+659B	# <cjk>
+0x9DCE	U+659F	# <cjk>
+0x9DCF	U+65AB	# <cjk>
+0x9DD0	U+65B7	# <cjk>
+0x9DD1	U+65C3	# <cjk>
+0x9DD2	U+65C6	# <cjk>
+0x9DD3	U+65C1	# <cjk>
+0x9DD4	U+65C4	# <cjk>
+0x9DD5	U+65CC	# <cjk>
+0x9DD6	U+65D2	# <cjk>
+0x9DD7	U+65DB	# <cjk>
+0x9DD8	U+65D9	# <cjk>
+0x9DD9	U+65E0	# <cjk>
+0x9DDA	U+65E1	# <cjk>
+0x9DDB	U+65F1	# <cjk>
+0x9DDC	U+6772	# <cjk>
+0x9DDD	U+660A	# <cjk>
+0x9DDE	U+6603	# <cjk>
+0x9DDF	U+65FB	# <cjk>
+0x9DE0	U+6773	# <cjk>
+0x9DE1	U+6635	# <cjk>
+0x9DE2	U+6636	# <cjk>
+0x9DE3	U+6634	# <cjk>
+0x9DE4	U+661C	# <cjk>
+0x9DE5	U+664F	# <cjk>
+0x9DE6	U+6644	# <cjk>
+0x9DE7	U+6649	# <cjk>
+0x9DE8	U+6641	# <cjk>
+0x9DE9	U+665E	# <cjk>
+0x9DEA	U+665D	# <cjk>
+0x9DEB	U+6664	# <cjk>
+0x9DEC	U+6667	# <cjk>
+0x9DED	U+6668	# <cjk>
+0x9DEE	U+665F	# <cjk>
+0x9DEF	U+6662	# <cjk>
+0x9DF0	U+6670	# <cjk>
+0x9DF1	U+6683	# <cjk>
+0x9DF2	U+6688	# <cjk>
+0x9DF3	U+668E	# <cjk>
+0x9DF4	U+6689	# <cjk>
+0x9DF5	U+6684	# <cjk>
+0x9DF6	U+6698	# <cjk>
+0x9DF7	U+669D	# <cjk>
+0x9DF8	U+66C1	# <cjk>
+0x9DF9	U+66B9	# <cjk>
+0x9DFA	U+66C9	# <cjk>
+0x9DFB	U+66BE	# <cjk>
+0x9DFC	U+66BC	# <cjk>
+0x9E40	U+66C4	# <cjk>
+0x9E41	U+66B8	# <cjk>
+0x9E42	U+66D6	# <cjk>
+0x9E43	U+66DA	# <cjk>
+0x9E44	U+66E0	# <cjk>
+0x9E45	U+663F	# <cjk>
+0x9E46	U+66E6	# <cjk>
+0x9E47	U+66E9	# <cjk>
+0x9E48	U+66F0	# <cjk>
+0x9E49	U+66F5	# <cjk>
+0x9E4A	U+66F7	# <cjk>
+0x9E4B	U+670F	# <cjk>
+0x9E4C	U+6716	# <cjk>
+0x9E4D	U+671E	# <cjk>
+0x9E4E	U+6726	# <cjk>
+0x9E4F	U+6727	# <cjk>
+0x9E50	U+9738	# <cjk>
+0x9E51	U+672E	# <cjk>
+0x9E52	U+673F	# <cjk>
+0x9E53	U+6736	# <cjk>
+0x9E54	U+6741	# <cjk>
+0x9E55	U+6738	# <cjk>
+0x9E56	U+6737	# <cjk>
+0x9E57	U+6746	# <cjk>
+0x9E58	U+675E	# <cjk>
+0x9E59	U+6760	# <cjk>
+0x9E5A	U+6759	# <cjk>
+0x9E5B	U+6763	# <cjk>
+0x9E5C	U+6764	# <cjk>
+0x9E5D	U+6789	# <cjk>
+0x9E5E	U+6770	# <cjk>
+0x9E5F	U+67A9	# <cjk>
+0x9E60	U+677C	# <cjk>
+0x9E61	U+676A	# <cjk>
+0x9E62	U+678C	# <cjk>
+0x9E63	U+678B	# <cjk>
+0x9E64	U+67A6	# <cjk>
+0x9E65	U+67A1	# <cjk>
+0x9E66	U+6785	# <cjk>
+0x9E67	U+67B7	# <cjk>
+0x9E68	U+67EF	# <cjk>
+0x9E69	U+67B4	# <cjk>
+0x9E6A	U+67EC	# <cjk>
+0x9E6B	U+67B3	# <cjk>
+0x9E6C	U+67E9	# <cjk>
+0x9E6D	U+67B8	# <cjk>
+0x9E6E	U+67E4	# <cjk>
+0x9E6F	U+67DE	# <cjk>
+0x9E70	U+67DD	# <cjk>
+0x9E71	U+67E2	# <cjk>
+0x9E72	U+67EE	# <cjk>
+0x9E73	U+67B9	# <cjk>
+0x9E74	U+67CE	# <cjk>
+0x9E75	U+67C6	# <cjk>
+0x9E76	U+67E7	# <cjk>
+0x9E77	U+6A9C	# <cjk>
+0x9E78	U+681E	# <cjk>
+0x9E79	U+6846	# <cjk>
+0x9E7A	U+6829	# <cjk>
+0x9E7B	U+6840	# <cjk>
+0x9E7C	U+684D	# <cjk>
+0x9E7D	U+6832	# <cjk>
+0x9E7E	U+684E	# <cjk>
+0x9E80	U+68B3	# <cjk>
+0x9E81	U+682B	# <cjk>
+0x9E82	U+6859	# <cjk>
+0x9E83	U+6863	# <cjk>
+0x9E84	U+6877	# <cjk>
+0x9E85	U+687F	# <cjk>
+0x9E86	U+689F	# <cjk>
+0x9E87	U+688F	# <cjk>
+0x9E88	U+68AD	# <cjk>
+0x9E89	U+6894	# <cjk>
+0x9E8A	U+689D	# <cjk>
+0x9E8B	U+689B	# <cjk>
+0x9E8C	U+6883	# <cjk>
+0x9E8D	U+6AAE	# <cjk>
+0x9E8E	U+68B9	# <cjk>
+0x9E8F	U+6874	# <cjk>
+0x9E90	U+68B5	# <cjk>
+0x9E91	U+68A0	# <cjk>
+0x9E92	U+68BA	# <cjk>
+0x9E93	U+690F	# <cjk>
+0x9E94	U+688D	# <cjk>
+0x9E95	U+687E	# <cjk>
+0x9E96	U+6901	# <cjk>
+0x9E97	U+68CA	# <cjk>
+0x9E98	U+6908	# <cjk>
+0x9E99	U+68D8	# <cjk>
+0x9E9A	U+6922	# <cjk>
+0x9E9B	U+6926	# <cjk>
+0x9E9C	U+68E1	# <cjk>
+0x9E9D	U+690C	# <cjk>
+0x9E9E	U+68CD	# <cjk>
+0x9E9F	U+68D4	# <cjk>
+0x9EA0	U+68E7	# <cjk>
+0x9EA1	U+68D5	# <cjk>
+0x9EA2	U+6936	# <cjk>
+0x9EA3	U+6912	# <cjk>
+0x9EA4	U+6904	# <cjk>
+0x9EA5	U+68D7	# <cjk>
+0x9EA6	U+68E3	# <cjk>
+0x9EA7	U+6925	# <cjk>
+0x9EA8	U+68F9	# <cjk>
+0x9EA9	U+68E0	# <cjk>
+0x9EAA	U+68EF	# <cjk>
+0x9EAB	U+6928	# <cjk>
+0x9EAC	U+692A	# <cjk>
+0x9EAD	U+691A	# <cjk>
+0x9EAE	U+6923	# <cjk>
+0x9EAF	U+6921	# <cjk>
+0x9EB0	U+68C6	# <cjk>
+0x9EB1	U+6979	# <cjk>
+0x9EB2	U+6977	# <cjk>
+0x9EB3	U+695C	# <cjk>
+0x9EB4	U+6978	# <cjk>
+0x9EB5	U+696B	# <cjk>
+0x9EB6	U+6954	# <cjk>
+0x9EB7	U+697E	# <cjk>
+0x9EB8	U+696E	# <cjk>
+0x9EB9	U+6939	# <cjk>
+0x9EBA	U+6974	# <cjk>
+0x9EBB	U+693D	# <cjk>
+0x9EBC	U+6959	# <cjk>
+0x9EBD	U+6930	# <cjk>
+0x9EBE	U+6961	# <cjk>
+0x9EBF	U+695E	# <cjk>
+0x9EC0	U+695D	# <cjk>
+0x9EC1	U+6981	# <cjk>
+0x9EC2	U+696A	# <cjk>
+0x9EC3	U+69B2	# <cjk>
+0x9EC4	U+69AE	# <cjk>
+0x9EC5	U+69D0	# <cjk>
+0x9EC6	U+69BF	# <cjk>
+0x9EC7	U+69C1	# <cjk>
+0x9EC8	U+69D3	# <cjk>
+0x9EC9	U+69BE	# <cjk>
+0x9ECA	U+69CE	# <cjk>
+0x9ECB	U+5BE8	# <cjk>
+0x9ECC	U+69CA	# <cjk>
+0x9ECD	U+69DD	# <cjk>
+0x9ECE	U+69BB	# <cjk>
+0x9ECF	U+69C3	# <cjk>
+0x9ED0	U+69A7	# <cjk>
+0x9ED1	U+6A2E	# <cjk>
+0x9ED2	U+6991	# <cjk>
+0x9ED3	U+69A0	# <cjk>
+0x9ED4	U+699C	# <cjk>
+0x9ED5	U+6995	# <cjk>
+0x9ED6	U+69B4	# <cjk>
+0x9ED7	U+69DE	# <cjk>
+0x9ED8	U+69E8	# <cjk>
+0x9ED9	U+6A02	# <cjk>
+0x9EDA	U+6A1B	# <cjk>
+0x9EDB	U+69FF	# <cjk>
+0x9EDC	U+6B0A	# <cjk>
+0x9EDD	U+69F9	# <cjk>
+0x9EDE	U+69F2	# <cjk>
+0x9EDF	U+69E7	# <cjk>
+0x9EE0	U+6A05	# <cjk>
+0x9EE1	U+69B1	# <cjk>
+0x9EE2	U+6A1E	# <cjk>
+0x9EE3	U+69ED	# <cjk>
+0x9EE4	U+6A14	# <cjk>
+0x9EE5	U+69EB	# <cjk>
+0x9EE6	U+6A0A	# <cjk>
+0x9EE7	U+6A12	# <cjk>
+0x9EE8	U+6AC1	# <cjk>
+0x9EE9	U+6A23	# <cjk>
+0x9EEA	U+6A13	# <cjk>
+0x9EEB	U+6A44	# <cjk>
+0x9EEC	U+6A0C	# <cjk>
+0x9EED	U+6A72	# <cjk>
+0x9EEE	U+6A36	# <cjk>
+0x9EEF	U+6A78	# <cjk>
+0x9EF0	U+6A47	# <cjk>
+0x9EF1	U+6A62	# <cjk>
+0x9EF2	U+6A59	# <cjk>
+0x9EF3	U+6A66	# <cjk>
+0x9EF4	U+6A48	# <cjk>
+0x9EF5	U+6A38	# <cjk>
+0x9EF6	U+6A22	# <cjk>
+0x9EF7	U+6A90	# <cjk>
+0x9EF8	U+6A8D	# <cjk>
+0x9EF9	U+6AA0	# <cjk>
+0x9EFA	U+6A84	# <cjk>
+0x9EFB	U+6AA2	# <cjk>
+0x9EFC	U+6AA3	# <cjk>
+0x9F40	U+6A97	# <cjk>
+0x9F41	U+8617	# <cjk>
+0x9F42	U+6ABB	# <cjk>
+0x9F43	U+6AC3	# <cjk>
+0x9F44	U+6AC2	# <cjk>
+0x9F45	U+6AB8	# <cjk>
+0x9F46	U+6AB3	# <cjk>
+0x9F47	U+6AAC	# <cjk>
+0x9F48	U+6ADE	# <cjk>
+0x9F49	U+6AD1	# <cjk>
+0x9F4A	U+6ADF	# <cjk>
+0x9F4B	U+6AAA	# <cjk>
+0x9F4C	U+6ADA	# <cjk>
+0x9F4D	U+6AEA	# <cjk>
+0x9F4E	U+6AFB	# <cjk>
+0x9F4F	U+6B05	# <cjk>
+0x9F50	U+8616	# <cjk>
+0x9F51	U+6AFA	# <cjk>
+0x9F52	U+6B12	# <cjk>
+0x9F53	U+6B16	# <cjk>
+0x9F54	U+9B31	# <cjk>
+0x9F55	U+6B1F	# <cjk>
+0x9F56	U+6B38	# <cjk>
+0x9F57	U+6B37	# <cjk>
+0x9F58	U+76DC	# <cjk>
+0x9F59	U+6B39	# <cjk>
+0x9F5A	U+98EE	# <cjk>
+0x9F5B	U+6B47	# <cjk>
+0x9F5C	U+6B43	# <cjk>
+0x9F5D	U+6B49	# <cjk>
+0x9F5E	U+6B50	# <cjk>
+0x9F5F	U+6B59	# <cjk>
+0x9F60	U+6B54	# <cjk>
+0x9F61	U+6B5B	# <cjk>
+0x9F62	U+6B5F	# <cjk>
+0x9F63	U+6B61	# <cjk>
+0x9F64	U+6B78	# <cjk>
+0x9F65	U+6B79	# <cjk>
+0x9F66	U+6B7F	# <cjk>
+0x9F67	U+6B80	# <cjk>
+0x9F68	U+6B84	# <cjk>
+0x9F69	U+6B83	# <cjk>
+0x9F6A	U+6B8D	# <cjk>
+0x9F6B	U+6B98	# <cjk>
+0x9F6C	U+6B95	# <cjk>
+0x9F6D	U+6B9E	# <cjk>
+0x9F6E	U+6BA4	# <cjk>
+0x9F6F	U+6BAA	# <cjk>
+0x9F70	U+6BAB	# <cjk>
+0x9F71	U+6BAF	# <cjk>
+0x9F72	U+6BB2	# <cjk>
+0x9F73	U+6BB1	# <cjk>
+0x9F74	U+6BB3	# <cjk>
+0x9F75	U+6BB7	# <cjk>
+0x9F76	U+6BBC	# <cjk>
+0x9F77	U+6BC6	# <cjk>
+0x9F78	U+6BCB	# <cjk>
+0x9F79	U+6BD3	# <cjk>
+0x9F7A	U+6BDF	# <cjk>
+0x9F7B	U+6BEC	# <cjk>
+0x9F7C	U+6BEB	# <cjk>
+0x9F7D	U+6BF3	# <cjk>
+0x9F7E	U+6BEF	# <cjk>
+0x9F80	U+9EBE	# <cjk>
+0x9F81	U+6C08	# <cjk>
+0x9F82	U+6C13	# <cjk>
+0x9F83	U+6C14	# <cjk>
+0x9F84	U+6C1B	# <cjk>
+0x9F85	U+6C24	# <cjk>
+0x9F86	U+6C23	# <cjk>
+0x9F87	U+6C5E	# <cjk>
+0x9F88	U+6C55	# <cjk>
+0x9F89	U+6C62	# <cjk>
+0x9F8A	U+6C6A	# <cjk>
+0x9F8B	U+6C82	# <cjk>
+0x9F8C	U+6C8D	# <cjk>
+0x9F8D	U+6C9A	# <cjk>
+0x9F8E	U+6C81	# <cjk>
+0x9F8F	U+6C9B	# <cjk>
+0x9F90	U+6C7E	# <cjk>
+0x9F91	U+6C68	# <cjk>
+0x9F92	U+6C73	# <cjk>
+0x9F93	U+6C92	# <cjk>
+0x9F94	U+6C90	# <cjk>
+0x9F95	U+6CC4	# <cjk>
+0x9F96	U+6CF1	# <cjk>
+0x9F97	U+6CD3	# <cjk>
+0x9F98	U+6CBD	# <cjk>
+0x9F99	U+6CD7	# <cjk>
+0x9F9A	U+6CC5	# <cjk>
+0x9F9B	U+6CDD	# <cjk>
+0x9F9C	U+6CAE	# <cjk>
+0x9F9D	U+6CB1	# <cjk>
+0x9F9E	U+6CBE	# <cjk>
+0x9F9F	U+6CBA	# <cjk>
+0x9FA0	U+6CDB	# <cjk>
+0x9FA1	U+6CEF	# <cjk>
+0x9FA2	U+6CD9	# <cjk>
+0x9FA3	U+6CEA	# <cjk>
+0x9FA4	U+6D1F	# <cjk>
+0x9FA5	U+884D	# <cjk>
+0x9FA6	U+6D36	# <cjk>
+0x9FA7	U+6D2B	# <cjk>
+0x9FA8	U+6D3D	# <cjk>
+0x9FA9	U+6D38	# <cjk>
+0x9FAA	U+6D19	# <cjk>
+0x9FAB	U+6D35	# <cjk>
+0x9FAC	U+6D33	# <cjk>
+0x9FAD	U+6D12	# <cjk>
+0x9FAE	U+6D0C	# <cjk>
+0x9FAF	U+6D63	# <cjk>
+0x9FB0	U+6D93	# <cjk>
+0x9FB1	U+6D64	# <cjk>
+0x9FB2	U+6D5A	# <cjk>
+0x9FB3	U+6D79	# <cjk>
+0x9FB4	U+6D59	# <cjk>
+0x9FB5	U+6D8E	# <cjk>
+0x9FB6	U+6D95	# <cjk>
+0x9FB7	U+6FE4	# <cjk>
+0x9FB8	U+6D85	# <cjk>
+0x9FB9	U+6DF9	# <cjk>
+0x9FBA	U+6E15	# <cjk>
+0x9FBB	U+6E0A	# <cjk>
+0x9FBC	U+6DB5	# <cjk>
+0x9FBD	U+6DC7	# <cjk>
+0x9FBE	U+6DE6	# <cjk>
+0x9FBF	U+6DB8	# <cjk>
+0x9FC0	U+6DC6	# <cjk>
+0x9FC1	U+6DEC	# <cjk>
+0x9FC2	U+6DDE	# <cjk>
+0x9FC3	U+6DCC	# <cjk>
+0x9FC4	U+6DE8	# <cjk>
+0x9FC5	U+6DD2	# <cjk>
+0x9FC6	U+6DC5	# <cjk>
+0x9FC7	U+6DFA	# <cjk>
+0x9FC8	U+6DD9	# <cjk>
+0x9FC9	U+6DE4	# <cjk>
+0x9FCA	U+6DD5	# <cjk>
+0x9FCB	U+6DEA	# <cjk>
+0x9FCC	U+6DEE	# <cjk>
+0x9FCD	U+6E2D	# <cjk>
+0x9FCE	U+6E6E	# <cjk>
+0x9FCF	U+6E2E	# <cjk>
+0x9FD0	U+6E19	# <cjk>
+0x9FD1	U+6E72	# <cjk>
+0x9FD2	U+6E5F	# <cjk>
+0x9FD3	U+6E3E	# <cjk>
+0x9FD4	U+6E23	# <cjk>
+0x9FD5	U+6E6B	# <cjk>
+0x9FD6	U+6E2B	# <cjk>
+0x9FD7	U+6E76	# <cjk>
+0x9FD8	U+6E4D	# <cjk>
+0x9FD9	U+6E1F	# <cjk>
+0x9FDA	U+6E43	# <cjk>
+0x9FDB	U+6E3A	# <cjk>
+0x9FDC	U+6E4E	# <cjk>
+0x9FDD	U+6E24	# <cjk>
+0x9FDE	U+6EFF	# <cjk>
+0x9FDF	U+6E1D	# <cjk>
+0x9FE0	U+6E38	# <cjk>
+0x9FE1	U+6E82	# <cjk>
+0x9FE2	U+6EAA	# <cjk>
+0x9FE3	U+6E98	# <cjk>
+0x9FE4	U+6EC9	# <cjk>
+0x9FE5	U+6EB7	# <cjk>
+0x9FE6	U+6ED3	# <cjk>
+0x9FE7	U+6EBD	# <cjk>
+0x9FE8	U+6EAF	# <cjk>
+0x9FE9	U+6EC4	# <cjk>
+0x9FEA	U+6EB2	# <cjk>
+0x9FEB	U+6ED4	# <cjk>
+0x9FEC	U+6ED5	# <cjk>
+0x9FED	U+6E8F	# <cjk>
+0x9FEE	U+6EA5	# <cjk>
+0x9FEF	U+6EC2	# <cjk>
+0x9FF0	U+6E9F	# <cjk>
+0x9FF1	U+6F41	# <cjk>
+0x9FF2	U+6F11	# <cjk>
+0x9FF3	U+704C	# <cjk>
+0x9FF4	U+6EEC	# <cjk>
+0x9FF5	U+6EF8	# <cjk>
+0x9FF6	U+6EFE	# <cjk>
+0x9FF7	U+6F3F	# <cjk>
+0x9FF8	U+6EF2	# <cjk>
+0x9FF9	U+6F31	# <cjk>
+0x9FFA	U+6EEF	# <cjk>
+0x9FFB	U+6F32	# <cjk>
+0x9FFC	U+6ECC	# <cjk>
+0xE040	U+6F3E	# <cjk>
+0xE041	U+6F13	# <cjk>
+0xE042	U+6EF7	# <cjk>
+0xE043	U+6F86	# <cjk>
+0xE044	U+6F7A	# <cjk>
+0xE045	U+6F78	# <cjk>
+0xE046	U+6F81	# <cjk>
+0xE047	U+6F80	# <cjk>
+0xE048	U+6F6F	# <cjk>
+0xE049	U+6F5B	# <cjk>
+0xE04A	U+6FF3	# <cjk>
+0xE04B	U+6F6D	# <cjk>
+0xE04C	U+6F82	# <cjk>
+0xE04D	U+6F7C	# <cjk>
+0xE04E	U+6F58	# <cjk>
+0xE04F	U+6F8E	# <cjk>
+0xE050	U+6F91	# <cjk>
+0xE051	U+6FC2	# <cjk>
+0xE052	U+6F66	# <cjk>
+0xE053	U+6FB3	# <cjk>
+0xE054	U+6FA3	# <cjk>
+0xE055	U+6FA1	# <cjk>
+0xE056	U+6FA4	# <cjk>
+0xE057	U+6FB9	# <cjk>
+0xE058	U+6FC6	# <cjk>
+0xE059	U+6FAA	# <cjk>
+0xE05A	U+6FDF	# <cjk>
+0xE05B	U+6FD5	# <cjk>
+0xE05C	U+6FEC	# <cjk>
+0xE05D	U+6FD4	# <cjk>
+0xE05E	U+6FD8	# <cjk>
+0xE05F	U+6FF1	# <cjk>
+0xE060	U+6FEE	# <cjk>
+0xE061	U+6FDB	# <cjk>
+0xE062	U+7009	# <cjk>
+0xE063	U+700B	# <cjk>
+0xE064	U+6FFA	# <cjk>
+0xE065	U+7011	# <cjk>
+0xE066	U+7001	# <cjk>
+0xE067	U+700F	# <cjk>
+0xE068	U+6FFE	# <cjk>
+0xE069	U+701B	# <cjk>
+0xE06A	U+701A	# <cjk>
+0xE06B	U+6F74	# <cjk>
+0xE06C	U+701D	# <cjk>
+0xE06D	U+7018	# <cjk>
+0xE06E	U+701F	# <cjk>
+0xE06F	U+7030	# <cjk>
+0xE070	U+703E	# <cjk>
+0xE071	U+7032	# <cjk>
+0xE072	U+7051	# <cjk>
+0xE073	U+7063	# <cjk>
+0xE074	U+7099	# <cjk>
+0xE075	U+7092	# <cjk>
+0xE076	U+70AF	# <cjk>
+0xE077	U+70F1	# <cjk>
+0xE078	U+70AC	# <cjk>
+0xE079	U+70B8	# <cjk>
+0xE07A	U+70B3	# <cjk>
+0xE07B	U+70AE	# <cjk>
+0xE07C	U+70DF	# <cjk>
+0xE07D	U+70CB	# <cjk>
+0xE07E	U+70DD	# <cjk>
+0xE080	U+70D9	# <cjk>
+0xE081	U+7109	# <cjk>
+0xE082	U+70FD	# <cjk>
+0xE083	U+711C	# <cjk>
+0xE084	U+7119	# <cjk>
+0xE085	U+7165	# <cjk>
+0xE086	U+7155	# <cjk>
+0xE087	U+7188	# <cjk>
+0xE088	U+7166	# <cjk>
+0xE089	U+7162	# <cjk>
+0xE08A	U+714C	# <cjk>
+0xE08B	U+7156	# <cjk>
+0xE08C	U+716C	# <cjk>
+0xE08D	U+718F	# <cjk>
+0xE08E	U+71FB	# <cjk>
+0xE08F	U+7184	# <cjk>
+0xE090	U+7195	# <cjk>
+0xE091	U+71A8	# <cjk>
+0xE092	U+71AC	# <cjk>
+0xE093	U+71D7	# <cjk>
+0xE094	U+71B9	# <cjk>
+0xE095	U+71BE	# <cjk>
+0xE096	U+71D2	# <cjk>
+0xE097	U+71C9	# <cjk>
+0xE098	U+71D4	# <cjk>
+0xE099	U+71CE	# <cjk>
+0xE09A	U+71E0	# <cjk>
+0xE09B	U+71EC	# <cjk>
+0xE09C	U+71E7	# <cjk>
+0xE09D	U+71F5	# <cjk>
+0xE09E	U+71FC	# <cjk>
+0xE09F	U+71F9	# <cjk>
+0xE0A0	U+71FF	# <cjk>
+0xE0A1	U+720D	# <cjk>
+0xE0A2	U+7210	# <cjk>
+0xE0A3	U+721B	# <cjk>
+0xE0A4	U+7228	# <cjk>
+0xE0A5	U+722D	# <cjk>
+0xE0A6	U+722C	# <cjk>
+0xE0A7	U+7230	# <cjk>
+0xE0A8	U+7232	# <cjk>
+0xE0A9	U+723B	# <cjk>
+0xE0AA	U+723C	# <cjk>
+0xE0AB	U+723F	# <cjk>
+0xE0AC	U+7240	# <cjk>
+0xE0AD	U+7246	# <cjk>
+0xE0AE	U+724B	# <cjk>
+0xE0AF	U+7258	# <cjk>
+0xE0B0	U+7274	# <cjk>
+0xE0B1	U+727E	# <cjk>
+0xE0B2	U+7282	# <cjk>
+0xE0B3	U+7281	# <cjk>
+0xE0B4	U+7287	# <cjk>
+0xE0B5	U+7292	# <cjk>
+0xE0B6	U+7296	# <cjk>
+0xE0B7	U+72A2	# <cjk>
+0xE0B8	U+72A7	# <cjk>
+0xE0B9	U+72B9	# <cjk>
+0xE0BA	U+72B2	# <cjk>
+0xE0BB	U+72C3	# <cjk>
+0xE0BC	U+72C6	# <cjk>
+0xE0BD	U+72C4	# <cjk>
+0xE0BE	U+72CE	# <cjk>
+0xE0BF	U+72D2	# <cjk>
+0xE0C0	U+72E2	# <cjk>
+0xE0C1	U+72E0	# <cjk>
+0xE0C2	U+72E1	# <cjk>
+0xE0C3	U+72F9	# <cjk>
+0xE0C4	U+72F7	# <cjk>
+0xE0C5	U+500F	# <cjk>
+0xE0C6	U+7317	# <cjk>
+0xE0C7	U+730A	# <cjk>
+0xE0C8	U+731C	# <cjk>
+0xE0C9	U+7316	# <cjk>
+0xE0CA	U+731D	# <cjk>
+0xE0CB	U+7334	# <cjk>
+0xE0CC	U+732F	# <cjk>
+0xE0CD	U+7329	# <cjk>
+0xE0CE	U+7325	# <cjk>
+0xE0CF	U+733E	# <cjk>
+0xE0D0	U+734E	# <cjk>
+0xE0D1	U+734F	# <cjk>
+0xE0D2	U+9ED8	# <cjk>
+0xE0D3	U+7357	# <cjk>
+0xE0D4	U+736A	# <cjk>
+0xE0D5	U+7368	# <cjk>
+0xE0D6	U+7370	# <cjk>
+0xE0D7	U+7378	# <cjk>
+0xE0D8	U+7375	# <cjk>
+0xE0D9	U+737B	# <cjk>
+0xE0DA	U+737A	# <cjk>
+0xE0DB	U+73C8	# <cjk>
+0xE0DC	U+73B3	# <cjk>
+0xE0DD	U+73CE	# <cjk>
+0xE0DE	U+73BB	# <cjk>
+0xE0DF	U+73C0	# <cjk>
+0xE0E0	U+73E5	# <cjk>
+0xE0E1	U+73EE	# <cjk>
+0xE0E2	U+73DE	# <cjk>
+0xE0E3	U+74A2	# <cjk>
+0xE0E4	U+7405	# <cjk>
+0xE0E5	U+746F	# <cjk>
+0xE0E6	U+7425	# <cjk>
+0xE0E7	U+73F8	# <cjk>
+0xE0E8	U+7432	# <cjk>
+0xE0E9	U+743A	# <cjk>
+0xE0EA	U+7455	# <cjk>
+0xE0EB	U+743F	# <cjk>
+0xE0EC	U+745F	# <cjk>
+0xE0ED	U+7459	# <cjk>
+0xE0EE	U+7441	# <cjk>
+0xE0EF	U+745C	# <cjk>
+0xE0F0	U+7469	# <cjk>
+0xE0F1	U+7470	# <cjk>
+0xE0F2	U+7463	# <cjk>
+0xE0F3	U+746A	# <cjk>
+0xE0F4	U+7476	# <cjk>
+0xE0F5	U+747E	# <cjk>
+0xE0F6	U+748B	# <cjk>
+0xE0F7	U+749E	# <cjk>
+0xE0F8	U+74A7	# <cjk>
+0xE0F9	U+74CA	# <cjk>
+0xE0FA	U+74CF	# <cjk>
+0xE0FB	U+74D4	# <cjk>
+0xE0FC	U+73F1	# <cjk>
+0xE140	U+74E0	# <cjk>
+0xE141	U+74E3	# <cjk>
+0xE142	U+74E7	# <cjk>
+0xE143	U+74E9	# <cjk>
+0xE144	U+74EE	# <cjk>
+0xE145	U+74F2	# <cjk>
+0xE146	U+74F0	# <cjk>
+0xE147	U+74F1	# <cjk>
+0xE148	U+74F8	# <cjk>
+0xE149	U+74F7	# <cjk>
+0xE14A	U+7504	# <cjk>
+0xE14B	U+7503	# <cjk>
+0xE14C	U+7505	# <cjk>
+0xE14D	U+750C	# <cjk>
+0xE14E	U+750E	# <cjk>
+0xE14F	U+750D	# <cjk>
+0xE150	U+7515	# <cjk>
+0xE151	U+7513	# <cjk>
+0xE152	U+751E	# <cjk>
+0xE153	U+7526	# <cjk>
+0xE154	U+752C	# <cjk>
+0xE155	U+753C	# <cjk>
+0xE156	U+7544	# <cjk>
+0xE157	U+754D	# <cjk>
+0xE158	U+754A	# <cjk>
+0xE159	U+7549	# <cjk>
+0xE15A	U+755B	# <cjk>
+0xE15B	U+7546	# <cjk>
+0xE15C	U+755A	# <cjk>
+0xE15D	U+7569	# <cjk>
+0xE15E	U+7564	# <cjk>
+0xE15F	U+7567	# <cjk>
+0xE160	U+756B	# <cjk>
+0xE161	U+756D	# <cjk>
+0xE162	U+7578	# <cjk>
+0xE163	U+7576	# <cjk>
+0xE164	U+7586	# <cjk>
+0xE165	U+7587	# <cjk>
+0xE166	U+7574	# <cjk>
+0xE167	U+758A	# <cjk>
+0xE168	U+7589	# <cjk>
+0xE169	U+7582	# <cjk>
+0xE16A	U+7594	# <cjk>
+0xE16B	U+759A	# <cjk>
+0xE16C	U+759D	# <cjk>
+0xE16D	U+75A5	# <cjk>
+0xE16E	U+75A3	# <cjk>
+0xE16F	U+75C2	# <cjk>
+0xE170	U+75B3	# <cjk>
+0xE171	U+75C3	# <cjk>
+0xE172	U+75B5	# <cjk>
+0xE173	U+75BD	# <cjk>
+0xE174	U+75B8	# <cjk>
+0xE175	U+75BC	# <cjk>
+0xE176	U+75B1	# <cjk>
+0xE177	U+75CD	# <cjk>
+0xE178	U+75CA	# <cjk>
+0xE179	U+75D2	# <cjk>
+0xE17A	U+75D9	# <cjk>
+0xE17B	U+75E3	# <cjk>
+0xE17C	U+75DE	# <cjk>
+0xE17D	U+75FE	# <cjk>
+0xE17E	U+75FF	# <cjk>
+0xE180	U+75FC	# <cjk>
+0xE181	U+7601	# <cjk>
+0xE182	U+75F0	# <cjk>
+0xE183	U+75FA	# <cjk>
+0xE184	U+75F2	# <cjk>
+0xE185	U+75F3	# <cjk>
+0xE186	U+760B	# <cjk>
+0xE187	U+760D	# <cjk>
+0xE188	U+7609	# <cjk>
+0xE189	U+761F	# <cjk>
+0xE18A	U+7627	# <cjk>
+0xE18B	U+7620	# <cjk>
+0xE18C	U+7621	# <cjk>
+0xE18D	U+7622	# <cjk>
+0xE18E	U+7624	# <cjk>
+0xE18F	U+7634	# <cjk>
+0xE190	U+7630	# <cjk>
+0xE191	U+763B	# <cjk>
+0xE192	U+7647	# <cjk>
+0xE193	U+7648	# <cjk>
+0xE194	U+7646	# <cjk>
+0xE195	U+765C	# <cjk>
+0xE196	U+7658	# <cjk>
+0xE197	U+7661	# <cjk>
+0xE198	U+7662	# <cjk>
+0xE199	U+7668	# <cjk>
+0xE19A	U+7669	# <cjk>
+0xE19B	U+766A	# <cjk>
+0xE19C	U+7667	# <cjk>
+0xE19D	U+766C	# <cjk>
+0xE19E	U+7670	# <cjk>
+0xE19F	U+7672	# <cjk>
+0xE1A0	U+7676	# <cjk>
+0xE1A1	U+7678	# <cjk>
+0xE1A2	U+767C	# <cjk>
+0xE1A3	U+7680	# <cjk>
+0xE1A4	U+7683	# <cjk>
+0xE1A5	U+7688	# <cjk>
+0xE1A6	U+768B	# <cjk>
+0xE1A7	U+768E	# <cjk>
+0xE1A8	U+7696	# <cjk>
+0xE1A9	U+7693	# <cjk>
+0xE1AA	U+7699	# <cjk>
+0xE1AB	U+769A	# <cjk>
+0xE1AC	U+76B0	# <cjk>
+0xE1AD	U+76B4	# <cjk>
+0xE1AE	U+76B8	# <cjk>
+0xE1AF	U+76B9	# <cjk>
+0xE1B0	U+76BA	# <cjk>
+0xE1B1	U+76C2	# <cjk>
+0xE1B2	U+76CD	# <cjk>
+0xE1B3	U+76D6	# <cjk>
+0xE1B4	U+76D2	# <cjk>
+0xE1B5	U+76DE	# <cjk>
+0xE1B6	U+76E1	# <cjk>
+0xE1B7	U+76E5	# <cjk>
+0xE1B8	U+76E7	# <cjk>
+0xE1B9	U+76EA	# <cjk>
+0xE1BA	U+862F	# <cjk>
+0xE1BB	U+76FB	# <cjk>
+0xE1BC	U+7708	# <cjk>
+0xE1BD	U+7707	# <cjk>
+0xE1BE	U+7704	# <cjk>
+0xE1BF	U+7729	# <cjk>
+0xE1C0	U+7724	# <cjk>
+0xE1C1	U+771E	# <cjk>
+0xE1C2	U+7725	# <cjk>
+0xE1C3	U+7726	# <cjk>
+0xE1C4	U+771B	# <cjk>
+0xE1C5	U+7737	# <cjk>
+0xE1C6	U+7738	# <cjk>
+0xE1C7	U+7747	# <cjk>
+0xE1C8	U+775A	# <cjk>
+0xE1C9	U+7768	# <cjk>
+0xE1CA	U+776B	# <cjk>
+0xE1CB	U+775B	# <cjk>
+0xE1CC	U+7765	# <cjk>
+0xE1CD	U+777F	# <cjk>
+0xE1CE	U+777E	# <cjk>
+0xE1CF	U+7779	# <cjk>
+0xE1D0	U+778E	# <cjk>
+0xE1D1	U+778B	# <cjk>
+0xE1D2	U+7791	# <cjk>
+0xE1D3	U+77A0	# <cjk>
+0xE1D4	U+779E	# <cjk>
+0xE1D5	U+77B0	# <cjk>
+0xE1D6	U+77B6	# <cjk>
+0xE1D7	U+77B9	# <cjk>
+0xE1D8	U+77BF	# <cjk>
+0xE1D9	U+77BC	# <cjk>
+0xE1DA	U+77BD	# <cjk>
+0xE1DB	U+77BB	# <cjk>
+0xE1DC	U+77C7	# <cjk>
+0xE1DD	U+77CD	# <cjk>
+0xE1DE	U+77D7	# <cjk>
+0xE1DF	U+77DA	# <cjk>
+0xE1E0	U+77DC	# <cjk>
+0xE1E1	U+77E3	# <cjk>
+0xE1E2	U+77EE	# <cjk>
+0xE1E3	U+77FC	# <cjk>
+0xE1E4	U+780C	# <cjk>
+0xE1E5	U+7812	# <cjk>
+0xE1E6	U+7926	# <cjk>
+0xE1E7	U+7820	# <cjk>
+0xE1E8	U+792A	# <cjk>
+0xE1E9	U+7845	# <cjk>
+0xE1EA	U+788E	# <cjk>
+0xE1EB	U+7874	# <cjk>
+0xE1EC	U+7886	# <cjk>
+0xE1ED	U+787C	# <cjk>
+0xE1EE	U+789A	# <cjk>
+0xE1EF	U+788C	# <cjk>
+0xE1F0	U+78A3	# <cjk>
+0xE1F1	U+78B5	# <cjk>
+0xE1F2	U+78AA	# <cjk>
+0xE1F3	U+78AF	# <cjk>
+0xE1F4	U+78D1	# <cjk>
+0xE1F5	U+78C6	# <cjk>
+0xE1F6	U+78CB	# <cjk>
+0xE1F7	U+78D4	# <cjk>
+0xE1F8	U+78BE	# <cjk>
+0xE1F9	U+78BC	# <cjk>
+0xE1FA	U+78C5	# <cjk>
+0xE1FB	U+78CA	# <cjk>
+0xE1FC	U+78EC	# <cjk>
+0xE240	U+78E7	# <cjk>
+0xE241	U+78DA	# <cjk>
+0xE242	U+78FD	# <cjk>
+0xE243	U+78F4	# <cjk>
+0xE244	U+7907	# <cjk>
+0xE245	U+7912	# <cjk>
+0xE246	U+7911	# <cjk>
+0xE247	U+7919	# <cjk>
+0xE248	U+792C	# <cjk>
+0xE249	U+792B	# <cjk>
+0xE24A	U+7940	# <cjk>
+0xE24B	U+7960	# <cjk>
+0xE24C	U+7957	# <cjk>
+0xE24D	U+795F	# <cjk>
+0xE24E	U+795A	# <cjk>
+0xE24F	U+7955	# <cjk>
+0xE250	U+7953	# <cjk>
+0xE251	U+797A	# <cjk>
+0xE252	U+797F	# <cjk>
+0xE253	U+798A	# <cjk>
+0xE254	U+799D	# <cjk>
+0xE255	U+79A7	# <cjk>
+0xE256	U+9F4B	# <cjk>
+0xE257	U+79AA	# <cjk>
+0xE258	U+79AE	# <cjk>
+0xE259	U+79B3	# <cjk>
+0xE25A	U+79B9	# <cjk>
+0xE25B	U+79BA	# <cjk>
+0xE25C	U+79C9	# <cjk>
+0xE25D	U+79D5	# <cjk>
+0xE25E	U+79E7	# <cjk>
+0xE25F	U+79EC	# <cjk>
+0xE260	U+79E1	# <cjk>
+0xE261	U+79E3	# <cjk>
+0xE262	U+7A08	# <cjk>
+0xE263	U+7A0D	# <cjk>
+0xE264	U+7A18	# <cjk>
+0xE265	U+7A19	# <cjk>
+0xE266	U+7A20	# <cjk>
+0xE267	U+7A1F	# <cjk>
+0xE268	U+7980	# <cjk>
+0xE269	U+7A31	# <cjk>
+0xE26A	U+7A3B	# <cjk>
+0xE26B	U+7A3E	# <cjk>
+0xE26C	U+7A37	# <cjk>
+0xE26D	U+7A43	# <cjk>
+0xE26E	U+7A57	# <cjk>
+0xE26F	U+7A49	# <cjk>
+0xE270	U+7A61	# <cjk>
+0xE271	U+7A62	# <cjk>
+0xE272	U+7A69	# <cjk>
+0xE273	U+9F9D	# <cjk>
+0xE274	U+7A70	# <cjk>
+0xE275	U+7A79	# <cjk>
+0xE276	U+7A7D	# <cjk>
+0xE277	U+7A88	# <cjk>
+0xE278	U+7A97	# <cjk>
+0xE279	U+7A95	# <cjk>
+0xE27A	U+7A98	# <cjk>
+0xE27B	U+7A96	# <cjk>
+0xE27C	U+7AA9	# <cjk>
+0xE27D	U+7AC8	# <cjk>
+0xE27E	U+7AB0	# <cjk>
+0xE280	U+7AB6	# <cjk>
+0xE281	U+7AC5	# <cjk>
+0xE282	U+7AC4	# <cjk>
+0xE283	U+7ABF	# <cjk>
+0xE284	U+9083	# <cjk>
+0xE285	U+7AC7	# <cjk>
+0xE286	U+7ACA	# <cjk>
+0xE287	U+7ACD	# <cjk>
+0xE288	U+7ACF	# <cjk>
+0xE289	U+7AD5	# <cjk>
+0xE28A	U+7AD3	# <cjk>
+0xE28B	U+7AD9	# <cjk>
+0xE28C	U+7ADA	# <cjk>
+0xE28D	U+7ADD	# <cjk>
+0xE28E	U+7AE1	# <cjk>
+0xE28F	U+7AE2	# <cjk>
+0xE290	U+7AE6	# <cjk>
+0xE291	U+7AED	# <cjk>
+0xE292	U+7AF0	# <cjk>
+0xE293	U+7B02	# <cjk>
+0xE294	U+7B0F	# <cjk>
+0xE295	U+7B0A	# <cjk>
+0xE296	U+7B06	# <cjk>
+0xE297	U+7B33	# <cjk>
+0xE298	U+7B18	# <cjk>
+0xE299	U+7B19	# <cjk>
+0xE29A	U+7B1E	# <cjk>
+0xE29B	U+7B35	# <cjk>
+0xE29C	U+7B28	# <cjk>
+0xE29D	U+7B36	# <cjk>
+0xE29E	U+7B50	# <cjk>
+0xE29F	U+7B7A	# <cjk>
+0xE2A0	U+7B04	# <cjk>
+0xE2A1	U+7B4D	# <cjk>
+0xE2A2	U+7B0B	# <cjk>
+0xE2A3	U+7B4C	# <cjk>
+0xE2A4	U+7B45	# <cjk>
+0xE2A5	U+7B75	# <cjk>
+0xE2A6	U+7B65	# <cjk>
+0xE2A7	U+7B74	# <cjk>
+0xE2A8	U+7B67	# <cjk>
+0xE2A9	U+7B70	# <cjk>
+0xE2AA	U+7B71	# <cjk>
+0xE2AB	U+7B6C	# <cjk>
+0xE2AC	U+7B6E	# <cjk>
+0xE2AD	U+7B9D	# <cjk>
+0xE2AE	U+7B98	# <cjk>
+0xE2AF	U+7B9F	# <cjk>
+0xE2B0	U+7B8D	# <cjk>
+0xE2B1	U+7B9C	# <cjk>
+0xE2B2	U+7B9A	# <cjk>
+0xE2B3	U+7B8B	# <cjk>
+0xE2B4	U+7B92	# <cjk>
+0xE2B5	U+7B8F	# <cjk>
+0xE2B6	U+7B5D	# <cjk>
+0xE2B7	U+7B99	# <cjk>
+0xE2B8	U+7BCB	# <cjk>
+0xE2B9	U+7BC1	# <cjk>
+0xE2BA	U+7BCC	# <cjk>
+0xE2BB	U+7BCF	# <cjk>
+0xE2BC	U+7BB4	# <cjk>
+0xE2BD	U+7BC6	# <cjk>
+0xE2BE	U+7BDD	# <cjk>
+0xE2BF	U+7BE9	# <cjk>
+0xE2C0	U+7C11	# <cjk>
+0xE2C1	U+7C14	# <cjk>
+0xE2C2	U+7BE6	# <cjk>
+0xE2C3	U+7BE5	# <cjk>
+0xE2C4	U+7C60	# <cjk>
+0xE2C5	U+7C00	# <cjk>
+0xE2C6	U+7C07	# <cjk>
+0xE2C7	U+7C13	# <cjk>
+0xE2C8	U+7BF3	# <cjk>
+0xE2C9	U+7BF7	# <cjk>
+0xE2CA	U+7C17	# <cjk>
+0xE2CB	U+7C0D	# <cjk>
+0xE2CC	U+7BF6	# <cjk>
+0xE2CD	U+7C23	# <cjk>
+0xE2CE	U+7C27	# <cjk>
+0xE2CF	U+7C2A	# <cjk>
+0xE2D0	U+7C1F	# <cjk>
+0xE2D1	U+7C37	# <cjk>
+0xE2D2	U+7C2B	# <cjk>
+0xE2D3	U+7C3D	# <cjk>
+0xE2D4	U+7C4C	# <cjk>
+0xE2D5	U+7C43	# <cjk>
+0xE2D6	U+7C54	# <cjk>
+0xE2D7	U+7C4F	# <cjk>
+0xE2D8	U+7C40	# <cjk>
+0xE2D9	U+7C50	# <cjk>
+0xE2DA	U+7C58	# <cjk>
+0xE2DB	U+7C5F	# <cjk>
+0xE2DC	U+7C64	# <cjk>
+0xE2DD	U+7C56	# <cjk>
+0xE2DE	U+7C65	# <cjk>
+0xE2DF	U+7C6C	# <cjk>
+0xE2E0	U+7C75	# <cjk>
+0xE2E1	U+7C83	# <cjk>
+0xE2E2	U+7C90	# <cjk>
+0xE2E3	U+7CA4	# <cjk>
+0xE2E4	U+7CAD	# <cjk>
+0xE2E5	U+7CA2	# <cjk>
+0xE2E6	U+7CAB	# <cjk>
+0xE2E7	U+7CA1	# <cjk>
+0xE2E8	U+7CA8	# <cjk>
+0xE2E9	U+7CB3	# <cjk>
+0xE2EA	U+7CB2	# <cjk>
+0xE2EB	U+7CB1	# <cjk>
+0xE2EC	U+7CAE	# <cjk>
+0xE2ED	U+7CB9	# <cjk>
+0xE2EE	U+7CBD	# <cjk>
+0xE2EF	U+7CC0	# <cjk>
+0xE2F0	U+7CC5	# <cjk>
+0xE2F1	U+7CC2	# <cjk>
+0xE2F2	U+7CD8	# <cjk>
+0xE2F3	U+7CD2	# <cjk>
+0xE2F4	U+7CDC	# <cjk>
+0xE2F5	U+7CE2	# <cjk>
+0xE2F6	U+9B3B	# <cjk>
+0xE2F7	U+7CEF	# <cjk>
+0xE2F8	U+7CF2	# <cjk>
+0xE2F9	U+7CF4	# <cjk>
+0xE2FA	U+7CF6	# <cjk>
+0xE2FB	U+7CFA	# <cjk>
+0xE2FC	U+7D06	# <cjk>
+0xE340	U+7D02	# <cjk>
+0xE341	U+7D1C	# <cjk>
+0xE342	U+7D15	# <cjk>
+0xE343	U+7D0A	# <cjk>
+0xE344	U+7D45	# <cjk>
+0xE345	U+7D4B	# <cjk>
+0xE346	U+7D2E	# <cjk>
+0xE347	U+7D32	# <cjk>
+0xE348	U+7D3F	# <cjk>
+0xE349	U+7D35	# <cjk>
+0xE34A	U+7D46	# <cjk>
+0xE34B	U+7D73	# <cjk>
+0xE34C	U+7D56	# <cjk>
+0xE34D	U+7D4E	# <cjk>
+0xE34E	U+7D72	# <cjk>
+0xE34F	U+7D68	# <cjk>
+0xE350	U+7D6E	# <cjk>
+0xE351	U+7D4F	# <cjk>
+0xE352	U+7D63	# <cjk>
+0xE353	U+7D93	# <cjk>
+0xE354	U+7D89	# <cjk>
+0xE355	U+7D5B	# <cjk>
+0xE356	U+7D8F	# <cjk>
+0xE357	U+7D7D	# <cjk>
+0xE358	U+7D9B	# <cjk>
+0xE359	U+7DBA	# <cjk>
+0xE35A	U+7DAE	# <cjk>
+0xE35B	U+7DA3	# <cjk>
+0xE35C	U+7DB5	# <cjk>
+0xE35D	U+7DC7	# <cjk>
+0xE35E	U+7DBD	# <cjk>
+0xE35F	U+7DAB	# <cjk>
+0xE360	U+7E3D	# <cjk>
+0xE361	U+7DA2	# <cjk>
+0xE362	U+7DAF	# <cjk>
+0xE363	U+7DDC	# <cjk>
+0xE364	U+7DB8	# <cjk>
+0xE365	U+7D9F	# <cjk>
+0xE366	U+7DB0	# <cjk>
+0xE367	U+7DD8	# <cjk>
+0xE368	U+7DDD	# <cjk>
+0xE369	U+7DE4	# <cjk>
+0xE36A	U+7DDE	# <cjk>
+0xE36B	U+7DFB	# <cjk>
+0xE36C	U+7DF2	# <cjk>
+0xE36D	U+7DE1	# <cjk>
+0xE36E	U+7E05	# <cjk>
+0xE36F	U+7E0A	# <cjk>
+0xE370	U+7E23	# <cjk>
+0xE371	U+7E21	# <cjk>
+0xE372	U+7E12	# <cjk>
+0xE373	U+7E31	# <cjk>
+0xE374	U+7E1F	# <cjk>
+0xE375	U+7E09	# <cjk>
+0xE376	U+7E0B	# <cjk>
+0xE377	U+7E22	# <cjk>
+0xE378	U+7E46	# <cjk>
+0xE379	U+7E66	# <cjk>
+0xE37A	U+7E3B	# <cjk>
+0xE37B	U+7E35	# <cjk>
+0xE37C	U+7E39	# <cjk>
+0xE37D	U+7E43	# <cjk>
+0xE37E	U+7E37	# <cjk>
+0xE380	U+7E32	# <cjk>
+0xE381	U+7E3A	# <cjk>
+0xE382	U+7E67	# <cjk>
+0xE383	U+7E5D	# <cjk>
+0xE384	U+7E56	# <cjk>
+0xE385	U+7E5E	# <cjk>
+0xE386	U+7E59	# <cjk>
+0xE387	U+7E5A	# <cjk>
+0xE388	U+7E79	# <cjk>
+0xE389	U+7E6A	# <cjk>
+0xE38A	U+7E69	# <cjk>
+0xE38B	U+7E7C	# <cjk>
+0xE38C	U+7E7B	# <cjk>
+0xE38D	U+7E83	# <cjk>
+0xE38E	U+7DD5	# <cjk>
+0xE38F	U+7E7D	# <cjk>
+0xE390	U+8FAE	# <cjk>
+0xE391	U+7E7F	# <cjk>
+0xE392	U+7E88	# <cjk>
+0xE393	U+7E89	# <cjk>
+0xE394	U+7E8C	# <cjk>
+0xE395	U+7E92	# <cjk>
+0xE396	U+7E90	# <cjk>
+0xE397	U+7E93	# <cjk>
+0xE398	U+7E94	# <cjk>
+0xE399	U+7E96	# <cjk>
+0xE39A	U+7E8E	# <cjk>
+0xE39B	U+7E9B	# <cjk>
+0xE39C	U+7E9C	# <cjk>
+0xE39D	U+7F38	# <cjk>
+0xE39E	U+7F3A	# <cjk>
+0xE39F	U+7F45	# <cjk>
+0xE3A0	U+7F4C	# <cjk>
+0xE3A1	U+7F4D	# <cjk>
+0xE3A2	U+7F4E	# <cjk>
+0xE3A3	U+7F50	# <cjk>
+0xE3A4	U+7F51	# <cjk>
+0xE3A5	U+7F55	# <cjk>
+0xE3A6	U+7F54	# <cjk>
+0xE3A7	U+7F58	# <cjk>
+0xE3A8	U+7F5F	# <cjk>
+0xE3A9	U+7F60	# <cjk>
+0xE3AA	U+7F68	# <cjk>
+0xE3AB	U+7F69	# <cjk>
+0xE3AC	U+7F67	# <cjk>
+0xE3AD	U+7F78	# <cjk>
+0xE3AE	U+7F82	# <cjk>
+0xE3AF	U+7F86	# <cjk>
+0xE3B0	U+7F83	# <cjk>
+0xE3B1	U+7F88	# <cjk>
+0xE3B2	U+7F87	# <cjk>
+0xE3B3	U+7F8C	# <cjk>
+0xE3B4	U+7F94	# <cjk>
+0xE3B5	U+7F9E	# <cjk>
+0xE3B6	U+7F9D	# <cjk>
+0xE3B7	U+7F9A	# <cjk>
+0xE3B8	U+7FA3	# <cjk>
+0xE3B9	U+7FAF	# <cjk>
+0xE3BA	U+7FB2	# <cjk>
+0xE3BB	U+7FB9	# <cjk>
+0xE3BC	U+7FAE	# <cjk>
+0xE3BD	U+7FB6	# <cjk>
+0xE3BE	U+7FB8	# <cjk>
+0xE3BF	U+8B71	# <cjk>
+0xE3C0	U+7FC5	# <cjk>
+0xE3C1	U+7FC6	# <cjk>
+0xE3C2	U+7FCA	# <cjk>
+0xE3C3	U+7FD5	# <cjk>
+0xE3C4	U+7FD4	# <cjk>
+0xE3C5	U+7FE1	# <cjk>
+0xE3C6	U+7FE6	# <cjk>
+0xE3C7	U+7FE9	# <cjk>
+0xE3C8	U+7FF3	# <cjk>
+0xE3C9	U+7FF9	# <cjk>
+0xE3CA	U+98DC	# <cjk>
+0xE3CB	U+8006	# <cjk>
+0xE3CC	U+8004	# <cjk>
+0xE3CD	U+800B	# <cjk>
+0xE3CE	U+8012	# <cjk>
+0xE3CF	U+8018	# <cjk>
+0xE3D0	U+8019	# <cjk>
+0xE3D1	U+801C	# <cjk>
+0xE3D2	U+8021	# <cjk>
+0xE3D3	U+8028	# <cjk>
+0xE3D4	U+803F	# <cjk>
+0xE3D5	U+803B	# <cjk>
+0xE3D6	U+804A	# <cjk>
+0xE3D7	U+8046	# <cjk>
+0xE3D8	U+8052	# <cjk>
+0xE3D9	U+8058	# <cjk>
+0xE3DA	U+805A	# <cjk>
+0xE3DB	U+805F	# <cjk>
+0xE3DC	U+8062	# <cjk>
+0xE3DD	U+8068	# <cjk>
+0xE3DE	U+8073	# <cjk>
+0xE3DF	U+8072	# <cjk>
+0xE3E0	U+8070	# <cjk>
+0xE3E1	U+8076	# <cjk>
+0xE3E2	U+8079	# <cjk>
+0xE3E3	U+807D	# <cjk>
+0xE3E4	U+807F	# <cjk>
+0xE3E5	U+8084	# <cjk>
+0xE3E6	U+8086	# <cjk>
+0xE3E7	U+8085	# <cjk>
+0xE3E8	U+809B	# <cjk>
+0xE3E9	U+8093	# <cjk>
+0xE3EA	U+809A	# <cjk>
+0xE3EB	U+80AD	# <cjk>
+0xE3EC	U+5190	# <cjk>
+0xE3ED	U+80AC	# <cjk>
+0xE3EE	U+80DB	# <cjk>
+0xE3EF	U+80E5	# <cjk>
+0xE3F0	U+80D9	# <cjk>
+0xE3F1	U+80DD	# <cjk>
+0xE3F2	U+80C4	# <cjk>
+0xE3F3	U+80DA	# <cjk>
+0xE3F4	U+80D6	# <cjk>
+0xE3F5	U+8109	# <cjk>
+0xE3F6	U+80EF	# <cjk>
+0xE3F7	U+80F1	# <cjk>
+0xE3F8	U+811B	# <cjk>
+0xE3F9	U+8129	# <cjk>
+0xE3FA	U+8123	# <cjk>
+0xE3FB	U+812F	# <cjk>
+0xE3FC	U+814B	# <cjk>
+0xE440	U+968B	# <cjk>
+0xE441	U+8146	# <cjk>
+0xE442	U+813E	# <cjk>
+0xE443	U+8153	# <cjk>
+0xE444	U+8151	# <cjk>
+0xE445	U+80FC	# <cjk>
+0xE446	U+8171	# <cjk>
+0xE447	U+816E	# <cjk>
+0xE448	U+8165	# <cjk>
+0xE449	U+8166	# <cjk>
+0xE44A	U+8174	# <cjk>
+0xE44B	U+8183	# <cjk>
+0xE44C	U+8188	# <cjk>
+0xE44D	U+818A	# <cjk>
+0xE44E	U+8180	# <cjk>
+0xE44F	U+8182	# <cjk>
+0xE450	U+81A0	# <cjk>
+0xE451	U+8195	# <cjk>
+0xE452	U+81A4	# <cjk>
+0xE453	U+81A3	# <cjk>
+0xE454	U+815F	# <cjk>
+0xE455	U+8193	# <cjk>
+0xE456	U+81A9	# <cjk>
+0xE457	U+81B0	# <cjk>
+0xE458	U+81B5	# <cjk>
+0xE459	U+81BE	# <cjk>
+0xE45A	U+81B8	# <cjk>
+0xE45B	U+81BD	# <cjk>
+0xE45C	U+81C0	# <cjk>
+0xE45D	U+81C2	# <cjk>
+0xE45E	U+81BA	# <cjk>
+0xE45F	U+81C9	# <cjk>
+0xE460	U+81CD	# <cjk>
+0xE461	U+81D1	# <cjk>
+0xE462	U+81D9	# <cjk>
+0xE463	U+81D8	# <cjk>
+0xE464	U+81C8	# <cjk>
+0xE465	U+81DA	# <cjk>
+0xE466	U+81DF	# <cjk>
+0xE467	U+81E0	# <cjk>
+0xE468	U+81E7	# <cjk>
+0xE469	U+81FA	# <cjk>
+0xE46A	U+81FB	# <cjk>
+0xE46B	U+81FE	# <cjk>
+0xE46C	U+8201	# <cjk>
+0xE46D	U+8202	# <cjk>
+0xE46E	U+8205	# <cjk>
+0xE46F	U+8207	# <cjk>
+0xE470	U+820A	# <cjk>
+0xE471	U+820D	# <cjk>
+0xE472	U+8210	# <cjk>
+0xE473	U+8216	# <cjk>
+0xE474	U+8229	# <cjk>
+0xE475	U+822B	# <cjk>
+0xE476	U+8238	# <cjk>
+0xE477	U+8233	# <cjk>
+0xE478	U+8240	# <cjk>
+0xE479	U+8259	# <cjk>
+0xE47A	U+8258	# <cjk>
+0xE47B	U+825D	# <cjk>
+0xE47C	U+825A	# <cjk>
+0xE47D	U+825F	# <cjk>
+0xE47E	U+8264	# <cjk>
+0xE480	U+8262	# <cjk>
+0xE481	U+8268	# <cjk>
+0xE482	U+826A	# <cjk>
+0xE483	U+826B	# <cjk>
+0xE484	U+822E	# <cjk>
+0xE485	U+8271	# <cjk>
+0xE486	U+8277	# <cjk>
+0xE487	U+8278	# <cjk>
+0xE488	U+827E	# <cjk>
+0xE489	U+828D	# <cjk>
+0xE48A	U+8292	# <cjk>
+0xE48B	U+82AB	# <cjk>
+0xE48C	U+829F	# <cjk>
+0xE48D	U+82BB	# <cjk>
+0xE48E	U+82AC	# <cjk>
+0xE48F	U+82E1	# <cjk>
+0xE490	U+82E3	# <cjk>
+0xE491	U+82DF	# <cjk>
+0xE492	U+82D2	# <cjk>
+0xE493	U+82F4	# <cjk>
+0xE494	U+82F3	# <cjk>
+0xE495	U+82FA	# <cjk>
+0xE496	U+8393	# <cjk>
+0xE497	U+8303	# <cjk>
+0xE498	U+82FB	# <cjk>
+0xE499	U+82F9	# <cjk>
+0xE49A	U+82DE	# <cjk>
+0xE49B	U+8306	# <cjk>
+0xE49C	U+82DC	# <cjk>
+0xE49D	U+8309	# <cjk>
+0xE49E	U+82D9	# <cjk>
+0xE49F	U+8335	# <cjk>
+0xE4A0	U+8334	# <cjk>
+0xE4A1	U+8316	# <cjk>
+0xE4A2	U+8332	# <cjk>
+0xE4A3	U+8331	# <cjk>
+0xE4A4	U+8340	# <cjk>
+0xE4A5	U+8339	# <cjk>
+0xE4A6	U+8350	# <cjk>
+0xE4A7	U+8345	# <cjk>
+0xE4A8	U+832F	# <cjk>
+0xE4A9	U+832B	# <cjk>
+0xE4AA	U+8317	# <cjk>
+0xE4AB	U+8318	# <cjk>
+0xE4AC	U+8385	# <cjk>
+0xE4AD	U+839A	# <cjk>
+0xE4AE	U+83AA	# <cjk>
+0xE4AF	U+839F	# <cjk>
+0xE4B0	U+83A2	# <cjk>
+0xE4B1	U+8396	# <cjk>
+0xE4B2	U+8323	# <cjk>
+0xE4B3	U+838E	# <cjk>
+0xE4B4	U+8387	# <cjk>
+0xE4B5	U+838A	# <cjk>
+0xE4B6	U+837C	# <cjk>
+0xE4B7	U+83B5	# <cjk>
+0xE4B8	U+8373	# <cjk>
+0xE4B9	U+8375	# <cjk>
+0xE4BA	U+83A0	# <cjk>
+0xE4BB	U+8389	# <cjk>
+0xE4BC	U+83A8	# <cjk>
+0xE4BD	U+83F4	# <cjk>
+0xE4BE	U+8413	# <cjk>
+0xE4BF	U+83EB	# <cjk>
+0xE4C0	U+83CE	# <cjk>
+0xE4C1	U+83FD	# <cjk>
+0xE4C2	U+8403	# <cjk>
+0xE4C3	U+83D8	# <cjk>
+0xE4C4	U+840B	# <cjk>
+0xE4C5	U+83C1	# <cjk>
+0xE4C6	U+83F7	# <cjk>
+0xE4C7	U+8407	# <cjk>
+0xE4C8	U+83E0	# <cjk>
+0xE4C9	U+83F2	# <cjk>
+0xE4CA	U+840D	# <cjk>
+0xE4CB	U+8422	# <cjk>
+0xE4CC	U+8420	# <cjk>
+0xE4CD	U+83BD	# <cjk>
+0xE4CE	U+8438	# <cjk>
+0xE4CF	U+8506	# <cjk>
+0xE4D0	U+83FB	# <cjk>
+0xE4D1	U+846D	# <cjk>
+0xE4D2	U+842A	# <cjk>
+0xE4D3	U+843C	# <cjk>
+0xE4D4	U+855A	# <cjk>
+0xE4D5	U+8484	# <cjk>
+0xE4D6	U+8477	# <cjk>
+0xE4D7	U+846B	# <cjk>
+0xE4D8	U+84AD	# <cjk>
+0xE4D9	U+846E	# <cjk>
+0xE4DA	U+8482	# <cjk>
+0xE4DB	U+8469	# <cjk>
+0xE4DC	U+8446	# <cjk>
+0xE4DD	U+842C	# <cjk>
+0xE4DE	U+846F	# <cjk>
+0xE4DF	U+8479	# <cjk>
+0xE4E0	U+8435	# <cjk>
+0xE4E1	U+84CA	# <cjk>
+0xE4E2	U+8462	# <cjk>
+0xE4E3	U+84B9	# <cjk>
+0xE4E4	U+84BF	# <cjk>
+0xE4E5	U+849F	# <cjk>
+0xE4E6	U+84D9	# <cjk>
+0xE4E7	U+84CD	# <cjk>
+0xE4E8	U+84BB	# <cjk>
+0xE4E9	U+84DA	# <cjk>
+0xE4EA	U+84D0	# <cjk>
+0xE4EB	U+84C1	# <cjk>
+0xE4EC	U+84C6	# <cjk>
+0xE4ED	U+84D6	# <cjk>
+0xE4EE	U+84A1	# <cjk>
+0xE4EF	U+8521	# <cjk>
+0xE4F0	U+84FF	# <cjk>
+0xE4F1	U+84F4	# <cjk>
+0xE4F2	U+8517	# <cjk>
+0xE4F3	U+8518	# <cjk>
+0xE4F4	U+852C	# <cjk>
+0xE4F5	U+851F	# <cjk>
+0xE4F6	U+8515	# <cjk>
+0xE4F7	U+8514	# <cjk>
+0xE4F8	U+84FC	# <cjk>
+0xE4F9	U+8540	# <cjk>
+0xE4FA	U+8563	# <cjk>
+0xE4FB	U+8558	# <cjk>
+0xE4FC	U+8548	# <cjk>
+0xE540	U+8541	# <cjk>
+0xE541	U+8602	# <cjk>
+0xE542	U+854B	# <cjk>
+0xE543	U+8555	# <cjk>
+0xE544	U+8580	# <cjk>
+0xE545	U+85A4	# <cjk>
+0xE546	U+8588	# <cjk>
+0xE547	U+8591	# <cjk>
+0xE548	U+858A	# <cjk>
+0xE549	U+85A8	# <cjk>
+0xE54A	U+856D	# <cjk>
+0xE54B	U+8594	# <cjk>
+0xE54C	U+859B	# <cjk>
+0xE54D	U+85EA	# <cjk>
+0xE54E	U+8587	# <cjk>
+0xE54F	U+859C	# <cjk>
+0xE550	U+8577	# <cjk>
+0xE551	U+857E	# <cjk>
+0xE552	U+8590	# <cjk>
+0xE553	U+85C9	# <cjk>
+0xE554	U+85BA	# <cjk>
+0xE555	U+85CF	# <cjk>
+0xE556	U+85B9	# <cjk>
+0xE557	U+85D0	# <cjk>
+0xE558	U+85D5	# <cjk>
+0xE559	U+85DD	# <cjk>
+0xE55A	U+85E5	# <cjk>
+0xE55B	U+85DC	# <cjk>
+0xE55C	U+85F9	# <cjk>
+0xE55D	U+860A	# <cjk>
+0xE55E	U+8613	# <cjk>
+0xE55F	U+860B	# <cjk>
+0xE560	U+85FE	# <cjk>
+0xE561	U+85FA	# <cjk>
+0xE562	U+8606	# <cjk>
+0xE563	U+8622	# <cjk>
+0xE564	U+861A	# <cjk>
+0xE565	U+8630	# <cjk>
+0xE566	U+863F	# <cjk>
+0xE567	U+864D	# <cjk>
+0xE568	U+4E55	# <cjk>
+0xE569	U+8654	# <cjk>
+0xE56A	U+865F	# <cjk>
+0xE56B	U+8667	# <cjk>
+0xE56C	U+8671	# <cjk>
+0xE56D	U+8693	# <cjk>
+0xE56E	U+86A3	# <cjk>
+0xE56F	U+86A9	# <cjk>
+0xE570	U+86AA	# <cjk>
+0xE571	U+868B	# <cjk>
+0xE572	U+868C	# <cjk>
+0xE573	U+86B6	# <cjk>
+0xE574	U+86AF	# <cjk>
+0xE575	U+86C4	# <cjk>
+0xE576	U+86C6	# <cjk>
+0xE577	U+86B0	# <cjk>
+0xE578	U+86C9	# <cjk>
+0xE579	U+8823	# <cjk>
+0xE57A	U+86AB	# <cjk>
+0xE57B	U+86D4	# <cjk>
+0xE57C	U+86DE	# <cjk>
+0xE57D	U+86E9	# <cjk>
+0xE57E	U+86EC	# <cjk>
+0xE580	U+86DF	# <cjk>
+0xE581	U+86DB	# <cjk>
+0xE582	U+86EF	# <cjk>
+0xE583	U+8712	# <cjk>
+0xE584	U+8706	# <cjk>
+0xE585	U+8708	# <cjk>
+0xE586	U+8700	# <cjk>
+0xE587	U+8703	# <cjk>
+0xE588	U+86FB	# <cjk>
+0xE589	U+8711	# <cjk>
+0xE58A	U+8709	# <cjk>
+0xE58B	U+870D	# <cjk>
+0xE58C	U+86F9	# <cjk>
+0xE58D	U+870A	# <cjk>
+0xE58E	U+8734	# <cjk>
+0xE58F	U+873F	# <cjk>
+0xE590	U+8737	# <cjk>
+0xE591	U+873B	# <cjk>
+0xE592	U+8725	# <cjk>
+0xE593	U+8729	# <cjk>
+0xE594	U+871A	# <cjk>
+0xE595	U+8760	# <cjk>
+0xE596	U+875F	# <cjk>
+0xE597	U+8778	# <cjk>
+0xE598	U+874C	# <cjk>
+0xE599	U+874E	# <cjk>
+0xE59A	U+8774	# <cjk>
+0xE59B	U+8757	# <cjk>
+0xE59C	U+8768	# <cjk>
+0xE59D	U+876E	# <cjk>
+0xE59E	U+8759	# <cjk>
+0xE59F	U+8753	# <cjk>
+0xE5A0	U+8763	# <cjk>
+0xE5A1	U+876A	# <cjk>
+0xE5A2	U+8805	# <cjk>
+0xE5A3	U+87A2	# <cjk>
+0xE5A4	U+879F	# <cjk>
+0xE5A5	U+8782	# <cjk>
+0xE5A6	U+87AF	# <cjk>
+0xE5A7	U+87CB	# <cjk>
+0xE5A8	U+87BD	# <cjk>
+0xE5A9	U+87C0	# <cjk>
+0xE5AA	U+87D0	# <cjk>
+0xE5AB	U+96D6	# <cjk>
+0xE5AC	U+87AB	# <cjk>
+0xE5AD	U+87C4	# <cjk>
+0xE5AE	U+87B3	# <cjk>
+0xE5AF	U+87C7	# <cjk>
+0xE5B0	U+87C6	# <cjk>
+0xE5B1	U+87BB	# <cjk>
+0xE5B2	U+87EF	# <cjk>
+0xE5B3	U+87F2	# <cjk>
+0xE5B4	U+87E0	# <cjk>
+0xE5B5	U+880F	# <cjk>
+0xE5B6	U+880D	# <cjk>
+0xE5B7	U+87FE	# <cjk>
+0xE5B8	U+87F6	# <cjk>
+0xE5B9	U+87F7	# <cjk>
+0xE5BA	U+880E	# <cjk>
+0xE5BB	U+87D2	# <cjk>
+0xE5BC	U+8811	# <cjk>
+0xE5BD	U+8816	# <cjk>
+0xE5BE	U+8815	# <cjk>
+0xE5BF	U+8822	# <cjk>
+0xE5C0	U+8821	# <cjk>
+0xE5C1	U+8831	# <cjk>
+0xE5C2	U+8836	# <cjk>
+0xE5C3	U+8839	# <cjk>
+0xE5C4	U+8827	# <cjk>
+0xE5C5	U+883B	# <cjk>
+0xE5C6	U+8844	# <cjk>
+0xE5C7	U+8842	# <cjk>
+0xE5C8	U+8852	# <cjk>
+0xE5C9	U+8859	# <cjk>
+0xE5CA	U+885E	# <cjk>
+0xE5CB	U+8862	# <cjk>
+0xE5CC	U+886B	# <cjk>
+0xE5CD	U+8881	# <cjk>
+0xE5CE	U+887E	# <cjk>
+0xE5CF	U+889E	# <cjk>
+0xE5D0	U+8875	# <cjk>
+0xE5D1	U+887D	# <cjk>
+0xE5D2	U+88B5	# <cjk>
+0xE5D3	U+8872	# <cjk>
+0xE5D4	U+8882	# <cjk>
+0xE5D5	U+8897	# <cjk>
+0xE5D6	U+8892	# <cjk>
+0xE5D7	U+88AE	# <cjk>
+0xE5D8	U+8899	# <cjk>
+0xE5D9	U+88A2	# <cjk>
+0xE5DA	U+888D	# <cjk>
+0xE5DB	U+88A4	# <cjk>
+0xE5DC	U+88B0	# <cjk>
+0xE5DD	U+88BF	# <cjk>
+0xE5DE	U+88B1	# <cjk>
+0xE5DF	U+88C3	# <cjk>
+0xE5E0	U+88C4	# <cjk>
+0xE5E1	U+88D4	# <cjk>
+0xE5E2	U+88D8	# <cjk>
+0xE5E3	U+88D9	# <cjk>
+0xE5E4	U+88DD	# <cjk>
+0xE5E5	U+88F9	# <cjk>
+0xE5E6	U+8902	# <cjk>
+0xE5E7	U+88FC	# <cjk>
+0xE5E8	U+88F4	# <cjk>
+0xE5E9	U+88E8	# <cjk>
+0xE5EA	U+88F2	# <cjk>
+0xE5EB	U+8904	# <cjk>
+0xE5EC	U+890C	# <cjk>
+0xE5ED	U+890A	# <cjk>
+0xE5EE	U+8913	# <cjk>
+0xE5EF	U+8943	# <cjk>
+0xE5F0	U+891E	# <cjk>
+0xE5F1	U+8925	# <cjk>
+0xE5F2	U+892A	# <cjk>
+0xE5F3	U+892B	# <cjk>
+0xE5F4	U+8941	# <cjk>
+0xE5F5	U+8944	# <cjk>
+0xE5F6	U+893B	# <cjk>
+0xE5F7	U+8936	# <cjk>
+0xE5F8	U+8938	# <cjk>
+0xE5F9	U+894C	# <cjk>
+0xE5FA	U+891D	# <cjk>
+0xE5FB	U+8960	# <cjk>
+0xE5FC	U+895E	# <cjk>
+0xE640	U+8966	# <cjk>
+0xE641	U+8964	# <cjk>
+0xE642	U+896D	# <cjk>
+0xE643	U+896A	# <cjk>
+0xE644	U+896F	# <cjk>
+0xE645	U+8974	# <cjk>
+0xE646	U+8977	# <cjk>
+0xE647	U+897E	# <cjk>
+0xE648	U+8983	# <cjk>
+0xE649	U+8988	# <cjk>
+0xE64A	U+898A	# <cjk>
+0xE64B	U+8993	# <cjk>
+0xE64C	U+8998	# <cjk>
+0xE64D	U+89A1	# <cjk>
+0xE64E	U+89A9	# <cjk>
+0xE64F	U+89A6	# <cjk>
+0xE650	U+89AC	# <cjk>
+0xE651	U+89AF	# <cjk>
+0xE652	U+89B2	# <cjk>
+0xE653	U+89BA	# <cjk>
+0xE654	U+89BD	# <cjk>
+0xE655	U+89BF	# <cjk>
+0xE656	U+89C0	# <cjk>
+0xE657	U+89DA	# <cjk>
+0xE658	U+89DC	# <cjk>
+0xE659	U+89DD	# <cjk>
+0xE65A	U+89E7	# <cjk>
+0xE65B	U+89F4	# <cjk>
+0xE65C	U+89F8	# <cjk>
+0xE65D	U+8A03	# <cjk>
+0xE65E	U+8A16	# <cjk>
+0xE65F	U+8A10	# <cjk>
+0xE660	U+8A0C	# <cjk>
+0xE661	U+8A1B	# <cjk>
+0xE662	U+8A1D	# <cjk>
+0xE663	U+8A25	# <cjk>
+0xE664	U+8A36	# <cjk>
+0xE665	U+8A41	# <cjk>
+0xE666	U+8A5B	# <cjk>
+0xE667	U+8A52	# <cjk>
+0xE668	U+8A46	# <cjk>
+0xE669	U+8A48	# <cjk>
+0xE66A	U+8A7C	# <cjk>
+0xE66B	U+8A6D	# <cjk>
+0xE66C	U+8A6C	# <cjk>
+0xE66D	U+8A62	# <cjk>
+0xE66E	U+8A85	# <cjk>
+0xE66F	U+8A82	# <cjk>
+0xE670	U+8A84	# <cjk>
+0xE671	U+8AA8	# <cjk>
+0xE672	U+8AA1	# <cjk>
+0xE673	U+8A91	# <cjk>
+0xE674	U+8AA5	# <cjk>
+0xE675	U+8AA6	# <cjk>
+0xE676	U+8A9A	# <cjk>
+0xE677	U+8AA3	# <cjk>
+0xE678	U+8AC4	# <cjk>
+0xE679	U+8ACD	# <cjk>
+0xE67A	U+8AC2	# <cjk>
+0xE67B	U+8ADA	# <cjk>
+0xE67C	U+8AEB	# <cjk>
+0xE67D	U+8AF3	# <cjk>
+0xE67E	U+8AE7	# <cjk>
+0xE680	U+8AE4	# <cjk>
+0xE681	U+8AF1	# <cjk>
+0xE682	U+8B14	# <cjk>
+0xE683	U+8AE0	# <cjk>
+0xE684	U+8AE2	# <cjk>
+0xE685	U+8AF7	# <cjk>
+0xE686	U+8ADE	# <cjk>
+0xE687	U+8ADB	# <cjk>
+0xE688	U+8B0C	# <cjk>
+0xE689	U+8B07	# <cjk>
+0xE68A	U+8B1A	# <cjk>
+0xE68B	U+8AE1	# <cjk>
+0xE68C	U+8B16	# <cjk>
+0xE68D	U+8B10	# <cjk>
+0xE68E	U+8B17	# <cjk>
+0xE68F	U+8B20	# <cjk>
+0xE690	U+8B33	# <cjk>
+0xE691	U+97AB	# <cjk>
+0xE692	U+8B26	# <cjk>
+0xE693	U+8B2B	# <cjk>
+0xE694	U+8B3E	# <cjk>
+0xE695	U+8B28	# <cjk>
+0xE696	U+8B41	# <cjk>
+0xE697	U+8B4C	# <cjk>
+0xE698	U+8B4F	# <cjk>
+0xE699	U+8B4E	# <cjk>
+0xE69A	U+8B49	# <cjk>
+0xE69B	U+8B56	# <cjk>
+0xE69C	U+8B5B	# <cjk>
+0xE69D	U+8B5A	# <cjk>
+0xE69E	U+8B6B	# <cjk>
+0xE69F	U+8B5F	# <cjk>
+0xE6A0	U+8B6C	# <cjk>
+0xE6A1	U+8B6F	# <cjk>
+0xE6A2	U+8B74	# <cjk>
+0xE6A3	U+8B7D	# <cjk>
+0xE6A4	U+8B80	# <cjk>
+0xE6A5	U+8B8C	# <cjk>
+0xE6A6	U+8B8E	# <cjk>
+0xE6A7	U+8B92	# <cjk>
+0xE6A8	U+8B93	# <cjk>
+0xE6A9	U+8B96	# <cjk>
+0xE6AA	U+8B99	# <cjk>
+0xE6AB	U+8B9A	# <cjk>
+0xE6AC	U+8C3A	# <cjk>
+0xE6AD	U+8C41	# <cjk>
+0xE6AE	U+8C3F	# <cjk>
+0xE6AF	U+8C48	# <cjk>
+0xE6B0	U+8C4C	# <cjk>
+0xE6B1	U+8C4E	# <cjk>
+0xE6B2	U+8C50	# <cjk>
+0xE6B3	U+8C55	# <cjk>
+0xE6B4	U+8C62	# <cjk>
+0xE6B5	U+8C6C	# <cjk>
+0xE6B6	U+8C78	# <cjk>
+0xE6B7	U+8C7A	# <cjk>
+0xE6B8	U+8C82	# <cjk>
+0xE6B9	U+8C89	# <cjk>
+0xE6BA	U+8C85	# <cjk>
+0xE6BB	U+8C8A	# <cjk>
+0xE6BC	U+8C8D	# <cjk>
+0xE6BD	U+8C8E	# <cjk>
+0xE6BE	U+8C94	# <cjk>
+0xE6BF	U+8C7C	# <cjk>
+0xE6C0	U+8C98	# <cjk>
+0xE6C1	U+621D	# <cjk>
+0xE6C2	U+8CAD	# <cjk>
+0xE6C3	U+8CAA	# <cjk>
+0xE6C4	U+8CBD	# <cjk>
+0xE6C5	U+8CB2	# <cjk>
+0xE6C6	U+8CB3	# <cjk>
+0xE6C7	U+8CAE	# <cjk>
+0xE6C8	U+8CB6	# <cjk>
+0xE6C9	U+8CC8	# <cjk>
+0xE6CA	U+8CC1	# <cjk>
+0xE6CB	U+8CE4	# <cjk>
+0xE6CC	U+8CE3	# <cjk>
+0xE6CD	U+8CDA	# <cjk>
+0xE6CE	U+8CFD	# <cjk>
+0xE6CF	U+8CFA	# <cjk>
+0xE6D0	U+8CFB	# <cjk>
+0xE6D1	U+8D04	# <cjk>
+0xE6D2	U+8D05	# <cjk>
+0xE6D3	U+8D0A	# <cjk>
+0xE6D4	U+8D07	# <cjk>
+0xE6D5	U+8D0F	# <cjk>
+0xE6D6	U+8D0D	# <cjk>
+0xE6D7	U+8D10	# <cjk>
+0xE6D8	U+9F4E	# <cjk>
+0xE6D9	U+8D13	# <cjk>
+0xE6DA	U+8CCD	# <cjk>
+0xE6DB	U+8D14	# <cjk>
+0xE6DC	U+8D16	# <cjk>
+0xE6DD	U+8D67	# <cjk>
+0xE6DE	U+8D6D	# <cjk>
+0xE6DF	U+8D71	# <cjk>
+0xE6E0	U+8D73	# <cjk>
+0xE6E1	U+8D81	# <cjk>
+0xE6E2	U+8D99	# <cjk>
+0xE6E3	U+8DC2	# <cjk>
+0xE6E4	U+8DBE	# <cjk>
+0xE6E5	U+8DBA	# <cjk>
+0xE6E6	U+8DCF	# <cjk>
+0xE6E7	U+8DDA	# <cjk>
+0xE6E8	U+8DD6	# <cjk>
+0xE6E9	U+8DCC	# <cjk>
+0xE6EA	U+8DDB	# <cjk>
+0xE6EB	U+8DCB	# <cjk>
+0xE6EC	U+8DEA	# <cjk>
+0xE6ED	U+8DEB	# <cjk>
+0xE6EE	U+8DDF	# <cjk>
+0xE6EF	U+8DE3	# <cjk>
+0xE6F0	U+8DFC	# <cjk>
+0xE6F1	U+8E08	# <cjk>
+0xE6F2	U+8E09	# <cjk>
+0xE6F3	U+8DFF	# <cjk>
+0xE6F4	U+8E1D	# <cjk>
+0xE6F5	U+8E1E	# <cjk>
+0xE6F6	U+8E10	# <cjk>
+0xE6F7	U+8E1F	# <cjk>
+0xE6F8	U+8E42	# <cjk>
+0xE6F9	U+8E35	# <cjk>
+0xE6FA	U+8E30	# <cjk>
+0xE6FB	U+8E34	# <cjk>
+0xE6FC	U+8E4A	# <cjk>
+0xE740	U+8E47	# <cjk>
+0xE741	U+8E49	# <cjk>
+0xE742	U+8E4C	# <cjk>
+0xE743	U+8E50	# <cjk>
+0xE744	U+8E48	# <cjk>
+0xE745	U+8E59	# <cjk>
+0xE746	U+8E64	# <cjk>
+0xE747	U+8E60	# <cjk>
+0xE748	U+8E2A	# <cjk>
+0xE749	U+8E63	# <cjk>
+0xE74A	U+8E55	# <cjk>
+0xE74B	U+8E76	# <cjk>
+0xE74C	U+8E72	# <cjk>
+0xE74D	U+8E7C	# <cjk>
+0xE74E	U+8E81	# <cjk>
+0xE74F	U+8E87	# <cjk>
+0xE750	U+8E85	# <cjk>
+0xE751	U+8E84	# <cjk>
+0xE752	U+8E8B	# <cjk>
+0xE753	U+8E8A	# <cjk>
+0xE754	U+8E93	# <cjk>
+0xE755	U+8E91	# <cjk>
+0xE756	U+8E94	# <cjk>
+0xE757	U+8E99	# <cjk>
+0xE758	U+8EAA	# <cjk>
+0xE759	U+8EA1	# <cjk>
+0xE75A	U+8EAC	# <cjk>
+0xE75B	U+8EB0	# <cjk>
+0xE75C	U+8EC6	# <cjk>
+0xE75D	U+8EB1	# <cjk>
+0xE75E	U+8EBE	# <cjk>
+0xE75F	U+8EC5	# <cjk>
+0xE760	U+8EC8	# <cjk>
+0xE761	U+8ECB	# <cjk>
+0xE762	U+8EDB	# <cjk>
+0xE763	U+8EE3	# <cjk>
+0xE764	U+8EFC	# <cjk>
+0xE765	U+8EFB	# <cjk>
+0xE766	U+8EEB	# <cjk>
+0xE767	U+8EFE	# <cjk>
+0xE768	U+8F0A	# <cjk>
+0xE769	U+8F05	# <cjk>
+0xE76A	U+8F15	# <cjk>
+0xE76B	U+8F12	# <cjk>
+0xE76C	U+8F19	# <cjk>
+0xE76D	U+8F13	# <cjk>
+0xE76E	U+8F1C	# <cjk>
+0xE76F	U+8F1F	# <cjk>
+0xE770	U+8F1B	# <cjk>
+0xE771	U+8F0C	# <cjk>
+0xE772	U+8F26	# <cjk>
+0xE773	U+8F33	# <cjk>
+0xE774	U+8F3B	# <cjk>
+0xE775	U+8F39	# <cjk>
+0xE776	U+8F45	# <cjk>
+0xE777	U+8F42	# <cjk>
+0xE778	U+8F3E	# <cjk>
+0xE779	U+8F4C	# <cjk>
+0xE77A	U+8F49	# <cjk>
+0xE77B	U+8F46	# <cjk>
+0xE77C	U+8F4E	# <cjk>
+0xE77D	U+8F57	# <cjk>
+0xE77E	U+8F5C	# <cjk>
+0xE780	U+8F62	# <cjk>
+0xE781	U+8F63	# <cjk>
+0xE782	U+8F64	# <cjk>
+0xE783	U+8F9C	# <cjk>
+0xE784	U+8F9F	# <cjk>
+0xE785	U+8FA3	# <cjk>
+0xE786	U+8FAD	# <cjk>
+0xE787	U+8FAF	# <cjk>
+0xE788	U+8FB7	# <cjk>
+0xE789	U+8FDA	# <cjk>
+0xE78A	U+8FE5	# <cjk>
+0xE78B	U+8FE2	# <cjk>
+0xE78C	U+8FEA	# <cjk>
+0xE78D	U+8FEF	# <cjk>
+0xE78E	U+9087	# <cjk>
+0xE78F	U+8FF4	# <cjk>
+0xE790	U+9005	# <cjk>
+0xE791	U+8FF9	# <cjk>
+0xE792	U+8FFA	# <cjk>
+0xE793	U+9011	# <cjk>
+0xE794	U+9015	# <cjk>
+0xE795	U+9021	# <cjk>
+0xE796	U+900D	# <cjk>
+0xE797	U+901E	# <cjk>
+0xE798	U+9016	# <cjk>
+0xE799	U+900B	# <cjk>
+0xE79A	U+9027	# <cjk>
+0xE79B	U+9036	# <cjk>
+0xE79C	U+9035	# <cjk>
+0xE79D	U+9039	# <cjk>
+0xE79E	U+8FF8	# <cjk>
+0xE79F	U+904F	# <cjk>
+0xE7A0	U+9050	# <cjk>
+0xE7A1	U+9051	# <cjk>
+0xE7A2	U+9052	# <cjk>
+0xE7A3	U+900E	# <cjk>
+0xE7A4	U+9049	# <cjk>
+0xE7A5	U+903E	# <cjk>
+0xE7A6	U+9056	# <cjk>
+0xE7A7	U+9058	# <cjk>
+0xE7A8	U+905E	# <cjk>
+0xE7A9	U+9068	# <cjk>
+0xE7AA	U+906F	# <cjk>
+0xE7AB	U+9076	# <cjk>
+0xE7AC	U+96A8	# <cjk>
+0xE7AD	U+9072	# <cjk>
+0xE7AE	U+9082	# <cjk>
+0xE7AF	U+907D	# <cjk>
+0xE7B0	U+9081	# <cjk>
+0xE7B1	U+9080	# <cjk>
+0xE7B2	U+908A	# <cjk>
+0xE7B3	U+9089	# <cjk>
+0xE7B4	U+908F	# <cjk>
+0xE7B5	U+90A8	# <cjk>
+0xE7B6	U+90AF	# <cjk>
+0xE7B7	U+90B1	# <cjk>
+0xE7B8	U+90B5	# <cjk>
+0xE7B9	U+90E2	# <cjk>
+0xE7BA	U+90E4	# <cjk>
+0xE7BB	U+6248	# <cjk>
+0xE7BC	U+90DB	# <cjk>
+0xE7BD	U+9102	# <cjk>
+0xE7BE	U+9112	# <cjk>
+0xE7BF	U+9119	# <cjk>
+0xE7C0	U+9132	# <cjk>
+0xE7C1	U+9130	# <cjk>
+0xE7C2	U+914A	# <cjk>
+0xE7C3	U+9156	# <cjk>
+0xE7C4	U+9158	# <cjk>
+0xE7C5	U+9163	# <cjk>
+0xE7C6	U+9165	# <cjk>
+0xE7C7	U+9169	# <cjk>
+0xE7C8	U+9173	# <cjk>
+0xE7C9	U+9172	# <cjk>
+0xE7CA	U+918B	# <cjk>
+0xE7CB	U+9189	# <cjk>
+0xE7CC	U+9182	# <cjk>
+0xE7CD	U+91A2	# <cjk>
+0xE7CE	U+91AB	# <cjk>
+0xE7CF	U+91AF	# <cjk>
+0xE7D0	U+91AA	# <cjk>
+0xE7D1	U+91B5	# <cjk>
+0xE7D2	U+91B4	# <cjk>
+0xE7D3	U+91BA	# <cjk>
+0xE7D4	U+91C0	# <cjk>
+0xE7D5	U+91C1	# <cjk>
+0xE7D6	U+91C9	# <cjk>
+0xE7D7	U+91CB	# <cjk>
+0xE7D8	U+91D0	# <cjk>
+0xE7D9	U+91D6	# <cjk>
+0xE7DA	U+91DF	# <cjk>
+0xE7DB	U+91E1	# <cjk>
+0xE7DC	U+91DB	# <cjk>
+0xE7DD	U+91FC	# <cjk>
+0xE7DE	U+91F5	# <cjk>
+0xE7DF	U+91F6	# <cjk>
+0xE7E0	U+921E	# <cjk>
+0xE7E1	U+91FF	# <cjk>
+0xE7E2	U+9214	# <cjk>
+0xE7E3	U+922C	# <cjk>
+0xE7E4	U+9215	# <cjk>
+0xE7E5	U+9211	# <cjk>
+0xE7E6	U+925E	# <cjk>
+0xE7E7	U+9257	# <cjk>
+0xE7E8	U+9245	# <cjk>
+0xE7E9	U+9249	# <cjk>
+0xE7EA	U+9264	# <cjk>
+0xE7EB	U+9248	# <cjk>
+0xE7EC	U+9295	# <cjk>
+0xE7ED	U+923F	# <cjk>
+0xE7EE	U+924B	# <cjk>
+0xE7EF	U+9250	# <cjk>
+0xE7F0	U+929C	# <cjk>
+0xE7F1	U+9296	# <cjk>
+0xE7F2	U+9293	# <cjk>
+0xE7F3	U+929B	# <cjk>
+0xE7F4	U+925A	# <cjk>
+0xE7F5	U+92CF	# <cjk>
+0xE7F6	U+92B9	# <cjk>
+0xE7F7	U+92B7	# <cjk>
+0xE7F8	U+92E9	# <cjk>
+0xE7F9	U+930F	# <cjk>
+0xE7FA	U+92FA	# <cjk>
+0xE7FB	U+9344	# <cjk>
+0xE7FC	U+932E	# <cjk>
+0xE840	U+9319	# <cjk>
+0xE841	U+9322	# <cjk>
+0xE842	U+931A	# <cjk>
+0xE843	U+9323	# <cjk>
+0xE844	U+933A	# <cjk>
+0xE845	U+9335	# <cjk>
+0xE846	U+933B	# <cjk>
+0xE847	U+935C	# <cjk>
+0xE848	U+9360	# <cjk>
+0xE849	U+937C	# <cjk>
+0xE84A	U+936E	# <cjk>
+0xE84B	U+9356	# <cjk>
+0xE84C	U+93B0	# <cjk>
+0xE84D	U+93AC	# <cjk>
+0xE84E	U+93AD	# <cjk>
+0xE84F	U+9394	# <cjk>
+0xE850	U+93B9	# <cjk>
+0xE851	U+93D6	# <cjk>
+0xE852	U+93D7	# <cjk>
+0xE853	U+93E8	# <cjk>
+0xE854	U+93E5	# <cjk>
+0xE855	U+93D8	# <cjk>
+0xE856	U+93C3	# <cjk>
+0xE857	U+93DD	# <cjk>
+0xE858	U+93D0	# <cjk>
+0xE859	U+93C8	# <cjk>
+0xE85A	U+93E4	# <cjk>
+0xE85B	U+941A	# <cjk>
+0xE85C	U+9414	# <cjk>
+0xE85D	U+9413	# <cjk>
+0xE85E	U+9403	# <cjk>
+0xE85F	U+9407	# <cjk>
+0xE860	U+9410	# <cjk>
+0xE861	U+9436	# <cjk>
+0xE862	U+942B	# <cjk>
+0xE863	U+9435	# <cjk>
+0xE864	U+9421	# <cjk>
+0xE865	U+943A	# <cjk>
+0xE866	U+9441	# <cjk>
+0xE867	U+9452	# <cjk>
+0xE868	U+9444	# <cjk>
+0xE869	U+945B	# <cjk>
+0xE86A	U+9460	# <cjk>
+0xE86B	U+9462	# <cjk>
+0xE86C	U+945E	# <cjk>
+0xE86D	U+946A	# <cjk>
+0xE86E	U+9229	# <cjk>
+0xE86F	U+9470	# <cjk>
+0xE870	U+9475	# <cjk>
+0xE871	U+9477	# <cjk>
+0xE872	U+947D	# <cjk>
+0xE873	U+945A	# <cjk>
+0xE874	U+947C	# <cjk>
+0xE875	U+947E	# <cjk>
+0xE876	U+9481	# <cjk>
+0xE877	U+947F	# <cjk>
+0xE878	U+9582	# <cjk>
+0xE879	U+9587	# <cjk>
+0xE87A	U+958A	# <cjk>
+0xE87B	U+9594	# <cjk>
+0xE87C	U+9596	# <cjk>
+0xE87D	U+9598	# <cjk>
+0xE87E	U+9599	# <cjk>
+0xE880	U+95A0	# <cjk>
+0xE881	U+95A8	# <cjk>
+0xE882	U+95A7	# <cjk>
+0xE883	U+95AD	# <cjk>
+0xE884	U+95BC	# <cjk>
+0xE885	U+95BB	# <cjk>
+0xE886	U+95B9	# <cjk>
+0xE887	U+95BE	# <cjk>
+0xE888	U+95CA	# <cjk>
+0xE889	U+6FF6	# <cjk>
+0xE88A	U+95C3	# <cjk>
+0xE88B	U+95CD	# <cjk>
+0xE88C	U+95CC	# <cjk>
+0xE88D	U+95D5	# <cjk>
+0xE88E	U+95D4	# <cjk>
+0xE88F	U+95D6	# <cjk>
+0xE890	U+95DC	# <cjk>
+0xE891	U+95E1	# <cjk>
+0xE892	U+95E5	# <cjk>
+0xE893	U+95E2	# <cjk>
+0xE894	U+9621	# <cjk>
+0xE895	U+9628	# <cjk>
+0xE896	U+962E	# <cjk>
+0xE897	U+962F	# <cjk>
+0xE898	U+9642	# <cjk>
+0xE899	U+964C	# <cjk>
+0xE89A	U+964F	# <cjk>
+0xE89B	U+964B	# <cjk>
+0xE89C	U+9677	# <cjk>
+0xE89D	U+965C	# <cjk>
+0xE89E	U+965E	# <cjk>
+0xE89F	U+965D	# <cjk>
+0xE8A0	U+965F	# <cjk>
+0xE8A1	U+9666	# <cjk>
+0xE8A2	U+9672	# <cjk>
+0xE8A3	U+966C	# <cjk>
+0xE8A4	U+968D	# <cjk>
+0xE8A5	U+9698	# <cjk>
+0xE8A6	U+9695	# <cjk>
+0xE8A7	U+9697	# <cjk>
+0xE8A8	U+96AA	# <cjk>
+0xE8A9	U+96A7	# <cjk>
+0xE8AA	U+96B1	# <cjk>
+0xE8AB	U+96B2	# <cjk>
+0xE8AC	U+96B0	# <cjk>
+0xE8AD	U+96B4	# <cjk>
+0xE8AE	U+96B6	# <cjk>
+0xE8AF	U+96B8	# <cjk>
+0xE8B0	U+96B9	# <cjk>
+0xE8B1	U+96CE	# <cjk>
+0xE8B2	U+96CB	# <cjk>
+0xE8B3	U+96C9	# <cjk>
+0xE8B4	U+96CD	# <cjk>
+0xE8B5	U+894D	# <cjk>
+0xE8B6	U+96DC	# <cjk>
+0xE8B7	U+970D	# <cjk>
+0xE8B8	U+96D5	# <cjk>
+0xE8B9	U+96F9	# <cjk>
+0xE8BA	U+9704	# <cjk>
+0xE8BB	U+9706	# <cjk>
+0xE8BC	U+9708	# <cjk>
+0xE8BD	U+9713	# <cjk>
+0xE8BE	U+970E	# <cjk>
+0xE8BF	U+9711	# <cjk>
+0xE8C0	U+970F	# <cjk>
+0xE8C1	U+9716	# <cjk>
+0xE8C2	U+9719	# <cjk>
+0xE8C3	U+9724	# <cjk>
+0xE8C4	U+972A	# <cjk>
+0xE8C5	U+9730	# <cjk>
+0xE8C6	U+9739	# <cjk>
+0xE8C7	U+973D	# <cjk>
+0xE8C8	U+973E	# <cjk>
+0xE8C9	U+9744	# <cjk>
+0xE8CA	U+9746	# <cjk>
+0xE8CB	U+9748	# <cjk>
+0xE8CC	U+9742	# <cjk>
+0xE8CD	U+9749	# <cjk>
+0xE8CE	U+975C	# <cjk>
+0xE8CF	U+9760	# <cjk>
+0xE8D0	U+9764	# <cjk>
+0xE8D1	U+9766	# <cjk>
+0xE8D2	U+9768	# <cjk>
+0xE8D3	U+52D2	# <cjk>
+0xE8D4	U+976B	# <cjk>
+0xE8D5	U+9771	# <cjk>
+0xE8D6	U+9779	# <cjk>
+0xE8D7	U+9785	# <cjk>
+0xE8D8	U+977C	# <cjk>
+0xE8D9	U+9781	# <cjk>
+0xE8DA	U+977A	# <cjk>
+0xE8DB	U+9786	# <cjk>
+0xE8DC	U+978B	# <cjk>
+0xE8DD	U+978F	# <cjk>
+0xE8DE	U+9790	# <cjk>
+0xE8DF	U+979C	# <cjk>
+0xE8E0	U+97A8	# <cjk>
+0xE8E1	U+97A6	# <cjk>
+0xE8E2	U+97A3	# <cjk>
+0xE8E3	U+97B3	# <cjk>
+0xE8E4	U+97B4	# <cjk>
+0xE8E5	U+97C3	# <cjk>
+0xE8E6	U+97C6	# <cjk>
+0xE8E7	U+97C8	# <cjk>
+0xE8E8	U+97CB	# <cjk>
+0xE8E9	U+97DC	# <cjk>
+0xE8EA	U+97ED	# <cjk>
+0xE8EB	U+9F4F	# <cjk>
+0xE8EC	U+97F2	# <cjk>
+0xE8ED	U+7ADF	# <cjk>
+0xE8EE	U+97F6	# <cjk>
+0xE8EF	U+97F5	# <cjk>
+0xE8F0	U+980F	# <cjk>
+0xE8F1	U+980C	# <cjk>
+0xE8F2	U+9838	# <cjk>
+0xE8F3	U+9824	# <cjk>
+0xE8F4	U+9821	# <cjk>
+0xE8F5	U+9837	# <cjk>
+0xE8F6	U+983D	# <cjk>
+0xE8F7	U+9846	# <cjk>
+0xE8F8	U+984F	# <cjk>
+0xE8F9	U+984B	# <cjk>
+0xE8FA	U+986B	# <cjk>
+0xE8FB	U+986F	# <cjk>
+0xE8FC	U+9870	# <cjk>
+0xE940	U+9871	# <cjk>
+0xE941	U+9874	# <cjk>
+0xE942	U+9873	# <cjk>
+0xE943	U+98AA	# <cjk>
+0xE944	U+98AF	# <cjk>
+0xE945	U+98B1	# <cjk>
+0xE946	U+98B6	# <cjk>
+0xE947	U+98C4	# <cjk>
+0xE948	U+98C3	# <cjk>
+0xE949	U+98C6	# <cjk>
+0xE94A	U+98E9	# <cjk>
+0xE94B	U+98EB	# <cjk>
+0xE94C	U+9903	# <cjk>
+0xE94D	U+9909	# <cjk>
+0xE94E	U+9912	# <cjk>
+0xE94F	U+9914	# <cjk>
+0xE950	U+9918	# <cjk>
+0xE951	U+9921	# <cjk>
+0xE952	U+991D	# <cjk>
+0xE953	U+991E	# <cjk>
+0xE954	U+9924	# <cjk>
+0xE955	U+9920	# <cjk>
+0xE956	U+992C	# <cjk>
+0xE957	U+992E	# <cjk>
+0xE958	U+993D	# <cjk>
+0xE959	U+993E	# <cjk>
+0xE95A	U+9942	# <cjk>
+0xE95B	U+9949	# <cjk>
+0xE95C	U+9945	# <cjk>
+0xE95D	U+9950	# <cjk>
+0xE95E	U+994B	# <cjk>
+0xE95F	U+9951	# <cjk>
+0xE960	U+9952	# <cjk>
+0xE961	U+994C	# <cjk>
+0xE962	U+9955	# <cjk>
+0xE963	U+9997	# <cjk>
+0xE964	U+9998	# <cjk>
+0xE965	U+99A5	# <cjk>
+0xE966	U+99AD	# <cjk>
+0xE967	U+99AE	# <cjk>
+0xE968	U+99BC	# <cjk>
+0xE969	U+99DF	# <cjk>
+0xE96A	U+99DB	# <cjk>
+0xE96B	U+99DD	# <cjk>
+0xE96C	U+99D8	# <cjk>
+0xE96D	U+99D1	# <cjk>
+0xE96E	U+99ED	# <cjk>
+0xE96F	U+99EE	# <cjk>
+0xE970	U+99F1	# <cjk>
+0xE971	U+99F2	# <cjk>
+0xE972	U+99FB	# <cjk>
+0xE973	U+99F8	# <cjk>
+0xE974	U+9A01	# <cjk>
+0xE975	U+9A0F	# <cjk>
+0xE976	U+9A05	# <cjk>
+0xE977	U+99E2	# <cjk>
+0xE978	U+9A19	# <cjk>
+0xE979	U+9A2B	# <cjk>
+0xE97A	U+9A37	# <cjk>
+0xE97B	U+9A45	# <cjk>
+0xE97C	U+9A42	# <cjk>
+0xE97D	U+9A40	# <cjk>
+0xE97E	U+9A43	# <cjk>
+0xE980	U+9A3E	# <cjk>
+0xE981	U+9A55	# <cjk>
+0xE982	U+9A4D	# <cjk>
+0xE983	U+9A5B	# <cjk>
+0xE984	U+9A57	# <cjk>
+0xE985	U+9A5F	# <cjk>
+0xE986	U+9A62	# <cjk>
+0xE987	U+9A65	# <cjk>
+0xE988	U+9A64	# <cjk>
+0xE989	U+9A69	# <cjk>
+0xE98A	U+9A6B	# <cjk>
+0xE98B	U+9A6A	# <cjk>
+0xE98C	U+9AAD	# <cjk>
+0xE98D	U+9AB0	# <cjk>
+0xE98E	U+9ABC	# <cjk>
+0xE98F	U+9AC0	# <cjk>
+0xE990	U+9ACF	# <cjk>
+0xE991	U+9AD1	# <cjk>
+0xE992	U+9AD3	# <cjk>
+0xE993	U+9AD4	# <cjk>
+0xE994	U+9ADE	# <cjk>
+0xE995	U+9ADF	# <cjk>
+0xE996	U+9AE2	# <cjk>
+0xE997	U+9AE3	# <cjk>
+0xE998	U+9AE6	# <cjk>
+0xE999	U+9AEF	# <cjk>
+0xE99A	U+9AEB	# <cjk>
+0xE99B	U+9AEE	# <cjk>
+0xE99C	U+9AF4	# <cjk>
+0xE99D	U+9AF1	# <cjk>
+0xE99E	U+9AF7	# <cjk>
+0xE99F	U+9AFB	# <cjk>
+0xE9A0	U+9B06	# <cjk>
+0xE9A1	U+9B18	# <cjk>
+0xE9A2	U+9B1A	# <cjk>
+0xE9A3	U+9B1F	# <cjk>
+0xE9A4	U+9B22	# <cjk>
+0xE9A5	U+9B23	# <cjk>
+0xE9A6	U+9B25	# <cjk>
+0xE9A7	U+9B27	# <cjk>
+0xE9A8	U+9B28	# <cjk>
+0xE9A9	U+9B29	# <cjk>
+0xE9AA	U+9B2A	# <cjk>
+0xE9AB	U+9B2E	# <cjk>
+0xE9AC	U+9B2F	# <cjk>
+0xE9AD	U+9B32	# <cjk>
+0xE9AE	U+9B44	# <cjk>
+0xE9AF	U+9B43	# <cjk>
+0xE9B0	U+9B4F	# <cjk>
+0xE9B1	U+9B4D	# <cjk>
+0xE9B2	U+9B4E	# <cjk>
+0xE9B3	U+9B51	# <cjk>
+0xE9B4	U+9B58	# <cjk>
+0xE9B5	U+9B74	# <cjk>
+0xE9B6	U+9B93	# <cjk>
+0xE9B7	U+9B83	# <cjk>
+0xE9B8	U+9B91	# <cjk>
+0xE9B9	U+9B96	# <cjk>
+0xE9BA	U+9B97	# <cjk>
+0xE9BB	U+9B9F	# <cjk>
+0xE9BC	U+9BA0	# <cjk>
+0xE9BD	U+9BA8	# <cjk>
+0xE9BE	U+9BB4	# <cjk>
+0xE9BF	U+9BC0	# <cjk>
+0xE9C0	U+9BCA	# <cjk>
+0xE9C1	U+9BB9	# <cjk>
+0xE9C2	U+9BC6	# <cjk>
+0xE9C3	U+9BCF	# <cjk>
+0xE9C4	U+9BD1	# <cjk>
+0xE9C5	U+9BD2	# <cjk>
+0xE9C6	U+9BE3	# <cjk>
+0xE9C7	U+9BE2	# <cjk>
+0xE9C8	U+9BE4	# <cjk>
+0xE9C9	U+9BD4	# <cjk>
+0xE9CA	U+9BE1	# <cjk>
+0xE9CB	U+9C3A	# <cjk>
+0xE9CC	U+9BF2	# <cjk>
+0xE9CD	U+9BF1	# <cjk>
+0xE9CE	U+9BF0	# <cjk>
+0xE9CF	U+9C15	# <cjk>
+0xE9D0	U+9C14	# <cjk>
+0xE9D1	U+9C09	# <cjk>
+0xE9D2	U+9C13	# <cjk>
+0xE9D3	U+9C0C	# <cjk>
+0xE9D4	U+9C06	# <cjk>
+0xE9D5	U+9C08	# <cjk>
+0xE9D6	U+9C12	# <cjk>
+0xE9D7	U+9C0A	# <cjk>
+0xE9D8	U+9C04	# <cjk>
+0xE9D9	U+9C2E	# <cjk>
+0xE9DA	U+9C1B	# <cjk>
+0xE9DB	U+9C25	# <cjk>
+0xE9DC	U+9C24	# <cjk>
+0xE9DD	U+9C21	# <cjk>
+0xE9DE	U+9C30	# <cjk>
+0xE9DF	U+9C47	# <cjk>
+0xE9E0	U+9C32	# <cjk>
+0xE9E1	U+9C46	# <cjk>
+0xE9E2	U+9C3E	# <cjk>
+0xE9E3	U+9C5A	# <cjk>
+0xE9E4	U+9C60	# <cjk>
+0xE9E5	U+9C67	# <cjk>
+0xE9E6	U+9C76	# <cjk>
+0xE9E7	U+9C78	# <cjk>
+0xE9E8	U+9CE7	# <cjk>
+0xE9E9	U+9CEC	# <cjk>
+0xE9EA	U+9CF0	# <cjk>
+0xE9EB	U+9D09	# <cjk>
+0xE9EC	U+9D08	# <cjk>
+0xE9ED	U+9CEB	# <cjk>
+0xE9EE	U+9D03	# <cjk>
+0xE9EF	U+9D06	# <cjk>
+0xE9F0	U+9D2A	# <cjk>
+0xE9F1	U+9D26	# <cjk>
+0xE9F2	U+9DAF	# <cjk>
+0xE9F3	U+9D23	# <cjk>
+0xE9F4	U+9D1F	# <cjk>
+0xE9F5	U+9D44	# <cjk>
+0xE9F6	U+9D15	# <cjk>
+0xE9F7	U+9D12	# <cjk>
+0xE9F8	U+9D41	# <cjk>
+0xE9F9	U+9D3F	# <cjk>
+0xE9FA	U+9D3E	# <cjk>
+0xE9FB	U+9D46	# <cjk>
+0xE9FC	U+9D48	# <cjk>
+0xEA40	U+9D5D	# <cjk>
+0xEA41	U+9D5E	# <cjk>
+0xEA42	U+9D64	# <cjk>
+0xEA43	U+9D51	# <cjk>
+0xEA44	U+9D50	# <cjk>
+0xEA45	U+9D59	# <cjk>
+0xEA46	U+9D72	# <cjk>
+0xEA47	U+9D89	# <cjk>
+0xEA48	U+9D87	# <cjk>
+0xEA49	U+9DAB	# <cjk>
+0xEA4A	U+9D6F	# <cjk>
+0xEA4B	U+9D7A	# <cjk>
+0xEA4C	U+9D9A	# <cjk>
+0xEA4D	U+9DA4	# <cjk>
+0xEA4E	U+9DA9	# <cjk>
+0xEA4F	U+9DB2	# <cjk>
+0xEA50	U+9DC4	# <cjk>
+0xEA51	U+9DC1	# <cjk>
+0xEA52	U+9DBB	# <cjk>
+0xEA53	U+9DB8	# <cjk>
+0xEA54	U+9DBA	# <cjk>
+0xEA55	U+9DC6	# <cjk>
+0xEA56	U+9DCF	# <cjk>
+0xEA57	U+9DC2	# <cjk>
+0xEA58	U+9DD9	# <cjk>
+0xEA59	U+9DD3	# <cjk>
+0xEA5A	U+9DF8	# <cjk>
+0xEA5B	U+9DE6	# <cjk>
+0xEA5C	U+9DED	# <cjk>
+0xEA5D	U+9DEF	# <cjk>
+0xEA5E	U+9DFD	# <cjk>
+0xEA5F	U+9E1A	# <cjk>
+0xEA60	U+9E1B	# <cjk>
+0xEA61	U+9E1E	# <cjk>
+0xEA62	U+9E75	# <cjk>
+0xEA63	U+9E79	# <cjk>
+0xEA64	U+9E7D	# <cjk>
+0xEA65	U+9E81	# <cjk>
+0xEA66	U+9E88	# <cjk>
+0xEA67	U+9E8B	# <cjk>
+0xEA68	U+9E8C	# <cjk>
+0xEA69	U+9E92	# <cjk>
+0xEA6A	U+9E95	# <cjk>
+0xEA6B	U+9E91	# <cjk>
+0xEA6C	U+9E9D	# <cjk>
+0xEA6D	U+9EA5	# <cjk>
+0xEA6E	U+9EA9	# <cjk>
+0xEA6F	U+9EB8	# <cjk>
+0xEA70	U+9EAA	# <cjk>
+0xEA71	U+9EAD	# <cjk>
+0xEA72	U+9761	# <cjk>
+0xEA73	U+9ECC	# <cjk>
+0xEA74	U+9ECE	# <cjk>
+0xEA75	U+9ECF	# <cjk>
+0xEA76	U+9ED0	# <cjk>
+0xEA77	U+9ED4	# <cjk>
+0xEA78	U+9EDC	# <cjk>
+0xEA79	U+9EDE	# <cjk>
+0xEA7A	U+9EDD	# <cjk>
+0xEA7B	U+9EE0	# <cjk>
+0xEA7C	U+9EE5	# <cjk>
+0xEA7D	U+9EE8	# <cjk>
+0xEA7E	U+9EEF	# <cjk>
+0xEA80	U+9EF4	# <cjk>
+0xEA81	U+9EF6	# <cjk>
+0xEA82	U+9EF7	# <cjk>
+0xEA83	U+9EF9	# <cjk>
+0xEA84	U+9EFB	# <cjk>
+0xEA85	U+9EFC	# <cjk>
+0xEA86	U+9EFD	# <cjk>
+0xEA87	U+9F07	# <cjk>
+0xEA88	U+9F08	# <cjk>
+0xEA89	U+76B7	# <cjk>
+0xEA8A	U+9F15	# <cjk>
+0xEA8B	U+9F21	# <cjk>
+0xEA8C	U+9F2C	# <cjk>
+0xEA8D	U+9F3E	# <cjk>
+0xEA8E	U+9F4A	# <cjk>
+0xEA8F	U+9F52	# <cjk>
+0xEA90	U+9F54	# <cjk>
+0xEA91	U+9F63	# <cjk>
+0xEA92	U+9F5F	# <cjk>
+0xEA93	U+9F60	# <cjk>
+0xEA94	U+9F61	# <cjk>
+0xEA95	U+9F66	# <cjk>
+0xEA96	U+9F67	# <cjk>
+0xEA97	U+9F6C	# <cjk>
+0xEA98	U+9F6A	# <cjk>
+0xEA99	U+9F77	# <cjk>
+0xEA9A	U+9F72	# <cjk>
+0xEA9B	U+9F76	# <cjk>
+0xEA9C	U+9F95	# <cjk>
+0xEA9D	U+9F9C	# <cjk>
+0xEA9E	U+9FA0	# <cjk>
+0xEA9F	U+582F	# <cjk>	[1983]
+0xEAA0	U+69C7	# <cjk>	[1983]
+0xEAA1	U+9059	# <cjk>	[1983]
+0xEAA2	U+7464	# <cjk>	[1983]
+0xEAA3	U+51DC	# <cjk>	[1990]
+0xEAA4	U+7199	# <cjk>	[1990]
+0xEAA5	U+5653	# <cjk>	[2004]
+0xEAA6	U+5DE2	# <cjk>	[2000]
+0xEAA7	U+5E14	# <cjk>	[2000]
+0xEAA8	U+5E18	# <cjk>	[2000]
+0xEAA9	U+5E58	# <cjk>	[2000]
+0xEAAA	U+5E5E	# <cjk>	[2000]
+0xEAAB	U+5EBE	# <cjk>	[2000]
+0xEAAC	U+F928	# CJK COMPATIBILITY IDEOGRAPH-F928	[2000]
+0xEAAD	U+5ECB	# <cjk>	[2000]
+0xEAAE	U+5EF9	# <cjk>	[2000]
+0xEAAF	U+5F00	# <cjk>	[2000]
+0xEAB0	U+5F02	# <cjk>	[2000]
+0xEAB1	U+5F07	# <cjk>	[2000]
+0xEAB2	U+5F1D	# <cjk>	[2000]
+0xEAB3	U+5F23	# <cjk>	[2000]
+0xEAB4	U+5F34	# <cjk>	[2000]
+0xEAB5	U+5F36	# <cjk>	[2000]
+0xEAB6	U+5F3D	# <cjk>	[2000]
+0xEAB7	U+5F40	# <cjk>	[2000]
+0xEAB8	U+5F45	# <cjk>	[2000]
+0xEAB9	U+5F54	# <cjk>	[2000]
+0xEABA	U+5F58	# <cjk>	[2000]
+0xEABB	U+5F64	# <cjk>	[2000]
+0xEABC	U+5F67	# <cjk>	[2000]
+0xEABD	U+5F7D	# <cjk>	[2000]
+0xEABE	U+5F89	# <cjk>	[2000]
+0xEABF	U+5F9C	# <cjk>	[2000]
+0xEAC0	U+5FA7	# <cjk>	[2000]
+0xEAC1	U+5FAF	# <cjk>	[2000]
+0xEAC2	U+5FB5	# <cjk>	[2000]
+0xEAC3	U+5FB7	# <cjk>	[2000]
+0xEAC4	U+5FC9	# <cjk>	[2000]
+0xEAC5	U+5FDE	# <cjk>	[2000]
+0xEAC6	U+5FE1	# <cjk>	[2000]
+0xEAC7	U+5FE9	# <cjk>	[2000]
+0xEAC8	U+600D	# <cjk>	[2000]
+0xEAC9	U+6014	# <cjk>	[2000]
+0xEACA	U+6018	# <cjk>	[2000]
+0xEACB	U+6033	# <cjk>	[2000]
+0xEACC	U+6035	# <cjk>	[2000]
+0xEACD	U+6047	# <cjk>	[2000]
+0xEACE	U+FA3D	# CJK COMPATIBILITY IDEOGRAPH-FA3D	[2000]	[Unicode3.2]
+0xEACF	U+609D	# <cjk>	[2000]
+0xEAD0	U+609E	# <cjk>	[2000]
+0xEAD1	U+60CB	# <cjk>	[2000]
+0xEAD2	U+60D4	# <cjk>	[2000]
+0xEAD3	U+60D5	# <cjk>	[2000]
+0xEAD4	U+60DD	# <cjk>	[2000]
+0xEAD5	U+60F8	# <cjk>	[2000]
+0xEAD6	U+611C	# <cjk>	[2000]
+0xEAD7	U+612B	# <cjk>	[2000]
+0xEAD8	U+6130	# <cjk>	[2000]
+0xEAD9	U+6137	# <cjk>	[2000]
+0xEADA	U+FA3E	# CJK COMPATIBILITY IDEOGRAPH-FA3E	[2000]	[Unicode3.2]
+0xEADB	U+618D	# <cjk>	[2000]
+0xEADC	U+FA3F	# CJK COMPATIBILITY IDEOGRAPH-FA3F	[2000]	[Unicode3.2]
+0xEADD	U+61BC	# <cjk>	[2000]
+0xEADE	U+61B9	# <cjk>	[2000]
+0xEADF	U+FA40	# CJK COMPATIBILITY IDEOGRAPH-FA40	[2000]	[Unicode3.2]
+0xEAE0	U+6222	# <cjk>	[2000]
+0xEAE1	U+623E	# <cjk>	[2000]
+0xEAE2	U+6243	# <cjk>	[2000]
+0xEAE3	U+6256	# <cjk>	[2000]
+0xEAE4	U+625A	# <cjk>	[2000]
+0xEAE5	U+626F	# <cjk>	[2000]
+0xEAE6	U+6285	# <cjk>	[2000]
+0xEAE7	U+62C4	# <cjk>	[2000]
+0xEAE8	U+62D6	# <cjk>	[2000]
+0xEAE9	U+62FC	# <cjk>	[2000]
+0xEAEA	U+630A	# <cjk>	[2000]
+0xEAEB	U+6318	# <cjk>	[2000]
+0xEAEC	U+6339	# <cjk>	[2000]
+0xEAED	U+6343	# <cjk>	[2000]
+0xEAEE	U+6365	# <cjk>	[2000]
+0xEAEF	U+637C	# <cjk>	[2000]
+0xEAF0	U+63E5	# <cjk>	[2000]
+0xEAF1	U+63ED	# <cjk>	[2000]
+0xEAF2	U+63F5	# <cjk>	[2000]
+0xEAF3	U+6410	# <cjk>	[2000]
+0xEAF4	U+6414	# <cjk>	[2000]
+0xEAF5	U+6422	# <cjk>	[2000]
+0xEAF6	U+6479	# <cjk>	[2000]
+0xEAF7	U+6451	# <cjk>	[2000]
+0xEAF8	U+6460	# <cjk>	[2000]
+0xEAF9	U+646D	# <cjk>	[2000]
+0xEAFA	U+64CE	# <cjk>	[2000]
+0xEAFB	U+64BE	# <cjk>	[2000]
+0xEAFC	U+64BF	# <cjk>	[2000]
+0xEB40	U+64C4	# <cjk>	[2000]
+0xEB41	U+64CA	# <cjk>	[2000]
+0xEB42	U+64D0	# <cjk>	[2000]
+0xEB43	U+64F7	# <cjk>	[2000]
+0xEB44	U+64FB	# <cjk>	[2000]
+0xEB45	U+6522	# <cjk>	[2000]
+0xEB46	U+6529	# <cjk>	[2000]
+0xEB47	U+FA41	# CJK COMPATIBILITY IDEOGRAPH-FA41	[2000]	[Unicode3.2]
+0xEB48	U+6567	# <cjk>	[2000]
+0xEB49	U+659D	# <cjk>	[2000]
+0xEB4A	U+FA42	# CJK COMPATIBILITY IDEOGRAPH-FA42	[2000]	[Unicode3.2]
+0xEB4B	U+6600	# <cjk>	[2000]
+0xEB4C	U+6609	# <cjk>	[2000]
+0xEB4D	U+6615	# <cjk>	[2000]
+0xEB4E	U+661E	# <cjk>	[2000]
+0xEB4F	U+663A	# <cjk>	[2000]
+0xEB50	U+6622	# <cjk>	[2000]
+0xEB51	U+6624	# <cjk>	[2000]
+0xEB52	U+662B	# <cjk>	[2000]
+0xEB53	U+6630	# <cjk>	[2000]
+0xEB54	U+6631	# <cjk>	[2000]
+0xEB55	U+6633	# <cjk>	[2000]
+0xEB56	U+66FB	# <cjk>	[2000]
+0xEB57	U+6648	# <cjk>	[2000]
+0xEB58	U+664C	# <cjk>	[2000]
+0xEB59	U+231C4	# <cjk>	[2000]	[Unicode3.1]
+0xEB5A	U+6659	# <cjk>	[2000]
+0xEB5B	U+665A	# <cjk>	[2000]
+0xEB5C	U+6661	# <cjk>	[2000]
+0xEB5D	U+6665	# <cjk>	[2000]
+0xEB5E	U+6673	# <cjk>	[2000]
+0xEB5F	U+6677	# <cjk>	[2000]
+0xEB60	U+6678	# <cjk>	[2000]
+0xEB61	U+668D	# <cjk>	[2000]
+0xEB62	U+FA43	# CJK COMPATIBILITY IDEOGRAPH-FA43	[2000]	[Unicode3.2]
+0xEB63	U+66A0	# <cjk>	[2000]
+0xEB64	U+66B2	# <cjk>	[2000]
+0xEB65	U+66BB	# <cjk>	[2000]
+0xEB66	U+66C6	# <cjk>	[2000]
+0xEB67	U+66C8	# <cjk>	[2000]
+0xEB68	U+3B22	# <cjk>	[2000]
+0xEB69	U+66DB	# <cjk>	[2000]
+0xEB6A	U+66E8	# <cjk>	[2000]
+0xEB6B	U+66FA	# <cjk>	[2000]
+0xEB6C	U+6713	# <cjk>	[2000]
+0xEB6D	U+F929	# CJK COMPATIBILITY IDEOGRAPH-F929	[2000]
+0xEB6E	U+6733	# <cjk>	[2000]
+0xEB6F	U+6766	# <cjk>	[2000]
+0xEB70	U+6747	# <cjk>	[2000]
+0xEB71	U+6748	# <cjk>	[2000]
+0xEB72	U+677B	# <cjk>	[2000]
+0xEB73	U+6781	# <cjk>	[2000]
+0xEB74	U+6793	# <cjk>	[2000]
+0xEB75	U+6798	# <cjk>	[2000]
+0xEB76	U+679B	# <cjk>	[2000]
+0xEB77	U+67BB	# <cjk>	[2000]
+0xEB78	U+67F9	# <cjk>	[2000]
+0xEB79	U+67C0	# <cjk>	[2000]
+0xEB7A	U+67D7	# <cjk>	[2000]
+0xEB7B	U+67FC	# <cjk>	[2000]
+0xEB7C	U+6801	# <cjk>	[2000]
+0xEB7D	U+6852	# <cjk>	[2000]
+0xEB7E	U+681D	# <cjk>	[2000]
+0xEB80	U+682C	# <cjk>	[2000]
+0xEB81	U+6831	# <cjk>	[2000]
+0xEB82	U+685B	# <cjk>	[2000]
+0xEB83	U+6872	# <cjk>	[2000]
+0xEB84	U+6875	# <cjk>	[2000]
+0xEB85	U+FA44	# CJK COMPATIBILITY IDEOGRAPH-FA44	[2000]	[Unicode3.2]
+0xEB86	U+68A3	# <cjk>	[2000]
+0xEB87	U+68A5	# <cjk>	[2000]
+0xEB88	U+68B2	# <cjk>	[2000]
+0xEB89	U+68C8	# <cjk>	[2000]
+0xEB8A	U+68D0	# <cjk>	[2000]
+0xEB8B	U+68E8	# <cjk>	[2000]
+0xEB8C	U+68ED	# <cjk>	[2000]
+0xEB8D	U+68F0	# <cjk>	[2000]
+0xEB8E	U+68F1	# <cjk>	[2000]
+0xEB8F	U+68FC	# <cjk>	[2000]
+0xEB90	U+690A	# <cjk>	[2000]
+0xEB91	U+6949	# <cjk>	[2000]
+0xEB92	U+235C4	# <cjk>	[2000]	[Unicode3.1]
+0xEB93	U+6935	# <cjk>	[2000]
+0xEB94	U+6942	# <cjk>	[2000]
+0xEB95	U+6957	# <cjk>	[2000]
+0xEB96	U+6963	# <cjk>	[2000]
+0xEB97	U+6964	# <cjk>	[2000]
+0xEB98	U+6968	# <cjk>	[2000]
+0xEB99	U+6980	# <cjk>	[2000]
+0xEB9A	U+FA14	# CJK COMPATIBILITY IDEOGRAPH-FA14	[2000]
+0xEB9B	U+69A5	# <cjk>	[2000]
+0xEB9C	U+69AD	# <cjk>	[2000]
+0xEB9D	U+69CF	# <cjk>	[2000]
+0xEB9E	U+3BB6	# <cjk>	[2000]
+0xEB9F	U+3BC3	# <cjk>	[2000]
+0xEBA0	U+69E2	# <cjk>	[2000]
+0xEBA1	U+69E9	# <cjk>	[2000]
+0xEBA2	U+69EA	# <cjk>	[2000]
+0xEBA3	U+69F5	# <cjk>	[2000]
+0xEBA4	U+69F6	# <cjk>	[2000]
+0xEBA5	U+6A0F	# <cjk>	[2000]
+0xEBA6	U+6A15	# <cjk>	[2000]
+0xEBA7	U+2373F	# <cjk>	[2000]	[Unicode3.1]
+0xEBA8	U+6A3B	# <cjk>	[2000]
+0xEBA9	U+6A3E	# <cjk>	[2000]
+0xEBAA	U+6A45	# <cjk>	[2000]
+0xEBAB	U+6A50	# <cjk>	[2000]
+0xEBAC	U+6A56	# <cjk>	[2000]
+0xEBAD	U+6A5B	# <cjk>	[2000]
+0xEBAE	U+6A6B	# <cjk>	[2000]
+0xEBAF	U+6A73	# <cjk>	[2000]
+0xEBB0	U+23763	# <cjk>	[2000]	[Unicode3.1]
+0xEBB1	U+6A89	# <cjk>	[2000]
+0xEBB2	U+6A94	# <cjk>	[2000]
+0xEBB3	U+6A9D	# <cjk>	[2000]
+0xEBB4	U+6A9E	# <cjk>	[2000]
+0xEBB5	U+6AA5	# <cjk>	[2000]
+0xEBB6	U+6AE4	# <cjk>	[2000]
+0xEBB7	U+6AE7	# <cjk>	[2000]
+0xEBB8	U+3C0F	# <cjk>	[2000]
+0xEBB9	U+F91D	# CJK COMPATIBILITY IDEOGRAPH-F91D	[2000]
+0xEBBA	U+6B1B	# <cjk>	[2000]
+0xEBBB	U+6B1E	# <cjk>	[2000]
+0xEBBC	U+6B2C	# <cjk>	[2000]
+0xEBBD	U+6B35	# <cjk>	[2000]
+0xEBBE	U+6B46	# <cjk>	[2000]
+0xEBBF	U+6B56	# <cjk>	[2000]
+0xEBC0	U+6B60	# <cjk>	[2000]
+0xEBC1	U+6B65	# <cjk>	[2000]
+0xEBC2	U+6B67	# <cjk>	[2000]
+0xEBC3	U+6B77	# <cjk>	[2000]
+0xEBC4	U+6B82	# <cjk>	[2000]
+0xEBC5	U+6BA9	# <cjk>	[2000]
+0xEBC6	U+6BAD	# <cjk>	[2000]
+0xEBC7	U+F970	# CJK COMPATIBILITY IDEOGRAPH-F970	[2000]
+0xEBC8	U+6BCF	# <cjk>	[2000]
+0xEBC9	U+6BD6	# <cjk>	[2000]
+0xEBCA	U+6BD7	# <cjk>	[2000]
+0xEBCB	U+6BFF	# <cjk>	[2000]
+0xEBCC	U+6C05	# <cjk>	[2000]
+0xEBCD	U+6C10	# <cjk>	[2000]
+0xEBCE	U+6C33	# <cjk>	[2000]
+0xEBCF	U+6C59	# <cjk>	[2000]
+0xEBD0	U+6C5C	# <cjk>	[2000]
+0xEBD1	U+6CAA	# <cjk>	[2000]
+0xEBD2	U+6C74	# <cjk>	[2000]
+0xEBD3	U+6C76	# <cjk>	[2000]
+0xEBD4	U+6C85	# <cjk>	[2000]
+0xEBD5	U+6C86	# <cjk>	[2000]
+0xEBD6	U+6C98	# <cjk>	[2000]
+0xEBD7	U+6C9C	# <cjk>	[2000]
+0xEBD8	U+6CFB	# <cjk>	[2000]
+0xEBD9	U+6CC6	# <cjk>	[2000]
+0xEBDA	U+6CD4	# <cjk>	[2000]
+0xEBDB	U+6CE0	# <cjk>	[2000]
+0xEBDC	U+6CEB	# <cjk>	[2000]
+0xEBDD	U+6CEE	# <cjk>	[2000]
+0xEBDE	U+23CFE	# <cjk>	[2000]	[Unicode3.1]
+0xEBDF	U+6D04	# <cjk>	[2000]
+0xEBE0	U+6D0E	# <cjk>	[2000]
+0xEBE1	U+6D2E	# <cjk>	[2000]
+0xEBE2	U+6D31	# <cjk>	[2000]
+0xEBE3	U+6D39	# <cjk>	[2000]
+0xEBE4	U+6D3F	# <cjk>	[2000]
+0xEBE5	U+6D58	# <cjk>	[2000]
+0xEBE6	U+6D65	# <cjk>	[2000]
+0xEBE7	U+FA45	# CJK COMPATIBILITY IDEOGRAPH-FA45	[2000]	[Unicode3.2]
+0xEBE8	U+6D82	# <cjk>	[2000]
+0xEBE9	U+6D87	# <cjk>	[2000]
+0xEBEA	U+6D89	# <cjk>	[2000]
+0xEBEB	U+6D94	# <cjk>	[2000]
+0xEBEC	U+6DAA	# <cjk>	[2000]
+0xEBED	U+6DAC	# <cjk>	[2000]
+0xEBEE	U+6DBF	# <cjk>	[2000]
+0xEBEF	U+6DC4	# <cjk>	[2000]
+0xEBF0	U+6DD6	# <cjk>	[2000]
+0xEBF1	U+6DDA	# <cjk>	[2000]
+0xEBF2	U+6DDB	# <cjk>	[2000]
+0xEBF3	U+6DDD	# <cjk>	[2000]
+0xEBF4	U+6DFC	# <cjk>	[2000]
+0xEBF5	U+FA46	# CJK COMPATIBILITY IDEOGRAPH-FA46	[2000]	[Unicode3.2]
+0xEBF6	U+6E34	# <cjk>	[2000]
+0xEBF7	U+6E44	# <cjk>	[2000]
+0xEBF8	U+6E5C	# <cjk>	[2000]
+0xEBF9	U+6E5E	# <cjk>	[2000]
+0xEBFA	U+6EAB	# <cjk>	[2000]
+0xEBFB	U+6EB1	# <cjk>	[2000]
+0xEBFC	U+6EC1	# <cjk>	[2000]
+0xEC40	U+6EC7	# <cjk>	[2000]
+0xEC41	U+6ECE	# <cjk>	[2000]
+0xEC42	U+6F10	# <cjk>	[2000]
+0xEC43	U+6F1A	# <cjk>	[2000]
+0xEC44	U+FA47	# CJK COMPATIBILITY IDEOGRAPH-FA47	[2000]	[Unicode3.2]
+0xEC45	U+6F2A	# <cjk>	[2000]
+0xEC46	U+6F2F	# <cjk>	[2000]
+0xEC47	U+6F33	# <cjk>	[2000]
+0xEC48	U+6F51	# <cjk>	[2000]
+0xEC49	U+6F59	# <cjk>	[2000]
+0xEC4A	U+6F5E	# <cjk>	[2000]
+0xEC4B	U+6F61	# <cjk>	[2000]
+0xEC4C	U+6F62	# <cjk>	[2000]
+0xEC4D	U+6F7E	# <cjk>	[2000]
+0xEC4E	U+6F88	# <cjk>	[2000]
+0xEC4F	U+6F8C	# <cjk>	[2000]
+0xEC50	U+6F8D	# <cjk>	[2000]
+0xEC51	U+6F94	# <cjk>	[2000]
+0xEC52	U+6FA0	# <cjk>	[2000]
+0xEC53	U+6FA7	# <cjk>	[2000]
+0xEC54	U+6FB6	# <cjk>	[2000]
+0xEC55	U+6FBC	# <cjk>	[2000]
+0xEC56	U+6FC7	# <cjk>	[2000]
+0xEC57	U+6FCA	# <cjk>	[2000]
+0xEC58	U+6FF9	# <cjk>	[2000]
+0xEC59	U+6FF0	# <cjk>	[2000]
+0xEC5A	U+6FF5	# <cjk>	[2000]
+0xEC5B	U+7005	# <cjk>	[2000]
+0xEC5C	U+7006	# <cjk>	[2000]
+0xEC5D	U+7028	# <cjk>	[2000]
+0xEC5E	U+704A	# <cjk>	[2000]
+0xEC5F	U+705D	# <cjk>	[2000]
+0xEC60	U+705E	# <cjk>	[2000]
+0xEC61	U+704E	# <cjk>	[2000]
+0xEC62	U+7064	# <cjk>	[2000]
+0xEC63	U+7075	# <cjk>	[2000]
+0xEC64	U+7085	# <cjk>	[2000]
+0xEC65	U+70A4	# <cjk>	[2000]
+0xEC66	U+70AB	# <cjk>	[2000]
+0xEC67	U+70B7	# <cjk>	[2000]
+0xEC68	U+70D4	# <cjk>	[2000]
+0xEC69	U+70D8	# <cjk>	[2000]
+0xEC6A	U+70E4	# <cjk>	[2000]
+0xEC6B	U+710F	# <cjk>	[2000]
+0xEC6C	U+712B	# <cjk>	[2000]
+0xEC6D	U+711E	# <cjk>	[2000]
+0xEC6E	U+7120	# <cjk>	[2000]
+0xEC6F	U+712E	# <cjk>	[2000]
+0xEC70	U+7130	# <cjk>	[2000]
+0xEC71	U+7146	# <cjk>	[2000]
+0xEC72	U+7147	# <cjk>	[2000]
+0xEC73	U+7151	# <cjk>	[2000]
+0xEC74	U+FA48	# CJK COMPATIBILITY IDEOGRAPH-FA48	[2000]	[Unicode3.2]
+0xEC75	U+7152	# <cjk>	[2000]
+0xEC76	U+715C	# <cjk>	[2000]
+0xEC77	U+7160	# <cjk>	[2000]
+0xEC78	U+7168	# <cjk>	[2000]
+0xEC79	U+FA15	# CJK COMPATIBILITY IDEOGRAPH-FA15	[2000]
+0xEC7A	U+7185	# <cjk>	[2000]
+0xEC7B	U+7187	# <cjk>	[2000]
+0xEC7C	U+7192	# <cjk>	[2000]
+0xEC7D	U+71C1	# <cjk>	[2000]
+0xEC7E	U+71BA	# <cjk>	[2000]
+0xEC80	U+71C4	# <cjk>	[2000]
+0xEC81	U+71FE	# <cjk>	[2000]
+0xEC82	U+7200	# <cjk>	[2000]
+0xEC83	U+7215	# <cjk>	[2000]
+0xEC84	U+7255	# <cjk>	[2000]
+0xEC85	U+7256	# <cjk>	[2000]
+0xEC86	U+3E3F	# <cjk>	[2000]
+0xEC87	U+728D	# <cjk>	[2000]
+0xEC88	U+729B	# <cjk>	[2000]
+0xEC89	U+72BE	# <cjk>	[2000]
+0xEC8A	U+72C0	# <cjk>	[2000]
+0xEC8B	U+72FB	# <cjk>	[2000]
+0xEC8C	U+247F1	# <cjk>	[2000]	[Unicode3.1]
+0xEC8D	U+7327	# <cjk>	[2000]
+0xEC8E	U+7328	# <cjk>	[2000]
+0xEC8F	U+FA16	# CJK COMPATIBILITY IDEOGRAPH-FA16	[2000]
+0xEC90	U+7350	# <cjk>	[2000]
+0xEC91	U+7366	# <cjk>	[2000]
+0xEC92	U+737C	# <cjk>	[2000]
+0xEC93	U+7395	# <cjk>	[2000]
+0xEC94	U+739F	# <cjk>	[2000]
+0xEC95	U+73A0	# <cjk>	[2000]
+0xEC96	U+73A2	# <cjk>	[2000]
+0xEC97	U+73A6	# <cjk>	[2000]
+0xEC98	U+73AB	# <cjk>	[2000]
+0xEC99	U+73C9	# <cjk>	[2000]
+0xEC9A	U+73CF	# <cjk>	[2000]
+0xEC9B	U+73D6	# <cjk>	[2000]
+0xEC9C	U+73D9	# <cjk>	[2000]
+0xEC9D	U+73E3	# <cjk>	[2000]
+0xEC9E	U+73E9	# <cjk>	[2000]
+0xEC9F	U+7407	# <cjk>	[2000]
+0xECA0	U+740A	# <cjk>	[2000]
+0xECA1	U+741A	# <cjk>	[2000]
+0xECA2	U+741B	# <cjk>	[2000]
+0xECA3	U+FA4A	# CJK COMPATIBILITY IDEOGRAPH-FA4A	[2000]	[Unicode3.2]
+0xECA4	U+7426	# <cjk>	[2000]
+0xECA5	U+7428	# <cjk>	[2000]
+0xECA6	U+742A	# <cjk>	[2000]
+0xECA7	U+742B	# <cjk>	[2000]
+0xECA8	U+742C	# <cjk>	[2000]
+0xECA9	U+742E	# <cjk>	[2000]
+0xECAA	U+742F	# <cjk>	[2000]
+0xECAB	U+7430	# <cjk>	[2000]
+0xECAC	U+7444	# <cjk>	[2000]
+0xECAD	U+7446	# <cjk>	[2000]
+0xECAE	U+7447	# <cjk>	[2000]
+0xECAF	U+744B	# <cjk>	[2000]
+0xECB0	U+7457	# <cjk>	[2000]
+0xECB1	U+7462	# <cjk>	[2000]
+0xECB2	U+746B	# <cjk>	[2000]
+0xECB3	U+746D	# <cjk>	[2000]
+0xECB4	U+7486	# <cjk>	[2000]
+0xECB5	U+7487	# <cjk>	[2000]
+0xECB6	U+7489	# <cjk>	[2000]
+0xECB7	U+7498	# <cjk>	[2000]
+0xECB8	U+749C	# <cjk>	[2000]
+0xECB9	U+749F	# <cjk>	[2000]
+0xECBA	U+74A3	# <cjk>	[2000]
+0xECBB	U+7490	# <cjk>	[2000]
+0xECBC	U+74A6	# <cjk>	[2000]
+0xECBD	U+74A8	# <cjk>	[2000]
+0xECBE	U+74A9	# <cjk>	[2000]
+0xECBF	U+74B5	# <cjk>	[2000]
+0xECC0	U+74BF	# <cjk>	[2000]
+0xECC1	U+74C8	# <cjk>	[2000]
+0xECC2	U+74C9	# <cjk>	[2000]
+0xECC3	U+74DA	# <cjk>	[2000]
+0xECC4	U+74FF	# <cjk>	[2000]
+0xECC5	U+7501	# <cjk>	[2000]
+0xECC6	U+7517	# <cjk>	[2000]
+0xECC7	U+752F	# <cjk>	[2000]
+0xECC8	U+756F	# <cjk>	[2000]
+0xECC9	U+7579	# <cjk>	[2000]
+0xECCA	U+7592	# <cjk>	[2000]
+0xECCB	U+3F72	# <cjk>	[2000]
+0xECCC	U+75CE	# <cjk>	[2000]
+0xECCD	U+75E4	# <cjk>	[2000]
+0xECCE	U+7600	# <cjk>	[2000]
+0xECCF	U+7602	# <cjk>	[2000]
+0xECD0	U+7608	# <cjk>	[2000]
+0xECD1	U+7615	# <cjk>	[2000]
+0xECD2	U+7616	# <cjk>	[2000]
+0xECD3	U+7619	# <cjk>	[2000]
+0xECD4	U+761E	# <cjk>	[2000]
+0xECD5	U+762D	# <cjk>	[2000]
+0xECD6	U+7635	# <cjk>	[2000]
+0xECD7	U+7643	# <cjk>	[2000]
+0xECD8	U+764B	# <cjk>	[2000]
+0xECD9	U+7664	# <cjk>	[2000]
+0xECDA	U+7665	# <cjk>	[2000]
+0xECDB	U+766D	# <cjk>	[2000]
+0xECDC	U+766F	# <cjk>	[2000]
+0xECDD	U+7671	# <cjk>	[2000]
+0xECDE	U+7681	# <cjk>	[2000]
+0xECDF	U+769B	# <cjk>	[2000]
+0xECE0	U+769D	# <cjk>	[2000]
+0xECE1	U+769E	# <cjk>	[2000]
+0xECE2	U+76A6	# <cjk>	[2000]
+0xECE3	U+76AA	# <cjk>	[2000]
+0xECE4	U+76B6	# <cjk>	[2000]
+0xECE5	U+76C5	# <cjk>	[2000]
+0xECE6	U+76CC	# <cjk>	[2000]
+0xECE7	U+76CE	# <cjk>	[2000]
+0xECE8	U+76D4	# <cjk>	[2000]
+0xECE9	U+76E6	# <cjk>	[2000]
+0xECEA	U+76F1	# <cjk>	[2000]
+0xECEB	U+76FC	# <cjk>	[2000]
+0xECEC	U+770A	# <cjk>	[2000]
+0xECED	U+7719	# <cjk>	[2000]
+0xECEE	U+7734	# <cjk>	[2000]
+0xECEF	U+7736	# <cjk>	[2000]
+0xECF0	U+7746	# <cjk>	[2000]
+0xECF1	U+774D	# <cjk>	[2000]
+0xECF2	U+774E	# <cjk>	[2000]
+0xECF3	U+775C	# <cjk>	[2000]
+0xECF4	U+775F	# <cjk>	[2000]
+0xECF5	U+7762	# <cjk>	[2000]
+0xECF6	U+777A	# <cjk>	[2000]
+0xECF7	U+7780	# <cjk>	[2000]
+0xECF8	U+7794	# <cjk>	[2000]
+0xECF9	U+77AA	# <cjk>	[2000]
+0xECFA	U+77E0	# <cjk>	[2000]
+0xECFB	U+782D	# <cjk>	[2000]
+0xECFC	U+2548E	# <cjk>	[2000]	[Unicode3.1]
+0xED40	U+7843	# <cjk>	[2000]
+0xED41	U+784E	# <cjk>	[2000]
+0xED42	U+784F	# <cjk>	[2000]
+0xED43	U+7851	# <cjk>	[2000]
+0xED44	U+7868	# <cjk>	[2000]
+0xED45	U+786E	# <cjk>	[2000]
+0xED46	U+FA4B	# CJK COMPATIBILITY IDEOGRAPH-FA4B	[2000]	[Unicode3.2]
+0xED47	U+78B0	# <cjk>	[2000]
+0xED48	U+2550E	# <cjk>	[2000]	[Unicode3.1]
+0xED49	U+78AD	# <cjk>	[2000]
+0xED4A	U+78E4	# <cjk>	[2000]
+0xED4B	U+78F2	# <cjk>	[2000]
+0xED4C	U+7900	# <cjk>	[2000]
+0xED4D	U+78F7	# <cjk>	[2000]
+0xED4E	U+791C	# <cjk>	[2000]
+0xED4F	U+792E	# <cjk>	[2000]
+0xED50	U+7931	# <cjk>	[2000]
+0xED51	U+7934	# <cjk>	[2000]
+0xED52	U+FA4C	# CJK COMPATIBILITY IDEOGRAPH-FA4C	[2000]	[Unicode3.2]
+0xED53	U+FA4D	# CJK COMPATIBILITY IDEOGRAPH-FA4D	[2000]	[Unicode3.2]
+0xED54	U+7945	# <cjk>	[2000]
+0xED55	U+7946	# <cjk>	[2000]
+0xED56	U+FA4E	# CJK COMPATIBILITY IDEOGRAPH-FA4E	[2000]	[Unicode3.2]
+0xED57	U+FA4F	# CJK COMPATIBILITY IDEOGRAPH-FA4F	[2000]	[Unicode3.2]
+0xED58	U+FA50	# CJK COMPATIBILITY IDEOGRAPH-FA50	[2000]	[Unicode3.2]
+0xED59	U+795C	# <cjk>	[2000]
+0xED5A	U+FA51	# CJK COMPATIBILITY IDEOGRAPH-FA51	[2000]	[Unicode3.2]
+0xED5B	U+FA19	# CJK COMPATIBILITY IDEOGRAPH-FA19	[2000]
+0xED5C	U+FA1A	# CJK COMPATIBILITY IDEOGRAPH-FA1A	[2000]
+0xED5D	U+7979	# <cjk>	[2000]
+0xED5E	U+FA52	# CJK COMPATIBILITY IDEOGRAPH-FA52	[2000]	[Unicode3.2]
+0xED5F	U+FA53	# CJK COMPATIBILITY IDEOGRAPH-FA53	[2000]	[Unicode3.2]
+0xED60	U+FA1B	# CJK COMPATIBILITY IDEOGRAPH-FA1B	[2000]
+0xED61	U+7998	# <cjk>	[2000]
+0xED62	U+79B1	# <cjk>	[2000]
+0xED63	U+79B8	# <cjk>	[2000]
+0xED64	U+79C8	# <cjk>	[2000]
+0xED65	U+79CA	# <cjk>	[2000]
+0xED66	U+25771	# <cjk>	[2000]	[Unicode3.1]
+0xED67	U+79D4	# <cjk>	[2000]
+0xED68	U+79DE	# <cjk>	[2000]
+0xED69	U+79EB	# <cjk>	[2000]
+0xED6A	U+79ED	# <cjk>	[2000]
+0xED6B	U+7A03	# <cjk>	[2000]
+0xED6C	U+FA54	# CJK COMPATIBILITY IDEOGRAPH-FA54	[2000]	[Unicode3.2]
+0xED6D	U+7A39	# <cjk>	[2000]
+0xED6E	U+7A5D	# <cjk>	[2000]
+0xED6F	U+7A6D	# <cjk>	[2000]
+0xED70	U+FA55	# CJK COMPATIBILITY IDEOGRAPH-FA55	[2000]	[Unicode3.2]
+0xED71	U+7A85	# <cjk>	[2000]
+0xED72	U+7AA0	# <cjk>	[2000]
+0xED73	U+259C4	# <cjk>	[2000]	[Unicode3.1]
+0xED74	U+7AB3	# <cjk>	[2000]
+0xED75	U+7ABB	# <cjk>	[2000]
+0xED76	U+7ACE	# <cjk>	[2000]
+0xED77	U+7AEB	# <cjk>	[2000]
+0xED78	U+7AFD	# <cjk>	[2000]
+0xED79	U+7B12	# <cjk>	[2000]
+0xED7A	U+7B2D	# <cjk>	[2000]
+0xED7B	U+7B3B	# <cjk>	[2000]
+0xED7C	U+7B47	# <cjk>	[2000]
+0xED7D	U+7B4E	# <cjk>	[2000]
+0xED7E	U+7B60	# <cjk>	[2000]
+0xED80	U+7B6D	# <cjk>	[2000]
+0xED81	U+7B6F	# <cjk>	[2000]
+0xED82	U+7B72	# <cjk>	[2000]
+0xED83	U+7B9E	# <cjk>	[2000]
+0xED84	U+FA56	# CJK COMPATIBILITY IDEOGRAPH-FA56	[2000]	[Unicode3.2]
+0xED85	U+7BD7	# <cjk>	[2000]
+0xED86	U+7BD9	# <cjk>	[2000]
+0xED87	U+7C01	# <cjk>	[2000]
+0xED88	U+7C31	# <cjk>	[2000]
+0xED89	U+7C1E	# <cjk>	[2000]
+0xED8A	U+7C20	# <cjk>	[2000]
+0xED8B	U+7C33	# <cjk>	[2000]
+0xED8C	U+7C36	# <cjk>	[2000]
+0xED8D	U+4264	# <cjk>	[2000]
+0xED8E	U+25DA1	# <cjk>	[2000]	[Unicode3.1]
+0xED8F	U+7C59	# <cjk>	[2000]
+0xED90	U+7C6D	# <cjk>	[2000]
+0xED91	U+7C79	# <cjk>	[2000]
+0xED92	U+7C8F	# <cjk>	[2000]
+0xED93	U+7C94	# <cjk>	[2000]
+0xED94	U+7CA0	# <cjk>	[2000]
+0xED95	U+7CBC	# <cjk>	[2000]
+0xED96	U+7CD5	# <cjk>	[2000]
+0xED97	U+7CD9	# <cjk>	[2000]
+0xED98	U+7CDD	# <cjk>	[2000]
+0xED99	U+7D07	# <cjk>	[2000]
+0xED9A	U+7D08	# <cjk>	[2000]
+0xED9B	U+7D13	# <cjk>	[2000]
+0xED9C	U+7D1D	# <cjk>	[2000]
+0xED9D	U+7D23	# <cjk>	[2000]
+0xED9E	U+7D31	# <cjk>	[2000]
+0xED9F	U+7D41	# <cjk>	[2000]
+0xEDA0	U+7D48	# <cjk>	[2000]
+0xEDA1	U+7D53	# <cjk>	[2000]
+0xEDA2	U+7D5C	# <cjk>	[2000]
+0xEDA3	U+7D7A	# <cjk>	[2000]
+0xEDA4	U+7D83	# <cjk>	[2000]
+0xEDA5	U+7D8B	# <cjk>	[2000]
+0xEDA6	U+7DA0	# <cjk>	[2000]
+0xEDA7	U+7DA6	# <cjk>	[2000]
+0xEDA8	U+7DC2	# <cjk>	[2000]
+0xEDA9	U+7DCC	# <cjk>	[2000]
+0xEDAA	U+7DD6	# <cjk>	[2000]
+0xEDAB	U+7DE3	# <cjk>	[2000]
+0xEDAC	U+FA57	# CJK COMPATIBILITY IDEOGRAPH-FA57	[2000]	[Unicode3.2]
+0xEDAD	U+7E28	# <cjk>	[2000]
+0xEDAE	U+7E08	# <cjk>	[2000]
+0xEDAF	U+7E11	# <cjk>	[2000]
+0xEDB0	U+7E15	# <cjk>	[2000]
+0xEDB1	U+FA59	# CJK COMPATIBILITY IDEOGRAPH-FA59	[2000]	[Unicode3.2]
+0xEDB2	U+7E47	# <cjk>	[2000]
+0xEDB3	U+7E52	# <cjk>	[2000]
+0xEDB4	U+7E61	# <cjk>	[2000]
+0xEDB5	U+7E8A	# <cjk>	[2000]
+0xEDB6	U+7E8D	# <cjk>	[2000]
+0xEDB7	U+7F47	# <cjk>	[2000]
+0xEDB8	U+FA5A	# CJK COMPATIBILITY IDEOGRAPH-FA5A	[2000]	[Unicode3.2]
+0xEDB9	U+7F91	# <cjk>	[2000]
+0xEDBA	U+7F97	# <cjk>	[2000]
+0xEDBB	U+7FBF	# <cjk>	[2000]
+0xEDBC	U+7FCE	# <cjk>	[2000]
+0xEDBD	U+7FDB	# <cjk>	[2000]
+0xEDBE	U+7FDF	# <cjk>	[2000]
+0xEDBF	U+7FEC	# <cjk>	[2000]
+0xEDC0	U+7FEE	# <cjk>	[2000]
+0xEDC1	U+7FFA	# <cjk>	[2000]
+0xEDC2	U+FA5B	# CJK COMPATIBILITY IDEOGRAPH-FA5B	[2000]	[Unicode3.2]
+0xEDC3	U+8014	# <cjk>	[2000]
+0xEDC4	U+8026	# <cjk>	[2000]
+0xEDC5	U+8035	# <cjk>	[2000]
+0xEDC6	U+8037	# <cjk>	[2000]
+0xEDC7	U+803C	# <cjk>	[2000]
+0xEDC8	U+80CA	# <cjk>	[2000]
+0xEDC9	U+80D7	# <cjk>	[2000]
+0xEDCA	U+80E0	# <cjk>	[2000]
+0xEDCB	U+80F3	# <cjk>	[2000]
+0xEDCC	U+8118	# <cjk>	[2000]
+0xEDCD	U+814A	# <cjk>	[2000]
+0xEDCE	U+8160	# <cjk>	[2000]
+0xEDCF	U+8167	# <cjk>	[2000]
+0xEDD0	U+8168	# <cjk>	[2000]
+0xEDD1	U+816D	# <cjk>	[2000]
+0xEDD2	U+81BB	# <cjk>	[2000]
+0xEDD3	U+81CA	# <cjk>	[2000]
+0xEDD4	U+81CF	# <cjk>	[2000]
+0xEDD5	U+81D7	# <cjk>	[2000]
+0xEDD6	U+FA5C	# CJK COMPATIBILITY IDEOGRAPH-FA5C	[2000]	[Unicode3.2]
+0xEDD7	U+4453	# <cjk>	[2000]
+0xEDD8	U+445B	# <cjk>	[2000]
+0xEDD9	U+8260	# <cjk>	[2000]
+0xEDDA	U+8274	# <cjk>	[2000]
+0xEDDB	U+26AFF	# <cjk>	[2000]	[Unicode3.1]
+0xEDDC	U+828E	# <cjk>	[2000]
+0xEDDD	U+82A1	# <cjk>	[2000]
+0xEDDE	U+82A3	# <cjk>	[2000]
+0xEDDF	U+82A4	# <cjk>	[2000]
+0xEDE0	U+82A9	# <cjk>	[2000]
+0xEDE1	U+82AE	# <cjk>	[2000]
+0xEDE2	U+82B7	# <cjk>	[2000]
+0xEDE3	U+82BE	# <cjk>	[2000]
+0xEDE4	U+82BF	# <cjk>	[2000]
+0xEDE5	U+82C6	# <cjk>	[2000]
+0xEDE6	U+82D5	# <cjk>	[2000]
+0xEDE7	U+82FD	# <cjk>	[2000]
+0xEDE8	U+82FE	# <cjk>	[2000]
+0xEDE9	U+8300	# <cjk>	[2000]
+0xEDEA	U+8301	# <cjk>	[2000]
+0xEDEB	U+8362	# <cjk>	[2000]
+0xEDEC	U+8322	# <cjk>	[2000]
+0xEDED	U+832D	# <cjk>	[2000]
+0xEDEE	U+833A	# <cjk>	[2000]
+0xEDEF	U+8343	# <cjk>	[2000]
+0xEDF0	U+8347	# <cjk>	[2000]
+0xEDF1	U+8351	# <cjk>	[2000]
+0xEDF2	U+8355	# <cjk>	[2000]
+0xEDF3	U+837D	# <cjk>	[2000]
+0xEDF4	U+8386	# <cjk>	[2000]
+0xEDF5	U+8392	# <cjk>	[2000]
+0xEDF6	U+8398	# <cjk>	[2000]
+0xEDF7	U+83A7	# <cjk>	[2000]
+0xEDF8	U+83A9	# <cjk>	[2000]
+0xEDF9	U+83BF	# <cjk>	[2000]
+0xEDFA	U+83C0	# <cjk>	[2000]
+0xEDFB	U+83C7	# <cjk>	[2000]
+0xEDFC	U+83CF	# <cjk>	[2000]
+0xEE40	U+83D1	# <cjk>	[2000]
+0xEE41	U+83E1	# <cjk>	[2000]
+0xEE42	U+83EA	# <cjk>	[2000]
+0xEE43	U+8401	# <cjk>	[2000]
+0xEE44	U+8406	# <cjk>	[2000]
+0xEE45	U+840A	# <cjk>	[2000]
+0xEE46	U+FA5F	# CJK COMPATIBILITY IDEOGRAPH-FA5F	[2000]	[Unicode3.2]
+0xEE47	U+8448	# <cjk>	[2000]
+0xEE48	U+845F	# <cjk>	[2000]
+0xEE49	U+8470	# <cjk>	[2000]
+0xEE4A	U+8473	# <cjk>	[2000]
+0xEE4B	U+8485	# <cjk>	[2000]
+0xEE4C	U+849E	# <cjk>	[2000]
+0xEE4D	U+84AF	# <cjk>	[2000]
+0xEE4E	U+84B4	# <cjk>	[2000]
+0xEE4F	U+84BA	# <cjk>	[2000]
+0xEE50	U+84C0	# <cjk>	[2000]
+0xEE51	U+84C2	# <cjk>	[2000]
+0xEE52	U+26E40	# <cjk>	[2000]	[Unicode3.1]
+0xEE53	U+8532	# <cjk>	[2000]
+0xEE54	U+851E	# <cjk>	[2000]
+0xEE55	U+8523	# <cjk>	[2000]
+0xEE56	U+852F	# <cjk>	[2000]
+0xEE57	U+8559	# <cjk>	[2000]
+0xEE58	U+8564	# <cjk>	[2000]
+0xEE59	U+FA1F	# CJK COMPATIBILITY IDEOGRAPH-FA1F 	[2000]
+0xEE5A	U+85AD	# <cjk>	[2000]
+0xEE5B	U+857A	# <cjk>	[2000]
+0xEE5C	U+858C	# <cjk>	[2000]
+0xEE5D	U+858F	# <cjk>	[2000]
+0xEE5E	U+85A2	# <cjk>	[2000]
+0xEE5F	U+85B0	# <cjk>	[2000]
+0xEE60	U+85CB	# <cjk>	[2000]
+0xEE61	U+85CE	# <cjk>	[2000]
+0xEE62	U+85ED	# <cjk>	[2000]
+0xEE63	U+8612	# <cjk>	[2000]
+0xEE64	U+85FF	# <cjk>	[2000]
+0xEE65	U+8604	# <cjk>	[2000]
+0xEE66	U+8605	# <cjk>	[2000]
+0xEE67	U+8610	# <cjk>	[2000]
+0xEE68	U+270F4	# <cjk>	[2000]	[Unicode3.1]
+0xEE69	U+8618	# <cjk>	[2000]
+0xEE6A	U+8629	# <cjk>	[2000]
+0xEE6B	U+8638	# <cjk>	[2000]
+0xEE6C	U+8657	# <cjk>	[2000]
+0xEE6D	U+865B	# <cjk>	[2000]
+0xEE6E	U+F936	# CJK COMPATIBILITY IDEOGRAPH-F936	[2000]
+0xEE6F	U+8662	# <cjk>	[2000]
+0xEE70	U+459D	# <cjk>	[2000]
+0xEE71	U+866C	# <cjk>	[2000]
+0xEE72	U+8675	# <cjk>	[2000]
+0xEE73	U+8698	# <cjk>	[2000]
+0xEE74	U+86B8	# <cjk>	[2000]
+0xEE75	U+86FA	# <cjk>	[2000]
+0xEE76	U+86FC	# <cjk>	[2000]
+0xEE77	U+86FD	# <cjk>	[2000]
+0xEE78	U+870B	# <cjk>	[2000]
+0xEE79	U+8771	# <cjk>	[2000]
+0xEE7A	U+8787	# <cjk>	[2000]
+0xEE7B	U+8788	# <cjk>	[2000]
+0xEE7C	U+87AC	# <cjk>	[2000]
+0xEE7D	U+87AD	# <cjk>	[2000]
+0xEE7E	U+87B5	# <cjk>	[2000]
+0xEE80	U+45EA	# <cjk>	[2000]
+0xEE81	U+87D6	# <cjk>	[2000]
+0xEE82	U+87EC	# <cjk>	[2000]
+0xEE83	U+8806	# <cjk>	[2000]
+0xEE84	U+880A	# <cjk>	[2000]
+0xEE85	U+8810	# <cjk>	[2000]
+0xEE86	U+8814	# <cjk>	[2000]
+0xEE87	U+881F	# <cjk>	[2000]
+0xEE88	U+8898	# <cjk>	[2000]
+0xEE89	U+88AA	# <cjk>	[2000]
+0xEE8A	U+88CA	# <cjk>	[2000]
+0xEE8B	U+88CE	# <cjk>	[2000]
+0xEE8C	U+27684	# <cjk>	[2000]	[Unicode3.1]
+0xEE8D	U+88F5	# <cjk>	[2000]
+0xEE8E	U+891C	# <cjk>	[2000]
+0xEE8F	U+FA60	# CJK COMPATIBILITY IDEOGRAPH-FA60	[2000]	[Unicode3.2]
+0xEE90	U+8918	# <cjk>	[2000]
+0xEE91	U+8919	# <cjk>	[2000]
+0xEE92	U+891A	# <cjk>	[2000]
+0xEE93	U+8927	# <cjk>	[2000]
+0xEE94	U+8930	# <cjk>	[2000]
+0xEE95	U+8932	# <cjk>	[2000]
+0xEE96	U+8939	# <cjk>	[2000]
+0xEE97	U+8940	# <cjk>	[2000]
+0xEE98	U+8994	# <cjk>	[2000]
+0xEE99	U+FA61	# CJK COMPATIBILITY IDEOGRAPH-FA61	[2000]	[Unicode3.2]
+0xEE9A	U+89D4	# <cjk>	[2000]
+0xEE9B	U+89E5	# <cjk>	[2000]
+0xEE9C	U+89F6	# <cjk>	[2000]
+0xEE9D	U+8A12	# <cjk>	[2000]
+0xEE9E	U+8A15	# <cjk>	[2000]
+0xEE9F	U+8A22	# <cjk>	[2000]
+0xEEA0	U+8A37	# <cjk>	[2000]
+0xEEA1	U+8A47	# <cjk>	[2000]
+0xEEA2	U+8A4E	# <cjk>	[2000]
+0xEEA3	U+8A5D	# <cjk>	[2000]
+0xEEA4	U+8A61	# <cjk>	[2000]
+0xEEA5	U+8A75	# <cjk>	[2000]
+0xEEA6	U+8A79	# <cjk>	[2000]
+0xEEA7	U+8AA7	# <cjk>	[2000]
+0xEEA8	U+8AD0	# <cjk>	[2000]
+0xEEA9	U+8ADF	# <cjk>	[2000]
+0xEEAA	U+8AF4	# <cjk>	[2000]
+0xEEAB	U+8AF6	# <cjk>	[2000]
+0xEEAC	U+FA22	# CJK COMPATIBILITY IDEOGRAPH-FA22	[2000]
+0xEEAD	U+FA62	# CJK COMPATIBILITY IDEOGRAPH-FA62	[2000]	[Unicode3.2]
+0xEEAE	U+FA63	# CJK COMPATIBILITY IDEOGRAPH-FA63	[2000]	[Unicode3.2]
+0xEEAF	U+8B46	# <cjk>	[2000]
+0xEEB0	U+8B54	# <cjk>	[2000]
+0xEEB1	U+8B59	# <cjk>	[2000]
+0xEEB2	U+8B69	# <cjk>	[2000]
+0xEEB3	U+8B9D	# <cjk>	[2000]
+0xEEB4	U+8C49	# <cjk>	[2000]
+0xEEB5	U+8C68	# <cjk>	[2000]
+0xEEB6	U+FA64	# CJK COMPATIBILITY IDEOGRAPH-FA64	[2000]	[Unicode3.2]
+0xEEB7	U+8CE1	# <cjk>	[2000]
+0xEEB8	U+8CF4	# <cjk>	[2000]
+0xEEB9	U+8CF8	# <cjk>	[2000]
+0xEEBA	U+8CFE	# <cjk>	[2000]
+0xEEBB	U+FA65	# CJK COMPATIBILITY IDEOGRAPH-FA65	[2000]	[Unicode3.2]
+0xEEBC	U+8D12	# <cjk>	[2000]
+0xEEBD	U+8D1B	# <cjk>	[2000]
+0xEEBE	U+8DAF	# <cjk>	[2000]
+0xEEBF	U+8DCE	# <cjk>	[2000]
+0xEEC0	U+8DD1	# <cjk>	[2000]
+0xEEC1	U+8DD7	# <cjk>	[2000]
+0xEEC2	U+8E20	# <cjk>	[2000]
+0xEEC3	U+8E23	# <cjk>	[2000]
+0xEEC4	U+8E3D	# <cjk>	[2000]
+0xEEC5	U+8E70	# <cjk>	[2000]
+0xEEC6	U+8E7B	# <cjk>	[2000]
+0xEEC7	U+28277	# <cjk>	[2000]	[Unicode3.1]
+0xEEC8	U+8EC0	# <cjk>	[2000]
+0xEEC9	U+4844	# <cjk>	[2000]
+0xEECA	U+8EFA	# <cjk>	[2000]
+0xEECB	U+8F1E	# <cjk>	[2000]
+0xEECC	U+8F2D	# <cjk>	[2000]
+0xEECD	U+8F36	# <cjk>	[2000]
+0xEECE	U+8F54	# <cjk>	[2000]
+0xEECF	U+283CD	# <cjk>	[2000]	[Unicode3.1]
+0xEED0	U+8FA6	# <cjk>	[2000]
+0xEED1	U+8FB5	# <cjk>	[2000]
+0xEED2	U+8FE4	# <cjk>	[2000]
+0xEED3	U+8FE8	# <cjk>	[2000]
+0xEED4	U+8FEE	# <cjk>	[2000]
+0xEED5	U+9008	# <cjk>	[2000]
+0xEED6	U+902D	# <cjk>	[2000]
+0xEED7	U+FA67	# CJK COMPATIBILITY IDEOGRAPH-FA67	[2000]	[Unicode3.2]
+0xEED8	U+9088	# <cjk>	[2000]
+0xEED9	U+9095	# <cjk>	[2000]
+0xEEDA	U+9097	# <cjk>	[2000]
+0xEEDB	U+9099	# <cjk>	[2000]
+0xEEDC	U+909B	# <cjk>	[2000]
+0xEEDD	U+90A2	# <cjk>	[2000]
+0xEEDE	U+90B3	# <cjk>	[2000]
+0xEEDF	U+90BE	# <cjk>	[2000]
+0xEEE0	U+90C4	# <cjk>	[2000]
+0xEEE1	U+90C5	# <cjk>	[2000]
+0xEEE2	U+90C7	# <cjk>	[2000]
+0xEEE3	U+90D7	# <cjk>	[2000]
+0xEEE4	U+90DD	# <cjk>	[2000]
+0xEEE5	U+90DE	# <cjk>	[2000]
+0xEEE6	U+90EF	# <cjk>	[2000]
+0xEEE7	U+90F4	# <cjk>	[2000]
+0xEEE8	U+FA26	# CJK COMPATIBILITY IDEOGRAPH-FA26	[2000]
+0xEEE9	U+9114	# <cjk>	[2000]
+0xEEEA	U+9115	# <cjk>	[2000]
+0xEEEB	U+9116	# <cjk>	[2000]
+0xEEEC	U+9122	# <cjk>	[2000]
+0xEEED	U+9123	# <cjk>	[2000]
+0xEEEE	U+9127	# <cjk>	[2000]
+0xEEEF	U+912F	# <cjk>	[2000]
+0xEEF0	U+9131	# <cjk>	[2000]
+0xEEF1	U+9134	# <cjk>	[2000]
+0xEEF2	U+913D	# <cjk>	[2000]
+0xEEF3	U+9148	# <cjk>	[2000]
+0xEEF4	U+915B	# <cjk>	[2000]
+0xEEF5	U+9183	# <cjk>	[2000]
+0xEEF6	U+919E	# <cjk>	[2000]
+0xEEF7	U+91AC	# <cjk>	[2000]
+0xEEF8	U+91B1	# <cjk>	[2000]
+0xEEF9	U+91BC	# <cjk>	[2000]
+0xEEFA	U+91D7	# <cjk>	[2000]
+0xEEFB	U+91FB	# <cjk>	[2000]
+0xEEFC	U+91E4	# <cjk>	[2000]
+0xEF40	U+91E5	# <cjk>	[2000]
+0xEF41	U+91ED	# <cjk>	[2000]
+0xEF42	U+91F1	# <cjk>	[2000]
+0xEF43	U+9207	# <cjk>	[2000]
+0xEF44	U+9210	# <cjk>	[2000]
+0xEF45	U+9238	# <cjk>	[2000]
+0xEF46	U+9239	# <cjk>	[2000]
+0xEF47	U+923A	# <cjk>	[2000]
+0xEF48	U+923C	# <cjk>	[2000]
+0xEF49	U+9240	# <cjk>	[2000]
+0xEF4A	U+9243	# <cjk>	[2000]
+0xEF4B	U+924F	# <cjk>	[2000]
+0xEF4C	U+9278	# <cjk>	[2000]
+0xEF4D	U+9288	# <cjk>	[2000]
+0xEF4E	U+92C2	# <cjk>	[2000]
+0xEF4F	U+92CB	# <cjk>	[2000]
+0xEF50	U+92CC	# <cjk>	[2000]
+0xEF51	U+92D3	# <cjk>	[2000]
+0xEF52	U+92E0	# <cjk>	[2000]
+0xEF53	U+92FF	# <cjk>	[2000]
+0xEF54	U+9304	# <cjk>	[2000]
+0xEF55	U+931F	# <cjk>	[2000]
+0xEF56	U+9321	# <cjk>	[2000]
+0xEF57	U+9325	# <cjk>	[2000]
+0xEF58	U+9348	# <cjk>	[2000]
+0xEF59	U+9349	# <cjk>	[2000]
+0xEF5A	U+934A	# <cjk>	[2000]
+0xEF5B	U+9364	# <cjk>	[2000]
+0xEF5C	U+9365	# <cjk>	[2000]
+0xEF5D	U+936A	# <cjk>	[2000]
+0xEF5E	U+9370	# <cjk>	[2000]
+0xEF5F	U+939B	# <cjk>	[2000]
+0xEF60	U+93A3	# <cjk>	[2000]
+0xEF61	U+93BA	# <cjk>	[2000]
+0xEF62	U+93C6	# <cjk>	[2000]
+0xEF63	U+93DE	# <cjk>	[2000]
+0xEF64	U+93DF	# <cjk>	[2000]
+0xEF65	U+9404	# <cjk>	[2000]
+0xEF66	U+93FD	# <cjk>	[2000]
+0xEF67	U+9433	# <cjk>	[2000]
+0xEF68	U+944A	# <cjk>	[2000]
+0xEF69	U+9463	# <cjk>	[2000]
+0xEF6A	U+946B	# <cjk>	[2000]
+0xEF6B	U+9471	# <cjk>	[2000]
+0xEF6C	U+9472	# <cjk>	[2000]
+0xEF6D	U+958E	# <cjk>	[2000]
+0xEF6E	U+959F	# <cjk>	[2000]
+0xEF6F	U+95A6	# <cjk>	[2000]
+0xEF70	U+95A9	# <cjk>	[2000]
+0xEF71	U+95AC	# <cjk>	[2000]
+0xEF72	U+95B6	# <cjk>	[2000]
+0xEF73	U+95BD	# <cjk>	[2000]
+0xEF74	U+95CB	# <cjk>	[2000]
+0xEF75	U+95D0	# <cjk>	[2000]
+0xEF76	U+95D3	# <cjk>	[2000]
+0xEF77	U+49B0	# <cjk>	[2000]
+0xEF78	U+95DA	# <cjk>	[2000]
+0xEF79	U+95DE	# <cjk>	[2000]
+0xEF7A	U+9658	# <cjk>	[2000]
+0xEF7B	U+9684	# <cjk>	[2000]
+0xEF7C	U+F9DC	# CJK COMPATIBILITY IDEOGRAPH-F9DC	[2000]
+0xEF7D	U+969D	# <cjk>	[2000]
+0xEF7E	U+96A4	# <cjk>	[2000]
+0xEF80	U+96A5	# <cjk>	[2000]
+0xEF81	U+96D2	# <cjk>	[2000]
+0xEF82	U+96DE	# <cjk>	[2000]
+0xEF83	U+FA68	# CJK COMPATIBILITY IDEOGRAPH-FA68	[2000]	[Unicode3.2]
+0xEF84	U+96E9	# <cjk>	[2000]
+0xEF85	U+96EF	# <cjk>	[2000]
+0xEF86	U+9733	# <cjk>	[2000]
+0xEF87	U+973B	# <cjk>	[2000]
+0xEF88	U+974D	# <cjk>	[2000]
+0xEF89	U+974E	# <cjk>	[2000]
+0xEF8A	U+974F	# <cjk>	[2000]
+0xEF8B	U+975A	# <cjk>	[2000]
+0xEF8C	U+976E	# <cjk>	[2000]
+0xEF8D	U+9773	# <cjk>	[2000]
+0xEF8E	U+9795	# <cjk>	[2000]
+0xEF8F	U+97AE	# <cjk>	[2000]
+0xEF90	U+97BA	# <cjk>	[2000]
+0xEF91	U+97C1	# <cjk>	[2000]
+0xEF92	U+97C9	# <cjk>	[2000]
+0xEF93	U+97DE	# <cjk>	[2000]
+0xEF94	U+97DB	# <cjk>	[2000]
+0xEF95	U+97F4	# <cjk>	[2000]
+0xEF96	U+FA69	# CJK COMPATIBILITY IDEOGRAPH-FA69	[2000]	[Unicode3.2]
+0xEF97	U+980A	# <cjk>	[2000]
+0xEF98	U+981E	# <cjk>	[2000]
+0xEF99	U+982B	# <cjk>	[2000]
+0xEF9A	U+9830	# <cjk>	[2000]
+0xEF9B	U+FA6A	# CJK COMPATIBILITY IDEOGRAPH-FA6A	[2000]	[Unicode3.2]
+0xEF9C	U+9852	# <cjk>	[2000]
+0xEF9D	U+9853	# <cjk>	[2000]
+0xEF9E	U+9856	# <cjk>	[2000]
+0xEF9F	U+9857	# <cjk>	[2000]
+0xEFA0	U+9859	# <cjk>	[2000]
+0xEFA1	U+985A	# <cjk>	[2000]
+0xEFA2	U+F9D0	# CJK COMPATIBILITY IDEOGRAPH-F9D0	[2000]
+0xEFA3	U+9865	# <cjk>	[2000]
+0xEFA4	U+986C	# <cjk>	[2000]
+0xEFA5	U+98BA	# <cjk>	[2000]
+0xEFA6	U+98C8	# <cjk>	[2000]
+0xEFA7	U+98E7	# <cjk>	[2000]
+0xEFA8	U+9958	# <cjk>	[2000]
+0xEFA9	U+999E	# <cjk>	[2000]
+0xEFAA	U+9A02	# <cjk>	[2000]
+0xEFAB	U+9A03	# <cjk>	[2000]
+0xEFAC	U+9A24	# <cjk>	[2000]
+0xEFAD	U+9A2D	# <cjk>	[2000]
+0xEFAE	U+9A2E	# <cjk>	[2000]
+0xEFAF	U+9A38	# <cjk>	[2000]
+0xEFB0	U+9A4A	# <cjk>	[2000]
+0xEFB1	U+9A4E	# <cjk>	[2000]
+0xEFB2	U+9A52	# <cjk>	[2000]
+0xEFB3	U+9AB6	# <cjk>	[2000]
+0xEFB4	U+9AC1	# <cjk>	[2000]
+0xEFB5	U+9AC3	# <cjk>	[2000]
+0xEFB6	U+9ACE	# <cjk>	[2000]
+0xEFB7	U+9AD6	# <cjk>	[2000]
+0xEFB8	U+9AF9	# <cjk>	[2000]
+0xEFB9	U+9B02	# <cjk>	[2000]
+0xEFBA	U+9B08	# <cjk>	[2000]
+0xEFBB	U+9B20	# <cjk>	[2000]
+0xEFBC	U+4C17	# <cjk>	[2000]
+0xEFBD	U+9B2D	# <cjk>	[2000]
+0xEFBE	U+9B5E	# <cjk>	[2000]
+0xEFBF	U+9B79	# <cjk>	[2000]
+0xEFC0	U+9B66	# <cjk>	[2000]
+0xEFC1	U+9B72	# <cjk>	[2000]
+0xEFC2	U+9B75	# <cjk>	[2000]
+0xEFC3	U+9B84	# <cjk>	[2000]
+0xEFC4	U+9B8A	# <cjk>	[2000]
+0xEFC5	U+9B8F	# <cjk>	[2000]
+0xEFC6	U+9B9E	# <cjk>	[2000]
+0xEFC7	U+9BA7	# <cjk>	[2000]
+0xEFC8	U+9BC1	# <cjk>	[2000]
+0xEFC9	U+9BCE	# <cjk>	[2000]
+0xEFCA	U+9BE5	# <cjk>	[2000]
+0xEFCB	U+9BF8	# <cjk>	[2000]
+0xEFCC	U+9BFD	# <cjk>	[2000]
+0xEFCD	U+9C00	# <cjk>	[2000]
+0xEFCE	U+9C23	# <cjk>	[2000]
+0xEFCF	U+9C41	# <cjk>	[2000]
+0xEFD0	U+9C4F	# <cjk>	[2000]
+0xEFD1	U+9C50	# <cjk>	[2000]
+0xEFD2	U+9C53	# <cjk>	[2000]
+0xEFD3	U+9C63	# <cjk>	[2000]
+0xEFD4	U+9C65	# <cjk>	[2000]
+0xEFD5	U+9C77	# <cjk>	[2000]
+0xEFD6	U+9D1D	# <cjk>	[2000]
+0xEFD7	U+9D1E	# <cjk>	[2000]
+0xEFD8	U+9D43	# <cjk>	[2000]
+0xEFD9	U+9D47	# <cjk>	[2000]
+0xEFDA	U+9D52	# <cjk>	[2000]
+0xEFDB	U+9D63	# <cjk>	[2000]
+0xEFDC	U+9D70	# <cjk>	[2000]
+0xEFDD	U+9D7C	# <cjk>	[2000]
+0xEFDE	U+9D8A	# <cjk>	[2000]
+0xEFDF	U+9D96	# <cjk>	[2000]
+0xEFE0	U+9DC0	# <cjk>	[2000]
+0xEFE1	U+9DAC	# <cjk>	[2000]
+0xEFE2	U+9DBC	# <cjk>	[2000]
+0xEFE3	U+9DD7	# <cjk>	[2000]
+0xEFE4	U+2A190	# <cjk>	[2000]	[Unicode3.1]
+0xEFE5	U+9DE7	# <cjk>	[2000]
+0xEFE6	U+9E07	# <cjk>	[2000]
+0xEFE7	U+9E15	# <cjk>	[2000]
+0xEFE8	U+9E7C	# <cjk>	[2000]
+0xEFE9	U+9E9E	# <cjk>	[2000]
+0xEFEA	U+9EA4	# <cjk>	[2000]
+0xEFEB	U+9EAC	# <cjk>	[2000]
+0xEFEC	U+9EAF	# <cjk>	[2000]
+0xEFED	U+9EB4	# <cjk>	[2000]
+0xEFEE	U+9EB5	# <cjk>	[2000]
+0xEFEF	U+9EC3	# <cjk>	[2000]
+0xEFF0	U+9ED1	# <cjk>	[2000]
+0xEFF1	U+9F10	# <cjk>	[2000]
+0xEFF2	U+9F39	# <cjk>	[2000]
+0xEFF3	U+9F57	# <cjk>	[2000]
+0xEFF4	U+9F90	# <cjk>	[2000]
+0xEFF5	U+9F94	# <cjk>	[2000]
+0xEFF6	U+9F97	# <cjk>	[2000]
+0xEFF7	U+9FA2	# <cjk>	[2000]
+0xEFF8	U+59F8	# <cjk>	[2004]
+0xEFF9	U+5C5B	# <cjk>	[2004]
+0xEFFA	U+5E77	# <cjk>	[2004]
+0xEFFB	U+7626	# <cjk>	[2004]
+0xEFFC	U+7E6B	# <cjk>	[2004]
+0xF040	U+20089	# <cjk>	[2000]	[Unicode3.1]
+0xF041	U+4E02	# <cjk>	[2000]
+0xF042	U+4E0F	# <cjk>	[2000]
+0xF043	U+4E12	# <cjk>	[2000]
+0xF044	U+4E29	# <cjk>	[2000]
+0xF045	U+4E2B	# <cjk>	[2000]
+0xF046	U+4E2E	# <cjk>	[2000]
+0xF047	U+4E40	# <cjk>	[2000]
+0xF048	U+4E47	# <cjk>	[2000]
+0xF049	U+4E48	# <cjk>	[2000]
+0xF04A	U+200A2	# <cjk>	[2000]	[Unicode3.1]
+0xF04B	U+4E51	# <cjk>	[2000]
+0xF04C	U+3406	# <cjk>	[2000]
+0xF04D	U+200A4	# <cjk>	[2000]	[Unicode3.1]
+0xF04E	U+4E5A	# <cjk>	[2000]
+0xF04F	U+4E69	# <cjk>	[2000]
+0xF050	U+4E9D	# <cjk>	[2000]
+0xF051	U+342C	# <cjk>	[2000]
+0xF052	U+342E	# <cjk>	[2000]
+0xF053	U+4EB9	# <cjk>	[2000]
+0xF054	U+4EBB	# <cjk>	[2000]
+0xF055	U+201A2	# <cjk>	[2000]	[Unicode3.1]
+0xF056	U+4EBC	# <cjk>	[2000]
+0xF057	U+4EC3	# <cjk>	[2000]
+0xF058	U+4EC8	# <cjk>	[2000]
+0xF059	U+4ED0	# <cjk>	[2000]
+0xF05A	U+4EEB	# <cjk>	[2000]
+0xF05B	U+4EDA	# <cjk>	[2000]
+0xF05C	U+4EF1	# <cjk>	[2000]
+0xF05D	U+4EF5	# <cjk>	[2000]
+0xF05E	U+4F00	# <cjk>	[2000]
+0xF05F	U+4F16	# <cjk>	[2000]
+0xF060	U+4F64	# <cjk>	[2000]
+0xF061	U+4F37	# <cjk>	[2000]
+0xF062	U+4F3E	# <cjk>	[2000]
+0xF063	U+4F54	# <cjk>	[2000]
+0xF064	U+4F58	# <cjk>	[2000]
+0xF065	U+20213	# <cjk>	[2000]	[Unicode3.1]
+0xF066	U+4F77	# <cjk>	[2000]
+0xF067	U+4F78	# <cjk>	[2000]
+0xF068	U+4F7A	# <cjk>	[2000]
+0xF069	U+4F7D	# <cjk>	[2000]
+0xF06A	U+4F82	# <cjk>	[2000]
+0xF06B	U+4F85	# <cjk>	[2000]
+0xF06C	U+4F92	# <cjk>	[2000]
+0xF06D	U+4F9A	# <cjk>	[2000]
+0xF06E	U+4FE6	# <cjk>	[2000]
+0xF06F	U+4FB2	# <cjk>	[2000]
+0xF070	U+4FBE	# <cjk>	[2000]
+0xF071	U+4FC5	# <cjk>	[2000]
+0xF072	U+4FCB	# <cjk>	[2000]
+0xF073	U+4FCF	# <cjk>	[2000]
+0xF074	U+4FD2	# <cjk>	[2000]
+0xF075	U+346A	# <cjk>	[2000]
+0xF076	U+4FF2	# <cjk>	[2000]
+0xF077	U+5000	# <cjk>	[2000]
+0xF078	U+5010	# <cjk>	[2000]
+0xF079	U+5013	# <cjk>	[2000]
+0xF07A	U+501C	# <cjk>	[2000]
+0xF07B	U+501E	# <cjk>	[2000]
+0xF07C	U+5022	# <cjk>	[2000]
+0xF07D	U+3468	# <cjk>	[2000]
+0xF07E	U+5042	# <cjk>	[2000]
+0xF080	U+5046	# <cjk>	[2000]
+0xF081	U+504E	# <cjk>	[2000]
+0xF082	U+5053	# <cjk>	[2000]
+0xF083	U+5057	# <cjk>	[2000]
+0xF084	U+5063	# <cjk>	[2000]
+0xF085	U+5066	# <cjk>	[2000]
+0xF086	U+506A	# <cjk>	[2000]
+0xF087	U+5070	# <cjk>	[2000]
+0xF088	U+50A3	# <cjk>	[2000]
+0xF089	U+5088	# <cjk>	[2000]
+0xF08A	U+5092	# <cjk>	[2000]
+0xF08B	U+5093	# <cjk>	[2000]
+0xF08C	U+5095	# <cjk>	[2000]
+0xF08D	U+5096	# <cjk>	[2000]
+0xF08E	U+509C	# <cjk>	[2000]
+0xF08F	U+50AA	# <cjk>	[2000]
+0xF090	U+2032B	# <cjk>	[2000]	[Unicode3.1]
+0xF091	U+50B1	# <cjk>	[2000]
+0xF092	U+50BA	# <cjk>	[2000]
+0xF093	U+50BB	# <cjk>	[2000]
+0xF094	U+50C4	# <cjk>	[2000]
+0xF095	U+50C7	# <cjk>	[2000]
+0xF096	U+50F3	# <cjk>	[2000]
+0xF097	U+20381	# <cjk>	[2000]	[Unicode3.1]
+0xF098	U+50CE	# <cjk>	[2000]
+0xF099	U+20371	# <cjk>	[2000]	[Unicode3.1]
+0xF09A	U+50D4	# <cjk>	[2000]
+0xF09B	U+50D9	# <cjk>	[2000]
+0xF09C	U+50E1	# <cjk>	[2000]
+0xF09D	U+50E9	# <cjk>	[2000]
+0xF09E	U+3492	# <cjk>	[2000]
+0xF09F	U+5B96	# <cjk>	[2000]
+0xF0A0	U+5BAC	# <cjk>	[2000]
+0xF0A1	U+3761	# <cjk>	[2000]
+0xF0A2	U+5BC0	# <cjk>	[2000]
+0xF0A3	U+3762	# <cjk>	[2000]
+0xF0A4	U+5BCE	# <cjk>	[2000]
+0xF0A5	U+5BD6	# <cjk>	[2000]
+0xF0A6	U+376C	# <cjk>	[2000]
+0xF0A7	U+376B	# <cjk>	[2000]
+0xF0A8	U+5BF1	# <cjk>	[2000]
+0xF0A9	U+5BFD	# <cjk>	[2000]
+0xF0AA	U+3775	# <cjk>	[2000]
+0xF0AB	U+5C03	# <cjk>	[2000]
+0xF0AC	U+5C29	# <cjk>	[2000]
+0xF0AD	U+5C30	# <cjk>	[2000]
+0xF0AE	U+21C56	# <cjk>	[2000]	[Unicode3.1]
+0xF0AF	U+5C5F	# <cjk>	[2000]
+0xF0B0	U+5C63	# <cjk>	[2000]
+0xF0B1	U+5C67	# <cjk>	[2000]
+0xF0B2	U+5C68	# <cjk>	[2000]
+0xF0B3	U+5C69	# <cjk>	[2000]
+0xF0B4	U+5C70	# <cjk>	[2000]
+0xF0B5	U+21D2D	# <cjk>	[2000]	[Unicode3.1]
+0xF0B6	U+21D45	# <cjk>	[2000]	[Unicode3.1]
+0xF0B7	U+5C7C	# <cjk>	[2000]
+0xF0B8	U+21D78	# <cjk>	[2000]	[Unicode3.1]
+0xF0B9	U+21D62	# <cjk>	[2000]	[Unicode3.1]
+0xF0BA	U+5C88	# <cjk>	[2000]
+0xF0BB	U+5C8A	# <cjk>	[2000]
+0xF0BC	U+37C1	# <cjk>	[2000]
+0xF0BD	U+21DA1	# <cjk>	[2000]	[Unicode3.1]
+0xF0BE	U+21D9C	# <cjk>	[2000]	[Unicode3.1]
+0xF0BF	U+5CA0	# <cjk>	[2000]
+0xF0C0	U+5CA2	# <cjk>	[2000]
+0xF0C1	U+5CA6	# <cjk>	[2000]
+0xF0C2	U+5CA7	# <cjk>	[2000]
+0xF0C3	U+21D92	# <cjk>	[2000]	[Unicode3.1]
+0xF0C4	U+5CAD	# <cjk>	[2000]
+0xF0C5	U+5CB5	# <cjk>	[2000]
+0xF0C6	U+21DB7	# <cjk>	[2000]	[Unicode3.1]
+0xF0C7	U+5CC9	# <cjk>	[2000]
+0xF0C8	U+21DE0	# <cjk>	[2000]	[Unicode3.1]
+0xF0C9	U+21E33	# <cjk>	[2000]	[Unicode3.1]
+0xF0CA	U+5D06	# <cjk>	[2000]
+0xF0CB	U+5D10	# <cjk>	[2000]
+0xF0CC	U+5D2B	# <cjk>	[2000]
+0xF0CD	U+5D1D	# <cjk>	[2000]
+0xF0CE	U+5D20	# <cjk>	[2000]
+0xF0CF	U+5D24	# <cjk>	[2000]
+0xF0D0	U+5D26	# <cjk>	[2000]
+0xF0D1	U+5D31	# <cjk>	[2000]
+0xF0D2	U+5D39	# <cjk>	[2000]
+0xF0D3	U+5D42	# <cjk>	[2000]
+0xF0D4	U+37E8	# <cjk>	[2000]
+0xF0D5	U+5D61	# <cjk>	[2000]
+0xF0D6	U+5D6A	# <cjk>	[2000]
+0xF0D7	U+37F4	# <cjk>	[2000]
+0xF0D8	U+5D70	# <cjk>	[2000]
+0xF0D9	U+21F1E	# <cjk>	[2000]	[Unicode3.1]
+0xF0DA	U+37FD	# <cjk>	[2000]
+0xF0DB	U+5D88	# <cjk>	[2000]
+0xF0DC	U+3800	# <cjk>	[2000]
+0xF0DD	U+5D92	# <cjk>	[2000]
+0xF0DE	U+5D94	# <cjk>	[2000]
+0xF0DF	U+5D97	# <cjk>	[2000]
+0xF0E0	U+5D99	# <cjk>	[2000]
+0xF0E1	U+5DB0	# <cjk>	[2000]
+0xF0E2	U+5DB2	# <cjk>	[2000]
+0xF0E3	U+5DB4	# <cjk>	[2000]
+0xF0E4	U+21F76	# <cjk>	[2000]	[Unicode3.1]
+0xF0E5	U+5DB9	# <cjk>	[2000]
+0xF0E6	U+5DD1	# <cjk>	[2000]
+0xF0E7	U+5DD7	# <cjk>	[2000]
+0xF0E8	U+5DD8	# <cjk>	[2000]
+0xF0E9	U+5DE0	# <cjk>	[2000]
+0xF0EA	U+21FFA	# <cjk>	[2000]	[Unicode3.1]
+0xF0EB	U+5DE4	# <cjk>	[2000]
+0xF0EC	U+5DE9	# <cjk>	[2000]
+0xF0ED	U+382F	# <cjk>	[2000]
+0xF0EE	U+5E00	# <cjk>	[2000]
+0xF0EF	U+3836	# <cjk>	[2000]
+0xF0F0	U+5E12	# <cjk>	[2000]
+0xF0F1	U+5E15	# <cjk>	[2000]
+0xF0F2	U+3840	# <cjk>	[2000]
+0xF0F3	U+5E1F	# <cjk>	[2000]
+0xF0F4	U+5E2E	# <cjk>	[2000]
+0xF0F5	U+5E3E	# <cjk>	[2000]
+0xF0F6	U+5E49	# <cjk>	[2000]
+0xF0F7	U+385C	# <cjk>	[2000]
+0xF0F8	U+5E56	# <cjk>	[2000]
+0xF0F9	U+3861	# <cjk>	[2000]
+0xF0FA	U+5E6B	# <cjk>	[2000]
+0xF0FB	U+5E6C	# <cjk>	[2000]
+0xF0FC	U+5E6D	# <cjk>	[2000]
+0xF140	U+5108	# <cjk>	[2000]
+0xF141	U+203F9	# <cjk>	[2000]	[Unicode3.1]
+0xF142	U+5117	# <cjk>	[2000]
+0xF143	U+511B	# <cjk>	[2000]
+0xF144	U+2044A	# <cjk>	[2000]	[Unicode3.1]
+0xF145	U+5160	# <cjk>	[2000]
+0xF146	U+20509	# <cjk>	[2000]	[Unicode3.1]
+0xF147	U+5173	# <cjk>	[2000]
+0xF148	U+5183	# <cjk>	[2000]
+0xF149	U+518B	# <cjk>	[2000]
+0xF14A	U+34BC	# <cjk>	[2000]
+0xF14B	U+5198	# <cjk>	[2000]
+0xF14C	U+51A3	# <cjk>	[2000]
+0xF14D	U+51AD	# <cjk>	[2000]
+0xF14E	U+34C7	# <cjk>	[2000]
+0xF14F	U+51BC	# <cjk>	[2000]
+0xF150	U+205D6	# <cjk>	[2000]	[Unicode3.1]
+0xF151	U+20628	# <cjk>	[2000]	[Unicode3.1]
+0xF152	U+51F3	# <cjk>	[2000]
+0xF153	U+51F4	# <cjk>	[2000]
+0xF154	U+5202	# <cjk>	[2000]
+0xF155	U+5212	# <cjk>	[2000]
+0xF156	U+5216	# <cjk>	[2000]
+0xF157	U+2074F	# <cjk>	[2000]	[Unicode3.1]
+0xF158	U+5255	# <cjk>	[2000]
+0xF159	U+525C	# <cjk>	[2000]
+0xF15A	U+526C	# <cjk>	[2000]
+0xF15B	U+5277	# <cjk>	[2000]
+0xF15C	U+5284	# <cjk>	[2000]
+0xF15D	U+5282	# <cjk>	[2000]
+0xF15E	U+20807	# <cjk>	[2000]	[Unicode3.1]
+0xF15F	U+5298	# <cjk>	[2000]
+0xF160	U+2083A	# <cjk>	[2000]	[Unicode3.1]
+0xF161	U+52A4	# <cjk>	[2000]
+0xF162	U+52A6	# <cjk>	[2000]
+0xF163	U+52AF	# <cjk>	[2000]
+0xF164	U+52BA	# <cjk>	[2000]
+0xF165	U+52BB	# <cjk>	[2000]
+0xF166	U+52CA	# <cjk>	[2000]
+0xF167	U+351F	# <cjk>	[2000]
+0xF168	U+52D1	# <cjk>	[2000]
+0xF169	U+208B9	# <cjk>	[2000]	[Unicode3.1]
+0xF16A	U+52F7	# <cjk>	[2000]
+0xF16B	U+530A	# <cjk>	[2000]
+0xF16C	U+530B	# <cjk>	[2000]
+0xF16D	U+5324	# <cjk>	[2000]
+0xF16E	U+5335	# <cjk>	[2000]
+0xF16F	U+533E	# <cjk>	[2000]
+0xF170	U+5342	# <cjk>	[2000]
+0xF171	U+2097C	# <cjk>	[2000]	[Unicode3.1]
+0xF172	U+2099D	# <cjk>	[2000]	[Unicode3.1]
+0xF173	U+5367	# <cjk>	[2000]
+0xF174	U+536C	# <cjk>	[2000]
+0xF175	U+537A	# <cjk>	[2000]
+0xF176	U+53A4	# <cjk>	[2000]
+0xF177	U+53B4	# <cjk>	[2000]
+0xF178	U+20AD3	# <cjk>	[2000]	[Unicode3.1]
+0xF179	U+53B7	# <cjk>	[2000]
+0xF17A	U+53C0	# <cjk>	[2000]
+0xF17B	U+20B1D	# <cjk>	[2000]	[Unicode3.1]
+0xF17C	U+355D	# <cjk>	[2000]
+0xF17D	U+355E	# <cjk>	[2000]
+0xF17E	U+53D5	# <cjk>	[2000]
+0xF180	U+53DA	# <cjk>	[2000]
+0xF181	U+3563	# <cjk>	[2000]
+0xF182	U+53F4	# <cjk>	[2000]
+0xF183	U+53F5	# <cjk>	[2000]
+0xF184	U+5455	# <cjk>	[2000]
+0xF185	U+5424	# <cjk>	[2000]
+0xF186	U+5428	# <cjk>	[2000]
+0xF187	U+356E	# <cjk>	[2000]
+0xF188	U+5443	# <cjk>	[2000]
+0xF189	U+5462	# <cjk>	[2000]
+0xF18A	U+5466	# <cjk>	[2000]
+0xF18B	U+546C	# <cjk>	[2000]
+0xF18C	U+548A	# <cjk>	[2000]
+0xF18D	U+548D	# <cjk>	[2000]
+0xF18E	U+5495	# <cjk>	[2000]
+0xF18F	U+54A0	# <cjk>	[2000]
+0xF190	U+54A6	# <cjk>	[2000]
+0xF191	U+54AD	# <cjk>	[2000]
+0xF192	U+54AE	# <cjk>	[2000]
+0xF193	U+54B7	# <cjk>	[2000]
+0xF194	U+54BA	# <cjk>	[2000]
+0xF195	U+54BF	# <cjk>	[2000]
+0xF196	U+54C3	# <cjk>	[2000]
+0xF197	U+20D45	# <cjk>	[2000]	[Unicode3.1]
+0xF198	U+54EC	# <cjk>	[2000]
+0xF199	U+54EF	# <cjk>	[2000]
+0xF19A	U+54F1	# <cjk>	[2000]
+0xF19B	U+54F3	# <cjk>	[2000]
+0xF19C	U+5500	# <cjk>	[2000]
+0xF19D	U+5501	# <cjk>	[2000]
+0xF19E	U+5509	# <cjk>	[2000]
+0xF19F	U+553C	# <cjk>	[2000]
+0xF1A0	U+5541	# <cjk>	[2000]
+0xF1A1	U+35A6	# <cjk>	[2000]
+0xF1A2	U+5547	# <cjk>	[2000]
+0xF1A3	U+554A	# <cjk>	[2000]
+0xF1A4	U+35A8	# <cjk>	[2000]
+0xF1A5	U+5560	# <cjk>	[2000]
+0xF1A6	U+5561	# <cjk>	[2000]
+0xF1A7	U+5564	# <cjk>	[2000]
+0xF1A8	U+20DE1	# <cjk>	[2000]	[Unicode3.1]
+0xF1A9	U+557D	# <cjk>	[2000]
+0xF1AA	U+5582	# <cjk>	[2000]
+0xF1AB	U+5588	# <cjk>	[2000]
+0xF1AC	U+5591	# <cjk>	[2000]
+0xF1AD	U+35C5	# <cjk>	[2000]
+0xF1AE	U+55D2	# <cjk>	[2000]
+0xF1AF	U+20E95	# <cjk>	[2000]	[Unicode3.1]
+0xF1B0	U+20E6D	# <cjk>	[2000]	[Unicode3.1]
+0xF1B1	U+55BF	# <cjk>	[2000]
+0xF1B2	U+55C9	# <cjk>	[2000]
+0xF1B3	U+55CC	# <cjk>	[2000]
+0xF1B4	U+55D1	# <cjk>	[2000]
+0xF1B5	U+55DD	# <cjk>	[2000]
+0xF1B6	U+35DA	# <cjk>	[2000]
+0xF1B7	U+55E2	# <cjk>	[2000]
+0xF1B8	U+20E64	# <cjk>	[2000]	[Unicode3.1]
+0xF1B9	U+55E9	# <cjk>	[2000]
+0xF1BA	U+5628	# <cjk>	[2000]
+0xF1BB	U+20F5F	# <cjk>	[2000]	[Unicode3.1]
+0xF1BC	U+5607	# <cjk>	[2000]
+0xF1BD	U+5610	# <cjk>	[2000]
+0xF1BE	U+5630	# <cjk>	[2000]
+0xF1BF	U+5637	# <cjk>	[2000]
+0xF1C0	U+35F4	# <cjk>	[2000]
+0xF1C1	U+563D	# <cjk>	[2000]
+0xF1C2	U+563F	# <cjk>	[2000]
+0xF1C3	U+5640	# <cjk>	[2000]
+0xF1C4	U+5647	# <cjk>	[2000]
+0xF1C5	U+565E	# <cjk>	[2000]
+0xF1C6	U+5660	# <cjk>	[2000]
+0xF1C7	U+566D	# <cjk>	[2000]
+0xF1C8	U+3605	# <cjk>	[2000]
+0xF1C9	U+5688	# <cjk>	[2000]
+0xF1CA	U+568C	# <cjk>	[2000]
+0xF1CB	U+5695	# <cjk>	[2000]
+0xF1CC	U+569A	# <cjk>	[2000]
+0xF1CD	U+569D	# <cjk>	[2000]
+0xF1CE	U+56A8	# <cjk>	[2000]
+0xF1CF	U+56AD	# <cjk>	[2000]
+0xF1D0	U+56B2	# <cjk>	[2000]
+0xF1D1	U+56C5	# <cjk>	[2000]
+0xF1D2	U+56CD	# <cjk>	[2000]
+0xF1D3	U+56DF	# <cjk>	[2000]
+0xF1D4	U+56E8	# <cjk>	[2000]
+0xF1D5	U+56F6	# <cjk>	[2000]
+0xF1D6	U+56F7	# <cjk>	[2000]
+0xF1D7	U+21201	# <cjk>	[2000]	[Unicode3.1]
+0xF1D8	U+5715	# <cjk>	[2000]
+0xF1D9	U+5723	# <cjk>	[2000]
+0xF1DA	U+21255	# <cjk>	[2000]	[Unicode3.1]
+0xF1DB	U+5729	# <cjk>	[2000]
+0xF1DC	U+2127B	# <cjk>	[2000]	[Unicode3.1]
+0xF1DD	U+5745	# <cjk>	[2000]
+0xF1DE	U+5746	# <cjk>	[2000]
+0xF1DF	U+574C	# <cjk>	[2000]
+0xF1E0	U+574D	# <cjk>	[2000]
+0xF1E1	U+21274	# <cjk>	[2000]	[Unicode3.1]
+0xF1E2	U+5768	# <cjk>	[2000]
+0xF1E3	U+576F	# <cjk>	[2000]
+0xF1E4	U+5773	# <cjk>	[2000]
+0xF1E5	U+5774	# <cjk>	[2000]
+0xF1E6	U+5775	# <cjk>	[2000]
+0xF1E7	U+577B	# <cjk>	[2000]
+0xF1E8	U+212E4	# <cjk>	[2000]	[Unicode3.1]
+0xF1E9	U+212D7	# <cjk>	[2000]	[Unicode3.1]
+0xF1EA	U+57AC	# <cjk>	[2000]
+0xF1EB	U+579A	# <cjk>	[2000]
+0xF1EC	U+579D	# <cjk>	[2000]
+0xF1ED	U+579E	# <cjk>	[2000]
+0xF1EE	U+57A8	# <cjk>	[2000]
+0xF1EF	U+57D7	# <cjk>	[2000]
+0xF1F0	U+212FD	# <cjk>	[2000]	[Unicode3.1]
+0xF1F1	U+57CC	# <cjk>	[2000]
+0xF1F2	U+21336	# <cjk>	[2000]	[Unicode3.1]
+0xF1F3	U+21344	# <cjk>	[2000]	[Unicode3.1]
+0xF1F4	U+57DE	# <cjk>	[2000]
+0xF1F5	U+57E6	# <cjk>	[2000]
+0xF1F6	U+57F0	# <cjk>	[2000]
+0xF1F7	U+364A	# <cjk>	[2000]
+0xF1F8	U+57F8	# <cjk>	[2000]
+0xF1F9	U+57FB	# <cjk>	[2000]
+0xF1FA	U+57FD	# <cjk>	[2000]
+0xF1FB	U+5804	# <cjk>	[2000]
+0xF1FC	U+581E	# <cjk>	[2000]
+0xF240	U+5820	# <cjk>	[2000]
+0xF241	U+5827	# <cjk>	[2000]
+0xF242	U+5832	# <cjk>	[2000]
+0xF243	U+5839	# <cjk>	[2000]
+0xF244	U+213C4	# <cjk>	[2000]	[Unicode3.1]
+0xF245	U+5849	# <cjk>	[2000]
+0xF246	U+584C	# <cjk>	[2000]
+0xF247	U+5867	# <cjk>	[2000]
+0xF248	U+588A	# <cjk>	[2000]
+0xF249	U+588B	# <cjk>	[2000]
+0xF24A	U+588D	# <cjk>	[2000]
+0xF24B	U+588F	# <cjk>	[2000]
+0xF24C	U+5890	# <cjk>	[2000]
+0xF24D	U+5894	# <cjk>	[2000]
+0xF24E	U+589D	# <cjk>	[2000]
+0xF24F	U+58AA	# <cjk>	[2000]
+0xF250	U+58B1	# <cjk>	[2000]
+0xF251	U+2146D	# <cjk>	[2000]	[Unicode3.1]
+0xF252	U+58C3	# <cjk>	[2000]
+0xF253	U+58CD	# <cjk>	[2000]
+0xF254	U+58E2	# <cjk>	[2000]
+0xF255	U+58F3	# <cjk>	[2000]
+0xF256	U+58F4	# <cjk>	[2000]
+0xF257	U+5905	# <cjk>	[2000]
+0xF258	U+5906	# <cjk>	[2000]
+0xF259	U+590B	# <cjk>	[2000]
+0xF25A	U+590D	# <cjk>	[2000]
+0xF25B	U+5914	# <cjk>	[2000]
+0xF25C	U+5924	# <cjk>	[2000]
+0xF25D	U+215D7	# <cjk>	[2000]	[Unicode3.1]
+0xF25E	U+3691	# <cjk>	[2000]
+0xF25F	U+593D	# <cjk>	[2000]
+0xF260	U+3699	# <cjk>	[2000]
+0xF261	U+5946	# <cjk>	[2000]
+0xF262	U+3696	# <cjk>	[2000]
+0xF263	U+26C29	# <cjk>	[2000]	[Unicode3.1]
+0xF264	U+595B	# <cjk>	[2000]
+0xF265	U+595F	# <cjk>	[2000]
+0xF266	U+21647	# <cjk>	[2000]	[Unicode3.1]
+0xF267	U+5975	# <cjk>	[2000]
+0xF268	U+5976	# <cjk>	[2000]
+0xF269	U+597C	# <cjk>	[2000]
+0xF26A	U+599F	# <cjk>	[2000]
+0xF26B	U+59AE	# <cjk>	[2000]
+0xF26C	U+59BC	# <cjk>	[2000]
+0xF26D	U+59C8	# <cjk>	[2000]
+0xF26E	U+59CD	# <cjk>	[2000]
+0xF26F	U+59DE	# <cjk>	[2000]
+0xF270	U+59E3	# <cjk>	[2000]
+0xF271	U+59E4	# <cjk>	[2000]
+0xF272	U+59E7	# <cjk>	[2000]
+0xF273	U+59EE	# <cjk>	[2000]
+0xF274	U+21706	# <cjk>	[2000]	[Unicode3.1]
+0xF275	U+21742	# <cjk>	[2000]	[Unicode3.1]
+0xF276	U+36CF	# <cjk>	[2000]
+0xF277	U+5A0C	# <cjk>	[2000]
+0xF278	U+5A0D	# <cjk>	[2000]
+0xF279	U+5A17	# <cjk>	[2000]
+0xF27A	U+5A27	# <cjk>	[2000]
+0xF27B	U+5A2D	# <cjk>	[2000]
+0xF27C	U+5A55	# <cjk>	[2000]
+0xF27D	U+5A65	# <cjk>	[2000]
+0xF27E	U+5A7A	# <cjk>	[2000]
+0xF280	U+5A8B	# <cjk>	[2000]
+0xF281	U+5A9C	# <cjk>	[2000]
+0xF282	U+5A9F	# <cjk>	[2000]
+0xF283	U+5AA0	# <cjk>	[2000]
+0xF284	U+5AA2	# <cjk>	[2000]
+0xF285	U+5AB1	# <cjk>	[2000]
+0xF286	U+5AB3	# <cjk>	[2000]
+0xF287	U+5AB5	# <cjk>	[2000]
+0xF288	U+5ABA	# <cjk>	[2000]
+0xF289	U+5ABF	# <cjk>	[2000]
+0xF28A	U+5ADA	# <cjk>	[2000]
+0xF28B	U+5ADC	# <cjk>	[2000]
+0xF28C	U+5AE0	# <cjk>	[2000]
+0xF28D	U+5AE5	# <cjk>	[2000]
+0xF28E	U+5AF0	# <cjk>	[2000]
+0xF28F	U+5AEE	# <cjk>	[2000]
+0xF290	U+5AF5	# <cjk>	[2000]
+0xF291	U+5B00	# <cjk>	[2000]
+0xF292	U+5B08	# <cjk>	[2000]
+0xF293	U+5B17	# <cjk>	[2000]
+0xF294	U+5B34	# <cjk>	[2000]
+0xF295	U+5B2D	# <cjk>	[2000]
+0xF296	U+5B4C	# <cjk>	[2000]
+0xF297	U+5B52	# <cjk>	[2000]
+0xF298	U+5B68	# <cjk>	[2000]
+0xF299	U+5B6F	# <cjk>	[2000]
+0xF29A	U+5B7C	# <cjk>	[2000]
+0xF29B	U+5B7F	# <cjk>	[2000]
+0xF29C	U+5B81	# <cjk>	[2000]
+0xF29D	U+5B84	# <cjk>	[2000]
+0xF29E	U+219C3	# <cjk>	[2000]	[Unicode3.1]
+0xF29F	U+5E6E	# <cjk>	[2000]
+0xF2A0	U+2217B	# <cjk>	[2000]	[Unicode3.1]
+0xF2A1	U+5EA5	# <cjk>	[2000]
+0xF2A2	U+5EAA	# <cjk>	[2000]
+0xF2A3	U+5EAC	# <cjk>	[2000]
+0xF2A4	U+5EB9	# <cjk>	[2000]
+0xF2A5	U+5EBF	# <cjk>	[2000]
+0xF2A6	U+5EC6	# <cjk>	[2000]
+0xF2A7	U+5ED2	# <cjk>	[2000]
+0xF2A8	U+5ED9	# <cjk>	[2000]
+0xF2A9	U+2231E	# <cjk>	[2000]	[Unicode3.1]
+0xF2AA	U+5EFD	# <cjk>	[2000]
+0xF2AB	U+5F08	# <cjk>	[2000]
+0xF2AC	U+5F0E	# <cjk>	[2000]
+0xF2AD	U+5F1C	# <cjk>	[2000]
+0xF2AE	U+223AD	# <cjk>	[2000]	[Unicode3.1]
+0xF2AF	U+5F1E	# <cjk>	[2000]
+0xF2B0	U+5F47	# <cjk>	[2000]
+0xF2B1	U+5F63	# <cjk>	[2000]
+0xF2B2	U+5F72	# <cjk>	[2000]
+0xF2B3	U+5F7E	# <cjk>	[2000]
+0xF2B4	U+5F8F	# <cjk>	[2000]
+0xF2B5	U+5FA2	# <cjk>	[2000]
+0xF2B6	U+5FA4	# <cjk>	[2000]
+0xF2B7	U+5FB8	# <cjk>	[2000]
+0xF2B8	U+5FC4	# <cjk>	[2000]
+0xF2B9	U+38FA	# <cjk>	[2000]
+0xF2BA	U+5FC7	# <cjk>	[2000]
+0xF2BB	U+5FCB	# <cjk>	[2000]
+0xF2BC	U+5FD2	# <cjk>	[2000]
+0xF2BD	U+5FD3	# <cjk>	[2000]
+0xF2BE	U+5FD4	# <cjk>	[2000]
+0xF2BF	U+5FE2	# <cjk>	[2000]
+0xF2C0	U+5FEE	# <cjk>	[2000]
+0xF2C1	U+5FEF	# <cjk>	[2000]
+0xF2C2	U+5FF3	# <cjk>	[2000]
+0xF2C3	U+5FFC	# <cjk>	[2000]
+0xF2C4	U+3917	# <cjk>	[2000]
+0xF2C5	U+6017	# <cjk>	[2000]
+0xF2C6	U+6022	# <cjk>	[2000]
+0xF2C7	U+6024	# <cjk>	[2000]
+0xF2C8	U+391A	# <cjk>	[2000]
+0xF2C9	U+604C	# <cjk>	[2000]
+0xF2CA	U+607F	# <cjk>	[2000]
+0xF2CB	U+608A	# <cjk>	[2000]
+0xF2CC	U+6095	# <cjk>	[2000]
+0xF2CD	U+60A8	# <cjk>	[2000]
+0xF2CE	U+226F3	# <cjk>	[2000]	[Unicode3.1]
+0xF2CF	U+60B0	# <cjk>	[2000]
+0xF2D0	U+60B1	# <cjk>	[2000]
+0xF2D1	U+60BE	# <cjk>	[2000]
+0xF2D2	U+60C8	# <cjk>	[2000]
+0xF2D3	U+60D9	# <cjk>	[2000]
+0xF2D4	U+60DB	# <cjk>	[2000]
+0xF2D5	U+60EE	# <cjk>	[2000]
+0xF2D6	U+60F2	# <cjk>	[2000]
+0xF2D7	U+60F5	# <cjk>	[2000]
+0xF2D8	U+6110	# <cjk>	[2000]
+0xF2D9	U+6112	# <cjk>	[2000]
+0xF2DA	U+6113	# <cjk>	[2000]
+0xF2DB	U+6119	# <cjk>	[2000]
+0xF2DC	U+611E	# <cjk>	[2000]
+0xF2DD	U+613A	# <cjk>	[2000]
+0xF2DE	U+396F	# <cjk>	[2000]
+0xF2DF	U+6141	# <cjk>	[2000]
+0xF2E0	U+6146	# <cjk>	[2000]
+0xF2E1	U+6160	# <cjk>	[2000]
+0xF2E2	U+617C	# <cjk>	[2000]
+0xF2E3	U+2285B	# <cjk>	[2000]	[Unicode3.1]
+0xF2E4	U+6192	# <cjk>	[2000]
+0xF2E5	U+6193	# <cjk>	[2000]
+0xF2E6	U+6197	# <cjk>	[2000]
+0xF2E7	U+6198	# <cjk>	[2000]
+0xF2E8	U+61A5	# <cjk>	[2000]
+0xF2E9	U+61A8	# <cjk>	[2000]
+0xF2EA	U+61AD	# <cjk>	[2000]
+0xF2EB	U+228AB	# <cjk>	[2000]	[Unicode3.1]
+0xF2EC	U+61D5	# <cjk>	[2000]
+0xF2ED	U+61DD	# <cjk>	[2000]
+0xF2EE	U+61DF	# <cjk>	[2000]
+0xF2EF	U+61F5	# <cjk>	[2000]
+0xF2F0	U+2298F	# <cjk>	[2000]	[Unicode3.1]
+0xF2F1	U+6215	# <cjk>	[2000]
+0xF2F2	U+6223	# <cjk>	[2000]
+0xF2F3	U+6229	# <cjk>	[2000]
+0xF2F4	U+6246	# <cjk>	[2000]
+0xF2F5	U+624C	# <cjk>	[2000]
+0xF2F6	U+6251	# <cjk>	[2000]
+0xF2F7	U+6252	# <cjk>	[2000]
+0xF2F8	U+6261	# <cjk>	[2000]
+0xF2F9	U+6264	# <cjk>	[2000]
+0xF2FA	U+627B	# <cjk>	[2000]
+0xF2FB	U+626D	# <cjk>	[2000]
+0xF2FC	U+6273	# <cjk>	[2000]
+0xF340	U+6299	# <cjk>	[2000]
+0xF341	U+62A6	# <cjk>	[2000]
+0xF342	U+62D5	# <cjk>	[2000]
+0xF343	U+22AB8	# <cjk>	[2000]	[Unicode3.1]
+0xF344	U+62FD	# <cjk>	[2000]
+0xF345	U+6303	# <cjk>	[2000]
+0xF346	U+630D	# <cjk>	[2000]
+0xF347	U+6310	# <cjk>	[2000]
+0xF348	U+22B4F	# <cjk>	[2000]	[Unicode3.1]
+0xF349	U+22B50	# <cjk>	[2000]	[Unicode3.1]
+0xF34A	U+6332	# <cjk>	[2000]
+0xF34B	U+6335	# <cjk>	[2000]
+0xF34C	U+633B	# <cjk>	[2000]
+0xF34D	U+633C	# <cjk>	[2000]
+0xF34E	U+6341	# <cjk>	[2000]
+0xF34F	U+6344	# <cjk>	[2000]
+0xF350	U+634E	# <cjk>	[2000]
+0xF351	U+22B46	# <cjk>	[2000]	[Unicode3.1]
+0xF352	U+6359	# <cjk>	[2000]
+0xF353	U+22C1D	# <cjk>	[2000]	[Unicode3.1]
+0xF354	U+22BA6	# <cjk>	[2000]	[Unicode3.1]
+0xF355	U+636C	# <cjk>	[2000]
+0xF356	U+6384	# <cjk>	[2000]
+0xF357	U+6399	# <cjk>	[2000]
+0xF358	U+22C24	# <cjk>	[2000]	[Unicode3.1]
+0xF359	U+6394	# <cjk>	[2000]
+0xF35A	U+63BD	# <cjk>	[2000]
+0xF35B	U+63F7	# <cjk>	[2000]
+0xF35C	U+63D4	# <cjk>	[2000]
+0xF35D	U+63D5	# <cjk>	[2000]
+0xF35E	U+63DC	# <cjk>	[2000]
+0xF35F	U+63E0	# <cjk>	[2000]
+0xF360	U+63EB	# <cjk>	[2000]
+0xF361	U+63EC	# <cjk>	[2000]
+0xF362	U+63F2	# <cjk>	[2000]
+0xF363	U+6409	# <cjk>	[2000]
+0xF364	U+641E	# <cjk>	[2000]
+0xF365	U+6425	# <cjk>	[2000]
+0xF366	U+6429	# <cjk>	[2000]
+0xF367	U+642F	# <cjk>	[2000]
+0xF368	U+645A	# <cjk>	[2000]
+0xF369	U+645B	# <cjk>	[2000]
+0xF36A	U+645D	# <cjk>	[2000]
+0xF36B	U+6473	# <cjk>	[2000]
+0xF36C	U+647D	# <cjk>	[2000]
+0xF36D	U+6487	# <cjk>	[2000]
+0xF36E	U+6491	# <cjk>	[2000]
+0xF36F	U+649D	# <cjk>	[2000]
+0xF370	U+649F	# <cjk>	[2000]
+0xF371	U+64CB	# <cjk>	[2000]
+0xF372	U+64CC	# <cjk>	[2000]
+0xF373	U+64D5	# <cjk>	[2000]
+0xF374	U+64D7	# <cjk>	[2000]
+0xF375	U+22DE1	# <cjk>	[2000]	[Unicode3.1]
+0xF376	U+64E4	# <cjk>	[2000]
+0xF377	U+64E5	# <cjk>	[2000]
+0xF378	U+64FF	# <cjk>	[2000]
+0xF379	U+6504	# <cjk>	[2000]
+0xF37A	U+3A6E	# <cjk>	[2000]
+0xF37B	U+650F	# <cjk>	[2000]
+0xF37C	U+6514	# <cjk>	[2000]
+0xF37D	U+6516	# <cjk>	[2000]
+0xF37E	U+3A73	# <cjk>	[2000]
+0xF380	U+651E	# <cjk>	[2000]
+0xF381	U+6532	# <cjk>	[2000]
+0xF382	U+6544	# <cjk>	[2000]
+0xF383	U+6554	# <cjk>	[2000]
+0xF384	U+656B	# <cjk>	[2000]
+0xF385	U+657A	# <cjk>	[2000]
+0xF386	U+6581	# <cjk>	[2000]
+0xF387	U+6584	# <cjk>	[2000]
+0xF388	U+6585	# <cjk>	[2000]
+0xF389	U+658A	# <cjk>	[2000]
+0xF38A	U+65B2	# <cjk>	[2000]
+0xF38B	U+65B5	# <cjk>	[2000]
+0xF38C	U+65B8	# <cjk>	[2000]
+0xF38D	U+65BF	# <cjk>	[2000]
+0xF38E	U+65C2	# <cjk>	[2000]
+0xF38F	U+65C9	# <cjk>	[2000]
+0xF390	U+65D4	# <cjk>	[2000]
+0xF391	U+3AD6	# <cjk>	[2000]
+0xF392	U+65F2	# <cjk>	[2000]
+0xF393	U+65F9	# <cjk>	[2000]
+0xF394	U+65FC	# <cjk>	[2000]
+0xF395	U+6604	# <cjk>	[2000]
+0xF396	U+6608	# <cjk>	[2000]
+0xF397	U+6621	# <cjk>	[2000]
+0xF398	U+662A	# <cjk>	[2000]
+0xF399	U+6645	# <cjk>	[2000]
+0xF39A	U+6651	# <cjk>	[2000]
+0xF39B	U+664E	# <cjk>	[2000]
+0xF39C	U+3AEA	# <cjk>	[2000]
+0xF39D	U+231C3	# <cjk>	[2000]	[Unicode3.1]
+0xF39E	U+6657	# <cjk>	[2000]
+0xF39F	U+665B	# <cjk>	[2000]
+0xF3A0	U+6663	# <cjk>	[2000]
+0xF3A1	U+231F5	# <cjk>	[2000]	[Unicode3.1]
+0xF3A2	U+231B6	# <cjk>	[2000]	[Unicode3.1]
+0xF3A3	U+666A	# <cjk>	[2000]
+0xF3A4	U+666B	# <cjk>	[2000]
+0xF3A5	U+666C	# <cjk>	[2000]
+0xF3A6	U+666D	# <cjk>	[2000]
+0xF3A7	U+667B	# <cjk>	[2000]
+0xF3A8	U+6680	# <cjk>	[2000]
+0xF3A9	U+6690	# <cjk>	[2000]
+0xF3AA	U+6692	# <cjk>	[2000]
+0xF3AB	U+6699	# <cjk>	[2000]
+0xF3AC	U+3B0E	# <cjk>	[2000]
+0xF3AD	U+66AD	# <cjk>	[2000]
+0xF3AE	U+66B1	# <cjk>	[2000]
+0xF3AF	U+66B5	# <cjk>	[2000]
+0xF3B0	U+3B1A	# <cjk>	[2000]
+0xF3B1	U+66BF	# <cjk>	[2000]
+0xF3B2	U+3B1C	# <cjk>	[2000]
+0xF3B3	U+66EC	# <cjk>	[2000]
+0xF3B4	U+3AD7	# <cjk>	[2000]
+0xF3B5	U+6701	# <cjk>	[2000]
+0xF3B6	U+6705	# <cjk>	[2000]
+0xF3B7	U+6712	# <cjk>	[2000]
+0xF3B8	U+23372	# <cjk>	[2000]	[Unicode3.1]
+0xF3B9	U+6719	# <cjk>	[2000]
+0xF3BA	U+233D3	# <cjk>	[2000]	[Unicode3.1]
+0xF3BB	U+233D2	# <cjk>	[2000]	[Unicode3.1]
+0xF3BC	U+674C	# <cjk>	[2000]
+0xF3BD	U+674D	# <cjk>	[2000]
+0xF3BE	U+6754	# <cjk>	[2000]
+0xF3BF	U+675D	# <cjk>	[2000]
+0xF3C0	U+233D0	# <cjk>	[2000]	[Unicode3.1]
+0xF3C1	U+233E4	# <cjk>	[2000]	[Unicode3.1]
+0xF3C2	U+233D5	# <cjk>	[2000]	[Unicode3.1]
+0xF3C3	U+6774	# <cjk>	[2000]
+0xF3C4	U+6776	# <cjk>	[2000]
+0xF3C5	U+233DA	# <cjk>	[2000]	[Unicode3.1]
+0xF3C6	U+6792	# <cjk>	[2000]
+0xF3C7	U+233DF	# <cjk>	[2000]	[Unicode3.1]
+0xF3C8	U+8363	# <cjk>	[2000]
+0xF3C9	U+6810	# <cjk>	[2000]
+0xF3CA	U+67B0	# <cjk>	[2000]
+0xF3CB	U+67B2	# <cjk>	[2000]
+0xF3CC	U+67C3	# <cjk>	[2000]
+0xF3CD	U+67C8	# <cjk>	[2000]
+0xF3CE	U+67D2	# <cjk>	[2000]
+0xF3CF	U+67D9	# <cjk>	[2000]
+0xF3D0	U+67DB	# <cjk>	[2000]
+0xF3D1	U+67F0	# <cjk>	[2000]
+0xF3D2	U+67F7	# <cjk>	[2000]
+0xF3D3	U+2344A	# <cjk>	[2000]	[Unicode3.1]
+0xF3D4	U+23451	# <cjk>	[2000]	[Unicode3.1]
+0xF3D5	U+2344B	# <cjk>	[2000]	[Unicode3.1]
+0xF3D6	U+6818	# <cjk>	[2000]
+0xF3D7	U+681F	# <cjk>	[2000]
+0xF3D8	U+682D	# <cjk>	[2000]
+0xF3D9	U+23465	# <cjk>	[2000]	[Unicode3.1]
+0xF3DA	U+6833	# <cjk>	[2000]
+0xF3DB	U+683B	# <cjk>	[2000]
+0xF3DC	U+683E	# <cjk>	[2000]
+0xF3DD	U+6844	# <cjk>	[2000]
+0xF3DE	U+6845	# <cjk>	[2000]
+0xF3DF	U+6849	# <cjk>	[2000]
+0xF3E0	U+684C	# <cjk>	[2000]
+0xF3E1	U+6855	# <cjk>	[2000]
+0xF3E2	U+6857	# <cjk>	[2000]
+0xF3E3	U+3B77	# <cjk>	[2000]
+0xF3E4	U+686B	# <cjk>	[2000]
+0xF3E5	U+686E	# <cjk>	[2000]
+0xF3E6	U+687A	# <cjk>	[2000]
+0xF3E7	U+687C	# <cjk>	[2000]
+0xF3E8	U+6882	# <cjk>	[2000]
+0xF3E9	U+6890	# <cjk>	[2000]
+0xF3EA	U+6896	# <cjk>	[2000]
+0xF3EB	U+3B6D	# <cjk>	[2000]
+0xF3EC	U+6898	# <cjk>	[2000]
+0xF3ED	U+6899	# <cjk>	[2000]
+0xF3EE	U+689A	# <cjk>	[2000]
+0xF3EF	U+689C	# <cjk>	[2000]
+0xF3F0	U+68AA	# <cjk>	[2000]
+0xF3F1	U+68AB	# <cjk>	[2000]
+0xF3F2	U+68B4	# <cjk>	[2000]
+0xF3F3	U+68BB	# <cjk>	[2000]
+0xF3F4	U+68FB	# <cjk>	[2000]
+0xF3F5	U+234E4	# <cjk>	[2000]	[Unicode3.1]
+0xF3F6	U+2355A	# <cjk>	[2000]	[Unicode3.1]
+0xF3F7	U+FA13	# CJK COMPATIBILITY IDEOGRAPH-FA13	[2000]
+0xF3F8	U+68C3	# <cjk>	[2000]
+0xF3F9	U+68C5	# <cjk>	[2000]
+0xF3FA	U+68CC	# <cjk>	[2000]
+0xF3FB	U+68CF	# <cjk>	[2000]
+0xF3FC	U+68D6	# <cjk>	[2000]
+0xF440	U+68D9	# <cjk>	[2000]
+0xF441	U+68E4	# <cjk>	[2000]
+0xF442	U+68E5	# <cjk>	[2000]
+0xF443	U+68EC	# <cjk>	[2000]
+0xF444	U+68F7	# <cjk>	[2000]
+0xF445	U+6903	# <cjk>	[2000]
+0xF446	U+6907	# <cjk>	[2000]
+0xF447	U+3B87	# <cjk>	[2000]
+0xF448	U+3B88	# <cjk>	[2000]
+0xF449	U+23594	# <cjk>	[2000]	[Unicode3.1]
+0xF44A	U+693B	# <cjk>	[2000]
+0xF44B	U+3B8D	# <cjk>	[2000]
+0xF44C	U+6946	# <cjk>	[2000]
+0xF44D	U+6969	# <cjk>	[2000]
+0xF44E	U+696C	# <cjk>	[2000]
+0xF44F	U+6972	# <cjk>	[2000]
+0xF450	U+697A	# <cjk>	[2000]
+0xF451	U+697F	# <cjk>	[2000]
+0xF452	U+6992	# <cjk>	[2000]
+0xF453	U+3BA4	# <cjk>	[2000]
+0xF454	U+6996	# <cjk>	[2000]
+0xF455	U+6998	# <cjk>	[2000]
+0xF456	U+69A6	# <cjk>	[2000]
+0xF457	U+69B0	# <cjk>	[2000]
+0xF458	U+69B7	# <cjk>	[2000]
+0xF459	U+69BA	# <cjk>	[2000]
+0xF45A	U+69BC	# <cjk>	[2000]
+0xF45B	U+69C0	# <cjk>	[2000]
+0xF45C	U+69D1	# <cjk>	[2000]
+0xF45D	U+69D6	# <cjk>	[2000]
+0xF45E	U+23639	# <cjk>	[2000]	[Unicode3.1]
+0xF45F	U+23647	# <cjk>	[2000]	[Unicode3.1]
+0xF460	U+6A30	# <cjk>	[2000]
+0xF461	U+23638	# <cjk>	[2000]	[Unicode3.1]
+0xF462	U+2363A	# <cjk>	[2000]	[Unicode3.1]
+0xF463	U+69E3	# <cjk>	[2000]
+0xF464	U+69EE	# <cjk>	[2000]
+0xF465	U+69EF	# <cjk>	[2000]
+0xF466	U+69F3	# <cjk>	[2000]
+0xF467	U+3BCD	# <cjk>	[2000]
+0xF468	U+69F4	# <cjk>	[2000]
+0xF469	U+69FE	# <cjk>	[2000]
+0xF46A	U+6A11	# <cjk>	[2000]
+0xF46B	U+6A1A	# <cjk>	[2000]
+0xF46C	U+6A1D	# <cjk>	[2000]
+0xF46D	U+2371C	# <cjk>	[2000]	[Unicode3.1]
+0xF46E	U+6A32	# <cjk>	[2000]
+0xF46F	U+6A33	# <cjk>	[2000]
+0xF470	U+6A34	# <cjk>	[2000]
+0xF471	U+6A3F	# <cjk>	[2000]
+0xF472	U+6A46	# <cjk>	[2000]
+0xF473	U+6A49	# <cjk>	[2000]
+0xF474	U+6A7A	# <cjk>	[2000]
+0xF475	U+6A4E	# <cjk>	[2000]
+0xF476	U+6A52	# <cjk>	[2000]
+0xF477	U+6A64	# <cjk>	[2000]
+0xF478	U+2370C	# <cjk>	[2000]	[Unicode3.1]
+0xF479	U+6A7E	# <cjk>	[2000]
+0xF47A	U+6A83	# <cjk>	[2000]
+0xF47B	U+6A8B	# <cjk>	[2000]
+0xF47C	U+3BF0	# <cjk>	[2000]
+0xF47D	U+6A91	# <cjk>	[2000]
+0xF47E	U+6A9F	# <cjk>	[2000]
+0xF480	U+6AA1	# <cjk>	[2000]
+0xF481	U+23764	# <cjk>	[2000]	[Unicode3.1]
+0xF482	U+6AAB	# <cjk>	[2000]
+0xF483	U+6ABD	# <cjk>	[2000]
+0xF484	U+6AC6	# <cjk>	[2000]
+0xF485	U+6AD4	# <cjk>	[2000]
+0xF486	U+6AD0	# <cjk>	[2000]
+0xF487	U+6ADC	# <cjk>	[2000]
+0xF488	U+6ADD	# <cjk>	[2000]
+0xF489	U+237FF	# <cjk>	[2000]	[Unicode3.1]
+0xF48A	U+237E7	# <cjk>	[2000]	[Unicode3.1]
+0xF48B	U+6AEC	# <cjk>	[2000]
+0xF48C	U+6AF1	# <cjk>	[2000]
+0xF48D	U+6AF2	# <cjk>	[2000]
+0xF48E	U+6AF3	# <cjk>	[2000]
+0xF48F	U+6AFD	# <cjk>	[2000]
+0xF490	U+23824	# <cjk>	[2000]	[Unicode3.1]
+0xF491	U+6B0B	# <cjk>	[2000]
+0xF492	U+6B0F	# <cjk>	[2000]
+0xF493	U+6B10	# <cjk>	[2000]
+0xF494	U+6B11	# <cjk>	[2000]
+0xF495	U+2383D	# <cjk>	[2000]	[Unicode3.1]
+0xF496	U+6B17	# <cjk>	[2000]
+0xF497	U+3C26	# <cjk>	[2000]
+0xF498	U+6B2F	# <cjk>	[2000]
+0xF499	U+6B4A	# <cjk>	[2000]
+0xF49A	U+6B58	# <cjk>	[2000]
+0xF49B	U+6B6C	# <cjk>	[2000]
+0xF49C	U+6B75	# <cjk>	[2000]
+0xF49D	U+6B7A	# <cjk>	[2000]
+0xF49E	U+6B81	# <cjk>	[2000]
+0xF49F	U+6B9B	# <cjk>	[2000]
+0xF4A0	U+6BAE	# <cjk>	[2000]
+0xF4A1	U+23A98	# <cjk>	[2000]	[Unicode3.1]
+0xF4A2	U+6BBD	# <cjk>	[2000]
+0xF4A3	U+6BBE	# <cjk>	[2000]
+0xF4A4	U+6BC7	# <cjk>	[2000]
+0xF4A5	U+6BC8	# <cjk>	[2000]
+0xF4A6	U+6BC9	# <cjk>	[2000]
+0xF4A7	U+6BDA	# <cjk>	[2000]
+0xF4A8	U+6BE6	# <cjk>	[2000]
+0xF4A9	U+6BE7	# <cjk>	[2000]
+0xF4AA	U+6BEE	# <cjk>	[2000]
+0xF4AB	U+6BF1	# <cjk>	[2000]
+0xF4AC	U+6C02	# <cjk>	[2000]
+0xF4AD	U+6C0A	# <cjk>	[2000]
+0xF4AE	U+6C0E	# <cjk>	[2000]
+0xF4AF	U+6C35	# <cjk>	[2000]
+0xF4B0	U+6C36	# <cjk>	[2000]
+0xF4B1	U+6C3A	# <cjk>	[2000]
+0xF4B2	U+23C7F	# <cjk>	[2000]	[Unicode3.1]
+0xF4B3	U+6C3F	# <cjk>	[2000]
+0xF4B4	U+6C4D	# <cjk>	[2000]
+0xF4B5	U+6C5B	# <cjk>	[2000]
+0xF4B6	U+6C6D	# <cjk>	[2000]
+0xF4B7	U+6C84	# <cjk>	[2000]
+0xF4B8	U+6C89	# <cjk>	[2000]
+0xF4B9	U+3CC3	# <cjk>	[2000]
+0xF4BA	U+6C94	# <cjk>	[2000]
+0xF4BB	U+6C95	# <cjk>	[2000]
+0xF4BC	U+6C97	# <cjk>	[2000]
+0xF4BD	U+6CAD	# <cjk>	[2000]
+0xF4BE	U+6CC2	# <cjk>	[2000]
+0xF4BF	U+6CD0	# <cjk>	[2000]
+0xF4C0	U+3CD2	# <cjk>	[2000]
+0xF4C1	U+6CD6	# <cjk>	[2000]
+0xF4C2	U+6CDA	# <cjk>	[2000]
+0xF4C3	U+6CDC	# <cjk>	[2000]
+0xF4C4	U+6CE9	# <cjk>	[2000]
+0xF4C5	U+6CEC	# <cjk>	[2000]
+0xF4C6	U+6CED	# <cjk>	[2000]
+0xF4C7	U+23D00	# <cjk>	[2000]	[Unicode3.1]
+0xF4C8	U+6D00	# <cjk>	[2000]
+0xF4C9	U+6D0A	# <cjk>	[2000]
+0xF4CA	U+6D24	# <cjk>	[2000]
+0xF4CB	U+6D26	# <cjk>	[2000]
+0xF4CC	U+6D27	# <cjk>	[2000]
+0xF4CD	U+6C67	# <cjk>	[2000]
+0xF4CE	U+6D2F	# <cjk>	[2000]
+0xF4CF	U+6D3C	# <cjk>	[2000]
+0xF4D0	U+6D5B	# <cjk>	[2000]
+0xF4D1	U+6D5E	# <cjk>	[2000]
+0xF4D2	U+6D60	# <cjk>	[2000]
+0xF4D3	U+6D70	# <cjk>	[2000]
+0xF4D4	U+6D80	# <cjk>	[2000]
+0xF4D5	U+6D81	# <cjk>	[2000]
+0xF4D6	U+6D8A	# <cjk>	[2000]
+0xF4D7	U+6D8D	# <cjk>	[2000]
+0xF4D8	U+6D91	# <cjk>	[2000]
+0xF4D9	U+6D98	# <cjk>	[2000]
+0xF4DA	U+23D40	# <cjk>	[2000]	[Unicode3.1]
+0xF4DB	U+6E17	# <cjk>	[2000]
+0xF4DC	U+23DFA	# <cjk>	[2000]	[Unicode3.1]
+0xF4DD	U+23DF9	# <cjk>	[2000]	[Unicode3.1]
+0xF4DE	U+23DD3	# <cjk>	[2000]	[Unicode3.1]
+0xF4DF	U+6DAB	# <cjk>	[2000]
+0xF4E0	U+6DAE	# <cjk>	[2000]
+0xF4E1	U+6DB4	# <cjk>	[2000]
+0xF4E2	U+6DC2	# <cjk>	[2000]
+0xF4E3	U+6D34	# <cjk>	[2000]
+0xF4E4	U+6DC8	# <cjk>	[2000]
+0xF4E5	U+6DCE	# <cjk>	[2000]
+0xF4E6	U+6DCF	# <cjk>	[2000]
+0xF4E7	U+6DD0	# <cjk>	[2000]
+0xF4E8	U+6DDF	# <cjk>	[2000]
+0xF4E9	U+6DE9	# <cjk>	[2000]
+0xF4EA	U+6DF6	# <cjk>	[2000]
+0xF4EB	U+6E36	# <cjk>	[2000]
+0xF4EC	U+6E1E	# <cjk>	[2000]
+0xF4ED	U+6E22	# <cjk>	[2000]
+0xF4EE	U+6E27	# <cjk>	[2000]
+0xF4EF	U+3D11	# <cjk>	[2000]
+0xF4F0	U+6E32	# <cjk>	[2000]
+0xF4F1	U+6E3C	# <cjk>	[2000]
+0xF4F2	U+6E48	# <cjk>	[2000]
+0xF4F3	U+6E49	# <cjk>	[2000]
+0xF4F4	U+6E4B	# <cjk>	[2000]
+0xF4F5	U+6E4C	# <cjk>	[2000]
+0xF4F6	U+6E4F	# <cjk>	[2000]
+0xF4F7	U+6E51	# <cjk>	[2000]
+0xF4F8	U+6E53	# <cjk>	[2000]
+0xF4F9	U+6E54	# <cjk>	[2000]
+0xF4FA	U+6E57	# <cjk>	[2000]
+0xF4FB	U+6E63	# <cjk>	[2000]
+0xF4FC	U+3D1E	# <cjk>	[2000]
+0xF540	U+6E93	# <cjk>	[2000]
+0xF541	U+6EA7	# <cjk>	[2000]
+0xF542	U+6EB4	# <cjk>	[2000]
+0xF543	U+6EBF	# <cjk>	[2000]
+0xF544	U+6EC3	# <cjk>	[2000]
+0xF545	U+6ECA	# <cjk>	[2000]
+0xF546	U+6ED9	# <cjk>	[2000]
+0xF547	U+6F35	# <cjk>	[2000]
+0xF548	U+6EEB	# <cjk>	[2000]
+0xF549	U+6EF9	# <cjk>	[2000]
+0xF54A	U+6EFB	# <cjk>	[2000]
+0xF54B	U+6F0A	# <cjk>	[2000]
+0xF54C	U+6F0C	# <cjk>	[2000]
+0xF54D	U+6F18	# <cjk>	[2000]
+0xF54E	U+6F25	# <cjk>	[2000]
+0xF54F	U+6F36	# <cjk>	[2000]
+0xF550	U+6F3C	# <cjk>	[2000]
+0xF551	U+23F7E	# <cjk>	[2000]	[Unicode3.1]
+0xF552	U+6F52	# <cjk>	[2000]
+0xF553	U+6F57	# <cjk>	[2000]
+0xF554	U+6F5A	# <cjk>	[2000]
+0xF555	U+6F60	# <cjk>	[2000]
+0xF556	U+6F68	# <cjk>	[2000]
+0xF557	U+6F98	# <cjk>	[2000]
+0xF558	U+6F7D	# <cjk>	[2000]
+0xF559	U+6F90	# <cjk>	[2000]
+0xF55A	U+6F96	# <cjk>	[2000]
+0xF55B	U+6FBE	# <cjk>	[2000]
+0xF55C	U+6F9F	# <cjk>	[2000]
+0xF55D	U+6FA5	# <cjk>	[2000]
+0xF55E	U+6FAF	# <cjk>	[2000]
+0xF55F	U+3D64	# <cjk>	[2000]
+0xF560	U+6FB5	# <cjk>	[2000]
+0xF561	U+6FC8	# <cjk>	[2000]
+0xF562	U+6FC9	# <cjk>	[2000]
+0xF563	U+6FDA	# <cjk>	[2000]
+0xF564	U+6FDE	# <cjk>	[2000]
+0xF565	U+6FE9	# <cjk>	[2000]
+0xF566	U+24096	# <cjk>	[2000]	[Unicode3.1]
+0xF567	U+6FFC	# <cjk>	[2000]
+0xF568	U+7000	# <cjk>	[2000]
+0xF569	U+7007	# <cjk>	[2000]
+0xF56A	U+700A	# <cjk>	[2000]
+0xF56B	U+7023	# <cjk>	[2000]
+0xF56C	U+24103	# <cjk>	[2000]	[Unicode3.1]
+0xF56D	U+7039	# <cjk>	[2000]
+0xF56E	U+703A	# <cjk>	[2000]
+0xF56F	U+703C	# <cjk>	[2000]
+0xF570	U+7043	# <cjk>	[2000]
+0xF571	U+7047	# <cjk>	[2000]
+0xF572	U+704B	# <cjk>	[2000]
+0xF573	U+3D9A	# <cjk>	[2000]
+0xF574	U+7054	# <cjk>	[2000]
+0xF575	U+7065	# <cjk>	[2000]
+0xF576	U+7069	# <cjk>	[2000]
+0xF577	U+706C	# <cjk>	[2000]
+0xF578	U+706E	# <cjk>	[2000]
+0xF579	U+7076	# <cjk>	[2000]
+0xF57A	U+707E	# <cjk>	[2000]
+0xF57B	U+7081	# <cjk>	[2000]
+0xF57C	U+7086	# <cjk>	[2000]
+0xF57D	U+7095	# <cjk>	[2000]
+0xF57E	U+7097	# <cjk>	[2000]
+0xF580	U+70BB	# <cjk>	[2000]
+0xF581	U+241C6	# <cjk>	[2000]	[Unicode3.1]
+0xF582	U+709F	# <cjk>	[2000]
+0xF583	U+70B1	# <cjk>	[2000]
+0xF584	U+241FE	# <cjk>	[2000]	[Unicode3.1]
+0xF585	U+70EC	# <cjk>	[2000]
+0xF586	U+70CA	# <cjk>	[2000]
+0xF587	U+70D1	# <cjk>	[2000]
+0xF588	U+70D3	# <cjk>	[2000]
+0xF589	U+70DC	# <cjk>	[2000]
+0xF58A	U+7103	# <cjk>	[2000]
+0xF58B	U+7104	# <cjk>	[2000]
+0xF58C	U+7106	# <cjk>	[2000]
+0xF58D	U+7107	# <cjk>	[2000]
+0xF58E	U+7108	# <cjk>	[2000]
+0xF58F	U+710C	# <cjk>	[2000]
+0xF590	U+3DC0	# <cjk>	[2000]
+0xF591	U+712F	# <cjk>	[2000]
+0xF592	U+7131	# <cjk>	[2000]
+0xF593	U+7150	# <cjk>	[2000]
+0xF594	U+714A	# <cjk>	[2000]
+0xF595	U+7153	# <cjk>	[2000]
+0xF596	U+715E	# <cjk>	[2000]
+0xF597	U+3DD4	# <cjk>	[2000]
+0xF598	U+7196	# <cjk>	[2000]
+0xF599	U+7180	# <cjk>	[2000]
+0xF59A	U+719B	# <cjk>	[2000]
+0xF59B	U+71A0	# <cjk>	[2000]
+0xF59C	U+71A2	# <cjk>	[2000]
+0xF59D	U+71AE	# <cjk>	[2000]
+0xF59E	U+71AF	# <cjk>	[2000]
+0xF59F	U+71B3	# <cjk>	[2000]
+0xF5A0	U+243BC	# <cjk>	[2000]	[Unicode3.1]
+0xF5A1	U+71CB	# <cjk>	[2000]
+0xF5A2	U+71D3	# <cjk>	[2000]
+0xF5A3	U+71D9	# <cjk>	[2000]
+0xF5A4	U+71DC	# <cjk>	[2000]
+0xF5A5	U+7207	# <cjk>	[2000]
+0xF5A6	U+3E05	# <cjk>	[2000]
+0xF5A7	U+FA49	# CJK COMPATIBILITY IDEOGRAPH-FA49	[2000]	[Unicode3.2]
+0xF5A8	U+722B	# <cjk>	[2000]
+0xF5A9	U+7234	# <cjk>	[2000]
+0xF5AA	U+7238	# <cjk>	[2000]
+0xF5AB	U+7239	# <cjk>	[2000]
+0xF5AC	U+4E2C	# <cjk>	[2000]
+0xF5AD	U+7242	# <cjk>	[2000]
+0xF5AE	U+7253	# <cjk>	[2000]
+0xF5AF	U+7257	# <cjk>	[2000]
+0xF5B0	U+7263	# <cjk>	[2000]
+0xF5B1	U+24629	# <cjk>	[2000]	[Unicode3.1]
+0xF5B2	U+726E	# <cjk>	[2000]
+0xF5B3	U+726F	# <cjk>	[2000]
+0xF5B4	U+7278	# <cjk>	[2000]
+0xF5B5	U+727F	# <cjk>	[2000]
+0xF5B6	U+728E	# <cjk>	[2000]
+0xF5B7	U+246A5	# <cjk>	[2000]	[Unicode3.1]
+0xF5B8	U+72AD	# <cjk>	[2000]
+0xF5B9	U+72AE	# <cjk>	[2000]
+0xF5BA	U+72B0	# <cjk>	[2000]
+0xF5BB	U+72B1	# <cjk>	[2000]
+0xF5BC	U+72C1	# <cjk>	[2000]
+0xF5BD	U+3E60	# <cjk>	[2000]
+0xF5BE	U+72CC	# <cjk>	[2000]
+0xF5BF	U+3E66	# <cjk>	[2000]
+0xF5C0	U+3E68	# <cjk>	[2000]
+0xF5C1	U+72F3	# <cjk>	[2000]
+0xF5C2	U+72FA	# <cjk>	[2000]
+0xF5C3	U+7307	# <cjk>	[2000]
+0xF5C4	U+7312	# <cjk>	[2000]
+0xF5C5	U+7318	# <cjk>	[2000]
+0xF5C6	U+7319	# <cjk>	[2000]
+0xF5C7	U+3E83	# <cjk>	[2000]
+0xF5C8	U+7339	# <cjk>	[2000]
+0xF5C9	U+732C	# <cjk>	[2000]
+0xF5CA	U+7331	# <cjk>	[2000]
+0xF5CB	U+7333	# <cjk>	[2000]
+0xF5CC	U+733D	# <cjk>	[2000]
+0xF5CD	U+7352	# <cjk>	[2000]
+0xF5CE	U+3E94	# <cjk>	[2000]
+0xF5CF	U+736B	# <cjk>	[2000]
+0xF5D0	U+736C	# <cjk>	[2000]
+0xF5D1	U+24896	# <cjk>	[2000]	[Unicode3.1]
+0xF5D2	U+736E	# <cjk>	[2000]
+0xF5D3	U+736F	# <cjk>	[2000]
+0xF5D4	U+7371	# <cjk>	[2000]
+0xF5D5	U+7377	# <cjk>	[2000]
+0xF5D6	U+7381	# <cjk>	[2000]
+0xF5D7	U+7385	# <cjk>	[2000]
+0xF5D8	U+738A	# <cjk>	[2000]
+0xF5D9	U+7394	# <cjk>	[2000]
+0xF5DA	U+7398	# <cjk>	[2000]
+0xF5DB	U+739C	# <cjk>	[2000]
+0xF5DC	U+739E	# <cjk>	[2000]
+0xF5DD	U+73A5	# <cjk>	[2000]
+0xF5DE	U+73A8	# <cjk>	[2000]
+0xF5DF	U+73B5	# <cjk>	[2000]
+0xF5E0	U+73B7	# <cjk>	[2000]
+0xF5E1	U+73B9	# <cjk>	[2000]
+0xF5E2	U+73BC	# <cjk>	[2000]
+0xF5E3	U+73BF	# <cjk>	[2000]
+0xF5E4	U+73C5	# <cjk>	[2000]
+0xF5E5	U+73CB	# <cjk>	[2000]
+0xF5E6	U+73E1	# <cjk>	[2000]
+0xF5E7	U+73E7	# <cjk>	[2000]
+0xF5E8	U+73F9	# <cjk>	[2000]
+0xF5E9	U+7413	# <cjk>	[2000]
+0xF5EA	U+73FA	# <cjk>	[2000]
+0xF5EB	U+7401	# <cjk>	[2000]
+0xF5EC	U+7424	# <cjk>	[2000]
+0xF5ED	U+7431	# <cjk>	[2000]
+0xF5EE	U+7439	# <cjk>	[2000]
+0xF5EF	U+7453	# <cjk>	[2000]
+0xF5F0	U+7440	# <cjk>	[2000]
+0xF5F1	U+7443	# <cjk>	[2000]
+0xF5F2	U+744D	# <cjk>	[2000]
+0xF5F3	U+7452	# <cjk>	[2000]
+0xF5F4	U+745D	# <cjk>	[2000]
+0xF5F5	U+7471	# <cjk>	[2000]
+0xF5F6	U+7481	# <cjk>	[2000]
+0xF5F7	U+7485	# <cjk>	[2000]
+0xF5F8	U+7488	# <cjk>	[2000]
+0xF5F9	U+24A4D	# <cjk>	[2000]	[Unicode3.1]
+0xF5FA	U+7492	# <cjk>	[2000]
+0xF5FB	U+7497	# <cjk>	[2000]
+0xF5FC	U+7499	# <cjk>	[2000]
+0xF640	U+74A0	# <cjk>	[2000]
+0xF641	U+74A1	# <cjk>	[2000]
+0xF642	U+74A5	# <cjk>	[2000]
+0xF643	U+74AA	# <cjk>	[2000]
+0xF644	U+74AB	# <cjk>	[2000]
+0xF645	U+74B9	# <cjk>	[2000]
+0xF646	U+74BB	# <cjk>	[2000]
+0xF647	U+74BA	# <cjk>	[2000]
+0xF648	U+74D6	# <cjk>	[2000]
+0xF649	U+74D8	# <cjk>	[2000]
+0xF64A	U+74DE	# <cjk>	[2000]
+0xF64B	U+74EF	# <cjk>	[2000]
+0xF64C	U+74EB	# <cjk>	[2000]
+0xF64D	U+24B56	# <cjk>	[2000]	[Unicode3.1]
+0xF64E	U+74FA	# <cjk>	[2000]
+0xF64F	U+24B6F	# <cjk>	[2000]	[Unicode3.1]
+0xF650	U+7520	# <cjk>	[2000]
+0xF651	U+7524	# <cjk>	[2000]
+0xF652	U+752A	# <cjk>	[2000]
+0xF653	U+3F57	# <cjk>	[2000]
+0xF654	U+24C16	# <cjk>	[2000]	[Unicode3.1]
+0xF655	U+753D	# <cjk>	[2000]
+0xF656	U+753E	# <cjk>	[2000]
+0xF657	U+7540	# <cjk>	[2000]
+0xF658	U+7548	# <cjk>	[2000]
+0xF659	U+754E	# <cjk>	[2000]
+0xF65A	U+7550	# <cjk>	[2000]
+0xF65B	U+7552	# <cjk>	[2000]
+0xF65C	U+756C	# <cjk>	[2000]
+0xF65D	U+7572	# <cjk>	[2000]
+0xF65E	U+7571	# <cjk>	[2000]
+0xF65F	U+757A	# <cjk>	[2000]
+0xF660	U+757D	# <cjk>	[2000]
+0xF661	U+757E	# <cjk>	[2000]
+0xF662	U+7581	# <cjk>	[2000]
+0xF663	U+24D14	# <cjk>	[2000]	[Unicode3.1]
+0xF664	U+758C	# <cjk>	[2000]
+0xF665	U+3F75	# <cjk>	[2000]
+0xF666	U+75A2	# <cjk>	[2000]
+0xF667	U+3F77	# <cjk>	[2000]
+0xF668	U+75B0	# <cjk>	[2000]
+0xF669	U+75B7	# <cjk>	[2000]
+0xF66A	U+75BF	# <cjk>	[2000]
+0xF66B	U+75C0	# <cjk>	[2000]
+0xF66C	U+75C6	# <cjk>	[2000]
+0xF66D	U+75CF	# <cjk>	[2000]
+0xF66E	U+75D3	# <cjk>	[2000]
+0xF66F	U+75DD	# <cjk>	[2000]
+0xF670	U+75DF	# <cjk>	[2000]
+0xF671	U+75E0	# <cjk>	[2000]
+0xF672	U+75E7	# <cjk>	[2000]
+0xF673	U+75EC	# <cjk>	[2000]
+0xF674	U+75EE	# <cjk>	[2000]
+0xF675	U+75F1	# <cjk>	[2000]
+0xF676	U+75F9	# <cjk>	[2000]
+0xF677	U+7603	# <cjk>	[2000]
+0xF678	U+7618	# <cjk>	[2000]
+0xF679	U+7607	# <cjk>	[2000]
+0xF67A	U+760F	# <cjk>	[2000]
+0xF67B	U+3FAE	# <cjk>	[2000]
+0xF67C	U+24E0E	# <cjk>	[2000]	[Unicode3.1]
+0xF67D	U+7613	# <cjk>	[2000]
+0xF67E	U+761B	# <cjk>	[2000]
+0xF680	U+761C	# <cjk>	[2000]
+0xF681	U+24E37	# <cjk>	[2000]	[Unicode3.1]
+0xF682	U+7625	# <cjk>	[2000]
+0xF683	U+7628	# <cjk>	[2000]
+0xF684	U+763C	# <cjk>	[2000]
+0xF685	U+7633	# <cjk>	[2000]
+0xF686	U+24E6A	# <cjk>	[2000]	[Unicode3.1]
+0xF687	U+3FC9	# <cjk>	[2000]
+0xF688	U+7641	# <cjk>	[2000]
+0xF689	U+24E8B	# <cjk>	[2000]	[Unicode3.1]
+0xF68A	U+7649	# <cjk>	[2000]
+0xF68B	U+7655	# <cjk>	[2000]
+0xF68C	U+3FD7	# <cjk>	[2000]
+0xF68D	U+766E	# <cjk>	[2000]
+0xF68E	U+7695	# <cjk>	[2000]
+0xF68F	U+769C	# <cjk>	[2000]
+0xF690	U+76A1	# <cjk>	[2000]
+0xF691	U+76A0	# <cjk>	[2000]
+0xF692	U+76A7	# <cjk>	[2000]
+0xF693	U+76A8	# <cjk>	[2000]
+0xF694	U+76AF	# <cjk>	[2000]
+0xF695	U+2504A	# <cjk>	[2000]	[Unicode3.1]
+0xF696	U+76C9	# <cjk>	[2000]
+0xF697	U+25055	# <cjk>	[2000]	[Unicode3.1]
+0xF698	U+76E8	# <cjk>	[2000]
+0xF699	U+76EC	# <cjk>	[2000]
+0xF69A	U+25122	# <cjk>	[2000]	[Unicode3.1]
+0xF69B	U+7717	# <cjk>	[2000]
+0xF69C	U+771A	# <cjk>	[2000]
+0xF69D	U+772D	# <cjk>	[2000]
+0xF69E	U+7735	# <cjk>	[2000]
+0xF69F	U+251A9	# <cjk>	[2000]	[Unicode3.1]
+0xF6A0	U+4039	# <cjk>	[2000]
+0xF6A1	U+251E5	# <cjk>	[2000]	[Unicode3.1]
+0xF6A2	U+251CD	# <cjk>	[2000]	[Unicode3.1]
+0xF6A3	U+7758	# <cjk>	[2000]
+0xF6A4	U+7760	# <cjk>	[2000]
+0xF6A5	U+776A	# <cjk>	[2000]
+0xF6A6	U+2521E	# <cjk>	[2000]	[Unicode3.1]
+0xF6A7	U+7772	# <cjk>	[2000]
+0xF6A8	U+777C	# <cjk>	[2000]
+0xF6A9	U+777D	# <cjk>	[2000]
+0xF6AA	U+2524C	# <cjk>	[2000]	[Unicode3.1]
+0xF6AB	U+4058	# <cjk>	[2000]
+0xF6AC	U+779A	# <cjk>	[2000]
+0xF6AD	U+779F	# <cjk>	[2000]
+0xF6AE	U+77A2	# <cjk>	[2000]
+0xF6AF	U+77A4	# <cjk>	[2000]
+0xF6B0	U+77A9	# <cjk>	[2000]
+0xF6B1	U+77DE	# <cjk>	[2000]
+0xF6B2	U+77DF	# <cjk>	[2000]
+0xF6B3	U+77E4	# <cjk>	[2000]
+0xF6B4	U+77E6	# <cjk>	[2000]
+0xF6B5	U+77EA	# <cjk>	[2000]
+0xF6B6	U+77EC	# <cjk>	[2000]
+0xF6B7	U+4093	# <cjk>	[2000]
+0xF6B8	U+77F0	# <cjk>	[2000]
+0xF6B9	U+77F4	# <cjk>	[2000]
+0xF6BA	U+77FB	# <cjk>	[2000]
+0xF6BB	U+2542E	# <cjk>	[2000]	[Unicode3.1]
+0xF6BC	U+7805	# <cjk>	[2000]
+0xF6BD	U+7806	# <cjk>	[2000]
+0xF6BE	U+7809	# <cjk>	[2000]
+0xF6BF	U+780D	# <cjk>	[2000]
+0xF6C0	U+7819	# <cjk>	[2000]
+0xF6C1	U+7821	# <cjk>	[2000]
+0xF6C2	U+782C	# <cjk>	[2000]
+0xF6C3	U+7847	# <cjk>	[2000]
+0xF6C4	U+7864	# <cjk>	[2000]
+0xF6C5	U+786A	# <cjk>	[2000]
+0xF6C6	U+254D9	# <cjk>	[2000]	[Unicode3.1]
+0xF6C7	U+788A	# <cjk>	[2000]
+0xF6C8	U+7894	# <cjk>	[2000]
+0xF6C9	U+78A4	# <cjk>	[2000]
+0xF6CA	U+789D	# <cjk>	[2000]
+0xF6CB	U+789E	# <cjk>	[2000]
+0xF6CC	U+789F	# <cjk>	[2000]
+0xF6CD	U+78BB	# <cjk>	[2000]
+0xF6CE	U+78C8	# <cjk>	[2000]
+0xF6CF	U+78CC	# <cjk>	[2000]
+0xF6D0	U+78CE	# <cjk>	[2000]
+0xF6D1	U+78D5	# <cjk>	[2000]
+0xF6D2	U+78E0	# <cjk>	[2000]
+0xF6D3	U+78E1	# <cjk>	[2000]
+0xF6D4	U+78E6	# <cjk>	[2000]
+0xF6D5	U+78F9	# <cjk>	[2000]
+0xF6D6	U+78FA	# <cjk>	[2000]
+0xF6D7	U+78FB	# <cjk>	[2000]
+0xF6D8	U+78FE	# <cjk>	[2000]
+0xF6D9	U+255A7	# <cjk>	[2000]	[Unicode3.1]
+0xF6DA	U+7910	# <cjk>	[2000]
+0xF6DB	U+791B	# <cjk>	[2000]
+0xF6DC	U+7930	# <cjk>	[2000]
+0xF6DD	U+7925	# <cjk>	[2000]
+0xF6DE	U+793B	# <cjk>	[2000]
+0xF6DF	U+794A	# <cjk>	[2000]
+0xF6E0	U+7958	# <cjk>	[2000]
+0xF6E1	U+795B	# <cjk>	[2000]
+0xF6E2	U+4105	# <cjk>	[2000]
+0xF6E3	U+7967	# <cjk>	[2000]
+0xF6E4	U+7972	# <cjk>	[2000]
+0xF6E5	U+7994	# <cjk>	[2000]
+0xF6E6	U+7995	# <cjk>	[2000]
+0xF6E7	U+7996	# <cjk>	[2000]
+0xF6E8	U+799B	# <cjk>	[2000]
+0xF6E9	U+79A1	# <cjk>	[2000]
+0xF6EA	U+79A9	# <cjk>	[2000]
+0xF6EB	U+79B4	# <cjk>	[2000]
+0xF6EC	U+79BB	# <cjk>	[2000]
+0xF6ED	U+79C2	# <cjk>	[2000]
+0xF6EE	U+79C7	# <cjk>	[2000]
+0xF6EF	U+79CC	# <cjk>	[2000]
+0xF6F0	U+79CD	# <cjk>	[2000]
+0xF6F1	U+79D6	# <cjk>	[2000]
+0xF6F2	U+4148	# <cjk>	[2000]
+0xF6F3	U+257A9	# <cjk>	[2000]	[Unicode3.1]
+0xF6F4	U+257B4	# <cjk>	[2000]	[Unicode3.1]
+0xF6F5	U+414F	# <cjk>	[2000]
+0xF6F6	U+7A0A	# <cjk>	[2000]
+0xF6F7	U+7A11	# <cjk>	[2000]
+0xF6F8	U+7A15	# <cjk>	[2000]
+0xF6F9	U+7A1B	# <cjk>	[2000]
+0xF6FA	U+7A1E	# <cjk>	[2000]
+0xF6FB	U+4163	# <cjk>	[2000]
+0xF6FC	U+7A2D	# <cjk>	[2000]
+0xF740	U+7A38	# <cjk>	[2000]
+0xF741	U+7A47	# <cjk>	[2000]
+0xF742	U+7A4C	# <cjk>	[2000]
+0xF743	U+7A56	# <cjk>	[2000]
+0xF744	U+7A59	# <cjk>	[2000]
+0xF745	U+7A5C	# <cjk>	[2000]
+0xF746	U+7A5F	# <cjk>	[2000]
+0xF747	U+7A60	# <cjk>	[2000]
+0xF748	U+7A67	# <cjk>	[2000]
+0xF749	U+7A6A	# <cjk>	[2000]
+0xF74A	U+7A75	# <cjk>	[2000]
+0xF74B	U+7A78	# <cjk>	[2000]
+0xF74C	U+7A82	# <cjk>	[2000]
+0xF74D	U+7A8A	# <cjk>	[2000]
+0xF74E	U+7A90	# <cjk>	[2000]
+0xF74F	U+7AA3	# <cjk>	[2000]
+0xF750	U+7AAC	# <cjk>	[2000]
+0xF751	U+259D4	# <cjk>	[2000]	[Unicode3.1]
+0xF752	U+41B4	# <cjk>	[2000]
+0xF753	U+7AB9	# <cjk>	[2000]
+0xF754	U+7ABC	# <cjk>	[2000]
+0xF755	U+7ABE	# <cjk>	[2000]
+0xF756	U+41BF	# <cjk>	[2000]
+0xF757	U+7ACC	# <cjk>	[2000]
+0xF758	U+7AD1	# <cjk>	[2000]
+0xF759	U+7AE7	# <cjk>	[2000]
+0xF75A	U+7AE8	# <cjk>	[2000]
+0xF75B	U+7AF4	# <cjk>	[2000]
+0xF75C	U+25AE4	# <cjk>	[2000]	[Unicode3.1]
+0xF75D	U+25AE3	# <cjk>	[2000]	[Unicode3.1]
+0xF75E	U+7B07	# <cjk>	[2000]
+0xF75F	U+25AF1	# <cjk>	[2000]	[Unicode3.1]
+0xF760	U+7B3D	# <cjk>	[2000]
+0xF761	U+7B27	# <cjk>	[2000]
+0xF762	U+7B2A	# <cjk>	[2000]
+0xF763	U+7B2E	# <cjk>	[2000]
+0xF764	U+7B2F	# <cjk>	[2000]
+0xF765	U+7B31	# <cjk>	[2000]
+0xF766	U+41E6	# <cjk>	[2000]
+0xF767	U+41F3	# <cjk>	[2000]
+0xF768	U+7B7F	# <cjk>	[2000]
+0xF769	U+7B41	# <cjk>	[2000]
+0xF76A	U+41EE	# <cjk>	[2000]
+0xF76B	U+7B55	# <cjk>	[2000]
+0xF76C	U+7B79	# <cjk>	[2000]
+0xF76D	U+7B64	# <cjk>	[2000]
+0xF76E	U+7B66	# <cjk>	[2000]
+0xF76F	U+7B69	# <cjk>	[2000]
+0xF770	U+7B73	# <cjk>	[2000]
+0xF771	U+25BB2	# <cjk>	[2000]	[Unicode3.1]
+0xF772	U+4207	# <cjk>	[2000]
+0xF773	U+7B90	# <cjk>	[2000]
+0xF774	U+7B91	# <cjk>	[2000]
+0xF775	U+7B9B	# <cjk>	[2000]
+0xF776	U+420E	# <cjk>	[2000]
+0xF777	U+7BAF	# <cjk>	[2000]
+0xF778	U+7BB5	# <cjk>	[2000]
+0xF779	U+7BBC	# <cjk>	[2000]
+0xF77A	U+7BC5	# <cjk>	[2000]
+0xF77B	U+7BCA	# <cjk>	[2000]
+0xF77C	U+25C4B	# <cjk>	[2000]	[Unicode3.1]
+0xF77D	U+25C64	# <cjk>	[2000]	[Unicode3.1]
+0xF77E	U+7BD4	# <cjk>	[2000]
+0xF780	U+7BD6	# <cjk>	[2000]
+0xF781	U+7BDA	# <cjk>	[2000]
+0xF782	U+7BEA	# <cjk>	[2000]
+0xF783	U+7BF0	# <cjk>	[2000]
+0xF784	U+7C03	# <cjk>	[2000]
+0xF785	U+7C0B	# <cjk>	[2000]
+0xF786	U+7C0E	# <cjk>	[2000]
+0xF787	U+7C0F	# <cjk>	[2000]
+0xF788	U+7C26	# <cjk>	[2000]
+0xF789	U+7C45	# <cjk>	[2000]
+0xF78A	U+7C4A	# <cjk>	[2000]
+0xF78B	U+7C51	# <cjk>	[2000]
+0xF78C	U+7C57	# <cjk>	[2000]
+0xF78D	U+7C5E	# <cjk>	[2000]
+0xF78E	U+7C61	# <cjk>	[2000]
+0xF78F	U+7C69	# <cjk>	[2000]
+0xF790	U+7C6E	# <cjk>	[2000]
+0xF791	U+7C6F	# <cjk>	[2000]
+0xF792	U+7C70	# <cjk>	[2000]
+0xF793	U+25E2E	# <cjk>	[2000]	[Unicode3.1]
+0xF794	U+25E56	# <cjk>	[2000]	[Unicode3.1]
+0xF795	U+25E65	# <cjk>	[2000]	[Unicode3.1]
+0xF796	U+7CA6	# <cjk>	[2000]
+0xF797	U+25E62	# <cjk>	[2000]	[Unicode3.1]
+0xF798	U+7CB6	# <cjk>	[2000]
+0xF799	U+7CB7	# <cjk>	[2000]
+0xF79A	U+7CBF	# <cjk>	[2000]
+0xF79B	U+25ED8	# <cjk>	[2000]	[Unicode3.1]
+0xF79C	U+7CC4	# <cjk>	[2000]
+0xF79D	U+25EC2	# <cjk>	[2000]	[Unicode3.1]
+0xF79E	U+7CC8	# <cjk>	[2000]
+0xF79F	U+7CCD	# <cjk>	[2000]
+0xF7A0	U+25EE8	# <cjk>	[2000]	[Unicode3.1]
+0xF7A1	U+7CD7	# <cjk>	[2000]
+0xF7A2	U+25F23	# <cjk>	[2000]	[Unicode3.1]
+0xF7A3	U+7CE6	# <cjk>	[2000]
+0xF7A4	U+7CEB	# <cjk>	[2000]
+0xF7A5	U+25F5C	# <cjk>	[2000]	[Unicode3.1]
+0xF7A6	U+7CF5	# <cjk>	[2000]
+0xF7A7	U+7D03	# <cjk>	[2000]
+0xF7A8	U+7D09	# <cjk>	[2000]
+0xF7A9	U+42C6	# <cjk>	[2000]
+0xF7AA	U+7D12	# <cjk>	[2000]
+0xF7AB	U+7D1E	# <cjk>	[2000]
+0xF7AC	U+25FE0	# <cjk>	[2000]	[Unicode3.1]
+0xF7AD	U+25FD4	# <cjk>	[2000]	[Unicode3.1]
+0xF7AE	U+7D3D	# <cjk>	[2000]
+0xF7AF	U+7D3E	# <cjk>	[2000]
+0xF7B0	U+7D40	# <cjk>	[2000]
+0xF7B1	U+7D47	# <cjk>	[2000]
+0xF7B2	U+2600C	# <cjk>	[2000]	[Unicode3.1]
+0xF7B3	U+25FFB	# <cjk>	[2000]	[Unicode3.1]
+0xF7B4	U+42D6	# <cjk>	[2000]
+0xF7B5	U+7D59	# <cjk>	[2000]
+0xF7B6	U+7D5A	# <cjk>	[2000]
+0xF7B7	U+7D6A	# <cjk>	[2000]
+0xF7B8	U+7D70	# <cjk>	[2000]
+0xF7B9	U+42DD	# <cjk>	[2000]
+0xF7BA	U+7D7F	# <cjk>	[2000]
+0xF7BB	U+26017	# <cjk>	[2000]	[Unicode3.1]
+0xF7BC	U+7D86	# <cjk>	[2000]
+0xF7BD	U+7D88	# <cjk>	[2000]
+0xF7BE	U+7D8C	# <cjk>	[2000]
+0xF7BF	U+7D97	# <cjk>	[2000]
+0xF7C0	U+26060	# <cjk>	[2000]	[Unicode3.1]
+0xF7C1	U+7D9D	# <cjk>	[2000]
+0xF7C2	U+7DA7	# <cjk>	[2000]
+0xF7C3	U+7DAA	# <cjk>	[2000]
+0xF7C4	U+7DB6	# <cjk>	[2000]
+0xF7C5	U+7DB7	# <cjk>	[2000]
+0xF7C6	U+7DC0	# <cjk>	[2000]
+0xF7C7	U+7DD7	# <cjk>	[2000]
+0xF7C8	U+7DD9	# <cjk>	[2000]
+0xF7C9	U+7DE6	# <cjk>	[2000]
+0xF7CA	U+7DF1	# <cjk>	[2000]
+0xF7CB	U+7DF9	# <cjk>	[2000]
+0xF7CC	U+4302	# <cjk>	[2000]
+0xF7CD	U+260ED	# <cjk>	[2000]	[Unicode3.1]
+0xF7CE	U+FA58	# CJK COMPATIBILITY IDEOGRAPH-FA58	[2000]	[Unicode3.2]
+0xF7CF	U+7E10	# <cjk>	[2000]
+0xF7D0	U+7E17	# <cjk>	[2000]
+0xF7D1	U+7E1D	# <cjk>	[2000]
+0xF7D2	U+7E20	# <cjk>	[2000]
+0xF7D3	U+7E27	# <cjk>	[2000]
+0xF7D4	U+7E2C	# <cjk>	[2000]
+0xF7D5	U+7E45	# <cjk>	[2000]
+0xF7D6	U+7E73	# <cjk>	[2000]
+0xF7D7	U+7E75	# <cjk>	[2000]
+0xF7D8	U+7E7E	# <cjk>	[2000]
+0xF7D9	U+7E86	# <cjk>	[2000]
+0xF7DA	U+7E87	# <cjk>	[2000]
+0xF7DB	U+432B	# <cjk>	[2000]
+0xF7DC	U+7E91	# <cjk>	[2000]
+0xF7DD	U+7E98	# <cjk>	[2000]
+0xF7DE	U+7E9A	# <cjk>	[2000]
+0xF7DF	U+4343	# <cjk>	[2000]
+0xF7E0	U+7F3C	# <cjk>	[2000]
+0xF7E1	U+7F3B	# <cjk>	[2000]
+0xF7E2	U+7F3E	# <cjk>	[2000]
+0xF7E3	U+7F43	# <cjk>	[2000]
+0xF7E4	U+7F44	# <cjk>	[2000]
+0xF7E5	U+7F4F	# <cjk>	[2000]
+0xF7E6	U+34C1	# <cjk>	[2000]
+0xF7E7	U+26270	# <cjk>	[2000]	[Unicode3.1]
+0xF7E8	U+7F52	# <cjk>	[2000]
+0xF7E9	U+26286	# <cjk>	[2000]	[Unicode3.1]
+0xF7EA	U+7F61	# <cjk>	[2000]
+0xF7EB	U+7F63	# <cjk>	[2000]
+0xF7EC	U+7F64	# <cjk>	[2000]
+0xF7ED	U+7F6D	# <cjk>	[2000]
+0xF7EE	U+7F7D	# <cjk>	[2000]
+0xF7EF	U+7F7E	# <cjk>	[2000]
+0xF7F0	U+2634C	# <cjk>	[2000]	[Unicode3.1]
+0xF7F1	U+7F90	# <cjk>	[2000]
+0xF7F2	U+517B	# <cjk>	[2000]
+0xF7F3	U+23D0E	# <cjk>	[2000]	[Unicode3.1]
+0xF7F4	U+7F96	# <cjk>	[2000]
+0xF7F5	U+7F9C	# <cjk>	[2000]
+0xF7F6	U+7FAD	# <cjk>	[2000]
+0xF7F7	U+26402	# <cjk>	[2000]	[Unicode3.1]
+0xF7F8	U+7FC3	# <cjk>	[2000]
+0xF7F9	U+7FCF	# <cjk>	[2000]
+0xF7FA	U+7FE3	# <cjk>	[2000]
+0xF7FB	U+7FE5	# <cjk>	[2000]
+0xF7FC	U+7FEF	# <cjk>	[2000]
+0xF840	U+7FF2	# <cjk>	[2000]
+0xF841	U+8002	# <cjk>	[2000]
+0xF842	U+800A	# <cjk>	[2000]
+0xF843	U+8008	# <cjk>	[2000]
+0xF844	U+800E	# <cjk>	[2000]
+0xF845	U+8011	# <cjk>	[2000]
+0xF846	U+8016	# <cjk>	[2000]
+0xF847	U+8024	# <cjk>	[2000]
+0xF848	U+802C	# <cjk>	[2000]
+0xF849	U+8030	# <cjk>	[2000]
+0xF84A	U+8043	# <cjk>	[2000]
+0xF84B	U+8066	# <cjk>	[2000]
+0xF84C	U+8071	# <cjk>	[2000]
+0xF84D	U+8075	# <cjk>	[2000]
+0xF84E	U+807B	# <cjk>	[2000]
+0xF84F	U+8099	# <cjk>	[2000]
+0xF850	U+809C	# <cjk>	[2000]
+0xF851	U+80A4	# <cjk>	[2000]
+0xF852	U+80A7	# <cjk>	[2000]
+0xF853	U+80B8	# <cjk>	[2000]
+0xF854	U+2667E	# <cjk>	[2000]	[Unicode3.1]
+0xF855	U+80C5	# <cjk>	[2000]
+0xF856	U+80D5	# <cjk>	[2000]
+0xF857	U+80D8	# <cjk>	[2000]
+0xF858	U+80E6	# <cjk>	[2000]
+0xF859	U+266B0	# <cjk>	[2000]	[Unicode3.1]
+0xF85A	U+810D	# <cjk>	[2000]
+0xF85B	U+80F5	# <cjk>	[2000]
+0xF85C	U+80FB	# <cjk>	[2000]
+0xF85D	U+43EE	# <cjk>	[2000]
+0xF85E	U+8135	# <cjk>	[2000]
+0xF85F	U+8116	# <cjk>	[2000]
+0xF860	U+811E	# <cjk>	[2000]
+0xF861	U+43F0	# <cjk>	[2000]
+0xF862	U+8124	# <cjk>	[2000]
+0xF863	U+8127	# <cjk>	[2000]
+0xF864	U+812C	# <cjk>	[2000]
+0xF865	U+2671D	# <cjk>	[2000]	[Unicode3.1]
+0xF866	U+813D	# <cjk>	[2000]
+0xF867	U+4408	# <cjk>	[2000]
+0xF868	U+8169	# <cjk>	[2000]
+0xF869	U+4417	# <cjk>	[2000]
+0xF86A	U+8181	# <cjk>	[2000]
+0xF86B	U+441C	# <cjk>	[2000]
+0xF86C	U+8184	# <cjk>	[2000]
+0xF86D	U+8185	# <cjk>	[2000]
+0xF86E	U+4422	# <cjk>	[2000]
+0xF86F	U+8198	# <cjk>	[2000]
+0xF870	U+81B2	# <cjk>	[2000]
+0xF871	U+81C1	# <cjk>	[2000]
+0xF872	U+81C3	# <cjk>	[2000]
+0xF873	U+81D6	# <cjk>	[2000]
+0xF874	U+81DB	# <cjk>	[2000]
+0xF875	U+268DD	# <cjk>	[2000]	[Unicode3.1]
+0xF876	U+81E4	# <cjk>	[2000]
+0xF877	U+268EA	# <cjk>	[2000]	[Unicode3.1]
+0xF878	U+81EC	# <cjk>	[2000]
+0xF879	U+26951	# <cjk>	[2000]	[Unicode3.1]
+0xF87A	U+81FD	# <cjk>	[2000]
+0xF87B	U+81FF	# <cjk>	[2000]
+0xF87C	U+2696F	# <cjk>	[2000]	[Unicode3.1]
+0xF87D	U+8204	# <cjk>	[2000]
+0xF87E	U+269DD	# <cjk>	[2000]	[Unicode3.1]
+0xF880	U+8219	# <cjk>	[2000]
+0xF881	U+8221	# <cjk>	[2000]
+0xF882	U+8222	# <cjk>	[2000]
+0xF883	U+26A1E	# <cjk>	[2000]	[Unicode3.1]
+0xF884	U+8232	# <cjk>	[2000]
+0xF885	U+8234	# <cjk>	[2000]
+0xF886	U+823C	# <cjk>	[2000]
+0xF887	U+8246	# <cjk>	[2000]
+0xF888	U+8249	# <cjk>	[2000]
+0xF889	U+8245	# <cjk>	[2000]
+0xF88A	U+26A58	# <cjk>	[2000]	[Unicode3.1]
+0xF88B	U+824B	# <cjk>	[2000]
+0xF88C	U+4476	# <cjk>	[2000]
+0xF88D	U+824F	# <cjk>	[2000]
+0xF88E	U+447A	# <cjk>	[2000]
+0xF88F	U+8257	# <cjk>	[2000]
+0xF890	U+26A8C	# <cjk>	[2000]	[Unicode3.1]
+0xF891	U+825C	# <cjk>	[2000]
+0xF892	U+8263	# <cjk>	[2000]
+0xF893	U+26AB7	# <cjk>	[2000]	[Unicode3.1]
+0xF894	U+FA5D	# CJK COMPATIBILITY IDEOGRAPH-FA5D	[2000]	[Unicode3.2]
+0xF895	U+FA5E	# CJK COMPATIBILITY IDEOGRAPH-FA5E	[2000]	[Unicode3.2]
+0xF896	U+8279	# <cjk>	[2000]
+0xF897	U+4491	# <cjk>	[2000]
+0xF898	U+827D	# <cjk>	[2000]
+0xF899	U+827F	# <cjk>	[2000]
+0xF89A	U+8283	# <cjk>	[2000]
+0xF89B	U+828A	# <cjk>	[2000]
+0xF89C	U+8293	# <cjk>	[2000]
+0xF89D	U+82A7	# <cjk>	[2000]
+0xF89E	U+82A8	# <cjk>	[2000]
+0xF89F	U+82B2	# <cjk>	[2000]
+0xF8A0	U+82B4	# <cjk>	[2000]
+0xF8A1	U+82BA	# <cjk>	[2000]
+0xF8A2	U+82BC	# <cjk>	[2000]
+0xF8A3	U+82E2	# <cjk>	[2000]
+0xF8A4	U+82E8	# <cjk>	[2000]
+0xF8A5	U+82F7	# <cjk>	[2000]
+0xF8A6	U+8307	# <cjk>	[2000]
+0xF8A7	U+8308	# <cjk>	[2000]
+0xF8A8	U+830C	# <cjk>	[2000]
+0xF8A9	U+8354	# <cjk>	[2000]
+0xF8AA	U+831B	# <cjk>	[2000]
+0xF8AB	U+831D	# <cjk>	[2000]
+0xF8AC	U+8330	# <cjk>	[2000]
+0xF8AD	U+833C	# <cjk>	[2000]
+0xF8AE	U+8344	# <cjk>	[2000]
+0xF8AF	U+8357	# <cjk>	[2000]
+0xF8B0	U+44BE	# <cjk>	[2000]
+0xF8B1	U+837F	# <cjk>	[2000]
+0xF8B2	U+44D4	# <cjk>	[2000]
+0xF8B3	U+44B3	# <cjk>	[2000]
+0xF8B4	U+838D	# <cjk>	[2000]
+0xF8B5	U+8394	# <cjk>	[2000]
+0xF8B6	U+8395	# <cjk>	[2000]
+0xF8B7	U+839B	# <cjk>	[2000]
+0xF8B8	U+839D	# <cjk>	[2000]
+0xF8B9	U+83C9	# <cjk>	[2000]
+0xF8BA	U+83D0	# <cjk>	[2000]
+0xF8BB	U+83D4	# <cjk>	[2000]
+0xF8BC	U+83DD	# <cjk>	[2000]
+0xF8BD	U+83E5	# <cjk>	[2000]
+0xF8BE	U+83F9	# <cjk>	[2000]
+0xF8BF	U+840F	# <cjk>	[2000]
+0xF8C0	U+8411	# <cjk>	[2000]
+0xF8C1	U+8415	# <cjk>	[2000]
+0xF8C2	U+26C73	# <cjk>	[2000]	[Unicode3.1]
+0xF8C3	U+8417	# <cjk>	[2000]
+0xF8C4	U+8439	# <cjk>	[2000]
+0xF8C5	U+844A	# <cjk>	[2000]
+0xF8C6	U+844F	# <cjk>	[2000]
+0xF8C7	U+8451	# <cjk>	[2000]
+0xF8C8	U+8452	# <cjk>	[2000]
+0xF8C9	U+8459	# <cjk>	[2000]
+0xF8CA	U+845A	# <cjk>	[2000]
+0xF8CB	U+845C	# <cjk>	[2000]
+0xF8CC	U+26CDD	# <cjk>	[2000]	[Unicode3.1]
+0xF8CD	U+8465	# <cjk>	[2000]
+0xF8CE	U+8476	# <cjk>	[2000]
+0xF8CF	U+8478	# <cjk>	[2000]
+0xF8D0	U+847C	# <cjk>	[2000]
+0xF8D1	U+8481	# <cjk>	[2000]
+0xF8D2	U+450D	# <cjk>	[2000]
+0xF8D3	U+84DC	# <cjk>	[2000]
+0xF8D4	U+8497	# <cjk>	[2000]
+0xF8D5	U+84A6	# <cjk>	[2000]
+0xF8D6	U+84BE	# <cjk>	[2000]
+0xF8D7	U+4508	# <cjk>	[2000]
+0xF8D8	U+84CE	# <cjk>	[2000]
+0xF8D9	U+84CF	# <cjk>	[2000]
+0xF8DA	U+84D3	# <cjk>	[2000]
+0xF8DB	U+26E65	# <cjk>	[2000]	[Unicode3.1]
+0xF8DC	U+84E7	# <cjk>	[2000]
+0xF8DD	U+84EA	# <cjk>	[2000]
+0xF8DE	U+84EF	# <cjk>	[2000]
+0xF8DF	U+84F0	# <cjk>	[2000]
+0xF8E0	U+84F1	# <cjk>	[2000]
+0xF8E1	U+84FA	# <cjk>	[2000]
+0xF8E2	U+84FD	# <cjk>	[2000]
+0xF8E3	U+850C	# <cjk>	[2000]
+0xF8E4	U+851B	# <cjk>	[2000]
+0xF8E5	U+8524	# <cjk>	[2000]
+0xF8E6	U+8525	# <cjk>	[2000]
+0xF8E7	U+852B	# <cjk>	[2000]
+0xF8E8	U+8534	# <cjk>	[2000]
+0xF8E9	U+854F	# <cjk>	[2000]
+0xF8EA	U+856F	# <cjk>	[2000]
+0xF8EB	U+4525	# <cjk>	[2000]
+0xF8EC	U+4543	# <cjk>	[2000]
+0xF8ED	U+853E	# <cjk>	[2000]
+0xF8EE	U+8551	# <cjk>	[2000]
+0xF8EF	U+8553	# <cjk>	[2000]
+0xF8F0	U+855E	# <cjk>	[2000]
+0xF8F1	U+8561	# <cjk>	[2000]
+0xF8F2	U+8562	# <cjk>	[2000]
+0xF8F3	U+26F94	# <cjk>	[2000]	[Unicode3.1]
+0xF8F4	U+857B	# <cjk>	[2000]
+0xF8F5	U+857D	# <cjk>	[2000]
+0xF8F6	U+857F	# <cjk>	[2000]
+0xF8F7	U+8581	# <cjk>	[2000]
+0xF8F8	U+8586	# <cjk>	[2000]
+0xF8F9	U+8593	# <cjk>	[2000]
+0xF8FA	U+859D	# <cjk>	[2000]
+0xF8FB	U+859F	# <cjk>	[2000]
+0xF8FC	U+26FF8	# <cjk>	[2000]	[Unicode3.1]
+0xF940	U+26FF6	# <cjk>	[2000]	[Unicode3.1]
+0xF941	U+26FF7	# <cjk>	[2000]	[Unicode3.1]
+0xF942	U+85B7	# <cjk>	[2000]
+0xF943	U+85BC	# <cjk>	[2000]
+0xF944	U+85C7	# <cjk>	[2000]
+0xF945	U+85CA	# <cjk>	[2000]
+0xF946	U+85D8	# <cjk>	[2000]
+0xF947	U+85D9	# <cjk>	[2000]
+0xF948	U+85DF	# <cjk>	[2000]
+0xF949	U+85E1	# <cjk>	[2000]
+0xF94A	U+85E6	# <cjk>	[2000]
+0xF94B	U+85F6	# <cjk>	[2000]
+0xF94C	U+8600	# <cjk>	[2000]
+0xF94D	U+8611	# <cjk>	[2000]
+0xF94E	U+861E	# <cjk>	[2000]
+0xF94F	U+8621	# <cjk>	[2000]
+0xF950	U+8624	# <cjk>	[2000]
+0xF951	U+8627	# <cjk>	[2000]
+0xF952	U+2710D	# <cjk>	[2000]	[Unicode3.1]
+0xF953	U+8639	# <cjk>	[2000]
+0xF954	U+863C	# <cjk>	[2000]
+0xF955	U+27139	# <cjk>	[2000]	[Unicode3.1]
+0xF956	U+8640	# <cjk>	[2000]
+0xF957	U+FA20	# CJK COMPATIBILITY IDEOGRAPH-FA20	[2000]
+0xF958	U+8653	# <cjk>	[2000]
+0xF959	U+8656	# <cjk>	[2000]
+0xF95A	U+866F	# <cjk>	[2000]
+0xF95B	U+8677	# <cjk>	[2000]
+0xF95C	U+867A	# <cjk>	[2000]
+0xF95D	U+8687	# <cjk>	[2000]
+0xF95E	U+8689	# <cjk>	[2000]
+0xF95F	U+868D	# <cjk>	[2000]
+0xF960	U+8691	# <cjk>	[2000]
+0xF961	U+869C	# <cjk>	[2000]
+0xF962	U+869D	# <cjk>	[2000]
+0xF963	U+86A8	# <cjk>	[2000]
+0xF964	U+FA21	# CJK COMPATIBILITY IDEOGRAPH-FA21	[2000]
+0xF965	U+86B1	# <cjk>	[2000]
+0xF966	U+86B3	# <cjk>	[2000]
+0xF967	U+86C1	# <cjk>	[2000]
+0xF968	U+86C3	# <cjk>	[2000]
+0xF969	U+86D1	# <cjk>	[2000]
+0xF96A	U+86D5	# <cjk>	[2000]
+0xF96B	U+86D7	# <cjk>	[2000]
+0xF96C	U+86E3	# <cjk>	[2000]
+0xF96D	U+86E6	# <cjk>	[2000]
+0xF96E	U+45B8	# <cjk>	[2000]
+0xF96F	U+8705	# <cjk>	[2000]
+0xF970	U+8707	# <cjk>	[2000]
+0xF971	U+870E	# <cjk>	[2000]
+0xF972	U+8710	# <cjk>	[2000]
+0xF973	U+8713	# <cjk>	[2000]
+0xF974	U+8719	# <cjk>	[2000]
+0xF975	U+871F	# <cjk>	[2000]
+0xF976	U+8721	# <cjk>	[2000]
+0xF977	U+8723	# <cjk>	[2000]
+0xF978	U+8731	# <cjk>	[2000]
+0xF979	U+873A	# <cjk>	[2000]
+0xF97A	U+873E	# <cjk>	[2000]
+0xF97B	U+8740	# <cjk>	[2000]
+0xF97C	U+8743	# <cjk>	[2000]
+0xF97D	U+8751	# <cjk>	[2000]
+0xF97E	U+8758	# <cjk>	[2000]
+0xF980	U+8764	# <cjk>	[2000]
+0xF981	U+8765	# <cjk>	[2000]
+0xF982	U+8772	# <cjk>	[2000]
+0xF983	U+877C	# <cjk>	[2000]
+0xF984	U+273DB	# <cjk>	[2000]	[Unicode3.1]
+0xF985	U+273DA	# <cjk>	[2000]	[Unicode3.1]
+0xF986	U+87A7	# <cjk>	[2000]
+0xF987	U+8789	# <cjk>	[2000]
+0xF988	U+878B	# <cjk>	[2000]
+0xF989	U+8793	# <cjk>	[2000]
+0xF98A	U+87A0	# <cjk>	[2000]
+0xF98B	U+273FE	# <cjk>	[2000]	[Unicode3.1]
+0xF98C	U+45E5	# <cjk>	[2000]
+0xF98D	U+87BE	# <cjk>	[2000]
+0xF98E	U+27410	# <cjk>	[2000]	[Unicode3.1]
+0xF98F	U+87C1	# <cjk>	[2000]
+0xF990	U+87CE	# <cjk>	[2000]
+0xF991	U+87F5	# <cjk>	[2000]
+0xF992	U+87DF	# <cjk>	[2000]
+0xF993	U+27449	# <cjk>	[2000]	[Unicode3.1]
+0xF994	U+87E3	# <cjk>	[2000]
+0xF995	U+87E5	# <cjk>	[2000]
+0xF996	U+87E6	# <cjk>	[2000]
+0xF997	U+87EA	# <cjk>	[2000]
+0xF998	U+87EB	# <cjk>	[2000]
+0xF999	U+87ED	# <cjk>	[2000]
+0xF99A	U+8801	# <cjk>	[2000]
+0xF99B	U+8803	# <cjk>	[2000]
+0xF99C	U+880B	# <cjk>	[2000]
+0xF99D	U+8813	# <cjk>	[2000]
+0xF99E	U+8828	# <cjk>	[2000]
+0xF99F	U+882E	# <cjk>	[2000]
+0xF9A0	U+8832	# <cjk>	[2000]
+0xF9A1	U+883C	# <cjk>	[2000]
+0xF9A2	U+460F	# <cjk>	[2000]
+0xF9A3	U+884A	# <cjk>	[2000]
+0xF9A4	U+8858	# <cjk>	[2000]
+0xF9A5	U+885F	# <cjk>	[2000]
+0xF9A6	U+8864	# <cjk>	[2000]
+0xF9A7	U+27615	# <cjk>	[2000]	[Unicode3.1]
+0xF9A8	U+27614	# <cjk>	[2000]	[Unicode3.1]
+0xF9A9	U+8869	# <cjk>	[2000]
+0xF9AA	U+27631	# <cjk>	[2000]	[Unicode3.1]
+0xF9AB	U+886F	# <cjk>	[2000]
+0xF9AC	U+88A0	# <cjk>	[2000]
+0xF9AD	U+88BC	# <cjk>	[2000]
+0xF9AE	U+88BD	# <cjk>	[2000]
+0xF9AF	U+88BE	# <cjk>	[2000]
+0xF9B0	U+88C0	# <cjk>	[2000]
+0xF9B1	U+88D2	# <cjk>	[2000]
+0xF9B2	U+27693	# <cjk>	[2000]	[Unicode3.1]
+0xF9B3	U+88D1	# <cjk>	[2000]
+0xF9B4	U+88D3	# <cjk>	[2000]
+0xF9B5	U+88DB	# <cjk>	[2000]
+0xF9B6	U+88F0	# <cjk>	[2000]
+0xF9B7	U+88F1	# <cjk>	[2000]
+0xF9B8	U+4641	# <cjk>	[2000]
+0xF9B9	U+8901	# <cjk>	[2000]
+0xF9BA	U+2770E	# <cjk>	[2000]	[Unicode3.1]
+0xF9BB	U+8937	# <cjk>	[2000]
+0xF9BC	U+27723	# <cjk>	[2000]	[Unicode3.1]
+0xF9BD	U+8942	# <cjk>	[2000]
+0xF9BE	U+8945	# <cjk>	[2000]
+0xF9BF	U+8949	# <cjk>	[2000]
+0xF9C0	U+27752	# <cjk>	[2000]	[Unicode3.1]
+0xF9C1	U+4665	# <cjk>	[2000]
+0xF9C2	U+8962	# <cjk>	[2000]
+0xF9C3	U+8980	# <cjk>	[2000]
+0xF9C4	U+8989	# <cjk>	[2000]
+0xF9C5	U+8990	# <cjk>	[2000]
+0xF9C6	U+899F	# <cjk>	[2000]
+0xF9C7	U+89B0	# <cjk>	[2000]
+0xF9C8	U+89B7	# <cjk>	[2000]
+0xF9C9	U+89D6	# <cjk>	[2000]
+0xF9CA	U+89D8	# <cjk>	[2000]
+0xF9CB	U+89EB	# <cjk>	[2000]
+0xF9CC	U+46A1	# <cjk>	[2000]
+0xF9CD	U+89F1	# <cjk>	[2000]
+0xF9CE	U+89F3	# <cjk>	[2000]
+0xF9CF	U+89FD	# <cjk>	[2000]
+0xF9D0	U+89FF	# <cjk>	[2000]
+0xF9D1	U+46AF	# <cjk>	[2000]
+0xF9D2	U+8A11	# <cjk>	[2000]
+0xF9D3	U+8A14	# <cjk>	[2000]
+0xF9D4	U+27985	# <cjk>	[2000]	[Unicode3.1]
+0xF9D5	U+8A21	# <cjk>	[2000]
+0xF9D6	U+8A35	# <cjk>	[2000]
+0xF9D7	U+8A3E	# <cjk>	[2000]
+0xF9D8	U+8A45	# <cjk>	[2000]
+0xF9D9	U+8A4D	# <cjk>	[2000]
+0xF9DA	U+8A58	# <cjk>	[2000]
+0xF9DB	U+8AAE	# <cjk>	[2000]
+0xF9DC	U+8A90	# <cjk>	[2000]
+0xF9DD	U+8AB7	# <cjk>	[2000]
+0xF9DE	U+8ABE	# <cjk>	[2000]
+0xF9DF	U+8AD7	# <cjk>	[2000]
+0xF9E0	U+8AFC	# <cjk>	[2000]
+0xF9E1	U+27A84	# <cjk>	[2000]	[Unicode3.1]
+0xF9E2	U+8B0A	# <cjk>	[2000]
+0xF9E3	U+8B05	# <cjk>	[2000]
+0xF9E4	U+8B0D	# <cjk>	[2000]
+0xF9E5	U+8B1C	# <cjk>	[2000]
+0xF9E6	U+8B1F	# <cjk>	[2000]
+0xF9E7	U+8B2D	# <cjk>	[2000]
+0xF9E8	U+8B43	# <cjk>	[2000]
+0xF9E9	U+470C	# <cjk>	[2000]
+0xF9EA	U+8B51	# <cjk>	[2000]
+0xF9EB	U+8B5E	# <cjk>	[2000]
+0xF9EC	U+8B76	# <cjk>	[2000]
+0xF9ED	U+8B7F	# <cjk>	[2000]
+0xF9EE	U+8B81	# <cjk>	[2000]
+0xF9EF	U+8B8B	# <cjk>	[2000]
+0xF9F0	U+8B94	# <cjk>	[2000]
+0xF9F1	U+8B95	# <cjk>	[2000]
+0xF9F2	U+8B9C	# <cjk>	[2000]
+0xF9F3	U+8B9E	# <cjk>	[2000]
+0xF9F4	U+8C39	# <cjk>	[2000]
+0xF9F5	U+27BB3	# <cjk>	[2000]	[Unicode3.1]
+0xF9F6	U+8C3D	# <cjk>	[2000]
+0xF9F7	U+27BBE	# <cjk>	[2000]	[Unicode3.1]
+0xF9F8	U+27BC7	# <cjk>	[2000]	[Unicode3.1]
+0xF9F9	U+8C45	# <cjk>	[2000]
+0xF9FA	U+8C47	# <cjk>	[2000]
+0xF9FB	U+8C4F	# <cjk>	[2000]
+0xF9FC	U+8C54	# <cjk>	[2000]
+0xFA40	U+8C57	# <cjk>	[2000]
+0xFA41	U+8C69	# <cjk>	[2000]
+0xFA42	U+8C6D	# <cjk>	[2000]
+0xFA43	U+8C73	# <cjk>	[2000]
+0xFA44	U+27CB8	# <cjk>	[2000]	[Unicode3.1]
+0xFA45	U+8C93	# <cjk>	[2000]
+0xFA46	U+8C92	# <cjk>	[2000]
+0xFA47	U+8C99	# <cjk>	[2000]
+0xFA48	U+4764	# <cjk>	[2000]
+0xFA49	U+8C9B	# <cjk>	[2000]
+0xFA4A	U+8CA4	# <cjk>	[2000]
+0xFA4B	U+8CD6	# <cjk>	[2000]
+0xFA4C	U+8CD5	# <cjk>	[2000]
+0xFA4D	U+8CD9	# <cjk>	[2000]
+0xFA4E	U+27DA0	# <cjk>	[2000]	[Unicode3.1]
+0xFA4F	U+8CF0	# <cjk>	[2000]
+0xFA50	U+8CF1	# <cjk>	[2000]
+0xFA51	U+27E10	# <cjk>	[2000]	[Unicode3.1]
+0xFA52	U+8D09	# <cjk>	[2000]
+0xFA53	U+8D0E	# <cjk>	[2000]
+0xFA54	U+8D6C	# <cjk>	[2000]
+0xFA55	U+8D84	# <cjk>	[2000]
+0xFA56	U+8D95	# <cjk>	[2000]
+0xFA57	U+8DA6	# <cjk>	[2000]
+0xFA58	U+27FB7	# <cjk>	[2000]	[Unicode3.1]
+0xFA59	U+8DC6	# <cjk>	[2000]
+0xFA5A	U+8DC8	# <cjk>	[2000]
+0xFA5B	U+8DD9	# <cjk>	[2000]
+0xFA5C	U+8DEC	# <cjk>	[2000]
+0xFA5D	U+8E0C	# <cjk>	[2000]
+0xFA5E	U+47FD	# <cjk>	[2000]
+0xFA5F	U+8DFD	# <cjk>	[2000]
+0xFA60	U+8E06	# <cjk>	[2000]
+0xFA61	U+2808A	# <cjk>	[2000]	[Unicode3.1]
+0xFA62	U+8E14	# <cjk>	[2000]
+0xFA63	U+8E16	# <cjk>	[2000]
+0xFA64	U+8E21	# <cjk>	[2000]
+0xFA65	U+8E22	# <cjk>	[2000]
+0xFA66	U+8E27	# <cjk>	[2000]
+0xFA67	U+280BB	# <cjk>	[2000]	[Unicode3.1]
+0xFA68	U+4816	# <cjk>	[2000]
+0xFA69	U+8E36	# <cjk>	[2000]
+0xFA6A	U+8E39	# <cjk>	[2000]
+0xFA6B	U+8E4B	# <cjk>	[2000]
+0xFA6C	U+8E54	# <cjk>	[2000]
+0xFA6D	U+8E62	# <cjk>	[2000]
+0xFA6E	U+8E6C	# <cjk>	[2000]
+0xFA6F	U+8E6D	# <cjk>	[2000]
+0xFA70	U+8E6F	# <cjk>	[2000]
+0xFA71	U+8E98	# <cjk>	[2000]
+0xFA72	U+8E9E	# <cjk>	[2000]
+0xFA73	U+8EAE	# <cjk>	[2000]
+0xFA74	U+8EB3	# <cjk>	[2000]
+0xFA75	U+8EB5	# <cjk>	[2000]
+0xFA76	U+8EB6	# <cjk>	[2000]
+0xFA77	U+8EBB	# <cjk>	[2000]
+0xFA78	U+28282	# <cjk>	[2000]	[Unicode3.1]
+0xFA79	U+8ED1	# <cjk>	[2000]
+0xFA7A	U+8ED4	# <cjk>	[2000]
+0xFA7B	U+484E	# <cjk>	[2000]
+0xFA7C	U+8EF9	# <cjk>	[2000]
+0xFA7D	U+282F3	# <cjk>	[2000]	[Unicode3.1]
+0xFA7E	U+8F00	# <cjk>	[2000]
+0xFA80	U+8F08	# <cjk>	[2000]
+0xFA81	U+8F17	# <cjk>	[2000]
+0xFA82	U+8F2B	# <cjk>	[2000]
+0xFA83	U+8F40	# <cjk>	[2000]
+0xFA84	U+8F4A	# <cjk>	[2000]
+0xFA85	U+8F58	# <cjk>	[2000]
+0xFA86	U+2840C	# <cjk>	[2000]	[Unicode3.1]
+0xFA87	U+8FA4	# <cjk>	[2000]
+0xFA88	U+8FB4	# <cjk>	[2000]
+0xFA89	U+FA66	# CJK COMPATIBILITY IDEOGRAPH-FA66	[2000]	[Unicode3.2]
+0xFA8A	U+8FB6	# <cjk>	[2000]
+0xFA8B	U+28455	# <cjk>	[2000]	[Unicode3.1]
+0xFA8C	U+8FC1	# <cjk>	[2000]
+0xFA8D	U+8FC6	# <cjk>	[2000]
+0xFA8E	U+FA24	# CJK COMPATIBILITY IDEOGRAPH-FA24	[2000]
+0xFA8F	U+8FCA	# <cjk>	[2000]
+0xFA90	U+8FCD	# <cjk>	[2000]
+0xFA91	U+8FD3	# <cjk>	[2000]
+0xFA92	U+8FD5	# <cjk>	[2000]
+0xFA93	U+8FE0	# <cjk>	[2000]
+0xFA94	U+8FF1	# <cjk>	[2000]
+0xFA95	U+8FF5	# <cjk>	[2000]
+0xFA96	U+8FFB	# <cjk>	[2000]
+0xFA97	U+9002	# <cjk>	[2000]
+0xFA98	U+900C	# <cjk>	[2000]
+0xFA99	U+9037	# <cjk>	[2000]
+0xFA9A	U+2856B	# <cjk>	[2000]	[Unicode3.1]
+0xFA9B	U+9043	# <cjk>	[2000]
+0xFA9C	U+9044	# <cjk>	[2000]
+0xFA9D	U+905D	# <cjk>	[2000]
+0xFA9E	U+285C8	# <cjk>	[2000]	[Unicode3.1]
+0xFA9F	U+285C9	# <cjk>	[2000]	[Unicode3.1]
+0xFAA0	U+9085	# <cjk>	[2000]
+0xFAA1	U+908C	# <cjk>	[2000]
+0xFAA2	U+9090	# <cjk>	[2000]
+0xFAA3	U+961D	# <cjk>	[2000]
+0xFAA4	U+90A1	# <cjk>	[2000]
+0xFAA5	U+48B5	# <cjk>	[2000]
+0xFAA6	U+90B0	# <cjk>	[2000]
+0xFAA7	U+90B6	# <cjk>	[2000]
+0xFAA8	U+90C3	# <cjk>	[2000]
+0xFAA9	U+90C8	# <cjk>	[2000]
+0xFAAA	U+286D7	# <cjk>	[2000]	[Unicode3.1]
+0xFAAB	U+90DC	# <cjk>	[2000]
+0xFAAC	U+90DF	# <cjk>	[2000]
+0xFAAD	U+286FA	# <cjk>	[2000]	[Unicode3.1]
+0xFAAE	U+90F6	# <cjk>	[2000]
+0xFAAF	U+90F2	# <cjk>	[2000]
+0xFAB0	U+9100	# <cjk>	[2000]
+0xFAB1	U+90EB	# <cjk>	[2000]
+0xFAB2	U+90FE	# <cjk>	[2000]
+0xFAB3	U+90FF	# <cjk>	[2000]
+0xFAB4	U+9104	# <cjk>	[2000]
+0xFAB5	U+9106	# <cjk>	[2000]
+0xFAB6	U+9118	# <cjk>	[2000]
+0xFAB7	U+911C	# <cjk>	[2000]
+0xFAB8	U+911E	# <cjk>	[2000]
+0xFAB9	U+9137	# <cjk>	[2000]
+0xFABA	U+9139	# <cjk>	[2000]
+0xFABB	U+913A	# <cjk>	[2000]
+0xFABC	U+9146	# <cjk>	[2000]
+0xFABD	U+9147	# <cjk>	[2000]
+0xFABE	U+9157	# <cjk>	[2000]
+0xFABF	U+9159	# <cjk>	[2000]
+0xFAC0	U+9161	# <cjk>	[2000]
+0xFAC1	U+9164	# <cjk>	[2000]
+0xFAC2	U+9174	# <cjk>	[2000]
+0xFAC3	U+9179	# <cjk>	[2000]
+0xFAC4	U+9185	# <cjk>	[2000]
+0xFAC5	U+918E	# <cjk>	[2000]
+0xFAC6	U+91A8	# <cjk>	[2000]
+0xFAC7	U+91AE	# <cjk>	[2000]
+0xFAC8	U+91B3	# <cjk>	[2000]
+0xFAC9	U+91B6	# <cjk>	[2000]
+0xFACA	U+91C3	# <cjk>	[2000]
+0xFACB	U+91C4	# <cjk>	[2000]
+0xFACC	U+91DA	# <cjk>	[2000]
+0xFACD	U+28949	# <cjk>	[2000]	[Unicode3.1]
+0xFACE	U+28946	# <cjk>	[2000]	[Unicode3.1]
+0xFACF	U+91EC	# <cjk>	[2000]
+0xFAD0	U+91EE	# <cjk>	[2000]
+0xFAD1	U+9201	# <cjk>	[2000]
+0xFAD2	U+920A	# <cjk>	[2000]
+0xFAD3	U+9216	# <cjk>	[2000]
+0xFAD4	U+9217	# <cjk>	[2000]
+0xFAD5	U+2896B	# <cjk>	[2000]	[Unicode3.1]
+0xFAD6	U+9233	# <cjk>	[2000]
+0xFAD7	U+9242	# <cjk>	[2000]
+0xFAD8	U+9247	# <cjk>	[2000]
+0xFAD9	U+924A	# <cjk>	[2000]
+0xFADA	U+924E	# <cjk>	[2000]
+0xFADB	U+9251	# <cjk>	[2000]
+0xFADC	U+9256	# <cjk>	[2000]
+0xFADD	U+9259	# <cjk>	[2000]
+0xFADE	U+9260	# <cjk>	[2000]
+0xFADF	U+9261	# <cjk>	[2000]
+0xFAE0	U+9265	# <cjk>	[2000]
+0xFAE1	U+9267	# <cjk>	[2000]
+0xFAE2	U+9268	# <cjk>	[2000]
+0xFAE3	U+28987	# <cjk>	[2000]	[Unicode3.1]
+0xFAE4	U+28988	# <cjk>	[2000]	[Unicode3.1]
+0xFAE5	U+927C	# <cjk>	[2000]
+0xFAE6	U+927D	# <cjk>	[2000]
+0xFAE7	U+927F	# <cjk>	[2000]
+0xFAE8	U+9289	# <cjk>	[2000]
+0xFAE9	U+928D	# <cjk>	[2000]
+0xFAEA	U+9297	# <cjk>	[2000]
+0xFAEB	U+9299	# <cjk>	[2000]
+0xFAEC	U+929F	# <cjk>	[2000]
+0xFAED	U+92A7	# <cjk>	[2000]
+0xFAEE	U+92AB	# <cjk>	[2000]
+0xFAEF	U+289BA	# <cjk>	[2000]	[Unicode3.1]
+0xFAF0	U+289BB	# <cjk>	[2000]	[Unicode3.1]
+0xFAF1	U+92B2	# <cjk>	[2000]
+0xFAF2	U+92BF	# <cjk>	[2000]
+0xFAF3	U+92C0	# <cjk>	[2000]
+0xFAF4	U+92C6	# <cjk>	[2000]
+0xFAF5	U+92CE	# <cjk>	[2000]
+0xFAF6	U+92D0	# <cjk>	[2000]
+0xFAF7	U+92D7	# <cjk>	[2000]
+0xFAF8	U+92D9	# <cjk>	[2000]
+0xFAF9	U+92E5	# <cjk>	[2000]
+0xFAFA	U+92E7	# <cjk>	[2000]
+0xFAFB	U+9311	# <cjk>	[2000]
+0xFAFC	U+28A1E	# <cjk>	[2000]	[Unicode3.1]
+0xFB40	U+28A29	# <cjk>	[2000]	[Unicode3.1]
+0xFB41	U+92F7	# <cjk>	[2000]
+0xFB42	U+92F9	# <cjk>	[2000]
+0xFB43	U+92FB	# <cjk>	[2000]
+0xFB44	U+9302	# <cjk>	[2000]
+0xFB45	U+930D	# <cjk>	[2000]
+0xFB46	U+9315	# <cjk>	[2000]
+0xFB47	U+931D	# <cjk>	[2000]
+0xFB48	U+931E	# <cjk>	[2000]
+0xFB49	U+9327	# <cjk>	[2000]
+0xFB4A	U+9329	# <cjk>	[2000]
+0xFB4B	U+28A71	# <cjk>	[2000]	[Unicode3.1]
+0xFB4C	U+28A43	# <cjk>	[2000]	[Unicode3.1]
+0xFB4D	U+9347	# <cjk>	[2000]
+0xFB4E	U+9351	# <cjk>	[2000]
+0xFB4F	U+9357	# <cjk>	[2000]
+0xFB50	U+935A	# <cjk>	[2000]
+0xFB51	U+936B	# <cjk>	[2000]
+0xFB52	U+9371	# <cjk>	[2000]
+0xFB53	U+9373	# <cjk>	[2000]
+0xFB54	U+93A1	# <cjk>	[2000]
+0xFB55	U+28A99	# <cjk>	[2000]	[Unicode3.1]
+0xFB56	U+28ACD	# <cjk>	[2000]	[Unicode3.1]
+0xFB57	U+9388	# <cjk>	[2000]
+0xFB58	U+938B	# <cjk>	[2000]
+0xFB59	U+938F	# <cjk>	[2000]
+0xFB5A	U+939E	# <cjk>	[2000]
+0xFB5B	U+93F5	# <cjk>	[2000]
+0xFB5C	U+28AE4	# <cjk>	[2000]	[Unicode3.1]
+0xFB5D	U+28ADD	# <cjk>	[2000]	[Unicode3.1]
+0xFB5E	U+93F1	# <cjk>	[2000]
+0xFB5F	U+93C1	# <cjk>	[2000]
+0xFB60	U+93C7	# <cjk>	[2000]
+0xFB61	U+93DC	# <cjk>	[2000]
+0xFB62	U+93E2	# <cjk>	[2000]
+0xFB63	U+93E7	# <cjk>	[2000]
+0xFB64	U+9409	# <cjk>	[2000]
+0xFB65	U+940F	# <cjk>	[2000]
+0xFB66	U+9416	# <cjk>	[2000]
+0xFB67	U+9417	# <cjk>	[2000]
+0xFB68	U+93FB	# <cjk>	[2000]
+0xFB69	U+9432	# <cjk>	[2000]
+0xFB6A	U+9434	# <cjk>	[2000]
+0xFB6B	U+943B	# <cjk>	[2000]
+0xFB6C	U+9445	# <cjk>	[2000]
+0xFB6D	U+28BC1	# <cjk>	[2000]	[Unicode3.1]
+0xFB6E	U+28BEF	# <cjk>	[2000]	[Unicode3.1]
+0xFB6F	U+946D	# <cjk>	[2000]
+0xFB70	U+946F	# <cjk>	[2000]
+0xFB71	U+9578	# <cjk>	[2000]
+0xFB72	U+9579	# <cjk>	[2000]
+0xFB73	U+9586	# <cjk>	[2000]
+0xFB74	U+958C	# <cjk>	[2000]
+0xFB75	U+958D	# <cjk>	[2000]
+0xFB76	U+28D10	# <cjk>	[2000]	[Unicode3.1]
+0xFB77	U+95AB	# <cjk>	[2000]
+0xFB78	U+95B4	# <cjk>	[2000]
+0xFB79	U+28D71	# <cjk>	[2000]	[Unicode3.1]
+0xFB7A	U+95C8	# <cjk>	[2000]
+0xFB7B	U+28DFB	# <cjk>	[2000]	[Unicode3.1]
+0xFB7C	U+28E1F	# <cjk>	[2000]	[Unicode3.1]
+0xFB7D	U+962C	# <cjk>	[2000]
+0xFB7E	U+9633	# <cjk>	[2000]
+0xFB80	U+9634	# <cjk>	[2000]
+0xFB81	U+28E36	# <cjk>	[2000]	[Unicode3.1]
+0xFB82	U+963C	# <cjk>	[2000]
+0xFB83	U+9641	# <cjk>	[2000]
+0xFB84	U+9661	# <cjk>	[2000]
+0xFB85	U+28E89	# <cjk>	[2000]	[Unicode3.1]
+0xFB86	U+9682	# <cjk>	[2000]
+0xFB87	U+28EEB	# <cjk>	[2000]	[Unicode3.1]
+0xFB88	U+969A	# <cjk>	[2000]
+0xFB89	U+28F32	# <cjk>	[2000]	[Unicode3.1]
+0xFB8A	U+49E7	# <cjk>	[2000]
+0xFB8B	U+96A9	# <cjk>	[2000]
+0xFB8C	U+96AF	# <cjk>	[2000]
+0xFB8D	U+96B3	# <cjk>	[2000]
+0xFB8E	U+96BA	# <cjk>	[2000]
+0xFB8F	U+96BD	# <cjk>	[2000]
+0xFB90	U+49FA	# <cjk>	[2000]
+0xFB91	U+28FF8	# <cjk>	[2000]	[Unicode3.1]
+0xFB92	U+96D8	# <cjk>	[2000]
+0xFB93	U+96DA	# <cjk>	[2000]
+0xFB94	U+96DD	# <cjk>	[2000]
+0xFB95	U+4A04	# <cjk>	[2000]
+0xFB96	U+9714	# <cjk>	[2000]
+0xFB97	U+9723	# <cjk>	[2000]
+0xFB98	U+4A29	# <cjk>	[2000]
+0xFB99	U+9736	# <cjk>	[2000]
+0xFB9A	U+9741	# <cjk>	[2000]
+0xFB9B	U+9747	# <cjk>	[2000]
+0xFB9C	U+9755	# <cjk>	[2000]
+0xFB9D	U+9757	# <cjk>	[2000]
+0xFB9E	U+975B	# <cjk>	[2000]
+0xFB9F	U+976A	# <cjk>	[2000]
+0xFBA0	U+292A0	# <cjk>	[2000]	[Unicode3.1]
+0xFBA1	U+292B1	# <cjk>	[2000]	[Unicode3.1]
+0xFBA2	U+9796	# <cjk>	[2000]
+0xFBA3	U+979A	# <cjk>	[2000]
+0xFBA4	U+979E	# <cjk>	[2000]
+0xFBA5	U+97A2	# <cjk>	[2000]
+0xFBA6	U+97B1	# <cjk>	[2000]
+0xFBA7	U+97B2	# <cjk>	[2000]
+0xFBA8	U+97BE	# <cjk>	[2000]
+0xFBA9	U+97CC	# <cjk>	[2000]
+0xFBAA	U+97D1	# <cjk>	[2000]
+0xFBAB	U+97D4	# <cjk>	[2000]
+0xFBAC	U+97D8	# <cjk>	[2000]
+0xFBAD	U+97D9	# <cjk>	[2000]
+0xFBAE	U+97E1	# <cjk>	[2000]
+0xFBAF	U+97F1	# <cjk>	[2000]
+0xFBB0	U+9804	# <cjk>	[2000]
+0xFBB1	U+980D	# <cjk>	[2000]
+0xFBB2	U+980E	# <cjk>	[2000]
+0xFBB3	U+9814	# <cjk>	[2000]
+0xFBB4	U+9816	# <cjk>	[2000]
+0xFBB5	U+4ABC	# <cjk>	[2000]
+0xFBB6	U+29490	# <cjk>	[2000]	[Unicode3.1]
+0xFBB7	U+9823	# <cjk>	[2000]
+0xFBB8	U+9832	# <cjk>	[2000]
+0xFBB9	U+9833	# <cjk>	[2000]
+0xFBBA	U+9825	# <cjk>	[2000]
+0xFBBB	U+9847	# <cjk>	[2000]
+0xFBBC	U+9866	# <cjk>	[2000]
+0xFBBD	U+98AB	# <cjk>	[2000]
+0xFBBE	U+98AD	# <cjk>	[2000]
+0xFBBF	U+98B0	# <cjk>	[2000]
+0xFBC0	U+295CF	# <cjk>	[2000]	[Unicode3.1]
+0xFBC1	U+98B7	# <cjk>	[2000]
+0xFBC2	U+98B8	# <cjk>	[2000]
+0xFBC3	U+98BB	# <cjk>	[2000]
+0xFBC4	U+98BC	# <cjk>	[2000]
+0xFBC5	U+98BF	# <cjk>	[2000]
+0xFBC6	U+98C2	# <cjk>	[2000]
+0xFBC7	U+98C7	# <cjk>	[2000]
+0xFBC8	U+98CB	# <cjk>	[2000]
+0xFBC9	U+98E0	# <cjk>	[2000]
+0xFBCA	U+2967F	# <cjk>	[2000]	[Unicode3.1]
+0xFBCB	U+98E1	# <cjk>	[2000]
+0xFBCC	U+98E3	# <cjk>	[2000]
+0xFBCD	U+98E5	# <cjk>	[2000]
+0xFBCE	U+98EA	# <cjk>	[2000]
+0xFBCF	U+98F0	# <cjk>	[2000]
+0xFBD0	U+98F1	# <cjk>	[2000]
+0xFBD1	U+98F3	# <cjk>	[2000]
+0xFBD2	U+9908	# <cjk>	[2000]
+0xFBD3	U+4B3B	# <cjk>	[2000]
+0xFBD4	U+296F0	# <cjk>	[2000]	[Unicode3.1]
+0xFBD5	U+9916	# <cjk>	[2000]
+0xFBD6	U+9917	# <cjk>	[2000]
+0xFBD7	U+29719	# <cjk>	[2000]	[Unicode3.1]
+0xFBD8	U+991A	# <cjk>	[2000]
+0xFBD9	U+991B	# <cjk>	[2000]
+0xFBDA	U+991C	# <cjk>	[2000]
+0xFBDB	U+29750	# <cjk>	[2000]	[Unicode3.1]
+0xFBDC	U+9931	# <cjk>	[2000]
+0xFBDD	U+9932	# <cjk>	[2000]
+0xFBDE	U+9933	# <cjk>	[2000]
+0xFBDF	U+993A	# <cjk>	[2000]
+0xFBE0	U+993B	# <cjk>	[2000]
+0xFBE1	U+993C	# <cjk>	[2000]
+0xFBE2	U+9940	# <cjk>	[2000]
+0xFBE3	U+9941	# <cjk>	[2000]
+0xFBE4	U+9946	# <cjk>	[2000]
+0xFBE5	U+994D	# <cjk>	[2000]
+0xFBE6	U+994E	# <cjk>	[2000]
+0xFBE7	U+995C	# <cjk>	[2000]
+0xFBE8	U+995F	# <cjk>	[2000]
+0xFBE9	U+9960	# <cjk>	[2000]
+0xFBEA	U+99A3	# <cjk>	[2000]
+0xFBEB	U+99A6	# <cjk>	[2000]
+0xFBEC	U+99B9	# <cjk>	[2000]
+0xFBED	U+99BD	# <cjk>	[2000]
+0xFBEE	U+99BF	# <cjk>	[2000]
+0xFBEF	U+99C3	# <cjk>	[2000]
+0xFBF0	U+99C9	# <cjk>	[2000]
+0xFBF1	U+99D4	# <cjk>	[2000]
+0xFBF2	U+99D9	# <cjk>	[2000]
+0xFBF3	U+99DE	# <cjk>	[2000]
+0xFBF4	U+298C6	# <cjk>	[2000]	[Unicode3.1]
+0xFBF5	U+99F0	# <cjk>	[2000]
+0xFBF6	U+99F9	# <cjk>	[2000]
+0xFBF7	U+99FC	# <cjk>	[2000]
+0xFBF8	U+9A0A	# <cjk>	[2000]
+0xFBF9	U+9A11	# <cjk>	[2000]
+0xFBFA	U+9A16	# <cjk>	[2000]
+0xFBFB	U+9A1A	# <cjk>	[2000]
+0xFBFC	U+9A20	# <cjk>	[2000]
+0xFC40	U+9A31	# <cjk>	[2000]
+0xFC41	U+9A36	# <cjk>	[2000]
+0xFC42	U+9A44	# <cjk>	[2000]
+0xFC43	U+9A4C	# <cjk>	[2000]
+0xFC44	U+9A58	# <cjk>	[2000]
+0xFC45	U+4BC2	# <cjk>	[2000]
+0xFC46	U+9AAF	# <cjk>	[2000]
+0xFC47	U+4BCA	# <cjk>	[2000]
+0xFC48	U+9AB7	# <cjk>	[2000]
+0xFC49	U+4BD2	# <cjk>	[2000]
+0xFC4A	U+9AB9	# <cjk>	[2000]
+0xFC4B	U+29A72	# <cjk>	[2000]	[Unicode3.1]
+0xFC4C	U+9AC6	# <cjk>	[2000]
+0xFC4D	U+9AD0	# <cjk>	[2000]
+0xFC4E	U+9AD2	# <cjk>	[2000]
+0xFC4F	U+9AD5	# <cjk>	[2000]
+0xFC50	U+4BE8	# <cjk>	[2000]
+0xFC51	U+9ADC	# <cjk>	[2000]
+0xFC52	U+9AE0	# <cjk>	[2000]
+0xFC53	U+9AE5	# <cjk>	[2000]
+0xFC54	U+9AE9	# <cjk>	[2000]
+0xFC55	U+9B03	# <cjk>	[2000]
+0xFC56	U+9B0C	# <cjk>	[2000]
+0xFC57	U+9B10	# <cjk>	[2000]
+0xFC58	U+9B12	# <cjk>	[2000]
+0xFC59	U+9B16	# <cjk>	[2000]
+0xFC5A	U+9B1C	# <cjk>	[2000]
+0xFC5B	U+9B2B	# <cjk>	[2000]
+0xFC5C	U+9B33	# <cjk>	[2000]
+0xFC5D	U+9B3D	# <cjk>	[2000]
+0xFC5E	U+4C20	# <cjk>	[2000]
+0xFC5F	U+9B4B	# <cjk>	[2000]
+0xFC60	U+9B63	# <cjk>	[2000]
+0xFC61	U+9B65	# <cjk>	[2000]
+0xFC62	U+9B6B	# <cjk>	[2000]
+0xFC63	U+9B6C	# <cjk>	[2000]
+0xFC64	U+9B73	# <cjk>	[2000]
+0xFC65	U+9B76	# <cjk>	[2000]
+0xFC66	U+9B77	# <cjk>	[2000]
+0xFC67	U+9BA6	# <cjk>	[2000]
+0xFC68	U+9BAC	# <cjk>	[2000]
+0xFC69	U+9BB1	# <cjk>	[2000]
+0xFC6A	U+29DDB	# <cjk>	[2000]	[Unicode3.1]
+0xFC6B	U+29E3D	# <cjk>	[2000]	[Unicode3.1]
+0xFC6C	U+9BB2	# <cjk>	[2000]
+0xFC6D	U+9BB8	# <cjk>	[2000]
+0xFC6E	U+9BBE	# <cjk>	[2000]
+0xFC6F	U+9BC7	# <cjk>	[2000]
+0xFC70	U+9BF3	# <cjk>	[2000]
+0xFC71	U+9BD8	# <cjk>	[2000]
+0xFC72	U+9BDD	# <cjk>	[2000]
+0xFC73	U+9BE7	# <cjk>	[2000]
+0xFC74	U+9BEA	# <cjk>	[2000]
+0xFC75	U+9BEB	# <cjk>	[2000]
+0xFC76	U+9BEF	# <cjk>	[2000]
+0xFC77	U+9BEE	# <cjk>	[2000]
+0xFC78	U+29E15	# <cjk>	[2000]	[Unicode3.1]
+0xFC79	U+9BFA	# <cjk>	[2000]
+0xFC7A	U+29E8A	# <cjk>	[2000]	[Unicode3.1]
+0xFC7B	U+9BF7	# <cjk>	[2000]
+0xFC7C	U+29E49	# <cjk>	[2000]	[Unicode3.1]
+0xFC7D	U+9C16	# <cjk>	[2000]
+0xFC7E	U+9C18	# <cjk>	[2000]
+0xFC80	U+9C19	# <cjk>	[2000]
+0xFC81	U+9C1A	# <cjk>	[2000]
+0xFC82	U+9C1D	# <cjk>	[2000]
+0xFC83	U+9C22	# <cjk>	[2000]
+0xFC84	U+9C27	# <cjk>	[2000]
+0xFC85	U+9C29	# <cjk>	[2000]
+0xFC86	U+9C2A	# <cjk>	[2000]
+0xFC87	U+29EC4	# <cjk>	[2000]	[Unicode3.1]
+0xFC88	U+9C31	# <cjk>	[2000]
+0xFC89	U+9C36	# <cjk>	[2000]
+0xFC8A	U+9C37	# <cjk>	[2000]
+0xFC8B	U+9C45	# <cjk>	[2000]
+0xFC8C	U+9C5C	# <cjk>	[2000]
+0xFC8D	U+29EE9	# <cjk>	[2000]	[Unicode3.1]
+0xFC8E	U+9C49	# <cjk>	[2000]
+0xFC8F	U+9C4A	# <cjk>	[2000]
+0xFC90	U+29EDB	# <cjk>	[2000]	[Unicode3.1]
+0xFC91	U+9C54	# <cjk>	[2000]
+0xFC92	U+9C58	# <cjk>	[2000]
+0xFC93	U+9C5B	# <cjk>	[2000]
+0xFC94	U+9C5D	# <cjk>	[2000]
+0xFC95	U+9C5F	# <cjk>	[2000]
+0xFC96	U+9C69	# <cjk>	[2000]
+0xFC97	U+9C6A	# <cjk>	[2000]
+0xFC98	U+9C6B	# <cjk>	[2000]
+0xFC99	U+9C6D	# <cjk>	[2000]
+0xFC9A	U+9C6E	# <cjk>	[2000]
+0xFC9B	U+9C70	# <cjk>	[2000]
+0xFC9C	U+9C72	# <cjk>	[2000]
+0xFC9D	U+9C75	# <cjk>	[2000]
+0xFC9E	U+9C7A	# <cjk>	[2000]
+0xFC9F	U+9CE6	# <cjk>	[2000]
+0xFCA0	U+9CF2	# <cjk>	[2000]
+0xFCA1	U+9D0B	# <cjk>	[2000]
+0xFCA2	U+9D02	# <cjk>	[2000]
+0xFCA3	U+29FCE	# <cjk>	[2000]	[Unicode3.1]
+0xFCA4	U+9D11	# <cjk>	[2000]
+0xFCA5	U+9D17	# <cjk>	[2000]
+0xFCA6	U+9D18	# <cjk>	[2000]
+0xFCA7	U+2A02F	# <cjk>	[2000]	[Unicode3.1]
+0xFCA8	U+4CC4	# <cjk>	[2000]
+0xFCA9	U+2A01A	# <cjk>	[2000]	[Unicode3.1]
+0xFCAA	U+9D32	# <cjk>	[2000]
+0xFCAB	U+4CD1	# <cjk>	[2000]
+0xFCAC	U+9D42	# <cjk>	[2000]
+0xFCAD	U+9D4A	# <cjk>	[2000]
+0xFCAE	U+9D5F	# <cjk>	[2000]
+0xFCAF	U+9D62	# <cjk>	[2000]
+0xFCB0	U+2A0F9	# <cjk>	[2000]	[Unicode3.1]
+0xFCB1	U+9D69	# <cjk>	[2000]
+0xFCB2	U+9D6B	# <cjk>	[2000]
+0xFCB3	U+2A082	# <cjk>	[2000]	[Unicode3.1]
+0xFCB4	U+9D73	# <cjk>	[2000]
+0xFCB5	U+9D76	# <cjk>	[2000]
+0xFCB6	U+9D77	# <cjk>	[2000]
+0xFCB7	U+9D7E	# <cjk>	[2000]
+0xFCB8	U+9D84	# <cjk>	[2000]
+0xFCB9	U+9D8D	# <cjk>	[2000]
+0xFCBA	U+9D99	# <cjk>	[2000]
+0xFCBB	U+9DA1	# <cjk>	[2000]
+0xFCBC	U+9DBF	# <cjk>	[2000]
+0xFCBD	U+9DB5	# <cjk>	[2000]
+0xFCBE	U+9DB9	# <cjk>	[2000]
+0xFCBF	U+9DBD	# <cjk>	[2000]
+0xFCC0	U+9DC3	# <cjk>	[2000]
+0xFCC1	U+9DC7	# <cjk>	[2000]
+0xFCC2	U+9DC9	# <cjk>	[2000]
+0xFCC3	U+9DD6	# <cjk>	[2000]
+0xFCC4	U+9DDA	# <cjk>	[2000]
+0xFCC5	U+9DDF	# <cjk>	[2000]
+0xFCC6	U+9DE0	# <cjk>	[2000]
+0xFCC7	U+9DE3	# <cjk>	[2000]
+0xFCC8	U+9DF4	# <cjk>	[2000]
+0xFCC9	U+4D07	# <cjk>	[2000]
+0xFCCA	U+9E0A	# <cjk>	[2000]
+0xFCCB	U+9E02	# <cjk>	[2000]
+0xFCCC	U+9E0D	# <cjk>	[2000]
+0xFCCD	U+9E19	# <cjk>	[2000]
+0xFCCE	U+9E1C	# <cjk>	[2000]
+0xFCCF	U+9E1D	# <cjk>	[2000]
+0xFCD0	U+9E7B	# <cjk>	[2000]
+0xFCD1	U+22218	# <cjk>	[2000]	[Unicode3.1]
+0xFCD2	U+9E80	# <cjk>	[2000]
+0xFCD3	U+9E85	# <cjk>	[2000]
+0xFCD4	U+9E9B	# <cjk>	[2000]
+0xFCD5	U+9EA8	# <cjk>	[2000]
+0xFCD6	U+2A38C	# <cjk>	[2000]	[Unicode3.1]
+0xFCD7	U+9EBD	# <cjk>	[2000]
+0xFCD8	U+2A437	# <cjk>	[2000]	[Unicode3.1]
+0xFCD9	U+9EDF	# <cjk>	[2000]
+0xFCDA	U+9EE7	# <cjk>	[2000]
+0xFCDB	U+9EEE	# <cjk>	[2000]
+0xFCDC	U+9EFF	# <cjk>	[2000]
+0xFCDD	U+9F02	# <cjk>	[2000]
+0xFCDE	U+4D77	# <cjk>	[2000]
+0xFCDF	U+9F03	# <cjk>	[2000]
+0xFCE0	U+9F17	# <cjk>	[2000]
+0xFCE1	U+9F19	# <cjk>	[2000]
+0xFCE2	U+9F2F	# <cjk>	[2000]
+0xFCE3	U+9F37	# <cjk>	[2000]
+0xFCE4	U+9F3A	# <cjk>	[2000]
+0xFCE5	U+9F3D	# <cjk>	[2000]
+0xFCE6	U+9F41	# <cjk>	[2000]
+0xFCE7	U+9F45	# <cjk>	[2000]
+0xFCE8	U+9F46	# <cjk>	[2000]
+0xFCE9	U+9F53	# <cjk>	[2000]
+0xFCEA	U+9F55	# <cjk>	[2000]
+0xFCEB	U+9F58	# <cjk>	[2000]
+0xFCEC	U+2A5F1	# <cjk>	[2000]	[Unicode3.1]
+0xFCED	U+9F5D	# <cjk>	[2000]
+0xFCEE	U+2A602	# <cjk>	[2000]	[Unicode3.1]
+0xFCEF	U+9F69	# <cjk>	[2000]
+0xFCF0	U+2A61A	# <cjk>	[2000]	[Unicode3.1]
+0xFCF1	U+9F6D	# <cjk>	[2000]
+0xFCF2	U+9F70	# <cjk>	[2000]
+0xFCF3	U+9F75	# <cjk>	[2000]
+0xFCF4	U+2A6B2	# <cjk>	[2000]	[Unicode3.1]
--- a/jdk/make/tools/Makefile	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/make/tools/Makefile	Thu Jun 12 13:50:55 2008 -0700
@@ -51,7 +51,8 @@
   jdwpgen                   \
   makeclasslist             \
   strip_properties          \
-  winver
+  winver                    \
+  CharsetMapping
 
 all build clean clobber::
 	$(SUBDIRS-loop)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/make/tools/src/build/tools/charsetmapping/CharsetMapping.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,271 @@
+/*
+ * Copyright 2008 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 build.tools.charsetmapping;
+
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.OutputStream;
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import java.util.*;
+
+public class CharsetMapping {
+    public final static char UNMAPPABLE_DECODING = '\uFFFD';
+    public final static int  UNMAPPABLE_ENCODING = -1;
+
+    public static class Entry {
+        public int bs;   //byte sequence reps
+        public int cp;   //Unicode codepoint
+        public int cp2;  //CC of composite
+
+        public Entry () {}
+        public Entry (int bytes, int cp, int cp2) {
+            this.bs = bytes;
+            this.cp = cp;
+            this.cp2 = cp2;
+        }
+    }
+
+    static Comparator<Entry> comparatorCP =
+        new Comparator<Entry>() {
+            public int compare(Entry m1, Entry m2) {
+                return m1.cp - m2.cp;
+            }
+            public boolean equals(Object obj) {
+                return this == obj;
+            }
+    };
+
+    public static class Parser {
+        static final Pattern basic = Pattern.compile("(?:0x)?(\\p{XDigit}++)\\s++(?:0x)?(\\p{XDigit}++)?\\s*+.*");
+        static final int gBS = 1;
+        static final int gCP = 2;
+        static final int gCP2 = 3;
+
+        BufferedReader reader;
+        boolean closed;
+        Matcher matcher;
+        int gbs, gcp, gcp2;
+
+        public Parser (InputStream in, Pattern p, int gbs, int gcp, int gcp2)
+            throws IOException
+        {
+            this.reader = new BufferedReader(new InputStreamReader(in));
+            this.closed = false;
+            this.matcher = p.matcher("");
+            this.gbs = gbs;
+            this.gcp = gcp;
+            this.gcp2 = gcp2;
+        }
+
+        public Parser (InputStream in, Pattern p) throws IOException {
+            this(in, p, gBS, gCP, gCP2);
+        }
+
+        public Parser (InputStream in) throws IOException {
+            this(in, basic, gBS, gCP, gCP2);
+        }
+
+        protected boolean isDirective(String line) {
+            return line.startsWith("#");
+        }
+
+        protected Entry parse(Matcher matcher, Entry mapping) {
+            mapping.bs = Integer.parseInt(matcher.group(gbs), 16);
+            mapping.cp = Integer.parseInt(matcher.group(gcp), 16);
+            if (gcp2 <= matcher.groupCount() &&
+                matcher.group(gcp2) != null)
+                mapping.cp2 = Integer.parseInt(matcher.group(gcp2), 16);
+            else
+                mapping.cp2 = 0;
+            return mapping;
+        }
+
+        public Entry next() throws Exception {
+            return next(new Entry());
+        }
+
+        // returns null and closes the input stream if the eof has beenreached.
+        public Entry next(Entry mapping) throws Exception {
+            if (closed)
+                return null;
+            String line;
+            while ((line = reader.readLine()) != null) {
+                if (isDirective(line))
+                    continue;
+                matcher.reset(line);
+                if (!matcher.lookingAt()) {
+                    //System.out.println("Missed: " + line);
+                    continue;
+                }
+                return parse(matcher, mapping);
+            }
+            reader.close();
+            closed = true;
+            return null;
+        }
+    }
+
+    // tags of different charset mapping tables
+    private final static int MAP_SINGLEBYTE      = 0x1; // 0..256  : c
+    private final static int MAP_DOUBLEBYTE1     = 0x2; // min..max: c
+    private final static int MAP_DOUBLEBYTE2     = 0x3; // min..max: c [DB2]
+    private final static int MAP_SUPPLEMENT      = 0x5; //           db,c
+    private final static int MAP_SUPPLEMENT_C2B  = 0x6; //           c,db
+    private final static int MAP_COMPOSITE       = 0x7; //           db,base,cc
+    private final static int MAP_INDEXC2B        = 0x8; // index table of c->bb
+
+    private static final void writeShort(OutputStream out, int data)
+        throws IOException
+    {
+        out.write((data >>> 8) & 0xFF);
+        out.write((data      ) & 0xFF);
+    }
+
+    private static final void writeShortArray(OutputStream out,
+                                              int type,
+                                              int[] array,
+                                              int off,
+                                              int size)   // exclusive
+        throws IOException
+    {
+        writeShort(out, type);
+        writeShort(out, size);
+        for (int i = off; i < size; i++) {
+            writeShort(out, array[off+i]);
+        }
+    }
+
+    public static final void writeSIZE(OutputStream out, int data)
+        throws IOException
+    {
+        out.write((data >>> 24) & 0xFF);
+        out.write((data >>> 16) & 0xFF);
+        out.write((data >>>  8) & 0xFF);
+        out.write((data       ) & 0xFF);
+    }
+
+    public static void writeINDEXC2B(OutputStream out, int[] indexC2B)
+        throws IOException
+    {
+        writeShort(out, MAP_INDEXC2B);
+        writeShort(out, indexC2B.length);
+        int off = 0;
+        for (int i = 0; i < indexC2B.length; i++) {
+            if (indexC2B[i] != 0) {
+                writeShort(out, off);
+                off += 256;
+            } else {
+                writeShort(out, -1);
+            }
+        }
+    }
+
+    public static void writeSINGLEBYTE(OutputStream out, int[] sb)
+        throws IOException
+    {
+        writeShortArray(out, MAP_SINGLEBYTE, sb, 0, 256);
+    }
+
+    private static void writeDOUBLEBYTE(OutputStream out,
+                                        int type,
+                                        int[] db,
+                                        int b1Min, int b1Max,
+                                        int b2Min, int b2Max)
+        throws IOException
+    {
+        writeShort(out, type);
+        writeShort(out, b1Min);
+        writeShort(out, b1Max);
+        writeShort(out, b2Min);
+        writeShort(out, b2Max);
+        writeShort(out, (b1Max - b1Min + 1) * (b2Max - b2Min + 1));
+
+        for (int b1 = b1Min; b1 <= b1Max; b1++) {
+            for (int b2 = b2Min; b2 <= b2Max; b2++) {
+                writeShort(out, db[b1 * 256 + b2]);
+            }
+        }
+    }
+    public static void writeDOUBLEBYTE1(OutputStream out,
+                                        int[] db,
+                                        int b1Min, int b1Max,
+                                        int b2Min, int b2Max)
+        throws IOException
+    {
+        writeDOUBLEBYTE(out, MAP_DOUBLEBYTE1, db, b1Min, b1Max, b2Min, b2Max);
+    }
+
+    public static void writeDOUBLEBYTE2(OutputStream out,
+                                        int[] db,
+                                        int b1Min, int b1Max,
+                                        int b2Min, int b2Max)
+        throws IOException
+    {
+        writeDOUBLEBYTE(out, MAP_DOUBLEBYTE2, db, b1Min, b1Max, b2Min, b2Max);
+    }
+
+    // the c2b table is output as well
+    public static void writeSUPPLEMENT(OutputStream out, Entry[] supp, int size)
+        throws IOException
+    {
+        writeShort(out, MAP_SUPPLEMENT);
+        writeShort(out, size * 2);
+        // db at first half, cc at the low half
+        for (int i = 0; i < size; i++) {
+            writeShort(out, supp[i].bs);
+        }
+        for (int i = 0; i < size; i++) {
+            writeShort(out, supp[i].cp);
+        }
+
+        //c2b
+        writeShort(out, MAP_SUPPLEMENT_C2B);
+        writeShort(out, size*2);
+        Arrays.sort(supp, 0, size, comparatorCP);
+        for (int i = 0; i < size; i++) {
+            writeShort(out, supp[i].cp);
+        }
+        for (int i = 0; i < size; i++) {
+            writeShort(out, supp[i].bs);
+        }
+    }
+
+    public static void writeCOMPOSITE(OutputStream out, Entry[] comp, int size)
+        throws IOException
+    {
+        writeShort(out, MAP_COMPOSITE);
+        writeShort(out, size*3);
+        // comp is sorted already
+        for (int i = 0; i < size; i++) {
+            writeShort(out, (char)comp[i].bs);
+            writeShort(out, (char)comp[i].cp);
+            writeShort(out, (char)comp[i].cp2);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/make/tools/src/build/tools/charsetmapping/GenerateMapping.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,98 @@
+/*
+ * Copyright 2008 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 build.tools.charsetmapping;
+
+import java.io.*;
+import java.util.regex.*;
+import static build.tools.charsetmapping.CharsetMapping.*;
+
+public class GenerateMapping {
+    public static void main(String argv[]) throws IOException {
+        if (argv.length < 2) {
+            System.out.println("Usage: java GenCSData fMap fDat");
+            System.exit(1);
+        }
+        genDataJIS0213(new FileInputStream(argv[0]),
+                       new FileOutputStream(argv[1]));
+    }
+
+    // regex pattern to parse the "jis0213.map" file
+    static Pattern sjis0213 = Pattern.compile("0x(\\p{XDigit}++)\\s++U\\+(\\p{XDigit}++)(?:\\+(\\p{XDigit}++))?\\s++#.*");
+    private static void genDataJIS0213(InputStream in, OutputStream out)
+    {
+        int[] sb = new int[0x100];                         // singlebyte
+        int[] db = new int[0x10000];                       // doublebyte
+        int[] indexC2B = new int[256];
+        Entry[] supp = new Entry[0x10000];
+        Entry[] comp = new Entry[0x100];
+        int suppTotal = 0;
+        int compTotal = 0;
+
+        int b1Min1 = 0x81;
+        int b1Max1 = 0x9f;
+        int b1Min2 = 0xe0;
+        int b1Max2 = 0xfc;
+        int b2Min = 0x40;
+        int b2Max = 0xfe;
+
+        //init
+        for (int i = 0; i < 0x80; i++) sb[i] = i;
+        for (int i = 0x80; i < 0x100; i++) sb[i] = UNMAPPABLE_DECODING;
+        for (int i = 0; i < 0x10000; i++) db[i] = UNMAPPABLE_DECODING;
+        try {
+            Parser p = new Parser(in, sjis0213);
+            Entry  e = null;
+            while ((e = p.next()) != null) {
+                if (e.cp2 != 0) {
+                    comp[compTotal++] = e;
+                } else {
+                    if (e.cp <= 0xffff) {
+                        if (e.bs <= 0xff)
+                            sb[e.bs] = e.cp;
+                        else
+                            db[e.bs] = e.cp;
+                        indexC2B[e.cp>>8] = 1;
+                    } else {
+                        supp[suppTotal++] = e;
+                    }
+                }
+            }
+            ByteArrayOutputStream baos = new ByteArrayOutputStream();
+            // c2b Index Table, always the first one
+            writeINDEXC2B(baos, indexC2B);
+            writeSINGLEBYTE(baos, sb);
+            writeDOUBLEBYTE1(baos, db, b1Min1, b1Max1, b2Min, b2Max);
+            writeDOUBLEBYTE2(baos, db, b1Min2, b1Max2, b2Min, b2Max);
+            writeSUPPLEMENT(baos, supp, suppTotal);
+            writeCOMPOSITE(baos, comp, compTotal);
+            writeSIZE(out, baos.size());
+            baos.writeTo(out);
+            out.close();
+        } catch (Exception x) {
+            x.printStackTrace();
+        }
+    }
+}
--- a/jdk/src/share/bin/emessages.h	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/bin/emessages.h	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2008 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
@@ -50,7 +50,7 @@
 #define JAR_ERROR2      "Error: Unable to access jarfile %s"
 #define JAR_ERROR3      "Error: Invalid or corrupt jarfile %s"
 
-#define CLS_ERROR1      "Error: Could not find the main class.\n" JNI_ERROR
+#define CLS_ERROR1      "Error: Could not find the main class %s.\n" JNI_ERROR
 #define CLS_ERROR2      "Error: Failed to load Main Class: %s\n%s"
 #define CLS_ERROR3      "Error: No main method found in specified class.\n" GEN_ERROR
 #define CLS_ERROR4      "Error: Main method not public\n" GEN_ERROR
--- a/jdk/src/share/bin/java.c	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/bin/java.c	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1995-2008 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
@@ -414,7 +414,7 @@
         mainClass = LoadClass(env, classname);
         if(mainClass == NULL) { /* exception occured */
             ReportExceptionDescription(env);
-            ReportErrorMessage(CLS_ERROR1);
+            ReportErrorMessage(CLS_ERROR1, classname);
             goto leave;
         }
         (*env)->ReleaseStringUTFChars(env, mainClassName, classname);
@@ -433,7 +433,7 @@
       mainClass = LoadClass(env, classname);
       if(mainClass == NULL) { /* exception occured */
         ReportExceptionDescription(env);
-        ReportErrorMessage(CLS_ERROR1);
+        ReportErrorMessage(CLS_ERROR1, classname);
         goto leave;
       }
       (*env)->ReleaseStringUTFChars(env, mainClassName, classname);
--- a/jdk/src/share/classes/com/sun/imageio/plugins/gif/GIFImageReader.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/com/sun/imageio/plugins/gif/GIFImageReader.java	Thu Jun 12 13:50:55 2008 -0700
@@ -504,7 +504,7 @@
             }
 
             // Found position of metadata for image 0
-            imageStartPosition.add(new Long(stream.getStreamPosition()));
+            imageStartPosition.add(Long.valueOf(stream.getStreamPosition()));
         } catch (IOException e) {
             throw new IIOException("I/O error reading header!", e);
         }
--- a/jdk/src/share/classes/com/sun/imageio/plugins/gif/GIFWritableImageMetadata.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/com/sun/imageio/plugins/gif/GIFWritableImageMetadata.java	Thu Jun 12 13:50:55 2008 -0700
@@ -98,7 +98,7 @@
         try {
             return data.getBytes("ISO-8859-1");
         } catch (UnsupportedEncodingException e) {
-            return (new String("")).getBytes();
+            return "".getBytes();
         }
     }
 
--- a/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKColorChooserPanel.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKColorChooserPanel.java	Thu Jun 12 13:50:55 2008 -0700
@@ -328,7 +328,7 @@
         setHSB(hue, saturation, brightness);
         if (update) {
             settingColor = true;
-            hueSpinner.setValue(new Integer((int)(hue * 360)));
+            hueSpinner.setValue(Integer.valueOf((int)(hue * 360)));
             settingColor = false;
         }
     }
@@ -376,8 +376,8 @@
         setHSB(hue, s, b);
         if (update) {
             settingColor = true;
-            saturationSpinner.setValue(new Integer((int)(s * 255)));
-            valueSpinner.setValue(new Integer((int)(b * 255)));
+            saturationSpinner.setValue(Integer.valueOf((int)(s * 255)));
+            valueSpinner.setValue(Integer.valueOf((int)(b * 255)));
             settingColor = false;
         }
     }
@@ -391,9 +391,9 @@
         setColor(color, false, true, true);
 
         settingColor = true;
-        hueSpinner.setValue(new Integer((int)(hue * 360)));
-        saturationSpinner.setValue(new Integer((int)(saturation * 255)));
-        valueSpinner.setValue(new Integer((int)(brightness * 255)));
+        hueSpinner.setValue(Integer.valueOf((int)(hue * 360)));
+        saturationSpinner.setValue(Integer.valueOf((int)(saturation * 255)));
+        valueSpinner.setValue(Integer.valueOf((int)(brightness * 255)));
         settingColor = false;
     }
 
@@ -409,9 +409,9 @@
         setColor(color, false, false, true);
 
         settingColor = true;
-        redSpinner.setValue(new Integer(color.getRed()));
-        greenSpinner.setValue(new Integer(color.getGreen()));
-        blueSpinner.setValue(new Integer(color.getBlue()));
+        redSpinner.setValue(Integer.valueOf(color.getRed()));
+        greenSpinner.setValue(Integer.valueOf(color.getGreen()));
+        blueSpinner.setValue(Integer.valueOf(color.getBlue()));
         settingColor = false;
     }
 
@@ -454,13 +454,13 @@
         colorNameTF.setText("#" + hexString.substring(1));
 
         if (updateSpinners) {
-            redSpinner.setValue(new Integer(color.getRed()));
-            greenSpinner.setValue(new Integer(color.getGreen()));
-            blueSpinner.setValue(new Integer(color.getBlue()));
+            redSpinner.setValue(Integer.valueOf(color.getRed()));
+            greenSpinner.setValue(Integer.valueOf(color.getGreen()));
+            blueSpinner.setValue(Integer.valueOf(color.getBlue()));
 
-            hueSpinner.setValue(new Integer((int)(hue * 360)));
-            saturationSpinner.setValue(new Integer((int)(saturation * 255)));
-            valueSpinner.setValue(new Integer((int)(brightness * 255)));
+            hueSpinner.setValue(Integer.valueOf((int)(hue * 360)));
+            saturationSpinner.setValue(Integer.valueOf((int)(saturation * 255)));
+            valueSpinner.setValue(Integer.valueOf((int)(brightness * 255)));
         }
         settingColor = false;
     }
--- a/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKFileChooserUI.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKFileChooserUI.java	Thu Jun 12 13:50:55 2008 -0700
@@ -97,14 +97,11 @@
     private static final Dimension hstrut3 = new Dimension(3, 1);
     private static final Dimension vstrut10 = new Dimension(1, 10);
 
-    private static final Insets insets = new Insets(10, 10, 10, 10);
-
     private static Dimension prefListSize = new Dimension(75, 150);
 
     private static Dimension PREF_SIZE = new Dimension(435, 360);
     private static Dimension MIN_SIZE = new Dimension(200, 300);
 
-    private static Dimension PREF_ACC_SIZE = new Dimension(10, 10);
     private static Dimension ZERO_ACC_SIZE = new Dimension(1, 1);
 
     private static Dimension MAX_SIZE = new Dimension(Short.MAX_VALUE, Short.MAX_VALUE);
@@ -125,7 +122,6 @@
     private JPanel bottomButtonPanel;
     private GTKDirectoryModel model = null;
     private Action newFolderAction;
-    private JPanel interior;
     private boolean readOnly;
     private boolean showDirectoryIcons;
     private boolean showFileIcons;
@@ -710,15 +706,19 @@
         bottomButtonPanel.setName("GTKFileChooser.bottomButtonPanel");
         align(bottomButtonPanel);
 
+        JPanel pnButtons = new JPanel(new GridLayout(1, 2, 5, 0));
+
         JButton cancelButton = getCancelButton(fc);
         align(cancelButton);
         cancelButton.setMargin(buttonMargin);
-        bottomButtonPanel.add(cancelButton);
+        pnButtons.add(cancelButton);
 
-        JButton approveButton = getApproveButton(fc);;
+        JButton approveButton = getApproveButton(fc);
         align(approveButton);
         approveButton.setMargin(buttonMargin);
-        bottomButtonPanel.add(approveButton);
+        pnButtons.add(approveButton);
+
+        bottomButtonPanel.add(pnButtons);
 
         if (fc.getControlButtonsAreShown()) {
             fc.add(bottomButtonPanel, BorderLayout.SOUTH);
@@ -1108,7 +1108,7 @@
             // Get the canonical (full) path. This has the side
             // benefit of removing extraneous chars from the path,
             // for example /foo/bar/ becomes /foo/bar
-            File canonical = null;
+            File canonical;
             try {
                 canonical = fsv.createFileObject(ShellFolder.getNormalizedFile(directory).getPath());
             } catch (IOException e) {
--- a/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKLookAndFeel.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKLookAndFeel.java	Thu Jun 12 13:50:55 2008 -0700
@@ -336,7 +336,7 @@
         // populate the table with the values from basic.
         super.initComponentDefaults(table);
 
-        Integer zero =  new Integer(0);
+        Integer zero =  Integer.valueOf(0);
         Object zeroBorder = new sun.swing.SwingLazyValue(
             "javax.swing.plaf.BorderUIResource$EmptyBorderUIResource",
             new Object[] {zero, zero, zero, zero});
@@ -371,7 +371,7 @@
         int vProgWidth  =  22 - (progXThickness * 2);
         int vProgHeight =  80 - (progYThickness * 2);
 
-        Integer caretBlinkRate = new Integer(500);
+        Integer caretBlinkRate = Integer.valueOf(500);
         Insets zeroInsets = new InsetsUIResource(0, 0, 0, 0);
 
         Double defaultCaretAspectRatio = new Double(0.025);
@@ -540,7 +540,7 @@
         }
 
         Object[] defaults = new Object[] {
-            "ArrowButton.size", new Integer(13),
+            "ArrowButton.size", Integer.valueOf(13),
 
 
             "Button.defaultButtonFollowsFocus", Boolean.FALSE,
@@ -893,8 +893,8 @@
 
 
             "ScrollBar.squareButtons", Boolean.FALSE,
-            "ScrollBar.thumbHeight", new Integer(14),
-            "ScrollBar.width", new Integer(16),
+            "ScrollBar.thumbHeight", Integer.valueOf(14),
+            "ScrollBar.width", Integer.valueOf(16),
             "ScrollBar.minimumThumbSize", new Dimension(8, 8),
             "ScrollBar.maximumThumbSize", new Dimension(4096, 4096),
             "ScrollBar.allowsAbsolutePositioning", Boolean.TRUE,
@@ -954,12 +954,12 @@
 
 
             "Separator.insets", zeroInsets,
-            "Separator.thickness", new Integer(2),
+            "Separator.thickness", Integer.valueOf(2),
 
 
             "Slider.paintValue", Boolean.TRUE,
-            "Slider.thumbWidth", new Integer(30),
-            "Slider.thumbHeight", new Integer(14),
+            "Slider.thumbWidth", Integer.valueOf(30),
+            "Slider.thumbHeight", Integer.valueOf(14),
             "Slider.focusInputMap",
                     new UIDefaults.LazyInputMap(new Object[] {
                             "RIGHT", "positiveUnitIncrement",
@@ -982,7 +982,7 @@
                              "LEFT", "positiveUnitIncrement",
                           "KP_LEFT", "positiveUnitIncrement",
                          }),
-
+            "Slider.onlyLeftMouseButtonDrag", Boolean.FALSE,
 
             "Spinner.ancestorInputMap",
                new UIDefaults.LazyInputMap(new Object[] {
@@ -1013,9 +1013,9 @@
                     }),
 
 
-            "SplitPane.size", new Integer(7),
-            "SplitPane.oneTouchOffset", new Integer(2),
-            "SplitPane.oneTouchButtonSize", new Integer(5),
+            "SplitPane.size", Integer.valueOf(7),
+            "SplitPane.oneTouchOffset", Integer.valueOf(2),
+            "SplitPane.oneTouchButtonSize", Integer.valueOf(5),
             "SplitPane.supportsOneTouchButtons", Boolean.FALSE,
 
 
@@ -1223,13 +1223,13 @@
 
             "ToolTip.font", new FontLazyValue(Region.TOOL_TIP),
 
-            "Tree.padding", new Integer(4),
+            "Tree.padding", Integer.valueOf(4),
             "Tree.background", tableBg,
             "Tree.drawHorizontalLines", Boolean.FALSE,
             "Tree.drawVerticalLines", Boolean.FALSE,
-            "Tree.rowHeight", new Integer(-1),
+            "Tree.rowHeight", Integer.valueOf(-1),
             "Tree.scrollsOnExpand", Boolean.FALSE,
-            "Tree.expanderSize", new Integer(10),
+            "Tree.expanderSize", Integer.valueOf(10),
             "Tree.repaintWholeRow", Boolean.TRUE,
             "Tree.closedIcon", null,
             "Tree.leafIcon", null,
@@ -1240,8 +1240,8 @@
             "Tree.collapsedIcon", new GTKStyle.GTKLazyValue(
                               "com.sun.java.swing.plaf.gtk.GTKIconFactory",
                               "getTreeCollapsedIcon"),
-            "Tree.leftChildIndent", new Integer(2),
-            "Tree.rightChildIndent", new Integer(12),
+            "Tree.leftChildIndent", Integer.valueOf(2),
+            "Tree.rightChildIndent", Integer.valueOf(12),
             "Tree.scrollsHorizontallyAndVertically", Boolean.FALSE,
             "Tree.drawsFocusBorder", Boolean.TRUE,
             "Tree.focusInputMap",
--- a/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKStyle.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKStyle.java	Thu Jun 12 13:50:55 2008 -0700
@@ -851,7 +851,7 @@
                 int focusLineWidth = getClassSpecificIntValue(context,
                         "focus-line-width", 0);
                 if (value == null && focusLineWidth > 0) {
-                    value = new Integer(16 + 2 * focusLineWidth);
+                    value = Integer.valueOf(16 + 2 * focusLineWidth);
                 }
             }
             return value;
@@ -975,12 +975,12 @@
 
         private static void initIconTypeMap() {
             ICON_TYPE_MAP = new HashMap<String,Integer>();
-            ICON_TYPE_MAP.put("gtk-menu", new Integer(1));
-            ICON_TYPE_MAP.put("gtk-small-toolbar", new Integer(2));
-            ICON_TYPE_MAP.put("gtk-large-toolbar", new Integer(3));
-            ICON_TYPE_MAP.put("gtk-button", new Integer(4));
-            ICON_TYPE_MAP.put("gtk-dnd", new Integer(5));
-            ICON_TYPE_MAP.put("gtk-dialog", new Integer(6));
+            ICON_TYPE_MAP.put("gtk-menu", Integer.valueOf(1));
+            ICON_TYPE_MAP.put("gtk-small-toolbar", Integer.valueOf(2));
+            ICON_TYPE_MAP.put("gtk-large-toolbar", Integer.valueOf(3));
+            ICON_TYPE_MAP.put("gtk-button", Integer.valueOf(4));
+            ICON_TYPE_MAP.put("gtk-dnd", Integer.valueOf(5));
+            ICON_TYPE_MAP.put("gtk-dialog", Integer.valueOf(6));
         }
 
     }
--- a/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/Metacity.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/Metacity.java	Thu Jun 12 13:50:55 2008 -0700
@@ -178,7 +178,7 @@
                         name = child.getNodeName();
                         Object value = null;
                         if ("distance".equals(name)) {
-                            value = new Integer(getIntAttr(child, "value", 0));
+                            value = Integer.valueOf(getIntAttr(child, "value", 0));
                         } else if ("border".equals(name)) {
                             value = new Insets(getIntAttr(child, "top", 0),
                                                getIntAttr(child, "left", 0),
@@ -808,7 +808,7 @@
     protected void setFrameGeometry(JComponent titlePane, Map gm) {
         this.frameGeometry = gm;
         if (getInt("top_height") == 0 && titlePane != null) {
-            gm.put("top_height", new Integer(titlePane.getHeight()));
+            gm.put("top_height", Integer.valueOf(titlePane.getHeight()));
         }
     }
 
--- a/jdk/src/share/classes/com/sun/java/swing/plaf/motif/MotifGraphicsUtils.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/com/sun/java/swing/plaf/motif/MotifGraphicsUtils.java	Thu Jun 12 13:50:55 2008 -0700
@@ -225,15 +225,15 @@
         if(b.getIcon() != null) {
             Icon icon;
             if(!model.isEnabled()) {
-                icon = (Icon) b.getDisabledIcon();
+                icon = b.getDisabledIcon();
             } else if(model.isPressed() && model.isArmed()) {
-                icon = (Icon) b.getPressedIcon();
+                icon = b.getPressedIcon();
                 if(icon == null) {
                     // Use default icon
-                    icon = (Icon) b.getIcon();
+                    icon = b.getIcon();
                 }
             } else {
-                icon = (Icon) b.getIcon();
+                icon = b.getIcon();
             }
 
             if (icon!=null) {
--- a/jdk/src/share/classes/com/sun/java/swing/plaf/motif/MotifInternalFrameTitlePane.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/com/sun/java/swing/plaf/motif/MotifInternalFrameTitlePane.java	Thu Jun 12 13:50:55 2008 -0700
@@ -86,18 +86,18 @@
 
     protected void assembleSystemMenu() {
         systemMenu = new JPopupMenu();
-        JMenuItem mi = (JMenuItem)systemMenu.add(new JMenuItem(restoreAction));
+        JMenuItem mi = systemMenu.add(new JMenuItem(restoreAction));
         mi.setMnemonic('R');
-        mi = (JMenuItem) systemMenu.add(new JMenuItem(moveAction));
+        mi = systemMenu.add(new JMenuItem(moveAction));
         mi.setMnemonic('M');
-        mi = (JMenuItem) systemMenu.add(new JMenuItem(sizeAction));
+        mi = systemMenu.add(new JMenuItem(sizeAction));
         mi.setMnemonic('S');
-        mi = (JMenuItem) systemMenu.add(new JMenuItem(iconifyAction));
+        mi = systemMenu.add(new JMenuItem(iconifyAction));
         mi.setMnemonic('n');
-        mi = (JMenuItem) systemMenu.add(new JMenuItem(maximizeAction));
+        mi = systemMenu.add(new JMenuItem(maximizeAction));
         mi.setMnemonic('x');
         systemMenu.add(new JSeparator());
-        mi = (JMenuItem) systemMenu.add(new JMenuItem(closeAction));
+        mi = systemMenu.add(new JMenuItem(closeAction));
         mi.setMnemonic('C');
 
         systemButton = new SystemButton();
@@ -157,7 +157,7 @@
     }
 
     public void propertyChange(PropertyChangeEvent evt) {
-        String prop = (String)evt.getPropertyName();
+        String prop = evt.getPropertyName();
         JInternalFrame f = (JInternalFrame)evt.getSource();
         boolean value = false;
         if (JInternalFrame.IS_SELECTED_PROPERTY.equals(prop)) {
--- a/jdk/src/share/classes/com/sun/java/swing/plaf/motif/MotifLookAndFeel.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/com/sun/java/swing/plaf/motif/MotifLookAndFeel.java	Thu Jun 12 13:50:55 2008 -0700
@@ -290,7 +290,7 @@
 
         Object unselectedTabBackground = new UIDefaults.LazyValue() {
             public Object createValue(UIDefaults table) {
-                Color c = (Color)table.getColor("control");
+                Color c = table.getColor("control");
                 return new ColorUIResource(Math.max((int)(c.getRed()*.85),0),
                                            Math.max((int)(c.getGreen()*.85),0),
                                            Math.max((int)(c.getBlue()*.85),0));
@@ -299,7 +299,7 @@
 
         Object unselectedTabForeground = new UIDefaults.LazyValue() {
             public Object createValue(UIDefaults table) {
-                Color c = (Color)table.getColor("controlText");
+                Color c = table.getColor("controlText");
                 return new ColorUIResource(Math.max((int)(c.getRed()*.85),0),
                                            Math.max((int)(c.getGreen()*.85),0),
                                            Math.max((int)(c.getBlue()*.85),0));
@@ -308,7 +308,7 @@
 
         Object unselectedTabShadow = new UIDefaults.LazyValue() {
             public Object createValue(UIDefaults table) {
-                Color c = (Color)table.getColor("control");
+                Color c = table.getColor("control");
                 Color base = new Color(Math.max((int)(c.getRed()*.85),0),
                                        Math.max((int)(c.getGreen()*.85),0),
                                        Math.max((int)(c.getBlue()*.85),0));
@@ -318,7 +318,7 @@
 
         Object unselectedTabHighlight = new UIDefaults.LazyValue() {
             public Object createValue(UIDefaults table) {
-                Color c = (Color)table.getColor("control");
+                Color c = table.getColor("control");
                 Color base = new Color(Math.max((int)(c.getRed()*.85),0),
                                        Math.max((int)(c.getGreen()*.85),0),
                                        Math.max((int)(c.getBlue()*.85),0));
@@ -567,7 +567,7 @@
             "ProgressBar.selectionBackground", table.get("controlText"),
             "ProgressBar.border", loweredBevelBorder,
             "ProgressBar.cellLength", new Integer(6),
-            "ProgressBar.cellSpacing", new Integer(0),
+            "ProgressBar.cellSpacing", Integer.valueOf(0),
 
             // Buttons
             "Button.margin", new InsetsUIResource(2, 4, 2, 4),
@@ -859,7 +859,7 @@
             "SplitPane.background", table.get("control"),
             "SplitPane.highlight", table.get("controlHighlight"),
             "SplitPane.shadow", table.get("controlShadow"),
-            "SplitPane.dividerSize", new Integer(20),
+            "SplitPane.dividerSize", Integer.valueOf(20),
             "SplitPane.activeThumb", table.get("activeCaptionBorder"),
             "SplitPane.ancestorInputMap",
                new UIDefaults.LazyInputMap(new Object[] {
@@ -1160,7 +1160,7 @@
               }),
 
             "TextField.caretForeground", black,
-            "TextField.caretBlinkRate", new Integer(500),
+            "TextField.caretBlinkRate", Integer.valueOf(500),
             "TextField.inactiveForeground", table.get("textInactiveText"),
             "TextField.selectionBackground", table.get("textHighlight"),
             "TextField.selectionForeground", table.get("textHighlightText"),
@@ -1171,7 +1171,7 @@
             "TextField.focusInputMap", fieldInputMap,
 
             "PasswordField.caretForeground", black,
-            "PasswordField.caretBlinkRate", new Integer(500),
+            "PasswordField.caretBlinkRate", Integer.valueOf(500),
             "PasswordField.inactiveForeground", table.get("textInactiveText"),
             "PasswordField.selectionBackground", table.get("textHighlight"),
             "PasswordField.selectionForeground", table.get("textHighlightText"),
@@ -1182,7 +1182,7 @@
             "PasswordField.focusInputMap", passwordInputMap,
 
             "TextArea.caretForeground", black,
-            "TextArea.caretBlinkRate", new Integer(500),
+            "TextArea.caretBlinkRate", Integer.valueOf(500),
             "TextArea.inactiveForeground", table.get("textInactiveText"),
             "TextArea.selectionBackground", table.get("textHighlight"),
             "TextArea.selectionForeground", table.get("textHighlightText"),
@@ -1193,7 +1193,7 @@
             "TextArea.focusInputMap", multilineInputMap,
 
             "TextPane.caretForeground", black,
-            "TextPane.caretBlinkRate", new Integer(500),
+            "TextPane.caretBlinkRate", Integer.valueOf(500),
             "TextPane.inactiveForeground", table.get("textInactiveText"),
             "TextPane.selectionBackground", lightGray,
             "TextPane.selectionForeground", table.get("textHighlightText"),
@@ -1204,7 +1204,7 @@
             "TextPane.focusInputMap", multilineInputMap,
 
             "EditorPane.caretForeground", red,
-            "EditorPane.caretBlinkRate", new Integer(500),
+            "EditorPane.caretBlinkRate", Integer.valueOf(500),
             "EditorPane.inactiveForeground", table.get("textInactiveText"),
             "EditorPane.selectionBackground", lightGray,
             "EditorPane.selectionForeground", table.get("textHighlightText"),
--- a/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsLookAndFeel.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsLookAndFeel.java	Thu Jun 12 13:50:55 2008 -0700
@@ -299,9 +299,9 @@
         initResourceBundle(table);
 
         // *** Shared Fonts
-        Integer twelve = new Integer(12);
-        Integer fontPlain = new Integer(Font.PLAIN);
-        Integer fontBold = new Integer(Font.BOLD);
+        Integer twelve = Integer.valueOf(12);
+        Integer fontPlain = Integer.valueOf(Font.PLAIN);
+        Integer fontBold = Integer.valueOf(Font.BOLD);
 
         Object dialogPlain12 = new SwingLazyValue(
                                "javax.swing.plaf.FontUIResource",
@@ -522,19 +522,19 @@
                                                        toolkit);
         Object WindowBorderWidth      = new DesktopProperty(
                                                        "win.frame.sizingBorderWidth",
-                                                       new Integer(1),
+                                                       Integer.valueOf(1),
                                                        toolkit);
         Object TitlePaneHeight        = new DesktopProperty(
                                                        "win.frame.captionHeight",
-                                                       new Integer(18),
+                                                       Integer.valueOf(18),
                                                        toolkit);
         Object TitleButtonWidth       = new DesktopProperty(
                                                        "win.frame.captionButtonWidth",
-                                                       new Integer(16),
+                                                       Integer.valueOf(16),
                                                        toolkit);
         Object TitleButtonHeight      = new DesktopProperty(
                                                        "win.frame.captionButtonHeight",
-                                                       new Integer(16),
+                                                       Integer.valueOf(16),
                                                        toolkit);
         Object InactiveTextColor      = new DesktopProperty(
                                                        "win.text.grayedTextColor",
@@ -567,7 +567,7 @@
         Object IconFont = ControlFont;
 
         Object scrollBarWidth = new DesktopProperty("win.scrollbar.width",
-                                                    new Integer(16), toolkit);
+                                                    Integer.valueOf(16), toolkit);
 
         Object menuBarHeight = new DesktopProperty("win.menu.height",
                                                    null, toolkit);
@@ -673,12 +673,12 @@
             "Button.disabledForeground", InactiveTextColor,
             "Button.disabledShadow", ControlHighlightColor,
             "Button.focus", black,
-            "Button.dashedRectGapX", new XPValue(new Integer(3), new Integer(5)),
-            "Button.dashedRectGapY", new XPValue(new Integer(3), new Integer(4)),
-            "Button.dashedRectGapWidth", new XPValue(new Integer(6), new Integer(10)),
-            "Button.dashedRectGapHeight", new XPValue(new Integer(6), new Integer(8)),
-            "Button.textShiftOffset", new XPValue(new Integer(0),
-                                                  new Integer(1)),
+            "Button.dashedRectGapX", new XPValue(Integer.valueOf(3), Integer.valueOf(5)),
+            "Button.dashedRectGapY", new XPValue(Integer.valueOf(3), Integer.valueOf(4)),
+            "Button.dashedRectGapWidth", new XPValue(Integer.valueOf(6), Integer.valueOf(10)),
+            "Button.dashedRectGapHeight", new XPValue(Integer.valueOf(6), Integer.valueOf(8)),
+            "Button.textShiftOffset", new XPValue(Integer.valueOf(0),
+                                                  Integer.valueOf(1)),
             // W2K keyboard navigation hidding.
             "Button.showMnemonics", showMnemonics,
             "Button.focusInputMap",
@@ -780,7 +780,7 @@
                }),
 
             // DesktopIcon
-            "DesktopIcon.width", new Integer(160),
+            "DesktopIcon.width", Integer.valueOf(160),
 
             "EditorPane.font", ControlFont,
             "EditorPane.background", WindowBackgroundColor,
@@ -814,9 +814,9 @@
                                                                "icons/NewFolder.gif"),
             "FileChooser.useSystemExtensionHiding", Boolean.TRUE,
 
-            "FileChooser.lookInLabelMnemonic", new Integer(KeyEvent.VK_I),
-            "FileChooser.fileNameLabelMnemonic", new Integer(KeyEvent.VK_N),
-            "FileChooser.filesOfTypeLabelMnemonic", new Integer(KeyEvent.VK_T),
+            "FileChooser.lookInLabelMnemonic", Integer.valueOf(KeyEvent.VK_I),
+            "FileChooser.fileNameLabelMnemonic", Integer.valueOf(KeyEvent.VK_N),
+            "FileChooser.filesOfTypeLabelMnemonic", Integer.valueOf(KeyEvent.VK_T),
             "FileChooser.usesSingleFilePane", Boolean.TRUE,
             "FileChooser.noPlacesBar", new DesktopProperty("win.comdlg.noPlacesBar",
                                                            Boolean.FALSE, toolkit),
@@ -1021,10 +1021,10 @@
             "Menu.selectionBackground", SelectionBackgroundColor,
             "Menu.acceleratorForeground", MenuTextColor,
             "Menu.acceleratorSelectionForeground", SelectionTextColor,
-            "Menu.menuPopupOffsetX", new Integer(0),
-            "Menu.menuPopupOffsetY", new Integer(0),
-            "Menu.submenuPopupOffsetX", new Integer(-4),
-            "Menu.submenuPopupOffsetY", new Integer(-3),
+            "Menu.menuPopupOffsetX", Integer.valueOf(0),
+            "Menu.menuPopupOffsetY", Integer.valueOf(0),
+            "Menu.submenuPopupOffsetX", Integer.valueOf(-4),
+            "Menu.submenuPopupOffsetY", Integer.valueOf(-3),
             "Menu.crossMenuMnemonic", Boolean.FALSE,
             "Menu.preserveTopLevelSelection", Boolean.TRUE,
 
@@ -1184,8 +1184,8 @@
             "ProgressBar.highlight", ControlHighlightColor,
             "ProgressBar.selectionForeground", ControlBackgroundColor,
             "ProgressBar.selectionBackground", SelectionBackgroundColor,
-            "ProgressBar.cellLength", new Integer(7),
-            "ProgressBar.cellSpacing", new Integer(2),
+            "ProgressBar.cellLength", Integer.valueOf(7),
+            "ProgressBar.cellSpacing", Integer.valueOf(2),
             "ProgressBar.indeterminateInsets", new Insets(3, 3, 3, 3),
 
             // *** RootPane.
@@ -1292,7 +1292,7 @@
             "SplitPane.highlight", ControlHighlightColor,
             "SplitPane.shadow", ControlShadowColor,
             "SplitPane.darkShadow", ControlDarkShadowColor,
-            "SplitPane.dividerSize", new Integer(5),
+            "SplitPane.dividerSize", Integer.valueOf(5),
             "SplitPane.ancestorInputMap",
                new UIDefaults.LazyInputMap(new Object[] {
                         "UP", "negativeIncrement",
@@ -1496,7 +1496,7 @@
             "ToggleButton.light", ControlLightColor,
             "ToggleButton.highlight", ControlHighlightColor,
             "ToggleButton.focus", ControlTextColor,
-            "ToggleButton.textShiftOffset", new Integer(1),
+            "ToggleButton.textShiftOffset", Integer.valueOf(1),
             "ToggleButton.focusInputMap",
               new UIDefaults.LazyInputMap(new Object[] {
                             "SPACE", "pressed",
@@ -1548,8 +1548,8 @@
             "Tree.background", WindowBackgroundColor,
             "Tree.foreground", WindowTextColor,
             "Tree.hash", gray,
-            "Tree.leftChildIndent", new Integer(8),
-            "Tree.rightChildIndent", new Integer(11),
+            "Tree.leftChildIndent", Integer.valueOf(8),
+            "Tree.rightChildIndent", Integer.valueOf(11),
             "Tree.textForeground", WindowTextColor,
             "Tree.textBackground", WindowBackgroundColor,
             "Tree.selectionForeground", SelectionTextColor,
@@ -2488,18 +2488,18 @@
         private int direction;
 
         XPDLUValue(int xpdlu, int classicdlu, int direction) {
-            super(new Integer(xpdlu), new Integer(classicdlu));
+            super(Integer.valueOf(xpdlu), Integer.valueOf(classicdlu));
             this.direction = direction;
         }
 
         public Object getXPValue(UIDefaults table) {
             int px = dluToPixels(((Integer)xpValue).intValue(), direction);
-            return new Integer(px);
+            return Integer.valueOf(px);
         }
 
         public Object getClassicValue(UIDefaults table) {
             int px = dluToPixels(((Integer)classicValue).intValue(), direction);
-            return new Integer(px);
+            return Integer.valueOf(px);
         }
     }
 
--- a/jdk/src/share/classes/com/sun/jmx/interceptor/DefaultMBeanServerInterceptor.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/com/sun/jmx/interceptor/DefaultMBeanServerInterceptor.java	Thu Jun 12 13:50:55 2008 -0700
@@ -233,7 +233,6 @@
                MBeanRegistrationException, MBeanException,
                NotCompliantMBeanException, InstanceNotFoundException {
 
-        ObjectName logicalName = name;
         Class theClass;
 
         if (className == null) {
@@ -519,8 +518,7 @@
                                                 QueryExp query) {
         // Query the MBeans on the repository
         //
-        Set<NamedObject> list = null;
-        list = repository.query(name, query);
+        Set<NamedObject> list = repository.query(name, query);
 
         if (queryByRepo) {
             // The repository performs the filtering
@@ -576,8 +574,7 @@
     private Set<ObjectName> queryNamesImpl(ObjectName name, QueryExp query) {
         // Query the MBeans on the repository
         //
-        Set<NamedObject> list = null;
-        list = repository.query(name, query);
+        Set<NamedObject> list = repository.query(name, query);
 
         if (queryByRepo) {
             // The repository performs the filtering
@@ -1042,7 +1039,7 @@
         if (registerFailed && moi instanceof DynamicMBean2)
             ((DynamicMBean2) moi).registerFailed();
         try {
-            moi.postRegister(new Boolean(registrationDone));
+            moi.postRegister(registrationDone);
         } catch (RuntimeException e) {
             throw new RuntimeMBeanException(e,
                       "RuntimeException thrown in postRegister method");
@@ -1094,8 +1091,7 @@
                 IllegalArgumentException("Object name cannot be null"),
                                "Exception occurred trying to get an MBean");
         }
-        DynamicMBean obj = null;
-        obj = repository.retrieve(name);
+        DynamicMBean obj = repository.retrieve(name);
         if (obj == null) {
             if (MBEANSERVER_LOGGER.isLoggable(Level.FINER)) {
                 MBEANSERVER_LOGGER.logp(Level.FINER,
@@ -1568,7 +1564,6 @@
             query.setMBeanServer(server);
             try {
                 for (NamedObject no : list) {
-                    final DynamicMBean obj = no.getObject();
                     boolean res;
                     try {
                         res = query.apply(no.getName());
--- a/jdk/src/share/classes/com/sun/jmx/mbeanserver/MBeanInstantiator.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/com/sun/jmx/mbeanserver/MBeanInstantiator.java	Thu Jun 12 13:50:55 2008 -0700
@@ -205,7 +205,7 @@
      */
     public Object instantiate(Class theClass)
         throws ReflectionException, MBeanException {
-        Object moi = null;
+        Object moi;
 
 
         // ------------------------------
@@ -265,7 +265,7 @@
         // ------------------------------
         // ------------------------------
         final Class[] tab;
-        Object moi= null;
+        Object moi;
         try {
             // Build the signature of the method
             //
@@ -283,8 +283,7 @@
         }
 
         // Query the metadata service to get the right constructor
-        Constructor cons = null;
-        cons = findConstructor(theClass, tab);
+        Constructor cons = findConstructor(theClass, tab);
 
         if (cons == null) {
             throw new ReflectionException(new
@@ -408,7 +407,7 @@
             throw new  RuntimeOperationsException(new
              IllegalArgumentException(), "Null className passed in parameter");
         }
-        Class theClass = null;
+        Class theClass;
         if (loaderName == null) {
             // Load the class using the agent class loader
             theClass = findClass(className, loader);
@@ -621,7 +620,7 @@
     static Class loadClass(String className, ClassLoader loader)
         throws ReflectionException {
 
-        Class theClass = null;
+        Class theClass;
         if (className == null) {
             throw new RuntimeOperationsException(new
                 IllegalArgumentException("The class name cannot be null"),
--- a/jdk/src/share/classes/com/sun/jmx/mbeanserver/Repository.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/com/sun/jmx/mbeanserver/Repository.java	Thu Jun 12 13:50:55 2008 -0700
@@ -89,7 +89,6 @@
 
     /* This class is used to match an ObjectName against a pattern. */
     private final static class ObjectNamePattern {
-        private final char[]   domain;
         private final String[] keys;
         private final String[] values;
         private final String   properties;
@@ -106,8 +105,7 @@
          * @param pattern The ObjectName pattern under examination.
          **/
         public ObjectNamePattern(ObjectName pattern) {
-            this(pattern.getDomain(),
-                 pattern.isPropertyListPattern(),
+            this(pattern.isPropertyListPattern(),
                  pattern.isPropertyValuePattern(),
                  pattern.getCanonicalKeyPropertyListString(),
                  pattern.getKeyPropertyList(),
@@ -124,13 +122,11 @@
          * @param keyPropertyList pattern.getKeyPropertyList().
          * @param pattern The ObjectName pattern under examination.
          **/
-        ObjectNamePattern(String domain,
-                          boolean propertyListPattern,
+        ObjectNamePattern(boolean propertyListPattern,
                           boolean propertyValuePattern,
                           String canonicalProps,
                           Map<String,String> keyPropertyList,
                           ObjectName pattern) {
-            this.domain = domain.toCharArray();
             this.isPropertyListPattern = propertyListPattern;
             this.isPropertyValuePattern = propertyValuePattern;
             this.properties = canonicalProps;
@@ -538,7 +534,7 @@
         // "domain:*", "domain:[key=value],*" : names in the specified domain
 
         // Surely one of the most frequent case ... query on the whole world
-        ObjectName name = null;
+        ObjectName name;
         if (pattern == null ||
             pattern.getCanonicalName().length() == 0 ||
             pattern.equals(ObjectName.WILDCARD))
@@ -660,7 +656,7 @@
      * @return  Number of MBeans.
      */
     public Integer getCount() {
-        return new Integer(nbElements);
+        return nbElements;
     }
 
     /**
@@ -669,7 +665,7 @@
      *
      * @return  A string giving the name of the default domain name.
      */
-    public  String getDefaultDomain() {
+    public String getDefaultDomain() {
         return domain;
     }
 
--- a/jdk/src/share/classes/com/sun/jmx/remote/internal/ClientNotifForwarder.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/com/sun/jmx/remote/internal/ClientNotifForwarder.java	Thu Jun 12 13:50:55 2008 -0700
@@ -435,7 +435,6 @@
 
                     clientSequenceNumber = nr.getNextSequenceNumber();
 
-                    final int size = infoList.size();
                     listeners = new HashMap<Integer, ClientListenerInfo>();
 
                     for (int i = 0 ; i < len ; i++) {
@@ -792,9 +791,6 @@
 
     private Thread currentFetchThread;
 
-    // admin stuff
-    private boolean inited = false;
-
     // state
     /**
      * This state means that a thread is being created for fetching and forwarding notifications.
--- a/jdk/src/share/classes/com/sun/jmx/remote/internal/ServerNotifForwarder.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/com/sun/jmx/remote/internal/ServerNotifForwarder.java	Thu Jun 12 13:50:55 2008 -0700
@@ -269,7 +269,7 @@
                 ", the maxNotifications is " + maxNotifications);
         }
 
-        NotificationResult nr = null;
+        NotificationResult nr;
         final long t = Math.min(connectionTimeout, timeout);
         try {
             nr = notifBuffer.fetchNotifications(bufferFilter,
@@ -322,7 +322,7 @@
 
     private Integer getListenerID() {
         synchronized(listenerCounterLock) {
-            return new Integer(listenerCounter++);
+            return listenerCounter++;
         }
     }
 
@@ -336,7 +336,7 @@
         SecurityManager sm = System.getSecurityManager();
         if (sm != null) {
             AccessControlContext acc = AccessController.getContext();
-            ObjectInstance oi = null;
+            ObjectInstance oi;
             try {
                 oi = AccessController.doPrivileged(
                     new PrivilegedExceptionAction<ObjectInstance>() {
--- a/jdk/src/share/classes/com/sun/jmx/remote/security/FileLoginModule.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/com/sun/jmx/remote/security/FileLoginModule.java	Thu Jun 12 13:50:55 2008 -0700
@@ -437,7 +437,7 @@
         // get the username and password
         getUsernamePassword(usePasswdFromSharedState);
 
-        String localPassword = null;
+        String localPassword;
 
         // userCredentials is initialized in login()
         if (((localPassword = userCredentials.getProperty(username)) == null) ||
@@ -487,10 +487,14 @@
                 throw ace;
             }
         }
-        BufferedInputStream bis = new BufferedInputStream(fis);
-        userCredentials = new Properties();
-        userCredentials.load(bis);
-        bis.close();
+        try {
+            BufferedInputStream bis = new BufferedInputStream(fis);
+            userCredentials = new Properties();
+            userCredentials.load(bis);
+            bis.close();
+        } finally {
+            fis.close();
+        }
     }
 
     /**
--- a/jdk/src/share/classes/com/sun/jmx/remote/security/JMXPluggableAuthenticator.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/com/sun/jmx/remote/security/JMXPluggableAuthenticator.java	Thu Jun 12 13:50:55 2008 -0700
@@ -295,7 +295,7 @@
 private static class FileLoginConfig extends Configuration {
 
     // The JAAS configuration for file-based authentication
-    private static AppConfigurationEntry[] entries;
+    private AppConfigurationEntry[] entries;
 
     // The classname of the login module for file-based authentication
     private static final String FILE_LOGIN_MODULE =
--- a/jdk/src/share/classes/com/sun/jmx/remote/security/MBeanServerFileAccessController.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/com/sun/jmx/remote/security/MBeanServerFileAccessController.java	Thu Jun 12 13:50:55 2008 -0700
@@ -231,10 +231,13 @@
     private static Properties propertiesFromFile(String fname)
         throws IOException {
         FileInputStream fin = new FileInputStream(fname);
-        Properties p = new Properties();
-        p.load(fin);
-        fin.close();
-        return p;
+        try {
+            Properties p = new Properties();
+            p.load(fin);
+            return p;
+        } finally {
+            fin.close();
+        }
     }
 
     private void checkAccessLevel(String accessLevel) {
--- a/jdk/src/share/classes/com/sun/management/HotSpotDiagnosticMXBean.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/com/sun/management/HotSpotDiagnosticMXBean.java	Thu Jun 12 13:50:55 2008 -0700
@@ -25,6 +25,8 @@
 
 package com.sun.management;
 
+import java.lang.management.PlatformManagedObject;
+
 /**
  * Diagnostic management interface for the HotSpot Virtual Machine.
  * The diagnostic MBean is registered to the platform MBeanServer
@@ -35,8 +37,13 @@
  * <blockquote>
  *    <tt>com.sun.management:type=HotSpotDiagnostic</tt>
  * </blockquote>
+.*
+ * It can be obtained by calling the
+ * {@link PlatformManagedObject#getObjectName} method.
+ *
+ * @see ManagementFactory#getPlatformMXBeans(Class)
  */
-public interface HotSpotDiagnosticMXBean {
+public interface HotSpotDiagnosticMXBean extends PlatformManagedObject {
     /**
      * Dumps the heap to the <tt>outputFile</tt> file in the same
      * format as the hprof heap dump.
--- a/jdk/src/share/classes/com/sun/security/auth/login/ConfigFile.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/com/sun/security/auth/login/ConfigFile.java	Thu Jun 12 13:50:55 2008 -0700
@@ -620,9 +620,35 @@
      * start up time noticeably for the new launcher. -- DAC
      */
     private InputStream getInputStream(URL url) throws IOException {
-        if ("file".equals(url.getProtocol())) {
-            String path = url.getFile().replace('/', File.separatorChar);
-            return new FileInputStream(path);
+        if ("file".equalsIgnoreCase(url.getProtocol())) {
+            // Compatibility notes:
+            //
+            // Code changed from
+            //   String path = url.getFile().replace('/', File.separatorChar);
+            //   return new FileInputStream(path);
+            //
+            // The original implementation would search for "/tmp/a%20b"
+            // when url is "file:///tmp/a%20b". This is incorrect. The
+            // current codes fix this bug and searches for "/tmp/a b".
+            // For compatibility reasons, when the file "/tmp/a b" does
+            // not exist, the file named "/tmp/a%20b" will be tried.
+            //
+            // This also means that if both file exists, the behavior of
+            // this method is changed, and the current codes choose the
+            // correct one.
+            try {
+                return url.openStream();
+            } catch (Exception e) {
+                String file = url.getPath();
+                if (url.getHost().length() > 0) {  // For Windows UNC
+                    file = "//" + url.getHost() + file;
+                }
+                if (debugConfig != null) {
+                    debugConfig.println("cannot read " + url +
+                            ", try " + file);
+                }
+                return new FileInputStream(file);
+            }
         } else {
             return url.openStream();
         }
--- a/jdk/src/share/classes/com/sun/tools/hat/Main.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/com/sun/tools/hat/Main.java	Thu Jun 12 13:50:55 2008 -0700
@@ -23,18 +23,10 @@
  * have any questions.
  */
 
-
 /*
- * The contents of this file are subject to the Sun Public License
- * Version 1.0 (the "License"); you may not use this file except in
- * compliance with the License. A copy of the License is available at
- * http://www.sun.com/, and in the file LICENSE.html in the
- * doc directory.
- *
  * The Original Code is HAT. The Initial Developer of the
  * Original Code is Bill Foote, with contributions from others
- * at JavaSoft/Sun. Portions created by Bill Foote and others
- * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
+ * at JavaSoft/Sun.
  */
 
 package com.sun.tools.hat;
--- a/jdk/src/share/classes/com/sun/tools/hat/build.xml	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/com/sun/tools/hat/build.xml	Thu Jun 12 13:50:55 2008 -0700
@@ -27,19 +27,9 @@
 
 <!-- 
 
- The contents of this file are subject to the Sun Public License
- Version 1.0 (the "License"); you may not use this file except in
- compliance with the License. A copy of the License is available at
- http://www.sun.com/, and in the file LICENSE.html in the
- doc directory.
- 
  The Original Code is HAT. The Initial Developer of the
  Original Code is Bill Foote, with contributions from others
- at JavaSoft/Sun. Portions created by Bill Foote and others
- at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
- 
- In addition to the formal license, I ask that you don't
- change the history or donations files without permission.
+ at JavaSoft/Sun.
 
 -->
 
--- a/jdk/src/share/classes/com/sun/tools/hat/internal/model/AbstractJavaHeapObjectVisitor.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/model/AbstractJavaHeapObjectVisitor.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-2005 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
@@ -25,20 +25,9 @@
 
 
 /*
- * The contents of this file are subject to the Sun Public License
- * Version 1.0 (the "License"); you may not use this file except in
- * compliance with the License. A copy of the License is available at
- * http://www.sun.com/, and in the file LICENSE.html in the
- * doc directory.
- *
  * The Original Code is HAT. The Initial Developer of the
  * Original Code is Bill Foote, with contributions from others
- * at JavaSoft/Sun. Portions created by Bill Foote and others
- * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
- *
- * In addition to the formal license, I ask that you don't
- * change the history or donations files without permission.
- *
+ * at JavaSoft/Sun.
  */
 
 package com.sun.tools.hat.internal.model;
--- a/jdk/src/share/classes/com/sun/tools/hat/internal/model/ArrayTypeCodes.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/model/ArrayTypeCodes.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-2005 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
@@ -25,20 +25,9 @@
 
 
 /*
- * The contents of this file are subject to the Sun Public License
- * Version 1.0 (the "License"); you may not use this file except in
- * compliance with the License. A copy of the License is available at
- * http://www.sun.com/, and in the file LICENSE.html in the
- * doc directory.
- *
  * The Original Code is HAT. The Initial Developer of the
  * Original Code is Bill Foote, with contributions from others
- * at JavaSoft/Sun. Portions created by Bill Foote and others
- * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
- *
- * In addition to the formal license, I ask that you don't
- * change the history or donations files without permission.
- *
+ * at JavaSoft/Sun.
  */
 
 package com.sun.tools.hat.internal.model;
--- a/jdk/src/share/classes/com/sun/tools/hat/internal/model/HackJavaValue.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/model/HackJavaValue.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-2005 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
@@ -25,20 +25,9 @@
 
 
 /*
- * The contents of this file are subject to the Sun Public License
- * Version 1.0 (the "License"); you may not use this file except in
- * compliance with the License. A copy of the License is available at
- * http://www.sun.com/, and in the file LICENSE.html in the
- * doc directory.
- *
  * The Original Code is HAT. The Initial Developer of the
  * Original Code is Bill Foote, with contributions from others
- * at JavaSoft/Sun. Portions created by Bill Foote and others
- * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
- *
- * In addition to the formal license, I ask that you don't
- * change the history or donations files without permission.
- *
+ * at JavaSoft/Sun.
  */
 
 package com.sun.tools.hat.internal.model;
--- a/jdk/src/share/classes/com/sun/tools/hat/internal/model/JavaBoolean.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/model/JavaBoolean.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-2005 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
@@ -25,20 +25,9 @@
 
 
 /*
- * The contents of this file are subject to the Sun Public License
- * Version 1.0 (the "License"); you may not use this file except in
- * compliance with the License. A copy of the License is available at
- * http://www.sun.com/, and in the file LICENSE.html in the
- * doc directory.
- *
  * The Original Code is HAT. The Initial Developer of the
  * Original Code is Bill Foote, with contributions from others
- * at JavaSoft/Sun. Portions created by Bill Foote and others
- * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
- *
- * In addition to the formal license, I ask that you don't
- * change the history or donations files without permission.
- *
+ * at JavaSoft/Sun.
  */
 
 package com.sun.tools.hat.internal.model;
--- a/jdk/src/share/classes/com/sun/tools/hat/internal/model/JavaByte.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/model/JavaByte.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-2005 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
@@ -25,20 +25,9 @@
 
 
 /*
- * The contents of this file are subject to the Sun Public License
- * Version 1.0 (the "License"); you may not use this file except in
- * compliance with the License. A copy of the License is available at
- * http://www.sun.com/, and in the file LICENSE.html in the
- * doc directory.
- *
  * The Original Code is HAT. The Initial Developer of the
  * Original Code is Bill Foote, with contributions from others
- * at JavaSoft/Sun. Portions created by Bill Foote and others
- * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
- *
- * In addition to the formal license, I ask that you don't
- * change the history or donations files without permission.
- *
+ * at JavaSoft/Sun.
  */
 
 package com.sun.tools.hat.internal.model;
--- a/jdk/src/share/classes/com/sun/tools/hat/internal/model/JavaChar.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/model/JavaChar.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-2005 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
@@ -25,20 +25,9 @@
 
 
 /*
- * The contents of this file are subject to the Sun Public License
- * Version 1.0 (the "License"); you may not use this file except in
- * compliance with the License. A copy of the License is available at
- * http://www.sun.com/, and in the file LICENSE.html in the
- * doc directory.
- *
  * The Original Code is HAT. The Initial Developer of the
  * Original Code is Bill Foote, with contributions from others
- * at JavaSoft/Sun. Portions created by Bill Foote and others
- * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
- *
- * In addition to the formal license, I ask that you don't
- * change the history or donations files without permission.
- *
+ * at JavaSoft/Sun.
  */
 
 package com.sun.tools.hat.internal.model;
--- a/jdk/src/share/classes/com/sun/tools/hat/internal/model/JavaClass.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/model/JavaClass.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-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
@@ -25,20 +25,9 @@
 
 
 /*
- * The contents of this file are subject to the Sun Public License
- * Version 1.0 (the "License"); you may not use this file except in
- * compliance with the License. A copy of the License is available at
- * http://www.sun.com/, and in the file LICENSE.html in the
- * doc directory.
- *
  * The Original Code is HAT. The Initial Developer of the
  * Original Code is Bill Foote, with contributions from others
- * at JavaSoft/Sun. Portions created by Bill Foote and others
- * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
- *
- * In addition to the formal license, I ask that you don't
- * change the history or donations files without permission.
- *
+ * at JavaSoft/Sun.
  */
 
 package com.sun.tools.hat.internal.model;
--- a/jdk/src/share/classes/com/sun/tools/hat/internal/model/JavaDouble.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/model/JavaDouble.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-2005 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
@@ -25,20 +25,9 @@
 
 
 /*
- * The contents of this file are subject to the Sun Public License
- * Version 1.0 (the "License"); you may not use this file except in
- * compliance with the License. A copy of the License is available at
- * http://www.sun.com/, and in the file LICENSE.html in the
- * doc directory.
- *
  * The Original Code is HAT. The Initial Developer of the
  * Original Code is Bill Foote, with contributions from others
- * at JavaSoft/Sun. Portions created by Bill Foote and others
- * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
- *
- * In addition to the formal license, I ask that you don't
- * change the history or donations files without permission.
- *
+ * at JavaSoft/Sun.
  */
 
 package com.sun.tools.hat.internal.model;
--- a/jdk/src/share/classes/com/sun/tools/hat/internal/model/JavaField.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/model/JavaField.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-2005 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
@@ -25,20 +25,9 @@
 
 
 /*
- * The contents of this file are subject to the Sun Public License
- * Version 1.0 (the "License"); you may not use this file except in
- * compliance with the License. A copy of the License is available at
- * http://www.sun.com/, and in the file LICENSE.html in the
- * doc directory.
- *
  * The Original Code is HAT. The Initial Developer of the
  * Original Code is Bill Foote, with contributions from others
- * at JavaSoft/Sun. Portions created by Bill Foote and others
- * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
- *
- * In addition to the formal license, I ask that you don't
- * change the history or donations files without permission.
- *
+ * at JavaSoft/Sun.
  */
 
 package com.sun.tools.hat.internal.model;
--- a/jdk/src/share/classes/com/sun/tools/hat/internal/model/JavaFloat.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/model/JavaFloat.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-2005 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
@@ -25,20 +25,9 @@
 
 
 /*
- * The contents of this file are subject to the Sun Public License
- * Version 1.0 (the "License"); you may not use this file except in
- * compliance with the License. A copy of the License is available at
- * http://www.sun.com/, and in the file LICENSE.html in the
- * doc directory.
- *
  * The Original Code is HAT. The Initial Developer of the
  * Original Code is Bill Foote, with contributions from others
- * at JavaSoft/Sun. Portions created by Bill Foote and others
- * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
- *
- * In addition to the formal license, I ask that you don't
- * change the history or donations files without permission.
- *
+ * at JavaSoft/Sun.
  */
 
 package com.sun.tools.hat.internal.model;
--- a/jdk/src/share/classes/com/sun/tools/hat/internal/model/JavaHeapObject.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/model/JavaHeapObject.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-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
@@ -25,20 +25,9 @@
 
 
 /*
- * The contents of this file are subject to the Sun Public License
- * Version 1.0 (the "License"); you may not use this file except in
- * compliance with the License. A copy of the License is available at
- * http://www.sun.com/, and in the file LICENSE.html in the
- * doc directory.
- *
  * The Original Code is HAT. The Initial Developer of the
  * Original Code is Bill Foote, with contributions from others
- * at JavaSoft/Sun. Portions created by Bill Foote and others
- * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
- *
- * In addition to the formal license, I ask that you don't
- * change the history or donations files without permission.
- *
+ * at JavaSoft/Sun.
  */
 
 package com.sun.tools.hat.internal.model;
--- a/jdk/src/share/classes/com/sun/tools/hat/internal/model/JavaHeapObjectVisitor.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/model/JavaHeapObjectVisitor.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-2005 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
@@ -25,20 +25,9 @@
 
 
 /*
- * The contents of this file are subject to the Sun Public License
- * Version 1.0 (the "License"); you may not use this file except in
- * compliance with the License. A copy of the License is available at
- * http://www.sun.com/, and in the file LICENSE.html in the
- * doc directory.
- *
  * The Original Code is HAT. The Initial Developer of the
  * Original Code is Bill Foote, with contributions from others
- * at JavaSoft/Sun. Portions created by Bill Foote and others
- * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
- *
- * In addition to the formal license, I ask that you don't
- * change the history or donations files without permission.
- *
+ * at JavaSoft/Sun.
  */
 
 package com.sun.tools.hat.internal.model;
--- a/jdk/src/share/classes/com/sun/tools/hat/internal/model/JavaInt.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/model/JavaInt.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-2005 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
@@ -25,20 +25,9 @@
 
 
 /*
- * The contents of this file are subject to the Sun Public License
- * Version 1.0 (the "License"); you may not use this file except in
- * compliance with the License. A copy of the License is available at
- * http://www.sun.com/, and in the file LICENSE.html in the
- * doc directory.
- *
  * The Original Code is HAT. The Initial Developer of the
  * Original Code is Bill Foote, with contributions from others
- * at JavaSoft/Sun. Portions created by Bill Foote and others
- * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
- *
- * In addition to the formal license, I ask that you don't
- * change the history or donations files without permission.
- *
+ * at JavaSoft/Sun.
  */
 
 package com.sun.tools.hat.internal.model;
--- a/jdk/src/share/classes/com/sun/tools/hat/internal/model/JavaLazyReadObject.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/model/JavaLazyReadObject.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-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
@@ -25,20 +25,9 @@
 
 
 /*
- * The contents of this file are subject to the Sun Public License
- * Version 1.0 (the "License"); you may not use this file except in
- * compliance with the License. A copy of the License is available at
- * http://www.sun.com/, and in the file LICENSE.html in the
- * doc directory.
- *
  * The Original Code is HAT. The Initial Developer of the
  * Original Code is Bill Foote, with contributions from others
- * at JavaSoft/Sun. Portions created by Bill Foote and others
- * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
- *
- * In addition to the formal license, I ask that you don't
- * change the history or donations files without permission.
- *
+ * at JavaSoft/Sun.
  */
 
 package com.sun.tools.hat.internal.model;
--- a/jdk/src/share/classes/com/sun/tools/hat/internal/model/JavaLong.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/model/JavaLong.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-2005 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
@@ -25,20 +25,9 @@
 
 
 /*
- * The contents of this file are subject to the Sun Public License
- * Version 1.0 (the "License"); you may not use this file except in
- * compliance with the License. A copy of the License is available at
- * http://www.sun.com/, and in the file LICENSE.html in the
- * doc directory.
- *
  * The Original Code is HAT. The Initial Developer of the
  * Original Code is Bill Foote, with contributions from others
- * at JavaSoft/Sun. Portions created by Bill Foote and others
- * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
- *
- * In addition to the formal license, I ask that you don't
- * change the history or donations files without permission.
- *
+ * at JavaSoft/Sun.
  */
 
 package com.sun.tools.hat.internal.model;
--- a/jdk/src/share/classes/com/sun/tools/hat/internal/model/JavaObject.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/model/JavaObject.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-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
@@ -25,20 +25,9 @@
 
 
 /*
- * The contents of this file are subject to the Sun Public License
- * Version 1.0 (the "License"); you may not use this file except in
- * compliance with the License. A copy of the License is available at
- * http://www.sun.com/, and in the file LICENSE.html in the
- * doc directory.
- *
  * The Original Code is HAT. The Initial Developer of the
  * Original Code is Bill Foote, with contributions from others
- * at JavaSoft/Sun. Portions created by Bill Foote and others
- * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
- *
- * In addition to the formal license, I ask that you don't
- * change the history or donations files without permission.
- *
+ * at JavaSoft/Sun.
  */
 
 package com.sun.tools.hat.internal.model;
--- a/jdk/src/share/classes/com/sun/tools/hat/internal/model/JavaObjectArray.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/model/JavaObjectArray.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-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
@@ -25,20 +25,9 @@
 
 
 /*
- * The contents of this file are subject to the Sun Public License
- * Version 1.0 (the "License"); you may not use this file except in
- * compliance with the License. A copy of the License is available at
- * http://www.sun.com/, and in the file LICENSE.html in the
- * doc directory.
- *
  * The Original Code is HAT. The Initial Developer of the
  * Original Code is Bill Foote, with contributions from others
- * at JavaSoft/Sun. Portions created by Bill Foote and others
- * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
- *
- * In addition to the formal license, I ask that you don't
- * change the history or donations files without permission.
- *
+ * at JavaSoft/Sun.
  */
 
 package com.sun.tools.hat.internal.model;
--- a/jdk/src/share/classes/com/sun/tools/hat/internal/model/JavaObjectRef.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/model/JavaObjectRef.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-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
@@ -25,20 +25,9 @@
 
 
 /*
- * The contents of this file are subject to the Sun Public License
- * Version 1.0 (the "License"); you may not use this file except in
- * compliance with the License. A copy of the License is available at
- * http://www.sun.com/, and in the file LICENSE.html in the
- * doc directory.
- *
  * The Original Code is HAT. The Initial Developer of the
  * Original Code is Bill Foote, with contributions from others
- * at JavaSoft/Sun. Portions created by Bill Foote and others
- * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
- *
- * In addition to the formal license, I ask that you don't
- * change the history or donations files without permission.
- *
+ * at JavaSoft/Sun.
  */
 
 package com.sun.tools.hat.internal.model;
--- a/jdk/src/share/classes/com/sun/tools/hat/internal/model/JavaShort.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/model/JavaShort.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-2005 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
@@ -25,20 +25,9 @@
 
 
 /*
- * The contents of this file are subject to the Sun Public License
- * Version 1.0 (the "License"); you may not use this file except in
- * compliance with the License. A copy of the License is available at
- * http://www.sun.com/, and in the file LICENSE.html in the
- * doc directory.
- *
  * The Original Code is HAT. The Initial Developer of the
  * Original Code is Bill Foote, with contributions from others
- * at JavaSoft/Sun. Portions created by Bill Foote and others
- * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
- *
- * In addition to the formal license, I ask that you don't
- * change the history or donations files without permission.
- *
+ * at JavaSoft/Sun.
  */
 
 package com.sun.tools.hat.internal.model;
--- a/jdk/src/share/classes/com/sun/tools/hat/internal/model/JavaStatic.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/model/JavaStatic.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-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
@@ -25,20 +25,9 @@
 
 
 /*
- * The contents of this file are subject to the Sun Public License
- * Version 1.0 (the "License"); you may not use this file except in
- * compliance with the License. A copy of the License is available at
- * http://www.sun.com/, and in the file LICENSE.html in the
- * doc directory.
- *
  * The Original Code is HAT. The Initial Developer of the
  * Original Code is Bill Foote, with contributions from others
- * at JavaSoft/Sun. Portions created by Bill Foote and others
- * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
- *
- * In addition to the formal license, I ask that you don't
- * change the history or donations files without permission.
- *
+ * at JavaSoft/Sun.
  */
 
 package com.sun.tools.hat.internal.model;
--- a/jdk/src/share/classes/com/sun/tools/hat/internal/model/JavaThing.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/model/JavaThing.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-2005 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
@@ -25,20 +25,9 @@
 
 
 /*
- * The contents of this file are subject to the Sun Public License
- * Version 1.0 (the "License"); you may not use this file except in
- * compliance with the License. A copy of the License is available at
- * http://www.sun.com/, and in the file LICENSE.html in the
- * doc directory.
- *
  * The Original Code is HAT. The Initial Developer of the
  * Original Code is Bill Foote, with contributions from others
- * at JavaSoft/Sun. Portions created by Bill Foote and others
- * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
- *
- * In addition to the formal license, I ask that you don't
- * change the history or donations files without permission.
- *
+ * at JavaSoft/Sun.
  */
 
 package com.sun.tools.hat.internal.model;
--- a/jdk/src/share/classes/com/sun/tools/hat/internal/model/JavaValue.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/model/JavaValue.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-2005 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
@@ -25,20 +25,9 @@
 
 
 /*
- * The contents of this file are subject to the Sun Public License
- * Version 1.0 (the "License"); you may not use this file except in
- * compliance with the License. A copy of the License is available at
- * http://www.sun.com/, and in the file LICENSE.html in the
- * doc directory.
- *
  * The Original Code is HAT. The Initial Developer of the
  * Original Code is Bill Foote, with contributions from others
- * at JavaSoft/Sun. Portions created by Bill Foote and others
- * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
- *
- * In addition to the formal license, I ask that you don't
- * change the history or donations files without permission.
- *
+ * at JavaSoft/Sun.
  */
 
 package com.sun.tools.hat.internal.model;
--- a/jdk/src/share/classes/com/sun/tools/hat/internal/model/JavaValueArray.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/model/JavaValueArray.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-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
@@ -25,20 +25,9 @@
 
 
 /*
- * The contents of this file are subject to the Sun Public License
- * Version 1.0 (the "License"); you may not use this file except in
- * compliance with the License. A copy of the License is available at
- * http://www.sun.com/, and in the file LICENSE.html in the
- * doc directory.
- *
  * The Original Code is HAT. The Initial Developer of the
  * Original Code is Bill Foote, with contributions from others
- * at JavaSoft/Sun. Portions created by Bill Foote and others
- * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
- *
- * In addition to the formal license, I ask that you don't
- * change the history or donations files without permission.
- *
+ * at JavaSoft/Sun.
  */
 
 package com.sun.tools.hat.internal.model;
--- a/jdk/src/share/classes/com/sun/tools/hat/internal/model/ReachableExcludes.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/model/ReachableExcludes.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-2005 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
@@ -25,20 +25,9 @@
 
 
 /*
- * The contents of this file are subject to the Sun Public License
- * Version 1.0 (the "License"); you may not use this file except in
- * compliance with the License. A copy of the License is available at
- * http://www.sun.com/, and in the file LICENSE.html in the
- * doc directory.
- *
  * The Original Code is HAT. The Initial Developer of the
  * Original Code is Bill Foote, with contributions from others
- * at JavaSoft/Sun. Portions created by Bill Foote and others
- * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
- *
- * In addition to the formal license, I ask that you don't
- * change the history or donations files without permission.
- *
+ * at JavaSoft/Sun.
  */
 
 package com.sun.tools.hat.internal.model;
--- a/jdk/src/share/classes/com/sun/tools/hat/internal/model/ReachableExcludesImpl.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/model/ReachableExcludesImpl.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-2005 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
@@ -25,20 +25,9 @@
 
 
 /*
- * The contents of this file are subject to the Sun Public License
- * Version 1.0 (the "License"); you may not use this file except in
- * compliance with the License. A copy of the License is available at
- * http://www.sun.com/, and in the file LICENSE.html in the
- * doc directory.
- *
  * The Original Code is HAT. The Initial Developer of the
  * Original Code is Bill Foote, with contributions from others
- * at JavaSoft/Sun. Portions created by Bill Foote and others
- * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
- *
- * In addition to the formal license, I ask that you don't
- * change the history or donations files without permission.
- *
+ * at JavaSoft/Sun.
  */
 
 package com.sun.tools.hat.internal.model;
--- a/jdk/src/share/classes/com/sun/tools/hat/internal/model/ReachableObjects.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/model/ReachableObjects.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-2005 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
@@ -25,20 +25,9 @@
 
 
 /*
- * The contents of this file are subject to the Sun Public License
- * Version 1.0 (the "License"); you may not use this file except in
- * compliance with the License. A copy of the License is available at
- * http://www.sun.com/, and in the file LICENSE.html in the
- * doc directory.
- *
  * The Original Code is HAT. The Initial Developer of the
  * Original Code is Bill Foote, with contributions from others
- * at JavaSoft/Sun. Portions created by Bill Foote and others
- * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
- *
- * In addition to the formal license, I ask that you don't
- * change the history or donations files without permission.
- *
+ * at JavaSoft/Sun.
  */
 
 package com.sun.tools.hat.internal.model;
--- a/jdk/src/share/classes/com/sun/tools/hat/internal/model/ReferenceChain.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/model/ReferenceChain.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-2005 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
@@ -25,20 +25,9 @@
 
 
 /*
- * The contents of this file are subject to the Sun Public License
- * Version 1.0 (the "License"); you may not use this file except in
- * compliance with the License. A copy of the License is available at
- * http://www.sun.com/, and in the file LICENSE.html in the
- * doc directory.
- *
  * The Original Code is HAT. The Initial Developer of the
  * Original Code is Bill Foote, with contributions from others
- * at JavaSoft/Sun. Portions created by Bill Foote and others
- * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
- *
- * In addition to the formal license, I ask that you don't
- * change the history or donations files without permission.
- *
+ * at JavaSoft/Sun.
  */
 
 package com.sun.tools.hat.internal.model;
--- a/jdk/src/share/classes/com/sun/tools/hat/internal/model/Root.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/model/Root.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-2005 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
@@ -25,20 +25,9 @@
 
 
 /*
- * The contents of this file are subject to the Sun Public License
- * Version 1.0 (the "License"); you may not use this file except in
- * compliance with the License. A copy of the License is available at
- * http://www.sun.com/, and in the file LICENSE.html in the
- * doc directory.
- *
  * The Original Code is HAT. The Initial Developer of the
  * Original Code is Bill Foote, with contributions from others
- * at JavaSoft/Sun. Portions created by Bill Foote and others
- * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
- *
- * In addition to the formal license, I ask that you don't
- * change the history or donations files without permission.
- *
+ * at JavaSoft/Sun.
  */
 
 package com.sun.tools.hat.internal.model;
--- a/jdk/src/share/classes/com/sun/tools/hat/internal/model/Snapshot.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/model/Snapshot.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-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
@@ -25,20 +25,9 @@
 
 
 /*
- * The contents of this file are subject to the Sun Public License
- * Version 1.0 (the "License"); you may not use this file except in
- * compliance with the License. A copy of the License is available at
- * http://www.sun.com/, and in the file LICENSE.html in the
- * doc directory.
- *
  * The Original Code is HAT. The Initial Developer of the
  * Original Code is Bill Foote, with contributions from others
- * at JavaSoft/Sun. Portions created by Bill Foote and others
- * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
- *
- * In addition to the formal license, I ask that you don't
- * change the history or donations files without permission.
- *
+ * at JavaSoft/Sun.
  */
 
 package com.sun.tools.hat.internal.model;
--- a/jdk/src/share/classes/com/sun/tools/hat/internal/model/StackFrame.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/model/StackFrame.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-2005 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
@@ -25,20 +25,9 @@
 
 
 /*
- * The contents of this file are subject to the Sun Public License
- * Version 1.0 (the "License"); you may not use this file except in
- * compliance with the License. A copy of the License is available at
- * http://www.sun.com/, and in the file LICENSE.html in the
- * doc directory.
- *
  * The Original Code is HAT. The Initial Developer of the
  * Original Code is Bill Foote, with contributions from others
- * at JavaSoft/Sun. Portions created by Bill Foote and others
- * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
- *
- * In addition to the formal license, I ask that you don't
- * change the history or donations files without permission.
- *
+ * at JavaSoft/Sun.
  */
 
 package com.sun.tools.hat.internal.model;
--- a/jdk/src/share/classes/com/sun/tools/hat/internal/model/StackTrace.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/model/StackTrace.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-2005 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
@@ -25,20 +25,9 @@
 
 
 /*
- * The contents of this file are subject to the Sun Public License
- * Version 1.0 (the "License"); you may not use this file except in
- * compliance with the License. A copy of the License is available at
- * http://www.sun.com/, and in the file LICENSE.html in the
- * doc directory.
- *
  * The Original Code is HAT. The Initial Developer of the
  * Original Code is Bill Foote, with contributions from others
- * at JavaSoft/Sun. Portions created by Bill Foote and others
- * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
- *
- * In addition to the formal license, I ask that you don't
- * change the history or donations files without permission.
- *
+ * at JavaSoft/Sun.
  */
 
 package com.sun.tools.hat.internal.model;
--- a/jdk/src/share/classes/com/sun/tools/hat/internal/oql/OQLEngine.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/oql/OQLEngine.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-2007 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
@@ -25,20 +25,9 @@
 
 
 /*
- * The contents of this file are subject to the Sun Public License
- * Version 1.0 (the "License"); you may not use this file except in
- * compliance with the License. A copy of the License is available at
- * http://www.sun.com/, and in the file LICENSE.html in the
- * doc directory.
- *
  * The Original Code is HAT. The Initial Developer of the
  * Original Code is Bill Foote, with contributions from others
- * at JavaSoft/Sun. Portions created by Bill Foote and others
- * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
- *
- * In addition to the formal license, I ask that you don't
- * change the history or donations files without permission.
- *
+ * at JavaSoft/Sun.
  */
 
 package com.sun.tools.hat.internal.oql;
--- a/jdk/src/share/classes/com/sun/tools/hat/internal/oql/OQLException.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/oql/OQLException.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-2005 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
@@ -25,20 +25,9 @@
 
 
 /*
- * The contents of this file are subject to the Sun Public License
- * Version 1.0 (the "License"); you may not use this file except in
- * compliance with the License. A copy of the License is available at
- * http://www.sun.com/, and in the file LICENSE.html in the
- * doc directory.
- *
  * The Original Code is HAT. The Initial Developer of the
  * Original Code is Bill Foote, with contributions from others
- * at JavaSoft/Sun. Portions created by Bill Foote and others
- * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
- *
- * In addition to the formal license, I ask that you don't
- * change the history or donations files without permission.
- *
+ * at JavaSoft/Sun.
  */
 
 package com.sun.tools.hat.internal.oql;
--- a/jdk/src/share/classes/com/sun/tools/hat/internal/oql/OQLQuery.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/oql/OQLQuery.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-2005 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
@@ -25,20 +25,9 @@
 
 
 /*
- * The contents of this file are subject to the Sun Public License
- * Version 1.0 (the "License"); you may not use this file except in
- * compliance with the License. A copy of the License is available at
- * http://www.sun.com/, and in the file LICENSE.html in the
- * doc directory.
- *
  * The Original Code is HAT. The Initial Developer of the
  * Original Code is Bill Foote, with contributions from others
- * at JavaSoft/Sun. Portions created by Bill Foote and others
- * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
- *
- * In addition to the formal license, I ask that you don't
- * change the history or donations files without permission.
- *
+ * at JavaSoft/Sun.
  */
 
 package com.sun.tools.hat.internal.oql;
--- a/jdk/src/share/classes/com/sun/tools/hat/internal/oql/ObjectVisitor.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/oql/ObjectVisitor.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-2005 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
@@ -25,20 +25,9 @@
 
 
 /*
- * The contents of this file are subject to the Sun Public License
- * Version 1.0 (the "License"); you may not use this file except in
- * compliance with the License. A copy of the License is available at
- * http://www.sun.com/, and in the file LICENSE.html in the
- * doc directory.
- *
  * The Original Code is HAT. The Initial Developer of the
  * Original Code is Bill Foote, with contributions from others
- * at JavaSoft/Sun. Portions created by Bill Foote and others
- * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
- *
- * In addition to the formal license, I ask that you don't
- * change the history or donations files without permission.
- *
+ * at JavaSoft/Sun.
  */
 
 package com.sun.tools.hat.internal.oql;
--- a/jdk/src/share/classes/com/sun/tools/hat/internal/parser/FileReadBuffer.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/parser/FileReadBuffer.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-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
@@ -25,20 +25,9 @@
 
 
 /*
- * The contents of this file are subject to the Sun Public License
- * Version 1.0 (the "License"); you may not use this file except in
- * compliance with the License. A copy of the License is available at
- * http://www.sun.com/, and in the file LICENSE.html in the
- * doc directory.
- *
  * The Original Code is HAT. The Initial Developer of the
  * Original Code is Bill Foote, with contributions from others
- * at JavaSoft/Sun. Portions created by Bill Foote and others
- * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
- *
- * In addition to the formal license, I ask that you don't
- * change the history or donations files without permission.
- *
+ * at JavaSoft/Sun.
  */
 
 package com.sun.tools.hat.internal.parser;
--- a/jdk/src/share/classes/com/sun/tools/hat/internal/parser/HprofReader.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/parser/HprofReader.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-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
@@ -23,21 +23,11 @@
  * have any questions.
  */
 
+
 /*
- * The contents of this file are subject to the Sun Public License
- * Version 1.0 (the "License"); you may not use this file except in
- * compliance with the License. A copy of the License is available at
- * http://www.sun.com/, and in the file LICENSE.html in the
- * doc directory.
- *
  * The Original Code is HAT. The Initial Developer of the
  * Original Code is Bill Foote, with contributions from others
- * at JavaSoft/Sun. Portions created by Bill Foote and others
- * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
- *
- * In addition to the formal license, I ask that you don't
- * change the history or donations files without permission.
- *
+ * at JavaSoft/Sun.
  */
 
 package com.sun.tools.hat.internal.parser;
--- a/jdk/src/share/classes/com/sun/tools/hat/internal/parser/MappedReadBuffer.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/parser/MappedReadBuffer.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-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
@@ -23,21 +23,11 @@
  * have any questions.
  */
 
+
 /*
- * The contents of this file are subject to the Sun Public License
- * Version 1.0 (the "License"); you may not use this file except in
- * compliance with the License. A copy of the License is available at
- * http://www.sun.com/, and in the file LICENSE.html in the
- * doc directory.
- *
  * The Original Code is HAT. The Initial Developer of the
  * Original Code is Bill Foote, with contributions from others
- * at JavaSoft/Sun. Portions created by Bill Foote and others
- * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
- *
- * In addition to the formal license, I ask that you don't
- * change the history or donations files without permission.
- *
+ * at JavaSoft/Sun.
  */
 
 package com.sun.tools.hat.internal.parser;
--- a/jdk/src/share/classes/com/sun/tools/hat/internal/parser/PositionDataInputStream.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/parser/PositionDataInputStream.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-2005 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
@@ -25,20 +25,9 @@
 
 
 /*
- * The contents of this file are subject to the Sun Public License
- * Version 1.0 (the "License"); you may not use this file except in
- * compliance with the License. A copy of the License is available at
- * http://www.sun.com/, and in the file LICENSE.html in the
- * doc directory.
- *
  * The Original Code is HAT. The Initial Developer of the
  * Original Code is Bill Foote, with contributions from others
- * at JavaSoft/Sun. Portions created by Bill Foote and others
- * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
- *
- * In addition to the formal license, I ask that you don't
- * change the history or donations files without permission.
- *
+ * at JavaSoft/Sun.
  */
 
 package com.sun.tools.hat.internal.parser;
--- a/jdk/src/share/classes/com/sun/tools/hat/internal/parser/PositionInputStream.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/parser/PositionInputStream.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-2005 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
@@ -25,20 +25,9 @@
 
 
 /*
- * The contents of this file are subject to the Sun Public License
- * Version 1.0 (the "License"); you may not use this file except in
- * compliance with the License. A copy of the License is available at
- * http://www.sun.com/, and in the file LICENSE.html in the
- * doc directory.
- *
  * The Original Code is HAT. The Initial Developer of the
  * Original Code is Bill Foote, with contributions from others
- * at JavaSoft/Sun. Portions created by Bill Foote and others
- * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
- *
- * In addition to the formal license, I ask that you don't
- * change the history or donations files without permission.
- *
+ * at JavaSoft/Sun.
  */
 
 package com.sun.tools.hat.internal.parser;
--- a/jdk/src/share/classes/com/sun/tools/hat/internal/parser/ReadBuffer.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/parser/ReadBuffer.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-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
@@ -25,20 +25,9 @@
 
 
 /*
- * The contents of this file are subject to the Sun Public License
- * Version 1.0 (the "License"); you may not use this file except in
- * compliance with the License. A copy of the License is available at
- * http://www.sun.com/, and in the file LICENSE.html in the
- * doc directory.
- *
  * The Original Code is HAT. The Initial Developer of the
  * Original Code is Bill Foote, with contributions from others
- * at JavaSoft/Sun. Portions created by Bill Foote and others
- * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
- *
- * In addition to the formal license, I ask that you don't
- * change the history or donations files without permission.
- *
+ * at JavaSoft/Sun.
  */
 
 package com.sun.tools.hat.internal.parser;
--- a/jdk/src/share/classes/com/sun/tools/hat/internal/parser/Reader.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/parser/Reader.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-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
@@ -25,20 +25,9 @@
 
 
 /*
- * The contents of this file are subject to the Sun Public License
- * Version 1.0 (the "License"); you may not use this file except in
- * compliance with the License. A copy of the License is available at
- * http://www.sun.com/, and in the file LICENSE.html in the
- * doc directory.
- *
  * The Original Code is HAT. The Initial Developer of the
  * Original Code is Bill Foote, with contributions from others
- * at JavaSoft/Sun. Portions created by Bill Foote and others
- * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
- *
- * In addition to the formal license, I ask that you don't
- * change the history or donations files without permission.
- *
+ * at JavaSoft/Sun.
  */
 
 package com.sun.tools.hat.internal.parser;
--- a/jdk/src/share/classes/com/sun/tools/hat/internal/server/AllClassesQuery.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/server/AllClassesQuery.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-2005 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
@@ -25,20 +25,9 @@
 
 
 /*
- * The contents of this file are subject to the Sun Public License
- * Version 1.0 (the "License"); you may not use this file except in
- * compliance with the License. A copy of the License is available at
- * http://www.sun.com/, and in the file LICENSE.html in the
- * doc directory.
- *
  * The Original Code is HAT. The Initial Developer of the
  * Original Code is Bill Foote, with contributions from others
- * at JavaSoft/Sun. Portions created by Bill Foote and others
- * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
- *
- * In addition to the formal license, I ask that you don't
- * change the history or donations files without permission.
- *
+ * at JavaSoft/Sun.
  */
 
 package com.sun.tools.hat.internal.server;
--- a/jdk/src/share/classes/com/sun/tools/hat/internal/server/AllRootsQuery.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/server/AllRootsQuery.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-2005 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
@@ -25,20 +25,9 @@
 
 
 /*
- * The contents of this file are subject to the Sun Public License
- * Version 1.0 (the "License"); you may not use this file except in
- * compliance with the License. A copy of the License is available at
- * http://www.sun.com/, and in the file LICENSE.html in the
- * doc directory.
- *
  * The Original Code is HAT. The Initial Developer of the
  * Original Code is Bill Foote, with contributions from others
- * at JavaSoft/Sun. Portions created by Bill Foote and others
- * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
- *
- * In addition to the formal license, I ask that you don't
- * change the history or donations files without permission.
- *
+ * at JavaSoft/Sun.
  */
 
 package com.sun.tools.hat.internal.server;
--- a/jdk/src/share/classes/com/sun/tools/hat/internal/server/ClassQuery.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/server/ClassQuery.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-2005 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
@@ -25,20 +25,9 @@
 
 
 /*
- * The contents of this file are subject to the Sun Public License
- * Version 1.0 (the "License"); you may not use this file except in
- * compliance with the License. A copy of the License is available at
- * http://www.sun.com/, and in the file LICENSE.html in the
- * doc directory.
- *
  * The Original Code is HAT. The Initial Developer of the
  * Original Code is Bill Foote, with contributions from others
- * at JavaSoft/Sun. Portions created by Bill Foote and others
- * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
- *
- * In addition to the formal license, I ask that you don't
- * change the history or donations files without permission.
- *
+ * at JavaSoft/Sun.
  */
 
 package com.sun.tools.hat.internal.server;
--- a/jdk/src/share/classes/com/sun/tools/hat/internal/server/FinalizerObjectsQuery.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/server/FinalizerObjectsQuery.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-2005 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
@@ -25,20 +25,9 @@
 
 
 /*
- * The contents of this file are subject to the Sun Public License
- * Version 1.0 (the "License"); you may not use this file except in
- * compliance with the License. A copy of the License is available at
- * http://www.sun.com/, and in the file LICENSE.html in the
- * doc directory.
- *
  * The Original Code is HAT. The Initial Developer of the
  * Original Code is Bill Foote, with contributions from others
- * at JavaSoft/Sun. Portions created by Bill Foote and others
- * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
- *
- * In addition to the formal license, I ask that you don't
- * change the history or donations files without permission.
- *
+ * at JavaSoft/Sun.
  */
 
 package com.sun.tools.hat.internal.server;
--- a/jdk/src/share/classes/com/sun/tools/hat/internal/server/FinalizerSummaryQuery.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/server/FinalizerSummaryQuery.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-2005 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
@@ -25,20 +25,9 @@
 
 
 /*
- * The contents of this file are subject to the Sun Public License
- * Version 1.0 (the "License"); you may not use this file except in
- * compliance with the License. A copy of the License is available at
- * http://www.sun.com/, and in the file LICENSE.html in the
- * doc directory.
- *
  * The Original Code is HAT. The Initial Developer of the
  * Original Code is Bill Foote, with contributions from others
- * at JavaSoft/Sun. Portions created by Bill Foote and others
- * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
- *
- * In addition to the formal license, I ask that you don't
- * change the history or donations files without permission.
- *
+ * at JavaSoft/Sun.
  */
 
 package com.sun.tools.hat.internal.server;
--- a/jdk/src/share/classes/com/sun/tools/hat/internal/server/HistogramQuery.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/server/HistogramQuery.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-2005 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
@@ -25,20 +25,9 @@
 
 
 /*
- * The contents of this file are subject to the Sun Public License
- * Version 1.0 (the "License"); you may not use this file except in
- * compliance with the License. A copy of the License is available at
- * http://www.sun.com/, and in the file LICENSE.html in the
- * doc directory.
- *
  * The Original Code is HAT. The Initial Developer of the
  * Original Code is Bill Foote, with contributions from others
- * at JavaSoft/Sun. Portions created by Bill Foote and others
- * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
- *
- * In addition to the formal license, I ask that you don't
- * change the history or donations files without permission.
- *
+ * at JavaSoft/Sun.
  */
 
 package com.sun.tools.hat.internal.server;
--- a/jdk/src/share/classes/com/sun/tools/hat/internal/server/HttpReader.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/server/HttpReader.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-2005 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
@@ -25,20 +25,9 @@
 
 
 /*
- * The contents of this file are subject to the Sun Public License
- * Version 1.0 (the "License"); you may not use this file except in
- * compliance with the License. A copy of the License is available at
- * http://www.sun.com/, and in the file LICENSE.html in the
- * doc directory.
- *
  * The Original Code is HAT. The Initial Developer of the
  * Original Code is Bill Foote, with contributions from others
- * at JavaSoft/Sun. Portions created by Bill Foote and others
- * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
- *
- * In addition to the formal license, I ask that you don't
- * change the history or donations files without permission.
- *
+ * at JavaSoft/Sun.
  */
 
 package com.sun.tools.hat.internal.server;
--- a/jdk/src/share/classes/com/sun/tools/hat/internal/server/InstancesCountQuery.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/server/InstancesCountQuery.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-2005 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,19 +24,10 @@
  */
 
 
-/* The contents of this file are subject to the Sun Public License
- * Version 1.0 (the "License"); you may not use this file except in
- * compliance with the License. A copy of the License is available at
- * http://www.sun.com/, and in the file LICENSE.html in the
- * doc directory.
- *
+/*
  * The Original Code is HAT. The Initial Developer of the
  * Original Code is Bill Foote, with contributions from others
- * at JavaSoft/Sun. Portions created by Bill Foote and others
- * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
- *
- * In addition to the formal license, I ask that you don't
- * change the history or donations files without permission.
+ * at JavaSoft/Sun.
  */
 
 package com.sun.tools.hat.internal.server;
--- a/jdk/src/share/classes/com/sun/tools/hat/internal/server/InstancesQuery.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/server/InstancesQuery.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-2005 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,19 +24,10 @@
  */
 
 
-/* The contents of this file are subject to the Sun Public License
- * Version 1.0 (the "License"); you may not use this file except in
- * compliance with the License. A copy of the License is available at
- * http://www.sun.com/, and in the file LICENSE.html in the
- * doc directory.
- *
+/*
  * The Original Code is HAT. The Initial Developer of the
  * Original Code is Bill Foote, with contributions from others
- * at JavaSoft/Sun. Portions created by Bill Foote and others
- * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
- *
- * In addition to the formal license, I ask that you don't
- * change the history or donations files without permission.
+ * at JavaSoft/Sun.
  */
 
 package com.sun.tools.hat.internal.server;
--- a/jdk/src/share/classes/com/sun/tools/hat/internal/server/OQLHelp.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/server/OQLHelp.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-2005 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
@@ -25,20 +25,9 @@
 
 
 /*
- * The contents of this file are subject to the Sun Public License
- * Version 1.0 (the "License"); you may not use this file except in
- * compliance with the License. A copy of the License is available at
- * http://www.sun.com/, and in the file LICENSE.html in the
- * doc directory.
- *
  * The Original Code is HAT. The Initial Developer of the
  * Original Code is Bill Foote, with contributions from others
- * at JavaSoft/Sun. Portions created by Bill Foote and others
- * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
- *
- * In addition to the formal license, I ask that you don't
- * change the history or donations files without permission.
- *
+ * at JavaSoft/Sun.
  */
 
 package com.sun.tools.hat.internal.server;
--- a/jdk/src/share/classes/com/sun/tools/hat/internal/server/OQLQuery.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/server/OQLQuery.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-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
@@ -25,20 +25,9 @@
 
 
 /*
- * The contents of this file are subject to the Sun Public License
- * Version 1.0 (the "License"); you may not use this file except in
- * compliance with the License. A copy of the License is available at
- * http://www.sun.com/, and in the file LICENSE.html in the
- * doc directory.
- *
  * The Original Code is HAT. The Initial Developer of the
  * Original Code is Bill Foote, with contributions from others
- * at JavaSoft/Sun. Portions created by Bill Foote and others
- * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
- *
- * In addition to the formal license, I ask that you don't
- * change the history or donations files without permission.
- *
+ * at JavaSoft/Sun.
  */
 
 package com.sun.tools.hat.internal.server;
--- a/jdk/src/share/classes/com/sun/tools/hat/internal/server/ObjectQuery.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/server/ObjectQuery.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-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
@@ -24,19 +24,10 @@
  */
 
 
-/* The contents of this file are subject to the Sun Public License
- * Version 1.0 (the "License"); you may not use this file except in
- * compliance with the License. A copy of the License is available at
- * http://www.sun.com/, and in the file LICENSE.html in the
- * doc directory.
- *
+/*
  * The Original Code is HAT. The Initial Developer of the
  * Original Code is Bill Foote, with contributions from others
- * at JavaSoft/Sun. Portions created by Bill Foote and others
- * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
- *
- * In addition to the formal license, I ask that you don't
- * change the history or donations files without permission.
+ * at JavaSoft/Sun.
  */
 
 package com.sun.tools.hat.internal.server;
--- a/jdk/src/share/classes/com/sun/tools/hat/internal/server/PlatformClasses.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/server/PlatformClasses.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-2005 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,19 +24,10 @@
  */
 
 
-/* The contents of this file are subject to the Sun Public License
- * Version 1.0 (the "License"); you may not use this file except in
- * compliance with the License. A copy of the License is available at
- * http://www.sun.com/, and in the file LICENSE.html in the
- * doc directory.
- *
+/*
  * The Original Code is HAT. The Initial Developer of the
  * Original Code is Bill Foote, with contributions from others
- * at JavaSoft/Sun. Portions created by Bill Foote and others
- * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
- *
- * In addition to the formal license, I ask that you don't
- * change the history or donations files without permission.
+ * at JavaSoft/Sun.
  */
 
 package com.sun.tools.hat.internal.server;
--- a/jdk/src/share/classes/com/sun/tools/hat/internal/server/QueryHandler.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/server/QueryHandler.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-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
@@ -24,20 +24,10 @@
  */
 
 
-
-/* The contents of this file are subject to the Sun Public License
- * Version 1.0 (the "License"); you may not use this file except in
- * compliance with the License. A copy of the License is available at
- * http://www.sun.com/, and in the file LICENSE.html in the
- * doc directory.
- *
+/*
  * The Original Code is HAT. The Initial Developer of the
  * Original Code is Bill Foote, with contributions from others
- * at JavaSoft/Sun. Portions created by Bill Foote and others
- * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
- *
- * In addition to the formal license, I ask that you don't
- * change the history or donations files without permission.
+ * at JavaSoft/Sun.
  */
 
 package com.sun.tools.hat.internal.server;
--- a/jdk/src/share/classes/com/sun/tools/hat/internal/server/QueryListener.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/server/QueryListener.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-2005 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,19 +24,10 @@
  */
 
 
-/* The contents of this file are subject to the Sun Public License
- * Version 1.0 (the "License"); you may not use this file except in
- * compliance with the License. A copy of the License is available at
- * http://www.sun.com/, and in the file LICENSE.html in the
- * doc directory.
- *
+/*
  * The Original Code is HAT. The Initial Developer of the
  * Original Code is Bill Foote, with contributions from others
- * at JavaSoft/Sun. Portions created by Bill Foote and others
- * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
- *
- * In addition to the formal license, I ask that you don't
- * change the history or donations files without permission.
+ * at JavaSoft/Sun.
  */
 
 package com.sun.tools.hat.internal.server;
--- a/jdk/src/share/classes/com/sun/tools/hat/internal/server/ReachableQuery.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/server/ReachableQuery.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-2005 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,20 +24,10 @@
  */
 
 
-
-/* The contents of this file are subject to the Sun Public License
- * Version 1.0 (the "License"); you may not use this file except in
- * compliance with the License. A copy of the License is available at
- * http://www.sun.com/, and in the file LICENSE.html in the
- * doc directory.
- *
+/*
  * The Original Code is HAT. The Initial Developer of the
  * Original Code is Bill Foote, with contributions from others
- * at JavaSoft/Sun. Portions created by Bill Foote and others
- * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
- *
- * In addition to the formal license, I ask that you don't
- * change the history or donations files without permission.
+ * at JavaSoft/Sun.
  */
 
 package com.sun.tools.hat.internal.server;
--- a/jdk/src/share/classes/com/sun/tools/hat/internal/server/RefsByTypeQuery.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/server/RefsByTypeQuery.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-2005 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
@@ -25,20 +25,9 @@
 
 
 /*
- * The contents of this file are subject to the Sun Public License
- * Version 1.0 (the "License"); you may not use this file except in
- * compliance with the License. A copy of the License is available at
- * http://www.sun.com/, and in the file LICENSE.html in the
- * doc directory.
- *
  * The Original Code is HAT. The Initial Developer of the
  * Original Code is Bill Foote, with contributions from others
- * at JavaSoft/Sun. Portions created by Bill Foote and others
- * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
- *
- * In addition to the formal license, I ask that you don't
- * change the history or donations files without permission.
- *
+ * at JavaSoft/Sun.
  */
 
 package com.sun.tools.hat.internal.server;
--- a/jdk/src/share/classes/com/sun/tools/hat/internal/server/RootStackQuery.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/server/RootStackQuery.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-2005 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,19 +24,10 @@
  */
 
 
-/* The contents of this file are subject to the Sun Public License
- * Version 1.0 (the "License"); you may not use this file except in
- * compliance with the License. A copy of the License is available at
- * http://www.sun.com/, and in the file LICENSE.html in the
- * doc directory.
- *
+/*
  * The Original Code is HAT. The Initial Developer of the
  * Original Code is Bill Foote, with contributions from others
- * at JavaSoft/Sun. Portions created by Bill Foote and others
- * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
- *
- * In addition to the formal license, I ask that you don't
- * change the history or donations files without permission.
+ * at JavaSoft/Sun.
  */
 
 package com.sun.tools.hat.internal.server;
--- a/jdk/src/share/classes/com/sun/tools/hat/internal/server/RootsQuery.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/server/RootsQuery.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-2005 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,19 +24,10 @@
  */
 
 
-/* The contents of this file are subject to the Sun Public License
- * Version 1.0 (the "License"); you may not use this file except in
- * compliance with the License. A copy of the License is available at
- * http://www.sun.com/, and in the file LICENSE.html in the
- * doc directory.
- *
+/*
  * The Original Code is HAT. The Initial Developer of the
  * Original Code is Bill Foote, with contributions from others
- * at JavaSoft/Sun. Portions created by Bill Foote and others
- * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
- *
- * In addition to the formal license, I ask that you don't
- * change the history or donations files without permission.
+ * at JavaSoft/Sun.
  */
 
 package com.sun.tools.hat.internal.server;
--- a/jdk/src/share/classes/com/sun/tools/hat/internal/util/ArraySorter.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/util/ArraySorter.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-2005 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,19 +24,10 @@
  */
 
 
-/* The contents of this file are subject to the Sun Public License
- * Version 1.0 (the "License"); you may not use this file except in
- * compliance with the License. A copy of the License is available at
- * http://www.sun.com/, and in the file LICENSE.html in the
- * doc directory.
- *
+/*
  * The Original Code is HAT. The Initial Developer of the
  * Original Code is Bill Foote, with contributions from others
- * at JavaSoft/Sun. Portions created by Bill Foote and others
- * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
- *
- * In addition to the formal license, I ask that you don't
- * change the history or donations files without permission.
+ * at JavaSoft/Sun.
  */
 
 package com.sun.tools.hat.internal.util;
--- a/jdk/src/share/classes/com/sun/tools/hat/internal/util/Comparer.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/util/Comparer.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-2005 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,19 +24,10 @@
  */
 
 
-/* The contents of this file are subject to the Sun Public License
- * Version 1.0 (the "License"); you may not use this file except in
- * compliance with the License. A copy of the License is available at
- * http://www.sun.com/, and in the file LICENSE.html in the
- * doc directory.
- *
+/*
  * The Original Code is HAT. The Initial Developer of the
  * Original Code is Bill Foote, with contributions from others
- * at JavaSoft/Sun. Portions created by Bill Foote and others
- * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
- *
- * In addition to the formal license, I ask that you don't
- * change the history or donations files without permission.
+ * at JavaSoft/Sun.
  */
 
 package com.sun.tools.hat.internal.util;
--- a/jdk/src/share/classes/com/sun/tools/hat/internal/util/CompositeEnumeration.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/util/CompositeEnumeration.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-2005 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
@@ -25,20 +25,9 @@
 
 
 /*
- * The contents of this file are subject to the Sun Public License
- * Version 1.0 (the "License"); you may not use this file except in
- * compliance with the License. A copy of the License is available at
- * http://www.sun.com/, and in the file LICENSE.html in the
- * doc directory.
- *
  * The Original Code is HAT. The Initial Developer of the
  * Original Code is Bill Foote, with contributions from others
- * at JavaSoft/Sun. Portions created by Bill Foote and others
- * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
- *
- * In addition to the formal license, I ask that you don't
- * change the history or donations files without permission.
- *
+ * at JavaSoft/Sun.
  */
 
 package com.sun.tools.hat.internal.util;
--- a/jdk/src/share/classes/com/sun/tools/hat/internal/util/Misc.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/util/Misc.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-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
@@ -24,19 +24,10 @@
  */
 
 
-/* The contents of this file are subject to the Sun Public License
- * Version 1.0 (the "License"); you may not use this file except in
- * compliance with the License. A copy of the License is available at
- * http://www.sun.com/, and in the file LICENSE.html in the
- * doc directory.
- *
+/*
  * The Original Code is HAT. The Initial Developer of the
  * Original Code is Bill Foote, with contributions from others
- * at JavaSoft/Sun. Portions created by Bill Foote and others
- * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
- *
- * In addition to the formal license, I ask that you don't
- * change the history or donations files without permission.
+ * at JavaSoft/Sun.
  */
 
 package com.sun.tools.hat.internal.util;
--- a/jdk/src/share/classes/com/sun/tools/hat/internal/util/VectorSorter.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/com/sun/tools/hat/internal/util/VectorSorter.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-2005 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,19 +24,10 @@
  */
 
 
-/* The contents of this file are subject to the Sun Public License
- * Version 1.0 (the "License"); you may not use this file except in
- * compliance with the License. A copy of the License is available at
- * http://www.sun.com/, and in the file LICENSE.html in the
- * doc directory.
- *
+/*
  * The Original Code is HAT. The Initial Developer of the
  * Original Code is Bill Foote, with contributions from others
- * at JavaSoft/Sun. Portions created by Bill Foote and others
- * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
- *
- * In addition to the formal license, I ask that you don't
- * change the history or donations files without permission.
+ * at JavaSoft/Sun.
  */
 
 package com.sun.tools.hat.internal.util;
--- a/jdk/src/share/classes/com/sun/tools/hat/resources/hat.js	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/com/sun/tools/hat/resources/hat.js	Thu Jun 12 13:50:55 2008 -0700
@@ -23,22 +23,10 @@
  * have any questions.
  */
 
-
 /*
- * The contents of this file are subject to the Sun Public License
- * Version 1.0 (the "License"); you may not use this file except in
- * compliance with the License. A copy of the License is available at
- * http://www.sun.com/, and in the file LICENSE.html in the
- * doc directory.
- * 
  * The Original Code is HAT. The Initial Developer of the
  * Original Code is Bill Foote, with contributions from others
- * at JavaSoft/Sun. Portions created by Bill Foote and others
- * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
- * 
- * In addition to the formal license, I ask that you don't
- * change the history or donations files without permission.
- * 
+ * at JavaSoft/Sun.
  */
 
 var hatPkg = Packages.com.sun.tools.hat.internal;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/classes/com/sun/tracing/Probe.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,71 @@
+/*
+ * Copyright 2008 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.tracing;
+
+/**
+ * The {@code Probe} interface represents a tracepoint.
+ *
+ * A {@code Probe} instance is obtained by calling the
+ * {@code Provider.getProbe()} method of a provider instance created by
+ * {@code ProviderFactory.createProvider()}.  A {@code Probe} can be used to
+ * trigger a probe manually (provided the correct arguments are passed to
+ * it), or to check a probe to see if anything is currently tracing it.
+ * <p>
+ * A tracing check can be used to avoid lengthy work that might be
+ * needed to set up the probe's arguments.  However, checking
+ * whether the probe is enabled generally takes the same amount of time
+ * as actually triggering the probe. So, you should only check a probe's status
+ * without triggering it if setting up the arguments is very expensive.
+ * <p>
+ * Users do not need to implement this interface: instances are
+ * created automatically by the system when a {@code Provider)} instance is
+ * created.
+ * <p>
+ * @since 1.7
+ */
+
+public interface Probe {
+    /**
+     * Checks whether there is an active trace of this probe.
+     *
+     * @return true if an active trace is detected.
+     */
+    boolean isEnabled();
+
+    /**
+     * Determines whether a tracepoint is enabled.
+     *
+     * Typically, users do not need to use this method. It is called
+     * automatically when a Provider's instance method is called. Calls to
+     * this method expect the arguments to match the declared parameters for
+     * the method associated with the probe.
+     *
+     * @param args the parameters to pass to the method.
+     * @throws IllegalArgumentException if the provided parameters do not
+     * match the method declaration for this probe.
+     */
+    void trigger(Object ... args);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/classes/com/sun/tracing/ProbeName.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,48 @@
+/*
+ * Copyright 2008 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.tracing;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.ElementType;
+
+/**
+ * An annotation used to override the name of a probe.
+ * <p>
+ * This annotation can be added to a method in a user-defined {@code Provider}
+ * interface, to set the name that will be used for the generated probe
+ * associated with that method.  Without this annotation, the name will be the
+ * name of the method.
+ * <p>
+ * @since 1.7
+ */
+@Retention(RetentionPolicy.RUNTIME)
+@Target(ElementType.METHOD)
+public @interface ProbeName {
+    String value();
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/classes/com/sun/tracing/Provider.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,76 @@
+/*
+ * Copyright 2008 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.tracing;
+
+/**
+ * {@code Provider} is a superinterface for user-defined tracing providers.
+ * <p>
+ * To define tracepoints, users must extend this interface
+ * and then use a {@code ProviderFactory} to create an instance of the
+ * newly-defined interface.  Each method in the defined interface represents a
+ * tracepoint (or probe), which can be triggered by calling the associated
+ * method on the returned instance.
+ * <p>
+ * This interface also contains a {@code getProbe()} method, which can be
+ * used to get direct handles to the {@code Probe} objects themselves.
+ * {@code Probe} objects can be triggered manually, or they can be queried to
+ * check their state.
+ * <p>
+ * When an application has finished triggering probes, it should call
+ * {@code dispose()} to free up any system resources associated with the
+ * Provider.
+ * <p>
+ * All methods declared in a subclass of this interface should have a
+ * {@code void} return type. Methods can have parameters, and when called the
+ * values of the arguments will be passed to the tracing implementation.
+ * If any methods do not have a {@code void} return type, an
+ * {@code java.lang.IllegalArgumentException} will be thrown when the
+ * provider is registered.
+ * @since 1.7
+ */
+
+public interface Provider {
+    /**
+     * Retrieves a reference to a Probe object, which is used to check status
+     * or to trigger the probe manually.
+     *
+     * If the provided method parameter is not a method of the provider
+     * interface,  or if the provider interface has been disposed, then
+     * this returns null
+     *
+     * @param method a method declared in the provider.
+     * @return the specified probe represented by that method, or null.
+     */
+    Probe getProbe(java.lang.reflect.Method method);
+
+    /**
+     * Disposes system resources associated with this provider.
+     *
+     * After calling this method, triggering the probes will have no effect.
+     * Additional calls to this method after the first call are ignored.
+     */
+    void dispose();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/classes/com/sun/tracing/ProviderFactory.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,110 @@
+
+package com.sun.tracing;
+
+import java.util.HashSet;
+import java.io.PrintStream;
+import java.lang.reflect.Field;
+import java.util.logging.Logger;
+
+import sun.tracing.NullProviderFactory;
+import sun.tracing.PrintStreamProviderFactory;
+import sun.tracing.MultiplexProviderFactory;
+import sun.tracing.dtrace.DTraceProviderFactory;
+
+/**
+ * {@code ProviderFactory} is a factory class used to create instances of
+ * providers.
+ *
+ * To enable tracing in an application, this class must be used to create
+ * instances of the provider interfaces defined by users.
+ * The system-defined factory is obtained by using the
+ * {@code getDefaultFactory()} static method.  The resulting instance can be
+ * used to create any number of providers.
+ *
+ * @since 1.7
+ */
+public abstract class ProviderFactory {
+
+    protected ProviderFactory() {}
+
+    /**
+     * Creates an implementation of a Provider interface.
+     *
+     * @param cls the provider interface to be defined.
+     * @return an implementation of {@code cls}, whose methods, when called,
+     * will trigger tracepoints in the application.
+     * @throws NullPointerException if cls is null
+     * @throws IllegalArgumentException if the class definition contains
+     * non-void methods
+     */
+    public abstract <T extends Provider> T createProvider(Class<T> cls);
+
+    /**
+     * Returns an implementation of a {@code ProviderFactory} which
+     * creates instances of Providers.
+     *
+     * The created Provider instances will be linked to all appropriate
+     * and enabled system-defined tracing mechanisms in the JDK.
+     *
+     * @return a {@code ProviderFactory} that is used to create Providers.
+     */
+    public static ProviderFactory getDefaultFactory() {
+        HashSet<ProviderFactory> factories = new HashSet<ProviderFactory>();
+
+        // Try to instantiate a DTraceProviderFactory
+        String prop = null;
+        try { prop = System.getProperty("com.sun.tracing.dtrace"); }
+        catch (java.security.AccessControlException e) {
+            Logger.getAnonymousLogger().fine(
+                "Cannot access property com.sun.tracing.dtrace");
+        }
+        if ( (prop == null || !prop.equals("disable")) &&
+             DTraceProviderFactory.isSupported() ) {
+            factories.add(new DTraceProviderFactory());
+        }
+
+        // Try to instantiate an output stream factory
+        try { prop = System.getProperty("sun.tracing.stream"); }
+        catch (java.security.AccessControlException e) {
+            Logger.getAnonymousLogger().fine(
+                "Cannot access property sun.tracing.stream");
+        }
+        if (prop != null) {
+            for (String spec : prop.split(",")) {
+                PrintStream ps = getPrintStreamFromSpec(spec);
+                if (ps != null) {
+                    factories.add(new PrintStreamProviderFactory(ps));
+                }
+            }
+        }
+
+        // See how many factories we instantiated, and return an appropriate
+        // factory that encapsulates that.
+        if (factories.size() == 0) {
+            return new NullProviderFactory();
+        } else if (factories.size() == 1) {
+            return factories.toArray(new ProviderFactory[1])[0];
+        } else {
+            return new MultiplexProviderFactory(factories);
+        }
+    }
+
+    private static PrintStream getPrintStreamFromSpec(String spec) {
+        try {
+            // spec is in the form of <class>.<field>, where <class> is
+            // a fully specified class name, and <field> is a static member
+            // in that class.  The <field> must be a 'PrintStream' or subtype
+            // in order to be used.
+            int fieldpos = spec.lastIndexOf('.');
+            Class<?> cls = Class.forName(spec.substring(0, fieldpos));
+            Field f = cls.getField(spec.substring(fieldpos + 1));
+            Class<?> fieldType = f.getType();
+            return (PrintStream)f.get(null);
+        } catch (Exception e) {
+            Logger.getAnonymousLogger().warning(
+                "Could not parse sun.tracing.stream property: " + e);
+        }
+        return null;
+    }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/classes/com/sun/tracing/ProviderName.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,48 @@
+/*
+ * Copyright 2008 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.tracing;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.ElementType;
+
+/**
+ * An annotation used to specify the name of a provider.
+ * <p>
+ * This annotation can be added to a user-defined {@code Provider}
+ * interface, to set the name that will be used
+ * for the provider in the generated probes.  Without this annotation,
+ * the simple class name of the provider interface is used.
+ * <p>
+ * @since 1.7
+ */
+@Retention(RetentionPolicy.RUNTIME)
+@Target(ElementType.TYPE)
+public @interface ProviderName {
+    String value();
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/classes/com/sun/tracing/dtrace/ArgsAttributes.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,53 @@
+/*
+ * Copyright 2008 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.tracing.dtrace;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.ElementType;
+
+
+/**
+ * This annotation describes the interface attributes of the probe arguments in
+ * a single provider.
+ *
+ * This annotation can be added to a user-defined {@code Provider} specification
+ * interface to set the stability attributes of the probe arguments, for
+ * all the probes specified in that provider.
+ * <p>
+ * If this annotation is not present, the interface attributes for the
+ * arguments are Private/Private/Unknown.
+ * <p>
+ * @see <a href="http://docs.sun.com/app/docs/doc/817-6223/6mlkidlnp?a=view">Solaris Dynamic Tracing Guide, Chapter 39: Stability</a>
+ * @since 1.7
+ */
+
+@Retention(RetentionPolicy.RUNTIME)
+@Target({ ElementType.TYPE })
+public @interface ArgsAttributes {
+  Attributes value();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/classes/com/sun/tracing/dtrace/Attributes.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,66 @@
+/*
+ * Copyright 2008 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.tracing.dtrace;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.ElementType;
+
+
+/**
+ * This annotation describes the interface's field attributes
+ * for the probes in a provider.
+ *
+ * This annotation provides the contents of field-specific annotations
+ * that specify the stability attributes and dependency class of a
+ * particular field, for the probes in a provider.
+ * <p>
+ * The default interface attributes for unspecified fields is
+ * Private/Private/Unknown.
+ * <p>
+ * @see <a href="http://docs.sun.com/app/docs/doc/817-6223/6mlkidlnp?a=view">Solaris Dynamic Tracing Guide, Chapter 39: Stability</a>
+ * @since 1.7
+ */
+
+@Retention(RetentionPolicy.RUNTIME)
+@Target({})
+public @interface Attributes {
+  /**
+   * The stability level of the name.
+   */
+  StabilityLevel name() default StabilityLevel.PRIVATE;
+
+  /**
+   * The stability level of the data.
+   */
+  StabilityLevel data() default StabilityLevel.PRIVATE;
+
+  /**
+   * The interface attribute's dependency class.
+   */
+  DependencyClass dependency()  default DependencyClass.UNKNOWN;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/classes/com/sun/tracing/dtrace/DependencyClass.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,77 @@
+/*
+ * Copyright 2008 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.tracing.dtrace;
+
+/**
+ * Enumeration for the DTrace dependency classes.
+ *
+ * @see <a href="http://docs.sun.com/app/docs/doc/817-6223/6mlkidlnp?a=view">Solaris Dynamic Tracing Guide for details, Chapter 39: Stability</a>
+ * @since 1.7
+ */
+public enum DependencyClass {
+    /**
+     * The interface has an unknown set of architectural dependencies.
+     */
+    UNKNOWN  (0),
+    /**
+     * The interface is specific to the CPU model of the current system.
+     */
+    CPU      (1),
+    /**
+     * The interface is specific to the hardware platform of the current
+     * system.
+     */
+    PLATFORM (2),
+    /**
+     * The interface is specific to the hardware platform group of the
+     * current system.
+     */
+    GROUP    (3),
+    /**
+     * The interface is specific to the instruction set architecture (ISA)
+     * supported by the microprocessors on this system.
+     */
+    ISA      (4),
+    /**
+     * The interface is common to all Solaris systems regardless of the
+     * underlying hardware.
+     */
+    COMMON   (5);
+
+    public String toDisplayString() {
+        return toString().substring(0,1) +
+               toString().substring(1).toLowerCase();
+    }
+
+    public int getEncoding() { return encoding; }
+
+    private int encoding;
+
+    private DependencyClass(int encoding) {
+        this.encoding = encoding;
+    }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/classes/com/sun/tracing/dtrace/FunctionAttributes.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,51 @@
+/*
+ * Copyright 2008 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.tracing.dtrace;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.ElementType;
+
+/**
+ * This annotation describes the interface attributes of the
+ * {@code function} field for a single provider.
+ *
+ * This annotation can be added to a user-defined {@code Provider} specification
+ * interface to set the stability attributes of the {@code function} field for
+ * all probes specified in that provider.
+ * <p>
+ * If this annotation is not present, the interface attributes for the
+ * {@code function} field are Private/Private/Unknown.
+ * <p>
+ * @see <a href="http://docs.sun.com/app/docs/doc/817-6223/6mlkidlnp?a=view">Solaris Dynamic Tracing Guide, Chapter 39: Stability</a>
+ * @since 1.7
+ */
+@Retention(RetentionPolicy.RUNTIME)
+@Target({ ElementType.TYPE })
+public @interface FunctionAttributes {
+    Attributes value();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/classes/com/sun/tracing/dtrace/FunctionName.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,47 @@
+/*
+ * Copyright 2008 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.tracing.dtrace;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.ElementType;
+
+/**
+ * An annotation used to specify the {@code function} field for a DTrace probe.
+ *
+ * This annotation can be added to a method in a user-defined Provider
+ * specification interface to set the {@code function} field that is used
+ * for the generated DTrace probe associated with that method.
+ * <p>
+ * @since 1.7
+ */
+@Retention(RetentionPolicy.RUNTIME)
+@Target(ElementType.METHOD)
+public @interface FunctionName {
+    String value();
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/classes/com/sun/tracing/dtrace/ModuleAttributes.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,51 @@
+/*
+ * Copyright 2008 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.tracing.dtrace;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.ElementType;
+
+/**
+ * This annotation is used to describe the interface attributes of the
+ * {@code module} field for a single provider.
+ *
+ * This annotation can be added to a user-defined Provider specification
+ * interface to set the stability attributes of the {@code module} field for
+ * all probes specified in that provider.
+ * <p>
+ * If this annotation is not present, the interface attributes for the
+ * {@code module} field is Private/Private/Unknown.
+ * <p>
+ * @see <a href="http://docs.sun.com/app/docs/doc/817-6223/6mlkidlnp?a=view">Solaris Dynamic Tracing Guide, Chapter 39: Stability</a>
+ * @since 1.7
+ */
+@Retention(RetentionPolicy.RUNTIME)
+@Target({ ElementType.TYPE })
+public @interface ModuleAttributes {
+    Attributes value();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/classes/com/sun/tracing/dtrace/ModuleName.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,47 @@
+/*
+ * Copyright 2008 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.tracing.dtrace;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.ElementType;
+
+/**
+ * An annotation used to specify the {@code module} field for a DTrace probe.
+ *
+ * This annotation can be added to a method in a user-defined Provider
+ * specification interface to set the {@code module} field that will be used
+ * for the generated DTrace probe associated with that method.
+ * <p>
+ * @since 1.7
+ */
+@Retention(RetentionPolicy.RUNTIME)
+@Target(ElementType.TYPE)
+public @interface ModuleName {
+    String value();
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/classes/com/sun/tracing/dtrace/NameAttributes.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,51 @@
+/*
+ * Copyright 2008 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.tracing.dtrace;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.ElementType;
+
+/**
+ * This annotation describes the interface attributes of the
+ * {@code name} field for a single provider.
+ *
+ * This annotation can be added to a user-defined Provider specification
+ * interface to set the stability attributes of the {@code name} field for
+ * all probes specified in that provider.
+ * <p>
+ * If this annotation is not present, the interface attributes for the
+ * {@code name} field will be Private/Private/Unknown.
+ * <p>
+ * @see <a href="http://docs.sun.com/app/docs/doc/817-6223/6mlkidlnp?a=view">Solaris Dynamic Tracing Guide, Chapter 39: Stability</a>
+ * @since 1.7
+ */
+@Retention(RetentionPolicy.RUNTIME)
+@Target({ ElementType.TYPE })
+public @interface NameAttributes {
+    Attributes value();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/classes/com/sun/tracing/dtrace/ProviderAttributes.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,51 @@
+/*
+ * Copyright 2008 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.tracing.dtrace;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.ElementType;
+
+/**
+ * This annotation is used to describe the interface attributes of the
+ * {@code provider} field for a single provider.
+ *
+ * This annotation can be added to a user-defined Provider specification
+ * interface to set the stability attributes of the {@code provider} field for
+ * all probes specified in that provider.
+ * <p>
+ * If this annotation is not present, the interface attributes for the
+ * {@code provider} field will be Private/Private/Unknown.
+ * <p>
+ * @see <a href="http://docs.sun.com/app/docs/doc/817-6223/6mlkidlnp?a=view">Solaris Dynamic Tracing Guide, Chapter 39: Stability</a>
+ * @since 1.7
+ */
+@Retention(RetentionPolicy.RUNTIME)
+@Target({ ElementType.TYPE })
+public @interface ProviderAttributes {
+    Attributes value();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/classes/com/sun/tracing/dtrace/StabilityLevel.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,88 @@
+/*
+ * Copyright 2008 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.tracing.dtrace;
+
+/**
+ * Enumeration for the DTrace stability levels.
+ *
+ * @see <a href="http://docs.sun.com/app/docs/doc/817-6223/6mlkidlnp?a=view">Solaris Dynamic Tracing Guide, Chapter 39: Stability</a>
+ * @since 1.7
+ */
+public enum StabilityLevel {
+    /**
+     * The interface is private to DTrace and represents an implementation
+     * detail of DTrace.
+     */
+    INTERNAL  (0),
+    /**
+     * The interface is private to Sun for use by other Sun products. It is
+     * not yet publicly documented for use by customers and ISVs.
+     */
+    PRIVATE  (1),
+    /**
+     * The interface is supported in the current release but is scheduled
+     * to be removed, most likely in a future minor release.
+     */
+    OBSOLETE (2),
+    /**
+     * The interface is controlled by an entity other than Sun.
+     */
+    EXTERNAL (3),
+    /**
+     * The interface gives developers early access to new or
+     * rapidly changing technology or to an implementation artifact that is
+     * essential for observing or debugging system behavior. A more
+     * stable solution is anticipated in the future.
+     */
+    UNSTABLE (4),
+    /**
+     * The interface might eventually become Standard or Stable but is
+     * still in transition.
+     */
+    EVOLVING (5),
+    /**
+     * The interface is a mature interface under Sun's control.
+     */
+    STABLE   (6),
+    /**
+     * The interface complies with an industry standard.
+     */
+    STANDARD (7);
+
+    String toDisplayString() {
+        return toString().substring(0,1) +
+               toString().substring(1).toLowerCase();
+    }
+
+    public int getEncoding() { return encoding; }
+
+    private int encoding;
+
+    private StabilityLevel(int encoding) {
+        this.encoding = encoding;
+    }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/classes/com/sun/tracing/dtrace/package-info.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,82 @@
+/*
+ * Copyright 2008 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 package contains annotations and enumerations that are used to
+ * add DTrace-specific information to a tracing provider.
+ * <p>
+ * The DTrace-specific annotations modify the attributes of a DTrace provider
+ * implementation when it is used by the tracing subsystem.  The annotations are
+ * added to a {@code com.sun.tracing} provider specification to control
+ * specific attributes of the provider as it relates to DTrace.
+ * <p>
+ * Any other tracing subsystems supported by the system will ignore these
+ * annotations.
+ * <p>
+ * DTrace probes have additional fields and stability attributes that are
+ * not accounted for in the generic tracing package.  If unspecified, the
+ * default values are used for the stability and dependency attributes of
+ * probes, as well as for the module and field names of the generated probes.
+ * The values can be specified by adding the appropriate annotations to the
+ * provider specification.
+ * <p>
+ * The {@code FunctionName} annotation is used to annotate the tracepoint
+ * methods defined in the provider specification.  The value of this annotation
+ * is used as the {@code function} field in the generated DTrace probes. It
+ * is typically set to the name of the enclosing function where the
+ * tracepoint is triggered.
+ * <p>
+ * The {@code ModuleName} annotation is used to annotate the provider
+ * specification itself and applies to all the probes in the provider.  It
+ * sets the value of the {@code module} field in the generated DTrace probes.
+ * <p>
+ * The remaining annotations, are also applied to the provider itself, and
+ * are used to set the stability and dependency attributes of all probes in
+ * that provider.  Each probe field and the probe arguments can be
+ * independently assigned interface attributes to control the stability
+ * ratings of the probes.
+ * <p>
+ * Here is an example of how to declare a provider, specifying additional DTrace
+ * data:
+<PRE>
+    &#064;ProviderName("my_app_provider")
+    &#064;ModuleName("app.jar")
+    &#064;ProviderAttributes(&#064;Attributes={
+        name=StabilityLevel.STABLE,data=StabilityLevel.STABLE,
+        dependency=DependencyClass.COMMON})
+    &#064;ProbeAttributes(&#064;Attributes={
+        name=StabilityLevel.STABLE,data=StabilityLevel.STABLE,
+        dependency=DependencyClass.COMMON})
+    &#064;ModuleAttributes(&#064;Attributes={name=StabilityLevel.UNSTABLE})
+    public class MyProvider {
+        &#064;FunctionName("main") void startProbe();
+    }
+</PRE>
+ * <p>
+ * @see <a href="http://docs.sun.com/app/docs/doc/817-6223/6mlkidlms?a=view">Solaris Dynamic Tracing Guide, Chapter 34: Statically Defined Tracing for User Applications</a>
+ * @see <a href="http://docs.sun.com/app/docs/doc/817-6223/6mlkidlnp?a=view">Solaris Dynamic Tracing Guide, Chapter 39: Stability</a>
+ */
+
+package com.sun.tracing.dtrace;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/classes/com/sun/tracing/package-info.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,183 @@
+/*
+ * Copyright 2008 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 package provides a mechanism for defining and
+ * inserting tracepoints into Java-technology based applications, which
+ * can then be monitored by the tracing tools available on the system.
+ * <p>
+ * To add tracepoints to a program, you must first decide where to place the
+ * tracepoints, what the logical names are for these points, what information
+ * will be available to the tracing mechanisms at each point, and decide upon
+ * any logical grouping.
+ * <p>
+ * You add instrumentation to a program in three steps:
+ * <ul>
+ * <li>First, declare tracepoints by creating interfaces to define
+ * them, and include these interfaces in the program definition.
+ * The declared interfaces are standard Java technology-based
+ * interfaces and are compiled with the program.</li>
+ * <li>Second, add code in the application to create an instance of the
+ * interface at some point during the initialization of the application,
+ * using a factory class provided by the system. The reference to the
+ * instance can be stored as a global static, or passed as context to all
+ * the places where it is needed.</li>
+ * <li>Finally, add the actual tracepoints to the desired locations in the
+ * application by inserting a call to one of the methods defined in the
+ * interface, via the factory-created reference.</li>
+ * </ul>
+ * <p>
+ * The method calls representing the tracepoints have no logical
+ * impact on the program.  The side effect of the call is that any
+ * activated tracing mechanisms will be notified that the tracepoint has
+ * been hit, and will take whatever actions are appropriate (for example,
+ * logging  the tracepoint, or triggering a DTrace probe, etc.).  In most
+ * cases, the impact on performance of adding tracepoints to the application
+ * will be minimal.
+ * <p>
+ * Each logical grouping of tracepoints should be defined in a common
+ * interface, called a <i>provider</i>.  An application can have one or many
+ * providers.  Each provider is independent and can be created whenever
+ * it is appropriate for that provider, for example, when a subsytem is
+ * initialized.  Providers should be disposed of when they are no longer
+ * needed, to free up any associated system resources.  Each tracepoint
+ * in a provider is represented by a method in that interface.  These methods
+ * are referred to as <i>probes</i>.  The method signature determines the probe
+ * parameters.  A call to the method with the specified parameters triggers
+ * the probe and makes its parameter values visible to any associated tracing
+ * mechanism.
+ * <p>
+ * User-defined interfaces which represent providers must extend the
+ * {@code Provider} interface.  To activate the system-defined
+ * tracing mechanisms, you must obtain an instance of the
+ * {@code ProviderFactory} class, and pass the class of the provider to
+ * the {@code createProvider()} method.  The returned instance is then used to
+ * trigger the probes later in the application.
+ * <p>
+ * In addition to triggering the probes, the provider instance can be used
+ * to obtain direct references to the {@code Probe} objects, which can be used
+ * directly for triggering, or can be queried to determine whether the probe is
+ * currently being traced.  The {@code Provider} interface also defines a
+ * {@code Provider.dispose()} method which is used to free up any resources
+ * that might be associated with that provider.
+ * <p>
+ * When a probe is triggered, any activated tracing system will be given
+ * the provider name, the probe name, and the values of the probe arguments.
+ * The tracing system is free to consume this data is whatever way is
+ * appropriate.
+ * By default, the provider name is the same as the class name of the interface
+ * that defines the provider. Similarly, the probe name is
+ * the name of the method that defines the probe. These default values
+ * can be over-ridden by annotations.  The provider definition can be
+ * annotated with the {@code @ProviderName} annotation, whose value will
+ * indicate the provider name that the tracing system will use.  Similarly,
+ * the {@code @ProbeName} annotation annotates a declared method and
+ * indicates the probe name that should be used in the place of the
+ * method name.  These annotations can be used to define providers and
+ * probes with the same name, in cases where the semantics of the Java language
+ * may prevent this.
+ * <p>
+ * Here is a very small and simple usage example:
+ * <p>
+ *
+<PRE>
+   import com.sun.tracing.Provider;
+   import com.sun.tracing.ProviderFactory;
+
+   interface MyProvider extends Provider {
+       void startProbe();
+       void finishProbe(int value);
+   }
+
+   public class MyApplication {
+       public static void main(String argv[]) {
+           ProviderFactory factory = ProviderFactory.getDefaultFactory();
+           MyProvider trace = factory.createProvider(MyProvider.class);
+
+           trace.startProbe();
+           int result = foo();
+           trace.finishProbe(result);
+
+           trace.dispose();
+       }
+   }
+</PRE>
+ * <p>
+ * The Java Development Kit (JDK) currently only includes one system-defined
+ * tracing framework: DTrace. DTrace is enabled automatically whenever an
+ * application is run on a system and a JDK release that supports it. When
+ * DTrace is enabled, probes are made available for listing and matching by
+ * DTrace scripts as soon as the provider is created. At the tracepoint, an
+ * associated DTrace script is informed of the creation of the provider, and
+ * it takes whatever action it is designed to take. Tracepoints in the
+ * program have the following DTrace probe names:<br>
+ *   {@code <provider><pid>:<module>:<function>:<probe>}
+ * Where:
+ * <ul>
+ * <li>{@code <provider>} the provider name as specified by the application</li>
+ * <li>{@code <pid>} the operating system process ID</li>
+ * <li>{@code <module>} undefined, unless specified by the application</li>
+ * <li>{@code <function>} undefined, unless specified by the application</li>
+ * <li>{@code <probe>} the probe name as specified by the application</li>
+ * </ul>
+ * <p>
+ * The {@code com.sun.tracing.dtrace} package contains additional
+ * annotations that can be used to control the names used for the
+ * <code>module</code> and <code>function</code> fields, as well as annotations
+ * that can be added to the provider to control probe stability and dependency
+ * attributes.
+ * <p>
+ * Integer, float and string probe parameters are made available to DTrace
+ * using
+ * the built-in argument variables, {@code arg0 ... arg_n}.  Integer-types
+ * are passed by value (boxed values are unboxed), floating-point types are
+ * passed as encoded integer
+ * arguments, and {@code java.lang.String} objects are converted
+ * to UTF8 strings, so they can be read into the DTrace script using the
+ * {@code copyinstr()} intrinsic.  Non-string and non-boxed primitive
+ * reference arguments are only
+ * placeholders and have no value.
+ * <p>
+ * Using the example above, with a theoretical process ID of 123, these are
+ * the probes that can be traced from DTrace:
+<PRE>
+    MyProvider123:::startProbe
+    MyProvider123:::finishProbe
+</PRE>
+ * When {@code finishProbe} executes, {@code arg0} will contain the
+ * value of {@code result}.
+ * <p>
+ * The DTrace tracing mechanism is enabled for all providers, apart from in the
+ * following circumstances:
+ * <ul>
+ * <li>DTrace is not supported on the underlying system.</li>
+ * <li>The property {@code com.sun.tracing.dtrace} is set to "disable".</li>
+ * <li>The RuntimePermission {@code com.sun.tracing.dtrace.createProvider}
+ * is denied to the process.</li>
+ * </ul>
+ * <p>
+ */
+
+package com.sun.tracing;
--- a/jdk/src/share/classes/java/awt/Button.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/java/awt/Button.java	Thu Jun 12 13:50:55 2008 -0700
@@ -597,7 +597,7 @@
         public String getAccessibleActionDescription(int i) {
             if (i == 0) {
                 // [[[PENDING:  WDW -- need to provide a localized string]]]
-                return new String("click");
+                return "click";
             } else {
                 return null;
             }
--- a/jdk/src/share/classes/java/awt/Color.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/java/awt/Color.java	Thu Jun 12 13:50:55 2008 -0700
@@ -51,6 +51,7 @@
  * http://www.w3.org/pub/WWW/Graphics/Color/sRGB.html
  * </A>.
  * <p>
+ * @version     10 Feb 1997
  * @author      Sami Shaio
  * @author      Arthur van Hoff
  * @see         ColorSpace
@@ -1176,23 +1177,32 @@
     }
 
     /**
-     * Creates and returns a {@link PaintContext} used to generate a solid
-     * color pattern.  This enables a <code>Color</code> object to be used
-     * as an argument to any method requiring an object implementing the
-     * {@link Paint} interface.
-     * The same <code>PaintContext</code> is returned, regardless of
-     * whether or not <code>r</code>, <code>r2d</code>,
-     * <code>xform</code>, or <code>hints</code> are <code>null</code>.
-     * @param cm the specified <code>ColorModel</code>
-     * @param r the specified {@link Rectangle}
-     * @param r2d the specified {@link Rectangle2D}
-     * @param xform the specified {@link AffineTransform}
-     * @param hints the specified {@link RenderingHints}
-     * @return a <code>PaintContext</code> that is used to generate a
-     *          solid color pattern.
+     * Creates and returns a {@link PaintContext} used to
+     * generate a solid color field pattern.
+     * See the {@link Paint#createContext specification} of the
+     * method in the {@link Paint} interface for information
+     * on null parameter handling.
+     *
+     * @param cm the preferred {@link ColorModel} which represents the most convenient
+     *           format for the caller to receive the pixel data, or {@code null}
+     *           if there is no preference.
+     * @param r the device space bounding box
+     *                     of the graphics primitive being rendered.
+     * @param r2d the user space bounding box
+     *                   of the graphics primitive being rendered.
+     * @param xform the {@link AffineTransform} from user
+     *              space into device space.
+     * @param hints the set of hints that the context object can use to
+     *              choose between rendering alternatives.
+     * @return the {@code PaintContext} for
+     *         generating color patterns.
      * @see Paint
      * @see PaintContext
-     * @see Graphics2D#setPaint
+     * @see ColorModel
+     * @see Rectangle
+     * @see Rectangle2D
+     * @see AffineTransform
+     * @see RenderingHints
      */
     public synchronized PaintContext createContext(ColorModel cm, Rectangle r,
                                                    Rectangle2D r2d,
--- a/jdk/src/share/classes/java/awt/Component.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/java/awt/Component.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1995-2008 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
@@ -49,6 +49,7 @@
 import java.io.IOException;
 import java.beans.PropertyChangeListener;
 import java.beans.PropertyChangeSupport;
+import java.beans.Transient;
 import java.awt.event.InputMethodListener;
 import java.awt.event.InputMethodEvent;
 import java.awt.im.InputContext;
@@ -634,7 +635,9 @@
      */
     private PropertyChangeSupport changeSupport;
 
-    private transient final Object changeSupportLock = new Object();
+    // Note: this field is considered final, though readObject() prohibits
+    // initializing final fields.
+    private transient Object changeSupportLock = new Object();
     private Object getChangeSupportLock() {
         return changeSupportLock;
     }
@@ -1003,7 +1006,7 @@
 
     /**
      * Gets this component's locking object (the object that owns the thread
-     * sychronization monitor) for AWT component-tree and layout
+     * synchronization monitor) for AWT component-tree and layout
      * operations.
      * @return this component's locking object
      */
@@ -1100,6 +1103,7 @@
      * @see #setVisible
      * @since JDK1.0
      */
+    @Transient
     public boolean isVisible() {
         return isVisible_NoClientCode();
     }
@@ -1325,12 +1329,15 @@
             KeyboardFocusManager.clearMostRecentFocusOwner(this);
             synchronized (getTreeLock()) {
                 enabled = false;
-                if (isFocusOwner()) {
+                // A disabled lw container is allowed to contain a focus owner.
+                if ((isFocusOwner() || (containsFocus() && !isLightweight())) &&
+                    KeyboardFocusManager.isAutoFocusTransferEnabled())
+                {
                     // Don't clear the global focus owner. If transferFocus
                     // fails, we want the focus to stay on the disabled
                     // Component so that keyboard traversal, et. al. still
                     // makes sense to the user.
-                    autoTransferFocus(false);
+                    transferFocus(false);
                 }
                 ComponentPeer peer = this.peer;
                 if (peer != null) {
@@ -1491,8 +1498,8 @@
             synchronized (getTreeLock()) {
                 visible = false;
                 mixOnHiding(isLightweight());
-                if (containsFocus()) {
-                    autoTransferFocus(true);
+                if (containsFocus() && KeyboardFocusManager.isAutoFocusTransferEnabled()) {
+                    transferFocus(true);
                 }
                 ComponentPeer peer = this.peer;
                 if (peer != null) {
@@ -1531,6 +1538,7 @@
      * @beaninfo
      *       bound: true
      */
+    @Transient
     public Color getForeground() {
         Color foreground = this.foreground;
         if (foreground != null) {
@@ -1585,6 +1593,7 @@
      * @see #setBackground
      * @since JDK1.0
      */
+    @Transient
     public Color getBackground() {
         Color background = this.background;
         if (background != null) {
@@ -1644,6 +1653,7 @@
      * @see #setFont
      * @since JDK1.0
      */
+    @Transient
     public Font getFont() {
         return getFont_NoClientCode();
     }
@@ -6576,12 +6586,8 @@
         }
 
         synchronized (getTreeLock()) {
-            if (isFocusOwner()
-                && KeyboardFocusManager.isAutoFocusTransferEnabled()
-                && !nextFocusHelper())
-            {
-                KeyboardFocusManager.getCurrentKeyboardFocusManager().
-                    clearGlobalFocusOwner();
+            if (isFocusOwner() && KeyboardFocusManager.isAutoFocusTransferEnabledFor(this)) {
+                transferFocus(true);
             }
 
             if (getContainer() != null && isAddNotifyComplete) {
@@ -6716,8 +6722,8 @@
 
         firePropertyChange("focusable", oldFocusable, focusable);
         if (oldFocusable && !focusable) {
-            if (isFocusOwner()) {
-                autoTransferFocus(true);
+            if (isFocusOwner() && KeyboardFocusManager.isAutoFocusTransferEnabled()) {
+                transferFocus(true);
             }
             KeyboardFocusManager.clearMostRecentFocusOwner(this);
         }
@@ -7371,69 +7377,6 @@
         }
     }
 
-    private void autoTransferFocus(boolean clearOnFailure) {
-        Component toTest = KeyboardFocusManager.
-            getCurrentKeyboardFocusManager().getFocusOwner();
-        if (toTest != this) {
-            if (toTest != null) {
-                toTest.autoTransferFocus(clearOnFailure);
-            }
-            return;
-        }
-
-        // Check if there are pending focus requests.  We shouldn't do
-        // auto-transfer if user has already took care of this
-        // component becoming ineligible to hold focus.
-        if (!KeyboardFocusManager.isAutoFocusTransferEnabled()) {
-            return;
-        }
-
-        // the following code will execute only if this Component is the focus
-        // owner
-
-        if (!(isDisplayable() && isVisible() && isEnabled() && isFocusable())) {
-            doAutoTransfer(clearOnFailure);
-            return;
-        }
-
-        toTest = getParent();
-
-        while (toTest != null && !(toTest instanceof Window)) {
-            if (!(toTest.isDisplayable() && toTest.isVisible() &&
-                  (toTest.isEnabled() || toTest.isLightweight()))) {
-                doAutoTransfer(clearOnFailure);
-                return;
-            }
-            toTest = toTest.getParent();
-        }
-    }
-    private void doAutoTransfer(boolean clearOnFailure) {
-        if (focusLog.isLoggable(Level.FINER)) {
-            focusLog.log(Level.FINER, "this = " + this + ", clearOnFailure = " + clearOnFailure);
-        }
-        if (clearOnFailure) {
-            if (!nextFocusHelper()) {
-                if (focusLog.isLoggable(Level.FINER)) {
-                    focusLog.log(Level.FINER, "clear global focus owner");
-                }
-                KeyboardFocusManager.getCurrentKeyboardFocusManager().
-                    clearGlobalFocusOwner();
-            }
-        } else {
-            transferFocus();
-        }
-    }
-
-    /**
-     * Transfers the focus to the next component, as though this Component were
-     * the focus owner.
-     * @see       #requestFocus()
-     * @since     JDK1.1
-     */
-    public void transferFocus() {
-        nextFocus();
-    }
-
     /**
      * Returns the Container which is the focus cycle root of this Component's
      * focus traversal cycle. Each focus traversal cycle has only a single
@@ -7473,31 +7416,51 @@
         return (rootAncestor == container);
     }
 
+    Container getTraversalRoot() {
+        return getFocusCycleRootAncestor();
+    }
+
+    /**
+     * Transfers the focus to the next component, as though this Component were
+     * the focus owner.
+     * @see       #requestFocus()
+     * @since     JDK1.1
+     */
+    public void transferFocus() {
+        nextFocus();
+    }
+
     /**
      * @deprecated As of JDK version 1.1,
      * replaced by transferFocus().
      */
     @Deprecated
     public void nextFocus() {
-        nextFocusHelper();
-    }
-
-    private boolean nextFocusHelper() {
-        Component toFocus = preNextFocusHelper();
+        transferFocus(false);
+    }
+
+    boolean transferFocus(boolean clearOnFailure) {
         if (focusLog.isLoggable(Level.FINER)) {
-            focusLog.log(Level.FINER, "toFocus = " + toFocus);
-        }
-        if (isFocusOwner() && toFocus == this) {
-            return false;
-        }
-        return postNextFocusHelper(toFocus, CausedFocusEvent.Cause.TRAVERSAL_FORWARD);
-    }
-
-    Container getTraversalRoot() {
-        return getFocusCycleRootAncestor();
-    }
-
-    final Component preNextFocusHelper() {
+            focusLog.finer("clearOnFailure = " + clearOnFailure);
+        }
+        Component toFocus = getNextFocusCandidate();
+        boolean res = false;
+        if (toFocus != null && !toFocus.isFocusOwner() && toFocus != this) {
+            res = toFocus.requestFocusInWindow(CausedFocusEvent.Cause.TRAVERSAL_FORWARD);
+        }
+        if (clearOnFailure && !res) {
+            if (focusLog.isLoggable(Level.FINER)) {
+                focusLog.finer("clear global focus owner");
+            }
+            KeyboardFocusManager.getCurrentKeyboardFocusManager().clearGlobalFocusOwner();
+        }
+        if (focusLog.isLoggable(Level.FINER)) {
+            focusLog.finer("returning result: " + res);
+        }
+        return res;
+    }
+
+    final Component getNextFocusCandidate() {
         Container rootAncestor = getTraversalRoot();
         Component comp = this;
         while (rootAncestor != null &&
@@ -7509,18 +7472,19 @@
             rootAncestor = comp.getFocusCycleRootAncestor();
         }
         if (focusLog.isLoggable(Level.FINER)) {
-            focusLog.log(Level.FINER, "comp = " + comp + ", root = " + rootAncestor);
-        }
+            focusLog.finer("comp = " + comp + ", root = " + rootAncestor);
+        }
+        Component candidate = null;
         if (rootAncestor != null) {
             FocusTraversalPolicy policy = rootAncestor.getFocusTraversalPolicy();
             Component toFocus = policy.getComponentAfter(rootAncestor, comp);
             if (focusLog.isLoggable(Level.FINER)) {
-                focusLog.log(Level.FINER, "component after is " + toFocus);
+                focusLog.finer("component after is " + toFocus);
             }
             if (toFocus == null) {
                 toFocus = policy.getDefaultComponent(rootAncestor);
                 if (focusLog.isLoggable(Level.FINER)) {
-                    focusLog.log(Level.FINER, "default component is " + toFocus);
+                    focusLog.finer("default component is " + toFocus);
                 }
             }
             if (toFocus == null) {
@@ -7529,23 +7493,12 @@
                     toFocus = applet;
                 }
             }
-            return toFocus;
-        }
-        return null;
-    }
-
-    static boolean postNextFocusHelper(Component toFocus, CausedFocusEvent.Cause cause) {
-        if (toFocus != null) {
-            if (focusLog.isLoggable(Level.FINER)) {
-                focusLog.log(Level.FINER, "Next component " + toFocus);
-            }
-            boolean res = toFocus.requestFocusInWindow(cause);
-            if (focusLog.isLoggable(Level.FINER)) {
-                focusLog.log(Level.FINER, "Request focus returned " + res);
-            }
-            return res;
-        }
-        return false;
+            candidate = toFocus;
+        }
+        if (focusLog.isLoggable(Level.FINER)) {
+            focusLog.finer("Focus transfer candidate: " + candidate);
+        }
+        return candidate;
     }
 
     /**
@@ -7555,6 +7508,10 @@
      * @since     1.4
      */
     public void transferFocusBackward() {
+        transferFocusBackward(false);
+    }
+
+    boolean transferFocusBackward(boolean clearOnFailure) {
         Container rootAncestor = getTraversalRoot();
         Component comp = this;
         while (rootAncestor != null &&
@@ -7565,6 +7522,7 @@
             comp = rootAncestor;
             rootAncestor = comp.getFocusCycleRootAncestor();
         }
+        boolean res = false;
         if (rootAncestor != null) {
             FocusTraversalPolicy policy = rootAncestor.getFocusTraversalPolicy();
             Component toFocus = policy.getComponentBefore(rootAncestor, comp);
@@ -7572,9 +7530,19 @@
                 toFocus = policy.getDefaultComponent(rootAncestor);
             }
             if (toFocus != null) {
-                toFocus.requestFocusInWindow(CausedFocusEvent.Cause.TRAVERSAL_BACKWARD);
-            }
-        }
+                res = toFocus.requestFocusInWindow(CausedFocusEvent.Cause.TRAVERSAL_BACKWARD);
+            }
+        }
+        if (!res) {
+            if (focusLog.isLoggable(Level.FINER)) {
+                focusLog.finer("clear global focus owner");
+            }
+            KeyboardFocusManager.getCurrentKeyboardFocusManager().clearGlobalFocusOwner();
+        }
+        if (focusLog.isLoggable(Level.FINER)) {
+            focusLog.finer("returning result: " + res);
+        }
+        return res;
     }
 
     /**
@@ -7649,6 +7617,20 @@
         return hasFocus();
     }
 
+    /*
+     * Used to disallow auto-focus-transfer on disposal of the focus owner
+     * in the process of disposing its parent container.
+     */
+    private boolean autoFocusTransferOnDisposal = true;
+
+    void setAutoFocusTransferOnDisposal(boolean value) {
+        autoFocusTransferOnDisposal = value;
+    }
+
+    boolean isAutoFocusTransferOnDisposal() {
+        return autoFocusTransferOnDisposal;
+    }
+
     /**
      * Adds the specified popup menu to the component.
      * @param     popup the popup menu to be added to the component.
@@ -8310,6 +8292,8 @@
     private void readObject(ObjectInputStream s)
       throws ClassNotFoundException, IOException
     {
+        changeSupportLock = new Object();
+
         s.defaultReadObject();
 
         appContext = AppContext.getAppContext();
--- a/jdk/src/share/classes/java/awt/Container.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/java/awt/Container.java	Thu Jun 12 13:50:55 2008 -0700
@@ -2660,9 +2660,26 @@
         synchronized (getTreeLock()) {
             int ncomponents = this.ncomponents;
             Component component[] = this.component;
-            for (int i = ncomponents-1 ; i >= 0 ; i--) {
-                if( component[i] != null )
-                component[i].removeNotify();
+            for (int i = ncomponents - 1; i >= 0; i--) {
+                if( component[i] != null ) {
+                    // Fix for 6607170.
+                    // We want to suppress focus change on disposal
+                    // of the focused component. But because of focus
+                    // is asynchronous, we should suppress focus change
+                    // on every component in case it receives native focus
+                    // in the process of disposal.
+                    component[i].setAutoFocusTransferOnDisposal(false);
+                    component[i].removeNotify();
+                    component[i].setAutoFocusTransferOnDisposal(true);
+                }
+            }
+            // If some of the children had focus before disposal then it still has.
+            // Auto-transfer focus to the next (or previous) component if auto-transfer
+            // is enabled.
+            if (containsFocus() && KeyboardFocusManager.isAutoFocusTransferEnabledFor(this)) {
+                if (!transferFocus(false)) {
+                    transferFocusBackward(true);
+                }
             }
             if ( dispatcher != null ) {
                 dispatcher.dispose();
--- a/jdk/src/share/classes/java/awt/DefaultKeyboardFocusManager.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/java/awt/DefaultKeyboardFocusManager.java	Thu Jun 12 13:50:55 2008 -0700
@@ -155,12 +155,13 @@
                                    boolean clearOnFailure)
     {
         if (toFocus != vetoedComponent && toFocus.isShowing() && toFocus.isFocusable() &&
-            toFocus.requestFocus(false, CausedFocusEvent.Cause.ROLLBACK)) {
+            toFocus.requestFocus(false, CausedFocusEvent.Cause.ROLLBACK))
+        {
             return true;
         } else {
-            Component nextFocus = toFocus.preNextFocusHelper();
-            if (nextFocus != vetoedComponent
-                && Component.postNextFocusHelper(nextFocus, CausedFocusEvent.Cause.ROLLBACK))
+            Component nextFocus = toFocus.getNextFocusCandidate();
+            if (nextFocus != null && nextFocus != vetoedComponent &&
+                nextFocus.requestFocusInWindow(CausedFocusEvent.Cause.ROLLBACK))
             {
                 return true;
             } else if (clearOnFailure) {
@@ -504,9 +505,16 @@
                 {
                     // we should not accept focus on such component, so reject it.
                     dequeueKeyEvents(-1, newFocusOwner);
-                    if (KeyboardFocusManager.isAutoFocusTransferEnabled())
-                    {
-                        restoreFocus(fe, newFocusedWindow);
+                    if (KeyboardFocusManager.isAutoFocusTransferEnabled()) {
+                        // If FOCUS_GAINED is for a disposed component (however
+                        // it shouldn't happen) its toplevel parent is null. In this
+                        // case we have to try to restore focus in the current focused
+                        // window (for the details: 6607170).
+                        if (newFocusedWindow == null) {
+                            restoreFocus(fe, currentFocusedWindow);
+                        } else {
+                            restoreFocus(fe, newFocusedWindow);
+                        }
                     }
                     break;
                 }
@@ -1078,6 +1086,9 @@
                     focusNextComponent(focusedComponent);
                 }
                 return;
+            } else if (e.getID() == KeyEvent.KEY_PRESSED) {
+                // Fix for 6637607: consumeNextKeyTyped should be reset.
+                consumeNextKeyTyped = false;
             }
 
             toTest = focusedComponent.getFocusTraversalKeys(
--- a/jdk/src/share/classes/java/awt/Dimension.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/java/awt/Dimension.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1995-2008 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
@@ -26,6 +26,7 @@
 package java.awt;
 
 import java.awt.geom.Dimension2D;
+import java.beans.Transient;
 
 /**
  * The <code>Dimension</code> class encapsulates the width and
@@ -165,6 +166,7 @@
      * @see      java.awt.Component#getSize
      * @since    1.1
      */
+    @Transient
     public Dimension getSize() {
         return new Dimension(width, height);
     }
--- a/jdk/src/share/classes/java/awt/Font.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/java/awt/Font.java	Thu Jun 12 13:50:55 2008 -0700
@@ -711,7 +711,7 @@
                                 EBIDI_EMBEDDING, EJUSTIFICATION,
                                 EINPUT_METHOD_HIGHLIGHT, EINPUT_METHOD_UNDERLINE,
                                 ESWAP_COLORS, ENUMERIC_SHAPING, EKERNING,
-                                ELIGATURES, ETRACKING);
+                                ELIGATURES, ETRACKING, ESUPERSCRIPT);
 
     private static final int EXTRA_MASK =
             AttributeValues.getMask(ETRANSFORM, ESUPERSCRIPT, EWIDTH);
@@ -1970,7 +1970,6 @@
      * in the JDK - and the only likely caller - is in this same class.
      */
     private float getItalicAngle(FontRenderContext frc) {
-        AffineTransform at = (isTransformed()) ? getTransform() : identityTx;
         Object aa, fm;
         if (frc == null) {
             aa = RenderingHints.VALUE_TEXT_ANTIALIAS_OFF;
@@ -1979,7 +1978,7 @@
             aa = frc.getAntiAliasingHint();
             fm = frc.getFractionalMetricsHint();
         }
-        return getFont2D().getItalicAngle(this, at, aa, fm);
+        return getFont2D().getItalicAngle(this, identityTx, aa, fm);
     }
 
     /**
--- a/jdk/src/share/classes/java/awt/GradientPaint.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/java/awt/GradientPaint.java	Thu Jun 12 13:50:55 2008 -0700
@@ -53,6 +53,7 @@
  *
  * @see Paint
  * @see Graphics2D#setPaint
+ * @version 10 Feb 1997
  */
 
 public class GradientPaint implements Paint {
@@ -223,19 +224,32 @@
     }
 
     /**
-     * Creates and returns a context used to generate the color pattern.
-     * @param cm {@link ColorModel} that receives
-     * the <code>Paint</code> data. This is used only as a hint.
-     * @param deviceBounds the device space bounding box of the
-     * graphics primitive being rendered
-     * @param userBounds the user space bounding box of the
-     * graphics primitive being rendered
+     * Creates and returns a {@link PaintContext} used to
+     * generate a linear color gradient pattern.
+     * See the {@link Paint#createContext specification} of the
+     * method in the {@link Paint} interface for information
+     * on null parameter handling.
+     *
+     * @param cm the preferred {@link ColorModel} which represents the most convenient
+     *           format for the caller to receive the pixel data, or {@code null}
+     *           if there is no preference.
+     * @param deviceBounds the device space bounding box
+     *                     of the graphics primitive being rendered.
+     * @param userBounds the user space bounding box
+     *                   of the graphics primitive being rendered.
      * @param xform the {@link AffineTransform} from user
-     *     space into device space
-     * @param hints the hints that the context object uses to choose
-     * between rendering alternatives
-     * @return the {@link PaintContext} that generates color patterns.
+     *              space into device space.
+     * @param hints the set of hints that the context object can use to
+     *              choose between rendering alternatives.
+     * @return the {@code PaintContext} for
+     *         generating color patterns.
+     * @see Paint
      * @see PaintContext
+     * @see ColorModel
+     * @see Rectangle
+     * @see Rectangle2D
+     * @see AffineTransform
+     * @see RenderingHints
      */
     public PaintContext createContext(ColorModel cm,
                                       Rectangle deviceBounds,
--- a/jdk/src/share/classes/java/awt/KeyboardFocusManager.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/java/awt/KeyboardFocusManager.java	Thu Jun 12 13:50:55 2008 -0700
@@ -2578,6 +2578,10 @@
         }
     }
 
+    static boolean isAutoFocusTransferEnabledFor(Component comp) {
+        return isAutoFocusTransferEnabled() && comp.isAutoFocusTransferOnDisposal();
+    }
+
     /*
      * Used to process exceptions in dispatching focus event (in focusLost/focusGained callbacks).
      * @param ex previously caught exception that may be processed right here, or null
--- a/jdk/src/share/classes/java/awt/LinearGradientPaint.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/java/awt/LinearGradientPaint.java	Thu Jun 12 13:50:55 2008 -0700
@@ -296,7 +296,32 @@
     }
 
     /**
-     * {@inheritDoc}
+     * Creates and returns a {@link PaintContext} used to
+     * generate a linear color gradient pattern.
+     * See the {@link Paint#createContext specification} of the
+     * method in the {@link Paint} interface for information
+     * on null parameter handling.
+     *
+     * @param cm the preferred {@link ColorModel} which represents the most convenient
+     *           format for the caller to receive the pixel data, or {@code null}
+     *           if there is no preference.
+     * @param deviceBounds the device space bounding box
+     *                     of the graphics primitive being rendered.
+     * @param userBounds the user space bounding box
+     *                   of the graphics primitive being rendered.
+     * @param transform the {@link AffineTransform} from user
+     *              space into device space.
+     * @param hints the set of hints that the context object can use to
+     *              choose between rendering alternatives.
+     * @return the {@code PaintContext} for
+     *         generating color patterns.
+     * @see Paint
+     * @see PaintContext
+     * @see ColorModel
+     * @see Rectangle
+     * @see Rectangle2D
+     * @see AffineTransform
+     * @see RenderingHints
      */
     public PaintContext createContext(ColorModel cm,
                                       Rectangle deviceBounds,
--- a/jdk/src/share/classes/java/awt/MenuItem.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/java/awt/MenuItem.java	Thu Jun 12 13:50:55 2008 -0700
@@ -847,7 +847,7 @@
         public String getAccessibleActionDescription(int i) {
             if (i == 0) {
                 // [[[PENDING:  WDW -- need to provide a localized string]]]
-                return new String("click");
+                return "click";
             } else {
                 return null;
             }
--- a/jdk/src/share/classes/java/awt/Paint.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/java/awt/Paint.java	Thu Jun 12 13:50:55 2008 -0700
@@ -46,42 +46,58 @@
  * @see GradientPaint
  * @see TexturePaint
  * @see Graphics2D#setPaint
+ * @version 1.36, 06/05/07
  */
 
 public interface Paint extends Transparency {
     /**
      * Creates and returns a {@link PaintContext} used to
      * generate the color pattern.
-     * Since the ColorModel argument to createContext is only a
-     * hint, implementations of Paint should accept a null argument
-     * for ColorModel.  Note that if the application does not
-     * prefer a specific ColorModel, the null ColorModel argument
-     * will give the Paint implementation full leeway in using the
-     * most efficient ColorModel it prefers for its raster processing.
-     * <p>
-     * Since the API documentation was not specific about this in
-     * releases before 1.4, there may be implementations of
-     * <code>Paint</code> that do not accept a null
-     * <code>ColorModel</code> argument.
-     * If a developer is writing code which passes a null
-     * <code>ColorModel</code> argument to the
-     * <code>createContext</code> method of <code>Paint</code>
-     * objects from arbitrary sources it would be wise to code defensively
-     * by manufacturing a non-null <code>ColorModel</code> for those
-     * objects which throw a <code>NullPointerException</code>.
-     * @param cm the {@link ColorModel} that receives the
-     * <code>Paint</code> data. This is used only as a hint.
+     * The arguments to this method convey additional information
+     * about the rendering operation that may be
+     * used or ignored on various implementations of the {@code Paint} interface.
+     * A caller must pass non-{@code null} values for all of the arguments
+     * except for the {@code ColorModel} argument which may be {@code null} to
+     * indicate that no specific {@code ColorModel} type is preferred.
+     * Implementations of the {@code Paint} interface are allowed to use or ignore
+     * any of the arguments as makes sense for their function, and are
+     * not constrained to use the specified {@code ColorModel} for the returned
+     * {@code PaintContext}, even if it is not {@code null}.
+     * Implementations are allowed to throw {@code NullPointerException} for
+     * any {@code null} argument other than the {@code ColorModel} argument,
+     * but are not required to do so.
+     *
+     * @param cm the preferred {@link ColorModel} which represents the most convenient
+     *           format for the caller to receive the pixel data, or {@code null}
+     *           if there is no preference.
      * @param deviceBounds the device space bounding box
-     *                     of the graphics primitive being rendered
+     *                     of the graphics primitive being rendered.
+     *                     Implementations of the {@code Paint} interface
+     *                     are allowed to throw {@code NullPointerException}
+     *                     for a {@code null} {@code deviceBounds}.
      * @param userBounds the user space bounding box
-     *                     of the graphics primitive being rendered
+     *                   of the graphics primitive being rendered.
+     *                     Implementations of the {@code Paint} interface
+     *                     are allowed to throw {@code NullPointerException}
+     *                     for a {@code null} {@code userBounds}.
      * @param xform the {@link AffineTransform} from user
-     *      space into device space
-     * @param hints the hint that the context object uses to
-     *              choose between rendering alternatives
-     * @return the <code>PaintContext</code> for
-     *              generating color patterns
+     *              space into device space.
+     *                     Implementations of the {@code Paint} interface
+     *                     are allowed to throw {@code NullPointerException}
+     *                     for a {@code null} {@code xform}.
+     * @param hints the set of hints that the context object can use to
+     *              choose between rendering alternatives.
+     *                     Implementations of the {@code Paint} interface
+     *                     are allowed to throw {@code NullPointerException}
+     *                     for a {@code null} {@code hints}.
+     * @return the {@code PaintContext} for
+     *         generating color patterns.
      * @see PaintContext
+     * @see ColorModel
+     * @see Rectangle
+     * @see Rectangle2D
+     * @see AffineTransform
+     * @see RenderingHints
      */
     public PaintContext createContext(ColorModel cm,
                                       Rectangle deviceBounds,
--- a/jdk/src/share/classes/java/awt/Point.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/java/awt/Point.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1995-2008 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
@@ -26,6 +26,7 @@
 package java.awt;
 
 import java.awt.geom.Point2D;
+import java.beans.Transient;
 
 /**
  * A point representing a location in {@code (x,y)} coordinate space,
@@ -119,6 +120,7 @@
      * @see         java.awt.Point#setLocation(int, int)
      * @since       1.1
      */
+    @Transient
     public Point getLocation() {
         return new Point(x, y);
     }
--- a/jdk/src/share/classes/java/awt/RadialGradientPaint.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/java/awt/RadialGradientPaint.java	Thu Jun 12 13:50:55 2008 -0700
@@ -543,7 +543,31 @@
     }
 
     /**
-     * {@inheritDoc}
+     * Creates and returns a {@link PaintContext} used to
+     * generate a circular radial color gradient pattern.
+     * See the description of the {@link Paint#createContext createContext} method
+     * for information on null parameter handling.
+     *
+     * @param cm the preferred {@link ColorModel} which represents the most convenient
+     *           format for the caller to receive the pixel data, or {@code null}
+     *           if there is no preference.
+     * @param deviceBounds the device space bounding box
+     *                     of the graphics primitive being rendered.
+     * @param userBounds the user space bounding box
+     *                   of the graphics primitive being rendered.
+     * @param transform the {@link AffineTransform} from user
+     *              space into device space.
+     * @param hints the set of hints that the context object can use to
+     *              choose between rendering alternatives.
+     * @return the {@code PaintContext} for
+     *         generating color patterns.
+     * @see Paint
+     * @see PaintContext
+     * @see ColorModel
+     * @see Rectangle
+     * @see Rectangle2D
+     * @see AffineTransform
+     * @see RenderingHints
      */
     public PaintContext createContext(ColorModel cm,
                                       Rectangle deviceBounds,
--- a/jdk/src/share/classes/java/awt/Rectangle.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/java/awt/Rectangle.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1995-2008 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
@@ -26,6 +26,7 @@
 package java.awt;
 
 import java.awt.geom.Rectangle2D;
+import java.beans.Transient;
 
 /**
  * A <code>Rectangle</code> specifies an area in a coordinate space that is
@@ -308,6 +309,7 @@
      * @see       #setBounds(int, int, int, int)
      * @since     1.1
      */
+    @Transient
     public Rectangle getBounds() {
         return new Rectangle(x, y, width, height);
     }
--- a/jdk/src/share/classes/java/awt/ScrollPane.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/java/awt/ScrollPane.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 1996-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1996-2008 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
@@ -32,6 +32,7 @@
 import sun.awt.SunToolkit;
 
 import java.beans.ConstructorProperties;
+import java.beans.Transient;
 import java.io.ObjectInputStream;
 import java.io.ObjectOutputStream;
 import java.io.IOException;
@@ -390,6 +391,7 @@
      * @throws NullPointerException if the scrollpane does not contain
      *     a child
      */
+    @Transient
     public Point getScrollPosition() {
         if (ncomponents <= 0) {
             throw new NullPointerException("child is null");
--- a/jdk/src/share/classes/java/awt/TexturePaint.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/java/awt/TexturePaint.java	Thu Jun 12 13:50:55 2008 -0700
@@ -45,6 +45,7 @@
  * replicated <code>Rectangle2D</code>.
  * @see Paint
  * @see Graphics2D#setPaint
+ * @version 1.48, 06/05/07
  */
 
 public class TexturePaint implements Paint {
@@ -93,20 +94,32 @@
     }
 
     /**
-     * Creates and returns a context used to generate the color pattern.
-     * @param cm the {@link ColorModel} that receives the
-     * <code>Paint</code> data. This is used only as a hint.
-     * @param deviceBounds the device space bounding box of the graphics
-     * primitive being rendered
-     * @param userBounds the user space bounding box of the graphics
-     * primitive being rendered
-     * @param xform the {@link AffineTransform} from user space
-     *          into device space
-     * @param hints a {@link RenderingHints} object that can be used to
-     *          specify how the pattern is ultimately rendered
-     * @return the {@link PaintContext} used for generating color
-     *          patterns.
+     * Creates and returns a {@link PaintContext} used to
+     * generate a tiled image pattern.
+     * See the {@link Paint#createContext specification} of the
+     * method in the {@link Paint} interface for information
+     * on null parameter handling.
+     *
+     * @param cm the preferred {@link ColorModel} which represents the most convenient
+     *           format for the caller to receive the pixel data, or {@code null}
+     *           if there is no preference.
+     * @param deviceBounds the device space bounding box
+     *                     of the graphics primitive being rendered.
+     * @param userBounds the user space bounding box
+     *                   of the graphics primitive being rendered.
+     * @param xform the {@link AffineTransform} from user
+     *              space into device space.
+     * @param hints the set of hints that the context object can use to
+     *              choose between rendering alternatives.
+     * @return the {@code PaintContext} for
+     *         generating color patterns.
+     * @see Paint
      * @see PaintContext
+     * @see ColorModel
+     * @see Rectangle
+     * @see Rectangle2D
+     * @see AffineTransform
+     * @see RenderingHints
      */
     public PaintContext createContext(ColorModel cm,
                                       Rectangle deviceBounds,
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/classes/java/awt/color/CMMException.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,57 @@
+/*
+ * 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.
+ */
+
+/*
+    Created by gbp, October 25, 1997
+
+ *
+ */
+/**********************************************************************
+ **********************************************************************
+ **********************************************************************
+ *** COPYRIGHT (c) Eastman Kodak Company, 1997                      ***
+ *** As  an unpublished  work pursuant to Title 17 of the United    ***
+ *** States Code.  All rights reserved.                             ***
+ **********************************************************************
+ **********************************************************************
+ **********************************************************************/
+
+
+package java.awt.color;
+
+
+/**
+ * This exception is thrown if the native CMM returns an error.
+ */
+
+public class CMMException extends java.lang.RuntimeException {
+
+    /**
+     *  Constructs a CMMException with the specified detail message.
+     *  @param s the specified detail message
+     */
+    public CMMException (String s) {
+        super (s);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/classes/java/awt/color/ColorSpace.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,611 @@
+/*
+ * Portions Copyright 1997-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) Eastman Kodak Company, 1997                      ***
+ *** As  an unpublished  work pursuant to Title 17 of the United    ***
+ *** States Code.  All rights reserved.                             ***
+ **********************************************************************
+ **********************************************************************
+ **********************************************************************/
+
+package java.awt.color;
+
+import sun.java2d.cmm.PCMM;
+import sun.java2d.cmm.CMSManager;
+
+
+/**
+ * This abstract class is used to serve as a color space tag to identify the
+ * specific color space of a Color object or, via a ColorModel object,
+ * of an Image, a BufferedImage, or a GraphicsDevice.  It contains
+ * methods that transform colors in a specific color space to/from sRGB
+ * and to/from a well-defined CIEXYZ color space.
+ * <p>
+ * For purposes of the methods in this class, colors are represented as
+ * arrays of color components represented as floats in a normalized range
+ * defined by each ColorSpace.  For many ColorSpaces (e.g. sRGB), this
+ * range is 0.0 to 1.0.  However, some ColorSpaces have components whose
+ * values have a different range.  Methods are provided to inquire per
+ * component minimum and maximum normalized values.
+ * <p>
+ * Several variables are defined for purposes of referring to color
+ * space types (e.g. TYPE_RGB, TYPE_XYZ, etc.) and to refer to specific
+ * color spaces (e.g. CS_sRGB and CS_CIEXYZ).
+ * sRGB is a proposed standard RGB color space.  For more information,
+ * see <A href="http://www.w3.org/pub/WWW/Graphics/Color/sRGB.html">
+ * http://www.w3.org/pub/WWW/Graphics/Color/sRGB.html
+ * </A>.
+ * <p>
+ * The purpose of the methods to transform to/from the well-defined
+ * CIEXYZ color space is to support conversions between any two color
+ * spaces at a reasonably high degree of accuracy.  It is expected that
+ * particular implementations of subclasses of ColorSpace (e.g.
+ * ICC_ColorSpace) will support high performance conversion based on
+ * underlying platform color management systems.
+ * <p>
+ * The CS_CIEXYZ space used by the toCIEXYZ/fromCIEXYZ methods can be
+ * described as follows:
+<pre>
+
+&nbsp;     CIEXYZ
+&nbsp;     viewing illuminance: 200 lux
+&nbsp;     viewing white point: CIE D50
+&nbsp;     media white point: "that of a perfectly reflecting diffuser" -- D50
+&nbsp;     media black point: 0 lux or 0 Reflectance
+&nbsp;     flare: 1 percent
+&nbsp;     surround: 20percent of the media white point
+&nbsp;     media description: reflection print (i.e., RLAB, Hunt viewing media)
+&nbsp;     note: For developers creating an ICC profile for this conversion
+&nbsp;           space, the following is applicable.  Use a simple Von Kries
+&nbsp;           white point adaptation folded into the 3X3 matrix parameters
+&nbsp;           and fold the flare and surround effects into the three
+&nbsp;           one-dimensional lookup tables (assuming one uses the minimal
+&nbsp;           model for monitors).
+
+</pre>
+ *
+ * <p>
+ * @see ICC_ColorSpace
+ */
+
+
+
+public abstract class ColorSpace implements java.io.Serializable {
+
+    static final long serialVersionUID = -409452704308689724L;
+
+    private int type;
+    private int numComponents;
+    private transient String [] compName = null;
+
+    // Cache of singletons for the predefined color spaces.
+    private static ColorSpace sRGBspace;
+    private static ColorSpace XYZspace;
+    private static ColorSpace PYCCspace;
+    private static ColorSpace GRAYspace;
+    private static ColorSpace LINEAR_RGBspace;
+
+    /**
+     * Any of the family of XYZ color spaces.
+     */
+    public static final int TYPE_XYZ = 0;
+
+    /**
+     * Any of the family of Lab color spaces.
+     */
+    public static final int TYPE_Lab = 1;
+
+    /**
+     * Any of the family of Luv color spaces.
+     */
+    public static final int TYPE_Luv = 2;
+
+    /**
+     * Any of the family of YCbCr color spaces.
+     */
+    public static final int TYPE_YCbCr = 3;
+
+    /**
+     * Any of the family of Yxy color spaces.
+     */
+    public static final int TYPE_Yxy = 4;
+
+    /**
+     * Any of the family of RGB color spaces.
+     */
+    public static final int TYPE_RGB = 5;
+
+    /**
+     * Any of the family of GRAY color spaces.
+     */
+    public static final int TYPE_GRAY = 6;
+
+    /**
+     * Any of the family of HSV color spaces.
+     */
+    public static final int TYPE_HSV = 7;
+
+    /**
+     * Any of the family of HLS color spaces.
+     */
+    public static final int TYPE_HLS = 8;
+
+    /**
+     * Any of the family of CMYK color spaces.
+     */
+    public static final int TYPE_CMYK = 9;
+
+    /**
+     * Any of the family of CMY color spaces.
+     */
+    public static final int TYPE_CMY = 11;
+
+    /**
+     * Generic 2 component color spaces.
+     */
+    public static final int TYPE_2CLR = 12;
+
+    /**
+     * Generic 3 component color spaces.
+     */
+    public static final int TYPE_3CLR = 13;
+
+    /**
+     * Generic 4 component color spaces.
+     */
+    public static final int TYPE_4CLR = 14;
+
+    /**
+     * Generic 5 component color spaces.
+     */
+    public static final int TYPE_5CLR = 15;
+
+    /**
+     * Generic 6 component color spaces.
+     */
+    public static final int TYPE_6CLR = 16;
+
+    /**
+     * Generic 7 component color spaces.
+     */
+    public static final int TYPE_7CLR = 17;
+
+    /**
+     * Generic 8 component color spaces.
+     */
+    public static final int TYPE_8CLR = 18;
+
+    /**
+     * Generic 9 component color spaces.
+     */
+    public static final int TYPE_9CLR = 19;
+
+    /**
+     * Generic 10 component color spaces.
+     */
+    public static final int TYPE_ACLR = 20;
+
+    /**
+     * Generic 11 component color spaces.
+     */
+    public static final int TYPE_BCLR = 21;
+
+    /**
+     * Generic 12 component color spaces.
+     */
+    public static final int TYPE_CCLR = 22;
+
+    /**
+     * Generic 13 component color spaces.
+     */
+    public static final int TYPE_DCLR = 23;
+
+    /**
+     * Generic 14 component color spaces.
+     */
+    public static final int TYPE_ECLR = 24;
+
+    /**
+     * Generic 15 component color spaces.
+     */
+    public static final int TYPE_FCLR = 25;
+
+    /**
+     * The sRGB color space defined at
+     * <A href="http://www.w3.org/pub/WWW/Graphics/Color/sRGB.html">
+     * http://www.w3.org/pub/WWW/Graphics/Color/sRGB.html
+     * </A>.
+     */
+    public static final int CS_sRGB = 1000;
+
+    /**
+     * A built-in linear RGB color space.  This space is based on the
+     * same RGB primaries as CS_sRGB, but has a linear tone reproduction curve.
+     */
+    public static final int CS_LINEAR_RGB = 1004;
+
+    /**
+     * The CIEXYZ conversion color space defined above.
+     */
+    public static final int CS_CIEXYZ = 1001;
+
+    /**
+     * The Photo YCC conversion color space.
+     */
+    public static final int CS_PYCC = 1002;
+
+    /**
+     * The built-in linear gray scale color space.
+     */
+    public static final int CS_GRAY = 1003;
+
+
+    /**
+     * Constructs a ColorSpace object given a color space type
+     * and the number of components.
+     * @param type one of the <CODE>ColorSpace</CODE> type constants
+     * @param numcomponents the number of components in the color space
+     */
+    protected ColorSpace (int type, int numcomponents) {
+        this.type = type;
+        this.numComponents = numcomponents;
+    }
+
+
+    /**
+     * Returns a ColorSpace representing one of the specific
+     * predefined color spaces.
+     * @param colorspace a specific color space identified by one of
+     *        the predefined class constants (e.g. CS_sRGB, CS_LINEAR_RGB,
+     *        CS_CIEXYZ, CS_GRAY, or CS_PYCC)
+     * @return the requested <CODE>ColorSpace</CODE> object
+     */
+    // NOTE: This method may be called by privileged threads.
+    //       DO NOT INVOKE CLIENT CODE ON THIS THREAD!
+    public static ColorSpace getInstance (int colorspace)
+    {
+    ColorSpace    theColorSpace;
+
+        switch (colorspace) {
+        case CS_sRGB:
+            synchronized(ColorSpace.class) {
+                if (sRGBspace == null) {
+                    ICC_Profile theProfile = ICC_Profile.getInstance (CS_sRGB);
+                    sRGBspace = new ICC_ColorSpace (theProfile);
+                }
+
+                theColorSpace = sRGBspace;
+            }
+            break;
+
+        case CS_CIEXYZ:
+            synchronized(ColorSpace.class) {
+                if (XYZspace == null) {
+                    ICC_Profile theProfile =
+                        ICC_Profile.getInstance (CS_CIEXYZ);
+                    XYZspace = new ICC_ColorSpace (theProfile);
+                }
+
+                theColorSpace = XYZspace;
+            }
+            break;
+
+        case CS_PYCC:
+            synchronized(ColorSpace.class) {
+                if (PYCCspace == null) {
+                    ICC_Profile theProfile = ICC_Profile.getInstance (CS_PYCC);
+                    PYCCspace = new ICC_ColorSpace (theProfile);
+                }
+
+                theColorSpace = PYCCspace;
+            }
+            break;
+
+
+        case CS_GRAY:
+            synchronized(ColorSpace.class) {
+                if (GRAYspace == null) {
+                    ICC_Profile theProfile = ICC_Profile.getInstance (CS_GRAY);
+                    GRAYspace = new ICC_ColorSpace (theProfile);
+                    /* to allow access from java.awt.ColorModel */
+                    CMSManager.GRAYspace = GRAYspace;
+                }
+
+                theColorSpace = GRAYspace;
+            }
+            break;
+
+
+        case CS_LINEAR_RGB:
+            synchronized(ColorSpace.class) {
+                if (LINEAR_RGBspace == null) {
+                    ICC_Profile theProfile =
+                        ICC_Profile.getInstance(CS_LINEAR_RGB);
+                    LINEAR_RGBspace = new ICC_ColorSpace (theProfile);
+                    /* to allow access from java.awt.ColorModel */
+                    CMSManager.LINEAR_RGBspace = LINEAR_RGBspace;
+                }
+
+                theColorSpace = LINEAR_RGBspace;
+            }
+            break;
+
+
+        default:
+            throw new IllegalArgumentException ("Unknown color space");
+        }
+
+        return theColorSpace;
+    }
+
+
+    /**
+     * Returns true if the ColorSpace is CS_sRGB.
+     * @return <CODE>true</CODE> if this is a <CODE>CS_sRGB</CODE> color
+     *         space, <code>false</code> if it is not
+     */
+    public boolean isCS_sRGB () {
+        /* REMIND - make sure we know sRGBspace exists already */
+        return (this == sRGBspace);
+    }
+
+    /**
+     * Transforms a color value assumed to be in this ColorSpace
+     * into a value in the default CS_sRGB color space.
+     * <p>
+     * This method transforms color values using algorithms designed
+     * to produce the best perceptual match between input and output
+     * colors.  In order to do colorimetric conversion of color values,
+     * you should use the <code>toCIEXYZ</code>
+     * method of this color space to first convert from the input
+     * color space to the CS_CIEXYZ color space, and then use the
+     * <code>fromCIEXYZ</code> method of the CS_sRGB color space to
+     * convert from CS_CIEXYZ to the output color space.
+     * See {@link #toCIEXYZ(float[]) toCIEXYZ} and
+     * {@link #fromCIEXYZ(float[]) fromCIEXYZ} for further information.
+     * <p>
+     * @param colorvalue a float array with length of at least the number
+     *        of components in this ColorSpace
+     * @return a float array of length 3
+     * @throws ArrayIndexOutOfBoundsException if array length is not
+     *         at least the number of components in this ColorSpace
+     */
+    public abstract float[] toRGB(float[] colorvalue);
+
+
+    /**
+     * Transforms a color value assumed to be in the default CS_sRGB
+     * color space into this ColorSpace.
+     * <p>
+     * This method transforms color values using algorithms designed
+     * to produce the best perceptual match between input and output
+     * colors.  In order to do colorimetric conversion of color values,
+     * you should use the <code>toCIEXYZ</code>
+     * method of the CS_sRGB color space to first convert from the input
+     * color space to the CS_CIEXYZ color space, and then use the
+     * <code>fromCIEXYZ</code> method of this color space to
+     * convert from CS_CIEXYZ to the output color space.
+     * See {@link #toCIEXYZ(float[]) toCIEXYZ} and
+     * {@link #fromCIEXYZ(float[]) fromCIEXYZ} for further information.
+     * <p>
+     * @param rgbvalue a float array with length of at least 3
+     * @return a float array with length equal to the number of
+     *         components in this ColorSpace
+     * @throws ArrayIndexOutOfBoundsException if array length is not
+     *         at least 3
+     */
+    public abstract float[] fromRGB(float[] rgbvalue);
+
+
+    /**
+     * Transforms a color value assumed to be in this ColorSpace
+     * into the CS_CIEXYZ conversion color space.
+     * <p>
+     * This method transforms color values using relative colorimetry,
+     * as defined by the International Color Consortium standard.  This
+     * means that the XYZ values returned by this method are represented
+     * relative to the D50 white point of the CS_CIEXYZ color space.
+     * This representation is useful in a two-step color conversion
+     * process in which colors are transformed from an input color
+     * space to CS_CIEXYZ and then to an output color space.  This
+     * representation is not the same as the XYZ values that would
+     * be measured from the given color value by a colorimeter.
+     * A further transformation is necessary to compute the XYZ values
+     * that would be measured using current CIE recommended practices.
+     * See the {@link ICC_ColorSpace#toCIEXYZ(float[]) toCIEXYZ} method of
+     * <code>ICC_ColorSpace</code> for further information.
+     * <p>
+     * @param colorvalue a float array with length of at least the number
+     *        of components in this ColorSpace
+     * @return a float array of length 3
+     * @throws ArrayIndexOutOfBoundsException if array length is not
+     *         at least the number of components in this ColorSpace.
+     */
+    public abstract float[] toCIEXYZ(float[] colorvalue);
+
+
+    /**
+     * Transforms a color value assumed to be in the CS_CIEXYZ conversion
+     * color space into this ColorSpace.
+     * <p>
+     * This method transforms color values using relative colorimetry,
+     * as defined by the International Color Consortium standard.  This
+     * means that the XYZ argument values taken by this method are represented
+     * relative to the D50 white point of the CS_CIEXYZ color space.
+     * This representation is useful in a two-step color conversion
+     * process in which colors are transformed from an input color
+     * space to CS_CIEXYZ and then to an output color space.  The color
+     * values returned by this method are not those that would produce
+     * the XYZ value passed to the method when measured by a colorimeter.
+     * If you have XYZ values corresponding to measurements made using
+     * current CIE recommended practices, they must be converted to D50
+     * relative values before being passed to this method.
+     * See the {@link ICC_ColorSpace#fromCIEXYZ(float[]) fromCIEXYZ} method of
+     * <code>ICC_ColorSpace</code> for further information.
+     * <p>
+     * @param colorvalue a float array with length of at least 3
+     * @return a float array with length equal to the number of
+     *         components in this ColorSpace
+     * @throws ArrayIndexOutOfBoundsException if array length is not
+     *         at least 3
+     */
+    public abstract float[] fromCIEXYZ(float[] colorvalue);
+
+    /**
+     * Returns the color space type of this ColorSpace (for example
+     * TYPE_RGB, TYPE_XYZ, ...).  The type defines the
+     * number of components of the color space and the interpretation,
+     * e.g. TYPE_RGB identifies a color space with three components - red,
+     * green, and blue.  It does not define the particular color
+     * characteristics of the space, e.g. the chromaticities of the
+     * primaries.
+     *
+     * @return the type constant that represents the type of this
+     *         <CODE>ColorSpace</CODE>
+     */
+    public int getType() {
+        return type;
+    }
+
+    /**
+     * Returns the number of components of this ColorSpace.
+     * @return The number of components in this <CODE>ColorSpace</CODE>.
+     */
+    public int getNumComponents() {
+        return numComponents;
+    }
+
+    /**
+     * Returns the name of the component given the component index.
+     *
+     * @param idx the component index
+     * @return the name of the component at the specified index
+     * @throws IllegalArgumentException if <code>idx</code> is
+     *         less than 0 or greater than numComponents - 1
+     */
+    public String getName (int idx) {
+        /* REMIND - handle common cases here */
+        if ((idx < 0) || (idx > numComponents - 1)) {
+            throw new IllegalArgumentException(
+                "Component index out of range: " + idx);
+        }
+
+        if (compName == null) {
+            switch (type) {
+                case ColorSpace.TYPE_XYZ:
+                    compName = new String[] {"X", "Y", "Z"};
+                    break;
+                case ColorSpace.TYPE_Lab:
+                    compName = new String[] {"L", "a", "b"};
+                    break;
+                case ColorSpace.TYPE_Luv:
+                    compName = new String[] {"L", "u", "v"};
+                    break;
+                case ColorSpace.TYPE_YCbCr:
+                    compName = new String[] {"Y", "Cb", "Cr"};
+                    break;
+                case ColorSpace.TYPE_Yxy:
+                    compName = new String[] {"Y", "x", "y"};
+                    break;
+                case ColorSpace.TYPE_RGB:
+                    compName = new String[] {"Red", "Green", "Blue"};
+                    break;
+                case ColorSpace.TYPE_GRAY:
+                    compName = new String[] {"Gray"};
+                    break;
+                case ColorSpace.TYPE_HSV:
+                    compName = new String[] {"Hue", "Saturation", "Value"};
+                    break;
+                case ColorSpace.TYPE_HLS:
+                    compName = new String[] {"Hue", "Lightness",
+                                             "Saturation"};
+                    break;
+                case ColorSpace.TYPE_CMYK:
+                    compName = new String[] {"Cyan", "Magenta", "Yellow",
+                                             "Black"};
+                    break;
+                case ColorSpace.TYPE_CMY:
+                    compName = new String[] {"Cyan", "Magenta", "Yellow"};
+                    break;
+                default:
+                    String [] tmp = new String[numComponents];
+                    for (int i = 0; i < tmp.length; i++) {
+                        tmp[i] = "Unnamed color component(" + i + ")";
+                    }
+                    compName = tmp;
+            }
+        }
+        return compName[idx];
+    }
+
+    /**
+     * Returns the minimum normalized color component value for the
+     * specified component.  The default implementation in this abstract
+     * class returns 0.0 for all components.  Subclasses should override
+     * this method if necessary.
+     *
+     * @param component the component index
+     * @return the minimum normalized component value
+     * @throws IllegalArgumentException if component is less than 0 or
+     *         greater than numComponents - 1
+     * @since 1.4
+     */
+    public float getMinValue(int component) {
+        if ((component < 0) || (component > numComponents - 1)) {
+            throw new IllegalArgumentException(
+                "Component index out of range: " + component);
+        }
+        return 0.0f;
+    }
+
+    /**
+     * Returns the maximum normalized color component value for the
+     * specified component.  The default implementation in this abstract
+     * class returns 1.0 for all components.  Subclasses should override
+     * this method if necessary.
+     *
+     * @param component the component index
+     * @return the maximum normalized component value
+     * @throws IllegalArgumentException if component is less than 0 or
+     *         greater than numComponents - 1
+     * @since 1.4
+     */
+    public float getMaxValue(int component) {
+        if ((component < 0) || (component > numComponents - 1)) {
+            throw new IllegalArgumentException(
+                "Component index out of range: " + component);
+        }
+        return 1.0f;
+    }
+
+    /* Returns true if cspace is the XYZspace.
+     */
+    static boolean isCS_CIEXYZ(ColorSpace cspace) {
+        return (cspace == XYZspace);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/classes/java/awt/color/ICC_ColorSpace.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,616 @@
+/*
+ * Portions Copyright 1997-2007 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) Eastman Kodak Company, 1997                      ***
+ *** As  an unpublished  work pursuant to Title 17 of the United    ***
+ *** States Code.  All rights reserved.                             ***
+ **********************************************************************
+ **********************************************************************
+ **********************************************************************/
+
+package java.awt.color;
+
+import sun.java2d.cmm.ColorTransform;
+import sun.java2d.cmm.CMSManager;
+import sun.java2d.cmm.PCMM;
+
+
+/**
+ *
+ * The ICC_ColorSpace class is an implementation of the abstract
+ * ColorSpace class.  This representation of
+ * device independent and device dependent color spaces is based on the
+ * International Color Consortium Specification ICC.1:2001-12, File Format for
+ * Color Profiles (see <A href="http://www.color.org">http://www.color.org</A>).
+ * <p>
+ * Typically, a Color or ColorModel would be associated with an ICC
+ * Profile which is either an input, display, or output profile (see
+ * the ICC specification).  There are other types of ICC Profiles, e.g.
+ * abstract profiles, device link profiles, and named color profiles,
+ * which do not contain information appropriate for representing the color
+ * space of a color, image, or device (see ICC_Profile).
+ * Attempting to create an ICC_ColorSpace object from an inappropriate ICC
+ * Profile is an error.
+ * <p>
+ * ICC Profiles represent transformations from the color space of
+ * the profile (e.g. a monitor) to a Profile Connection Space (PCS).
+ * Profiles of interest for tagging images or colors have a
+ * PCS which is one of the device independent
+ * spaces (one CIEXYZ space and two CIELab spaces) defined in the
+ * ICC Profile Format Specification.  Most profiles of interest
+ * either have invertible transformations or explicitly specify
+ * transformations going both directions.  Should an ICC_ColorSpace
+ * object be used in a way requiring a conversion from PCS to
+ * the profile's native space and there is inadequate data to
+ * correctly perform the conversion, the ICC_ColorSpace object will
+ * produce output in the specified type of color space (e.g. TYPE_RGB,
+ * TYPE_CMYK, etc.), but the specific color values of the output data
+ * will be undefined.
+ * <p>
+ * The details of this class are not important for simple applets,
+ * which draw in a default color space or manipulate and display
+ * imported images with a known color space.  At most, such applets
+ * would need to get one of the default color spaces via
+ * ColorSpace.getInstance().
+ * <p>
+ * @see ColorSpace
+ * @see ICC_Profile
+ */
+
+
+
+public class ICC_ColorSpace extends ColorSpace {
+
+    static final long serialVersionUID = 3455889114070431483L;
+
+    private ICC_Profile    thisProfile;
+    private float[] minVal;
+    private float[] maxVal;
+    private float[] diffMinMax;
+    private float[] invDiffMinMax;
+    private boolean needScaleInit = true;
+
+    // {to,from}{RGB,CIEXYZ} methods create and cache these when needed
+    private transient ColorTransform this2srgb;
+    private transient ColorTransform srgb2this;
+    private transient ColorTransform this2xyz;
+    private transient ColorTransform xyz2this;
+
+
+    /**
+    * Constructs a new ICC_ColorSpace from an ICC_Profile object.
+    * @param profile the specified ICC_Profile object
+    * @exception IllegalArgumentException if profile is inappropriate for
+    *            representing a ColorSpace.
+    */
+    public ICC_ColorSpace (ICC_Profile profile) {
+        super (profile.getColorSpaceType(), profile.getNumComponents());
+
+        int profileClass = profile.getProfileClass();
+
+        /* REMIND - is NAMEDCOLOR OK? */
+        if ((profileClass != ICC_Profile.CLASS_INPUT) &&
+            (profileClass != ICC_Profile.CLASS_DISPLAY) &&
+            (profileClass != ICC_Profile.CLASS_OUTPUT) &&
+            (profileClass != ICC_Profile.CLASS_COLORSPACECONVERSION) &&
+            (profileClass != ICC_Profile.CLASS_NAMEDCOLOR) &&
+            (profileClass != ICC_Profile.CLASS_ABSTRACT)) {
+            throw new IllegalArgumentException("Invalid profile type");
+        }
+
+        thisProfile = profile;
+        setMinMax();
+    }
+
+    /**
+    * Returns the ICC_Profile for this ICC_ColorSpace.
+    * @return the ICC_Profile for this ICC_ColorSpace.
+    */
+    public ICC_Profile getProfile() {
+        return thisProfile;
+    }
+
+    /**
+     * Transforms a color value assumed to be in this ColorSpace
+     * into a value in the default CS_sRGB color space.
+     * <p>
+     * This method transforms color values using algorithms designed
+     * to produce the best perceptual match between input and output
+     * colors.  In order to do colorimetric conversion of color values,
+     * you should use the <code>toCIEXYZ</code>
+     * method of this color space to first convert from the input
+     * color space to the CS_CIEXYZ color space, and then use the
+     * <code>fromCIEXYZ</code> method of the CS_sRGB color space to
+     * convert from CS_CIEXYZ to the output color space.
+     * See {@link #toCIEXYZ(float[]) toCIEXYZ} and
+     * {@link #fromCIEXYZ(float[]) fromCIEXYZ} for further information.
+     * <p>
+     * @param colorvalue a float array with length of at least the number
+     *      of components in this ColorSpace.
+     * @return a float array of length 3.
+     * @throws ArrayIndexOutOfBoundsException if array length is not
+     * at least the number of components in this ColorSpace.
+     */
+    public float[]    toRGB (float[] colorvalue) {
+
+        if (this2srgb == null) {
+            ColorTransform[] transformList = new ColorTransform [2];
+            ICC_ColorSpace srgbCS =
+                (ICC_ColorSpace) ColorSpace.getInstance (CS_sRGB);
+            PCMM mdl = CMSManager.getModule();
+            transformList[0] = mdl.createTransform(
+                thisProfile, ColorTransform.Any, ColorTransform.In);
+            transformList[1] = mdl.createTransform(
+                srgbCS.getProfile(), ColorTransform.Any, ColorTransform.Out);
+            this2srgb = mdl.createTransform(transformList);
+            if (needScaleInit) {
+                setComponentScaling();
+            }
+        }
+
+        int nc = this.getNumComponents();
+        short tmp[] = new short[nc];
+        for (int i = 0; i < nc; i++) {
+            tmp[i] = (short)
+                ((colorvalue[i] - minVal[i]) * invDiffMinMax[i] + 0.5f);
+        }
+        tmp = this2srgb.colorConvert(tmp, null);
+        float[] result = new float [3];
+        for (int i = 0; i < 3; i++) {
+            result[i] = ((float) (tmp[i] & 0xffff)) / 65535.0f;
+        }
+        return result;
+    }
+
+    /**
+     * Transforms a color value assumed to be in the default CS_sRGB
+     * color space into this ColorSpace.
+     * <p>
+     * This method transforms color values using algorithms designed
+     * to produce the best perceptual match between input and output
+     * colors.  In order to do colorimetric conversion of color values,
+     * you should use the <code>toCIEXYZ</code>
+     * method of the CS_sRGB color space to first convert from the input
+     * color space to the CS_CIEXYZ color space, and then use the
+     * <code>fromCIEXYZ</code> method of this color space to
+     * convert from CS_CIEXYZ to the output color space.
+     * See {@link #toCIEXYZ(float[]) toCIEXYZ} and
+     * {@link #fromCIEXYZ(float[]) fromCIEXYZ} for further information.
+     * <p>
+     * @param rgbvalue a float array with length of at least 3.
+     * @return a float array with length equal to the number of
+     *       components in this ColorSpace.
+     * @throws ArrayIndexOutOfBoundsException if array length is not
+     * at least 3.
+     */
+    public float[]    fromRGB(float[] rgbvalue) {
+
+        if (srgb2this == null) {
+            ColorTransform[] transformList = new ColorTransform [2];
+            ICC_ColorSpace srgbCS =
+                (ICC_ColorSpace) ColorSpace.getInstance (CS_sRGB);
+            PCMM mdl = CMSManager.getModule();
+            transformList[0] = mdl.createTransform(
+                srgbCS.getProfile(), ColorTransform.Any, ColorTransform.In);
+            transformList[1] = mdl.createTransform(
+                thisProfile, ColorTransform.Any, ColorTransform.Out);
+            srgb2this = mdl.createTransform(transformList);
+            if (needScaleInit) {
+                setComponentScaling();
+            }
+        }
+
+        short tmp[] = new short[3];
+        for (int i = 0; i < 3; i++) {
+            tmp[i] = (short) ((rgbvalue[i] * 65535.0f) + 0.5f);
+        }
+        tmp = srgb2this.colorConvert(tmp, null);
+        int nc = this.getNumComponents();
+        float[] result = new float [nc];
+        for (int i = 0; i < nc; i++) {
+            result[i] = (((float) (tmp[i] & 0xffff)) / 65535.0f) *
+                        diffMinMax[i] + minVal[i];
+        }
+        return result;
+    }
+
+
+    /**
+     * Transforms a color value assumed to be in this ColorSpace
+     * into the CS_CIEXYZ conversion color space.
+     * <p>
+     * This method transforms color values using relative colorimetry,
+     * as defined by the ICC Specification.  This
+     * means that the XYZ values returned by this method are represented
+     * relative to the D50 white point of the CS_CIEXYZ color space.
+     * This representation is useful in a two-step color conversion
+     * process in which colors are transformed from an input color
+     * space to CS_CIEXYZ and then to an output color space.  This
+     * representation is not the same as the XYZ values that would
+     * be measured from the given color value by a colorimeter.
+     * A further transformation is necessary to compute the XYZ values
+     * that would be measured using current CIE recommended practices.
+     * The paragraphs below explain this in more detail.
+     * <p>
+     * The ICC standard uses a device independent color space (DICS) as the
+     * mechanism for converting color from one device to another device.  In
+     * this architecture, colors are converted from the source device's color
+     * space to the ICC DICS and then from the ICC DICS to the destination
+     * device's color space.  The ICC standard defines device profiles which
+     * contain transforms which will convert between a device's color space
+     * and the ICC DICS.  The overall conversion of colors from a source
+     * device to colors of a destination device is done by connecting the
+     * device-to-DICS transform of the profile for the source device to the
+     * DICS-to-device transform of the profile for the destination device.
+     * For this reason, the ICC DICS is commonly referred to as the profile
+     * connection space (PCS).  The color space used in the methods
+     * toCIEXYZ and fromCIEXYZ is the CIEXYZ PCS defined by the ICC
+     * Specification.  This is also the color space represented by
+     * ColorSpace.CS_CIEXYZ.
+     * <p>
+     * The XYZ values of a color are often represented as relative to some
+     * white point, so the actual meaning of the XYZ values cannot be known
+     * without knowing the white point of those values.  This is known as
+     * relative colorimetry.  The PCS uses a white point of D50, so the XYZ
+     * values of the PCS are relative to D50.  For example, white in the PCS
+     * will have the XYZ values of D50, which is defined to be X=.9642,
+     * Y=1.000, and Z=0.8249.  This white point is commonly used for graphic
+     * arts applications, but others are often used in other applications.
+     * <p>
+     * To quantify the color characteristics of a device such as a printer
+     * or monitor, measurements of XYZ values for particular device colors
+     * are typically made.  For purposes of this discussion, the term
+     * device XYZ values is used to mean the XYZ values that would be
+     * measured from device colors using current CIE recommended practices.
+     * <p>
+     * Converting between device XYZ values and the PCS XYZ values returned
+     * by this method corresponds to converting between the device's color
+     * space, as represented by CIE colorimetric values, and the PCS.  There
+     * are many factors involved in this process, some of which are quite
+     * subtle.  The most important, however, is the adjustment made to account
+     * for differences between the device's white point and the white point of
+     * the PCS.  There are many techniques for doing this and it is the
+     * subject of much current research and controversy.  Some commonly used
+     * methods are XYZ scaling, the von Kries transform, and the Bradford
+     * transform.  The proper method to use depends upon each particular
+     * application.
+     * <p>
+     * The simplest method is XYZ scaling.  In this method each device XYZ
+     * value is  converted to a PCS XYZ value by multiplying it by the ratio
+     * of the PCS white point (D50) to the device white point.
+     * <pre>
+     *
+     * Xd, Yd, Zd are the device XYZ values
+     * Xdw, Ydw, Zdw are the device XYZ white point values
+     * Xp, Yp, Zp are the PCS XYZ values
+     * Xd50, Yd50, Zd50 are the PCS XYZ white point values
+     *
+     * Xp = Xd * (Xd50 / Xdw)
+     * Yp = Yd * (Yd50 / Ydw)
+     * Zp = Zd * (Zd50 / Zdw)
+     *
+     * </pre>
+     * <p>
+     * Conversion from the PCS to the device would be done by inverting these
+     * equations:
+     * <pre>
+     *
+     * Xd = Xp * (Xdw / Xd50)
+     * Yd = Yp * (Ydw / Yd50)
+     * Zd = Zp * (Zdw / Zd50)
+     *
+     * </pre>
+     * <p>
+     * Note that the media white point tag in an ICC profile is not the same
+     * as the device white point.  The media white point tag is expressed in
+     * PCS values and is used to represent the difference between the XYZ of
+     * device illuminant and the XYZ of the device media when measured under
+     * that illuminant.  The device white point is expressed as the device
+     * XYZ values corresponding to white displayed on the device.  For
+     * example, displaying the RGB color (1.0, 1.0, 1.0) on an sRGB device
+     * will result in a measured device XYZ value of D65.  This will not
+     * be the same as the media white point tag XYZ value in the ICC
+     * profile for an sRGB device.
+     * <p>
+     * @param colorvalue a float array with length of at least the number
+     *        of components in this ColorSpace.
+     * @return a float array of length 3.
+     * @throws ArrayIndexOutOfBoundsException if array length is not
+     * at least the number of components in this ColorSpace.
+     */
+    public float[]    toCIEXYZ(float[] colorvalue) {
+
+        if (this2xyz == null) {
+            ColorTransform[] transformList = new ColorTransform [2];
+            ICC_ColorSpace xyzCS =
+                (ICC_ColorSpace) ColorSpace.getInstance (CS_CIEXYZ);
+            PCMM mdl = CMSManager.getModule();
+            try {
+                transformList[0] = mdl.createTransform(
+                    thisProfile, ICC_Profile.icRelativeColorimetric,
+                    ColorTransform.In);
+            } catch (CMMException e) {
+                transformList[0] = mdl.createTransform(
+                    thisProfile, ColorTransform.Any, ColorTransform.In);
+            }
+            transformList[1] = mdl.createTransform(
+                xyzCS.getProfile(), ColorTransform.Any, ColorTransform.Out);
+            this2xyz = mdl.createTransform (transformList);
+            if (needScaleInit) {
+                setComponentScaling();
+            }
+        }
+
+        int nc = this.getNumComponents();
+        short tmp[] = new short[nc];
+        for (int i = 0; i < nc; i++) {
+            tmp[i] = (short)
+                ((colorvalue[i] - minVal[i]) * invDiffMinMax[i] + 0.5f);
+        }
+        tmp = this2xyz.colorConvert(tmp, null);
+        float ALMOST_TWO = 1.0f + (32767.0f / 32768.0f);
+        // For CIEXYZ, min = 0.0, max = ALMOST_TWO for all components
+        float[] result = new float [3];
+        for (int i = 0; i < 3; i++) {
+            result[i] = (((float) (tmp[i] & 0xffff)) / 65535.0f) * ALMOST_TWO;
+        }
+        return result;
+    }
+
+
+    /**
+     * Transforms a color value assumed to be in the CS_CIEXYZ conversion
+     * color space into this ColorSpace.
+     * <p>
+     * This method transforms color values using relative colorimetry,
+     * as defined by the ICC Specification.  This
+     * means that the XYZ argument values taken by this method are represented
+     * relative to the D50 white point of the CS_CIEXYZ color space.
+     * This representation is useful in a two-step color conversion
+     * process in which colors are transformed from an input color
+     * space to CS_CIEXYZ and then to an output color space.  The color
+     * values returned by this method are not those that would produce
+     * the XYZ value passed to the method when measured by a colorimeter.
+     * If you have XYZ values corresponding to measurements made using
+     * current CIE recommended practices, they must be converted to D50
+     * relative values before being passed to this method.
+     * The paragraphs below explain this in more detail.
+     * <p>
+     * The ICC standard uses a device independent color space (DICS) as the
+     * mechanism for converting color from one device to another device.  In
+     * this architecture, colors are converted from the source device's color
+     * space to the ICC DICS and then from the ICC DICS to the destination
+     * device's color space.  The ICC standard defines device profiles which
+     * contain transforms which will convert between a device's color space
+     * and the ICC DICS.  The overall conversion of colors from a source
+     * device to colors of a destination device is done by connecting the
+     * device-to-DICS transform of the profile for the source device to the
+     * DICS-to-device transform of the profile for the destination device.
+     * For this reason, the ICC DICS is commonly referred to as the profile
+     * connection space (PCS).  The color space used in the methods
+     * toCIEXYZ and fromCIEXYZ is the CIEXYZ PCS defined by the ICC
+     * Specification.  This is also the color space represented by
+     * ColorSpace.CS_CIEXYZ.
+     * <p>
+     * The XYZ values of a color are often represented as relative to some
+     * white point, so the actual meaning of the XYZ values cannot be known
+     * without knowing the white point of those values.  This is known as
+     * relative colorimetry.  The PCS uses a white point of D50, so the XYZ
+     * values of the PCS are relative to D50.  For example, white in the PCS
+     * will have the XYZ values of D50, which is defined to be X=.9642,
+     * Y=1.000, and Z=0.8249.  This white point is commonly used for graphic
+     * arts applications, but others are often used in other applications.
+     * <p>
+     * To quantify the color characteristics of a device such as a printer
+     * or monitor, measurements of XYZ values for particular device colors
+     * are typically made.  For purposes of this discussion, the term
+     * device XYZ values is used to mean the XYZ values that would be
+     * measured from device colors using current CIE recommended practices.
+     * <p>
+     * Converting between device XYZ values and the PCS XYZ values taken as
+     * arguments by this method corresponds to converting between the device's
+     * color space, as represented by CIE colorimetric values, and the PCS.
+     * There are many factors involved in this process, some of which are quite
+     * subtle.  The most important, however, is the adjustment made to account
+     * for differences between the device's white point and the white point of
+     * the PCS.  There are many techniques for doing this and it is the
+     * subject of much current research and controversy.  Some commonly used
+     * methods are XYZ scaling, the von Kries transform, and the Bradford
+     * transform.  The proper method to use depends upon each particular
+     * application.
+     * <p>
+     * The simplest method is XYZ scaling.  In this method each device XYZ
+     * value is  converted to a PCS XYZ value by multiplying it by the ratio
+     * of the PCS white point (D50) to the device white point.
+     * <pre>
+     *
+     * Xd, Yd, Zd are the device XYZ values
+     * Xdw, Ydw, Zdw are the device XYZ white point values
+     * Xp, Yp, Zp are the PCS XYZ values
+     * Xd50, Yd50, Zd50 are the PCS XYZ white point values
+     *
+     * Xp = Xd * (Xd50 / Xdw)
+     * Yp = Yd * (Yd50 / Ydw)
+     * Zp = Zd * (Zd50 / Zdw)
+     *
+     * </pre>
+     * <p>
+     * Conversion from the PCS to the device would be done by inverting these
+     * equations:
+     * <pre>
+     *
+     * Xd = Xp * (Xdw / Xd50)
+     * Yd = Yp * (Ydw / Yd50)
+     * Zd = Zp * (Zdw / Zd50)
+     *
+     * </pre>
+     * <p>
+     * Note that the media white point tag in an ICC profile is not the same
+     * as the device white point.  The media white point tag is expressed in
+     * PCS values and is used to represent the difference between the XYZ of
+     * device illuminant and the XYZ of the device media when measured under
+     * that illuminant.  The device white point is expressed as the device
+     * XYZ values corresponding to white displayed on the device.  For
+     * example, displaying the RGB color (1.0, 1.0, 1.0) on an sRGB device
+     * will result in a measured device XYZ value of D65.  This will not
+     * be the same as the media white point tag XYZ value in the ICC
+     * profile for an sRGB device.
+     * <p>
+     * <p>
+     * @param colorvalue a float array with length of at least 3.
+     * @return a float array with length equal to the number of
+     *         components in this ColorSpace.
+     * @throws ArrayIndexOutOfBoundsException if array length is not
+     * at least 3.
+     */
+    public float[]    fromCIEXYZ(float[] colorvalue) {
+
+        if (xyz2this == null) {
+            ColorTransform[] transformList = new ColorTransform [2];
+            ICC_ColorSpace xyzCS =
+                (ICC_ColorSpace) ColorSpace.getInstance (CS_CIEXYZ);
+            PCMM mdl = CMSManager.getModule();
+            transformList[0] = mdl.createTransform (
+                xyzCS.getProfile(), ColorTransform.Any, ColorTransform.In);
+            try {
+                transformList[1] = mdl.createTransform(
+                    thisProfile, ICC_Profile.icRelativeColorimetric,
+                    ColorTransform.Out);
+            } catch (CMMException e) {
+                transformList[1] = CMSManager.getModule().createTransform(
+                thisProfile, ColorTransform.Any, ColorTransform.Out);
+            }
+            xyz2this = mdl.createTransform(transformList);
+            if (needScaleInit) {
+                setComponentScaling();
+            }
+        }
+
+        short tmp[] = new short[3];
+        float ALMOST_TWO = 1.0f + (32767.0f / 32768.0f);
+        float factor = 65535.0f / ALMOST_TWO;
+        // For CIEXYZ, min = 0.0, max = ALMOST_TWO for all components
+        for (int i = 0; i < 3; i++) {
+            tmp[i] = (short) ((colorvalue[i] * factor) + 0.5f);
+        }
+        tmp = xyz2this.colorConvert(tmp, null);
+        int nc = this.getNumComponents();
+        float[] result = new float [nc];
+        for (int i = 0; i < nc; i++) {
+            result[i] = (((float) (tmp[i] & 0xffff)) / 65535.0f) *
+                        diffMinMax[i] + minVal[i];
+        }
+        return result;
+    }
+
+    /**
+     * Returns the minimum normalized color component value for the
+     * specified component.  For TYPE_XYZ spaces, this method returns
+     * minimum values of 0.0 for all components.  For TYPE_Lab spaces,
+     * this method returns 0.0 for L and -128.0 for a and b components.
+     * This is consistent with the encoding of the XYZ and Lab Profile
+     * Connection Spaces in the ICC specification.  For all other types, this
+     * method returns 0.0 for all components.  When using an ICC_ColorSpace
+     * with a profile that requires different minimum component values,
+     * it is necessary to subclass this class and override this method.
+     * @param component The component index.
+     * @return The minimum normalized component value.
+     * @throws IllegalArgumentException if component is less than 0 or
+     *         greater than numComponents - 1.
+     * @since 1.4
+     */
+    public float getMinValue(int component) {
+        if ((component < 0) || (component > this.getNumComponents() - 1)) {
+            throw new IllegalArgumentException(
+                "Component index out of range: + component");
+        }
+        return minVal[component];
+    }
+
+    /**
+     * Returns the maximum normalized color component value for the
+     * specified component.  For TYPE_XYZ spaces, this method returns
+     * maximum values of 1.0 + (32767.0 / 32768.0) for all components.
+     * For TYPE_Lab spaces,
+     * this method returns 100.0 for L and 127.0 for a and b components.
+     * This is consistent with the encoding of the XYZ and Lab Profile
+     * Connection Spaces in the ICC specification.  For all other types, this
+     * method returns 1.0 for all components.  When using an ICC_ColorSpace
+     * with a profile that requires different maximum component values,
+     * it is necessary to subclass this class and override this method.
+     * @param component The component index.
+     * @return The maximum normalized component value.
+     * @throws IllegalArgumentException if component is less than 0 or
+     *         greater than numComponents - 1.
+     * @since 1.4
+     */
+    public float getMaxValue(int component) {
+        if ((component < 0) || (component > this.getNumComponents() - 1)) {
+            throw new IllegalArgumentException(
+                "Component index out of range: + component");
+        }
+        return maxVal[component];
+    }
+
+    private void setMinMax() {
+        int nc = this.getNumComponents();
+        int type = this.getType();
+        minVal = new float[nc];
+        maxVal = new float[nc];
+        if (type == ColorSpace.TYPE_Lab) {
+            minVal[0] = 0.0f;    // L
+            maxVal[0] = 100.0f;
+            minVal[1] = -128.0f; // a
+            maxVal[1] = 127.0f;
+            minVal[2] = -128.0f; // b
+            maxVal[2] = 127.0f;
+        } else if (type == ColorSpace.TYPE_XYZ) {
+            minVal[0] = minVal[1] = minVal[2] = 0.0f; // X, Y, Z
+            maxVal[0] = maxVal[1] = maxVal[2] = 1.0f + (32767.0f/ 32768.0f);
+        } else {
+            for (int i = 0; i < nc; i++) {
+                minVal[i] = 0.0f;
+                maxVal[i] = 1.0f;
+            }
+        }
+    }
+
+    private void setComponentScaling() {
+        int nc = this.getNumComponents();
+        diffMinMax = new float[nc];
+        invDiffMinMax = new float[nc];
+        for (int i = 0; i < nc; i++) {
+            minVal[i] = this.getMinValue(i); // in case getMinVal is overridden
+            maxVal[i] = this.getMaxValue(i); // in case getMaxVal is overridden
+            diffMinMax[i] = maxVal[i] - minVal[i];
+            invDiffMinMax[i] = 65535.0f / diffMinMax[i];
+        }
+        needScaleInit = false;
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/classes/java/awt/color/ICC_Profile.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,2003 @@
+/*
+ * Portions Copyright 1997-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) Eastman Kodak Company, 1997                      ***
+ *** As  an unpublished  work pursuant to Title 17 of the United    ***
+ *** States Code.  All rights reserved.                             ***
+ **********************************************************************
+ **********************************************************************
+ **********************************************************************/
+
+package java.awt.color;
+
+import sun.java2d.cmm.PCMM;
+import sun.java2d.cmm.CMSManager;
+import sun.java2d.cmm.ProfileDeferralMgr;
+import sun.java2d.cmm.ProfileDeferralInfo;
+import sun.java2d.cmm.ProfileActivator;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.ObjectStreamException;
+import java.io.OutputStream;
+import java.io.Serializable;
+
+import java.util.StringTokenizer;
+
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+
+/**
+ * A representation of color profile data for device independent and
+ * device dependent color spaces based on the International Color
+ * Consortium Specification ICC.1:2001-12, File Format for Color Profiles,
+ * (see <A href="http://www.color.org"> http://www.color.org</A>).
+ * <p>
+ * An ICC_ColorSpace object can be constructed from an appropriate
+ * ICC_Profile.
+ * Typically, an ICC_ColorSpace would be associated with an ICC
+ * Profile which is either an input, display, or output profile (see
+ * the ICC specification).  There are also device link, abstract,
+ * color space conversion, and named color profiles.  These are less
+ * useful for tagging a color or image, but are useful for other
+ * purposes (in particular device link profiles can provide improved
+ * performance for converting from one device's color space to
+ * another's).
+ * <p>
+ * ICC Profiles represent transformations from the color space of
+ * the profile (e.g. a monitor) to a Profile Connection Space (PCS).
+ * Profiles of interest for tagging images or colors have a PCS
+ * which is one of the two specific device independent
+ * spaces (one CIEXYZ space and one CIELab space) defined in the
+ * ICC Profile Format Specification.  Most profiles of interest
+ * either have invertible transformations or explicitly specify
+ * transformations going both directions.
+ * <p>
+ * @see ICC_ColorSpace
+ */
+
+
+public class ICC_Profile implements Serializable {
+
+    private static final long serialVersionUID = -3938515861990936766L;
+
+    transient long ID;
+
+    private transient ProfileDeferralInfo deferralInfo;
+    private transient ProfileActivator profileActivator;
+
+    // Registry of singleton profile objects for specific color spaces
+    // defined in the ColorSpace class (e.g. CS_sRGB), see
+    // getInstance(int cspace) factory method.
+    private static ICC_Profile sRGBprofile;
+    private static ICC_Profile XYZprofile;
+    private static ICC_Profile PYCCprofile;
+    private static ICC_Profile GRAYprofile;
+    private static ICC_Profile LINEAR_RGBprofile;
+
+
+    /**
+     * Profile class is input.
+     */
+    public static final int CLASS_INPUT = 0;
+
+    /**
+     * Profile class is display.
+     */
+    public static final int CLASS_DISPLAY = 1;
+
+    /**
+     * Profile class is output.
+     */
+    public static final int CLASS_OUTPUT = 2;
+
+    /**
+     * Profile class is device link.
+     */
+    public static final int CLASS_DEVICELINK = 3;
+
+    /**
+     * Profile class is color space conversion.
+     */
+    public static final int CLASS_COLORSPACECONVERSION = 4;
+
+    /**
+     * Profile class is abstract.
+     */
+    public static final int CLASS_ABSTRACT = 5;
+
+    /**
+     * Profile class is named color.
+     */
+    public static final int CLASS_NAMEDCOLOR = 6;
+
+
+    /**
+     * ICC Profile Color Space Type Signature: 'XYZ '.
+     */
+    public static final int icSigXYZData        = 0x58595A20;    /* 'XYZ ' */
+
+    /**
+     * ICC Profile Color Space Type Signature: 'Lab '.
+     */
+    public static final int icSigLabData        = 0x4C616220;    /* 'Lab ' */
+
+    /**
+     * ICC Profile Color Space Type Signature: 'Luv '.
+     */
+    public static final int icSigLuvData        = 0x4C757620;    /* 'Luv ' */
+
+    /**
+     * ICC Profile Color Space Type Signature: 'YCbr'.
+     */
+    public static final int icSigYCbCrData        = 0x59436272;    /* 'YCbr' */
+
+    /**
+     * ICC Profile Color Space Type Signature: 'Yxy '.
+     */
+    public static final int icSigYxyData        = 0x59787920;    /* 'Yxy ' */
+
+    /**
+     * ICC Profile Color Space Type Signature: 'RGB '.
+     */
+    public static final int icSigRgbData        = 0x52474220;    /* 'RGB ' */
+
+    /**
+     * ICC Profile Color Space Type Signature: 'GRAY'.
+     */
+    public static final int icSigGrayData        = 0x47524159;    /* 'GRAY' */
+
+    /**
+     * ICC Profile Color Space Type Signature: 'HSV'.
+     */
+    public static final int icSigHsvData        = 0x48535620;    /* 'HSV ' */
+
+    /**
+     * ICC Profile Color Space Type Signature: 'HLS'.
+     */
+    public static final int icSigHlsData        = 0x484C5320;    /* 'HLS ' */
+
+    /**
+     * ICC Profile Color Space Type Signature: 'CMYK'.
+     */
+    public static final int icSigCmykData        = 0x434D594B;    /* 'CMYK' */
+
+    /**
+     * ICC Profile Color Space Type Signature: 'CMY '.
+     */
+    public static final int icSigCmyData        = 0x434D5920;    /* 'CMY ' */
+
+    /**
+     * ICC Profile Color Space Type Signature: '2CLR'.
+     */
+    public static final int icSigSpace2CLR        = 0x32434C52;    /* '2CLR' */
+
+    /**
+     * ICC Profile Color Space Type Signature: '3CLR'.
+     */
+    public static final int icSigSpace3CLR        = 0x33434C52;    /* '3CLR' */
+
+    /**
+     * ICC Profile Color Space Type Signature: '4CLR'.
+     */
+    public static final int icSigSpace4CLR        = 0x34434C52;    /* '4CLR' */
+
+    /**
+     * ICC Profile Color Space Type Signature: '5CLR'.
+     */
+    public static final int icSigSpace5CLR        = 0x35434C52;    /* '5CLR' */
+
+    /**
+     * ICC Profile Color Space Type Signature: '6CLR'.
+     */
+    public static final int icSigSpace6CLR        = 0x36434C52;    /* '6CLR' */
+
+    /**
+     * ICC Profile Color Space Type Signature: '7CLR'.
+     */
+    public static final int icSigSpace7CLR        = 0x37434C52;    /* '7CLR' */
+
+    /**
+     * ICC Profile Color Space Type Signature: '8CLR'.
+     */
+    public static final int icSigSpace8CLR        = 0x38434C52;    /* '8CLR' */
+
+    /**
+     * ICC Profile Color Space Type Signature: '9CLR'.
+     */
+    public static final int icSigSpace9CLR        = 0x39434C52;    /* '9CLR' */
+
+    /**
+     * ICC Profile Color Space Type Signature: 'ACLR'.
+     */
+    public static final int icSigSpaceACLR        = 0x41434C52;    /* 'ACLR' */
+
+    /**
+     * ICC Profile Color Space Type Signature: 'BCLR'.
+     */
+    public static final int icSigSpaceBCLR        = 0x42434C52;    /* 'BCLR' */
+
+    /**
+     * ICC Profile Color Space Type Signature: 'CCLR'.
+     */
+    public static final int icSigSpaceCCLR        = 0x43434C52;    /* 'CCLR' */
+
+    /**
+     * ICC Profile Color Space Type Signature: 'DCLR'.
+     */
+    public static final int icSigSpaceDCLR        = 0x44434C52;    /* 'DCLR' */
+
+    /**
+     * ICC Profile Color Space Type Signature: 'ECLR'.
+     */
+    public static final int icSigSpaceECLR        = 0x45434C52;    /* 'ECLR' */
+
+    /**
+     * ICC Profile Color Space Type Signature: 'FCLR'.
+     */
+    public static final int icSigSpaceFCLR        = 0x46434C52;    /* 'FCLR' */
+
+
+    /**
+     * ICC Profile Class Signature: 'scnr'.
+     */
+    public static final int icSigInputClass       = 0x73636E72;    /* 'scnr' */
+
+    /**
+     * ICC Profile Class Signature: 'mntr'.
+     */
+    public static final int icSigDisplayClass     = 0x6D6E7472;    /* 'mntr' */
+
+    /**
+     * ICC Profile Class Signature: 'prtr'.
+     */
+    public static final int icSigOutputClass      = 0x70727472;    /* 'prtr' */
+
+    /**
+     * ICC Profile Class Signature: 'link'.
+     */
+    public static final int icSigLinkClass        = 0x6C696E6B;    /* 'link' */
+
+    /**
+     * ICC Profile Class Signature: 'abst'.
+     */
+    public static final int icSigAbstractClass    = 0x61627374;    /* 'abst' */
+
+    /**
+     * ICC Profile Class Signature: 'spac'.
+     */
+    public static final int icSigColorSpaceClass  = 0x73706163;    /* 'spac' */
+
+    /**
+     * ICC Profile Class Signature: 'nmcl'.
+     */
+    public static final int icSigNamedColorClass  = 0x6e6d636c;    /* 'nmcl' */
+
+
+    /**
+     * ICC Profile Rendering Intent: Perceptual.
+     */
+    public static final int icPerceptual            = 0;
+
+    /**
+     * ICC Profile Rendering Intent: RelativeColorimetric.
+     */
+    public static final int icRelativeColorimetric    = 1;
+
+    /**
+     * ICC Profile Rendering Intent: Media-RelativeColorimetric.
+     * @since 1.5
+     */
+    public static final int icMediaRelativeColorimetric = 1;
+
+    /**
+     * ICC Profile Rendering Intent: Saturation.
+     */
+    public static final int icSaturation            = 2;
+
+    /**
+     * ICC Profile Rendering Intent: AbsoluteColorimetric.
+     */
+    public static final int icAbsoluteColorimetric    = 3;
+
+    /**
+     * ICC Profile Rendering Intent: ICC-AbsoluteColorimetric.
+     * @since 1.5
+     */
+    public static final int icICCAbsoluteColorimetric = 3;
+
+
+    /**
+     * ICC Profile Tag Signature: 'head' - special.
+     */
+    public static final int icSigHead      = 0x68656164; /* 'head' - special */
+
+    /**
+     * ICC Profile Tag Signature: 'A2B0'.
+     */
+    public static final int icSigAToB0Tag         = 0x41324230;    /* 'A2B0' */
+
+    /**
+     * ICC Profile Tag Signature: 'A2B1'.
+     */
+    public static final int icSigAToB1Tag         = 0x41324231;    /* 'A2B1' */
+
+    /**
+     * ICC Profile Tag Signature: 'A2B2'.
+     */
+    public static final int icSigAToB2Tag         = 0x41324232;    /* 'A2B2' */
+
+    /**
+     * ICC Profile Tag Signature: 'bXYZ'.
+     */
+    public static final int icSigBlueColorantTag  = 0x6258595A;    /* 'bXYZ' */
+
+    /**
+     * ICC Profile Tag Signature: 'bXYZ'.
+     * @since 1.5
+     */
+    public static final int icSigBlueMatrixColumnTag = 0x6258595A; /* 'bXYZ' */
+
+    /**
+     * ICC Profile Tag Signature: 'bTRC'.
+     */
+    public static final int icSigBlueTRCTag       = 0x62545243;    /* 'bTRC' */
+
+    /**
+     * ICC Profile Tag Signature: 'B2A0'.
+     */
+    public static final int icSigBToA0Tag         = 0x42324130;    /* 'B2A0' */
+
+    /**
+     * ICC Profile Tag Signature: 'B2A1'.
+     */
+    public static final int icSigBToA1Tag         = 0x42324131;    /* 'B2A1' */
+
+    /**
+     * ICC Profile Tag Signature: 'B2A2'.
+     */
+    public static final int icSigBToA2Tag         = 0x42324132;    /* 'B2A2' */
+
+    /**
+     * ICC Profile Tag Signature: 'calt'.
+     */
+    public static final int icSigCalibrationDateTimeTag = 0x63616C74;
+                                                                   /* 'calt' */
+
+    /**
+     * ICC Profile Tag Signature: 'targ'.
+     */
+    public static final int icSigCharTargetTag    = 0x74617267;    /* 'targ' */
+
+    /**
+     * ICC Profile Tag Signature: 'cprt'.
+     */
+    public static final int icSigCopyrightTag     = 0x63707274;    /* 'cprt' */
+
+    /**
+     * ICC Profile Tag Signature: 'crdi'.
+     */
+    public static final int icSigCrdInfoTag       = 0x63726469;    /* 'crdi' */
+
+    /**
+     * ICC Profile Tag Signature: 'dmnd'.
+     */
+    public static final int icSigDeviceMfgDescTag = 0x646D6E64;    /* 'dmnd' */
+
+    /**
+     * ICC Profile Tag Signature: 'dmdd'.
+     */
+    public static final int icSigDeviceModelDescTag = 0x646D6464;  /* 'dmdd' */
+
+    /**
+     * ICC Profile Tag Signature: 'devs'.
+     */
+    public static final int icSigDeviceSettingsTag =  0x64657673;  /* 'devs' */
+
+    /**
+     * ICC Profile Tag Signature: 'gamt'.
+     */
+    public static final int icSigGamutTag         = 0x67616D74;    /* 'gamt' */
+
+    /**
+     * ICC Profile Tag Signature: 'kTRC'.
+     */
+    public static final int icSigGrayTRCTag       = 0x6b545243;    /* 'kTRC' */
+
+    /**
+     * ICC Profile Tag Signature: 'gXYZ'.
+     */
+    public static final int icSigGreenColorantTag = 0x6758595A;    /* 'gXYZ' */
+
+    /**
+     * ICC Profile Tag Signature: 'gXYZ'.
+     * @since 1.5
+     */
+    public static final int icSigGreenMatrixColumnTag = 0x6758595A;/* 'gXYZ' */
+
+    /**
+     * ICC Profile Tag Signature: 'gTRC'.
+     */
+    public static final int icSigGreenTRCTag      = 0x67545243;    /* 'gTRC' */
+
+    /**
+     * ICC Profile Tag Signature: 'lumi'.
+     */
+    public static final int icSigLuminanceTag     = 0x6C756d69;    /* 'lumi' */
+
+    /**
+     * ICC Profile Tag Signature: 'meas'.
+     */
+    public static final int icSigMeasurementTag   = 0x6D656173;    /* 'meas' */
+
+    /**
+     * ICC Profile Tag Signature: 'bkpt'.
+     */
+    public static final int icSigMediaBlackPointTag = 0x626B7074;  /* 'bkpt' */
+
+    /**
+     * ICC Profile Tag Signature: 'wtpt'.
+     */
+    public static final int icSigMediaWhitePointTag = 0x77747074;  /* 'wtpt' */
+
+    /**
+     * ICC Profile Tag Signature: 'ncl2'.
+     */
+    public static final int icSigNamedColor2Tag   = 0x6E636C32;    /* 'ncl2' */
+
+    /**
+     * ICC Profile Tag Signature: 'resp'.
+     */
+    public static final int icSigOutputResponseTag = 0x72657370;   /* 'resp' */
+
+    /**
+     * ICC Profile Tag Signature: 'pre0'.
+     */
+    public static final int icSigPreview0Tag      = 0x70726530;    /* 'pre0' */
+
+    /**
+     * ICC Profile Tag Signature: 'pre1'.
+     */
+    public static final int icSigPreview1Tag      = 0x70726531;    /* 'pre1' */
+
+    /**
+     * ICC Profile Tag Signature: 'pre2'.
+     */
+    public static final int icSigPreview2Tag      = 0x70726532;    /* 'pre2' */
+
+    /**
+     * ICC Profile Tag Signature: 'desc'.
+     */
+    public static final int icSigProfileDescriptionTag = 0x64657363;
+                                                                   /* 'desc' */
+
+    /**
+     * ICC Profile Tag Signature: 'pseq'.
+     */
+    public static final int icSigProfileSequenceDescTag = 0x70736571;
+                                                                   /* 'pseq' */
+
+    /**
+     * ICC Profile Tag Signature: 'psd0'.
+     */
+    public static final int icSigPs2CRD0Tag       = 0x70736430;    /* 'psd0' */
+
+    /**
+     * ICC Profile Tag Signature: 'psd1'.
+     */
+    public static final int icSigPs2CRD1Tag       = 0x70736431;    /* 'psd1' */
+
+    /**
+     * ICC Profile Tag Signature: 'psd2'.
+     */
+    public static final int icSigPs2CRD2Tag       = 0x70736432;    /* 'psd2' */
+
+    /**
+     * ICC Profile Tag Signature: 'psd3'.
+     */
+    public static final int icSigPs2CRD3Tag       = 0x70736433;    /* 'psd3' */
+
+    /**
+     * ICC Profile Tag Signature: 'ps2s'.
+     */
+    public static final int icSigPs2CSATag        = 0x70733273;    /* 'ps2s' */
+
+    /**
+     * ICC Profile Tag Signature: 'ps2i'.
+     */
+    public static final int icSigPs2RenderingIntentTag = 0x70733269;
+                                                                   /* 'ps2i' */
+
+    /**
+     * ICC Profile Tag Signature: 'rXYZ'.
+     */
+    public static final int icSigRedColorantTag   = 0x7258595A;    /* 'rXYZ' */
+
+    /**
+     * ICC Profile Tag Signature: 'rXYZ'.
+     * @since 1.5
+     */
+    public static final int icSigRedMatrixColumnTag = 0x7258595A;  /* 'rXYZ' */
+
+    /**
+     * ICC Profile Tag Signature: 'rTRC'.
+     */
+    public static final int icSigRedTRCTag        = 0x72545243;    /* 'rTRC' */
+
+    /**
+     * ICC Profile Tag Signature: 'scrd'.
+     */
+    public static final int icSigScreeningDescTag = 0x73637264;    /* 'scrd' */
+
+    /**
+     * ICC Profile Tag Signature: 'scrn'.
+     */
+    public static final int icSigScreeningTag     = 0x7363726E;    /* 'scrn' */
+
+    /**
+     * ICC Profile Tag Signature: 'tech'.
+     */
+    public static final int icSigTechnologyTag    = 0x74656368;    /* 'tech' */
+
+    /**
+     * ICC Profile Tag Signature: 'bfd '.
+     */
+    public static final int icSigUcrBgTag         = 0x62666420;    /* 'bfd ' */
+
+    /**
+     * ICC Profile Tag Signature: 'vued'.
+     */
+    public static final int icSigViewingCondDescTag = 0x76756564;  /* 'vued' */
+
+    /**
+     * ICC Profile Tag Signature: 'view'.
+     */
+    public static final int icSigViewingConditionsTag = 0x76696577;/* 'view' */
+
+    /**
+     * ICC Profile Tag Signature: 'chrm'.
+     */
+    public static final int icSigChromaticityTag  = 0x6368726d;    /* 'chrm' */
+
+    /**
+     * ICC Profile Tag Signature: 'chad'.
+     * @since 1.5
+     */
+    public static final int icSigChromaticAdaptationTag = 0x63686164;/* 'chad' */
+
+    /**
+     * ICC Profile Tag Signature: 'clro'.
+     * @since 1.5
+     */
+    public static final int icSigColorantOrderTag = 0x636C726F;    /* 'clro' */
+
+    /**
+     * ICC Profile Tag Signature: 'clrt'.
+     * @since 1.5
+     */
+    public static final int icSigColorantTableTag = 0x636C7274;    /* 'clrt' */
+
+
+    /**
+     * ICC Profile Header Location: profile size in bytes.
+     */
+    public static final int icHdrSize         = 0;  /* Profile size in bytes */
+
+    /**
+     * ICC Profile Header Location: CMM for this profile.
+     */
+    public static final int icHdrCmmId        = 4;  /* CMM for this profile */
+
+    /**
+     * ICC Profile Header Location: format version number.
+     */
+    public static final int icHdrVersion      = 8;  /* Format version number */
+
+    /**
+     * ICC Profile Header Location: type of profile.
+     */
+    public static final int icHdrDeviceClass  = 12; /* Type of profile */
+
+    /**
+     * ICC Profile Header Location: color space of data.
+     */
+    public static final int icHdrColorSpace   = 16; /* Color space of data */
+
+    /**
+     * ICC Profile Header Location: PCS - XYZ or Lab only.
+     */
+    public static final int icHdrPcs          = 20; /* PCS - XYZ or Lab only */
+
+    /**
+     * ICC Profile Header Location: date profile was created.
+     */
+    public static final int icHdrDate       = 24; /* Date profile was created */
+
+    /**
+     * ICC Profile Header Location: icMagicNumber.
+     */
+    public static final int icHdrMagic        = 36; /* icMagicNumber */
+
+    /**
+     * ICC Profile Header Location: primary platform.
+     */
+    public static final int icHdrPlatform     = 40; /* Primary Platform */
+
+    /**
+     * ICC Profile Header Location: various bit settings.
+     */
+    public static final int icHdrFlags        = 44; /* Various bit settings */
+
+    /**
+     * ICC Profile Header Location: device manufacturer.
+     */
+    public static final int icHdrManufacturer = 48; /* Device manufacturer */
+
+    /**
+     * ICC Profile Header Location: device model number.
+     */
+    public static final int icHdrModel        = 52; /* Device model number */
+
+    /**
+     * ICC Profile Header Location: device attributes.
+     */
+    public static final int icHdrAttributes   = 56; /* Device attributes */
+
+    /**
+     * ICC Profile Header Location: rendering intent.
+     */
+    public static final int icHdrRenderingIntent = 64; /* Rendering intent */
+
+    /**
+     * ICC Profile Header Location: profile illuminant.
+     */
+    public static final int icHdrIlluminant   = 68; /* Profile illuminant */
+
+    /**
+     * ICC Profile Header Location: profile creator.
+     */
+    public static final int icHdrCreator      = 80; /* Profile creator */
+
+    /**
+     * ICC Profile Header Location: profile's ID.
+     * @since 1.5
+     */
+    public static final int icHdrProfileID = 84; /* Profile's ID */
+
+
+    /**
+     * ICC Profile Constant: tag type signaturE.
+     */
+    public static final int icTagType          = 0;    /* tag type signature */
+
+    /**
+     * ICC Profile Constant: reserved.
+     */
+    public static final int icTagReserved      = 4;    /* reserved */
+
+    /**
+     * ICC Profile Constant: curveType count.
+     */
+    public static final int icCurveCount       = 8;    /* curveType count */
+
+    /**
+     * ICC Profile Constant: curveType data.
+     */
+    public static final int icCurveData        = 12;   /* curveType data */
+
+    /**
+     * ICC Profile Constant: XYZNumber X.
+     */
+    public static final int icXYZNumberX       = 8;    /* XYZNumber X */
+
+
+    /**
+     * Constructs an ICC_Profile object with a given ID.
+     */
+    ICC_Profile(long ID) {
+        this.ID = ID;
+    }
+
+
+    /**
+     * Constructs an ICC_Profile object whose loading will be deferred.
+     * The ID will be 0 until the profile is loaded.
+     */
+    ICC_Profile(ProfileDeferralInfo pdi) {
+        this.deferralInfo = pdi;
+        this.profileActivator = new ProfileActivator() {
+            public void activate() {
+                activateDeferredProfile();
+            }
+        };
+        ProfileDeferralMgr.registerDeferral(this.profileActivator);
+    }
+
+
+    /**
+     * Frees the resources associated with an ICC_Profile object.
+     */
+    protected void finalize () {
+        if (ID != 0) {
+            CMSManager.getModule().freeProfile(ID);
+        } else if (profileActivator != null) {
+            ProfileDeferralMgr.unregisterDeferral(profileActivator);
+        }
+    }
+
+
+    /**
+     * Constructs an ICC_Profile object corresponding to the data in
+     * a byte array.  Throws an IllegalArgumentException if the data
+     * does not correspond to a valid ICC Profile.
+     * @param data the specified ICC Profile data
+     * @return an <code>ICC_Profile</code> object corresponding to
+     *          the data in the specified <code>data</code> array.
+     */
+    public static ICC_Profile getInstance(byte[] data) {
+    ICC_Profile thisProfile;
+
+        long theID;
+
+        if (ProfileDeferralMgr.deferring) {
+            ProfileDeferralMgr.activateProfiles();
+        }
+
+        try {
+            theID = CMSManager.getModule().loadProfile(data);
+        } catch (CMMException c) {
+            throw new IllegalArgumentException("Invalid ICC Profile Data");
+        }
+
+        try {
+            if ((getColorSpaceType (theID) == ColorSpace.TYPE_GRAY) &&
+                (getData (theID, icSigMediaWhitePointTag) != null) &&
+                (getData (theID, icSigGrayTRCTag) != null)) {
+                thisProfile = new ICC_ProfileGray (theID);
+            }
+            else if ((getColorSpaceType (theID) == ColorSpace.TYPE_RGB) &&
+                (getData (theID, icSigMediaWhitePointTag) != null) &&
+                (getData (theID, icSigRedColorantTag) != null) &&
+                (getData (theID, icSigGreenColorantTag) != null) &&
+                (getData (theID, icSigBlueColorantTag) != null) &&
+                (getData (theID, icSigRedTRCTag) != null) &&
+                (getData (theID, icSigGreenTRCTag) != null) &&
+                (getData (theID, icSigBlueTRCTag) != null)) {
+                thisProfile = new ICC_ProfileRGB (theID);
+            }
+            else {
+                thisProfile = new ICC_Profile (theID);
+            }
+        } catch (CMMException c) {
+            thisProfile = new ICC_Profile (theID);
+        }
+        return thisProfile;
+    }
+
+
+
+    /**
+     * Constructs an ICC_Profile corresponding to one of the specific color
+     * spaces defined by the ColorSpace class (for example CS_sRGB).
+     * Throws an IllegalArgumentException if cspace is not one of the
+     * defined color spaces.
+     *
+     * @param cspace the type of color space to create a profile for.
+     * The specified type is one of the color
+     * space constants defined in the  <CODE>ColorSpace</CODE> class.
+     *
+     * @return an <code>ICC_Profile</code> object corresponding to
+     *          the specified <code>ColorSpace</code> type.
+     * @exception IllegalArgumentException If <CODE>cspace</CODE> is not
+     * one of the predefined color space types.
+     */
+    public static ICC_Profile getInstance (int cspace) {
+        ICC_Profile thisProfile = null;
+        String fileName;
+
+        switch (cspace) {
+        case ColorSpace.CS_sRGB:
+            synchronized(ICC_Profile.class) {
+                if (sRGBprofile == null) {
+                    try {
+                        /*
+                         * Deferral is only used for standard profiles.
+                         * Enabling the appropriate access privileges is handled
+                         * at a lower level.
+                         */
+                        sRGBprofile = getDeferredInstance(
+                            new ProfileDeferralInfo("sRGB.pf",
+                                                    ColorSpace.TYPE_RGB,
+                                                    3, CLASS_DISPLAY));
+                    } catch (IOException e) {
+                        throw new IllegalArgumentException(
+                              "Can't load standard profile: sRGB.pf");
+                    }
+                }
+                thisProfile = sRGBprofile;
+            }
+
+            break;
+
+        case ColorSpace.CS_CIEXYZ:
+            synchronized(ICC_Profile.class) {
+                if (XYZprofile == null) {
+                    XYZprofile = getStandardProfile("CIEXYZ.pf");
+                }
+                thisProfile = XYZprofile;
+            }
+
+            break;
+
+        case ColorSpace.CS_PYCC:
+            synchronized(ICC_Profile.class) {
+                if (PYCCprofile == null) {
+                    PYCCprofile = getStandardProfile("PYCC.pf");
+                }
+                thisProfile = PYCCprofile;
+            }
+
+            break;
+
+        case ColorSpace.CS_GRAY:
+            synchronized(ICC_Profile.class) {
+                if (GRAYprofile == null) {
+                    GRAYprofile = getStandardProfile("GRAY.pf");
+                }
+                thisProfile = GRAYprofile;
+            }
+
+            break;
+
+        case ColorSpace.CS_LINEAR_RGB:
+            synchronized(ICC_Profile.class) {
+                if (LINEAR_RGBprofile == null) {
+                    LINEAR_RGBprofile = getStandardProfile("LINEAR_RGB.pf");
+                }
+                thisProfile = LINEAR_RGBprofile;
+            }
+
+            break;
+
+        default:
+            throw new IllegalArgumentException("Unknown color space");
+        }
+
+        return thisProfile;
+    }
+
+    /* This asserts system privileges, so is used only for the
+     * standard profiles.
+     */
+    private static ICC_Profile getStandardProfile(final String name) {
+
+        return (ICC_Profile) AccessController.doPrivileged(
+            new PrivilegedAction() {
+                 public Object run() {
+                     ICC_Profile p = null;
+                     try {
+                         p = getInstance (name);
+                     } catch (IOException ex) {
+                         throw new IllegalArgumentException(
+                               "Can't load standard profile: " + name);
+                     }
+                     return p;
+                 }
+             });
+    }
+
+    /**
+     * Constructs an ICC_Profile corresponding to the data in a file.
+     * fileName may be an absolute or a relative file specification.
+     * Relative file names are looked for in several places: first, relative
+     * to any directories specified by the java.iccprofile.path property;
+     * second, relative to any directories specified by the java.class.path
+     * property; finally, in a directory used to store profiles always
+     * available, such as the profile for sRGB.  Built-in profiles use .pf as
+     * the file name extension for profiles, e.g. sRGB.pf.
+     * This method throws an IOException if the specified file cannot be
+     * opened or if an I/O error occurs while reading the file.  It throws
+     * an IllegalArgumentException if the file does not contain valid ICC
+     * Profile data.
+     * @param fileName The file that contains the data for the profile.
+     *
+     * @return an <code>ICC_Profile</code> object corresponding to
+     *          the data in the specified file.
+     * @exception IOException If the specified file cannot be opened or
+     * an I/O error occurs while reading the file.
+     *
+     * @exception IllegalArgumentException If the file does not
+     * contain valid ICC Profile data.
+     *
+     * @exception SecurityException If a security manager is installed
+     * and it does not permit read access to the given file.
+     */
+    public static ICC_Profile getInstance(String fileName) throws IOException {
+    ICC_Profile thisProfile;
+    FileInputStream fis;
+
+        SecurityManager security = System.getSecurityManager();
+        if (security != null) {
+            security.checkRead(fileName);
+        }
+
+        if ((fis = openProfile(fileName)) == null) {
+            throw new IOException("Cannot open file " + fileName);
+        }
+
+        thisProfile = getInstance(fis);
+
+        fis.close();    /* close the file */
+
+        return thisProfile;
+    }
+
+
+    /**
+     * Constructs an ICC_Profile corresponding to the data in an InputStream.
+     * This method throws an IllegalArgumentException if the stream does not
+     * contain valid ICC Profile data.  It throws an IOException if an I/O
+     * error occurs while reading the stream.
+     * @param s The input stream from which to read the profile data.
+     *
+     * @return an <CODE>ICC_Profile</CODE> object corresponding to the
+     *     data in the specified <code>InputStream</code>.
+     *
+     * @exception IOException If an I/O error occurs while reading the stream.
+     *
+     * @exception IllegalArgumentException If the stream does not
+     * contain valid ICC Profile data.
+     */
+    public static ICC_Profile getInstance(InputStream s) throws IOException {
+    byte profileData[];
+
+        if (s instanceof ProfileDeferralInfo) {
+            /* hack to detect profiles whose loading can be deferred */
+            return getDeferredInstance((ProfileDeferralInfo) s);
+        }
+
+        if ((profileData = getProfileDataFromStream(s)) == null) {
+            throw new IllegalArgumentException("Invalid ICC Profile Data");
+        }
+
+        return getInstance(profileData);
+    }
+
+
+    static byte[] getProfileDataFromStream(InputStream s) throws IOException {
+    byte profileData[];
+    int profileSize;
+
+        byte header[] = new byte[128];
+        int bytestoread = 128;
+        int bytesread = 0;
+        int n;
+
+        while (bytestoread != 0) {
+            if ((n = s.read(header, bytesread, bytestoread)) < 0) {
+                return null;
+            }
+            bytesread += n;
+            bytestoread -= n;
+        }
+        if (header[36] != 0x61 || header[37] != 0x63 ||
+            header[38] != 0x73 || header[39] != 0x70) {
+            return null;   /* not a valid profile */
+        }
+        profileSize = ((header[0] & 0xff) << 24) |
+                      ((header[1] & 0xff) << 16) |
+                      ((header[2] & 0xff) <<  8) |
+                       (header[3] & 0xff);
+        profileData = new byte[profileSize];
+        System.arraycopy(header, 0, profileData, 0, 128);
+        bytestoread = profileSize - 128;
+        bytesread = 128;
+        while (bytestoread != 0) {
+            if ((n = s.read(profileData, bytesread, bytestoread)) < 0) {
+                return null;
+            }
+            bytesread += n;
+            bytestoread -= n;
+        }
+
+        return profileData;
+    }
+
+
+    /**
+     * Constructs an ICC_Profile for which the actual loading of the
+     * profile data from a file and the initialization of the CMM should
+     * be deferred as long as possible.
+     * Deferral is only used for standard profiles.
+     * If deferring is disabled, then getStandardProfile() ensures
+     * that all of the appropriate access privileges are granted
+     * when loading this profile.
+     * If deferring is enabled, then the deferred activation
+     * code will take care of access privileges.
+     * @see activateDeferredProfile()
+     */
+    static ICC_Profile getDeferredInstance(ProfileDeferralInfo pdi)
+        throws IOException {
+
+        if (!ProfileDeferralMgr.deferring) {
+            return getStandardProfile(pdi.filename);
+        }
+        if (pdi.colorSpaceType == ColorSpace.TYPE_RGB) {
+            return new ICC_ProfileRGB(pdi);
+        } else if (pdi.colorSpaceType == ColorSpace.TYPE_GRAY) {
+            return new ICC_ProfileGray(pdi);
+        } else {
+            return new ICC_Profile(pdi);
+        }
+    }
+
+
+    void activateDeferredProfile() {
+    byte profileData[];
+    FileInputStream fis;
+    String fileName = deferralInfo.filename;
+
+        profileActivator = null;
+        deferralInfo = null;
+        if ((fis = openProfile(fileName)) == null) {
+            throw new IllegalArgumentException("Cannot open file " + fileName);
+        }
+        try {
+            profileData = getProfileDataFromStream(fis);
+            fis.close();    /* close the file */
+        }
+        catch (IOException e) {
+            throw new IllegalArgumentException("Invalid ICC Profile Data" +
+                fileName);
+        }
+        if (profileData == null) {
+            throw new IllegalArgumentException("Invalid ICC Profile Data" +
+                fileName);
+        }
+        try {
+            ID = CMSManager.getModule().loadProfile(profileData);
+        } catch (CMMException c) {
+            throw new IllegalArgumentException("Invalid ICC Profile Data" +
+                fileName);
+        }
+    }
+
+
+    /**
+     * Returns profile major version.
+     * @return  The major version of the profile.
+     */
+    public int getMajorVersion() {
+    byte[] theHeader;
+
+        theHeader = getData(icSigHead); /* getData will activate deferred
+                                           profiles if necessary */
+
+        return (int) theHeader[8];
+    }
+
+    /**
+     * Returns profile minor version.
+     * @return The minor version of the profile.
+     */
+    public int getMinorVersion() {
+    byte[] theHeader;
+
+        theHeader = getData(icSigHead); /* getData will activate deferred
+                                           profiles if necessary */
+
+        return (int) theHeader[9];
+    }
+
+    /**
+     * Returns the profile class.
+     * @return One of the predefined profile class constants.
+     */
+    public int getProfileClass() {
+    byte[] theHeader;
+    int theClassSig, theClass;
+
+        if (deferralInfo != null) {
+            return deferralInfo.profileClass; /* Need to have this info for
+                                                 ICC_ColorSpace without
+                                                 causing a deferred profile
+                                                 to be loaded */
+        }
+
+        theHeader = getData(icSigHead);
+
+        theClassSig = intFromBigEndian (theHeader, icHdrDeviceClass);
+
+        switch (theClassSig) {
+        case icSigInputClass:
+            theClass = CLASS_INPUT;
+            break;
+
+        case icSigDisplayClass:
+            theClass = CLASS_DISPLAY;
+            break;
+
+        case icSigOutputClass:
+            theClass = CLASS_OUTPUT;
+            break;
+
+        case icSigLinkClass:
+            theClass = CLASS_DEVICELINK;
+            break;
+
+        case icSigColorSpaceClass:
+            theClass = CLASS_COLORSPACECONVERSION;
+            break;
+
+        case icSigAbstractClass:
+            theClass = CLASS_ABSTRACT;
+            break;
+
+        case icSigNamedColorClass:
+            theClass = CLASS_NAMEDCOLOR;
+            break;
+
+        default:
+            throw new IllegalArgumentException("Unknown profile class");
+        }
+
+        return theClass;
+    }
+
+    /**
+     * Returns the color space type.  Returns one of the color space type
+     * constants defined by the ColorSpace class.  This is the
+     * "input" color space of the profile.  The type defines the
+     * number of components of the color space and the interpretation,
+     * e.g. TYPE_RGB identifies a color space with three components - red,
+     * green, and blue.  It does not define the particular color
+     * characteristics of the space, e.g. the chromaticities of the
+     * primaries.
+     * @return One of the color space type constants defined in the
+     * <CODE>ColorSpace</CODE> class.
+     */
+    public int getColorSpaceType() {
+        if (deferralInfo != null) {
+            return deferralInfo.colorSpaceType; /* Need to have this info for
+                                                   ICC_ColorSpace without
+                                                   causing a deferred profile
+                                                   to be loaded */
+        }
+        return    getColorSpaceType(ID);
+    }
+
+    static int getColorSpaceType(long profileID) {
+    byte[] theHeader;
+    int theColorSpaceSig, theColorSpace;
+
+        theHeader = getData(profileID, icSigHead);
+        theColorSpaceSig = intFromBigEndian(theHeader, icHdrColorSpace);
+        theColorSpace = iccCStoJCS (theColorSpaceSig);
+        return theColorSpace;
+    }
+
+    /**
+     * Returns the color space type of the Profile Connection Space (PCS).
+     * Returns one of the color space type constants defined by the
+     * ColorSpace class.  This is the "output" color space of the
+     * profile.  For an input, display, or output profile useful
+     * for tagging colors or images, this will be either TYPE_XYZ or
+     * TYPE_Lab and should be interpreted as the corresponding specific
+     * color space defined in the ICC specification.  For a device
+     * link profile, this could be any of the color space type constants.
+     * @return One of the color space type constants defined in the
+     * <CODE>ColorSpace</CODE> class.
+     */
+    public int getPCSType() {
+        if (ProfileDeferralMgr.deferring) {
+            ProfileDeferralMgr.activateProfiles();
+        }
+        return getPCSType(ID);
+    }
+
+
+    static int getPCSType(long profileID) {
+    byte[] theHeader;
+    int thePCSSig, thePCS;
+
+        theHeader = getData(profileID, icSigHead);
+        thePCSSig = intFromBigEndian(theHeader, icHdrPcs);
+        thePCS = iccCStoJCS(thePCSSig);
+        return thePCS;
+    }
+
+
+    /**
+     * Write this ICC_Profile to a file.
+     *
+     * @param fileName The file to write the profile data to.
+     *
+     * @exception IOException If the file cannot be opened for writing
+     * or an I/O error occurs while writing to the file.
+     */
+    public void write(String fileName) throws IOException {
+    FileOutputStream outputFile;
+    byte profileData[];
+
+        profileData = getData(); /* this will activate deferred
+                                    profiles if necessary */
+        outputFile = new FileOutputStream(fileName);
+        outputFile.write(profileData);
+        outputFile.close ();
+    }
+
+
+    /**
+     * Write this ICC_Profile to an OutputStream.
+     *
+     * @param s The stream to write the profile data to.
+     *
+     * @exception IOException If an I/O error occurs while writing to the
+     * stream.
+     */
+    public void write(OutputStream s) throws IOException {
+    byte profileData[];
+
+        profileData = getData(); /* this will activate deferred
+                                    profiles if necessary */
+        s.write(profileData);
+    }
+
+
+    /**
+     * Returns a byte array corresponding to the data of this ICC_Profile.
+     * @return A byte array that contains the profile data.
+     * @see #setData(int, byte[])
+     */
+    public byte[] getData() {
+    int profileSize;
+    byte[] profileData;
+
+        if (ProfileDeferralMgr.deferring) {
+            ProfileDeferralMgr.activateProfiles();
+        }
+
+        PCMM mdl = CMSManager.getModule();
+
+        /* get the number of bytes needed for this profile */
+        profileSize = mdl.getProfileSize(ID);
+
+        profileData = new byte [profileSize];
+
+        /* get the data for the profile */
+        mdl.getProfileData(ID, profileData);
+
+        return profileData;
+    }
+
+
+    /**
+     * Returns a particular tagged data element from the profile as
+     * a byte array.  Elements are identified by signatures
+     * as defined in the ICC specification.  The signature
+     * icSigHead can be used to get the header.  This method is useful
+     * for advanced applets or applications which need to access
+     * profile data directly.
+     *
+     * @param tagSignature The ICC tag signature for the data element you
+     * want to get.
+     *
+     * @return A byte array that contains the tagged data element. Returns
+     * <code>null</code> if the specified tag doesn't exist.
+     * @see #setData(int, byte[])
+     */
+    public byte[] getData(int tagSignature) {
+
+        if (ProfileDeferralMgr.deferring) {
+            ProfileDeferralMgr.activateProfiles();
+        }
+
+        return getData(ID, tagSignature);
+    }
+
+
+    static byte[] getData(long profileID, int tagSignature) {
+    int tagSize;
+    byte[] tagData;
+
+        try {
+            PCMM mdl = CMSManager.getModule();
+
+            /* get the number of bytes needed for this tag */
+            tagSize = mdl.getTagSize(profileID, tagSignature);
+
+            tagData = new byte[tagSize]; /* get an array for the tag */
+
+            /* get the tag's data */
+            mdl.getTagData(profileID, tagSignature, tagData);
+        } catch(CMMException c) {
+            tagData = null;
+        }
+
+        return tagData;
+    }
+
+    /**
+     * Sets a particular tagged data element in the profile from
+     * a byte array.  This method is useful
+     * for advanced applets or applications which need to access
+     * profile data directly.
+     *
+     * @param tagSignature The ICC tag signature for the data element
+     * you want to set.
+     * @param tagData the data to set for the specified tag signature
+     * @see #getData
+     */
+    public void setData(int tagSignature, byte[] tagData) {
+
+        if (ProfileDeferralMgr.deferring) {
+            ProfileDeferralMgr.activateProfiles();
+        }
+
+        CMSManager.getModule().setTagData(ID, tagSignature, tagData);
+    }
+
+    /**
+     * Sets the rendering intent of the profile.
+     * This is used to select the proper transform from a profile that
+     * has multiple transforms.
+     */
+    void setRenderingIntent(int renderingIntent) {
+        byte[] theHeader = getData(icSigHead);/* getData will activate deferred
+                                                 profiles if necessary */
+        intToBigEndian (renderingIntent, theHeader, icHdrRenderingIntent);
+                                                 /* set the rendering intent */
+        setData (icSigHead, theHeader);
+    }
+
+
+    /**
+     * Returns the rendering intent of the profile.
+     * This is used to select the proper transform from a profile that
+     * has multiple transforms.  It is typically set in a source profile
+     * to select a transform from an output profile.
+     */
+    int getRenderingIntent() {
+        byte[] theHeader = getData(icSigHead);/* getData will activate deferred
+                                                 profiles if necessary */
+
+        int renderingIntent = intFromBigEndian(theHeader, icHdrRenderingIntent);
+                                                 /* set the rendering intent */
+        return renderingIntent;
+    }
+
+
+    /**
+     * Returns the number of color components in the "input" color
+     * space of this profile.  For example if the color space type
+     * of this profile is TYPE_RGB, then this method will return 3.
+     *
+     * @return The number of color components in the profile's input
+     * color space.
+     *
+     * @throws ProfileDataException if color space is in the profile
+     *         is invalid
+     */
+    public int getNumComponents() {
+    byte[]    theHeader;
+    int    theColorSpaceSig, theNumComponents;
+
+        if (deferralInfo != null) {
+            return deferralInfo.numComponents; /* Need to have this info for
+                                                  ICC_ColorSpace without
+                                                  causing a deferred profile
+                                                  to be loaded */
+        }
+        theHeader = getData(icSigHead);
+
+        theColorSpaceSig = intFromBigEndian (theHeader, icHdrColorSpace);
+
+        switch (theColorSpaceSig) {
+        case icSigGrayData:
+            theNumComponents = 1;
+            break;
+
+        case icSigSpace2CLR:
+            theNumComponents = 2;
+            break;
+
+        case icSigXYZData:
+        case icSigLabData:
+        case icSigLuvData:
+        case icSigYCbCrData:
+        case icSigYxyData:
+        case icSigRgbData:
+        case icSigHsvData:
+        case icSigHlsData:
+        case icSigCmyData:
+        case icSigSpace3CLR:
+            theNumComponents = 3;
+            break;
+
+        case icSigCmykData:
+        case icSigSpace4CLR:
+            theNumComponents = 4;
+            break;
+
+        case icSigSpace5CLR:
+            theNumComponents = 5;
+            break;
+
+        case icSigSpace6CLR:
+            theNumComponents = 6;
+            break;
+
+        case icSigSpace7CLR:
+            theNumComponents = 7;
+            break;
+
+        case icSigSpace8CLR:
+            theNumComponents = 8;
+            break;
+
+        case icSigSpace9CLR:
+            theNumComponents = 9;
+            break;
+
+        case icSigSpaceACLR:
+            theNumComponents = 10;
+            break;
+
+        case icSigSpaceBCLR:
+            theNumComponents = 11;
+            break;
+
+        case icSigSpaceCCLR:
+            theNumComponents = 12;
+            break;
+
+        case icSigSpaceDCLR:
+            theNumComponents = 13;
+            break;
+
+        case icSigSpaceECLR:
+            theNumComponents = 14;
+            break;
+
+        case icSigSpaceFCLR:
+            theNumComponents = 15;
+            break;
+
+        default:
+            throw new ProfileDataException ("invalid ICC color space");
+        }
+
+        return theNumComponents;
+    }
+
+
+    /**
+     * Returns a float array of length 3 containing the X, Y, and Z
+     * components of the mediaWhitePointTag in the ICC profile.
+     */
+    float[] getMediaWhitePoint() {
+        return getXYZTag(icSigMediaWhitePointTag);
+                                           /* get the media white point tag */
+    }
+
+
+    /**
+     * Returns a float array of length 3 containing the X, Y, and Z
+     * components encoded in an XYZType tag.
+     */
+    float[] getXYZTag(int theTagSignature) {
+    byte[] theData;
+    float[] theXYZNumber;
+    int i1, i2, theS15Fixed16;
+
+        theData = getData(theTagSignature); /* get the tag data */
+                                            /* getData will activate deferred
+                                               profiles if necessary */
+
+        theXYZNumber = new float [3];        /* array to return */
+
+        /* convert s15Fixed16Number to float */
+        for (i1 = 0, i2 = icXYZNumberX; i1 < 3; i1++, i2 += 4) {
+            theS15Fixed16 = intFromBigEndian(theData, i2);
+            theXYZNumber [i1] = ((float) theS15Fixed16) / 65536.0f;
+        }
+        return theXYZNumber;
+    }
+
+
+    /**
+     * Returns a gamma value representing a tone reproduction
+     * curve (TRC).  If the profile represents the TRC as a table rather
+     * than a single gamma value, then an exception is thrown.  In this
+     * case the actual table can be obtained via getTRC().
+     * theTagSignature should be one of icSigGrayTRCTag, icSigRedTRCTag,
+     * icSigGreenTRCTag, or icSigBlueTRCTag.
+     * @return the gamma value as a float.
+     * @exception ProfileDataException if the profile does not specify
+     *            the TRC as a single gamma value.
+     */
+    float getGamma(int theTagSignature) {
+    byte[] theTRCData;
+    float theGamma;
+    int theU8Fixed8;
+
+        theTRCData = getData(theTagSignature); /* get the TRC */
+                                               /* getData will activate deferred
+                                                  profiles if necessary */
+
+        if (intFromBigEndian (theTRCData, icCurveCount) != 1) {
+            throw new ProfileDataException ("TRC is not a gamma");
+        }
+
+        /* convert u8Fixed8 to float */
+        theU8Fixed8 = (shortFromBigEndian(theTRCData, icCurveData)) & 0xffff;
+
+        theGamma = ((float) theU8Fixed8) / 256.0f;
+
+        return theGamma;
+    }
+
+
+    /**
+     * Returns the TRC as an array of shorts.  If the profile has
+     * specified the TRC as linear (gamma = 1.0) or as a simple gamma
+     * value, this method throws an exception, and the getGamma() method
+     * should be used to get the gamma value.  Otherwise the short array
+     * returned here represents a lookup table where the input Gray value
+     * is conceptually in the range [0.0, 1.0].  Value 0.0 maps
+     * to array index 0 and value 1.0 maps to array index length-1.
+     * Interpolation may be used to generate output values for
+     * input values which do not map exactly to an index in the
+     * array.  Output values also map linearly to the range [0.0, 1.0].
+     * Value 0.0 is represented by an array value of 0x0000 and
+     * value 1.0 by 0xFFFF, i.e. the values are really unsigned
+     * short values, although they are returned in a short array.
+     * theTagSignature should be one of icSigGrayTRCTag, icSigRedTRCTag,
+     * icSigGreenTRCTag, or icSigBlueTRCTag.
+     * @return a short array representing the TRC.
+     * @exception ProfileDataException if the profile does not specify
+     *            the TRC as a table.
+     */
+    short[] getTRC(int theTagSignature) {
+    byte[] theTRCData;
+    short[] theTRC;
+    int i1, i2, nElements, theU8Fixed8;
+
+        theTRCData = getData(theTagSignature); /* get the TRC */
+                                               /* getData will activate deferred
+                                                  profiles if necessary */
+
+        nElements = intFromBigEndian(theTRCData, icCurveCount);
+
+        if (nElements == 1) {
+            throw new ProfileDataException("TRC is not a table");
+        }
+
+        /* make the short array */
+        theTRC = new short [nElements];
+
+        for (i1 = 0, i2 = icCurveData; i1 < nElements; i1++, i2 += 2) {
+            theTRC[i1] = shortFromBigEndian(theTRCData, i2);
+        }
+
+        return theTRC;
+    }
+
+
+    /* convert an ICC color space signature into a Java color space type */
+    static int iccCStoJCS(int theColorSpaceSig) {
+    int theColorSpace;
+
+        switch (theColorSpaceSig) {
+        case icSigXYZData:
+            theColorSpace = ColorSpace.TYPE_XYZ;
+            break;
+
+        case icSigLabData:
+            theColorSpace = ColorSpace.TYPE_Lab;
+            break;
+
+        case icSigLuvData:
+            theColorSpace = ColorSpace.TYPE_Luv;
+            break;
+
+        case icSigYCbCrData:
+            theColorSpace = ColorSpace.TYPE_YCbCr;
+            break;
+
+        case icSigYxyData:
+            theColorSpace = ColorSpace.TYPE_Yxy;
+            break;
+
+        case icSigRgbData:
+            theColorSpace = ColorSpace.TYPE_RGB;
+            break;
+
+        case icSigGrayData:
+            theColorSpace = ColorSpace.TYPE_GRAY;
+            break;
+
+        case icSigHsvData:
+            theColorSpace = ColorSpace.TYPE_HSV;
+            break;
+
+        case icSigHlsData:
+            theColorSpace = ColorSpace.TYPE_HLS;
+            break;
+
+        case icSigCmykData:
+            theColorSpace = ColorSpace.TYPE_CMYK;
+            break;
+
+        case icSigCmyData:
+            theColorSpace = ColorSpace.TYPE_CMY;
+            break;
+
+        case icSigSpace2CLR:
+            theColorSpace = ColorSpace.TYPE_2CLR;
+            break;
+
+        case icSigSpace3CLR:
+            theColorSpace = ColorSpace.TYPE_3CLR;
+            break;
+
+        case icSigSpace4CLR:
+            theColorSpace = ColorSpace.TYPE_4CLR;
+            break;
+
+        case icSigSpace5CLR:
+            theColorSpace = ColorSpace.TYPE_5CLR;
+            break;
+
+        case icSigSpace6CLR:
+            theColorSpace = ColorSpace.TYPE_6CLR;
+            break;
+
+        case icSigSpace7CLR:
+            theColorSpace = ColorSpace.TYPE_7CLR;
+            break;
+
+        case icSigSpace8CLR:
+            theColorSpace = ColorSpace.TYPE_8CLR;
+            break;
+
+        case icSigSpace9CLR:
+            theColorSpace = ColorSpace.TYPE_9CLR;
+            break;
+
+        case icSigSpaceACLR:
+            theColorSpace = ColorSpace.TYPE_ACLR;
+            break;
+
+        case icSigSpaceBCLR:
+            theColorSpace = ColorSpace.TYPE_BCLR;
+            break;
+
+        case icSigSpaceCCLR:
+            theColorSpace = ColorSpace.TYPE_CCLR;
+            break;
+
+        case icSigSpaceDCLR:
+            theColorSpace = ColorSpace.TYPE_DCLR;
+            break;
+
+        case icSigSpaceECLR:
+            theColorSpace = ColorSpace.TYPE_ECLR;
+            break;
+
+        case icSigSpaceFCLR:
+            theColorSpace = ColorSpace.TYPE_FCLR;
+            break;
+
+        default:
+            throw new IllegalArgumentException ("Unknown color space");
+        }
+
+        return theColorSpace;
+    }
+
+
+    static int intFromBigEndian(byte[] array, int index) {
+        return (((array[index]   & 0xff) << 24) |
+                ((array[index+1] & 0xff) << 16) |
+                ((array[index+2] & 0xff) <<  8) |
+                 (array[index+3] & 0xff));
+    }
+
+
+    static void intToBigEndian(int value, byte[] array, int index) {
+            array[index]   = (byte) (value >> 24);
+            array[index+1] = (byte) (value >> 16);
+            array[index+2] = (byte) (value >>  8);
+            array[index+3] = (byte) (value);
+    }
+
+
+    static short shortFromBigEndian(byte[] array, int index) {
+        return (short) (((array[index]   & 0xff) << 8) |
+                         (array[index+1] & 0xff));
+    }
+
+
+    static void shortToBigEndian(short value, byte[] array, int index) {
+            array[index]   = (byte) (value >> 8);
+            array[index+1] = (byte) (value);
+    }
+
+
+    /*
+     * fileName may be an absolute or a relative file specification.
+     * Relative file names are looked for in several places: first, relative
+     * to any directories specified by the java.iccprofile.path property;
+     * second, relative to any directories specified by the java.class.path
+     * property; finally, in a directory used to store profiles always
+     * available, such as a profile for sRGB.  Built-in profiles use .pf as
+     * the file name extension for profiles, e.g. sRGB.pf.
+     */
+    private static FileInputStream openProfile(final String fileName) {
+        return (FileInputStream)java.security.AccessController.doPrivileged(
+            new java.security.PrivilegedAction() {
+            public Object run() {
+                return privilegedOpenProfile(fileName);
+            }
+        });
+    }
+
+    /*
+     * this version is called from doPrivileged in privilegedOpenProfile.
+     * the whole method is privileged!
+     */
+    private static FileInputStream privilegedOpenProfile(String fileName) {
+        FileInputStream fis = null;
+        String path, dir, fullPath;
+
+        File f = new File(fileName); /* try absolute file name */
+
+        if ((!f.isFile()) &&
+                ((path = System.getProperty("java.iccprofile.path")) != null)){
+                                    /* try relative to java.iccprofile.path */
+                StringTokenizer st =
+                    new StringTokenizer(path, File.pathSeparator);
+                while (st.hasMoreTokens() && (!f.isFile())) {
+                    dir = st.nextToken();
+                        fullPath = dir + File.separatorChar + fileName;
+                    f = new File(fullPath);
+                }
+            }
+
+        if ((!f.isFile()) &&
+                ((path = System.getProperty("java.class.path")) != null)) {
+                                    /* try relative to java.class.path */
+                StringTokenizer st =
+                    new StringTokenizer(path, File.pathSeparator);
+                while (st.hasMoreTokens() && (!f.isFile())) {
+                    dir = st.nextToken();
+                        fullPath = dir + File.separatorChar + fileName;
+                    f = new File(fullPath);
+                }
+            }
+
+        if (!f.isFile()) { /* try the directory of built-in profiles */
+                dir = System.getProperty("java.home") +
+                    File.separatorChar + "lib" + File.separatorChar + "cmm";
+                fullPath = dir + File.separatorChar + fileName;
+                f = new File(fullPath);
+            }
+
+        if (f.isFile()) {
+            try {
+                fis = new FileInputStream(f);
+            } catch (FileNotFoundException e) {
+            }
+        }
+        return fis;
+    }
+
+
+    /*
+     * Serialization support.
+     *
+     * Directly deserialized profiles are useless since they are not
+     * registered with CMM.  We don't allow constructor to be called
+     * directly and instead have clients to call one of getInstance
+     * factory methods that will register the profile with CMM.  For
+     * deserialization we implement readResolve method that will
+     * resolve the bogus deserialized profile object with one obtained
+     * with getInstance as well.
+     *
+     * There're two primary factory methods for construction of ICC
+     * profiles: getInstance(int cspace) and getInstance(byte[] data).
+     * This implementation of ICC_Profile uses the former to return a
+     * cached singleton profile object, other implementations will
+     * likely use this technique too.  To preserve the singleton
+     * pattern across serialization we serialize cached singleton
+     * profiles in such a way that deserializing VM could call
+     * getInstance(int cspace) method that will resolve deserialized
+     * object into the corresponding singleton as well.
+     *
+     * Since the singletons are private to ICC_Profile the readResolve
+     * method have to be `protected' instead of `private' so that
+     * singletons that are instances of subclasses of ICC_Profile
+     * could be correctly deserialized.
+     */
+
+
+    /**
+     * Version of the format of additional serialized data in the
+     * stream.  Version&nbsp;<code>1</code> corresponds to Java&nbsp;2
+     * Platform,&nbsp;v1.3.
+     * @since 1.3
+     * @serial
+     */
+    private int iccProfileSerializedDataVersion = 1;
+
+
+    /**
+     * Writes default serializable fields to the stream.  Writes a
+     * string and an array of bytes to the stream as additional data.
+     *
+     * @param s stream used for serialization.
+     * @throws IOException
+     *     thrown by <code>ObjectInputStream</code>.
+     * @serialData
+     *     The <code>String</code> is the name of one of
+     *     <code>CS_<var>*</var></code> constants defined in the
+     *     {@link ColorSpace} class if the profile object is a profile
+     *     for a predefined color space (for example
+     *     <code>"CS_sRGB"</code>).  The string is <code>null</code>
+     *     otherwise.
+     *     <p>
+     *     The <code>byte[]</code> array is the profile data for the
+     *     profile.  For predefined color spaces <code>null</code> is
+     *     written instead of the profile data.  If in the future
+     *     versions of Java API new predefined color spaces will be
+     *     added, future versions of this class may choose to write
+     *     for new predefined color spaces not only the color space
+     *     name, but the profile data as well so that older versions
+     *     could still deserialize the object.
+     */
+    private void writeObject(ObjectOutputStream s)
+      throws IOException
+    {
+        s.defaultWriteObject();
+
+        String csName = null;
+        if (this == sRGBprofile) {
+            csName = "CS_sRGB";
+        } else if (this == XYZprofile) {
+            csName = "CS_CIEXYZ";
+        } else if (this == PYCCprofile) {
+            csName = "CS_PYCC";
+        } else if (this == GRAYprofile) {
+            csName = "CS_GRAY";
+        } else if (this == LINEAR_RGBprofile) {
+            csName = "CS_LINEAR_RGB";
+        }
+
+        // Future versions may choose to write profile data for new
+        // predefined color spaces as well, if any will be introduced,
+        // so that old versions that don't recognize the new CS name
+        // may fall back to constructing profile from the data.
+        byte[] data = null;
+        if (csName == null) {
+            // getData will activate deferred profile if necessary
+            data = getData();
+        }
+
+        s.writeObject(csName);
+        s.writeObject(data);
+    }
+
+    // Temporary storage used by readObject to store resolved profile
+    // (obtained with getInstance) for readResolve to return.
+    private transient ICC_Profile resolvedDeserializedProfile;
+
+    /**
+     * Reads default serializable fields from the stream.  Reads from
+     * the stream a string and an array of bytes as additional data.
+     *
+     * @param s stream used for deserialization.
+     * @throws IOException
+     *     thrown by <code>ObjectInputStream</code>.
+     * @throws ClassNotFoundException
+     *     thrown by <code>ObjectInputStream</code>.
+     * @serialData
+     *     The <code>String</code> is the name of one of
+     *     <code>CS_<var>*</var></code> constants defined in the
+     *     {@link ColorSpace} class if the profile object is a profile
+     *     for a predefined color space (for example
+     *     <code>"CS_sRGB"</code>).  The string is <code>null</code>
+     *     otherwise.
+     *     <p>
+     *     The <code>byte[]</code> array is the profile data for the
+     *     profile.  It will usually be <code>null</code> for the
+     *     predefined profiles.
+     *     <p>
+     *     If the string is recognized as a constant name for
+     *     predefined color space the object will be resolved into
+     *     profile obtained with
+     *     <code>getInstance(int&nbsp;cspace)</code> and the profile
+     *     data are ignored.  Otherwise the object will be resolved
+     *     into profile obtained with
+     *     <code>getInstance(byte[]&nbsp;data)</code>.
+     * @see #readResolve()
+     * @see #getInstance(int)
+     * @see #getInstance(byte[])
+     */
+    private void readObject(ObjectInputStream s)
+      throws IOException, ClassNotFoundException
+    {
+        s.defaultReadObject();
+
+        String csName = (String)s.readObject();
+        byte[] data = (byte[])s.readObject();
+
+        int cspace = 0;         // ColorSpace.CS_* constant if known
+        boolean isKnownPredefinedCS = false;
+        if (csName != null) {
+            isKnownPredefinedCS = true;
+            if (csName.equals("CS_sRGB")) {
+                cspace = ColorSpace.CS_sRGB;
+            } else if (csName.equals("CS_CIEXYZ")) {
+                cspace = ColorSpace.CS_CIEXYZ;
+            } else if (csName.equals("CS_PYCC")) {
+                cspace = ColorSpace.CS_PYCC;
+            } else if (csName.equals("CS_GRAY")) {
+                cspace = ColorSpace.CS_GRAY;
+            } else if (csName.equals("CS_LINEAR_RGB")) {
+                cspace = ColorSpace.CS_LINEAR_RGB;
+            } else {
+                isKnownPredefinedCS = false;
+            }
+        }
+
+        if (isKnownPredefinedCS) {
+            resolvedDeserializedProfile = getInstance(cspace);
+        } else {
+            resolvedDeserializedProfile = getInstance(data);
+        }
+    }
+
+    /**
+     * Resolves instances being deserialized into instances registered
+     * with CMM.
+     * @return ICC_Profile object for profile registered with CMM.
+     * @throws ObjectStreamException
+     *     never thrown, but mandated by the serialization spec.
+     * @since 1.3
+     */
+    protected Object readResolve() throws ObjectStreamException {
+        return resolvedDeserializedProfile;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/classes/java/awt/color/ICC_ProfileGray.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,150 @@
+/*
+ * Portions Copyright 1997-2007 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) Eastman Kodak Company, 1997                      ***
+ *** As  an unpublished  work pursuant to Title 17 of the United    ***
+ *** States Code.  All rights reserved.                             ***
+ **********************************************************************
+ **********************************************************************
+ **********************************************************************/
+
+package java.awt.color;
+
+import java.awt.image.LookupTable;
+import sun.java2d.cmm.ProfileDeferralInfo;
+
+/**
+ *
+ * A subclass of the ICC_Profile class which represents profiles
+ * which meet the following criteria: the color space type of the
+ * profile is TYPE_GRAY and the profile includes the grayTRCTag and
+ * mediaWhitePointTag tags.  Examples of this kind of profile are
+ * monochrome input profiles, monochrome display profiles, and
+ * monochrome output profiles.  The getInstance methods in the
+ * ICC_Profile class will
+ * return an ICC_ProfileGray object when the above conditions are
+ * met.  The advantage of this class is that it provides a lookup
+ * table that Java or native methods may be able to use directly to
+ * optimize color conversion in some cases.
+ * <p>
+ * To transform from a GRAY device profile color space to the CIEXYZ Profile
+ * Connection Space, the device gray component is transformed by
+ * a lookup through the tone reproduction curve (TRC).  The result is
+ * treated as the achromatic component of the PCS.
+<pre>
+
+&nbsp;               PCSY = grayTRC[deviceGray]
+
+</pre>
+ * The inverse transform is done by converting the PCS Y components to
+ * device Gray via the inverse of the grayTRC.
+ * <p>
+ */
+
+
+
+public class ICC_ProfileGray
+extends ICC_Profile {
+
+    static final long serialVersionUID = -1124721290732002649L;
+
+    /**
+     * Constructs a new ICC_ProfileGray from a CMM ID.
+     */
+    ICC_ProfileGray(long ID) {
+        super(ID);
+    }
+
+    /**
+     * Constructs a new ICC_ProfileGray from a ProfileDeferralInfo object.
+     */
+    ICC_ProfileGray(ProfileDeferralInfo pdi) {
+        super(pdi);
+    }
+
+
+    /**
+     * Returns a float array of length 3 containing the X, Y, and Z
+     * components of the mediaWhitePointTag in the ICC profile.
+     * @return an array containing the components of the
+     * mediaWhitePointTag in the ICC profile.
+     */
+    public float[] getMediaWhitePoint() {
+        return super.getMediaWhitePoint();
+    }
+
+
+    /**
+     * Returns a gamma value representing the tone reproduction
+     * curve (TRC).  If the profile represents the TRC as a table rather
+     * than a single gamma value, then an exception is thrown.  In this
+     * case the actual table can be obtained via getTRC().  When
+     * using a gamma value, the PCS Y component is computed as follows:
+<pre>
+
+&nbsp;                         gamma
+&nbsp;        PCSY = deviceGray
+
+</pre>
+     * @return the gamma value as a float.
+     * @exception ProfileDataException if the profile does not specify
+     *            the TRC as a single gamma value.
+     */
+    public float getGamma() {
+    float theGamma;
+
+        theGamma = super.getGamma(ICC_Profile.icSigGrayTRCTag);
+        return theGamma;
+    }
+
+    /**
+     * Returns the TRC as an array of shorts.  If the profile has
+     * specified the TRC as linear (gamma = 1.0) or as a simple gamma
+     * value, this method throws an exception, and the getGamma() method
+     * should be used to get the gamma value.  Otherwise the short array
+     * returned here represents a lookup table where the input Gray value
+     * is conceptually in the range [0.0, 1.0].  Value 0.0 maps
+     * to array index 0 and value 1.0 maps to array index length-1.
+     * Interpolation may be used to generate output values for
+     * input values which do not map exactly to an index in the
+     * array.  Output values also map linearly to the range [0.0, 1.0].
+     * Value 0.0 is represented by an array value of 0x0000 and
+     * value 1.0 by 0xFFFF, i.e. the values are really unsigned
+     * short values, although they are returned in a short array.
+     * @return a short array representing the TRC.
+     * @exception ProfileDataException if the profile does not specify
+     *            the TRC as a table.
+     */
+    public short[] getTRC() {
+    short[]    theTRC;
+
+        theTRC = super.getTRC(ICC_Profile.icSigGrayTRCTag);
+        return theTRC;
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/classes/java/awt/color/ICC_ProfileRGB.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,282 @@
+/*
+ * Portions Copyright 1997-2007 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) Eastman Kodak Company, 1997                      ***
+ *** As  an unpublished  work pursuant to Title 17 of the United    ***
+ *** States Code.  All rights reserved.                             ***
+ **********************************************************************
+ **********************************************************************
+ **********************************************************************/
+
+package java.awt.color;
+
+import java.awt.image.LookupTable;
+import sun.java2d.cmm.ProfileDeferralInfo;
+
+/**
+ *
+ * The ICC_ProfileRGB class is a subclass of the ICC_Profile class
+ * that represents profiles which meet the following criteria:
+ * <ul>
+ * <li>The profile's color space type is RGB.</li>
+ * <li>The profile includes the <code>redColorantTag</code>,
+ * <code>greenColorantTag</code>, <code>blueColorantTag</code>,
+ * <code>redTRCTag</code>, <code>greenTRCTag</code>,
+ * <code>blueTRCTag</code>, and <code>mediaWhitePointTag</code> tags.</li>
+ * </ul>
+ * The <code>ICC_Profile</code> <code>getInstance</code> method will
+ * return an <code>ICC_ProfileRGB</code> object when these conditions are met.
+ * Three-component, matrix-based input profiles and RGB display profiles are
+ * examples of this type of profile.
+ * <p>
+ * This profile class provides color transform matrices and lookup tables
+ * that Java or native methods can use directly to
+ * optimize color conversion in some cases.
+ * <p>
+ * To transform from a device profile color space to the CIEXYZ Profile
+ * Connection Space, each device color component is first linearized by
+ * a lookup through the corresponding tone reproduction curve (TRC).
+ * The resulting linear RGB components are converted to the CIEXYZ PCS
+ * using a a 3x3 matrix constructed from the RGB colorants.
+ * <pre>
+ *
+ * &nbsp;               linearR = redTRC[deviceR]
+ *
+ * &nbsp;               linearG = greenTRC[deviceG]
+ *
+ * &nbsp;               linearB = blueTRC[deviceB]
+ *
+ * &nbsp; _      _       _                                             _   _         _
+ * &nbsp;[  PCSX  ]     [  redColorantX  greenColorantX  blueColorantX  ] [  linearR  ]
+ * &nbsp;[        ]     [                                               ] [           ]
+ * &nbsp;[  PCSY  ]  =  [  redColorantY  greenColorantY  blueColorantY  ] [  linearG  ]
+ * &nbsp;[        ]     [                                               ] [           ]
+ * &nbsp;[_ PCSZ _]     [_ redColorantZ  greenColorantZ  blueColorantZ _] [_ linearB _]
+ *
+ * </pre>
+ * The inverse transform is performed by converting PCS XYZ components to linear
+ * RGB components through the inverse of the above 3x3 matrix, and then converting
+ * linear RGB to device RGB through inverses of the TRCs.
+ * <p>
+ */
+
+
+
+public class ICC_ProfileRGB
+extends ICC_Profile {
+
+    static final long serialVersionUID = 8505067385152579334L;
+
+    /**
+     * Used to get a gamma value or TRC for the red component.
+     */
+    public static final int REDCOMPONENT = 0;
+
+    /**
+     * Used to get a gamma value or TRC for the green component.
+     */
+    public static final int GREENCOMPONENT = 1;
+
+    /**
+     * Used to get a gamma value or TRC for the blue component.
+     */
+    public static final int BLUECOMPONENT = 2;
+
+
+    /**
+     * Constructs an new <code>ICC_ProfileRGB</code> from a CMM ID.
+     *
+     * @param ID The CMM ID for the profile.
+     *
+     */
+    ICC_ProfileRGB(long ID) {
+        super(ID);
+    }
+
+    /**
+     * Constructs a new <code>ICC_ProfileRGB</code> from a
+     * ProfileDeferralInfo object.
+     *
+     * @param pdi
+     */
+    ICC_ProfileRGB(ProfileDeferralInfo pdi) {
+        super(pdi);
+    }
+
+
+    /**
+     * Returns an array that contains the components of the profile's
+     * <CODE>mediaWhitePointTag</CODE>.
+     *
+     * @return A 3-element <CODE>float</CODE> array containing the x, y,
+     * and z components of the profile's <CODE>mediaWhitePointTag</CODE>.
+     */
+    public float[] getMediaWhitePoint() {
+        return super.getMediaWhitePoint();
+    }
+
+
+    /**
+     * Returns a 3x3 <CODE>float</CODE> matrix constructed from the
+     * X, Y, and Z components of the profile's <CODE>redColorantTag</CODE>,
+     * <CODE>greenColorantTag</CODE>, and <CODE>blueColorantTag</CODE>.
+     * <p>
+     * This matrix can be used for color transforms in the forward
+     * direction of the profile--from the profile color space
+     * to the CIEXYZ PCS.
+     *
+     * @return A 3x3 <CODE>float</CODE> array that contains the x, y, and z
+     * components of the profile's <CODE>redColorantTag</CODE>,
+     * <CODE>greenColorantTag</CODE>, and <CODE>blueColorantTag</CODE>.
+     */
+    public float[][] getMatrix() {
+        float[][] theMatrix = new float[3][3];
+        float[] tmpMatrix;
+
+        tmpMatrix = getXYZTag(ICC_Profile.icSigRedColorantTag);
+        theMatrix[0][0] = tmpMatrix[0];
+        theMatrix[1][0] = tmpMatrix[1];
+        theMatrix[2][0] = tmpMatrix[2];
+        tmpMatrix = getXYZTag(ICC_Profile.icSigGreenColorantTag);
+        theMatrix[0][1] = tmpMatrix[0];
+        theMatrix[1][1] = tmpMatrix[1];
+        theMatrix[2][1] = tmpMatrix[2];
+        tmpMatrix = getXYZTag(ICC_Profile.icSigBlueColorantTag);
+        theMatrix[0][2] = tmpMatrix[0];
+        theMatrix[1][2] = tmpMatrix[1];
+        theMatrix[2][2] = tmpMatrix[2];
+        return theMatrix;
+    }
+
+    /**
+     * Returns a gamma value representing the tone reproduction curve
+     * (TRC) for a particular component.  The component parameter
+     * must be one of REDCOMPONENT, GREENCOMPONENT, or BLUECOMPONENT.
+     * <p>
+     * If the profile
+     * represents the TRC for the corresponding component
+     * as a table rather than a single gamma value, an
+     * exception is thrown.  In this case the actual table
+     * can be obtained through the {@link #getTRC(int)} method.
+     * When using a gamma value,
+     * the linear component (R, G, or B) is computed as follows:
+     * <pre>
+     *
+     * &nbsp;                                         gamma
+     * &nbsp;        linearComponent = deviceComponent
+     *
+     *</pre>
+     * @param component The <CODE>ICC_ProfileRGB</CODE> constant that
+     * represents the component whose TRC you want to retrieve
+     * @return the gamma value as a float.
+     * @exception ProfileDataException if the profile does not specify
+     *            the corresponding TRC as a single gamma value.
+     */
+    public float getGamma(int component) {
+    float theGamma;
+    int theSignature;
+
+        switch (component) {
+        case REDCOMPONENT:
+            theSignature = ICC_Profile.icSigRedTRCTag;
+            break;
+
+        case GREENCOMPONENT:
+            theSignature = ICC_Profile.icSigGreenTRCTag;
+            break;
+
+        case BLUECOMPONENT:
+            theSignature = ICC_Profile.icSigBlueTRCTag;
+            break;
+
+        default:
+            throw new IllegalArgumentException("Must be Red, Green, or Blue");
+        }
+
+        theGamma = super.getGamma(theSignature);
+
+        return theGamma;
+    }
+
+    /**
+     * Returns the TRC for a particular component as an array.
+     * Component must be <code>REDCOMPONENT</code>,
+     * <code>GREENCOMPONENT</code>, or <code>BLUECOMPONENT</code>.
+     * Otherwise the returned array
+     * represents a lookup table where the input component value
+     * is conceptually in the range [0.0, 1.0].  Value 0.0 maps
+     * to array index 0 and value 1.0 maps to array index length-1.
+     * Interpolation might be used to generate output values for
+     * input values that do not map exactly to an index in the
+     * array.  Output values also map linearly to the range [0.0, 1.0].
+     * Value 0.0 is represented by an array value of 0x0000 and
+     * value 1.0 by 0xFFFF.  In other words, the values are really unsigned
+     * <code>short</code> values even though they are returned in a
+     * <code>short</code> array.
+     *
+     * If the profile has specified the corresponding TRC
+     * as linear (gamma = 1.0) or as a simple gamma value, this method
+     * throws an exception.  In this case, the {@link #getGamma(int)}
+     * method should be used to get the gamma value.
+     *
+     * @param component The <CODE>ICC_ProfileRGB</CODE> constant that
+     * represents the component whose TRC you want to retrieve:
+     * <CODE>REDCOMPONENT</CODE>, <CODE>GREENCOMPONENT</CODE>, or
+     * <CODE>BLUECOMPONENT</CODE>.
+     *
+     * @return a short array representing the TRC.
+     * @exception ProfileDataException if the profile does not specify
+     *            the corresponding TRC as a table.
+     */
+    public short[] getTRC(int component) {
+    short[] theTRC;
+    int theSignature;
+
+        switch (component) {
+        case REDCOMPONENT:
+            theSignature = ICC_Profile.icSigRedTRCTag;
+            break;
+
+        case GREENCOMPONENT:
+            theSignature = ICC_Profile.icSigGreenTRCTag;
+            break;
+
+        case BLUECOMPONENT:
+            theSignature = ICC_Profile.icSigBlueTRCTag;
+            break;
+
+        default:
+            throw new IllegalArgumentException("Must be Red, Green, or Blue");
+        }
+
+        theTRC = super.getTRC(theSignature);
+
+        return theTRC;
+    }
+
+}
--- a/jdk/src/share/classes/java/awt/datatransfer/SystemFlavorMap.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/java/awt/datatransfer/SystemFlavorMap.java	Thu Jun 12 13:50:55 2008 -0700
@@ -298,7 +298,7 @@
                     while (continueLine(line)) {
                         String nextLine = in.readLine();
                         if (nextLine == null) {
-                            nextLine = new String("");
+                            nextLine = "";
                         }
                         String loppedLine =
                             line.substring(0, line.length() - 1);
@@ -313,7 +313,7 @@
                         }
                         nextLine = nextLine.substring(startIndex,
                                                       nextLine.length());
-                        line = new String(loppedLine+nextLine);
+                        line = loppedLine+nextLine;
                     }
 
                     // Find start of key
--- a/jdk/src/share/classes/java/awt/dnd/DragGestureEvent.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/java/awt/dnd/DragGestureEvent.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 1998-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1998-2008 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
@@ -55,9 +55,19 @@
  * platform dependent drag initiating gesture has occurred
  * on the <code>Component</code> that it is tracking.
  *
+ * The {@code action} field of any {@code DragGestureEvent} instance should take one of the following
+ * values:
+ * <ul>
+ * <li> {@code DnDConstants.ACTION_COPY}
+ * <li> {@code DnDConstants.ACTION_MOVE}
+ * <li> {@code DnDConstants.ACTION_LINK}
+ * </ul>
+ * Assigning the value different from listed above will cause an unspecified behavior.
+ *
  * @see java.awt.dnd.DragGestureRecognizer
  * @see java.awt.dnd.DragGestureListener
  * @see java.awt.dnd.DragSource
+ * @see java.awt.dnd.DnDConstants
  */
 
 public class DragGestureEvent extends EventObject {
@@ -65,19 +75,25 @@
     private static final long serialVersionUID = 9080172649166731306L;
 
     /**
-     * Constructs a <code>DragGestureEvent</code> given the
-     * <code>DragGestureRecognizer</code> firing this event,
-     * an <code>int</code> representing
-     * the user's preferred action, a <code>Point</code>
-     * indicating the origin of the drag, and a <code>List</code>
-     * of events that comprise the gesture.
+     * Constructs a <code>DragGestureEvent</code> object given by the
+     * <code>DragGestureRecognizer</code> instance firing this event,
+     * an {@code act} parameter representing
+     * the user's preferred action, an {@code ori} parameter
+     * indicating the origin of the drag, and a {@code List} of
+     * events that comprise the gesture({@code evs} parameter).
      * <P>
      * @param dgr The <code>DragGestureRecognizer</code> firing this event
-     * @param act The the user's preferred action
+     * @param act The user's preferred action.
+     *            For information on allowable values, see
+     *            the class description for {@link DragGestureEvent}
      * @param ori The origin of the drag
      * @param evs The <code>List</code> of events that comprise the gesture
      * <P>
-     * @throws IllegalArgumentException if input parameters are {@code null}
+     * @throws IllegalArgumentException if any parameter equals {@code null}
+     * @throws IllegalArgumentException if the act parameter does not comply with
+     *                                  the values given in the class
+     *                                  description for {@link DragGestureEvent}
+     * @see java.awt.dnd.DnDConstants
      */
 
     public DragGestureEvent(DragGestureRecognizer dgr, int act, Point ori,
--- a/jdk/src/share/classes/java/awt/dnd/DropTargetEvent.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/java/awt/dnd/DropTargetEvent.java	Thu Jun 12 13:50:55 2008 -0700
@@ -45,10 +45,13 @@
     private static final long serialVersionUID = 2821229066521922993L;
 
     /**
-     * Construct a <code>DropTargetEvent</code> with
-     * a specified <code>DropTargetContext</code>.
+     * Construct a <code>DropTargetEvent</code> object with
+     * the specified <code>DropTargetContext</code>.
      * <P>
-     * @param dtc the <code>DropTargetContext</code>
+     * @param dtc The <code>DropTargetContext</code>
+     * @throws NullPointerException if {@code dtc} equals {@code null}.
+     * @see #getSource()
+     * @see #getDropTargetContext()
      */
 
     public DropTargetEvent(DropTargetContext dtc) {
--- a/jdk/src/share/classes/java/awt/event/ActionEvent.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/java/awt/event/ActionEvent.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 1996-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1996-2008 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,10 @@
  * is therefore spared the details of processing individual mouse movements
  * and mouse clicks, and can instead process a "meaningful" (semantic)
  * event like "button pressed".
+ * <p>
+ * An unspecified behavior will be caused if the {@code id} parameter
+ * of any particular {@code ActionEvent} instance is not
+ * in the range from {@code ACTION_FIRST} to {@code ACTION_LAST}.
  *
  * @see ActionListener
  * @see <a href="http://java.sun.com/docs/books/tutorial/post1.0/ui/eventmodel.html">Tutorial: Java 1.1 Event Model</a>
@@ -134,18 +138,22 @@
     /**
      * Constructs an <code>ActionEvent</code> object.
      * <p>
-     * Note that passing in an invalid <code>id</code> results in
-     * unspecified behavior. This method throws an
+     * This method throws an
      * <code>IllegalArgumentException</code> if <code>source</code>
      * is <code>null</code>.
      * A <code>null</code> <code>command</code> string is legal,
      * but not recommended.
      *
-     * @param source  the object that originated the event
-     * @param id      an integer that identifies the event
-     * @param command a string that may specify a command (possibly one
+     * @param source  The object that originated the event
+     * @param id      An integer that identifies the event.
+     *                     For information on allowable values, see
+     *                     the class description for {@link ActionEvent}
+     * @param command A string that may specify a command (possibly one
      *                of several) associated with the event
      * @throws IllegalArgumentException if <code>source</code> is null
+     * @see #getSource()
+     * @see #getID()
+     * @see #getActionCommand()
      */
     public ActionEvent(Object source, int id, String command) {
         this(source, id, command, 0);
@@ -154,19 +162,27 @@
     /**
      * Constructs an <code>ActionEvent</code> object with modifier keys.
      * <p>
-     * Note that passing in an invalid <code>id</code> results in
-     * unspecified behavior. This method throws an
+     * This method throws an
      * <code>IllegalArgumentException</code> if <code>source</code>
      * is <code>null</code>.
      * A <code>null</code> <code>command</code> string is legal,
      * but not recommended.
      *
-     * @param source    the object that originated the event
-     * @param id        an integer that identifies the event
-     * @param command   a string that may specify a command (possibly one
-     *                  of several) associated with the event
-     * @param modifiers the modifier keys held down during this action
+     * @param source  The object that originated the event
+     * @param id      An integer that identifies the event.
+     *                     For information on allowable values, see
+     *                     the class description for {@link ActionEvent}
+     * @param command A string that may specify a command (possibly one
+     *                of several) associated with the event
+     * @param modifiers The modifier keys down during event
+     *                  (shift, ctrl, alt, meta).
+     *                  Passing negative parameter is not recommended.
+     *                  Zero value means that no modifiers were passed
      * @throws IllegalArgumentException if <code>source</code> is null
+     * @see #getSource()
+     * @see #getID()
+     * @see #getActionCommand()
+     * @see #getModifiers()
      */
     public ActionEvent(Object source, int id, String command, int modifiers) {
         this(source, id, command, 0, modifiers);
@@ -176,20 +192,31 @@
      * Constructs an <code>ActionEvent</code> object with the specified
      * modifier keys and timestamp.
      * <p>
-     * Note that passing in an invalid <code>id</code> results in
-     * unspecified behavior. This method throws an
+     * This method throws an
      * <code>IllegalArgumentException</code> if <code>source</code>
      * is <code>null</code>.
      * A <code>null</code> <code>command</code> string is legal,
      * but not recommended.
      *
-     * @param source    the object that originated the event
-     * @param id        an integer that identifies the event
-     * @param command   a string that may specify a command (possibly one
-     *                  of several) associated with the event
-     * @param when      the time the event occurred
-     * @param modifiers the modifier keys held down during this action
+     * @param source    The object that originated the event
+     * @param id      An integer that identifies the event.
+     *                     For information on allowable values, see
+     *                     the class description for {@link ActionEvent}
+     * @param command A string that may specify a command (possibly one
+     *                of several) associated with the event
+     * @param modifiers The modifier keys down during event
+     *                  (shift, ctrl, alt, meta).
+     *                  Passing negative parameter is not recommended.
+     *                  Zero value means that no modifiers were passed
+     * @param when   A long that gives the time the event occurred.
+     *               Passing negative or zero value
+     *               is not recommended
      * @throws IllegalArgumentException if <code>source</code> is null
+     * @see #getSource()
+     * @see #getID()
+     * @see #getActionCommand()
+     * @see #getModifiers()
+     * @see #getWhen()
      *
      * @since 1.4
      */
--- a/jdk/src/share/classes/java/awt/event/AdjustmentEvent.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/java/awt/event/AdjustmentEvent.java	Thu Jun 12 13:50:55 2008 -0700
@@ -29,7 +29,25 @@
 import java.awt.AWTEvent;
 
 /**
- * The adjustment event emitted by Adjustable objects.
+ * The adjustment event emitted by Adjustable objects like
+ * {@link java.awt.Scrollbar} and {@link java.awt.ScrollPane}.
+ * When the user changes the value of the scrolling component,
+ * it receives an instance of {@code AdjustmentEvent}.
+ * <p>
+ * An unspecified behavior will be caused if the {@code id} parameter
+ * of any particular {@code AdjustmentEvent} instance is not
+ * in the range from {@code ADJUSTMENT_FIRST} to {@code ADJUSTMENT_LAST}.
+ * <p>
+ * The {@code type} of any {@code AdjustmentEvent} instance takes one of the following
+ * values:
+ *                     <ul>
+ *                     <li> {@code UNIT_INCREMENT}
+ *                     <li> {@code UNIT_DECREMENT}
+ *                     <li> {@code BLOCK_INCREMENT}
+ *                     <li> {@code BLOCK_DECREMENT}
+ *                     <li> {@code TRACK}
+ *                     </ul>
+ * Assigning the value different from listed above will cause an unspecified behavior.
  * @see java.awt.Adjustable
  * @see AdjustmentListener
  *
@@ -130,17 +148,24 @@
      * Constructs an <code>AdjustmentEvent</code> object with the
      * specified <code>Adjustable</code> source, event type,
      * adjustment type, and value.
-     * <p>Note that passing in an invalid <code>id</code> results in
-     * unspecified behavior.  This method throws an
+     * <p> This method throws an
      * <code>IllegalArgumentException</code> if <code>source</code>
      * is <code>null</code>.
      *
-     * @param source the <code>Adjustable</code> object where the
+     * @param source The <code>Adjustable</code> object where the
      *               event originated
-     * @param id     the event type
-     * @param type   the adjustment type
-     * @param value  the current value of the adjustment
+     * @param id     An integer indicating the type of event.
+     *                     For information on allowable values, see
+     *                     the class description for {@link AdjustmentEvent}
+     * @param type   An integer indicating the adjustment type.
+     *                     For information on allowable values, see
+     *                     the class description for {@link AdjustmentEvent}
+     * @param value  The current value of the adjustment
      * @throws IllegalArgumentException if <code>source</code> is null
+     * @see #getSource()
+     * @see #getID()
+     * @see #getAdjustmentType()
+     * @see #getValue()
      */
     public AdjustmentEvent(Adjustable source, int id, int type, int value) {
         this(source, id, type, value, false);
@@ -149,22 +174,29 @@
     /**
      * Constructs an <code>AdjustmentEvent</code> object with the
      * specified Adjustable source, event type, adjustment type, and value.
-     * <p>Note that passing in an invalid <code>id</code> results in
-     * unspecified behavior.  This method throws an
+     * <p> This method throws an
      * <code>IllegalArgumentException</code> if <code>source</code>
      * is <code>null</code>.
-
      *
-     * @param source the <code>Adjustable</code> object where the
+     * @param source The <code>Adjustable</code> object where the
      *               event originated
-     * @param id     the event type
-     * @param type   the adjustment type
-     * @param value  the current value of the adjustment
-     * @param isAdjusting <code>true</code> if the event is one
+     * @param id     An integer indicating the type of event.
+     *                     For information on allowable values, see
+     *                     the class description for {@link AdjustmentEvent}
+     * @param type   An integer indicating the adjustment type.
+     *                     For information on allowable values, see
+     *                     the class description for {@link AdjustmentEvent}
+     * @param value  The current value of the adjustment
+     * @param isAdjusting A boolean that equals <code>true</code> if the event is one
      *               of a series of multiple adjusting events,
      *               otherwise <code>false</code>
      * @throws IllegalArgumentException if <code>source</code> is null
      * @since 1.4
+     * @see #getSource()
+     * @see #getID()
+     * @see #getAdjustmentType()
+     * @see #getValue()
+     * @see #getValueIsAdjusting()
      */
     public AdjustmentEvent(Adjustable source, int id, int type, int value, boolean isAdjusting) {
         super(source, id);
--- a/jdk/src/share/classes/java/awt/event/ComponentEvent.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/java/awt/event/ComponentEvent.java	Thu Jun 12 13:50:55 2008 -0700
@@ -52,6 +52,10 @@
  * (<code>ComponentAdapter</code> objects implement the
  * <code>ComponentListener</code> interface.) Each such listener object
  * gets this <code>ComponentEvent</code> when the event occurs.
+ * <p>
+ * An unspecified behavior will be caused if the {@code id} parameter
+ * of any particular {@code ComponentEvent} instance is not
+ * in the range from {@code COMPONENT_FIRST} to {@code COMPONENT_LAST}.
  *
  * @see ComponentAdapter
  * @see ComponentListener
@@ -99,14 +103,17 @@
 
     /**
      * Constructs a <code>ComponentEvent</code> object.
-     * <p>Note that passing in an invalid <code>id</code> results in
-     * unspecified behavior. This method throws an
+     * <p> This method throws an
      * <code>IllegalArgumentException</code> if <code>source</code>
      * is <code>null</code>.
      *
-     * @param source the <code>Component</code> that originated the event
-     * @param id     an integer indicating the type of event
+     * @param source The <code>Component</code> that originated the event
+     * @param id     An integer indicating the type of event.
+     *                     For information on allowable values, see
+     *                     the class description for {@link ComponentEvent}
      * @throws IllegalArgumentException if <code>source</code> is null
+     * @see #getComponent()
+     * @see #getID()
      */
     public ComponentEvent(Component source, int id) {
         super(source, id);
--- a/jdk/src/share/classes/java/awt/event/ContainerEvent.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/java/awt/event/ContainerEvent.java	Thu Jun 12 13:50:55 2008 -0700
@@ -45,6 +45,10 @@
  * (<code>ContainerAdapter</code> objects implement the
  * <code>ContainerListener</code> interface.) Each such listener object
  * gets this <code>ContainerEvent</code> when the event occurs.
+ * <p>
+ * An unspecified behavior will be caused if the {@code id} parameter
+ * of any particular {@code ContainerEvent} instance is not
+ * in the range from {@code CONTAINER_FIRST} to {@code CONTAINER_LAST}.
  *
  * @see ContainerAdapter
  * @see ContainerListener
@@ -92,16 +96,20 @@
 
     /**
      * Constructs a <code>ContainerEvent</code> object.
-     * <p>Note that passing in an invalid <code>id</code> results in
-     * unspecified behavior. This method throws an
+     * <p> This method throws an
      * <code>IllegalArgumentException</code> if <code>source</code>
      * is <code>null</code>.
      *
-     * @param source the <code>Component</code> object (container)
+     * @param source The <code>Component</code> object (container)
      *               that originated the event
-     * @param id     an integer indicating the type of event
+     * @param id     An integer indicating the type of event.
+     *                     For information on allowable values, see
+     *                     the class description for {@link ContainerEvent}
      * @param child  the component that was added or removed
      * @throws IllegalArgumentException if <code>source</code> is null
+     * @see #getContainer()
+     * @see #getID()
+     * @see #getChild()
      */
     public ContainerEvent(Component source, int id, Component child) {
         super(source, id);
--- a/jdk/src/share/classes/java/awt/event/FocusEvent.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/java/awt/event/FocusEvent.java	Thu Jun 12 13:50:55 2008 -0700
@@ -50,6 +50,10 @@
  * reactivated. Both permanent and temporary focus events are delivered using
  * the FOCUS_GAINED and FOCUS_LOST event ids; the level may be distinguished in
  * the event using the isTemporary() method.
+ * <p>
+ * An unspecified behavior will be caused if the {@code id} parameter
+ * of any particular {@code FocusEvent} instance is not
+ * in the range from {@code FOCUS_FIRST} to {@code FOCUS_LAST}.
  *
  * @see FocusAdapter
  * @see FocusListener
@@ -121,18 +125,23 @@
      * application, with a Java application in a different VM,
      * or with no other <code>Component</code>, then the opposite
      * <code>Component</code> is <code>null</code>.
-     * <p>Note that passing in an invalid <code>id</code> results in
-     * unspecified behavior. This method throws an
+     * <p> This method throws an
      * <code>IllegalArgumentException</code> if <code>source</code>
      * is <code>null</code>.
      *
-     * @param source     the <code>Component</code> that originated the event
-     * @param id         <code>FOCUS_GAINED</code> or <code>FOCUS_LOST</code>
-     * @param temporary  <code>true</code> if the focus change is temporary;
+     * @param source     The <code>Component</code> that originated the event
+     * @param id         An integer indicating the type of event.
+     *                     For information on allowable values, see
+     *                     the class description for {@link FocusEvent}
+     * @param temporary  Equals <code>true</code> if the focus change is temporary;
      *                   <code>false</code> otherwise
-     * @param opposite   the other Component involved in the focus change,
+     * @param opposite   The other Component involved in the focus change,
      *                   or <code>null</code>
-     * @throws IllegalArgumentException if <code>source</code> is null
+     * @throws IllegalArgumentException if <code>source</code> equals {@code null}
+     * @see #getSource()
+     * @see #getID()
+     * @see #isTemporary()
+     * @see #getOppositeComponent()
      * @since 1.4
      */
     public FocusEvent(Component source, int id, boolean temporary,
@@ -145,16 +154,20 @@
     /**
      * Constructs a <code>FocusEvent</code> object and identifies
      * whether or not the change is temporary.
-     * <p>Note that passing in an invalid <code>id</code> results in
-     * unspecified behavior. This method throws an
+     * <p> This method throws an
      * <code>IllegalArgumentException</code> if <code>source</code>
      * is <code>null</code>.
      *
-     * @param source    the <code>Component</code> that originated the event
-     * @param id        an integer indicating the type of event
-     * @param temporary <code>true</code> if the focus change is temporary;
+     * @param source    The <code>Component</code> that originated the event
+     * @param id        An integer indicating the type of event.
+     *                     For information on allowable values, see
+     *                     the class description for {@link FocusEvent}
+     * @param temporary Equals <code>true</code> if the focus change is temporary;
      *                  <code>false</code> otherwise
-     * @throws IllegalArgumentException if <code>source</code> is null
+     * @throws IllegalArgumentException if <code>source</code> equals {@code null}
+     * @see #getSource()
+     * @see #getID()
+     * @see #isTemporary()
      */
     public FocusEvent(Component source, int id, boolean temporary) {
         this(source, id, temporary, null);
@@ -163,14 +176,17 @@
     /**
      * Constructs a <code>FocusEvent</code> object and identifies it
      * as a permanent change in focus.
-     * <p>Note that passing in an invalid <code>id</code> results in
-     * unspecified behavior. This method throws an
+     * <p> This method throws an
      * <code>IllegalArgumentException</code> if <code>source</code>
      * is <code>null</code>.
      *
-     * @param source    the <code>Component</code> that originated the event
-     * @param id        an integer indicating the type of event
-     * @throws IllegalArgumentException if <code>source</code> is null
+     * @param source    The <code>Component</code> that originated the event
+     * @param id        An integer indicating the type of event.
+     *                     For information on allowable values, see
+     *                     the class description for {@link FocusEvent}
+     * @throws IllegalArgumentException if <code>source</code> equals {@code null}
+     * @see #getSource()
+     * @see #getID()
      */
     public FocusEvent(Component source, int id) {
         this(source, id, false);
--- a/jdk/src/share/classes/java/awt/event/HierarchyEvent.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/java/awt/event/HierarchyEvent.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 1999-2004 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1999-2008 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
@@ -31,7 +31,7 @@
 
 /**
  * An event which indicates a change to the <code>Component</code>
- * hierarchy to which a <code>Component</code> belongs.
+ * hierarchy to which <code>Component</code> belongs.
  * <ul>
  * <li>Hierarchy Change Events (HierarchyListener)
  *     <ul>
@@ -58,16 +58,30 @@
  * Container is added, removed, moved, or resized, and passed down the
  * hierarchy. It is also generated by a Component object when that object's
  * <code>addNotify</code>, <code>removeNotify</code>, <code>show</code>, or
- * <code>hide</code> method is called. ANCESTOR_MOVED and ANCESTOR_RESIZED
+ * <code>hide</code> method is called. The {@code ANCESTOR_MOVED} and
+ * {@code ANCESTOR_RESIZED}
  * events are dispatched to every <code>HierarchyBoundsListener</code> or
  * <code>HierarchyBoundsAdapter</code> object which registered to receive
  * such events using the Component's <code>addHierarchyBoundsListener</code>
  * method. (<code>HierarchyBoundsAdapter</code> objects implement the <code>
- * HierarchyBoundsListener</code> interface.) HIERARCHY_CHANGED events are
+ * HierarchyBoundsListener</code> interface.) The {@code HIERARCHY_CHANGED} events are
  * dispatched to every <code>HierarchyListener</code> object which registered
  * to receive such events using the Component's <code>addHierarchyListener
  * </code> method. Each such listener object gets this <code>HierarchyEvent
  * </code> when the event occurs.
+ * <p>
+ * An unspecified behavior will be caused if the {@code id} parameter
+ * of any particular {@code HierarchyEvent} instance is not
+ * in the range from {@code HIERARCHY_FIRST} to {@code HIERARCHY_LAST}.
+ * <br>
+ * The {@code changeFlags} parameter of any {@code HierarchyEvent} instance takes one of the following
+ * values:
+ * <ul>
+ * <li> {@code HierarchyEvent.PARENT_CHANGED}
+ * <li> {@code HierarchyEvent.DISPLAYABILITY_CHANGED}
+ * <li> {@code HierarchyEvent.SHOWING_CHANGED}
+ * </ul>
+ * Assigning the value different from listed above will cause unspecified behavior.
  *
  * @author      David Mendenhall
  * @see         HierarchyListener
@@ -108,20 +122,20 @@
     public static final int HIERARCHY_LAST = ANCESTOR_RESIZED;
 
     /**
-     * Indicates that the <code>HIERARCHY_CHANGED</code> event
+     * A change flag indicates that the <code>HIERARCHY_CHANGED</code> event
      * was generated by a reparenting operation.
      */
     public static final int PARENT_CHANGED = 0x1;
 
     /**
-     * Indicates that the <code>HIERARCHY_CHANGED</code> event
-     * was generated due to a change in the displayability
-     * of the hierarchy.  To discern the
-     * current displayability of the hierarchy, call
-     * <code>Component.isDisplayable</code>. Displayability changes occur
-     * in response to explicit or implicit calls to
+     * A change flag indicates that the <code>HIERARCHY_CHANGED</code> event
+     * was generated due to the changing of the hierarchy displayability.
+     * To discern the
+     * current displayability of the hierarchy, call the
+     * <code>Component.isDisplayable</code> method. Displayability changes occur
+     * in response to explicit or implicit calls of the
      * <code>Component.addNotify</code> and
-     * <code>Component.removeNotify</code>.
+     * <code>Component.removeNotify</code> methods.
      *
      * @see java.awt.Component#isDisplayable()
      * @see java.awt.Component#addNotify()
@@ -130,15 +144,15 @@
     public static final int DISPLAYABILITY_CHANGED = 0x2;
 
     /**
-     * Indicates that the <code>HIERARCHY_CHANGED</code> event
-     * was generated due to a change in the showing state
-     * of the hierarchy. To discern the
-     * current showing state of the hierarchy, call
-     * <code>Component.isShowing</code>. Showing state changes occur
+     * A change flag indicates that the <code>HIERARCHY_CHANGED</code> event
+     * was generated due to the changing of the hierarchy showing state.
+     * To discern the
+     * current showing state of the hierarchy, call the
+     * <code>Component.isShowing</code> method. Showing state changes occur
      * when either the displayability or visibility of the
      * hierarchy occurs. Visibility changes occur in response to explicit
-     * or implicit calls to <code>Component.show</code> and
-     * <code>Component.hide</code>.
+     * or implicit calls of the <code>Component.show</code> and
+     * <code>Component.hide</code> methods.
      *
      * @see java.awt.Component#isShowing()
      * @see java.awt.Component#addNotify()
@@ -155,20 +169,26 @@
     /**
      * Constructs an <code>HierarchyEvent</code> object to identify a
      * change in the <code>Component</code> hierarchy.
-     * <p>Note that passing in an invalid <code>id</code> results in
-     * unspecified behavior. This method throws an
+     * <p>This method throws an
      * <code>IllegalArgumentException</code> if <code>source</code>
      * is <code>null</code>.
      *
-     * @param source          the <code>Component</code> object that
+     * @param source          The <code>Component</code> object that
      *                        originated the event
-     * @param id              an integer indicating the type of event
-     * @param changed         the <code>Component</code> at the top of
+     * @param id              An integer indicating the type of event.
+     *                        For information on allowable values, see
+     *                        the class description for {@link HierarchyEvent}
+     * @param changed         The <code>Component</code> at the top of
      *                        the hierarchy which was changed
-     * @param changedParent   the parent of <code>changed</code>; this
+     * @param changedParent   The parent of the <code>changed</code> component.
+     *                        This
      *                        may be the parent before or after the
      *                        change, depending on the type of change
-     * @throws IllegalArgumentException if <code>source</code> is null
+     * @throws IllegalArgumentException if <code>source</code> is {@code null}
+     * @see #getSource()
+     * @see #getID()
+     * @see #getChanged()
+     * @see #getChangedParent()
      */
     public HierarchyEvent(Component source, int id, Component changed,
                           Container changedParent) {
@@ -180,23 +200,32 @@
     /**
      * Constructs an <code>HierarchyEvent</code> object to identify
      * a change in the <code>Component</code> hierarchy.
-     * <p>Note that passing in an invalid <code>id</code> results in
-     * unspecified behavior. This method throws an
+     * <p> This method throws an
      * <code>IllegalArgumentException</code> if <code>source</code>
      * is <code>null</code>.
      *
-     * @param source          the <code>Component</code> object that
+     * @param source          The <code>Component</code> object that
      *                        originated the event
-     * @param id              an integer indicating the type of event
-     * @param changed         the <code>Component</code> at the top
+     * @param id              An integer indicating the type of event.
+     *                        For information on allowable values, see
+     *                        the class description for {@link HierarchyEvent}
+     * @param changed         The <code>Component</code> at the top
      *                        of the hierarchy which was changed
-     * @param changedParent   the parent of <code>changed</code>; this
+     * @param changedParent   The parent of the <code>changed</code> component.
+     *                        This
      *                        may be the parent before or after the
      *                        change, depending on the type of change
-     * @param changeFlags     a bitmask which indicates the type(s) of
-     *                        <code>HIERARCHY_CHANGED</code> events
-     *                        represented in this event object
+     * @param changeFlags     A bitmask which indicates the type(s) of
+     *                        the <code>HIERARCHY_CHANGED</code> events
+     *                        represented in this event object.
+     *                        For information on allowable values, see
+     *                        the class description for {@link HierarchyEvent}
      * @throws IllegalArgumentException if <code>source</code> is null
+     * @see #getSource()
+     * @see #getID()
+     * @see #getChanged()
+     * @see #getChangedParent()
+     * @see #getChangeFlags()
      */
     public HierarchyEvent(Component source, int id, Component changed,
                           Container changedParent, long changeFlags) {
--- a/jdk/src/share/classes/java/awt/event/InputEvent.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/java/awt/event/InputEvent.java	Thu Jun 12 13:50:55 2008 -0700
@@ -208,17 +208,32 @@
     /**
      * Constructs an InputEvent object with the specified source component,
      * modifiers, and type.
-     * <p>Note that passing in an invalid <code>id</code> results in
-     * unspecified behavior. This method throws an
+     * <p> This method throws an
      * <code>IllegalArgumentException</code> if <code>source</code>
      * is <code>null</code>.
      *
      * @param source the object where the event originated
-     * @param id the event type
-     * @param when the time the event occurred
-     * @param modifiers represents the modifier keys and mouse buttons down
-     *                  while the event occurred
+     * @param id           the integer that identifies the event type.
+     *                     It is allowed to pass as parameter any value that
+     *                     allowed for some subclass of {@code InputEvent} class.
+     *                     Passing in the value different from those values result
+     *                     in unspecified behavior
+     * @param when         a long int that gives the time the event occurred.
+     *                     Passing negative or zero value
+     *                     is not recommended
+     * @param modifiers    the modifier keys down during event (e.g. shift, ctrl,
+     *                     alt, meta)
+     *                     Passing negative parameter is not recommended.
+     *                     Zero value means no modifiers.
+     *                     Either extended _DOWN_MASK or old _MASK modifiers
+     *                     should be used, but both models should not be mixed
+     *                     in one event. Use of the extended modifiers is
+     *                     preferred
      * @throws IllegalArgumentException if <code>source</code> is null
+     * @see #getSource()
+     * @see #getID()
+     * @see #getWhen()
+     * @see #getModifiers()
      */
     InputEvent(Component source, int id, long when, int modifiers) {
         super(source, id);
@@ -285,7 +300,8 @@
     }
 
     /**
-     * Returns the timestamp of when this event occurred.
+     * Returns the difference in milliseconds between the timestamp of when this event occurred and
+     * midnight, January 1, 1970 UTC.
      */
     public long getWhen() {
         return when;
@@ -358,7 +374,12 @@
      * Returns a String describing the extended modifier keys and
      * mouse buttons, such as "Shift", "Button1", or "Ctrl+Shift".
      * These strings can be localized by changing the
-     * awt.properties file.
+     * <code>awt.properties</code> file.
+     * <p>
+     * Note that passing negative parameter is incorrect,
+     * and will cause the returning an unspecified string.
+     * Zero parameter means that no modifiers were passed and will
+     * cause the returning an empty string.
      *
      * @param modifiers a modifier mask describing the extended
        *                modifier keys and mouse buttons for the event
--- a/jdk/src/share/classes/java/awt/event/InvocationEvent.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/java/awt/event/InvocationEvent.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 1998-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1998-2008 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
@@ -39,6 +39,10 @@
  * can use this fact to write replacement functions for <code>invokeLater
  * </code> and <code>invokeAndWait</code> without writing special-case code
  * in any <code>AWTEventListener</code> objects.
+ * <p>
+ * An unspecified behavior will be caused if the {@code id} parameter
+ * of any particular {@code InvocationEvent} instance is not
+ * in the range from {@code INVOCATION_FIRST} to {@code INVOCATION_LAST}.
  *
  * @author      Fred Ecks
  * @author      David Mendenhall
@@ -123,12 +127,13 @@
      * <p> This method throws an <code>IllegalArgumentException</code>
      * if <code>source</code> is <code>null</code>.
      *
-     * @param source    the <code>Object</code> that originated the event
-     * @param runnable  the <code>Runnable</code> whose <code>run</code>
+     * @param source    The <code>Object</code> that originated the event
+     * @param runnable  The <code>Runnable</code> whose <code>run</code>
      *                  method will be executed
      * @throws IllegalArgumentException if <code>source</code> is null
      *
-     * @see     #InvocationEvent(Object, Runnable, Object, boolean)
+     * @see #getSource()
+     * @see #InvocationEvent(Object, Runnable, Object, boolean)
      */
     public InvocationEvent(Object source, Runnable runnable) {
         this(source, runnable, null, false);
@@ -147,15 +152,15 @@
      * <p>This method throws an <code>IllegalArgumentException</code>
      * if <code>source</code> is <code>null</code>.
      *
-     * @param source            the <code>Object</code> that originated
+     * @param source            The <code>Object</code> that originated
      *                          the event
-     * @param runnable          the <code>Runnable</code> whose
+     * @param runnable          The <code>Runnable</code> whose
      *                          <code>run</code> method will be
      *                          executed
-     * @param notifier          the Object whose <code>notifyAll</code>
+     * @param notifier          The {@code Object} whose <code>notifyAll</code>
      *                          method will be called after
      *                          <code>Runnable.run</code> has returned
-     * @param catchThrowables   specifies whether <code>dispatch</code>
+     * @param catchThrowables   Specifies whether <code>dispatch</code>
      *                          should catch Throwable when executing
      *                          the <code>Runnable</code>'s <code>run</code>
      *                          method, or should instead propagate those
@@ -163,6 +168,7 @@
      *                          dispatch loop
      * @throws IllegalArgumentException if <code>source</code> is null
      *
+     * @see #getSource()
      * @see     #InvocationEvent(Object, int, Runnable, Object, boolean)
      */
     public InvocationEvent(Object source, Runnable runnable, Object notifier,
@@ -176,26 +182,29 @@
      * method when dispatched.  If notifier is non-<code>null</code>,
      * <code>notifyAll</code> will be called on it
      * immediately after <code>run</code> returns.
-     * <p>Note that passing in an invalid <code>id</code> results in
-     * unspecified behavior. This method throws an
+     * <p>This method throws an
      * <code>IllegalArgumentException</code> if <code>source</code>
      * is <code>null</code>.
      *
-     * @param source            the <code>Object</code> that originated
+     * @param source            The <code>Object</code> that originated
      *                          the event
-     * @param id                the ID for the event
-     * @param runnable          the <code>Runnable</code> whose
+     * @param id     An integer indicating the type of event.
+     *                     For information on allowable values, see
+     *                     the class description for {@link InvocationEvent}
+     * @param runnable          The <code>Runnable</code> whose
      *                          <code>run</code> method will be executed
-     * @param notifier          the <code>Object</code> whose <code>notifyAll</code>
+     * @param notifier          The <code>Object</code> whose <code>notifyAll</code>
      *                          method will be called after
      *                          <code>Runnable.run</code> has returned
-     * @param catchThrowables   specifies whether <code>dispatch</code>
+     * @param catchThrowables   Specifies whether <code>dispatch</code>
      *                          should catch Throwable when executing the
      *                          <code>Runnable</code>'s <code>run</code>
      *                          method, or should instead propagate those
      *                          Throwables to the EventDispatchThread's
      *                          dispatch loop
      * @throws IllegalArgumentException if <code>source</code> is null
+     * @see #getSource()
+     * @see #getID()
      */
     protected InvocationEvent(Object source, int id, Runnable runnable,
                               Object notifier, boolean catchThrowables) {
--- a/jdk/src/share/classes/java/awt/event/ItemEvent.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/java/awt/event/ItemEvent.java	Thu Jun 12 13:50:55 2008 -0700
@@ -41,6 +41,18 @@
  * spared the details of processing individual mouse movements and mouse
  * clicks, and can instead process a "meaningful" (semantic) event like
  * "item selected" or "item deselected".
+ * <p>
+ * An unspecified behavior will be caused if the {@code id} parameter
+ * of any particular {@code ItemEvent} instance is not
+ * in the range from {@code ITEM_FIRST} to {@code ITEM_LAST}.
+ * <p>
+ * The {@code stateChange} of any {@code ItemEvent} instance takes one of the following
+ * values:
+ *                     <ul>
+ *                     <li> {@code ItemEvent.SELECTED}
+ *                     <li> {@code ItemEvent.DESELECTED}
+ *                     </ul>
+ * Assigning the value different from listed above will cause an unspecified behavior.
  *
  * @author Carl Quinn
  *
@@ -101,19 +113,24 @@
 
     /**
      * Constructs an <code>ItemEvent</code> object.
-     * <p>Note that passing in an invalid <code>id</code> results in
-     * unspecified behavior. This method throws an
+     * <p> This method throws an
      * <code>IllegalArgumentException</code> if <code>source</code>
      * is <code>null</code>.
      *
-     * @param source the <code>ItemSelectable</code> object
+     * @param source The <code>ItemSelectable</code> object
      *               that originated the event
-     * @param id     an integer that identifies the event type
-     * @param item   an object -- the item affected by the event
-     * @param stateChange
-     *               an integer that indicates whether the item was
-     *               selected or deselected
+     * @param id           The integer that identifies the event type.
+     *                     For information on allowable values, see
+     *                     the class description for {@link ItemEvent}
+     * @param item   An object -- the item affected by the event
+     * @param stateChange  An integer that indicates whether the item was
+     *               selected or deselected.
+     *                     For information on allowable values, see
+     *                     the class description for {@link ItemEvent}
      * @throws IllegalArgumentException if <code>source</code> is null
+     * @see #getItemSelectable()
+     * @see #getID()
+     * @see #getStateChange()
      */
     public ItemEvent(ItemSelectable source, int id, Object item, int stateChange) {
         super(source, id);
--- a/jdk/src/share/classes/java/awt/event/KeyEvent.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/java/awt/event/KeyEvent.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 1996-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1996-2008 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
@@ -128,6 +128,10 @@
  * (VK_ENTER, VK_BACK_SPACE, and VK_TAB), do not rely on the values of the VK_
  * constants.  Sun reserves the right to change these values as needed
  * to accomodate a wider range of keyboards in the future.
+ * <p>
+ * An unspecified behavior will be caused if the {@code id} parameter
+ * of any particular {@code KeyEvent} instance is not
+ * in the range from {@code KEY_FIRST} to {@code KEY_LAST}.
  *
  * @author Carl Quinn
  * @author Amy Fowler
@@ -914,27 +918,32 @@
 
     /**
      * Constructs a <code>KeyEvent</code> object.
-     * <p>Note that passing in an invalid <code>id</code> results in
-     * unspecified behavior. This method throws an
+     * <p>This method throws an
      * <code>IllegalArgumentException</code> if <code>source</code>
      * is <code>null</code>.
      *
-     * @param source    the <code>Component</code> that originated the event
-     * @param id        an integer identifying the type of event
-     * @param when      a long integer that specifies the time the event
-     *                  occurred
-     * @param modifiers the modifier keys down during event (shift, ctrl,
-     *                  alt, meta)
-     *                  Either extended _DOWN_MASK or old _MASK modifiers
-     *                  should be used, but both models should not be mixed
-     *                  in one event. Use of the extended modifiers is
-     *                  preferred.
-     * @param keyCode   the integer code for an actual key, or VK_UNDEFINED
+     * @param source    The <code>Component</code> that originated the event
+     * @param id              An integer indicating the type of event.
+     *                  For information on allowable values, see
+     *                  the class description for {@link KeyEvent}
+     * @param when      A long integer that specifies the time the event
+     *                  occurred.
+     *                     Passing negative or zero value
+     *                     is not recommended
+     * @param modifiers The modifier keys down during event (shift, ctrl,
+     *                  alt, meta).
+     *                     Passing negative value
+     *                     is not recommended.
+     *                     Zero value means that no modifiers were passed.
+     *                  Use either an extended _DOWN_MASK or old _MASK modifiers,
+     *                  however do not mix models in the one event.
+     *                  The extended modifiers are preferred for using
+     * @param keyCode   The integer code for an actual key, or VK_UNDEFINED
      *                  (for a key-typed event)
-     * @param keyChar   the Unicode character generated by this event, or
+     * @param keyChar   The Unicode character generated by this event, or
      *                  CHAR_UNDEFINED (for key-pressed and key-released
      *                  events which do not map to a valid Unicode character)
-     * @param keyLocation  identifies the key location.  The only legal
+     * @param keyLocation  Identifies the key location.  The only legal
      *        values are <code>KEY_LOCATION_UNKNOWN</code>,
      *        <code>KEY_LOCATION_STANDARD</code>, <code>KEY_LOCATION_LEFT</code>,
      *        <code>KEY_LOCATION_RIGHT</code>, and <code>KEY_LOCATION_NUMPAD</code>.
@@ -948,6 +957,13 @@
      *     or if <code>keyLocation</code> is not one of the legal
      *       values enumerated above.
      * @throws IllegalArgumentException if <code>source</code> is null
+     * @see #getSource()
+     * @see #getID()
+     * @see #getWhen()
+     * @see #getModifiers()
+     * @see #getKeyCode()
+     * @see #getKeyChar()
+     * @see #getKeyLocation()
      * @since 1.4
      */
     public KeyEvent(Component source, int id, long when, int modifiers,
@@ -982,24 +998,29 @@
 
     /**
      * Constructs a <code>KeyEvent</code> object.
-     * <p>Note that passing in an invalid <code>id</code> results in
-     * unspecified behavior. This method throws an
+     * <p> This method throws an
      * <code>IllegalArgumentException</code> if <code>source</code>
      * is <code>null</code>.
      *
-     * @param source    the <code>Component</code> that originated the event
-     * @param id        an integer identifying the type of event
-     * @param when      a long integer that specifies the time the event
-     *                  occurred
-     * @param modifiers the modifier keys down during event (shift, ctrl,
-     *                  alt, meta)
-     *                  Either extended _DOWN_MASK or old _MASK modifiers
-     *                  should be used, but both models should not be mixed
-     *                  in one event. Use of the extended modifiers is
-     *                  preferred.
-     * @param keyCode   the integer code for an actual key, or VK_UNDEFINED
+     * @param source    The <code>Component</code> that originated the event
+     * @param id              An integer indicating the type of event.
+     *                  For information on allowable values, see
+     *                  the class description for {@link KeyEvent}
+     * @param when      A long integer that specifies the time the event
+     *                  occurred.
+     *                     Passing negative or zero value
+     *                     is not recommended
+     * @param modifiers The modifier keys down during event (shift, ctrl,
+     *                  alt, meta).
+     *                     Passing negative value
+     *                     is not recommended.
+     *                     Zero value means that no modifiers were passed.
+     *                  Use either an extended _DOWN_MASK or old _MASK modifiers,
+     *                  however do not mix models in the one event.
+     *                  The extended modifiers are preferred for using
+     * @param keyCode   The integer code for an actual key, or VK_UNDEFINED
      *                  (for a key-typed event)
-     * @param keyChar   the Unicode character generated by this event, or
+     * @param keyChar   The Unicode character generated by this event, or
      *                  CHAR_UNDEFINED (for key-pressed and key-released
      *                  events which do not map to a valid Unicode character)
      * @throws IllegalArgumentException  if <code>id</code> is
@@ -1008,6 +1029,12 @@
      *     <code>KEY_TYPED</code> and <code>keyCode</code> is not
      *     <code>VK_UNDEFINED</code>
      * @throws IllegalArgumentException if <code>source</code> is null
+     * @see #getSource()
+     * @see #getID()
+     * @see #getWhen()
+     * @see #getModifiers()
+     * @see #getKeyCode()
+     * @see #getKeyChar()
      */
     public KeyEvent(Component source, int id, long when, int modifiers,
                     int keyCode, char keyChar) {
--- a/jdk/src/share/classes/java/awt/event/MouseEvent.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/java/awt/event/MouseEvent.java	Thu Jun 12 13:50:55 2008 -0700
@@ -159,6 +159,11 @@
  * The reported coordinates for mouse drag events are clipped to fit within the
  * bounds of the virtual device associated with the <code>Component</code>.
  * </ul>
+ * <p>
+ * An unspecified behavior will be caused if the {@code id} parameter
+ * of any particular {@code MouseEvent} instance is not
+ * in the range from {@code MOUSE_FIRST} to {@code MOUSE_LAST}-1
+ * ({@code MOUSE_WHEEL} is not acceptable).
  *
  * @author Carl Quinn
  *
@@ -418,8 +423,7 @@
      * specified source component,
      * type, modifiers, coordinates, and click count.
      * <p>
-     * Note that passing in an invalid <code>id</code> results in
-     * unspecified behavior.  Creating an invalid event (such
+     * Creating an invalid event (such
      * as by using more than one of the old _MASKs, or modifier/button
      * values which don't match) results in unspecified behavior.
      * An invocation of the form
@@ -435,28 +439,44 @@
      * <code>IllegalArgumentException</code> if <code>source</code>
      * is <code>null</code>.
      *
-     * @param source       the <code>Component</code> that originated the event
-     * @param id           the integer that identifies the event
-     * @param when         a long int that gives the time the event occurred
-     * @param modifiers    the modifier keys down during event (e.g. shift, ctrl,
+     * @param source       The <code>Component</code> that originated the event
+     * @param id              An integer indicating the type of event.
+     *                     For information on allowable values, see
+     *                     the class description for {@link MouseEvent}
+     * @param when         A long integer that gives the time the event occurred.
+     *                     Passing negative or zero value
+     *                     is not recommended
+     * @param modifiers    The modifier keys down during event (e.g. shift, ctrl,
      *                     alt, meta)
-     *                     Either extended _DOWN_MASK or old _MASK modifiers
-     *                     should be used, but both models should not be mixed
-     *                     in one event. Use of the extended modifiers is
-     *                     preferred.
-     * @param x            the horizontal x coordinate for the mouse location
-     * @param y            the vertical y coordinate for the mouse location
-     * @param clickCount   the number of mouse clicks associated with event
-     * @param popupTrigger a boolean, true if this event is a trigger for a
-     *                     popup menu
-     * @param button       which of the mouse buttons has changed state.
-     *                      <code>NOBUTTON</code>,
-     *                      <code>BUTTON1</code>,
-     *                      <code>BUTTON2</code> or
-     *                      <code>BUTTON3</code>.
+     *                     Passing negative parameter
+     *                     is not recommended.
+     *                     Zero value means that no modifiers were passed.
+     *                     Use either an extended _DOWN_MASK or old _MASK modifiers,
+     *                     however do not mix models in the one event.
+     *                     The extended modifiers are preferred for using
+     * @param x            The horizontal x coordinate for the mouse location.
+     *                       It is allowed to pass negative values
+     * @param y            The vertical y coordinate for the mouse location.
+     *                       It is allowed to pass negative values
+     * @param clickCount   The number of mouse clicks associated with event.
+     *                       Passing negative value
+     *                       is not recommended
+     * @param popupTrigger A boolean that equals {@code true} if this event
+     *                     is a trigger for a popup menu
+     * @param button       An integer that indicates, which of the mouse buttons has
+     *                     changed its state
      * @throws IllegalArgumentException if an invalid <code>button</code>
      *            value is passed in
      * @throws IllegalArgumentException if <code>source</code> is null
+     * @see #getSource()
+     * @see #getID()
+     * @see #getWhen()
+     * @see #getModifiers()
+     * @see #getX()
+     * @see #getY()
+     * @see #getClickCount()
+     * @see #isPopupTrigger()
+     * @see #getButton()
      * @since 1.4
      */
     public MouseEvent(Component source, int id, long when, int modifiers,
@@ -479,8 +499,6 @@
      * Constructs a <code>MouseEvent</code> object with the
      * specified source component,
      * type, modifiers, coordinates, and click count.
-     * <p>Note that passing in an invalid <code>id</code> results in
-     * unspecified behavior.
      * An invocation of the form
      * <tt>MouseEvent(source, id, when, modifiers, x, y, clickCount, popupTrigger)</tt>
      * behaves in exactly the same way as the invocation
@@ -493,21 +511,39 @@
      * This method throws an <code>IllegalArgumentException</code>
      * if <code>source</code> is <code>null</code>.
      *
-     * @param source       the <code>Component</code> that originated the event
-     * @param id           the integer that identifies the event
-     * @param when         a long int that gives the time the event occurred
-     * @param modifiers    the modifier keys down during event (e.g. shift, ctrl,
+     * @param source       The <code>Component</code> that originated the event
+     * @param id              An integer indicating the type of event.
+     *                     For information on allowable values, see
+     *                     the class description for {@link MouseEvent}
+     * @param when         A long integer that gives the time the event occurred.
+     *                     Passing negative or zero value
+     *                     is not recommended
+     * @param modifiers    The modifier keys down during event (e.g. shift, ctrl,
      *                     alt, meta)
-     *                     Either extended _DOWN_MASK or old _MASK modifiers
-     *                     should be used, but both models should not be mixed
-     *                     in one event. Use of the extended modifiers is
-     *                     preferred.
-     * @param x            the horizontal x coordinate for the mouse location
-     * @param y            the vertical y coordinate for the mouse location
-     * @param clickCount   the number of mouse clicks associated with event
-     * @param popupTrigger a boolean, true if this event is a trigger for a
-     *                     popup menu
+     *                     Passing negative parameter
+     *                     is not recommended.
+     *                     Zero value means that no modifiers were passed.
+     *                     Use either an extended _DOWN_MASK or old _MASK modifiers,
+     *                     however do not mix models in the one event.
+     *                     The extended modifiers are preferred for using
+     * @param x            The horizontal x coordinate for the mouse location.
+     *                       It is allowed to pass negative values
+     * @param y            The vertical y coordinate for the mouse location.
+     *                       It is allowed to pass negative values
+     * @param clickCount   The number of mouse clicks associated with event.
+     *                       Passing negative value
+     *                       is not recommended
+     * @param popupTrigger A boolean that equals {@code true} if this event
+     *                     is a trigger for a popup menu
      * @throws IllegalArgumentException if <code>source</code> is null
+     * @see #getSource()
+     * @see #getID()
+     * @see #getWhen()
+     * @see #getModifiers()
+     * @see #getX()
+     * @see #getY()
+     * @see #getClickCount()
+     * @see #isPopupTrigger()
      */
      public MouseEvent(Component source, int id, long when, int modifiers,
                       int x, int y, int clickCount, boolean popupTrigger) {
@@ -520,8 +556,7 @@
      * specified source component,
      * type, modifiers, coordinates, absolute coordinates, and click count.
      * <p>
-     * Note that passing in an invalid <code>id</code> results in
-     * unspecified behavior.  Creating an invalid event (such
+     * Creating an invalid event (such
      * as by using more than one of the old _MASKs, or modifier/button
      * values which don't match) results in unspecified behavior.
      * Even if inconsistent values for relative and absolute coordinates are
@@ -531,30 +566,50 @@
      * <code>IllegalArgumentException</code> if <code>source</code>
      * is <code>null</code>.
      *
-     * @param source       the <code>Component</code> that originated the event
-     * @param id           the integer that identifies the event
-     * @param when         a long int that gives the time the event occurred
-     * @param modifiers    the modifier keys down during event (e.g. shift, ctrl,
+     * @param source       The <code>Component</code> that originated the event
+     * @param id              An integer indicating the type of event.
+     *                     For information on allowable values, see
+     *                     the class description for {@link MouseEvent}
+     * @param when         A long integer that gives the time the event occurred.
+     *                     Passing negative or zero value
+     *                     is not recommended
+     * @param modifiers    The modifier keys down during event (e.g. shift, ctrl,
      *                     alt, meta)
-     *                     Either extended _DOWN_MASK or old _MASK modifiers
-     *                     should be used, but both models should not be mixed
-     *                     in one event. Use of the extended modifiers is
-     *                     preferred.
-     * @param x            the horizontal x coordinate for the mouse location
-     * @param y            the vertical y coordinate for the mouse location
-     * @param xAbs         the absolute horizontal x coordinate for the mouse location
-     * @param yAbs         the absolute vertical y coordinate for the mouse location
-     * @param clickCount   the number of mouse clicks associated with event
-     * @param popupTrigger a boolean, true if this event is a trigger for a
-     *                     popup menu
-     * @param button       which of the mouse buttons has changed state.
-     *                      <code>NOBUTTON</code>,
-     *                      <code>BUTTON1</code>,
-     *                      <code>BUTTON2</code> or
-     *                      <code>BUTTON3</code>.
+     *                     Passing negative parameter
+     *                     is not recommended.
+     *                     Zero value means that no modifiers were passed.
+     *                     Use either an extended _DOWN_MASK or old _MASK modifiers,
+     *                     however do not mix models in the one event.
+     *                     The extended modifiers are preferred for using
+     * @param x            The horizontal x coordinate for the mouse location.
+     *                       It is allowed to pass negative values
+     * @param y            The vertical y coordinate for the mouse location.
+     *                       It is allowed to pass negative values
+     * @param xAbs           The absolute horizontal x coordinate for the mouse location
+     *                       It is allowed to pass negative values
+     * @param yAbs           The absolute vertical y coordinate for the mouse location
+     *                       It is allowed to pass negative values
+     * @param clickCount   The number of mouse clicks associated with event.
+     *                       Passing negative value
+     *                       is not recommended
+     * @param popupTrigger A boolean that equals {@code true} if this event
+     *                     is a trigger for a popup menu
+     * @param button       An integer that indicates, which of the mouse buttons has
+     *                     changed its state
      * @throws IllegalArgumentException if an invalid <code>button</code>
      *            value is passed in
      * @throws IllegalArgumentException if <code>source</code> is null
+     * @see #getSource()
+     * @see #getID()
+     * @see #getWhen()
+     * @see #getModifiers()
+     * @see #getX()
+     * @see #getY()
+     * @see #getXOnScreen()
+     * @see #getYOnScreen()
+     * @see #getClickCount()
+     * @see #isPopupTrigger()
+     * @see #getButton()
      * @since 1.6
      */
     public MouseEvent(Component source, int id, long when, int modifiers,
@@ -675,21 +730,26 @@
     }
 
     /**
-     * Returns a <code>String</code> describing the modifier keys and
+     * Returns a <code>String</code> instance describing the modifier keys and
      * mouse buttons that were down during the event, such as "Shift",
      * or "Ctrl+Shift". These strings can be localized by changing
      * the <code>awt.properties</code> file.
      * <p>
-     * Note that <code>InputEvent.ALT_MASK</code> and
-     * <code>InputEvent.BUTTON2_MASK</code> have the same value,
-     * so the string "Alt" is returned for both modifiers.  Likewise,
-     * <code>InputEvent.META_MASK</code> and
-     * <code>InputEvent.BUTTON3_MASK</code> have the same value,
-     * so the string "Meta" is returned for both modifiers.
+     * Note that the <code>InputEvent.ALT_MASK</code> and
+     * <code>InputEvent.BUTTON2_MASK</code> have equal values,
+     * so the "Alt" string is returned for both modifiers.  Likewise,
+     * the <code>InputEvent.META_MASK</code> and
+     * <code>InputEvent.BUTTON3_MASK</code> have equal values,
+     * so the "Meta" string is returned for both modifiers.
+     * <p>
+     * Note that passing negative parameter is incorrect,
+     * and will cause the returning an unspecified string.
+     * Zero parameter means that no modifiers were passed and will
+     * cause the returning an empty string.
      *
-     * @param modifiers a modifier mask describing the modifier keys and
+     * @param modifiers A modifier mask describing the modifier keys and
      *                  mouse buttons that were down during the event
-     * @return string   a text description of the combination of modifier
+     * @return string   string text description of the combination of modifier
      *                  keys and mouse buttons that were down during the event
      * @see InputEvent#getModifiersExText(int)
      * @since 1.4
--- a/jdk/src/share/classes/java/awt/event/MouseWheelEvent.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/java/awt/event/MouseWheelEvent.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2000-2008 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
--- a/jdk/src/share/classes/java/awt/event/PaintEvent.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/java/awt/event/PaintEvent.java	Thu Jun 12 13:50:55 2008 -0700
@@ -36,6 +36,10 @@
  * designed to be used with the Event Listener model; programs
  * should continue to override paint/update methods in order
  * render themselves properly.
+ * <p>
+ * An unspecified behavior will be caused if the {@code id} parameter
+ * of any particular {@code PaintEvent} instance is not
+ * in the range from {@code PAINT_FIRST} to {@code PAINT_LAST}.
  *
  * @author Amy Fowler
  * @since 1.1
@@ -82,15 +86,19 @@
     /**
      * Constructs a <code>PaintEvent</code> object with the specified
      * source component and type.
-     * <p>Note that passing in an invalid <code>id</code> results in
-     * unspecified behavior. This method throws an
+     * <p> This method throws an
      * <code>IllegalArgumentException</code> if <code>source</code>
      * is <code>null</code>.
      *
-     * @param source     the object where the event originated
-     * @param id         the event type
-     * @param updateRect the rectangle area which needs to be repainted
+     * @param source     The object where the event originated
+     * @param id           The integer that identifies the event type.
+     *                     For information on allowable values, see
+     *                     the class description for {@link PaintEvent}
+     * @param updateRect The rectangle area which needs to be repainted
      * @throws IllegalArgumentException if <code>source</code> is null
+     * @see #getSource()
+     * @see #getID()
+     * @see #getUpdateRect()
      */
     public PaintEvent(Component source, int id, Rectangle updateRect) {
         super(source, id);
--- a/jdk/src/share/classes/java/awt/event/TextEvent.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/java/awt/event/TextEvent.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 1996-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1996-2008 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
@@ -38,12 +38,15 @@
  * this <code>TextEvent</code> when the event occurs. The listener is
  * spared the details of processing individual mouse movements and key strokes
  * Instead, it can process a "meaningful" (semantic) event like "text changed".
+ * <p>
+ * An unspecified behavior will be caused if the {@code id} parameter
+ * of any particular {@code TextEvent} instance is not
+ * in the range from {@code TEXT_FIRST} to {@code TEXT_LAST}.
  *
  * @author Georges Saab
  *
  * @see java.awt.TextComponent
  * @see TextListener
- * @see <a href="http://java.sun.com/docs/books/tutorial/post1.0/ui/textlistener.html">Tutorial: Writing a Text Listener</a>
  *
  * @since 1.1
  */
@@ -72,15 +75,18 @@
 
     /**
      * Constructs a <code>TextEvent</code> object.
-     * <p>Note that passing in an invalid <code>id</code> results in
-     * unspecified behavior. This method throws an
+     * <p> This method throws an
      * <code>IllegalArgumentException</code> if <code>source</code>
      * is <code>null</code>.
      *
-     * @param source the (<code>TextComponent</code>) object that
+     * @param source The (<code>TextComponent</code>) object that
      *               originated the event
-     * @param id     an integer that identifies the event type
+     * @param id     An integer that identifies the event type.
+     *                     For information on allowable values, see
+     *                     the class description for {@link TextEvent}
      * @throws IllegalArgumentException if <code>source</code> is null
+     * @see #getSource()
+     * @see #getID()
      */
     public TextEvent(Object source, int id) {
         super(source, id);
--- a/jdk/src/share/classes/java/awt/event/TextListener.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/java/awt/event/TextListener.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 1996-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1996-2008 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
@@ -40,7 +40,6 @@
  * @author Georges Saab
  *
  * @see TextEvent
- * @see <a href="http://java.sun.com/docs/books/tutorial/post1.0/ui/textlistener.html">Tutorial: Writing a Text Listener</a>
  *
  * @since 1.1
  */
--- a/jdk/src/share/classes/java/awt/event/WindowEvent.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/java/awt/event/WindowEvent.java	Thu Jun 12 13:50:55 2008 -0700
@@ -41,6 +41,10 @@
  * (<code>WindowAdapter</code> objects implement the
  * <code>WindowListener</code> interface.) Each such listener object
  * gets this <code>WindowEvent</code> when the event occurs.
+ * <p>
+ * An unspecified behavior will be caused if the {@code id} parameter
+ * of any particular {@code WindowEvent} instance is not
+ * in the range from {@code WINDOW_FIRST} to {@code WINDOW_LAST}.
  *
  * @author Carl Quinn
  * @author Amy Fowler
@@ -170,20 +174,27 @@
 
     /**
      * Constructs a <code>WindowEvent</code> object.
-     * <p>Note that passing in an invalid <code>id</code> results in
-     * unspecified behavior. This method throws an
+     * <p>This method throws an
      * <code>IllegalArgumentException</code> if <code>source</code>
      * is <code>null</code>.
      *
-     * @param source    the <code>Window</code> object
+     * @param source    The <code>Window</code> object
      *                    that originated the event
-     * @param id        an integer indicating the type of event.
-     * @param opposite  the other window involved in the focus or activation
+     * @param id        An integer indicating the type of event.
+     *                     For information on allowable values, see
+     *                     the class description for {@link WindowEvent}
+     * @param opposite  The other window involved in the focus or activation
      *                      change, or <code>null</code>
-     * @param oldState  previous state of the window for window state
-     *                      change event
-     * @param newState  new state of the window for window state change event
+     * @param oldState  Previous state of the window for window state change event.
+     *                  See {@code #getOldState()} for allowable values
+     * @param newState  New state of the window for window state change event.
+     *                  See {@code #getNewState()} for allowable values
      * @throws IllegalArgumentException if <code>source</code> is null
+     * @see #getWindow()
+     * @see #getID()
+     * @see #getOppositeWindow()
+     * @see #getOldState()
+     * @see #getNewState()
      * @since 1.4
      */
     public WindowEvent(Window source, int id, Window opposite,
@@ -209,24 +220,28 @@
      * If this focus change occurs with a native application, with a
      * Java application in a different VM, or with no other
      * <code>Window</code>, then the opposite Window is <code>null</code>.
-     * <p>Note that passing in an invalid <code>id</code> results in
-     * unspecified behavior. This method throws an
+     * <p>This method throws an
      * <code>IllegalArgumentException</code> if <code>source</code>
      * is <code>null</code>.
      *
-     * @param source     the <code>Window</code> object that
+     * @param source     The <code>Window</code> object that
      *                   originated the event
-     * @param id         <code>WINDOW_ACTIVATED</code>,
-     *                   <code>WINDOW_DEACTIVATED</code>,
-     *                   <code>WINDOW_GAINED_FOCUS</code>,
-     *                   or <code>WINDOW_LOST_FOCUS</code>. It is
-     *                   expected that this constructor will not be used for
-     *                   other <code>WindowEvent</code> types because the
-     *                   opposite <code>Window</code> of such events
-     *                   will always be <code>null</code>
-     * @param opposite   the other <code>Window</code> involved in the
+     * @param id        An integer indicating the type of event.
+     *                     For information on allowable values, see
+     *                     the class description for {@link WindowEvent}.
+     *                  It is expected that this constructor will not
+     *                  be used for other then
+     *                  {@code WINDOW_ACTIVATED},{@code WINDOW_DEACTIVATED},
+     *                  {@code WINDOW_GAINED_FOCUS}, or {@code WINDOW_LOST_FOCUS}.
+     *                  {@code WindowEvent} types,
+     *                  because the opposite <code>Window</code> of other event types
+     *                  will always be {@code null}.
+     * @param opposite   The other <code>Window</code> involved in the
      *                   focus or activation change, or <code>null</code>
      * @throws IllegalArgumentException if <code>source</code> is null
+     * @see #getWindow()
+     * @see #getID()
+     * @see #getOppositeWindow()
      * @since 1.4
      */
     public WindowEvent(Window source, int id, Window opposite) {
@@ -236,21 +251,30 @@
     /**
      * Constructs a <code>WindowEvent</code> object with the specified
      * previous and new window states.
-     * <p>Note that passing in an invalid <code>id</code> results in
-     * unspecified behavior. This method throws an
+     * <p>This method throws an
      * <code>IllegalArgumentException</code> if <code>source</code>
      * is <code>null</code>.
      *
-     * @param source    the <code>Window</code> object
+     * @param source    The <code>Window</code> object
      *                  that originated the event
-     * @param id        <code>WINDOW_STATE_CHANGED</code> event type.
+     * @param id        An integer indicating the type of event.
+     *                     For information on allowable values, see
+     *                     the class description for {@link WindowEvent}.
      *                  It is expected that this constructor will not
-     *                  be used for other <code>WindowEvent</code>
+     *                  be used for other then
+     *                  {@code WINDOW_STATE_CHANGED}
+     *                  {@code WindowEvent}
      *                  types, because the previous and new window
      *                  states are meaningless for other event types.
-     * @param oldState  an integer representing the previous window state
-     * @param newState  an integer representing the new window state
+     * @param oldState  An integer representing the previous window state.
+     *                  See {@code #getOldState()} for allowable values
+     * @param newState  An integer representing the new window state.
+     *                  See {@code #getNewState()} for allowable values
      * @throws IllegalArgumentException if <code>source</code> is null
+     * @see #getWindow()
+     * @see #getID()
+     * @see #getOldState()
+     * @see #getNewState()
      * @since 1.4
      */
     public WindowEvent(Window source, int id, int oldState, int newState) {
@@ -259,14 +283,17 @@
 
     /**
      * Constructs a <code>WindowEvent</code> object.
-     * <p>Note that passing in an invalid <code>id</code> results in
-     * unspecified behavior. This method throws an
+     * <p>This method throws an
      * <code>IllegalArgumentException</code> if <code>source</code>
      * is <code>null</code>.
      *
-     * @param source the <code>Window</code> object that originated the event
-     * @param id     an integer indicating the type of event
+     * @param source The <code>Window</code> object that originated the event
+     * @param id     An integer indicating the type of event.
+     *                     For information on allowable values, see
+     *                     the class description for {@link WindowEvent}.
      * @throws IllegalArgumentException if <code>source</code> is null
+     * @see #getWindow()
+     * @see #getID()
      */
     public WindowEvent(Window source, int id) {
         this(source, id, null, 0, 0);
--- a/jdk/src/share/classes/java/awt/font/OpenType.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/java/awt/font/OpenType.java	Thu Jun 12 13:50:55 2008 -0700
@@ -31,9 +31,9 @@
  * <i>sfnt</i> tables from the font.  A particular
  * <code>Font</code> object can implement this interface.
  * <p>
- * For more information on TrueType fonts, see the
- * Apple TrueType Reference Manual
- * ( <a href="http://fonts.apple.com/TTRefMan/index.html">http://fonts.apple.com/TTRefMan/index.html</a> ).
+ * For more information on TrueType and OpenType fonts, see the
+ * OpenType specification.
+ * ( <a href=http://www.microsoft.com/typography/otspec/">http://www.microsoft.com/typography/otspec/l</a> ).
  */
 public interface OpenType {
 
--- a/jdk/src/share/classes/java/awt/geom/RectangularShape.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/java/awt/geom/RectangularShape.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 1997-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-2008 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,6 +27,7 @@
 
 import java.awt.Shape;
 import java.awt.Rectangle;
+import java.beans.Transient;
 
 /**
  * <code>RectangularShape</code> is the base class for a number of
@@ -171,6 +172,7 @@
      * @see #setFrame(Rectangle2D)
      * @since 1.2
      */
+    @Transient
     public Rectangle2D getFrame() {
         return new Rectangle2D.Double(getX(), getY(), getWidth(), getHeight());
     }
--- a/jdk/src/share/classes/java/awt/im/InputContext.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/java/awt/im/InputContext.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 1997-2005 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-2008 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
@@ -28,6 +28,7 @@
 import java.awt.Component;
 import java.util.Locale;
 import java.awt.AWTEvent;
+import java.beans.Transient;
 import java.lang.Character.Subset;
 import sun.awt.im.InputMethodContext;
 
@@ -231,6 +232,7 @@
      * @see #setCompositionEnabled
      * @since 1.3
      */
+    @Transient
     public boolean isCompositionEnabled() {
         // real implementation is in sun.awt.im.InputContext
         return false;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/classes/java/awt/image/BandedSampleModel.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,839 @@
+/*
+ * Portions Copyright 1997-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) Eastman Kodak Company, 1997
+ *** As  an unpublished  work pursuant to Title 17 of the United
+ *** States Code.  All rights reserved.
+ ******************************************************************
+ ******************************************************************
+ ******************************************************************/
+
+package java.awt.image;
+
+/**
+ *  This class represents image data which is stored in a band interleaved
+ *  fashion and for
+ *  which each sample of a pixel occupies one data element of the DataBuffer.
+ *  It subclasses ComponentSampleModel but provides a more efficent
+ *  implementation for accessing band interleaved image data than is provided
+ *  by ComponentSampleModel.  This class should typically be used when working
+ *  with images which store sample data for each band in a different bank of the
+ *  DataBuffer. Accessor methods are provided so that image data can be
+ *  manipulated directly. Pixel stride is the number of
+ *  data array elements between two samples for the same band on the same
+ *  scanline. The pixel stride for a BandedSampleModel is one.
+ *  Scanline stride is the number of data array elements between
+ *  a given sample and the corresponding sample in the same column of the next
+ *  scanline.  Band offsets denote the number
+ *  of data array elements from the first data array element of the bank
+ *  of the DataBuffer holding each band to the first sample of the band.
+ *  The bands are numbered from 0 to N-1.
+ *  Bank indices denote the correspondence between a bank of the data buffer
+ *  and a band of image data.  This class supports
+ *  {@link DataBuffer#TYPE_BYTE TYPE_BYTE},
+ *  {@link DataBuffer#TYPE_USHORT TYPE_USHORT},
+ *  {@link DataBuffer#TYPE_SHORT TYPE_SHORT},
+ *  {@link DataBuffer#TYPE_INT TYPE_INT},
+ *  {@link DataBuffer#TYPE_FLOAT TYPE_FLOAT}, and
+ *  {@link DataBuffer#TYPE_DOUBLE TYPE_DOUBLE} datatypes
+ */
+
+
+public final class BandedSampleModel extends ComponentSampleModel
+{
+
+    /**
+     * Constructs a BandedSampleModel with the specified parameters.
+     * The pixel stride will be one data element.  The scanline stride
+     * will be the same as the width.  Each band will be stored in
+     * a separate bank and all band offsets will be zero.
+     * @param dataType  The data type for storing samples.
+     * @param w         The width (in pixels) of the region of
+     *                  image data described.
+     * @param h         The height (in pixels) of the region of image
+     *                  data described.
+     * @param numBands  The number of bands for the image data.
+     * @throws IllegalArgumentException if <code>dataType</code> is not
+     *         one of the supported data types
+     */
+    public BandedSampleModel(int dataType, int w, int h, int numBands) {
+        super(dataType, w, h, 1, w,
+              BandedSampleModel.createIndicesArray(numBands),
+              BandedSampleModel.createOffsetArray(numBands));
+    }
+
+    /**
+     * Constructs a BandedSampleModel with the specified parameters.
+     * The number of bands will be inferred from the lengths of the
+     * bandOffsets bankIndices arrays, which must be equal.  The pixel
+     * stride will be one data element.
+     * @param dataType  The data type for storing samples.
+     * @param w         The width (in pixels) of the region of
+     *                  image data described.
+     * @param h         The height (in pixels) of the region of
+     *                  image data described.
+     * @param scanlineStride The line stride of the of the image data.
+     * @param bankIndices The bank index for each band.
+     * @param bandOffsets The band offset for each band.
+     * @throws IllegalArgumentException if <code>dataType</code> is not
+     *         one of the supported data types
+     */
+    public BandedSampleModel(int dataType,
+                             int w, int h,
+                             int scanlineStride,
+                             int bankIndices[],
+                             int bandOffsets[]) {
+
+        super(dataType, w, h, 1,scanlineStride, bankIndices, bandOffsets);
+    }
+
+    /**
+     * Creates a new BandedSampleModel with the specified
+     * width and height.  The new BandedSampleModel will have the same
+     * number of bands, storage data type, and bank indices
+     * as this BandedSampleModel.  The band offsets will be compressed
+     * such that the offset between bands will be w*pixelStride and
+     * the minimum of all of the band offsets is zero.
+     * @param w the width of the resulting <code>BandedSampleModel</code>
+     * @param h the height of the resulting <code>BandedSampleModel</code>
+     * @return a new <code>BandedSampleModel</code> with the specified
+     *         width and height.
+     * @throws IllegalArgumentException if <code>w</code> or
+     *         <code>h</code> equals either
+     *         <code>Integer.MAX_VALUE</code> or
+     *         <code>Integer.MIN_VALUE</code>
+     * @throws IllegalArgumentException if <code>dataType</code> is not
+     *         one of the supported data types
+     */
+    public SampleModel createCompatibleSampleModel(int w, int h) {
+        int[] bandOffs;
+
+        if (numBanks == 1) {
+            bandOffs = orderBands(bandOffsets, w*h);
+        }
+        else {
+            bandOffs = new int[bandOffsets.length];
+        }
+
+        SampleModel sampleModel =
+            new BandedSampleModel(dataType, w, h, w, bankIndices, bandOffs);
+        return sampleModel;
+    }
+
+    /**
+     * Creates a new BandedSampleModel with a subset of the bands of this
+     * BandedSampleModel.  The new BandedSampleModel can be
+     * used with any DataBuffer that the existing BandedSampleModel
+     * can be used with.  The new BandedSampleModel/DataBuffer
+     * combination will represent an image with a subset of the bands
+     * of the original BandedSampleModel/DataBuffer combination.
+     * @throws RasterFormatException if the number of bands is greater than
+     *                               the number of banks in this sample model.
+     * @throws IllegalArgumentException if <code>dataType</code> is not
+     *         one of the supported data types
+     */
+    public SampleModel createSubsetSampleModel(int bands[]) {
+        if (bands.length > bankIndices.length)
+            throw new RasterFormatException("There are only " +
+                                            bankIndices.length +
+                                            " bands");
+        int newBankIndices[] = new int[bands.length];
+        int newBandOffsets[] = new int[bands.length];
+
+        for (int i=0; i<bands.length; i++) {
+            newBankIndices[i] = bankIndices[bands[i]];
+            newBandOffsets[i] = bandOffsets[bands[i]];
+        }
+
+        return new BandedSampleModel(this.dataType, width, height,
+                                     this.scanlineStride,
+                                     newBankIndices, newBandOffsets);
+    }
+
+    /**
+     * Creates a DataBuffer that corresponds to this BandedSampleModel,
+     * The DataBuffer's data type, number of banks, and size
+     * will be consistent with this BandedSampleModel.
+     * @throws IllegalArgumentException if <code>dataType</code> is not
+     *         one of the supported types.
+     */
+    public DataBuffer createDataBuffer() {
+        DataBuffer dataBuffer = null;
+
+        int size = scanlineStride * height;
+        switch (dataType) {
+        case DataBuffer.TYPE_BYTE:
+            dataBuffer = new DataBufferByte(size, numBanks);
+            break;
+        case DataBuffer.TYPE_USHORT:
+            dataBuffer = new DataBufferUShort(size, numBanks);
+            break;
+        case DataBuffer.TYPE_SHORT:
+            dataBuffer = new DataBufferShort(size, numBanks);
+            break;
+        case DataBuffer.TYPE_INT:
+            dataBuffer = new DataBufferInt(size, numBanks);
+            break;
+        case DataBuffer.TYPE_FLOAT:
+            dataBuffer = new DataBufferFloat(size, numBanks);
+            break;
+        case DataBuffer.TYPE_DOUBLE:
+            dataBuffer = new DataBufferDouble(size, numBanks);
+            break;
+        default:
+            throw new IllegalArgumentException("dataType is not one " +
+                "of the supported types.");
+        }
+
+        return dataBuffer;
+    }
+
+
+    /**
+     * Returns data for a single pixel in a primitive array of type
+     * TransferType.  For a BandedSampleModel, this will be the same
+     * as the data type, and samples will be returned one per array
+     * element.  Generally, obj
+     * should be passed in as null, so that the Object will be created
+     * automatically and will be of the right primitive data type.
+     * <p>
+     * The following code illustrates transferring data for one pixel from
+     * DataBuffer <code>db1</code>, whose storage layout is described by
+     * BandedSampleModel <code>bsm1</code>, to DataBuffer <code>db2</code>,
+     * whose storage layout is described by
+     * BandedSampleModel <code>bsm2</code>.
+     * The transfer will generally be more efficient than using
+     * getPixel/setPixel.
+     * <pre>
+     *       BandedSampleModel bsm1, bsm2;
+     *       DataBufferInt db1, db2;
+     *       bsm2.setDataElements(x, y, bsm1.getDataElements(x, y, null, db1),
+     *                            db2);
+     * </pre>
+     * Using getDataElements/setDataElements to transfer between two
+     * DataBuffer/SampleModel pairs is legitimate if the SampleModels have
+     * the same number of bands, corresponding bands have the same number of
+     * bits per sample, and the TransferTypes are the same.
+     * <p>
+     * If obj is non-null, it should be a primitive array of type TransferType.
+     * Otherwise, a ClassCastException is thrown.  An
+     * ArrayIndexOutOfBoundsException may be thrown if the coordinates are
+     * not in bounds, or if obj is non-null and is not large enough to hold
+     * the pixel data.
+     * @param x         The X coordinate of the pixel location
+     * @param y         The Y coordinate of the pixel location
+     * @param obj       If non-null, a primitive array in which to return
+     *                  the pixel data.
+     * @param data      The DataBuffer containing the image data.
+     * @return the data for the specified pixel.
+     * @see #setDataElements(int, int, Object, DataBuffer)
+     */
+    public Object getDataElements(int x, int y, Object obj, DataBuffer data) {
+        if ((x < 0) || (y < 0) || (x >= width) || (y >= height)) {
+            throw new ArrayIndexOutOfBoundsException
+                ("Coordinate out of bounds!");
+        }
+        int type = getTransferType();
+        int numDataElems = getNumDataElements();
+        int pixelOffset = y*scanlineStride + x;
+
+        switch(type) {
+
+        case DataBuffer.TYPE_BYTE:
+
+            byte[] bdata;
+
+            if (obj == null) {
+                bdata = new byte[numDataElems];
+            } else {
+                bdata = (byte[])obj;
+            }
+
+            for (int i=0; i<numDataElems; i++) {
+                bdata[i] = (byte)data.getElem(bankIndices[i],
+                                              pixelOffset + bandOffsets[i]);
+            }
+
+            obj = (Object)bdata;
+            break;
+
+        case DataBuffer.TYPE_USHORT:
+        case DataBuffer.TYPE_SHORT:
+
+            short[] sdata;
+
+            if (obj == null) {
+                sdata = new short[numDataElems];
+            } else {
+                sdata = (short[])obj;
+            }
+
+            for (int i=0; i<numDataElems; i++) {
+                sdata[i] = (short)data.getElem(bankIndices[i],
+                                               pixelOffset + bandOffsets[i]);
+            }
+
+            obj = (Object)sdata;
+            break;
+
+        case DataBuffer.TYPE_INT:
+
+            int[] idata;
+
+            if (obj == null) {
+                idata = new int[numDataElems];
+            } else {
+                idata = (int[])obj;
+            }
+
+            for (int i=0; i<numDataElems; i++) {
+                idata[i] = data.getElem(bankIndices[i],
+                                        pixelOffset + bandOffsets[i]);
+            }
+
+            obj = (Object)idata;
+            break;
+
+        case DataBuffer.TYPE_FLOAT:
+
+            float[] fdata;
+
+            if (obj == null) {
+                fdata = new float[numDataElems];
+            } else {
+                fdata = (float[])obj;
+            }
+
+            for (int i=0; i<numDataElems; i++) {
+                fdata[i] = data.getElemFloat(bankIndices[i],
+                                             pixelOffset + bandOffsets[i]);
+            }
+
+            obj = (Object)fdata;
+            break;
+
+        case DataBuffer.TYPE_DOUBLE:
+
+            double[] ddata;
+
+            if (obj == null) {
+                ddata = new double[numDataElems];
+            } else {
+                ddata = (double[])obj;
+            }
+
+            for (int i=0; i<numDataElems; i++) {
+                ddata[i] = data.getElemDouble(bankIndices[i],
+                                              pixelOffset + bandOffsets[i]);
+            }
+
+            obj = (Object)ddata;
+            break;
+        }
+
+        return obj;
+    }
+
+    /**
+     * Returns all samples for the specified pixel in an int array.
+     * ArrayIndexOutOfBoundsException may be thrown if the coordinates are
+     * not in bounds.
+     * @param x         The X coordinate of the pixel location
+     * @param y         The Y coordinate of the pixel location
+     * @param iArray    If non-null, returns the samples in this array
+     * @param data      The DataBuffer containing the image data
+     * @return the samples for the specified pixel.
+     * @see #setPixel(int, int, int[], DataBuffer)
+     */
+    public int[] getPixel(int x, int y, int iArray[], DataBuffer data) {
+        if ((x < 0) || (y < 0) || (x >= width) || (y >= height)) {
+            throw new ArrayIndexOutOfBoundsException
+                ("Coordinate out of bounds!");
+        }
+
+        int[] pixels;
+
+        if (iArray != null) {
+           pixels = iArray;
+        } else {
+           pixels = new int [numBands];
+        }
+
+        int pixelOffset = y*scanlineStride + x;
+        for (int i=0; i<numBands; i++) {
+            pixels[i] = data.getElem(bankIndices[i],
+                                     pixelOffset + bandOffsets[i]);
+        }
+        return pixels;
+    }
+
+    /**
+     * Returns all samples for the specified rectangle of pixels in
+     * an int array, one sample per data array element.
+     * ArrayIndexOutOfBoundsException may be thrown if the coordinates are
+     * not in bounds.
+     * @param x         The X coordinate of the upper left pixel location
+     * @param y         The Y coordinate of the upper left pixel location
+     * @param w         The width of the pixel rectangle
+     * @param h         The height of the pixel rectangle
+     * @param iArray    If non-null, returns the samples in this array
+     * @param data      The DataBuffer containing the image data
+     * @return the samples for the pixels within the specified region.
+     * @see #setPixels(int, int, int, int, int[], DataBuffer)
+     */
+    public int[] getPixels(int x, int y, int w, int h,
+                           int iArray[], DataBuffer data) {
+        if ((x < 0) || (y < 0) || (x + w > width) || (y + h > height)) {
+            throw new ArrayIndexOutOfBoundsException
+                ("Coordinate out of bounds!");
+        }
+        int[] pixels;
+
+        if (iArray != null) {
+           pixels = iArray;
+        } else {
+           pixels = new int[w*h*numBands];
+        }
+
+        for (int k = 0; k < numBands; k++) {
+            int lineOffset = y*scanlineStride + x + bandOffsets[k];
+            int srcOffset = k;
+            int bank = bankIndices[k];
+
+            for (int i = 0; i < h; i++) {
+                int pixelOffset = lineOffset;
+                for (int j = 0; j < w; j++) {
+                    pixels[srcOffset] = data.getElem(bank, pixelOffset++);
+                    srcOffset += numBands;
+                }
+                lineOffset += scanlineStride;
+            }
+        }
+        return pixels;
+    }
+
+    /**
+     * Returns as int the sample in a specified band for the pixel
+     * located at (x,y).
+     * ArrayIndexOutOfBoundsException may be thrown if the coordinates are
+     * not in bounds.
+     * @param x         The X coordinate of the pixel location
+     * @param y         The Y coordinate of the pixel location
+     * @param b         The band to return
+     * @param data      The DataBuffer containing the image data
+     * @return the sample in the specified band for the specified pixel.
+     * @see #setSample(int, int, int, int, DataBuffer)
+     */
+    public int getSample(int x, int y, int b, DataBuffer data) {
+        // Bounds check for 'b' will be performed automatically
+        if ((x < 0) || (y < 0) || (x >= width) || (y >= height)) {
+            throw new ArrayIndexOutOfBoundsException
+                ("Coordinate out of bounds!");
+        }
+        int sample =
+            data.getElem(bankIndices[b],
+                         y*scanlineStride + x + bandOffsets[b]);
+        return sample;
+    }
+
+    /**
+     * Returns the sample in a specified band
+     * for the pixel located at (x,y) as a float.
+     * ArrayIndexOutOfBoundsException may be thrown if the coordinates are
+     * not in bounds.
+     * @param x         The X coordinate of the pixel location
+     * @param y         The Y coordinate of the pixel location
+     * @param b         The band to return
+     * @param data      The DataBuffer containing the image data
+     * @return a float value that represents the sample in the specified
+     * band for the specified pixel.
+     */
+    public float getSampleFloat(int x, int y, int b, DataBuffer data) {
+        // Bounds check for 'b' will be performed automatically
+        if ((x < 0) || (y < 0) || (x >= width) || (y >= height)) {
+            throw new ArrayIndexOutOfBoundsException
+                ("Coordinate out of bounds!");
+        }
+
+        float sample = data.getElemFloat(bankIndices[b],
+                                    y*scanlineStride + x + bandOffsets[b]);
+        return sample;
+    }
+
+    /**
+     * Returns the sample in a specified band
+     * for a pixel located at (x,y) as a double.
+     * ArrayIndexOutOfBoundsException may be thrown if the coordinates are
+     * not in bounds.
+     * @param x         The X coordinate of the pixel location
+     * @param y         The Y coordinate of the pixel location
+     * @param b         The band to return
+     * @param data      The DataBuffer containing the image data
+     * @return a double value that represents the sample in the specified
+     * band for the specified pixel.
+     */
+    public double getSampleDouble(int x, int y, int b, DataBuffer data) {
+        // Bounds check for 'b' will be performed automatically
+        if ((x < 0) || (y < 0) || (x >= width) || (y >= height)) {
+            throw new ArrayIndexOutOfBoundsException
+                ("Coordinate out of bounds!");
+        }
+
+        double sample = data.getElemDouble(bankIndices[b],
+                                       y*scanlineStride + x + bandOffsets[b]);
+        return sample;
+    }
+
+    /**
+     * Returns the samples in a specified band for the specified rectangle
+     * of pixels in an int array, one sample per data array element.
+     * ArrayIndexOutOfBoundsException may be thrown if the coordinates are
+     * not in bounds.
+     * @param x         The X coordinate of the upper left pixel location
+     * @param y         The Y coordinate of the upper left pixel location
+     * @param w         The width of the pixel rectangle
+     * @param h         The height of the pixel rectangle
+     * @param b         The band to return
+     * @param iArray    If non-null, returns the samples in this array
+     * @param data      The DataBuffer containing the image data
+     * @return the samples in the specified band for the pixels within
+     * the specified region.
+     * @see #setSamples(int, int, int, int, int, int[], DataBuffer)
+     */
+    public int[] getSamples(int x, int y, int w, int h, int b,
+                            int iArray[], DataBuffer data) {
+        // Bounds check for 'b' will be performed automatically
+        if ((x < 0) || (y < 0) || (x + w > width) || (y + h > height)) {
+            throw new ArrayIndexOutOfBoundsException
+                ("Coordinate out of bounds!");
+        }
+        int samples[];
+        if (iArray != null) {
+           samples = iArray;
+        } else {
+           samples = new int [w*h];
+        }
+
+        int lineOffset = y*scanlineStride + x + bandOffsets[b];
+        int srcOffset = 0;
+        int bank = bankIndices[b];
+
+        for (int i = 0; i < h; i++) {
+           int sampleOffset = lineOffset;
+           for (int j = 0; j < w; j++) {
+               samples[srcOffset++] = data.getElem(bank, sampleOffset++);
+           }
+           lineOffset += scanlineStride;
+        }
+        return samples;
+    }
+
+    /**
+     * Sets the data for a single pixel in the specified DataBuffer from a
+     * primitive array of type TransferType.  For a BandedSampleModel,
+     * this will be the same as the data type, and samples are transferred
+     * one per array element.
+     * <p>
+     * The following code illustrates transferring data for one pixel from
+     * DataBuffer <code>db1</code>, whose storage layout is described by
+     * BandedSampleModel <code>bsm1</code>, to DataBuffer <code>db2</code>,
+     * whose storage layout is described by
+     * BandedSampleModel <code>bsm2</code>.
+     * The transfer will generally be more efficient than using
+     * getPixel/setPixel.
+     * <pre>
+     *       BandedSampleModel bsm1, bsm2;
+     *       DataBufferInt db1, db2;
+     *       bsm2.setDataElements(x, y, bsm1.getDataElements(x, y, null, db1),
+     *                            db2);
+     * </pre>
+     * Using getDataElements/setDataElements to transfer between two
+     * DataBuffer/SampleModel pairs is legitimate if the SampleModels have
+     * the same number of bands, corresponding bands have the same number of
+     * bits per sample, and the TransferTypes are the same.
+     * <p>
+     * obj must be a primitive array of type TransferType.  Otherwise,
+     * a ClassCastException is thrown.  An
+     * ArrayIndexOutOfBoundsException may be thrown if the coordinates are
+     * not in bounds, or if obj is not large enough to hold the pixel data.
+     * @param x         The X coordinate of the pixel location
+     * @param y         The Y coordinate of the pixel location
+     * @param obj       If non-null, returns the primitive array in this
+     *                  object
+     * @param data      The DataBuffer containing the image data
+     * @see #getDataElements(int, int, Object, DataBuffer)
+     */
+    public void setDataElements(int x, int y, Object obj, DataBuffer data) {
+        if ((x < 0) || (y < 0) || (x >= width) || (y >= height)) {
+            throw new ArrayIndexOutOfBoundsException
+                ("Coordinate out of bounds!");
+        }
+        int type = getTransferType();
+        int numDataElems = getNumDataElements();
+        int pixelOffset = y*scanlineStride + x;
+
+        switch(type) {
+
+        case DataBuffer.TYPE_BYTE:
+
+            byte[] barray = (byte[])obj;
+
+            for (int i=0; i<numDataElems; i++) {
+                data.setElem(bankIndices[i], pixelOffset + bandOffsets[i],
+                             barray[i] & 0xff);
+            }
+            break;
+
+        case DataBuffer.TYPE_USHORT:
+        case DataBuffer.TYPE_SHORT:
+
+            short[] sarray = (short[])obj;
+
+            for (int i=0; i<numDataElems; i++) {
+                data.setElem(bankIndices[i], pixelOffset + bandOffsets[i],
+                             sarray[i] & 0xffff);
+            }
+            break;
+
+        case DataBuffer.TYPE_INT:
+
+            int[] iarray = (int[])obj;
+
+            for (int i=0; i<numDataElems; i++) {
+                data.setElem(bankIndices[i], pixelOffset + bandOffsets[i],
+                             iarray[i]);
+            }
+            break;
+
+        case DataBuffer.TYPE_FLOAT:
+
+            float[] farray = (float[])obj;
+
+            for (int i=0; i<numDataElems; i++) {
+                data.setElemFloat(bankIndices[i], pixelOffset + bandOffsets[i],
+                                  farray[i]);
+            }
+            break;
+
+        case DataBuffer.TYPE_DOUBLE:
+
+            double[] darray = (double[])obj;
+
+            for (int i=0; i<numDataElems; i++) {
+                data.setElemDouble(bankIndices[i], pixelOffset + bandOffsets[i],
+                                   darray[i]);
+            }
+            break;
+
+        }
+    }
+
+    /**
+     * Sets a pixel in the DataBuffer using an int array of samples for input.
+     * ArrayIndexOutOfBoundsException may be thrown if the coordinates are
+     * not in bounds.
+     * @param x         The X coordinate of the pixel location
+     * @param y         The Y coordinate of the pixel location
+     * @param iArray    The input samples in an int array
+     * @param data      The DataBuffer containing the image data
+     * @see #getPixel(int, int, int[], DataBuffer)
+     */
+    public void setPixel(int x, int y, int iArray[], DataBuffer data) {
+        if ((x < 0) || (y < 0) || (x >= width) || (y >= height)) {
+            throw new ArrayIndexOutOfBoundsException
+                ("Coordinate out of bounds!");
+        }
+       int pixelOffset = y*scanlineStride + x;
+       for (int i=0; i<numBands; i++) {
+           data.setElem(bankIndices[i], pixelOffset + bandOffsets[i],
+                        iArray[i]);
+       }
+    }
+
+    /**
+     * Sets all samples for a rectangle of pixels from an int array containing
+     * one sample per array element.
+     * ArrayIndexOutOfBoundsException may be thrown if the coordinates are
+     * not in bounds.
+     * @param x         The X coordinate of the upper left pixel location
+     * @param y         The Y coordinate of the upper left pixel location
+     * @param w         The width of the pixel rectangle
+     * @param h         The height of the pixel rectangle
+     * @param iArray    The input samples in an int array
+     * @param data      The DataBuffer containing the image data
+     * @see #getPixels(int, int, int, int, int[], DataBuffer)
+     */
+    public void setPixels(int x, int y, int w, int h,
+                          int iArray[], DataBuffer data) {
+        if ((x < 0) || (y < 0) || (x + w > width) || (y + h > height)) {
+            throw new ArrayIndexOutOfBoundsException
+                ("Coordinate out of bounds!");
+        }
+
+        for (int k = 0; k < numBands; k++) {
+            int lineOffset = y*scanlineStride + x + bandOffsets[k];
+            int srcOffset = k;
+            int bank = bankIndices[k];
+
+            for (int i = 0; i < h; i++) {
+                int pixelOffset = lineOffset;
+                for (int j = 0; j < w; j++) {
+                    data.setElem(bank, pixelOffset++, iArray[srcOffset]);
+                    srcOffset += numBands;
+                }
+                lineOffset += scanlineStride;
+           }
+        }
+    }
+
+    /**
+     * Sets a sample in the specified band for the pixel located at (x,y)
+     * in the DataBuffer using an int for input.
+     * ArrayIndexOutOfBoundsException may be thrown if the coordinates are
+     * not in bounds.
+     * @param x         The X coordinate of the pixel location
+     * @param y         The Y coordinate of the pixel location
+     * @param b         The band to set
+     * @param s         The input sample as an int
+     * @param data      The DataBuffer containing the image data
+     * @see #getSample(int, int, int, DataBuffer)
+     */
+    public void setSample(int x, int y, int b, int s,
+                          DataBuffer data) {
+        // Bounds check for 'b' will be performed automatically
+        if ((x < 0) || (y < 0) || (x >= width) || (y >= height)) {
+            throw new ArrayIndexOutOfBoundsException
+                ("Coordinate out of bounds!");
+        }
+        data.setElem(bankIndices[b],
+                     y*scanlineStride + x + bandOffsets[b], s);
+    }
+
+    /**
+     * Sets a sample in the specified band for the pixel located at (x,y)
+     * in the DataBuffer using a float for input.
+     * ArrayIndexOutOfBoundsException may be thrown if the coordinates are
+     * not in bounds.
+     * @param x         The X coordinate of the pixel location
+     * @param y         The Y coordinate of the pixel location
+     * @param b         The band to set
+     * @param s         The input sample as a float
+     * @param data      The DataBuffer containing the image data
+     * @see #getSample(int, int, int, DataBuffer)
+     */
+    public void setSample(int x, int y, int b,
+                          float s ,
+                          DataBuffer data) {
+        // Bounds check for 'b' will be performed automatically
+        if ((x < 0) || (y < 0) || (x >= width) || (y >= height)) {
+            throw new ArrayIndexOutOfBoundsException
+                ("Coordinate out of bounds!");
+        }
+        data.setElemFloat(bankIndices[b],
+                          y*scanlineStride + x + bandOffsets[b], s);
+    }
+
+    /**
+     * Sets a sample in the specified band for the pixel located at (x,y)
+     * in the DataBuffer using a double for input.
+     * ArrayIndexOutOfBoundsException may be thrown if the coordinates are
+     * not in bounds.
+     * @param x         The X coordinate of the pixel location
+     * @param y         The Y coordinate of the pixel location
+     * @param b         The band to set
+     * @param s         The input sample as a double
+     * @param data      The DataBuffer containing the image data
+     * @see #getSample(int, int, int, DataBuffer)
+     */
+    public void setSample(int x, int y, int b,
+                          double s,
+                          DataBuffer data) {
+        // Bounds check for 'b' will be performed automatically
+        if ((x < 0) || (y < 0) || (x >= width) || (y >= height)) {
+            throw new ArrayIndexOutOfBoundsException
+                ("Coordinate out of bounds!");
+        }
+        data.setElemDouble(bankIndices[b],
+                          y*scanlineStride + x + bandOffsets[b], s);
+    }
+
+    /**
+     * Sets the samples in the specified band for the specified rectangle
+     * of pixels from an int array containing one sample per data array element.
+     * ArrayIndexOutOfBoundsException may be thrown if the coordinates are
+     * not in bounds.
+     * @param x         The X coordinate of the upper left pixel location
+     * @param y         The Y coordinate of the upper left pixel location
+     * @param w         The width of the pixel rectangle
+     * @param h         The height of the pixel rectangle
+     * @param b         The band to set
+     * @param iArray    The input sample array
+     * @param data      The DataBuffer containing the image data
+     * @see #getSamples(int, int, int, int, int, int[], DataBuffer)
+     */
+    public void setSamples(int x, int y, int w, int h, int b,
+                           int iArray[], DataBuffer data) {
+        // Bounds check for 'b' will be performed automatically
+        if ((x < 0) || (y < 0) || (x + w > width) || (y + h > height)) {
+            throw new ArrayIndexOutOfBoundsException
+                ("Coordinate out of bounds!");
+        }
+        int lineOffset = y*scanlineStride + x + bandOffsets[b];
+        int srcOffset = 0;
+        int bank = bankIndices[b];
+
+        for (int i = 0; i < h; i++) {
+           int sampleOffset = lineOffset;
+           for (int j = 0; j < w; j++) {
+              data.setElem(bank, sampleOffset++, iArray[srcOffset++]);
+           }
+           lineOffset += scanlineStride;
+        }
+    }
+
+    private static int[] createOffsetArray(int numBands) {
+        int[] bandOffsets = new int[numBands];
+        for (int i=0; i < numBands; i++) {
+            bandOffsets[i] = 0;
+        }
+        return bandOffsets;
+    }
+
+    private static int[] createIndicesArray(int numBands) {
+        int[] bankIndices = new int[numBands];
+        for (int i=0; i < numBands; i++) {
+            bankIndices[i] = i;
+        }
+        return bankIndices;
+    }
+
+    // Differentiate hash code from other ComponentSampleModel subclasses
+    public int hashCode() {
+        return super.hashCode() ^ 0x2;
+    }
+}
--- a/jdk/src/share/classes/java/awt/image/BufferedImage.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/java/awt/image/BufferedImage.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1210,9 +1210,9 @@
      *          <code>BufferedImage</code>.
      */
     public String toString() {
-        return new String("BufferedImage@"+Integer.toHexString(hashCode())
-                          +": type = "+imageType
-                          +" "+colorModel+" "+raster);
+        return "BufferedImage@"+Integer.toHexString(hashCode())
+            +": type = "+imageType
+            +" "+colorModel+" "+raster;
     }
 
     /**
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/classes/java/awt/image/ColorConvertOp.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,1109 @@
+/*
+ * Portions Copyright 1997-2007 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) Eastman Kodak Company, 1997                      ***
+ *** As  an unpublished  work pursuant to Title 17 of the United    ***
+ *** States Code.  All rights reserved.                             ***
+ **********************************************************************
+ **********************************************************************
+ **********************************************************************/
+
+package java.awt.image;
+
+import java.awt.Point;
+import java.awt.Graphics2D;
+import java.awt.color.*;
+import sun.java2d.cmm.ColorTransform;
+import sun.java2d.cmm.CMSManager;
+import sun.java2d.cmm.ProfileDeferralMgr;
+import sun.java2d.cmm.PCMM;
+import java.awt.geom.Rectangle2D;
+import java.awt.geom.Point2D;
+import java.awt.RenderingHints;
+
+/**
+ * This class performs a pixel-by-pixel color conversion of the data in
+ * the source image.  The resulting color values are scaled to the precision
+ * of the destination image.  Color conversion can be specified
+ * via an array of ColorSpace objects or an array of ICC_Profile objects.
+ * <p>
+ * If the source is a BufferedImage with premultiplied alpha, the
+ * color components are divided by the alpha component before color conversion.
+ * If the destination is a BufferedImage with premultiplied alpha, the
+ * color components are multiplied by the alpha component after conversion.
+ * Rasters are treated as having no alpha channel, i.e. all bands are
+ * color bands.
+ * <p>
+ * If a RenderingHints object is specified in the constructor, the
+ * color rendering hint and the dithering hint may be used to control
+ * color conversion.
+ * <p>
+ * Note that Source and Destination may be the same object.
+ * <p>
+ * @see java.awt.RenderingHints#KEY_COLOR_RENDERING
+ * @see java.awt.RenderingHints#KEY_DITHERING
+ */
+public class ColorConvertOp implements BufferedImageOp, RasterOp {
+    ICC_Profile[]    profileList;
+    ColorSpace[]     CSList;
+    ColorTransform    thisTransform, thisRasterTransform;
+    ICC_Profile      thisSrcProfile, thisDestProfile;
+    RenderingHints   hints;
+    boolean          gotProfiles;
+    float[]          srcMinVals, srcMaxVals, dstMinVals, dstMaxVals;
+
+    /* the class initializer */
+    static {
+        if (ProfileDeferralMgr.deferring) {
+            ProfileDeferralMgr.activateProfiles();
+        }
+    }
+
+    /**
+     * Constructs a new ColorConvertOp which will convert
+     * from a source color space to a destination color space.
+     * The RenderingHints argument may be null.
+     * This Op can be used only with BufferedImages, and will convert
+     * directly from the ColorSpace of the source image to that of the
+     * destination.  The destination argument of the filter method
+     * cannot be specified as null.
+     * @param hints the <code>RenderingHints</code> object used to control
+     *        the color conversion, or <code>null</code>
+     */
+    public ColorConvertOp (RenderingHints hints)
+    {
+        profileList = new ICC_Profile [0];    /* 0 length list */
+        this.hints  = hints;
+    }
+
+    /**
+     * Constructs a new ColorConvertOp from a ColorSpace object.
+     * The RenderingHints argument may be null.  This
+     * Op can be used only with BufferedImages, and is primarily useful
+     * when the {@link #filter(BufferedImage, BufferedImage) filter}
+     * method is invoked with a destination argument of null.
+     * In that case, the ColorSpace defines the destination color space
+     * for the destination created by the filter method.  Otherwise, the
+     * ColorSpace defines an intermediate space to which the source is
+     * converted before being converted to the destination space.
+     * @param cspace defines the destination <code>ColorSpace</code> or an
+     *        intermediate <code>ColorSpace</code>
+     * @param hints the <code>RenderingHints</code> object used to control
+     *        the color conversion, or <code>null</code>
+     * @throws NullPointerException if cspace is null
+     */
+    public ColorConvertOp (ColorSpace cspace, RenderingHints hints)
+    {
+        if (cspace == null) {
+            throw new NullPointerException("ColorSpace cannot be null");
+        }
+        if (cspace instanceof ICC_ColorSpace) {
+            profileList = new ICC_Profile [1];    /* 1 profile in the list */
+
+            profileList [0] = ((ICC_ColorSpace) cspace).getProfile();
+        }
+        else {
+            CSList = new ColorSpace[1]; /* non-ICC case: 1 ColorSpace in list */
+            CSList[0] = cspace;
+        }
+        this.hints  = hints;
+    }
+
+
+    /**
+     * Constructs a new ColorConvertOp from two ColorSpace objects.
+     * The RenderingHints argument may be null.
+     * This Op is primarily useful for calling the filter method on
+     * Rasters, in which case the two ColorSpaces define the operation
+     * to be performed on the Rasters.  In that case, the number of bands
+     * in the source Raster must match the number of components in
+     * srcCspace, and the number of bands in the destination Raster
+     * must match the number of components in dstCspace.  For BufferedImages,
+     * the two ColorSpaces define intermediate spaces through which the
+     * source is converted before being converted to the destination space.
+     * @param srcCspace the source <code>ColorSpace</code>
+     * @param dstCspace the destination <code>ColorSpace</code>
+     * @param hints the <code>RenderingHints</code> object used to control
+     *        the color conversion, or <code>null</code>
+     * @throws NullPointerException if either srcCspace or dstCspace is null
+     */
+    public ColorConvertOp(ColorSpace srcCspace, ColorSpace dstCspace,
+                           RenderingHints hints)
+    {
+        if ((srcCspace == null) || (dstCspace == null)) {
+            throw new NullPointerException("ColorSpaces cannot be null");
+        }
+        if ((srcCspace instanceof ICC_ColorSpace) &&
+            (dstCspace instanceof ICC_ColorSpace)) {
+            profileList = new ICC_Profile [2];    /* 2 profiles in the list */
+
+            profileList [0] = ((ICC_ColorSpace) srcCspace).getProfile();
+            profileList [1] = ((ICC_ColorSpace) dstCspace).getProfile();
+
+            getMinMaxValsFromColorSpaces(srcCspace, dstCspace);
+        } else {
+            /* non-ICC case: 2 ColorSpaces in list */
+            CSList = new ColorSpace[2];
+            CSList[0] = srcCspace;
+            CSList[1] = dstCspace;
+        }
+        this.hints  = hints;
+    }
+
+
+     /**
+     * Constructs a new ColorConvertOp from an array of ICC_Profiles.
+     * The RenderingHints argument may be null.
+     * The sequence of profiles may include profiles that represent color
+     * spaces, profiles that represent effects, etc.  If the whole sequence
+     * does not represent a well-defined color conversion, an exception is
+     * thrown.
+     * <p>For BufferedImages, if the ColorSpace
+     * of the source BufferedImage does not match the requirements of the
+     * first profile in the array,
+     * the first conversion is to an appropriate ColorSpace.
+     * If the requirements of the last profile in the array are not met
+     * by the ColorSpace of the destination BufferedImage,
+     * the last conversion is to the destination's ColorSpace.
+     * <p>For Rasters, the number of bands in the source Raster must match
+     * the requirements of the first profile in the array, and the
+     * number of bands in the destination Raster must match the requirements
+     * of the last profile in the array.  The array must have at least two
+     * elements or calling the filter method for Rasters will throw an
+     * IllegalArgumentException.
+     * @param profiles the array of <code>ICC_Profile</code> objects
+     * @param hints the <code>RenderingHints</code> object used to control
+     *        the color conversion, or <code>null</code>
+     * @exception IllegalArgumentException when the profile sequence does not
+     *             specify a well-defined color conversion
+     * @exception NullPointerException if profiles is null
+     */
+    public ColorConvertOp (ICC_Profile[] profiles, RenderingHints hints)
+    {
+        if (profiles == null) {
+            throw new NullPointerException("Profiles cannot be null");
+        }
+        gotProfiles = true;
+        profileList = new ICC_Profile[profiles.length];
+        for (int i1 = 0; i1 < profiles.length; i1++) {
+            profileList[i1] = profiles[i1];
+        }
+        this.hints  = hints;
+    }
+
+
+    /**
+     * Returns the array of ICC_Profiles used to construct this ColorConvertOp.
+     * Returns null if the ColorConvertOp was not constructed from such an
+     * array.
+     * @return the array of <code>ICC_Profile</code> objects of this
+     *         <code>ColorConvertOp</code>, or <code>null</code> if this
+     *         <code>ColorConvertOp</code> was not constructed with an
+     *         array of <code>ICC_Profile</code> objects.
+     */
+    public final ICC_Profile[] getICC_Profiles() {
+        if (gotProfiles) {
+            ICC_Profile[] profiles = new ICC_Profile[profileList.length];
+            for (int i1 = 0; i1 < profileList.length; i1++) {
+                profiles[i1] = profileList[i1];
+            }
+            return profiles;
+        }
+        return null;
+    }
+
+    /**
+     * ColorConverts the source BufferedImage.
+     * If the destination image is null,
+     * a BufferedImage will be created with an appropriate ColorModel.
+     * @param src the source <code>BufferedImage</code> to be converted
+     * @param dest the destination <code>BufferedImage</code>,
+     *        or <code>null</code>
+     * @return <code>dest</code> color converted from <code>src</code>
+     *         or a new, converted <code>BufferedImage</code>
+     *         if <code>dest</code> is <code>null</code>
+     * @exception IllegalArgumentException if dest is null and this op was
+     *             constructed using the constructor which takes only a
+     *             RenderingHints argument, since the operation is ill defined.
+     */
+    public final BufferedImage filter(BufferedImage src, BufferedImage dest) {
+        ColorSpace srcColorSpace, destColorSpace;
+        BufferedImage savdest = null;
+
+        if (src.getColorModel() instanceof IndexColorModel) {
+            IndexColorModel icm = (IndexColorModel) src.getColorModel();
+            src = icm.convertToIntDiscrete(src.getRaster(), true);
+        }
+        srcColorSpace = src.getColorModel().getColorSpace();
+        if (dest != null) {
+            if (dest.getColorModel() instanceof IndexColorModel) {
+                savdest = dest;
+                dest = null;
+                destColorSpace = null;
+            } else {
+                destColorSpace = dest.getColorModel().getColorSpace();
+            }
+        } else {
+            destColorSpace = null;
+        }
+
+        if ((CSList != null) ||
+            (!(srcColorSpace instanceof ICC_ColorSpace)) ||
+            ((dest != null) &&
+             (!(destColorSpace instanceof ICC_ColorSpace)))) {
+            /* non-ICC case */
+            dest = nonICCBIFilter(src, srcColorSpace, dest, destColorSpace);
+        } else {
+            dest = ICCBIFilter(src, srcColorSpace, dest, destColorSpace);
+        }
+
+        if (savdest != null) {
+            Graphics2D big = savdest.createGraphics();
+            try {
+                big.drawImage(dest, 0, 0, null);
+            } finally {
+                big.dispose();
+            }
+            return savdest;
+        } else {
+            return dest;
+        }
+    }
+
+    private final BufferedImage ICCBIFilter(BufferedImage src,
+                                            ColorSpace srcColorSpace,
+                                            BufferedImage dest,
+                                            ColorSpace destColorSpace) {
+    int              nProfiles = profileList.length;
+    ICC_Profile      srcProfile = null, destProfile = null;
+
+        srcProfile = ((ICC_ColorSpace) srcColorSpace).getProfile();
+
+        if (dest == null) {        /* last profile in the list defines
+                                      the output color space */
+            if (nProfiles == 0) {
+                throw new IllegalArgumentException(
+                    "Destination ColorSpace is undefined");
+            }
+            destProfile = profileList [nProfiles - 1];
+            dest = createCompatibleDestImage(src, null);
+        }
+        else {
+            if (src.getHeight() != dest.getHeight() ||
+                src.getWidth() != dest.getWidth()) {
+                throw new IllegalArgumentException(
+                    "Width or height of BufferedImages do not match");
+            }
+            destProfile = ((ICC_ColorSpace) destColorSpace).getProfile();
+        }
+
+        /* Checking if all profiles in the transform sequence are the same.
+         * If so, performing just copying the data.
+         */
+        if (srcProfile == destProfile) {
+            boolean noTrans = true;
+            for (int i = 0; i < nProfiles; i++) {
+                if (srcProfile != profileList[i]) {
+                    noTrans = false;
+                    break;
+                }
+            }
+            if (noTrans) {
+                Graphics2D g = dest.createGraphics();
+                try {
+                    g.drawImage(src, 0, 0, null);
+                } finally {
+                    g.dispose();
+                }
+
+                return dest;
+            }
+        }
+
+        /* make a new transform if needed */
+        if ((thisTransform == null) || (thisSrcProfile != srcProfile) ||
+            (thisDestProfile != destProfile) ) {
+            updateBITransform(srcProfile, destProfile);
+        }
+
+        /* color convert the image */
+        thisTransform.colorConvert(src, dest);
+
+        return dest;
+    }
+
+    private void updateBITransform(ICC_Profile srcProfile,
+                                   ICC_Profile destProfile) {
+        ICC_Profile[]    theProfiles;
+        int              i1, nProfiles, nTransforms, whichTrans, renderState;
+        ColorTransform[]  theTransforms;
+        boolean          useSrc = false, useDest = false;
+
+        nProfiles = profileList.length;
+        nTransforms = nProfiles;
+        if ((nProfiles == 0) || (srcProfile != profileList[0])) {
+            nTransforms += 1;
+            useSrc = true;
+        }
+        if ((nProfiles == 0) || (destProfile != profileList[nProfiles - 1]) ||
+            (nTransforms < 2)) {
+            nTransforms += 1;
+            useDest = true;
+        }
+
+        /* make the profile list */
+        theProfiles = new ICC_Profile[nTransforms]; /* the list of profiles
+                                                       for this Op */
+
+        int idx = 0;
+        if (useSrc) {
+            /* insert source as first profile */
+            theProfiles[idx++] = srcProfile;
+        }
+
+        for (i1 = 0; i1 < nProfiles; i1++) {
+                                   /* insert profiles defined in this Op */
+            theProfiles[idx++] = profileList [i1];
+        }
+
+        if (useDest) {
+            /* insert dest as last profile */
+            theProfiles[idx] = destProfile;
+        }
+
+        /* make the transform list */
+        theTransforms = new ColorTransform [nTransforms];
+
+        /* initialize transform get loop */
+        if (theProfiles[0].getProfileClass() == ICC_Profile.CLASS_OUTPUT) {
+                                        /* if first profile is a printer
+                                           render as colorimetric */
+            renderState = ICC_Profile.icRelativeColorimetric;
+        }
+        else {
+            renderState = ICC_Profile.icPerceptual; /* render any other
+                                                       class perceptually */
+        }
+
+        whichTrans = ColorTransform.In;
+
+        PCMM mdl = CMSManager.getModule();
+
+        /* get the transforms from each profile */
+        for (i1 = 0; i1 < nTransforms; i1++) {
+            if (i1 == nTransforms -1) {         /* last profile? */
+                whichTrans = ColorTransform.Out; /* get output transform */
+            }
+            else {      /* check for abstract profile */
+                if ((whichTrans == ColorTransform.Simulation) &&
+                    (theProfiles[i1].getProfileClass () ==
+                     ICC_Profile.CLASS_ABSTRACT)) {
+                renderState = ICC_Profile.icPerceptual;
+                    whichTrans = ColorTransform.In;
+                }
+            }
+
+            theTransforms[i1] = mdl.createTransform (
+                theProfiles[i1], renderState, whichTrans);
+
+            /* get this profile's rendering intent to select transform
+               from next profile */
+            renderState = getRenderingIntent(theProfiles[i1]);
+
+            /* "middle" profiles use simulation transform */
+            whichTrans = ColorTransform.Simulation;
+        }
+
+        /* make the net transform */
+        thisTransform = mdl.createTransform(theTransforms);
+
+        /* update corresponding source and dest profiles */
+        thisSrcProfile = srcProfile;
+        thisDestProfile = destProfile;
+    }
+
+    /**
+     * ColorConverts the image data in the source Raster.
+     * If the destination Raster is null, a new Raster will be created.
+     * The number of bands in the source and destination Rasters must
+     * meet the requirements explained above.  The constructor used to
+     * create this ColorConvertOp must have provided enough information
+     * to define both source and destination color spaces.  See above.
+     * Otherwise, an exception is thrown.
+     * @param src the source <code>Raster</code> to be converted
+     * @param dest the destination <code>WritableRaster</code>,
+     *        or <code>null</code>
+     * @return <code>dest</code> color converted from <code>src</code>
+     *         or a new, converted <code>WritableRaster</code>
+     *         if <code>dest</code> is <code>null</code>
+     * @exception IllegalArgumentException if the number of source or
+     *             destination bands is incorrect, the source or destination
+     *             color spaces are undefined, or this op was constructed
+     *             with one of the constructors that applies only to
+     *             operations on BufferedImages.
+     */
+    public final WritableRaster filter (Raster src, WritableRaster dest)  {
+
+        if (CSList != null) {
+            /* non-ICC case */
+            return nonICCRasterFilter(src, dest);
+        }
+        int nProfiles = profileList.length;
+        if (nProfiles < 2) {
+            throw new IllegalArgumentException(
+                "Source or Destination ColorSpace is undefined");
+        }
+        if (src.getNumBands() != profileList[0].getNumComponents()) {
+            throw new IllegalArgumentException(
+                "Numbers of source Raster bands and source color space " +
+                "components do not match");
+        }
+        if (dest == null) {
+            dest = createCompatibleDestRaster(src);
+        }
+        else {
+            if (src.getHeight() != dest.getHeight() ||
+                src.getWidth() != dest.getWidth()) {
+                throw new IllegalArgumentException(
+                    "Width or height of Rasters do not match");
+            }
+            if (dest.getNumBands() !=
+                profileList[nProfiles-1].getNumComponents()) {
+                throw new IllegalArgumentException(
+                    "Numbers of destination Raster bands and destination " +
+                    "color space components do not match");
+            }
+        }
+
+        /* make a new transform if needed */
+        if (thisRasterTransform == null) {
+            int              i1, whichTrans, renderState;
+            ColorTransform[]  theTransforms;
+
+            /* make the transform list */
+            theTransforms = new ColorTransform [nProfiles];
+
+            /* initialize transform get loop */
+            if (profileList[0].getProfileClass() == ICC_Profile.CLASS_OUTPUT) {
+                                            /* if first profile is a printer
+                                               render as colorimetric */
+                renderState = ICC_Profile.icRelativeColorimetric;
+            }
+            else {
+                renderState = ICC_Profile.icPerceptual; /* render any other
+                                                           class perceptually */
+            }
+
+            whichTrans = ColorTransform.In;
+
+            PCMM mdl = CMSManager.getModule();
+
+            /* get the transforms from each profile */
+            for (i1 = 0; i1 < nProfiles; i1++) {
+                if (i1 == nProfiles -1) {         /* last profile? */
+                    whichTrans = ColorTransform.Out; /* get output transform */
+                }
+                else {  /* check for abstract profile */
+                    if ((whichTrans == ColorTransform.Simulation) &&
+                        (profileList[i1].getProfileClass () ==
+                         ICC_Profile.CLASS_ABSTRACT)) {
+                        renderState = ICC_Profile.icPerceptual;
+                        whichTrans = ColorTransform.In;
+                    }
+                }
+
+                theTransforms[i1] = mdl.createTransform (
+                    profileList[i1], renderState, whichTrans);
+
+                /* get this profile's rendering intent to select transform
+                   from next profile */
+                renderState = getRenderingIntent(profileList[i1]);
+
+                /* "middle" profiles use simulation transform */
+                whichTrans = ColorTransform.Simulation;
+            }
+
+            /* make the net transform */
+            thisRasterTransform = mdl.createTransform(theTransforms);
+        }
+
+        int srcTransferType = src.getTransferType();
+        int dstTransferType = dest.getTransferType();
+        if ((srcTransferType == DataBuffer.TYPE_FLOAT) ||
+            (srcTransferType == DataBuffer.TYPE_DOUBLE) ||
+            (dstTransferType == DataBuffer.TYPE_FLOAT) ||
+            (dstTransferType == DataBuffer.TYPE_DOUBLE)) {
+            if (srcMinVals == null) {
+                getMinMaxValsFromProfiles(profileList[0],
+                                          profileList[nProfiles-1]);
+            }
+            /* color convert the raster */
+            thisRasterTransform.colorConvert(src, dest,
+                                             srcMinVals, srcMaxVals,
+                                             dstMinVals, dstMaxVals);
+        } else {
+            /* color convert the raster */
+            thisRasterTransform.colorConvert(src, dest);
+        }
+
+
+        return dest;
+    }
+
+    /**
+     * Returns the bounding box of the destination, given this source.
+     * Note that this will be the same as the the bounding box of the
+     * source.
+     * @param src the source <code>BufferedImage</code>
+     * @return a <code>Rectangle2D</code> that is the bounding box
+     *         of the destination, given the specified <code>src</code>
+     */
+    public final Rectangle2D getBounds2D (BufferedImage src) {
+        return getBounds2D(src.getRaster());
+    }
+
+    /**
+     * Returns the bounding box of the destination, given this source.
+     * Note that this will be the same as the the bounding box of the
+     * source.
+     * @param src the source <code>Raster</code>
+     * @return a <code>Rectangle2D</code> that is the bounding box
+     *         of the destination, given the specified <code>src</code>
+     */
+    public final Rectangle2D getBounds2D (Raster src) {
+        /*        return new Rectangle (src.getXOffset(),
+                              src.getYOffset(),
+                              src.getWidth(), src.getHeight()); */
+        return src.getBounds();
+    }
+
+    /**
+     * Creates a zeroed destination image with the correct size and number of
+     * bands, given this source.
+     * @param src       Source image for the filter operation.
+     * @param destCM    ColorModel of the destination.  If null, an
+     *                  appropriate ColorModel will be used.
+     * @return a <code>BufferedImage</code> with the correct size and
+     * number of bands from the specified <code>src</code>.
+     * @throws IllegalArgumentException if <code>destCM</code> is
+     *         <code>null</code> and this <code>ColorConvertOp</code> was
+     *         created without any <code>ICC_Profile</code> or
+     *         <code>ColorSpace</code> defined for the destination
+     */
+    public BufferedImage createCompatibleDestImage (BufferedImage src,
+                                                    ColorModel destCM) {
+        ColorSpace cs = null;;
+        if (destCM == null) {
+            if (CSList == null) {
+                /* ICC case */
+                int nProfiles = profileList.length;
+                if (nProfiles == 0) {
+                    throw new IllegalArgumentException(
+                        "Destination ColorSpace is undefined");
+                }
+                ICC_Profile destProfile = profileList[nProfiles - 1];
+                cs = new ICC_ColorSpace(destProfile);
+            } else {
+                /* non-ICC case */
+                int nSpaces = CSList.length;
+                cs = CSList[nSpaces - 1];
+            }
+        }
+        return createCompatibleDestImage(src, destCM, cs);
+    }
+
+    private BufferedImage createCompatibleDestImage(BufferedImage src,
+                                                    ColorModel destCM,
+                                                    ColorSpace destCS) {
+        BufferedImage image;
+        if (destCM == null) {
+            ColorModel srcCM = src.getColorModel();
+            int nbands = destCS.getNumComponents();
+            boolean hasAlpha = srcCM.hasAlpha();
+            if (hasAlpha) {
+               nbands += 1;
+            }
+            int[] nbits = new int[nbands];
+            for (int i = 0; i < nbands; i++) {
+                nbits[i] = 8;
+            }
+            destCM = new ComponentColorModel(destCS, nbits, hasAlpha,
+                                             srcCM.isAlphaPremultiplied(),
+                                             srcCM.getTransparency(),
+                                             DataBuffer.TYPE_BYTE);
+        }
+        int w = src.getWidth();
+        int h = src.getHeight();
+        image = new BufferedImage(destCM,
+                                  destCM.createCompatibleWritableRaster(w, h),
+                                  destCM.isAlphaPremultiplied(), null);
+        return image;
+    }
+
+
+    /**
+     * Creates a zeroed destination Raster with the correct size and number of
+     * bands, given this source.
+     * @param src the specified <code>Raster</code>
+     * @return a <code>WritableRaster</code> with the correct size and number
+     *         of bands from the specified <code>src</code>
+     * @throws IllegalArgumentException if this <code>ColorConvertOp</code>
+     *         was created without sufficient information to define the
+     *         <code>dst</code> and <code>src</code> color spaces
+     */
+    public WritableRaster createCompatibleDestRaster (Raster src) {
+        int ncomponents;
+
+        if (CSList != null) {
+            /* non-ICC case */
+            if (CSList.length != 2) {
+                throw new IllegalArgumentException(
+                    "Destination ColorSpace is undefined");
+            }
+            ncomponents = CSList[1].getNumComponents();
+        } else {
+            /* ICC case */
+            int nProfiles = profileList.length;
+            if (nProfiles < 2) {
+                throw new IllegalArgumentException(
+                    "Destination ColorSpace is undefined");
+            }
+            ncomponents = profileList[nProfiles-1].getNumComponents();
+        }
+
+        WritableRaster dest =
+            Raster.createInterleavedRaster(DataBuffer.TYPE_BYTE,
+                                  src.getWidth(),
+                                  src.getHeight(),
+                                  ncomponents,
+                                  new Point(src.getMinX(), src.getMinY()));
+        return dest;
+    }
+
+    /**
+     * Returns the location of the destination point given a
+     * point in the source.  If <code>dstPt</code> is non-null,
+     * it will be used to hold the return value.  Note that
+     * for this class, the destination point will be the same
+     * as the source point.
+     * @param srcPt the specified source <code>Point2D</code>
+     * @param dstPt the destination <code>Point2D</code>
+     * @return <code>dstPt</code> after setting its location to be
+     *         the same as <code>srcPt</code>
+     */
+    public final Point2D getPoint2D (Point2D srcPt, Point2D dstPt) {
+        if (dstPt == null) {
+            dstPt = new Point2D.Float();
+        }
+        dstPt.setLocation(srcPt.getX(), srcPt.getY());
+
+        return dstPt;
+    }
+
+
+    /**
+     * Returns the RenderingIntent from the specified ICC Profile.
+     */
+    private int getRenderingIntent (ICC_Profile profile) {
+        byte[] header = profile.getData(ICC_Profile.icSigHead);
+        int index = ICC_Profile.icHdrRenderingIntent;
+        return (((header[index]   & 0xff) << 24) |
+                ((header[index+1] & 0xff) << 16) |
+                ((header[index+2] & 0xff) <<  8) |
+                 (header[index+3] & 0xff));
+    }
+
+    /**
+     * Returns the rendering hints used by this op.
+     * @return the <code>RenderingHints</code> object of this
+     *         <code>ColorConvertOp</code>
+     */
+    public final RenderingHints getRenderingHints() {
+        return hints;
+    }
+
+    private final BufferedImage nonICCBIFilter(BufferedImage src,
+                                               ColorSpace srcColorSpace,
+                                               BufferedImage dst,
+                                               ColorSpace dstColorSpace) {
+
+        int w = src.getWidth();
+        int h = src.getHeight();
+        ICC_ColorSpace ciespace =
+            (ICC_ColorSpace) ColorSpace.getInstance(ColorSpace.CS_CIEXYZ);
+        if (dst == null) {
+            dst = createCompatibleDestImage(src, null);
+            dstColorSpace = dst.getColorModel().getColorSpace();
+        } else {
+            if ((h != dst.getHeight()) || (w != dst.getWidth())) {
+                throw new IllegalArgumentException(
+                    "Width or height of BufferedImages do not match");
+            }
+        }
+        Raster srcRas = src.getRaster();
+        WritableRaster dstRas = dst.getRaster();
+        ColorModel srcCM = src.getColorModel();
+        ColorModel dstCM = dst.getColorModel();
+        int srcNumComp = srcCM.getNumColorComponents();
+        int dstNumComp = dstCM.getNumColorComponents();
+        boolean dstHasAlpha = dstCM.hasAlpha();
+        boolean needSrcAlpha = srcCM.hasAlpha() && dstHasAlpha;
+        ColorSpace[] list;
+        if ((CSList == null) && (profileList.length != 0)) {
+            /* possible non-ICC src, some profiles, possible non-ICC dst */
+            boolean nonICCSrc, nonICCDst;
+            ICC_Profile srcProfile, dstProfile;
+            if (!(srcColorSpace instanceof ICC_ColorSpace)) {
+                nonICCSrc = true;
+                srcProfile = ciespace.getProfile();
+            } else {
+                nonICCSrc = false;
+                srcProfile = ((ICC_ColorSpace) srcColorSpace).getProfile();
+            }
+            if (!(dstColorSpace instanceof ICC_ColorSpace)) {
+                nonICCDst = true;
+                dstProfile = ciespace.getProfile();
+            } else {
+                nonICCDst = false;
+                dstProfile = ((ICC_ColorSpace) dstColorSpace).getProfile();
+            }
+            /* make a new transform if needed */
+            if ((thisTransform == null) || (thisSrcProfile != srcProfile) ||
+                (thisDestProfile != dstProfile) ) {
+                updateBITransform(srcProfile, dstProfile);
+            }
+            // process per scanline
+            float maxNum = 65535.0f; // use 16-bit precision in CMM
+            ColorSpace cs;
+            int iccSrcNumComp;
+            if (nonICCSrc) {
+                cs = ciespace;
+                iccSrcNumComp = 3;
+            } else {
+                cs = srcColorSpace;
+                iccSrcNumComp = srcNumComp;
+            }
+            float[] srcMinVal = new float[iccSrcNumComp];
+            float[] srcInvDiffMinMax = new float[iccSrcNumComp];
+            for (int i = 0; i < srcNumComp; i++) {
+                srcMinVal[i] = cs.getMinValue(i);
+                srcInvDiffMinMax[i] = maxNum / (cs.getMaxValue(i) - srcMinVal[i]);
+            }
+            int iccDstNumComp;
+            if (nonICCDst) {
+                cs = ciespace;
+                iccDstNumComp = 3;
+            } else {
+                cs = dstColorSpace;
+                iccDstNumComp = dstNumComp;
+            }
+            float[] dstMinVal = new float[iccDstNumComp];
+            float[] dstDiffMinMax = new float[iccDstNumComp];
+            for (int i = 0; i < dstNumComp; i++) {
+                dstMinVal[i] = cs.getMinValue(i);
+                dstDiffMinMax[i] = (cs.getMaxValue(i) - dstMinVal[i]) / maxNum;
+            }
+            float[] dstColor;
+            if (dstHasAlpha) {
+                int size = ((dstNumComp + 1) > 3) ? (dstNumComp + 1) : 3;
+                dstColor = new float[size];
+            } else {
+                int size = (dstNumComp  > 3) ? dstNumComp : 3;
+                dstColor = new float[size];
+            }
+            short[] srcLine = new short[w * iccSrcNumComp];
+            short[] dstLine = new short[w * iccDstNumComp];
+            Object pixel;
+            float[] color;
+            float[] alpha = null;
+            if (needSrcAlpha) {
+                alpha = new float[w];
+            }
+            int idx;
+            // process each scanline
+            for (int y = 0; y < h; y++) {
+                // convert src scanline
+                pixel = null;
+                color = null;
+                idx = 0;
+                for (int x = 0; x < w; x++) {
+                    pixel = srcRas.getDataElements(x, y, pixel);
+                    color = srcCM.getNormalizedComponents(pixel, color, 0);
+                    if (needSrcAlpha) {
+                        alpha[x] = color[srcNumComp];
+                    }
+                    if (nonICCSrc) {
+                        color = srcColorSpace.toCIEXYZ(color);
+                    }
+                    for (int i = 0; i < iccSrcNumComp; i++) {
+                        srcLine[idx++] = (short)
+                            ((color[i] - srcMinVal[i]) * srcInvDiffMinMax[i] +
+                             0.5f);
+                    }
+                }
+                // color convert srcLine to dstLine
+                thisTransform.colorConvert(srcLine, dstLine);
+                // convert dst scanline
+                pixel = null;
+                idx = 0;
+                for (int x = 0; x < w; x++) {
+                    for (int i = 0; i < iccDstNumComp; i++) {
+                        dstColor[i] = ((float) (dstLine[idx++] & 0xffff)) *
+                                      dstDiffMinMax[i] + dstMinVal[i];
+                    }
+                    if (nonICCDst) {
+                        color = srcColorSpace.fromCIEXYZ(dstColor);
+                        for (int i = 0; i < dstNumComp; i++) {
+                            dstColor[i] = color[i];
+                        }
+                    }
+                    if (needSrcAlpha) {
+                        dstColor[dstNumComp] = alpha[x];
+                    } else if (dstHasAlpha) {
+                        dstColor[dstNumComp] = 1.0f;
+                    }
+                    pixel = dstCM.getDataElements(dstColor, 0, pixel);
+                    dstRas.setDataElements(x, y, pixel);
+                }
+            }
+        } else {
+            /* possible non-ICC src, possible CSList, possible non-ICC dst */
+            // process per pixel
+            int numCS;
+            if (CSList == null) {
+                numCS = 0;
+            } else {
+                numCS = CSList.length;
+            }
+            float[] dstColor;
+            if (dstHasAlpha) {
+                dstColor = new float[dstNumComp + 1];
+            } else {
+                dstColor = new float[dstNumComp];
+            }
+            Object spixel = null;
+            Object dpixel = null;
+            float[] color = null;
+            float[] tmpColor;
+            // process each pixel
+            for (int y = 0; y < h; y++) {
+                for (int x = 0; x < w; x++) {
+                    spixel = srcRas.getDataElements(x, y, spixel);
+                    color = srcCM.getNormalizedComponents(spixel, color, 0);
+                    tmpColor = srcColorSpace.toCIEXYZ(color);
+                    for (int i = 0; i < numCS; i++) {
+                        tmpColor = CSList[i].fromCIEXYZ(tmpColor);
+                        tmpColor = CSList[i].toCIEXYZ(tmpColor);
+                    }
+                    tmpColor = dstColorSpace.fromCIEXYZ(tmpColor);
+                    for (int i = 0; i < dstNumComp; i++) {
+                        dstColor[i] = tmpColor[i];
+                    }
+                    if (needSrcAlpha) {
+                        dstColor[dstNumComp] = color[srcNumComp];
+                    } else if (dstHasAlpha) {
+                        dstColor[dstNumComp] = 1.0f;
+                    }
+                    dpixel = dstCM.getDataElements(dstColor, 0, dpixel);
+                    dstRas.setDataElements(x, y, dpixel);
+
+                }
+            }
+        }
+
+        return dst;
+    }
+
+    /* color convert a Raster - handles byte, ushort, int, short, float,
+       or double transferTypes */
+    private final WritableRaster nonICCRasterFilter(Raster src,
+                                                    WritableRaster dst)  {
+
+        if (CSList.length != 2) {
+            throw new IllegalArgumentException(
+                "Destination ColorSpace is undefined");
+        }
+        if (src.getNumBands() != CSList[0].getNumComponents()) {
+            throw new IllegalArgumentException(
+                "Numbers of source Raster bands and source color space " +
+                "components do not match");
+        }
+        if (dst == null) {
+            dst = createCompatibleDestRaster(src);
+        } else {
+            if (src.getHeight() != dst.getHeight() ||
+                src.getWidth() != dst.getWidth()) {
+                throw new IllegalArgumentException(
+                    "Width or height of Rasters do not match");
+            }
+            if (dst.getNumBands() != CSList[1].getNumComponents()) {
+                throw new IllegalArgumentException(
+                    "Numbers of destination Raster bands and destination " +
+                    "color space components do not match");
+            }
+        }
+
+        if (srcMinVals == null) {
+            getMinMaxValsFromColorSpaces(CSList[0], CSList[1]);
+        }
+
+        SampleModel srcSM = src.getSampleModel();
+        SampleModel dstSM = dst.getSampleModel();
+        boolean srcIsFloat, dstIsFloat;
+        int srcTransferType = src.getTransferType();
+        int dstTransferType = dst.getTransferType();
+        if ((srcTransferType == DataBuffer.TYPE_FLOAT) ||
+            (srcTransferType == DataBuffer.TYPE_DOUBLE)) {
+            srcIsFloat = true;
+        } else {
+            srcIsFloat = false;
+        }
+        if ((dstTransferType == DataBuffer.TYPE_FLOAT) ||
+            (dstTransferType == DataBuffer.TYPE_DOUBLE)) {
+            dstIsFloat = true;
+        } else {
+            dstIsFloat = false;
+        }
+        int w = src.getWidth();
+        int h = src.getHeight();
+        int srcNumBands = src.getNumBands();
+        int dstNumBands = dst.getNumBands();
+        float[] srcScaleFactor = null;
+        float[] dstScaleFactor = null;
+        if (!srcIsFloat) {
+            srcScaleFactor = new float[srcNumBands];
+            for (int i = 0; i < srcNumBands; i++) {
+                if (srcTransferType == DataBuffer.TYPE_SHORT) {
+                    srcScaleFactor[i] = (srcMaxVals[i] - srcMinVals[i]) /
+                                        32767.0f;
+                } else {
+                    srcScaleFactor[i] = (srcMaxVals[i] - srcMinVals[i]) /
+                        ((float) ((1 << srcSM.getSampleSize(i)) - 1));
+                }
+            }
+        }
+        if (!dstIsFloat) {
+            dstScaleFactor = new float[dstNumBands];
+            for (int i = 0; i < dstNumBands; i++) {
+                if (dstTransferType == DataBuffer.TYPE_SHORT) {
+                    dstScaleFactor[i] = 32767.0f /
+                                        (dstMaxVals[i] - dstMinVals[i]);
+                } else {
+                    dstScaleFactor[i] =
+                        ((float) ((1 << dstSM.getSampleSize(i)) - 1)) /
+                        (dstMaxVals[i] - dstMinVals[i]);
+                }
+            }
+        }
+        int ys = src.getMinY();
+        int yd = dst.getMinY();
+        int xs, xd;
+        float sample;
+        float[] color = new float[srcNumBands];
+        float[] tmpColor;
+        ColorSpace srcColorSpace = CSList[0];
+        ColorSpace dstColorSpace = CSList[1];
+        // process each pixel
+        for (int y = 0; y < h; y++, ys++, yd++) {
+            // get src scanline
+            xs = src.getMinX();
+            xd = dst.getMinX();
+            for (int x = 0; x < w; x++, xs++, xd++) {
+                for (int i = 0; i < srcNumBands; i++) {
+                    sample = src.getSampleFloat(xs, ys, i);
+                    if (!srcIsFloat) {
+                        sample = sample * srcScaleFactor[i] + srcMinVals[i];
+                    }
+                    color[i] = sample;
+                }
+                tmpColor = srcColorSpace.toCIEXYZ(color);
+                tmpColor = dstColorSpace.fromCIEXYZ(tmpColor);
+                for (int i = 0; i < dstNumBands; i++) {
+                    sample = tmpColor[i];
+                    if (!dstIsFloat) {
+                        sample = (sample - dstMinVals[i]) * dstScaleFactor[i];
+                    }
+                    dst.setSample(xd, yd, i, sample);
+                }
+            }
+        }
+        return dst;
+    }
+
+    private void getMinMaxValsFromProfiles(ICC_Profile srcProfile,
+                                           ICC_Profile dstProfile) {
+        int type = srcProfile.getColorSpaceType();
+        int nc = srcProfile.getNumComponents();
+        srcMinVals = new float[nc];
+        srcMaxVals = new float[nc];
+        setMinMax(type, nc, srcMinVals, srcMaxVals);
+        type = dstProfile.getColorSpaceType();
+        nc = dstProfile.getNumComponents();
+        dstMinVals = new float[nc];
+        dstMaxVals = new float[nc];
+        setMinMax(type, nc, dstMinVals, dstMaxVals);
+    }
+
+    private void setMinMax(int type, int nc, float[] minVals, float[] maxVals) {
+        if (type == ColorSpace.TYPE_Lab) {
+            minVals[0] = 0.0f;    // L
+            maxVals[0] = 100.0f;
+            minVals[1] = -128.0f; // a
+            maxVals[1] = 127.0f;
+            minVals[2] = -128.0f; // b
+            maxVals[2] = 127.0f;
+        } else if (type == ColorSpace.TYPE_XYZ) {
+            minVals[0] = minVals[1] = minVals[2] = 0.0f; // X, Y, Z
+            maxVals[0] = maxVals[1] = maxVals[2] = 1.0f + (32767.0f/ 32768.0f);
+        } else {
+            for (int i = 0; i < nc; i++) {
+                minVals[i] = 0.0f;
+                maxVals[i] = 1.0f;
+            }
+        }
+    }
+
+    private void getMinMaxValsFromColorSpaces(ColorSpace srcCspace,
+                                              ColorSpace dstCspace) {
+        int nc = srcCspace.getNumComponents();
+        srcMinVals = new float[nc];
+        srcMaxVals = new float[nc];
+        for (int i = 0; i < nc; i++) {
+            srcMinVals[i] = srcCspace.getMinValue(i);
+            srcMaxVals[i] = srcCspace.getMaxValue(i);
+        }
+        nc = dstCspace.getNumComponents();
+        dstMinVals = new float[nc];
+        dstMaxVals = new float[nc];
+        for (int i = 0; i < nc; i++) {
+            dstMinVals[i] = dstCspace.getMinValue(i);
+            dstMaxVals[i] = dstCspace.getMaxValue(i);
+        }
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/classes/java/awt/image/ComponentSampleModel.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,1202 @@
+/*
+ * Portions Copyright 1997-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) Eastman Kodak Company, 1997
+ *** As  an unpublished  work pursuant to Title 17 of the United
+ *** States Code.  All rights reserved.
+ ******************************************************************
+ ******************************************************************
+ ******************************************************************/
+
+package java.awt.image;
+
+import java.util.Arrays;
+
+/**
+ *  This class represents image data which is stored such that each sample
+ *  of a pixel occupies one data element of the DataBuffer.  It stores the
+ *  N samples which make up a pixel in N separate data array elements.
+ *  Different bands may be in different banks of the DataBuffer.
+ *  Accessor methods are provided so that image data can be manipulated
+ *  directly. This class can support different kinds of interleaving, e.g.
+ *  band interleaving, scanline interleaving, and pixel interleaving.
+ *  Pixel stride is the number of data array elements between two samples
+ *  for the same band on the same scanline. Scanline stride is the number
+ *  of data array elements between a given sample and the corresponding sample
+ *  in the same column of the next scanline.  Band offsets denote the number
+ *  of data array elements from the first data array element of the bank
+ *  of the DataBuffer holding each band to the first sample of the band.
+ *  The bands are numbered from 0 to N-1.  This class can represent image
+ *  data for which each sample is an unsigned integral number which can be
+ *  stored in 8, 16, or 32 bits (using <code>DataBuffer.TYPE_BYTE</code>,
+ *  <code>DataBuffer.TYPE_USHORT</code>, or <code>DataBuffer.TYPE_INT</code>,
+ *  respectively), data for which each sample is a signed integral number
+ *  which can be stored in 16 bits (using <code>DataBuffer.TYPE_SHORT</code>),
+ *  or data for which each sample is a signed float or double quantity
+ *  (using <code>DataBuffer.TYPE_FLOAT</code> or
+ *  <code>DataBuffer.TYPE_DOUBLE</code>, respectively).
+ *  All samples of a given ComponentSampleModel
+ *  are stored with the same precision.  All strides and offsets must be
+ *  non-negative.  This class supports
+ *  {@link DataBuffer#TYPE_BYTE TYPE_BYTE},
+ *  {@link DataBuffer#TYPE_USHORT TYPE_USHORT},
+ *  {@link DataBuffer#TYPE_SHORT TYPE_SHORT},
+ *  {@link DataBuffer#TYPE_INT TYPE_INT},
+ *  {@link DataBuffer#TYPE_FLOAT TYPE_FLOAT},
+ *  {@link DataBuffer#TYPE_DOUBLE TYPE_DOUBLE},
+ *  @see java.awt.image.PixelInterleavedSampleModel
+ *  @see java.awt.image.BandedSampleModel
+ */
+
+public class ComponentSampleModel extends SampleModel
+{
+    /** Offsets for all bands in data array elements. */
+    protected int bandOffsets[];
+
+    /** Index for each bank storing a band of image data. */
+    protected int[] bankIndices;
+
+    /**
+     * The number of bands in this
+     * <code>ComponentSampleModel</code>.
+     */
+    protected int numBands = 1;
+
+    /**
+     * The number of banks in this
+     * <code>ComponentSampleModel</code>.
+     */
+    protected int numBanks = 1;
+
+    /**
+     *  Line stride (in data array elements) of the region of image
+     *  data described by this ComponentSampleModel.
+     */
+    protected int scanlineStride;
+
+    /** Pixel stride (in data array elements) of the region of image
+     *  data described by this ComponentSampleModel.
+     */
+    protected int pixelStride;
+
+    static private native void initIDs();
+    static {
+        ColorModel.loadLibraries();
+        initIDs();
+    }
+
+    /**
+     * Constructs a ComponentSampleModel with the specified parameters.
+     * The number of bands will be given by the length of the bandOffsets array.
+     * All bands will be stored in the first bank of the DataBuffer.
+     * @param dataType  the data type for storing samples
+     * @param w         the width (in pixels) of the region of
+     *     image data described
+     * @param h         the height (in pixels) of the region of
+     *     image data described
+     * @param pixelStride the pixel stride of the region of image
+     *     data described
+     * @param scanlineStride the line stride of the region of image
+     *     data described
+     * @param bandOffsets the offsets of all bands
+     * @throws IllegalArgumentException if <code>w</code> or
+     *         <code>h</code> is not greater than 0
+     * @throws IllegalArgumentException if <code>pixelStride</code>
+     *         is less than 0
+     * @throws IllegalArgumentException if <code>scanlineStride</code>
+     *         is less than 0
+     * @throws IllegalArgumentException if <code>numBands</code>
+     *         is less than 1
+     * @throws IllegalArgumentException if the product of <code>w</code>
+     *         and <code>h</code> is greater than
+     *         <code>Integer.MAX_VALUE</code>
+     * @throws IllegalArgumentException if <code>dataType</code> is not
+     *         one of the supported data types
+     */
+    public ComponentSampleModel(int dataType,
+                                int w, int h,
+                                int pixelStride,
+                                int scanlineStride,
+                                int bandOffsets[]) {
+        super(dataType, w, h, bandOffsets.length);
+        this.dataType = dataType;
+        this.pixelStride = pixelStride;
+        this.scanlineStride  = scanlineStride;
+        this.bandOffsets = (int[])bandOffsets.clone();
+        numBands = bandOffsets.length;
+        if (pixelStride < 0) {
+            throw new IllegalArgumentException("Pixel stride must be >= 0");
+        }
+        // TODO - bug 4296691 - remove this check
+        if (scanlineStride < 0) {
+            throw new IllegalArgumentException("Scanline stride must be >= 0");
+        }
+        if (numBands < 1) {
+            throw new IllegalArgumentException("Must have at least one band.");
+        }
+        if ((dataType < DataBuffer.TYPE_BYTE) ||
+            (dataType > DataBuffer.TYPE_DOUBLE)) {
+            throw new IllegalArgumentException("Unsupported dataType.");
+        }
+        bankIndices = new int[numBands];
+        for (int i=0; i<numBands; i++) {
+            bankIndices[i] = 0;
+        }
+    }
+
+
+    /**
+     * Constructs a ComponentSampleModel with the specified parameters.
+     * The number of bands will be given by the length of the bandOffsets array.
+     * Different bands may be stored in different banks of the DataBuffer.
+     *
+     * @param dataType  the data type for storing samples
+     * @param w         the width (in pixels) of the region of
+     *     image data described
+     * @param h         the height (in pixels) of the region of
+     *     image data described
+     * @param pixelStride the pixel stride of the region of image
+     *     data described
+     * @param scanlineStride The line stride of the region of image
+     *     data described
+     * @param bankIndices the bank indices of all bands
+     * @param bandOffsets the band offsets of all bands
+     * @throws IllegalArgumentException if <code>w</code> or
+     *         <code>h</code> is not greater than 0
+     * @throws IllegalArgumentException if <code>pixelStride</code>
+     *         is less than 0
+     * @throws IllegalArgumentException if <code>scanlineStride</code>
+     *         is less than 0
+     * @throws IllegalArgumentException if the length of
+     *         <code>bankIndices</code> does not equal the length of
+     *         <code>bankOffsets</code>
+     * @throws IllegalArgumentException if any of the bank indices
+     *         of <code>bandIndices</code> is less than 0
+     * @throws IllegalArgumentException if <code>dataType</code> is not
+     *         one of the supported data types
+     */
+    public ComponentSampleModel(int dataType,
+                                int w, int h,
+                                int pixelStride,
+                                int scanlineStride,
+                                int bankIndices[],
+                                int bandOffsets[]) {
+        super(dataType, w, h, bandOffsets.length);
+        this.dataType = dataType;
+        this.pixelStride = pixelStride;
+        this.scanlineStride  = scanlineStride;
+        this.bandOffsets = (int[])bandOffsets.clone();
+        this.bankIndices = (int[]) bankIndices.clone();
+        if (pixelStride < 0) {
+            throw new IllegalArgumentException("Pixel stride must be >= 0");
+        }
+        // TODO - bug 4296691 - remove this check
+        if (scanlineStride < 0) {
+            throw new IllegalArgumentException("Scanline stride must be >= 0");
+        }
+        if ((dataType < DataBuffer.TYPE_BYTE) ||
+            (dataType > DataBuffer.TYPE_DOUBLE)) {
+            throw new IllegalArgumentException("Unsupported dataType.");
+        }
+        int maxBank = bankIndices[0];
+        if (maxBank < 0) {
+            throw new IllegalArgumentException("Index of bank 0 is less than "+
+                                               "0 ("+maxBank+")");
+        }
+        for (int i=1; i < bankIndices.length; i++) {
+            if (bankIndices[i] > maxBank) {
+                maxBank = bankIndices[i];
+            }
+            else if (bankIndices[i] < 0) {
+                throw new IllegalArgumentException("Index of bank "+i+
+                                                   " is less than 0 ("+
+                                                   maxBank+")");
+            }
+        }
+        numBanks         = maxBank+1;
+        numBands         = bandOffsets.length;
+        if (bandOffsets.length != bankIndices.length) {
+            throw new IllegalArgumentException("Length of bandOffsets must "+
+                                               "equal length of bankIndices.");
+        }
+    }
+
+    /**
+     * Returns the size of the data buffer (in data elements) needed
+     * for a data buffer that matches this ComponentSampleModel.
+     */
+     private long getBufferSize() {
+         int maxBandOff=bandOffsets[0];
+         for (int i=1; i<bandOffsets.length; i++)
+             maxBandOff = Math.max(maxBandOff,bandOffsets[i]);
+
+         long size = 0;
+         if (maxBandOff >= 0)
+             size += maxBandOff+1;
+         if (pixelStride > 0)
+             size += pixelStride * (width-1);
+         if (scanlineStride > 0)
+             size += scanlineStride*(height-1);
+         return size;
+     }
+
+     /**
+      * Preserves band ordering with new step factor...
+      */
+    int []orderBands(int orig[], int step) {
+        int map[] = new int[orig.length];
+        int ret[] = new int[orig.length];
+
+        for (int i=0; i<map.length; i++) map[i] = i;
+
+        for (int i = 0; i < ret.length; i++) {
+            int index = i;
+            for (int j = i+1; j < ret.length; j++) {
+                if (orig[map[index]] > orig[map[j]]) {
+                    index = j;
+                }
+            }
+            ret[map[index]] = i*step;
+            map[index]  = map[i];
+        }
+        return ret;
+    }
+
+    /**
+     * Creates a new <code>ComponentSampleModel</code> with the specified
+     * width and height.  The new <code>SampleModel</code> will have the same
+     * number of bands, storage data type, interleaving scheme, and
+     * pixel stride as this <code>SampleModel</code>.
+     * @param w the width of the resulting <code>SampleModel</code>
+     * @param h the height of the resulting <code>SampleModel</code>
+     * @return a new <code>ComponentSampleModel</code> with the specified size
+     * @throws IllegalArgumentException if <code>w</code> or
+     *         <code>h</code> is not greater than 0
+     */
+    public SampleModel createCompatibleSampleModel(int w, int h) {
+        SampleModel ret=null;
+        long size;
+        int minBandOff=bandOffsets[0];
+        int maxBandOff=bandOffsets[0];
+        for (int i=1; i<bandOffsets.length; i++) {
+            minBandOff = Math.min(minBandOff,bandOffsets[i]);
+            maxBandOff = Math.max(maxBandOff,bandOffsets[i]);
+        }
+        maxBandOff -= minBandOff;
+
+        int bands   = bandOffsets.length;
+        int bandOff[];
+        int pStride = Math.abs(pixelStride);
+        int lStride = Math.abs(scanlineStride);
+        int bStride = Math.abs(maxBandOff);
+
+        if (pStride > lStride) {
+            if (pStride > bStride) {
+                if (lStride > bStride) { // pix > line > band
+                    bandOff = new int[bandOffsets.length];
+                    for (int i=0; i<bands; i++)
+                        bandOff[i] = bandOffsets[i]-minBandOff;
+                    lStride = bStride+1;
+                    pStride = lStride*h;
+                } else { // pix > band > line
+                    bandOff = orderBands(bandOffsets,lStride*h);
+                    pStride = bands*lStride*h;
+                }
+            } else { // band > pix > line
+                pStride = lStride*h;
+                bandOff = orderBands(bandOffsets,pStride*w);
+            }
+        } else {
+            if (pStride > bStride) { // line > pix > band
+                bandOff = new int[bandOffsets.length];
+                for (int i=0; i<bands; i++)
+                    bandOff[i] = bandOffsets[i]-minBandOff;
+                pStride = bStride+1;
+                lStride = pStride*w;
+            } else {
+                if (lStride > bStride) { // line > band > pix
+                    bandOff = orderBands(bandOffsets,pStride*w);
+                    lStride = bands*pStride*w;
+                } else { // band > line > pix
+                    lStride = pStride*w;
+                    bandOff = orderBands(bandOffsets,lStride*h);
+                }
+            }
+        }
+
+        // make sure we make room for negative offsets...
+        int base = 0;
+        if (scanlineStride < 0) {
+            base += lStride*h;
+            lStride *= -1;
+        }
+        if (pixelStride    < 0) {
+            base += pStride*w;
+            pStride *= -1;
+        }
+
+        for (int i=0; i<bands; i++)
+            bandOff[i] += base;
+        return new ComponentSampleModel(dataType, w, h, pStride,
+                                        lStride, bankIndices, bandOff);
+    }
+
+    /**
+     * Creates a new ComponentSampleModel with a subset of the bands
+     * of this ComponentSampleModel.  The new ComponentSampleModel can be
+     * used with any DataBuffer that the existing ComponentSampleModel
+     * can be used with.  The new ComponentSampleModel/DataBuffer
+     * combination will represent an image with a subset of the bands
+     * of the original ComponentSampleModel/DataBuffer combination.
+     * @param bands a subset of bands from this
+     *              <code>ComponentSampleModel</code>
+     * @return a <code>ComponentSampleModel</code> created with a subset
+     *          of bands from this <code>ComponentSampleModel</code>.
+     */
+    public SampleModel createSubsetSampleModel(int bands[]) {
+       if (bands.length > bankIndices.length)
+            throw new RasterFormatException("There are only " +
+                                            bankIndices.length +
+                                            " bands");
+        int newBankIndices[] = new int[bands.length];
+        int newBandOffsets[] = new int[bands.length];
+
+        for (int i=0; i<bands.length; i++) {
+            newBankIndices[i] = bankIndices[bands[i]];
+            newBandOffsets[i] = bandOffsets[bands[i]];
+        }
+
+        return new ComponentSampleModel(this.dataType, width, height,
+                                        this.pixelStride,
+                                        this.scanlineStride,
+                                        newBankIndices, newBandOffsets);
+    }
+
+    /**
+     * Creates a <code>DataBuffer</code> that corresponds to this
+     * <code>ComponentSampleModel</code>.
+     * The <code>DataBuffer</code> object's data type, number of banks,
+     * and size are be consistent with this <code>ComponentSampleModel</code>.
+     * @return a <code>DataBuffer</code> whose data type, number of banks
+     *         and size are consistent with this
+     *         <code>ComponentSampleModel</code>.
+     */
+    public DataBuffer createDataBuffer() {
+        DataBuffer dataBuffer = null;
+
+        int size = (int)getBufferSize();
+        switch (dataType) {
+        case DataBuffer.TYPE_BYTE:
+            dataBuffer = new DataBufferByte(size, numBanks);
+            break;
+        case DataBuffer.TYPE_USHORT:
+            dataBuffer = new DataBufferUShort(size, numBanks);
+            break;
+        case DataBuffer.TYPE_SHORT:
+            dataBuffer = new DataBufferShort(size, numBanks);
+            break;
+        case DataBuffer.TYPE_INT:
+            dataBuffer = new DataBufferInt(size, numBanks);
+            break;
+        case DataBuffer.TYPE_FLOAT:
+            dataBuffer = new DataBufferFloat(size, numBanks);
+            break;
+        case DataBuffer.TYPE_DOUBLE:
+            dataBuffer = new DataBufferDouble(size, numBanks);
+            break;
+        }
+
+        return dataBuffer;
+    }
+
+
+    /** Gets the offset for the first band of pixel (x,y).
+     *  A sample of the first band can be retrieved from a
+     * <code>DataBuffer</code>
+     *  <code>data</code> with a <code>ComponentSampleModel</code>
+     * <code>csm</code> as
+     * <pre>
+     *        data.getElem(csm.getOffset(x, y));
+     * </pre>
+     * @param x the X location of the pixel
+     * @param y the Y location of the pixel
+     * @return the offset for the first band of the specified pixel.
+     */
+    public int getOffset(int x, int y) {
+        int offset = y*scanlineStride + x*pixelStride + bandOffsets[0];
+        return offset;
+    }
+
+    /** Gets the offset for band b of pixel (x,y).
+     *  A sample of band <code>b</code> can be retrieved from a
+     *  <code>DataBuffer</code> <code>data</code>
+     *  with a <code>ComponentSampleModel</code> <code>csm</code> as
+     * <pre>
+     *       data.getElem(csm.getOffset(x, y, b));
+     * </pre>
+     * @param x the X location of the specified pixel
+     * @param y the Y location of the specified pixel
+     * @param b the specified band
+     * @return the offset for the specified band of the specified pixel.
+     */
+    public int getOffset(int x, int y, int b) {
+        int offset = y*scanlineStride + x*pixelStride + bandOffsets[b];
+        return offset;
+    }
+
+    /** Returns the number of bits per sample for all bands.
+     *  @return an array containing the number of bits per sample
+     *          for all bands, where each element in the array
+     *          represents a band.
+     */
+    public final int[] getSampleSize() {
+        int sampleSize[] = new int [numBands];
+        int sizeInBits = getSampleSize(0);
+
+        for (int i=0; i<numBands; i++)
+            sampleSize[i] = sizeInBits;
+
+        return sampleSize;
+    }
+
+    /** Returns the number of bits per sample for the specified band.
+     *  @param band the specified band
+     *  @return the number of bits per sample for the specified band.
+     */
+    public final int getSampleSize(int band) {
+        return DataBuffer.getDataTypeSize(dataType);
+    }
+
+    /** Returns the bank indices for all bands.
+     *  @return the bank indices for all bands.
+     */
+    public final int [] getBankIndices() {
+        return (int[]) bankIndices.clone();
+    }
+
+    /** Returns the band offset for all bands.
+     *  @return the band offsets for all bands.
+     */
+    public final int [] getBandOffsets() {
+        return (int[])bandOffsets.clone();
+    }
+
+    /** Returns the scanline stride of this ComponentSampleModel.
+     *  @return the scanline stride of this <code>ComponentSampleModel</code>.
+     */
+    public final int getScanlineStride() {
+        return scanlineStride;
+    }
+
+    /** Returns the pixel stride of this ComponentSampleModel.
+     *  @return the pixel stride of this <code>ComponentSampleModel</code>.
+     */
+    public final int getPixelStride() {
+        return pixelStride;
+    }
+
+    /**
+     * Returns the number of data elements needed to transfer a pixel
+     * with the
+     * {@link #getDataElements(int, int, Object, DataBuffer) } and
+     * {@link #setDataElements(int, int, Object, DataBuffer) }
+     * methods.
+     * For a <code>ComponentSampleModel</code>, this is identical to the
+     * number of bands.
+     * @return the number of data elements needed to transfer a pixel with
+     *         the <code>getDataElements</code> and
+     *         <code>setDataElements</code> methods.
+     * @see java.awt.image.SampleModel#getNumDataElements
+     * @see #getNumBands
+     */
+    public final int getNumDataElements() {
+        return getNumBands();
+    }
+
+    /**
+     * Returns data for a single pixel in a primitive array of type
+     * <code>TransferType</code>.  For a <code>ComponentSampleModel</code>,
+     * this is the same as the data type, and samples are returned
+     * one per array element.  Generally, <code>obj</code> should
+     * be passed in as <code>null</code>, so that the <code>Object</code>
+     * is created automatically and is the right primitive data type.
+     * <p>
+     * The following code illustrates transferring data for one pixel from
+     * <code>DataBuffer</code> <code>db1</code>, whose storage layout is
+     * described by <code>ComponentSampleModel</code> <code>csm1</code>,
+     * to <code>DataBuffer</code> <code>db2</code>, whose storage layout
+     * is described by <code>ComponentSampleModel</code> <code>csm2</code>.
+     * The transfer is usually more efficient than using
+     * <code>getPixel</code> and <code>setPixel</code>.
+     * <pre>
+     *       ComponentSampleModel csm1, csm2;
+     *       DataBufferInt db1, db2;
+     *       csm2.setDataElements(x, y,
+     *                            csm1.getDataElements(x, y, null, db1), db2);
+     * </pre>
+     *
+     * Using <code>getDataElements</code> and <code>setDataElements</code>
+     * to transfer between two <code>DataBuffer/SampleModel</code>
+     * pairs is legitimate if the <code>SampleModel</code> objects have
+     * the same number of bands, corresponding bands have the same number of
+     * bits per sample, and the <code>TransferType</code>s are the same.
+     * <p>
+     * If <code>obj</code> is not <code>null</code>, it should be a
+     * primitive array of type <code>TransferType</code>.
+     * Otherwise, a <code>ClassCastException</code> is thrown.  An
+     * <code>ArrayIndexOutOfBoundsException</code> might be thrown if the
+     * coordinates are not in bounds, or if <code>obj</code> is not
+     * <code>null</code> and is not large enough to hold
+     * the pixel data.
+     *
+     * @param x         the X coordinate of the pixel location
+     * @param y         the Y coordinate of the pixel location
+     * @param obj       if non-<code>null</code>, a primitive array
+     *                  in which to return the pixel data
+     * @param data      the <code>DataBuffer</code> containing the image data
+     * @return the data of the specified pixel
+     * @see #setDataElements(int, int, Object, DataBuffer)
+     *
+     * @throws NullPointerException if data is null.
+     * @throws ArrayIndexOutOfBoundsException if the coordinates are
+     * not in bounds, or if obj is too small to hold the ouput.
+     */
+    public Object getDataElements(int x, int y, Object obj, DataBuffer data) {
+        if ((x < 0) || (y < 0) || (x >= width) || (y >= height)) {
+            throw new ArrayIndexOutOfBoundsException
+                ("Coordinate out of bounds!");
+        }
+
+        int type = getTransferType();
+        int numDataElems = getNumDataElements();
+        int pixelOffset = y*scanlineStride + x*pixelStride;
+
+        switch(type) {
+
+        case DataBuffer.TYPE_BYTE:
+
+            byte[] bdata;
+
+            if (obj == null)
+                bdata = new byte[numDataElems];
+            else
+                bdata = (byte[])obj;
+
+            for (int i=0; i<numDataElems; i++) {
+                bdata[i] = (byte)data.getElem(bankIndices[i],
+                                              pixelOffset + bandOffsets[i]);
+            }
+
+            obj = (Object)bdata;
+            break;
+
+        case DataBuffer.TYPE_USHORT:
+        case DataBuffer.TYPE_SHORT:
+
+            short[] sdata;
+
+            if (obj == null)
+                sdata = new short[numDataElems];
+            else
+                sdata = (short[])obj;
+
+            for (int i=0; i<numDataElems; i++) {
+                sdata[i] = (short)data.getElem(bankIndices[i],
+                                               pixelOffset + bandOffsets[i]);
+            }
+
+            obj = (Object)sdata;
+            break;
+
+        case DataBuffer.TYPE_INT:
+
+            int[] idata;
+
+            if (obj == null)
+                idata = new int[numDataElems];
+            else
+                idata = (int[])obj;
+
+            for (int i=0; i<numDataElems; i++) {
+                idata[i] = data.getElem(bankIndices[i],
+                                        pixelOffset + bandOffsets[i]);
+            }
+
+            obj = (Object)idata;
+            break;
+
+        case DataBuffer.TYPE_FLOAT:
+
+            float[] fdata;
+
+            if (obj == null)
+                fdata = new float[numDataElems];
+            else
+                fdata = (float[])obj;
+
+            for (int i=0; i<numDataElems; i++) {
+                fdata[i] = data.getElemFloat(bankIndices[i],
+                                             pixelOffset + bandOffsets[i]);
+            }
+
+            obj = (Object)fdata;
+            break;
+
+        case DataBuffer.TYPE_DOUBLE:
+
+            double[] ddata;
+
+            if (obj == null)
+                ddata = new double[numDataElems];
+            else
+                ddata = (double[])obj;
+
+            for (int i=0; i<numDataElems; i++) {
+                ddata[i] = data.getElemDouble(bankIndices[i],
+                                              pixelOffset + bandOffsets[i]);
+            }
+
+            obj = (Object)ddata;
+            break;
+        }
+
+        return obj;
+    }
+
+    /**
+     * Returns all samples for the specified pixel in an int array,
+     * one sample per array element.
+     * An <code>ArrayIndexOutOfBoundsException</code> might be thrown if
+     * the coordinates are not in bounds.
+     * @param x         the X coordinate of the pixel location
+     * @param y         the Y coordinate of the pixel location
+     * @param iArray    If non-null, returns the samples in this array
+     * @param data      The DataBuffer containing the image data
+     * @return the samples of the specified pixel.
+     * @see #setPixel(int, int, int[], DataBuffer)
+     *
+     * @throws NullPointerException if data is null.
+     * @throws ArrayIndexOutOfBoundsException if the coordinates are
+     * not in bounds, or if iArray is too small to hold the output.
+     */
+    public int[] getPixel(int x, int y, int iArray[], DataBuffer data) {
+        if ((x < 0) || (y < 0) || (x >= width) || (y >= height)) {
+            throw new ArrayIndexOutOfBoundsException
+                ("Coordinate out of bounds!");
+        }
+        int pixels[];
+        if (iArray != null) {
+           pixels = iArray;
+        } else {
+           pixels = new int [numBands];
+        }
+        int pixelOffset = y*scanlineStride + x*pixelStride;
+        for (int i=0; i<numBands; i++) {
+            pixels[i] = data.getElem(bankIndices[i],
+                                     pixelOffset + bandOffsets[i]);
+        }
+        return pixels;
+    }
+
+    /**
+     * Returns all samples for the specified rectangle of pixels in
+     * an int array, one sample per array element.
+     * An <code>ArrayIndexOutOfBoundsException</code> might be thrown if
+     * the coordinates are not in bounds.
+     * @param x         The X coordinate of the upper left pixel location
+     * @param y         The Y coordinate of the upper left pixel location
+     * @param w         The width of the pixel rectangle
+     * @param h         The height of the pixel rectangle
+     * @param iArray    If non-null, returns the samples in this array
+     * @param data      The DataBuffer containing the image data
+     * @return the samples of the pixels within the specified region.
+     * @see #setPixels(int, int, int, int, int[], DataBuffer)
+     */
+    public int[] getPixels(int x, int y, int w, int h,
+                           int iArray[], DataBuffer data) {
+        if ((x < 0) || (y < 0) || (x + w > width) || (y + h > height)) {
+            throw new ArrayIndexOutOfBoundsException
+                ("Coordinate out of bounds!");
+        }
+        int pixels[];
+        if (iArray != null) {
+           pixels = iArray;
+        } else {
+           pixels = new int [w*h*numBands];
+        }
+        int lineOffset = y*scanlineStride + x*pixelStride;
+        int srcOffset = 0;
+
+        for (int i = 0; i < h; i++) {
+           int pixelOffset = lineOffset;
+           for (int j = 0; j < w; j++) {
+              for (int k=0; k < numBands; k++) {
+                 pixels[srcOffset++] =
+                    data.getElem(bankIndices[k], pixelOffset + bandOffsets[k]);
+              }
+              pixelOffset += pixelStride;
+           }
+           lineOffset += scanlineStride;
+        }
+        return pixels;
+    }
+
+    /**
+     * Returns as int the sample in a specified band for the pixel
+     * located at (x,y).
+     * An <code>ArrayIndexOutOfBoundsException</code> might be thrown if
+     * the coordinates are not in bounds.
+     * @param x         the X coordinate of the pixel location
+     * @param y         the Y coordinate of the pixel location
+     * @param b         the band to return
+     * @param data      the <code>DataBuffer</code> containing the image data
+     * @return the sample in a specified band for the specified pixel
+     * @see #setSample(int, int, int, int, DataBuffer)
+     */
+    public int getSample(int x, int y, int b, DataBuffer data) {
+        // Bounds check for 'b' will be performed automatically
+        if ((x < 0) || (y < 0) || (x >= width) || (y >= height)) {
+            throw new ArrayIndexOutOfBoundsException
+                ("Coordinate out of bounds!");
+        }
+        int sample = data.getElem(bankIndices[b],
+                                  y*scanlineStride + x*pixelStride +
+                                  bandOffsets[b]);
+        return sample;
+    }
+
+    /**
+     * Returns the sample in a specified band
+     * for the pixel located at (x,y) as a float.
+     * An <code>ArrayIndexOutOfBoundsException</code> might be
+     * thrown if the coordinates are not in bounds.
+     * @param x         The X coordinate of the pixel location
+     * @param y         The Y coordinate of the pixel location
+     * @param b         The band to return
+     * @param data      The DataBuffer containing the image data
+     * @return a float value representing the sample in the specified
+     * band for the specified pixel.
+     */
+    public float getSampleFloat(int x, int y, int b, DataBuffer data) {
+        // Bounds check for 'b' will be performed automatically
+        if ((x < 0) || (y < 0) || (x >= width) || (y >= height)) {
+            throw new ArrayIndexOutOfBoundsException
+                ("Coordinate out of bounds!");
+        }
+
+        float sample = data.getElemFloat(bankIndices[b],
+                                         y*scanlineStride + x*pixelStride +
+                                         bandOffsets[b]);
+        return sample;
+    }
+
+    /**
+     * Returns the sample in a specified band
+     * for a pixel located at (x,y) as a double.
+     * An <code>ArrayIndexOutOfBoundsException</code> might be
+     * thrown if the coordinates are not in bounds.
+     * @param x         The X coordinate of the pixel location
+     * @param y         The Y coordinate of the pixel location
+     * @param b         The band to return
+     * @param data      The DataBuffer containing the image data
+     * @return a double value representing the sample in the specified
+     * band for the specified pixel.
+     */
+    public double getSampleDouble(int x, int y, int b, DataBuffer data) {
+        // Bounds check for 'b' will be performed automatically
+        if ((x < 0) || (y < 0) || (x >= width) || (y >= height)) {
+            throw new ArrayIndexOutOfBoundsException
+                ("Coordinate out of bounds!");
+        }
+
+        double sample = data.getElemDouble(bankIndices[b],
+                                           y*scanlineStride + x*pixelStride +
+                                           bandOffsets[b]);
+        return sample;
+    }
+
+    /**
+     * Returns the samples in a specified band for the specified rectangle
+     * of pixels in an int array, one sample per data array element.
+     * An <code>ArrayIndexOutOfBoundsException</code> might be thrown if
+     * the coordinates are not in bounds.
+     * @param x         The X coordinate of the upper left pixel location
+     * @param y         The Y coordinate of the upper left pixel location
+     * @param w         the width of the pixel rectangle
+     * @param h         the height of the pixel rectangle
+     * @param b         the band to return
+     * @param iArray    if non-<code>null</code>, returns the samples
+     *                  in this array
+     * @param data      the <code>DataBuffer</code> containing the image data
+     * @return the samples in the specified band of the specified pixel
+     * @see #setSamples(int, int, int, int, int, int[], DataBuffer)
+     */
+    public int[] getSamples(int x, int y, int w, int h, int b,
+                            int iArray[], DataBuffer data) {
+        // Bounds check for 'b' will be performed automatically
+        if ((x < 0) || (y < 0) || (x + w > width) || (y + h > height)) {
+            throw new ArrayIndexOutOfBoundsException
+                ("Coordinate out of bounds!");
+        }
+        int samples[];
+        if (iArray != null) {
+           samples = iArray;
+        } else {
+           samples = new int [w*h];
+        }
+        int lineOffset = y*scanlineStride + x*pixelStride +  bandOffsets[b];
+        int srcOffset = 0;
+
+        for (int i = 0; i < h; i++) {
+           int sampleOffset = lineOffset;
+           for (int j = 0; j < w; j++) {
+              samples[srcOffset++] = data.getElem(bankIndices[b],
+                                                  sampleOffset);
+              sampleOffset += pixelStride;
+           }
+           lineOffset += scanlineStride;
+        }
+        return samples;
+    }
+
+    /**
+     * Sets the data for a single pixel in the specified
+     * <code>DataBuffer</code> from a primitive array of type
+     * <code>TransferType</code>.  For a <code>ComponentSampleModel</code>,
+     * this is the same as the data type, and samples are transferred
+     * one per array element.
+     * <p>
+     * The following code illustrates transferring data for one pixel from
+     * <code>DataBuffer</code> <code>db1</code>, whose storage layout is
+     * described by <code>ComponentSampleModel</code> <code>csm1</code>,
+     * to <code>DataBuffer</code> <code>db2</code>, whose storage layout
+     * is described by <code>ComponentSampleModel</code> <code>csm2</code>.
+     * The transfer is usually more efficient than using
+     * <code>getPixel</code> and <code>setPixel</code>.
+     * <pre>
+     *       ComponentSampleModel csm1, csm2;
+     *       DataBufferInt db1, db2;
+     *       csm2.setDataElements(x, y, csm1.getDataElements(x, y, null, db1),
+     *                            db2);
+     * </pre>
+     * Using <code>getDataElements</code> and <code>setDataElements</code>
+     * to transfer between two <code>DataBuffer/SampleModel</code> pairs
+     * is legitimate if the <code>SampleModel</code> objects have
+     * the same number of bands, corresponding bands have the same number of
+     * bits per sample, and the <code>TransferType</code>s are the same.
+     * <p>
+     * A <code>ClassCastException</code> is thrown if <code>obj</code> is not
+     * a primitive array of type <code>TransferType</code>.
+     * An <code>ArrayIndexOutOfBoundsException</code> might be thrown if
+     * the coordinates are not in bounds, or if <code>obj</code> is not large
+     * enough to hold the pixel data.
+     * @param x         the X coordinate of the pixel location
+     * @param y         the Y coordinate of the pixel location
+     * @param obj       a primitive array containing pixel data
+     * @param data      the DataBuffer containing the image data
+     * @see #getDataElements(int, int, Object, DataBuffer)
+     */
+    public void setDataElements(int x, int y, Object obj, DataBuffer data) {
+        if ((x < 0) || (y < 0) || (x >= width) || (y >= height)) {
+            throw new ArrayIndexOutOfBoundsException
+                ("Coordinate out of bounds!");
+        }
+
+        int type = getTransferType();
+        int numDataElems = getNumDataElements();
+        int pixelOffset = y*scanlineStride + x*pixelStride;
+
+        switch(type) {
+
+        case DataBuffer.TYPE_BYTE:
+
+            byte[] barray = (byte[])obj;
+
+            for (int i=0; i<numDataElems; i++) {
+                data.setElem(bankIndices[i], pixelOffset + bandOffsets[i],
+                           ((int)barray[i])&0xff);
+            }
+            break;
+
+        case DataBuffer.TYPE_USHORT:
+        case DataBuffer.TYPE_SHORT:
+
+            short[] sarray = (short[])obj;
+
+            for (int i=0; i<numDataElems; i++) {
+                data.setElem(bankIndices[i], pixelOffset + bandOffsets[i],
+                           ((int)sarray[i])&0xffff);
+            }
+            break;
+
+        case DataBuffer.TYPE_INT:
+
+            int[] iarray = (int[])obj;
+
+            for (int i=0; i<numDataElems; i++) {
+                data.setElem(bankIndices[i],
+                             pixelOffset + bandOffsets[i], iarray[i]);
+            }
+            break;
+
+        case DataBuffer.TYPE_FLOAT:
+
+            float[] farray = (float[])obj;
+
+            for (int i=0; i<numDataElems; i++) {
+                data.setElemFloat(bankIndices[i],
+                             pixelOffset + bandOffsets[i], farray[i]);
+            }
+            break;
+
+        case DataBuffer.TYPE_DOUBLE:
+
+            double[] darray = (double[])obj;
+
+            for (int i=0; i<numDataElems; i++) {
+                data.setElemDouble(bankIndices[i],
+                             pixelOffset + bandOffsets[i], darray[i]);
+            }
+            break;
+
+        }
+    }
+
+    /**
+     * Sets a pixel in the <code>DataBuffer</code> using an int array of
+     * samples for input.  An <code>ArrayIndexOutOfBoundsException</code>
+     * might be thrown if the coordinates are
+     * not in bounds.
+     * @param x         The X coordinate of the pixel location
+     * @param y         The Y coordinate of the pixel location
+     * @param iArray    The input samples in an int array
+     * @param data      The DataBuffer containing the image data
+     * @see #getPixel(int, int, int[], DataBuffer)
+     */
+    public void setPixel(int x, int y, int iArray[], DataBuffer data) {
+        if ((x < 0) || (y < 0) || (x >= width) || (y >= height)) {
+            throw new ArrayIndexOutOfBoundsException
+                ("Coordinate out of bounds!");
+        }
+       int pixelOffset = y*scanlineStride + x*pixelStride;
+       for (int i=0; i<numBands; i++) {
+           data.setElem(bankIndices[i],
+                        pixelOffset + bandOffsets[i],iArray[i]);
+       }
+    }
+
+    /**
+     * Sets all samples for a rectangle of pixels from an int array containing
+     * one sample per array element.
+     * An <code>ArrayIndexOutOfBoundsException</code> might be thrown if the
+     * coordinates are not in bounds.
+     * @param x         The X coordinate of the upper left pixel location
+     * @param y         The Y coordinate of the upper left pixel location
+     * @param w         The width of the pixel rectangle
+     * @param h         The height of the pixel rectangle
+     * @param iArray    The input samples in an int array
+     * @param data      The DataBuffer containing the image data
+     * @see #getPixels(int, int, int, int, int[], DataBuffer)
+     */
+    public void setPixels(int x, int y, int w, int h,
+                          int iArray[], DataBuffer data) {
+        if ((x < 0) || (y < 0) || (x + w > width) || (y + h > height)) {
+            throw new ArrayIndexOutOfBoundsException
+                ("Coordinate out of bounds!");
+        }
+
+        int lineOffset = y*scanlineStride + x*pixelStride;
+        int srcOffset = 0;
+
+        for (int i = 0; i < h; i++) {
+           int pixelOffset = lineOffset;
+           for (int j = 0; j < w; j++) {
+              for (int k=0; k < numBands; k++) {
+                 data.setElem(bankIndices[k], pixelOffset + bandOffsets[k],
+                              iArray[srcOffset++]);
+              }
+              pixelOffset += pixelStride;
+           }
+           lineOffset += scanlineStride;
+        }
+    }
+
+    /**
+     * Sets a sample in the specified band for the pixel located at (x,y)
+     * in the <code>DataBuffer</code> using an int for input.
+     * An <code>ArrayIndexOutOfBoundsException</code> might be thrown if the
+     * coordinates are not in bounds.
+     * @param x         The X coordinate of the pixel location
+     * @param y         The Y coordinate of the pixel location
+     * @param b         the band to set
+     * @param s         the input sample as an int
+     * @param data      the DataBuffer containing the image data
+     * @see #getSample(int, int, int, DataBuffer)
+     */
+    public void setSample(int x, int y, int b, int s,
+                          DataBuffer data) {
+        // Bounds check for 'b' will be performed automatically
+        if ((x < 0) || (y < 0) || (x >= width) || (y >= height)) {
+            throw new ArrayIndexOutOfBoundsException
+                ("Coordinate out of bounds!");
+        }
+        data.setElem(bankIndices[b],
+                     y*scanlineStride + x*pixelStride + bandOffsets[b], s);
+    }
+
+    /**
+     * Sets a sample in the specified band for the pixel located at (x,y)
+     * in the <code>DataBuffer</code> using a float for input.
+     * An <code>ArrayIndexOutOfBoundsException</code> might be thrown if
+     * the coordinates are not in bounds.
+     * @param x         The X coordinate of the pixel location
+     * @param y         The Y coordinate of the pixel location
+     * @param b         The band to set
+     * @param s         The input sample as a float
+     * @param data      The DataBuffer containing the image data
+     * @see #getSample(int, int, int, DataBuffer)
+     */
+    public void setSample(int x, int y, int b,
+                          float s ,
+                          DataBuffer data) {
+        // Bounds check for 'b' will be performed automatically
+        if ((x < 0) || (y < 0) || (x >= width) || (y >= height)) {
+            throw new ArrayIndexOutOfBoundsException
+                ("Coordinate out of bounds!");
+        }
+        data.setElemFloat(bankIndices[b],
+                          y*scanlineStride + x*pixelStride + bandOffsets[b],
+                          s);
+    }
+
+    /**
+     * Sets a sample in the specified band for the pixel located at (x,y)
+     * in the <code>DataBuffer</code> using a double for input.
+     * An <code>ArrayIndexOutOfBoundsException</code> might be thrown if
+     * the coordinates are not in bounds.
+     * @param x         The X coordinate of the pixel location
+     * @param y         The Y coordinate of the pixel location
+     * @param b         The band to set
+     * @param s         The input sample as a double
+     * @param data      The DataBuffer containing the image data
+     * @see #getSample(int, int, int, DataBuffer)
+     */
+    public void setSample(int x, int y, int b,
+                          double s,
+                          DataBuffer data) {
+        // Bounds check for 'b' will be performed automatically
+        if ((x < 0) || (y < 0) || (x >= width) || (y >= height)) {
+            throw new ArrayIndexOutOfBoundsException
+                ("Coordinate out of bounds!");
+        }
+        data.setElemDouble(bankIndices[b],
+                          y*scanlineStride + x*pixelStride + bandOffsets[b],
+                          s);
+    }
+
+    /**
+     * Sets the samples in the specified band for the specified rectangle
+     * of pixels from an int array containing one sample per data array element.
+     * An <code>ArrayIndexOutOfBoundsException</code> might be thrown if the
+     * coordinates are not in bounds.
+     * @param x         The X coordinate of the upper left pixel location
+     * @param y         The Y coordinate of the upper left pixel location
+     * @param w         The width of the pixel rectangle
+     * @param h         The height of the pixel rectangle
+     * @param b         The band to set
+     * @param iArray    The input samples in an int array
+     * @param data      The DataBuffer containing the image data
+     * @see #getSamples(int, int, int, int, int, int[], DataBuffer)
+     */
+    public void setSamples(int x, int y, int w, int h, int b,
+                           int iArray[], DataBuffer data) {
+        // Bounds check for 'b' will be performed automatically
+        if ((x < 0) || (y < 0) || (x + w > width) || (y + h > height)) {
+            throw new ArrayIndexOutOfBoundsException
+                ("Coordinate out of bounds!");
+        }
+        int lineOffset = y*scanlineStride + x*pixelStride + bandOffsets[b];
+        int srcOffset = 0;
+
+        for (int i = 0; i < h; i++) {
+           int sampleOffset = lineOffset;
+           for (int j = 0; j < w; j++) {
+              data.setElem(bankIndices[b], sampleOffset, iArray[srcOffset++]);
+              sampleOffset += pixelStride;
+           }
+           lineOffset += scanlineStride;
+        }
+    }
+
+    public boolean equals(Object o) {
+        if ((o == null) || !(o instanceof ComponentSampleModel)) {
+            return false;
+        }
+
+        ComponentSampleModel that = (ComponentSampleModel)o;
+        return this.width == that.width &&
+            this.height == that.height &&
+            this.numBands == that.numBands &&
+            this.dataType == that.dataType &&
+            Arrays.equals(this.bandOffsets, that.bandOffsets) &&
+            Arrays.equals(this.bankIndices, that.bankIndices) &&
+            this.numBands == that.numBands &&
+            this.numBanks == that.numBanks &&
+            this.scanlineStride == that.scanlineStride &&
+            this.pixelStride == that.pixelStride;
+    }
+
+    // If we implement equals() we must also implement hashCode
+    public int hashCode() {
+        int hash = 0;
+        hash = width;
+        hash <<= 8;
+        hash ^= height;
+        hash <<= 8;
+        hash ^= numBands;
+        hash <<= 8;
+        hash ^= dataType;
+        hash <<= 8;
+        for (int i = 0; i < bandOffsets.length; i++) {
+            hash ^= bandOffsets[i];
+            hash <<= 8;
+        }
+        for (int i = 0; i < bankIndices.length; i++) {
+            hash ^= bankIndices[i];
+            hash <<= 8;
+        }
+        hash ^= numBands;
+        hash <<= 8;
+        hash ^= numBanks;
+        hash <<= 8;
+        hash ^= scanlineStride;
+        hash <<= 8;
+        hash ^= pixelStride;
+        return hash;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/classes/java/awt/image/DataBuffer.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,535 @@
+/*
+ * Portions Copyright 1997-2007 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) Eastman Kodak Company, 1997
+ *** As  an unpublished  work pursuant to Title 17 of the United
+ *** States Code.  All rights reserved.
+ ******************************************************************
+ ******************************************************************
+ ******************************************************************/
+
+package java.awt.image;
+
+import sun.java2d.StateTrackable.State;
+import static sun.java2d.StateTrackable.State.*;
+import sun.java2d.StateTrackableDelegate;
+
+import sun.awt.image.SunWritableRaster;
+
+/**
+ * This class exists to wrap one or more data arrays.  Each data array in
+ * the DataBuffer is referred to as a bank.  Accessor methods for getting
+ * and setting elements of the DataBuffer's banks exist with and without
+ * a bank specifier.  The methods without a bank specifier use the default 0th
+ * bank.  The DataBuffer can optionally take an offset per bank, so that
+ * data in an existing array can be used even if the interesting data
+ * doesn't start at array location zero.  Getting or setting the 0th
+ * element of a bank, uses the (0+offset)th element of the array.  The
+ * size field specifies how much of the data array is available for
+ * use.  Size + offset for a given bank should never be greater
+ * than the length of the associated data array.  The data type of
+ * a data buffer indicates the type of the data array(s) and may also
+ * indicate additional semantics, e.g. storing unsigned 8-bit data
+ * in elements of a byte array.  The data type may be TYPE_UNDEFINED
+ * or one of the types defined below.  Other types may be added in
+ * the future.  Generally, an object of class DataBuffer will be cast down
+ * to one of its data type specific subclasses to access data type specific
+ * methods for improved performance.  Currently, the Java 2D(tm) API
+ * image classes use TYPE_BYTE, TYPE_USHORT, TYPE_INT, TYPE_SHORT,
+ * TYPE_FLOAT, and TYPE_DOUBLE DataBuffers to store image data.
+ * @see java.awt.image.Raster
+ * @see java.awt.image.SampleModel
+ */
+public abstract class DataBuffer {
+
+    /** Tag for unsigned byte data. */
+    public static final int TYPE_BYTE  = 0;
+
+    /** Tag for unsigned short data. */
+    public static final int TYPE_USHORT = 1;
+
+    /** Tag for signed short data.  Placeholder for future use. */
+    public static final int TYPE_SHORT = 2;
+
+    /** Tag for int data. */
+    public static final int TYPE_INT   = 3;
+
+    /** Tag for float data.  Placeholder for future use. */
+    public static final int TYPE_FLOAT  = 4;
+
+    /** Tag for double data.  Placeholder for future use. */
+    public static final int TYPE_DOUBLE  = 5;
+
+    /** Tag for undefined data. */
+    public static final int TYPE_UNDEFINED = 32;
+
+    /** The data type of this DataBuffer. */
+    protected int dataType;
+
+    /** The number of banks in this DataBuffer. */
+    protected int banks;
+
+    /** Offset into default (first) bank from which to get the first element. */
+    protected int offset;
+
+    /** Usable size of all banks. */
+    protected int size;
+
+    /** Offsets into all banks. */
+    protected int offsets[];
+
+    /* The current StateTrackable state. */
+    StateTrackableDelegate theTrackable;
+
+    /** Size of the data types indexed by DataType tags defined above. */
+    private static final int dataTypeSize[] = {8,16,16,32,32,64};
+
+    /** Returns the size (in bits) of the data type, given a datatype tag.
+      * @param type the value of one of the defined datatype tags
+      * @return the size of the data type
+      * @throws IllegalArgumentException if <code>type</code> is less than
+      *         zero or greater than {@link #TYPE_DOUBLE}
+      */
+    public static int getDataTypeSize(int type) {
+        if (type < TYPE_BYTE || type > TYPE_DOUBLE) {
+            throw new IllegalArgumentException("Unknown data type "+type);
+        }
+        return dataTypeSize[type];
+    }
+
+    /**
+     *  Constructs a DataBuffer containing one bank of the specified
+     *  data type and size.
+     *
+     *  @param dataType the data type of this <code>DataBuffer</code>
+     *  @param size the size of the banks
+     */
+    protected DataBuffer(int dataType, int size) {
+        this(UNTRACKABLE, dataType, size);
+    }
+
+    /**
+     *  Constructs a DataBuffer containing one bank of the specified
+     *  data type and size with the indicated initial {@link State State}.
+     *
+     *  @param initialState the initial {@link State State} state of the data
+     *  @param dataType the data type of this <code>DataBuffer</code>
+     *  @param size the size of the banks
+     *  @since 1.7
+     */
+    DataBuffer(State initialState,
+               int dataType, int size)
+    {
+        this.theTrackable = StateTrackableDelegate.createInstance(initialState);
+        this.dataType = dataType;
+        this.banks = 1;
+        this.size = size;
+        this.offset = 0;
+        this.offsets = new int[1];  // init to 0 by new
+    }
+
+    /**
+     *  Constructs a DataBuffer containing the specified number of
+     *  banks.  Each bank has the specified size and an offset of 0.
+     *
+     *  @param dataType the data type of this <code>DataBuffer</code>
+     *  @param size the size of the banks
+     *  @param numBanks the number of banks in this
+     *         <code>DataBuffer</code>
+     */
+    protected DataBuffer(int dataType, int size, int numBanks) {
+        this(UNTRACKABLE, dataType, size, numBanks);
+    }
+
+    /**
+     *  Constructs a DataBuffer containing the specified number of
+     *  banks with the indicated initial {@link State State}.
+     *  Each bank has the specified size and an offset of 0.
+     *
+     *  @param initialState the initial {@link State State} state of the data
+     *  @param dataType the data type of this <code>DataBuffer</code>
+     *  @param size the size of the banks
+     *  @param numBanks the number of banks in this
+     *         <code>DataBuffer</code>
+     *  @since 1.7
+     */
+    DataBuffer(State initialState,
+               int dataType, int size, int numBanks)
+    {
+        this.theTrackable = StateTrackableDelegate.createInstance(initialState);
+        this.dataType = dataType;
+        this.banks = numBanks;
+        this.size = size;
+        this.offset = 0;
+        this.offsets = new int[banks]; // init to 0 by new
+    }
+
+    /**
+     *  Constructs a DataBuffer that contains the specified number
+     *  of banks.  Each bank has the specified datatype, size and offset.
+     *
+     *  @param dataType the data type of this <code>DataBuffer</code>
+     *  @param size the size of the banks
+     *  @param numBanks the number of banks in this
+     *         <code>DataBuffer</code>
+     *  @param offset the offset for each bank
+     */
+    protected DataBuffer(int dataType, int size, int numBanks, int offset) {
+        this(UNTRACKABLE, dataType, size, numBanks, offset);
+    }
+
+    /**
+     *  Constructs a DataBuffer that contains the specified number
+     *  of banks with the indicated initial {@link State State}.
+     *  Each bank has the specified datatype, size and offset.
+     *
+     *  @param initialState the initial {@link State State} state of the data
+     *  @param dataType the data type of this <code>DataBuffer</code>
+     *  @param size the size of the banks
+     *  @param numBanks the number of banks in this
+     *         <code>DataBuffer</code>
+     *  @param offset the offset for each bank
+     *  @since 1.7
+     */
+    DataBuffer(State initialState,
+               int dataType, int size, int numBanks, int offset)
+    {
+        this.theTrackable = StateTrackableDelegate.createInstance(initialState);
+        this.dataType = dataType;
+        this.banks = numBanks;
+        this.size = size;
+        this.offset = offset;
+        this.offsets = new int[numBanks];
+        for (int i = 0; i < numBanks; i++) {
+            this.offsets[i] = offset;
+        }
+    }
+
+    /**
+     *  Constructs a DataBuffer which contains the specified number
+     *  of banks.  Each bank has the specified datatype and size.  The
+     *  offset for each bank is specified by its respective entry in
+     *  the offsets array.
+     *
+     *  @param dataType the data type of this <code>DataBuffer</code>
+     *  @param size the size of the banks
+     *  @param numBanks the number of banks in this
+     *         <code>DataBuffer</code>
+     *  @param offsets an array containing an offset for each bank.
+     *  @throws ArrayIndexOutOfBoundsException if <code>numBanks</code>
+     *          does not equal the length of <code>offsets</code>
+     */
+    protected DataBuffer(int dataType, int size, int numBanks, int offsets[]) {
+        this(UNTRACKABLE, dataType, size, numBanks, offsets);
+    }
+
+    /**
+     *  Constructs a DataBuffer which contains the specified number
+     *  of banks with the indicated initial {@link State State}.
+     *  Each bank has the specified datatype and size.  The
+     *  offset for each bank is specified by its respective entry in
+     *  the offsets array.
+     *
+     *  @param initialState the initial {@link State State} state of the data
+     *  @param dataType the data type of this <code>DataBuffer</code>
+     *  @param size the size of the banks
+     *  @param numBanks the number of banks in this
+     *         <code>DataBuffer</code>
+     *  @param offsets an array containing an offset for each bank.
+     *  @throws ArrayIndexOutOfBoundsException if <code>numBanks</code>
+     *          does not equal the length of <code>offsets</code>
+     *  @since 1.7
+     */
+    DataBuffer(State initialState,
+               int dataType, int size, int numBanks, int offsets[])
+    {
+        if (numBanks != offsets.length) {
+            throw new ArrayIndexOutOfBoundsException("Number of banks" +
+                 " does not match number of bank offsets");
+        }
+        this.theTrackable = StateTrackableDelegate.createInstance(initialState);
+        this.dataType = dataType;
+        this.banks = numBanks;
+        this.size = size;
+        this.offset = offsets[0];
+        this.offsets = (int[])offsets.clone();
+    }
+
+    /**  Returns the data type of this DataBuffer.
+     *   @return the data type of this <code>DataBuffer</code>.
+     */
+    public int getDataType() {
+        return dataType;
+    }
+
+    /**  Returns the size (in array elements) of all banks.
+     *   @return the size of all banks.
+     */
+    public int getSize() {
+        return size;
+    }
+
+    /** Returns the offset of the default bank in array elements.
+     *  @return the offset of the default bank.
+     */
+    public int getOffset() {
+        return offset;
+    }
+
+    /** Returns the offsets (in array elements) of all the banks.
+     *  @return the offsets of all banks.
+     */
+    public int[] getOffsets() {
+        return (int[])offsets.clone();
+    }
+
+    /** Returns the number of banks in this DataBuffer.
+     *  @return the number of banks.
+     */
+    public int getNumBanks() {
+        return banks;
+    }
+
+    /**
+     * Returns the requested data array element from the first (default) bank
+     * as an integer.
+     * @param i the index of the requested data array element
+     * @return the data array element at the specified index.
+     * @see #setElem(int, int)
+     * @see #setElem(int, int, int)
+     */
+    public int getElem(int i) {
+        return getElem(0,i);
+    }
+
+    /**
+     * Returns the requested data array element from the specified bank
+     * as an integer.
+     * @param bank the specified bank
+     * @param i the index of the requested data array element
+     * @return the data array element at the specified index from the
+     *         specified bank at the specified index.
+     * @see #setElem(int, int)
+     * @see #setElem(int, int, int)
+     */
+    public abstract int getElem(int bank, int i);
+
+    /**
+     * Sets the requested data array element in the first (default) bank
+     * from the given integer.
+     * @param i the specified index into the data array
+     * @param val the data to set the element at the specified index in
+     * the data array
+     * @see #getElem(int)
+     * @see #getElem(int, int)
+     */
+    public void  setElem(int i, int val) {
+        setElem(0,i,val);
+    }
+
+    /**
+     * Sets the requested data array element in the specified bank
+     * from the given integer.
+     * @param bank the specified bank
+     * @param i the specified index into the data array
+     * @param val  the data to set the element in the specified bank
+     * at the specified index in the data array
+     * @see #getElem(int)
+     * @see #getElem(int, int)
+     */
+    public abstract void setElem(int bank, int i, int val);
+
+    /**
+     * Returns the requested data array element from the first (default) bank
+     * as a float.  The implementation in this class is to cast getElem(i)
+     * to a float.  Subclasses may override this method if another
+     * implementation is needed.
+     * @param i the index of the requested data array element
+     * @return a float value representing the data array element at the
+     *  specified index.
+     * @see #setElemFloat(int, float)
+     * @see #setElemFloat(int, int, float)
+     */
+    public float getElemFloat(int i) {
+        return (float)getElem(i);
+    }
+
+    /**
+     * Returns the requested data array element from the specified bank
+     * as a float.  The implementation in this class is to cast
+     * {@link #getElem(int, int)}
+     * to a float.  Subclasses can override this method if another
+     * implementation is needed.
+     * @param bank the specified bank
+     * @param i the index of the requested data array element
+     * @return a float value representing the data array element from the
+     * specified bank at the specified index.
+     * @see #setElemFloat(int, float)
+     * @see #setElemFloat(int, int, float)
+     */
+    public float getElemFloat(int bank, int i) {
+        return (float)getElem(bank,i);
+    }
+
+    /**
+     * Sets the requested data array element in the first (default) bank
+     * from the given float.  The implementation in this class is to cast
+     * val to an int and call {@link #setElem(int, int)}.  Subclasses
+     * can override this method if another implementation is needed.
+     * @param i the specified index
+     * @param val the value to set the element at the specified index in
+     * the data array
+     * @see #getElemFloat(int)
+     * @see #getElemFloat(int, int)
+     */
+    public void setElemFloat(int i, float val) {
+        setElem(i,(int)val);
+    }
+
+    /**
+     * Sets the requested data array element in the specified bank
+     * from the given float.  The implementation in this class is to cast
+     * val to an int and call {@link #setElem(int, int)}.  Subclasses can
+     * override this method if another implementation is needed.
+     * @param bank the specified bank
+     * @param i the specified index
+     * @param val the value to set the element in the specified bank at
+     * the specified index in the data array
+     * @see #getElemFloat(int)
+     * @see #getElemFloat(int, int)
+     */
+    public void setElemFloat(int bank, int i, float val) {
+        setElem(bank,i,(int)val);
+    }
+
+    /**
+     * Returns the requested data array element from the first (default) bank
+     * as a double.  The implementation in this class is to cast
+     * {@link #getElem(int)}
+     * to a double.  Subclasses can override this method if another
+     * implementation is needed.
+     * @param i the specified index
+     * @return a double value representing the element at the specified
+     * index in the data array.
+     * @see #setElemDouble(int, double)
+     * @see #setElemDouble(int, int, double)
+     */
+    public double getElemDouble(int i) {
+        return (double)getElem(i);
+    }
+
+    /**
+     * Returns the requested data array element from the specified bank as
+     * a double.  The implementation in this class is to cast getElem(bank, i)
+     * to a double.  Subclasses may override this method if another
+     * implementation is needed.
+     * @param bank the specified bank
+     * @param i the specified index
+     * @return a double value representing the element from the specified
+     * bank at the specified index in the data array.
+     * @see #setElemDouble(int, double)
+     * @see #setElemDouble(int, int, double)
+     */
+    public double getElemDouble(int bank, int i) {
+        return (double)getElem(bank,i);
+    }
+
+    /**
+     * Sets the requested data array element in the first (default) bank
+     * from the given double.  The implementation in this class is to cast
+     * val to an int and call {@link #setElem(int, int)}.  Subclasses can
+     * override this method if another implementation is needed.
+     * @param i the specified index
+     * @param val the value to set the element at the specified index
+     * in the data array
+     * @see #getElemDouble(int)
+     * @see #getElemDouble(int, int)
+     */
+    public void setElemDouble(int i, double val) {
+        setElem(i,(int)val);
+    }
+
+    /**
+     * Sets the requested data array element in the specified bank
+     * from the given double.  The implementation in this class is to cast
+     * val to an int and call {@link #setElem(int, int)}.  Subclasses can
+     * override this method if another implementation is needed.
+     * @param bank the specified bank
+     * @param i the specified index
+     * @param val the value to set the element in the specified bank
+     * at the specified index of the data array
+     * @see #getElemDouble(int)
+     * @see #getElemDouble(int, int)
+     */
+    public void setElemDouble(int bank, int i, double val) {
+        setElem(bank,i,(int)val);
+    }
+
+    static int[] toIntArray(Object obj) {
+        if (obj instanceof int[]) {
+            return (int[])obj;
+        } else if (obj == null) {
+            return null;
+        } else if (obj instanceof short[]) {
+            short sdata[] = (short[])obj;
+            int idata[] = new int[sdata.length];
+            for (int i = 0; i < sdata.length; i++) {
+                idata[i] = (int)sdata[i] & 0xffff;
+            }
+            return idata;
+        } else if (obj instanceof byte[]) {
+            byte bdata[] = (byte[])obj;
+            int idata[] = new int[bdata.length];
+            for (int i = 0; i < bdata.length; i++) {
+                idata[i] = 0xff & (int)bdata[i];
+            }
+            return idata;
+        }
+        return null;
+    }
+
+    static {
+        SunWritableRaster.setDataStealer(new SunWritableRaster.DataStealer() {
+            public byte[] getData(DataBufferByte dbb, int bank) {
+                return dbb.bankdata[bank];
+            }
+
+            public short[] getData(DataBufferUShort dbus, int bank) {
+                return dbus.bankdata[bank];
+            }
+
+            public int[] getData(DataBufferInt dbi, int bank) {
+                return dbi.bankdata[bank];
+            }
+
+            public StateTrackableDelegate getTrackable(DataBuffer db) {
+                return db.theTrackable;
+            }
+        });
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/classes/java/awt/image/DataBufferByte.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,286 @@
+/*
+ * Portions Copyright 1997-2007 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) Eastman Kodak Company, 1997
+ *** As  an unpublished  work pursuant to Title 17 of the United
+ *** States Code.  All rights reserved.
+ ******************************************************************
+ ******************************************************************
+ ******************************************************************/
+
+package java.awt.image;
+
+import static sun.java2d.StateTrackable.State.*;
+
+/**
+ * This class extends <CODE>DataBuffer</CODE> and stores data internally as bytes.
+ * Values stored in the byte array(s) of this <CODE>DataBuffer</CODE> are treated as
+ * unsigned values.
+ * <p>
+ * <a name="optimizations">
+ * Note that some implementations may function more efficiently
+ * if they can maintain control over how the data for an image is
+ * stored.
+ * For example, optimizations such as caching an image in video
+ * memory require that the implementation track all modifications
+ * to that data.
+ * Other implementations may operate better if they can store the
+ * data in locations other than a Java array.
+ * To maintain optimum compatibility with various optimizations
+ * it is best to avoid constructors and methods which expose the
+ * underlying storage as a Java array, as noted below in the
+ * documentation for those methods.
+ * </a>
+ */
+public final class DataBufferByte extends DataBuffer
+{
+    /** The default data bank. */
+    byte data[];
+
+    /** All data banks */
+    byte bankdata[][];
+
+    /**
+     * Constructs a byte-based <CODE>DataBuffer</CODE> with a single bank and the
+     * specified size.
+     *
+     * @param size The size of the <CODE>DataBuffer</CODE>.
+     */
+    public DataBufferByte(int size) {
+      super(STABLE, TYPE_BYTE, size);
+      data = new byte[size];
+      bankdata = new byte[1][];
+      bankdata[0] = data;
+    }
+
+    /**
+     * Constructs a byte based <CODE>DataBuffer</CODE> with the specified number of
+     * banks all of which are the specified size.
+     *
+     * @param size The size of the banks in the <CODE>DataBuffer</CODE>.
+     * @param numBanks The number of banks in the a<CODE>DataBuffer</CODE>.
+     */
+    public DataBufferByte(int size, int numBanks) {
+        super(STABLE, TYPE_BYTE, size, numBanks);
+        bankdata = new byte[numBanks][];
+        for (int i= 0; i < numBanks; i++) {
+            bankdata[i] = new byte[size];
+        }
+        data = bankdata[0];
+    }
+
+    /**
+     * Constructs a byte-based <CODE>DataBuffer</CODE> with a single bank using the
+     * specified array.
+     * Only the first <CODE>size</CODE> elements should be used by accessors of
+     * this <CODE>DataBuffer</CODE>.  <CODE>dataArray</CODE> must be large enough to
+     * hold <CODE>size</CODE> elements.
+     * <p>
+     * Note that {@code DataBuffer} objects created by this constructor
+     * may be incompatible with <a href="#optimizations">performance
+     * optimizations</a> used by some implementations (such as caching
+     * an associated image in video memory).
+     *
+     * @param dataArray The byte array for the <CODE>DataBuffer</CODE>.
+     * @param size The size of the <CODE>DataBuffer</CODE> bank.
+     */
+    public DataBufferByte(byte dataArray[], int size) {
+        super(UNTRACKABLE, TYPE_BYTE, size);
+        data = dataArray;
+        bankdata = new byte[1][];
+        bankdata[0] = data;
+    }
+
+    /**
+     * Constructs a byte-based <CODE>DataBuffer</CODE> with a single bank using the
+     * specified array, size, and offset.  <CODE>dataArray</CODE> must have at least
+     * <CODE>offset</CODE> + <CODE>size</CODE> elements.  Only elements <CODE>offset</CODE>
+     * through <CODE>offset</CODE> + <CODE>size</CODE> - 1
+     * should be used by accessors of this <CODE>DataBuffer</CODE>.
+     * <p>
+     * Note that {@code DataBuffer} objects created by this constructor
+     * may be incompatible with <a href="#optimizations">performance
+     * optimizations</a> used by some implementations (such as caching
+     * an associated image in video memory).
+     *
+     * @param dataArray The byte array for the <CODE>DataBuffer</CODE>.
+     * @param size The size of the <CODE>DataBuffer</CODE> bank.
+     * @param offset The offset into the <CODE>dataArray</CODE>. <CODE>dataArray</CODE>
+     * must have at least <CODE>offset</CODE> + <CODE>size</CODE> elements.
+     */
+    public DataBufferByte(byte dataArray[], int size, int offset){
+        super(UNTRACKABLE, TYPE_BYTE, size, 1, offset);
+        data = dataArray;
+        bankdata = new byte[1][];
+        bankdata[0] = data;
+    }
+
+    /**
+     * Constructs a byte-based <CODE>DataBuffer</CODE> with the specified arrays.
+     * The number of banks is equal to <CODE>dataArray.length</CODE>.
+     * Only the first <CODE>size</CODE> elements of each array should be used by
+     * accessors of this <CODE>DataBuffer</CODE>.
+     * <p>
+     * Note that {@code DataBuffer} objects created by this constructor
+     * may be incompatible with <a href="#optimizations">performance
+     * optimizations</a> used by some implementations (such as caching
+     * an associated image in video memory).
+     *
+     * @param dataArray The byte arrays for the <CODE>DataBuffer</CODE>.
+     * @param size The size of the banks in the <CODE>DataBuffer</CODE>.
+     */
+    public DataBufferByte(byte dataArray[][], int size) {
+        super(UNTRACKABLE, TYPE_BYTE, size, dataArray.length);
+        bankdata = (byte[][]) dataArray.clone();
+        data = bankdata[0];
+    }
+
+    /**
+     * Constructs a byte-based <CODE>DataBuffer</CODE> with the specified arrays, size,
+     * and offsets.
+     * The number of banks is equal to <CODE>dataArray.length</CODE>.  Each array must
+     * be at least as large as <CODE>size</CODE> + the corresponding <CODE>offset</CODE>.
+     * There must be an entry in the <CODE>offset</CODE> array for each <CODE>dataArray</CODE>
+     * entry.  For each bank, only elements <CODE>offset</CODE> through
+     * <CODE>offset</CODE> + <CODE>size</CODE> - 1 should be used by accessors of this
+     * <CODE>DataBuffer</CODE>.
+     * <p>
+     * Note that {@code DataBuffer} objects created by this constructor
+     * may be incompatible with <a href="#optimizations">performance
+     * optimizations</a> used by some implementations (such as caching
+     * an associated image in video memory).
+     *
+     * @param dataArray The byte arrays for the <CODE>DataBuffer</CODE>.
+     * @param size The size of the banks in the <CODE>DataBuffer</CODE>.
+     * @param offsets The offsets into each array.
+     */
+    public DataBufferByte(byte dataArray[][], int size, int offsets[]) {
+        super(UNTRACKABLE, TYPE_BYTE, size, dataArray.length, offsets);
+        bankdata = (byte[][]) dataArray.clone();
+        data = bankdata[0];
+    }
+
+    /**
+     * Returns the default (first) byte data array.
+     * <p>
+     * Note that calling this method may cause this {@code DataBuffer}
+     * object to be incompatible with <a href="#optimizations">performance
+     * optimizations</a> used by some implementations (such as caching
+     * an associated image in video memory).
+     *
+     * @return The first byte data array.
+     */
+    public byte[] getData() {
+        theTrackable.setUntrackable();
+        return data;
+    }
+
+    /**
+     * Returns the data array for the specified bank.
+     * <p>
+     * Note that calling this method may cause this {@code DataBuffer}
+     * object to be incompatible with <a href="#optimizations">performance
+     * optimizations</a> used by some implementations (such as caching
+     * an associated image in video memory).
+     *
+     * @param bank The bank whose data array you want to get.
+     * @return The data array for the specified bank.
+     */
+    public byte[] getData(int bank) {
+        theTrackable.setUntrackable();
+        return bankdata[bank];
+    }
+
+    /**
+     * Returns the data arrays for all banks.
+     * <p>
+     * Note that calling this method may cause this {@code DataBuffer}
+     * object to be incompatible with <a href="#optimizations">performance
+     * optimizations</a> used by some implementations (such as caching
+     * an associated image in video memory).
+     *
+     * @return All of the data arrays.
+     */
+    public byte[][] getBankData() {
+        theTrackable.setUntrackable();
+        return (byte[][]) bankdata.clone();
+    }
+
+    /**
+     * Returns the requested data array element from the first (default) bank.
+     *
+     * @param i The data array element you want to get.
+     * @return The requested data array element as an integer.
+     * @see #setElem(int, int)
+     * @see #setElem(int, int, int)
+     */
+    public int getElem(int i) {
+        return (int)(data[i+offset]) & 0xff;
+    }
+
+    /**
+     * Returns the requested data array element from the specified bank.
+     *
+     * @param bank The bank from which you want to get a data array element.
+     * @param i The data array element you want to get.
+     * @return The requested data array element as an integer.
+     * @see #setElem(int, int)
+     * @see #setElem(int, int, int)
+     */
+    public int getElem(int bank, int i) {
+        return (int)(bankdata[bank][i+offsets[bank]]) & 0xff;
+    }
+
+    /**
+     * Sets the requested data array element in the first (default) bank
+     * to the specified value.
+     *
+     * @param i The data array element you want to set.
+     * @param val The integer value to which you want to set the data array element.
+     * @see #getElem(int)
+     * @see #getElem(int, int)
+     */
+    public void setElem(int i, int val) {
+        data[i+offset] = (byte)val;
+        theTrackable.markDirty();
+    }
+
+    /**
+     * Sets the requested data array element in the specified bank
+     * from the given integer.
+     * @param bank The bank in which you want to set the data array element.
+     * @param i The data array element you want to set.
+     * @param val The integer value to which you want to set the specified data array element.
+     * @see #getElem(int)
+     * @see #getElem(int, int)
+     */
+    public void setElem(int bank, int i, int val) {
+        bankdata[bank][i+offsets[bank]] = (byte)val;
+        theTrackable.markDirty();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/classes/java/awt/image/DataBufferInt.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,284 @@
+/*
+ * Portions Copyright 1997-2007 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) Eastman Kodak Company, 1997
+ *** As  an unpublished  work pursuant to Title 17 of the United
+ *** States Code.  All rights reserved.
+ ******************************************************************
+ ******************************************************************
+ ******************************************************************/
+
+package java.awt.image;
+
+import static sun.java2d.StateTrackable.State.*;
+
+/**
+ * This class extends <CODE>DataBuffer</CODE> and stores data internally
+ * as integers.
+ * <p>
+ * <a name="optimizations">
+ * Note that some implementations may function more efficiently
+ * if they can maintain control over how the data for an image is
+ * stored.
+ * For example, optimizations such as caching an image in video
+ * memory require that the implementation track all modifications
+ * to that data.
+ * Other implementations may operate better if they can store the
+ * data in locations other than a Java array.
+ * To maintain optimum compatibility with various optimizations
+ * it is best to avoid constructors and methods which expose the
+ * underlying storage as a Java array as noted below in the
+ * documentation for those methods.
+ * </a>
+ */
+public final class DataBufferInt extends DataBuffer
+{
+    /** The default data bank. */
+    int data[];
+
+    /** All data banks */
+    int bankdata[][];
+
+    /**
+     * Constructs an integer-based <CODE>DataBuffer</CODE> with a single bank
+     * and the specified size.
+     *
+     * @param size The size of the <CODE>DataBuffer</CODE>.
+     */
+    public DataBufferInt(int size) {
+        super(STABLE, TYPE_INT, size);
+        data = new int[size];
+        bankdata = new int[1][];
+        bankdata[0] = data;
+    }
+
+    /**
+     * Constructs an integer-based <CODE>DataBuffer</CODE> with the specified number of
+     * banks, all of which are the specified size.
+     *
+     * @param size The size of the banks in the <CODE>DataBuffer</CODE>.
+     * @param numBanks The number of banks in the a<CODE>DataBuffer</CODE>.
+     */
+    public DataBufferInt(int size, int numBanks) {
+        super(STABLE, TYPE_INT, size, numBanks);
+        bankdata = new int[numBanks][];
+        for (int i= 0; i < numBanks; i++) {
+            bankdata[i] = new int[size];
+        }
+        data = bankdata[0];
+    }
+
+    /**
+     * Constructs an integer-based <CODE>DataBuffer</CODE> with a single bank using the
+     * specified array.
+     * Only the first <CODE>size</CODE> elements should be used by accessors of
+     * this <CODE>DataBuffer</CODE>.  <CODE>dataArray</CODE> must be large enough to
+     * hold <CODE>size</CODE> elements.
+     * <p>
+     * Note that {@code DataBuffer} objects created by this constructor
+     * may be incompatible with <a href="#optimizations">performance
+     * optimizations</a> used by some implementations (such as caching
+     * an associated image in video memory).
+     *
+     * @param dataArray The integer array for the <CODE>DataBuffer</CODE>.
+     * @param size The size of the <CODE>DataBuffer</CODE> bank.
+     */
+    public DataBufferInt(int dataArray[], int size) {
+        super(UNTRACKABLE, TYPE_INT, size);
+        data = dataArray;
+        bankdata = new int[1][];
+        bankdata[0] = data;
+    }
+
+    /**
+     * Constructs an integer-based <CODE>DataBuffer</CODE> with a single bank using the
+     * specified array, size, and offset.  <CODE>dataArray</CODE> must have at least
+     * <CODE>offset</CODE> + <CODE>size</CODE> elements.  Only elements <CODE>offset</CODE>
+     * through <CODE>offset</CODE> + <CODE>size</CODE> - 1
+     * should be used by accessors of this <CODE>DataBuffer</CODE>.
+     * <p>
+     * Note that {@code DataBuffer} objects created by this constructor
+     * may be incompatible with <a href="#optimizations">performance
+     * optimizations</a> used by some implementations (such as caching
+     * an associated image in video memory).
+     *
+     * @param dataArray The integer array for the <CODE>DataBuffer</CODE>.
+     * @param size The size of the <CODE>DataBuffer</CODE> bank.
+     * @param offset The offset into the <CODE>dataArray</CODE>.
+     */
+    public DataBufferInt(int dataArray[], int size, int offset) {
+        super(UNTRACKABLE, TYPE_INT, size, 1, offset);
+        data = dataArray;
+        bankdata = new int[1][];
+        bankdata[0] = data;
+    }
+
+    /**
+     * Constructs an integer-based <CODE>DataBuffer</CODE> with the specified arrays.
+     * The number of banks will be equal to <CODE>dataArray.length</CODE>.
+     * Only the first <CODE>size</CODE> elements of each array should be used by
+     * accessors of this <CODE>DataBuffer</CODE>.
+     * <p>
+     * Note that {@code DataBuffer} objects created by this constructor
+     * may be incompatible with <a href="#optimizations">performance
+     * optimizations</a> used by some implementations (such as caching
+     * an associated image in video memory).
+     *
+     * @param dataArray The integer arrays for the <CODE>DataBuffer</CODE>.
+     * @param size The size of the banks in the <CODE>DataBuffer</CODE>.
+     */
+    public DataBufferInt(int dataArray[][], int size) {
+        super(UNTRACKABLE, TYPE_INT, size, dataArray.length);
+        bankdata = (int [][]) dataArray.clone();
+        data = bankdata[0];
+    }
+
+    /**
+     * Constructs an integer-based <CODE>DataBuffer</CODE> with the specified arrays, size,
+     * and offsets.
+     * The number of banks is equal to <CODE>dataArray.length</CODE>.  Each array must
+     * be at least as large as <CODE>size</CODE> + the corresponding offset.   There must
+     * be an entry in the offset array for each <CODE>dataArray</CODE> entry.  For each
+     * bank, only elements <CODE>offset</CODE> through
+     * <CODE>offset</CODE> + <CODE>size</CODE> - 1 should be
+     * used by accessors of this <CODE>DataBuffer</CODE>.
+     * <p>
+     * Note that {@code DataBuffer} objects created by this constructor
+     * may be incompatible with <a href="#optimizations">performance
+     * optimizations</a> used by some implementations (such as caching
+     * an associated image in video memory).
+     *
+     * @param dataArray The integer arrays for the <CODE>DataBuffer</CODE>.
+     * @param size The size of the banks in the <CODE>DataBuffer</CODE>.
+     * @param offsets The offsets into each array.
+     */
+    public DataBufferInt(int dataArray[][], int size, int offsets[]) {
+        super(UNTRACKABLE, TYPE_INT, size, dataArray.length, offsets);
+        bankdata = (int [][]) dataArray.clone();
+        data = bankdata[0];
+    }
+
+    /**
+     * Returns the default (first) int data array in <CODE>DataBuffer</CODE>.
+     * <p>
+     * Note that calling this method may cause this {@code DataBuffer}
+     * object to be incompatible with <a href="#optimizations">performance
+     * optimizations</a> used by some implementations (such as caching
+     * an associated image in video memory).
+     *
+     * @return The first integer data array.
+     */
+    public int[] getData() {
+        theTrackable.setUntrackable();
+        return data;
+    }
+
+    /**
+     * Returns the data array for the specified bank.
+     * <p>
+     * Note that calling this method may cause this {@code DataBuffer}
+     * object to be incompatible with <a href="#optimizations">performance
+     * optimizations</a> used by some implementations (such as caching
+     * an associated image in video memory).
+     *
+     * @param bank The bank whose data array you want to get.
+     * @return The data array for the specified bank.
+     */
+    public int[] getData(int bank) {
+        theTrackable.setUntrackable();
+        return bankdata[bank];
+    }
+
+    /**
+     * Returns the data arrays for all banks.
+     * <p>
+     * Note that calling this method may cause this {@code DataBuffer}
+     * object to be incompatible with <a href="#optimizations">performance
+     * optimizations</a> used by some implementations (such as caching
+     * an associated image in video memory).
+     *
+     * @return All of the data arrays.
+     */
+    public int[][] getBankData() {
+        theTrackable.setUntrackable();
+        return (int [][]) bankdata.clone();
+    }
+
+    /**
+     * Returns the requested data array element from the first (default) bank.
+     *
+     * @param i The data array element you want to get.
+     * @return The requested data array element as an integer.
+     * @see #setElem(int, int)
+     * @see #setElem(int, int, int)
+     */
+    public int getElem(int i) {
+        return data[i+offset];
+    }
+
+    /**
+     * Returns the requested data array element from the specified bank.
+     *
+     * @param bank The bank from which you want to get a data array element.
+     * @param i The data array element you want to get.
+     * @return The requested data array element as an integer.
+     * @see #setElem(int, int)
+     * @see #setElem(int, int, int)
+     */
+    public int getElem(int bank, int i) {
+        return bankdata[bank][i+offsets[bank]];
+    }
+
+    /**
+     * Sets the requested data array element in the first (default) bank
+     * to the specified value.
+     *
+     * @param i The data array element you want to set.
+     * @param val The integer value to which you want to set the data array element.
+     * @see #getElem(int)
+     * @see #getElem(int, int)
+     */
+    public void setElem(int i, int val) {
+        data[i+offset] = val;
+        theTrackable.markDirty();
+    }
+
+    /**
+     * Sets the requested data array element in the specified bank
+     * to the integer value <CODE>i</CODE>.
+     * @param bank The bank in which you want to set the data array element.
+     * @param i The data array element you want to set.
+     * @param val The integer value to which you want to set the specified data array element.
+     * @see #getElem(int)
+     * @see #getElem(int, int)
+     */
+    public void setElem(int bank, int i, int val) {
+        bankdata[bank][i+offsets[bank]] = (int)val;
+        theTrackable.markDirty();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/classes/java/awt/image/DataBufferShort.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,283 @@
+/*
+ * Portions Copyright 1997-2007 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) Eastman Kodak Company, 1997
+ *** As  an unpublished  work pursuant to Title 17 of the United
+ *** States Code.  All rights reserved.
+ ******************************************************************
+ ******************************************************************
+ ******************************************************************/
+
+package java.awt.image;
+
+import static sun.java2d.StateTrackable.State.*;
+
+/**
+ * This class extends <CODE>DataBuffer</CODE> and stores data internally as shorts.
+ * <p>
+ * <a name="optimizations">
+ * Note that some implementations may function more efficiently
+ * if they can maintain control over how the data for an image is
+ * stored.
+ * For example, optimizations such as caching an image in video
+ * memory require that the implementation track all modifications
+ * to that data.
+ * Other implementations may operate better if they can store the
+ * data in locations other than a Java array.
+ * To maintain optimum compatibility with various optimizations
+ * it is best to avoid constructors and methods which expose the
+ * underlying storage as a Java array as noted below in the
+ * documentation for those methods.
+ * </a>
+ */
+public final class DataBufferShort extends DataBuffer
+{
+    /** The default data bank. */
+    short data[];
+
+    /** All data banks */
+    short bankdata[][];
+
+    /**
+     * Constructs a short-based <CODE>DataBuffer</CODE> with a single bank and the
+     * specified size.
+     *
+     * @param size The size of the <CODE>DataBuffer</CODE>.
+     */
+    public DataBufferShort(int size) {
+        super(STABLE, TYPE_SHORT,size);
+        data = new short[size];
+        bankdata = new short[1][];
+        bankdata[0] = data;
+    }
+
+    /**
+     * Constructs a short-based <CODE>DataBuffer</CODE> with the specified number of
+     * banks all of which are the specified size.
+     *
+     * @param size The size of the banks in the <CODE>DataBuffer</CODE>.
+     * @param numBanks The number of banks in the a<CODE>DataBuffer</CODE>.
+     */
+    public DataBufferShort(int size, int numBanks) {
+        super(STABLE, TYPE_SHORT,size,numBanks);
+        bankdata = new short[numBanks][];
+        for (int i= 0; i < numBanks; i++) {
+            bankdata[i] = new short[size];
+        }
+        data = bankdata[0];
+    }
+
+    /**
+     * Constructs a short-based <CODE>DataBuffer</CODE> with a single bank using the
+     * specified array.
+     * Only the first <CODE>size</CODE> elements should be used by accessors of
+     * this <CODE>DataBuffer</CODE>.  <CODE>dataArray</CODE> must be large enough to
+     * hold <CODE>size</CODE> elements.
+     * <p>
+     * Note that {@code DataBuffer} objects created by this constructor
+     * may be incompatible with <a href="#optimizations">performance
+     * optimizations</a> used by some implementations (such as caching
+     * an associated image in video memory).
+     *
+     * @param dataArray The short array for the <CODE>DataBuffer</CODE>.
+     * @param size The size of the <CODE>DataBuffer</CODE> bank.
+     */
+    public DataBufferShort(short dataArray[], int size) {
+        super(UNTRACKABLE, TYPE_SHORT, size);
+        data = dataArray;
+        bankdata = new short[1][];
+        bankdata[0] = data;
+    }
+
+    /**
+     * Constructs a short-based <CODE>DataBuffer</CODE> with a single bank using the
+     * specified array, size, and offset.  <CODE>dataArray</CODE> must have at least
+     * <CODE>offset</CODE> + <CODE>size</CODE> elements.  Only elements <CODE>offset</CODE>
+     * through <CODE>offset</CODE> + <CODE>size</CODE> - 1
+     * should be used by accessors of this <CODE>DataBuffer</CODE>.
+     * <p>
+     * Note that {@code DataBuffer} objects created by this constructor
+     * may be incompatible with <a href="#optimizations">performance
+     * optimizations</a> used by some implementations (such as caching
+     * an associated image in video memory).
+     *
+     * @param dataArray The short array for the <CODE>DataBuffer</CODE>.
+     * @param size The size of the <CODE>DataBuffer</CODE> bank.
+     * @param offset The offset into the <CODE>dataArray</CODE>.
+     */
+    public DataBufferShort(short dataArray[], int size, int offset) {
+        super(UNTRACKABLE, TYPE_SHORT, size, 1, offset);
+        data = dataArray;
+        bankdata = new short[1][];
+        bankdata[0] = data;
+    }
+
+    /**
+     * Constructs a short-based <CODE>DataBuffer</CODE> with the specified arrays.
+     * The number of banks will be equal to <CODE>dataArray.length</CODE>.
+     * Only the first <CODE>size</CODE> elements of each array should be used by
+     * accessors of this <CODE>DataBuffer</CODE>.
+     * <p>
+     * Note that {@code DataBuffer} objects created by this constructor
+     * may be incompatible with <a href="#optimizations">performance
+     * optimizations</a> used by some implementations (such as caching
+     * an associated image in video memory).
+     *
+     * @param dataArray The short arrays for the <CODE>DataBuffer</CODE>.
+     * @param size The size of the banks in the <CODE>DataBuffer</CODE>.
+     */
+    public DataBufferShort(short dataArray[][], int size) {
+        super(UNTRACKABLE, TYPE_SHORT, size, dataArray.length);
+        bankdata = (short[][]) dataArray.clone();
+        data = bankdata[0];
+    }
+
+    /**
+     * Constructs a short-based <CODE>DataBuffer</CODE> with the specified arrays, size,
+     * and offsets.
+     * The number of banks is equal to <CODE>dataArray.length</CODE>.  Each array must
+     * be at least as large as <CODE>size</CODE> + the corresponding offset.   There must
+     * be an entry in the offset array for each <CODE>dataArray</CODE> entry.  For each
+     * bank, only elements <CODE>offset</CODE> through
+     * <CODE>offset</CODE> + <CODE>size</CODE> - 1 should be
+     * used by accessors of this <CODE>DataBuffer</CODE>.
+     * <p>
+     * Note that {@code DataBuffer} objects created by this constructor
+     * may be incompatible with <a href="#optimizations">performance
+     * optimizations</a> used by some implementations (such as caching
+     * an associated image in video memory).
+     *
+     * @param dataArray The short arrays for the <CODE>DataBuffer</CODE>.
+     * @param size The size of the banks in the <CODE>DataBuffer</CODE>.
+     * @param offsets The offsets into each array.
+     */
+    public DataBufferShort(short dataArray[][], int size, int offsets[]) {
+        super(UNTRACKABLE, TYPE_SHORT, size, dataArray.length, offsets);
+        bankdata = (short[][]) dataArray.clone();
+        data = bankdata[0];
+    }
+
+    /**
+     * Returns the default (first) byte data array.
+     * <p>
+     * Note that calling this method may cause this {@code DataBuffer}
+     * object to be incompatible with <a href="#optimizations">performance
+     * optimizations</a> used by some implementations (such as caching
+     * an associated image in video memory).
+     *
+     * @return The first short data array.
+     */
+    public short[] getData() {
+        theTrackable.setUntrackable();
+        return data;
+    }
+
+    /**
+     * Returns the data array for the specified bank.
+     * <p>
+     * Note that calling this method may cause this {@code DataBuffer}
+     * object to be incompatible with <a href="#optimizations">performance
+     * optimizations</a> used by some implementations (such as caching
+     * an associated image in video memory).
+     *
+     * @param bank The bank whose data array you want to get.
+     * @return The data array for the specified bank.
+     */
+    public short[] getData(int bank) {
+        theTrackable.setUntrackable();
+        return bankdata[bank];
+    }
+
+    /**
+     * Returns the data arrays for all banks.
+     * <p>
+     * Note that calling this method may cause this {@code DataBuffer}
+     * object to be incompatible with <a href="#optimizations">performance
+     * optimizations</a> used by some implementations (such as caching
+     * an associated image in video memory).
+     *
+     * @return All of the data arrays.
+     */
+    public short[][] getBankData() {
+        theTrackable.setUntrackable();
+        return (short[][]) bankdata.clone();
+    }
+
+    /**
+     * Returns the requested data array element from the first (default) bank.
+     *
+     * @param i The data array element you want to get.
+     * @return The requested data array element as an integer.
+     * @see #setElem(int, int)
+     * @see #setElem(int, int, int)
+     */
+    public int getElem(int i) {
+        return (int)(data[i+offset]);
+    }
+
+    /**
+     * Returns the requested data array element from the specified bank.
+     *
+     * @param bank The bank from which you want to get a data array element.
+     * @param i The data array element you want to get.
+     * @return The requested data array element as an integer.
+     * @see #setElem(int, int)
+     * @see #setElem(int, int, int)
+     */
+    public int getElem(int bank, int i) {
+        return (int)(bankdata[bank][i+offsets[bank]]);
+    }
+
+    /**
+     * Sets the requested data array element in the first (default) bank
+     * to the specified value.
+     *
+     * @param i The data array element you want to set.
+     * @param val The integer value to which you want to set the data array element.
+     * @see #getElem(int)
+     * @see #getElem(int, int)
+     */
+    public void setElem(int i, int val) {
+        data[i+offset] = (short)val;
+        theTrackable.markDirty();
+    }
+
+    /**
+     * Sets the requested data array element in the specified bank
+     * from the given integer.
+     * @param bank The bank in which you want to set the data array element.
+     * @param i The data array element you want to set.
+     * @param val The integer value to which you want to set the specified data array element.
+     * @see #getElem(int)
+     * @see #getElem(int, int)
+     */
+    public void setElem(int bank, int i, int val) {
+        bankdata[bank][i+offsets[bank]] = (short)val;
+        theTrackable.markDirty();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/classes/java/awt/image/DataBufferUShort.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,318 @@
+/*
+ * Portions Copyright 1997-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) Eastman Kodak Company, 1997
+ *** As  an unpublished  work pursuant to Title 17 of the United
+ *** States Code.  All rights reserved.
+ ******************************************************************
+ ******************************************************************
+ ******************************************************************/
+
+package java.awt.image;
+
+import static sun.java2d.StateTrackable.State.*;
+
+/**
+ * This class extends <CODE>DataBuffer</CODE> and stores data internally as
+ * shorts.  Values stored in the short array(s) of this <CODE>DataBuffer</CODE>
+ * are treated as unsigned values.
+ * <p>
+ * <a name="optimizations">
+ * Note that some implementations may function more efficiently
+ * if they can maintain control over how the data for an image is
+ * stored.
+ * For example, optimizations such as caching an image in video
+ * memory require that the implementation track all modifications
+ * to that data.
+ * Other implementations may operate better if they can store the
+ * data in locations other than a Java array.
+ * To maintain optimum compatibility with various optimizations
+ * it is best to avoid constructors and methods which expose the
+ * underlying storage as a Java array as noted below in the
+ * documentation for those methods.
+ * </a>
+ */
+public final class DataBufferUShort extends DataBuffer
+{
+    /** The default data bank. */
+    short data[];
+
+    /** All data banks */
+    short bankdata[][];
+
+    /**
+     * Constructs an unsigned-short based <CODE>DataBuffer</CODE> with a single bank and the
+     * specified size.
+     *
+     * @param size The size of the <CODE>DataBuffer</CODE>.
+     */
+    public DataBufferUShort(int size) {
+        super(STABLE, TYPE_USHORT, size);
+        data = new short[size];
+        bankdata = new short[1][];
+        bankdata[0] = data;
+    }
+
+    /**
+     * Constructs an unsigned-short based <CODE>DataBuffer</CODE> with the specified number of
+     * banks, all of which are the specified size.
+     *
+     * @param size The size of the banks in the <CODE>DataBuffer</CODE>.
+     * @param numBanks The number of banks in the a<CODE>DataBuffer</CODE>.
+    */
+    public DataBufferUShort(int size, int numBanks) {
+        super(STABLE, TYPE_USHORT, size, numBanks);
+        bankdata = new short[numBanks][];
+        for (int i= 0; i < numBanks; i++) {
+            bankdata[i] = new short[size];
+        }
+        data = bankdata[0];
+    }
+
+    /**
+     * Constructs an unsigned-short based <CODE>DataBuffer</CODE> with a single bank
+     * using the specified array.
+     * Only the first <CODE>size</CODE> elements should be used by accessors of
+     * this <CODE>DataBuffer</CODE>.  <CODE>dataArray</CODE> must be large enough to
+     * hold <CODE>size</CODE> elements.
+     * <p>
+     * Note that {@code DataBuffer} objects created by this constructor
+     * may be incompatible with <a href="#optimizations">performance
+     * optimizations</a> used by some implementations (such as caching
+     * an associated image in video memory).
+     *
+     * @param dataArray The unsigned-short array for the <CODE>DataBuffer</CODE>.
+     * @param size The size of the <CODE>DataBuffer</CODE> bank.
+     */
+    public DataBufferUShort(short dataArray[], int size) {
+        super(UNTRACKABLE, TYPE_USHORT, size);
+        if (dataArray == null) {
+            throw new NullPointerException("dataArray is null");
+        }
+        data = dataArray;
+        bankdata = new short[1][];
+        bankdata[0] = data;
+    }
+
+    /**
+     * Constructs an unsigned-short based <CODE>DataBuffer</CODE> with a single bank
+     * using the specified array, size, and offset.  <CODE>dataArray</CODE> must have at
+     * least <CODE>offset</CODE> + <CODE>size</CODE> elements.  Only elements
+     * <CODE>offset</CODE> through <CODE>offset</CODE> + <CODE>size</CODE> - 1 should
+     * be used by accessors of this <CODE>DataBuffer</CODE>.
+     * <p>
+     * Note that {@code DataBuffer} objects created by this constructor
+     * may be incompatible with <a href="#optimizations">performance
+     * optimizations</a> used by some implementations (such as caching
+     * an associated image in video memory).
+     *
+     * @param dataArray The unsigned-short array for the <CODE>DataBuffer</CODE>.
+     * @param size The size of the <CODE>DataBuffer</CODE> bank.
+     * @param offset The offset into the <CODE>dataArray</CODE>.
+     */
+    public DataBufferUShort(short dataArray[], int size, int offset) {
+        super(UNTRACKABLE, TYPE_USHORT, size, 1, offset);
+        if (dataArray == null) {
+            throw new NullPointerException("dataArray is null");
+        }
+        if ((size+offset) > dataArray.length) {
+            throw new IllegalArgumentException("Length of dataArray is less "+
+                                               " than size+offset.");
+        }
+        data = dataArray;
+        bankdata = new short[1][];
+        bankdata[0] = data;
+    }
+
+    /**
+     * Constructs an unsigned-short based <CODE>DataBuffer</CODE> with the specified arrays.
+     * The number of banks will be equal to <CODE>dataArray.length</CODE>.
+     * Only the first <CODE>size</CODE> elements of each array should be used by
+     * accessors of this <CODE>DataBuffer</CODE>.
+     * <p>
+     * Note that {@code DataBuffer} objects created by this constructor
+     * may be incompatible with <a href="#optimizations">performance
+     * optimizations</a> used by some implementations (such as caching
+     * an associated image in video memory).
+     *
+     * @param dataArray The unsigned-short arrays for the <CODE>DataBuffer</CODE>.
+     * @param size The size of the banks in the <CODE>DataBuffer</CODE>.
+     */
+    public DataBufferUShort(short dataArray[][], int size) {
+        super(UNTRACKABLE, TYPE_USHORT, size, dataArray.length);
+        if (dataArray == null) {
+            throw new NullPointerException("dataArray is null");
+        }
+        for (int i=0; i < dataArray.length; i++) {
+            if (dataArray[i] == null) {
+                throw new NullPointerException("dataArray["+i+"] is null");
+            }
+        }
+
+        bankdata = (short[][]) dataArray.clone();
+        data = bankdata[0];
+    }
+
+    /**
+     * Constructs an unsigned-short based <CODE>DataBuffer</CODE> with specified arrays,
+     * size, and offsets.
+     * The number of banks is equal to <CODE>dataArray.length</CODE>.  Each array must
+     * be at least as large as <CODE>size</CODE> + the corresponding offset.   There must
+     * be an entry in the offset array for each <CODE>dataArray</CODE> entry.  For each
+     * bank, only elements <CODE>offset</CODE> through
+     * <CODE>offset</CODE> + <CODE>size</CODE> - 1 should be
+     * used by accessors of this <CODE>DataBuffer</CODE>.
+     * <p>
+     * Note that {@code DataBuffer} objects created by this constructor
+     * may be incompatible with <a href="#optimizations">performance
+     * optimizations</a> used by some implementations (such as caching
+     * an associated image in video memory).
+     *
+     * @param dataArray The unsigned-short arrays for the <CODE>DataBuffer</CODE>.
+     * @param size The size of the banks in the <CODE>DataBuffer</CODE>.
+     * @param offsets The offsets into each array.
+     */
+    public DataBufferUShort(short dataArray[][], int size, int offsets[]) {
+        super(UNTRACKABLE, TYPE_USHORT, size, dataArray.length, offsets);
+        if (dataArray == null) {
+            throw new NullPointerException("dataArray is null");
+        }
+        for (int i=0; i < dataArray.length; i++) {
+            if (dataArray[i] == null) {
+                throw new NullPointerException("dataArray["+i+"] is null");
+            }
+            if ((size+offsets[i]) > dataArray[i].length) {
+                throw new IllegalArgumentException("Length of dataArray["+i+
+                                                   "] is less than size+"+
+                                                   "offsets["+i+"].");
+            }
+
+        }
+        bankdata = (short[][]) dataArray.clone();
+        data = bankdata[0];
+    }
+
+    /**
+     * Returns the default (first) unsigned-short data array.
+     * <p>
+     * Note that calling this method may cause this {@code DataBuffer}
+     * object to be incompatible with <a href="#optimizations">performance
+     * optimizations</a> used by some implementations (such as caching
+     * an associated image in video memory).
+     *
+     * @return The first unsigned-short data array.
+     */
+    public short[] getData() {
+        theTrackable.setUntrackable();
+        return data;
+    }
+
+    /**
+     * Returns the data array for the specified bank.
+     * <p>
+     * Note that calling this method may cause this {@code DataBuffer}
+     * object to be incompatible with <a href="#optimizations">performance
+     * optimizations</a> used by some implementations (such as caching
+     * an associated image in video memory).
+     *
+     * @param bank The bank whose data array you want to get.
+     * @return The data array for the specified bank.
+     */
+    public short[] getData(int bank) {
+        theTrackable.setUntrackable();
+        return bankdata[bank];
+    }
+
+    /**
+     * Returns the data arrays for all banks.
+     * <p>
+     * Note that calling this method may cause this {@code DataBuffer}
+     * object to be incompatible with <a href="#optimizations">performance
+     * optimizations</a> used by some implementations (such as caching
+     * an associated image in video memory).
+     *
+     * @return All of the data arrays.
+     */
+    public short[][] getBankData() {
+        theTrackable.setUntrackable();
+        return (short[][]) bankdata.clone();
+    }
+
+    /**
+     * Returns the requested data array element from the first (default) bank.
+     *
+     * @param i The data array element you want to get.
+     * @return The requested data array element as an integer.
+     * @see #setElem(int, int)
+     * @see #setElem(int, int, int)
+     */
+    public int getElem(int i) {
+        return (int)(data[i+offset]&0xffff);
+    }
+
+    /**
+     * Returns the requested data array element from the specified bank.
+     *
+     * @param bank The bank from which you want to get a data array element.
+     * @param i The data array element you want to get.
+     * @return The requested data array element as an integer.
+     * @see #setElem(int, int)
+     * @see #setElem(int, int, int)
+     */
+    public int getElem(int bank, int i) {
+        return (int)(bankdata[bank][i+offsets[bank]]&0xffff);
+    }
+
+    /**
+     * Sets the requested data array element in the first (default) bank
+     * to the specified value.
+     *
+     * @param i The data array element you want to set.
+     * @param val The integer value to which you want to set the data array element.
+     * @see #getElem(int)
+     * @see #getElem(int, int)
+     */
+    public void setElem(int i, int val) {
+        data[i+offset] = (short)(val&0xffff);
+        theTrackable.markDirty();
+    }
+
+    /**
+     * Sets the requested data array element in the specified bank
+     * from the given integer.
+     * @param bank The bank in which you want to set the data array element.
+     * @param i The data array element you want to set.
+     * @param val The integer value to which you want to set the specified data array element.
+     * @see #getElem(int)
+     * @see #getElem(int, int)
+     */
+    public void setElem(int bank, int i, int val) {
+        bankdata[bank][i+offsets[bank]] = (short)(val&0xffff);
+        theTrackable.markDirty();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/classes/java/awt/image/MultiPixelPackedSampleModel.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,699 @@
+/*
+ * Portions Copyright 1997-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) Eastman Kodak Company, 1997
+ *** As  an unpublished  work pursuant to Title 17 of the United
+ *** States Code.  All rights reserved.
+ ******************************************************************
+ ******************************************************************
+ ******************************************************************/
+
+package java.awt.image;
+
+/**
+ * The <code>MultiPixelPackedSampleModel</code> class represents
+ * one-banded images and can pack multiple one-sample
+ * pixels into one data element.  Pixels are not allowed to span data elements.
+ * The data type can be DataBuffer.TYPE_BYTE, DataBuffer.TYPE_USHORT,
+ * or DataBuffer.TYPE_INT.  Each pixel must be a power of 2 number of bits
+ * and a power of 2 number of pixels must fit exactly in one data element.
+ * Pixel bit stride is equal to the number of bits per pixel.  Scanline
+ * stride is in data elements and the last several data elements might be
+ * padded with unused pixels.  Data bit offset is the offset in bits from
+ * the beginning of the {@link DataBuffer} to the first pixel and must be
+ * a multiple of pixel bit stride.
+ * <p>
+ * The following code illustrates extracting the bits for pixel
+ * <code>x,&nbsp;y</code> from <code>DataBuffer</code> <code>data</code>
+ * and storing the pixel data in data elements of type
+ * <code>dataType</code>:
+ * <pre>
+ *      int dataElementSize = DataBuffer.getDataTypeSize(dataType);
+ *      int bitnum = dataBitOffset + x*pixelBitStride;
+ *      int element = data.getElem(y*scanlineStride + bitnum/dataElementSize);
+ *      int shift = dataElementSize - (bitnum & (dataElementSize-1))
+ *                  - pixelBitStride;
+ *      int pixel = (element >> shift) & ((1 << pixelBitStride) - 1);
+ * </pre>
+ */
+
+public class MultiPixelPackedSampleModel extends SampleModel
+{
+    /** The number of bits from one pixel to the next. */
+    int pixelBitStride;
+
+    /** Bitmask that extracts the rightmost pixel of a data element. */
+    int bitMask;
+
+    /**
+      * The number of pixels that fit in a data element.  Also used
+      * as the number of bits per pixel.
+      */
+    int pixelsPerDataElement;
+
+    /** The size of a data element in bits. */
+    int dataElementSize;
+
+    /** The bit offset into the data array where the first pixel begins.
+     */
+    int dataBitOffset;
+
+    /** ScanlineStride of the data buffer described in data array elements. */
+    int scanlineStride;
+
+    /**
+     * Constructs a <code>MultiPixelPackedSampleModel</code> with the
+     * specified data type, width, height and number of bits per pixel.
+     * @param dataType  the data type for storing samples
+     * @param w         the width, in pixels, of the region of
+     *                  image data described
+     * @param h         the height, in pixels, of the region of
+     *                  image data described
+     * @param numberOfBits the number of bits per pixel
+     * @throws IllegalArgumentException if <code>dataType</code> is not
+     *         either <code>DataBuffer.TYPE_BYTE</code>,
+     *         <code>DataBuffer.TYPE_USHORT</code>, or
+     *         <code>DataBuffer.TYPE_INT</code>
+     */
+    public MultiPixelPackedSampleModel(int dataType,
+                                       int w,
+                                       int h,
+                                       int numberOfBits) {
+        this(dataType,w,h,
+             numberOfBits,
+            (w*numberOfBits+DataBuffer.getDataTypeSize(dataType)-1)/
+                DataBuffer.getDataTypeSize(dataType),
+             0);
+        if (dataType != DataBuffer.TYPE_BYTE &&
+            dataType != DataBuffer.TYPE_USHORT &&
+            dataType != DataBuffer.TYPE_INT) {
+            throw new IllegalArgumentException("Unsupported data type "+
+                                               dataType);
+        }
+    }
+
+    /**
+     * Constructs a <code>MultiPixelPackedSampleModel</code> with
+     * specified data type, width, height, number of bits per pixel,
+     * scanline stride and data bit offset.
+     * @param dataType  the data type for storing samples
+     * @param w         the width, in pixels, of the region of
+     *                  image data described
+     * @param h         the height, in pixels, of the region of
+     *                  image data described
+     * @param numberOfBits the number of bits per pixel
+     * @param scanlineStride the line stride of the image data
+     * @param dataBitOffset the data bit offset for the region of image
+     *                  data described
+     * @exception RasterFormatException if the number of bits per pixel
+     *                  is not a power of 2 or if a power of 2 number of
+     *                  pixels do not fit in one data element.
+     * @throws IllegalArgumentException if <code>w</code> or
+     *         <code>h</code> is not greater than 0
+     * @throws IllegalArgumentException if <code>dataType</code> is not
+     *         either <code>DataBuffer.TYPE_BYTE</code>,
+     *         <code>DataBuffer.TYPE_USHORT</code>, or
+     *         <code>DataBuffer.TYPE_INT</code>
+     */
+    public MultiPixelPackedSampleModel(int dataType, int w, int h,
+                                       int numberOfBits,
+                                       int scanlineStride,
+                                       int dataBitOffset) {
+        super(dataType, w, h, 1);
+        if (dataType != DataBuffer.TYPE_BYTE &&
+            dataType != DataBuffer.TYPE_USHORT &&
+            dataType != DataBuffer.TYPE_INT) {
+            throw new IllegalArgumentException("Unsupported data type "+
+                                               dataType);
+        }
+        this.dataType = dataType;
+        this.pixelBitStride = numberOfBits;
+        this.scanlineStride = scanlineStride;
+        this.dataBitOffset = dataBitOffset;
+        this.dataElementSize = DataBuffer.getDataTypeSize(dataType);
+        this.pixelsPerDataElement = dataElementSize/numberOfBits;
+        if (pixelsPerDataElement*numberOfBits != dataElementSize) {
+           throw new RasterFormatException("MultiPixelPackedSampleModel " +
+                                             "does not allow pixels to " +
+                                             "span data element boundaries");
+        }
+        this.bitMask = (1 << numberOfBits) - 1;
+    }
+
+
+    /**
+     * Creates a new <code>MultiPixelPackedSampleModel</code> with the
+     * specified width and height.  The new
+     * <code>MultiPixelPackedSampleModel</code> has the
+     * same storage data type and number of bits per pixel as this
+     * <code>MultiPixelPackedSampleModel</code>.
+     * @param w the specified width
+     * @param h the specified height
+     * @return a {@link SampleModel} with the specified width and height
+     * and with the same storage data type and number of bits per pixel
+     * as this <code>MultiPixelPackedSampleModel</code>.
+     * @throws IllegalArgumentException if <code>w</code> or
+     *         <code>h</code> is not greater than 0
+     */
+    public SampleModel createCompatibleSampleModel(int w, int h) {
+      SampleModel sampleModel =
+            new MultiPixelPackedSampleModel(dataType, w, h, pixelBitStride);
+      return sampleModel;
+    }
+
+    /**
+     * Creates a <code>DataBuffer</code> that corresponds to this
+     * <code>MultiPixelPackedSampleModel</code>.  The
+     * <code>DataBuffer</code> object's data type and size
+     * is consistent with this <code>MultiPixelPackedSampleModel</code>.
+     * The <code>DataBuffer</code> has a single bank.
+     * @return a <code>DataBuffer</code> with the same data type and
+     * size as this <code>MultiPixelPackedSampleModel</code>.
+     */
+    public DataBuffer createDataBuffer() {
+        DataBuffer dataBuffer = null;
+
+        int size = (int)scanlineStride*height;
+        switch (dataType) {
+        case DataBuffer.TYPE_BYTE:
+            dataBuffer = new DataBufferByte(size+(dataBitOffset+7)/8);
+            break;
+        case DataBuffer.TYPE_USHORT:
+            dataBuffer = new DataBufferUShort(size+(dataBitOffset+15)/16);
+            break;
+        case DataBuffer.TYPE_INT:
+            dataBuffer = new DataBufferInt(size+(dataBitOffset+31)/32);
+            break;
+        }
+        return dataBuffer;
+    }
+
+    /**
+     * Returns the number of data elements needed to transfer one pixel
+     * via the {@link #getDataElements} and {@link #setDataElements}
+     * methods.  For a <code>MultiPixelPackedSampleModel</code>, this is
+     * one.
+     * @return the number of data elements.
+     */
+    public int getNumDataElements() {
+        return 1;
+    }
+
+    /**
+     * Returns the number of bits per sample for all bands.
+     * @return the number of bits per sample.
+     */
+    public int[] getSampleSize() {
+        int sampleSize[] = {pixelBitStride};
+        return sampleSize;
+    }
+
+    /**
+     * Returns the number of bits per sample for the specified band.
+     * @param band the specified band
+     * @return the number of bits per sample for the specified band.
+     */
+    public int getSampleSize(int band) {
+        return pixelBitStride;
+    }
+
+    /**
+     * Returns the offset of pixel (x,&nbsp;y) in data array elements.
+     * @param x the X coordinate of the specified pixel
+     * @param y the Y coordinate of the specified pixel
+     * @return the offset of the specified pixel.
+     */
+    public int getOffset(int x, int y) {
+        int offset = y * scanlineStride;
+        offset +=  (x*pixelBitStride+dataBitOffset)/dataElementSize;
+        return offset;
+    }
+
+    /**
+     *  Returns the offset, in bits, into the data element in which it is
+     *  stored for the <code>x</code>th pixel of a scanline.
+     *  This offset is the same for all scanlines.
+     *  @param x the specified pixel
+     *  @return the bit offset of the specified pixel.
+     */
+    public int getBitOffset(int x){
+       return  (x*pixelBitStride+dataBitOffset)%dataElementSize;
+    }
+
+    /**
+     * Returns the scanline stride.
+     * @return the scanline stride of this
+     * <code>MultiPixelPackedSampleModel</code>.
+     */
+    public int getScanlineStride() {
+        return scanlineStride;
+    }
+
+    /**
+     * Returns the pixel bit stride in bits.  This value is the same as
+     * the number of bits per pixel.
+     * @return the <code>pixelBitStride</code> of this
+     * <code>MultiPixelPackedSampleModel</code>.
+     */
+    public int getPixelBitStride() {
+        return pixelBitStride;
+    }
+
+    /**
+     * Returns the data bit offset in bits.
+     * @return the <code>dataBitOffset</code> of this
+     * <code>MultiPixelPackedSampleModel</code>.
+     */
+    public int getDataBitOffset() {
+        return dataBitOffset;
+    }
+
+    /**
+     *  Returns the TransferType used to transfer pixels by way of the
+     *  <code>getDataElements</code> and <code>setDataElements</code>
+     *  methods. The TransferType might or might not be the same as the
+     *  storage DataType.  The TransferType is one of
+     *  DataBuffer.TYPE_BYTE, DataBuffer.TYPE_USHORT,
+     *  or DataBuffer.TYPE_INT.
+     *  @return the transfertype.
+     */
+    public int getTransferType() {
+        if (pixelBitStride > 16)
+            return DataBuffer.TYPE_INT;
+        else if (pixelBitStride > 8)
+            return DataBuffer.TYPE_USHORT;
+        else
+            return DataBuffer.TYPE_BYTE;
+    }
+
+    /**
+     * Creates a new <code>MultiPixelPackedSampleModel</code> with a
+     * subset of the bands of this
+     * <code>MultiPixelPackedSampleModel</code>.  Since a
+     * <code>MultiPixelPackedSampleModel</code> only has one band, the
+     * bands argument must have a length of one and indicate the zeroth
+     * band.
+     * @param bands the specified bands
+     * @return a new <code>SampleModel</code> with a subset of bands of
+     * this <code>MultiPixelPackedSampleModel</code>.
+     * @exception RasterFormatException if the number of bands requested
+     * is not one.
+     * @throws IllegalArgumentException if <code>w</code> or
+     *         <code>h</code> is not greater than 0
+     */
+    public SampleModel createSubsetSampleModel(int bands[]) {
+        if (bands != null) {
+           if (bands.length != 1)
+            throw new RasterFormatException("MultiPixelPackedSampleModel has "
+                                            + "only one band.");
+        }
+        SampleModel sm = createCompatibleSampleModel(width, height);
+        return sm;
+    }
+
+    /**
+     * Returns as <code>int</code> the sample in a specified band for the
+     * pixel located at (x,&nbsp;y).  An
+     * <code>ArrayIndexOutOfBoundsException</code> is thrown if the
+     * coordinates are not in bounds.
+     * @param x         the X coordinate of the specified pixel
+     * @param y         the Y coordinate of the specified pixel
+     * @param b         the band to return, which is assumed to be 0
+     * @param data      the <code>DataBuffer</code> containing the image
+     *                  data
+     * @return the specified band containing the sample of the specified
+     * pixel.
+     * @exception ArrayIndexOutOfBoundException if the specified
+     *          coordinates are not in bounds.
+     * @see #setSample(int, int, int, int, DataBuffer)
+     */
+    public int getSample(int x, int y, int b, DataBuffer data) {
+        // 'b' must be 0
+        if ((x < 0) || (y < 0) || (x >= width) || (y >= height) ||
+            (b != 0)) {
+            throw new ArrayIndexOutOfBoundsException
+                ("Coordinate out of bounds!");
+        }
+        int bitnum = dataBitOffset + x*pixelBitStride;
+        int element = data.getElem(y*scanlineStride + bitnum/dataElementSize);
+        int shift = dataElementSize - (bitnum & (dataElementSize-1))
+                    - pixelBitStride;
+        return (element >> shift) & bitMask;
+    }
+
+    /**
+     * Sets a sample in the specified band for the pixel located at
+     * (x,&nbsp;y) in the <code>DataBuffer</code> using an
+     * <code>int</code> for input.
+     * An <code>ArrayIndexOutOfBoundsException</code> is thrown if the
+     * coordinates are not in bounds.
+     * @param x the X coordinate of the specified pixel
+     * @param y the Y coordinate of the specified pixel
+     * @param b the band to return, which is assumed to be 0
+     * @param s the input sample as an <code>int</code>
+     * @param data the <code>DataBuffer</code> where image data is stored
+     * @exception ArrayIndexOutOfBoundsException if the coordinates are
+     * not in bounds.
+     * @see #getSample(int, int, int, DataBuffer)
+     */
+    public void setSample(int x, int y, int b, int s,
+                          DataBuffer data) {
+        // 'b' must be 0
+        if ((x < 0) || (y < 0) || (x >= width) || (y >= height) ||
+            (b != 0)) {
+            throw new ArrayIndexOutOfBoundsException
+                ("Coordinate out of bounds!");
+        }
+        int bitnum = dataBitOffset + x * pixelBitStride;
+        int index = y * scanlineStride + (bitnum / dataElementSize);
+        int shift = dataElementSize - (bitnum & (dataElementSize-1))
+                    - pixelBitStride;
+        int element = data.getElem(index);
+        element &= ~(bitMask << shift);
+        element |= (s & bitMask) << shift;
+        data.setElem(index,element);
+    }
+
+    /**
+     * Returns data for a single pixel in a primitive array of type
+     * TransferType.  For a <code>MultiPixelPackedSampleModel</code>,
+     * the array has one element, and the type is the smallest of
+     * DataBuffer.TYPE_BYTE, DataBuffer.TYPE_USHORT, or DataBuffer.TYPE_INT
+     * that can hold a single pixel.  Generally, <code>obj</code>
+     * should be passed in as <code>null</code>, so that the
+     * <code>Object</code> is created automatically and is the
+     * correct primitive data type.
+     * <p>
+     * The following code illustrates transferring data for one pixel from
+     * <code>DataBuffer</code> <code>db1</code>, whose storage layout is
+     * described by <code>MultiPixelPackedSampleModel</code>
+     * <code>mppsm1</code>, to <code>DataBuffer</code> <code>db2</code>,
+     * whose storage layout is described by
+     * <code>MultiPixelPackedSampleModel</code> <code>mppsm2</code>.
+     * The transfer is generally more efficient than using
+     * <code>getPixel</code> or <code>setPixel</code>.
+     * <pre>
+     *       MultiPixelPackedSampleModel mppsm1, mppsm2;
+     *       DataBufferInt db1, db2;
+     *       mppsm2.setDataElements(x, y, mppsm1.getDataElements(x, y, null,
+     *                              db1), db2);
+     * </pre>
+     * Using <code>getDataElements</code> or <code>setDataElements</code>
+     * to transfer between two <code>DataBuffer/SampleModel</code> pairs
+     * is legitimate if the <code>SampleModels</code> have the same number
+     * of bands, corresponding bands have the same number of
+     * bits per sample, and the TransferTypes are the same.
+     * <p>
+     * If <code>obj</code> is not <code>null</code>, it should be a
+     * primitive array of type TransferType.  Otherwise, a
+     * <code>ClassCastException</code> is thrown.  An
+     * <code>ArrayIndexOutOfBoundsException</code> is thrown if the
+     * coordinates are not in bounds, or if <code>obj</code> is not
+     * <code>null</code> and is not large enough to hold the pixel data.
+     * @param x the X coordinate of the specified pixel
+     * @param y the Y coordinate of the specified pixel
+     * @param obj a primitive array in which to return the pixel data or
+     *          <code>null</code>.
+     * @param data the <code>DataBuffer</code> containing the image data.
+     * @return an <code>Object</code> containing data for the specified
+     *  pixel.
+     * @exception ClassCastException if <code>obj</code> is not a
+     *  primitive array of type TransferType or is not <code>null</code>
+     * @exception ArrayIndexOutOfBoundsException if the coordinates are
+     * not in bounds, or if <code>obj</code> is not <code>null</code> or
+     * not large enough to hold the pixel data
+     * @see #setDataElements(int, int, Object, DataBuffer)
+     */
+    public Object getDataElements(int x, int y, Object obj, DataBuffer data) {
+        if ((x < 0) || (y < 0) || (x >= width) || (y >= height)) {
+            throw new ArrayIndexOutOfBoundsException
+                ("Coordinate out of bounds!");
+        }
+
+        int type = getTransferType();
+        int bitnum = dataBitOffset + x*pixelBitStride;
+        int shift = dataElementSize - (bitnum & (dataElementSize-1))
+                    - pixelBitStride;
+        int element = 0;
+
+        switch(type) {
+
+        case DataBuffer.TYPE_BYTE:
+
+            byte[] bdata;
+
+            if (obj == null)
+                bdata = new byte[1];
+            else
+                bdata = (byte[])obj;
+
+            element = data.getElem(y*scanlineStride +
+                                    bitnum/dataElementSize);
+            bdata[0] = (byte)((element >> shift) & bitMask);
+
+            obj = (Object)bdata;
+            break;
+
+        case DataBuffer.TYPE_USHORT:
+
+            short[] sdata;
+
+            if (obj == null)
+                sdata = new short[1];
+            else
+                sdata = (short[])obj;
+
+            element = data.getElem(y*scanlineStride +
+                                   bitnum/dataElementSize);
+            sdata[0] = (short)((element >> shift) & bitMask);
+
+            obj = (Object)sdata;
+            break;
+
+        case DataBuffer.TYPE_INT:
+
+            int[] idata;
+
+            if (obj == null)
+                idata = new int[1];
+            else
+                idata = (int[])obj;
+
+            element = data.getElem(y*scanlineStride +
+                                   bitnum/dataElementSize);
+            idata[0] = (element >> shift) & bitMask;
+
+            obj = (Object)idata;
+            break;
+        }
+
+        return obj;
+    }
+
+    /**
+     * Returns the specified single band pixel in the first element
+     * of an <code>int</code> array.
+     * <code>ArrayIndexOutOfBoundsException</code> is thrown if the
+     * coordinates are not in bounds.
+     * @param x the X coordinate of the specified pixel
+     * @param y the Y coordinate of the specified pixel
+     * @param iArray the array containing the pixel to be returned or
+     *  <code>null</code>
+     * @param data the <code>DataBuffer</code> where image data is stored
+     * @return an array containing the specified pixel.
+     * @exception ArrayIndexOutOfBoundsException if the coordinates
+     *  are not in bounds
+     * @see #setPixel(int, int, int[], DataBuffer)
+     */
+    public int[] getPixel(int x, int y, int iArray[], DataBuffer data) {
+        if ((x < 0) || (y < 0) || (x >= width) || (y >= height)) {
+            throw new ArrayIndexOutOfBoundsException
+                ("Coordinate out of bounds!");
+        }
+        int pixels[];
+        if (iArray != null) {
+           pixels = iArray;
+        } else {
+           pixels = new int [numBands];
+        }
+        int bitnum = dataBitOffset + x*pixelBitStride;
+        int element = data.getElem(y*scanlineStride + bitnum/dataElementSize);
+        int shift = dataElementSize - (bitnum & (dataElementSize-1))
+                    - pixelBitStride;
+        pixels[0] = (element >> shift) & bitMask;
+        return pixels;
+    }
+
+    /**
+     * Sets the data for a single pixel in the specified
+     * <code>DataBuffer</code> from a primitive array of type
+     * TransferType.  For a <code>MultiPixelPackedSampleModel</code>,
+     * only the first element of the array holds valid data,
+     * and the type must be the smallest of
+     * DataBuffer.TYPE_BYTE, DataBuffer.TYPE_USHORT, or DataBuffer.TYPE_INT
+     * that can hold a single pixel.
+     * <p>
+     * The following code illustrates transferring data for one pixel from
+     * <code>DataBuffer</code> <code>db1</code>, whose storage layout is
+     * described by <code>MultiPixelPackedSampleModel</code>
+     * <code>mppsm1</code>, to <code>DataBuffer</code> <code>db2</code>,
+     * whose storage layout is described by
+     * <code>MultiPixelPackedSampleModel</code> <code>mppsm2</code>.
+     * The transfer is generally more efficient than using
+     * <code>getPixel</code> or <code>setPixel</code>.
+     * <pre>
+     *       MultiPixelPackedSampleModel mppsm1, mppsm2;
+     *       DataBufferInt db1, db2;
+     *       mppsm2.setDataElements(x, y, mppsm1.getDataElements(x, y, null,
+     *                              db1), db2);
+     * </pre>
+     * Using <code>getDataElements</code> or <code>setDataElements</code> to
+     * transfer between two <code>DataBuffer/SampleModel</code> pairs is
+     * legitimate if the <code>SampleModel</code> objects have
+     * the same number of bands, corresponding bands have the same number of
+     * bits per sample, and the TransferTypes are the same.
+     * <p>
+     * <code>obj</code> must be a primitive array of type TransferType.
+     * Otherwise, a <code>ClassCastException</code> is thrown.  An
+     * <code>ArrayIndexOutOfBoundsException</code> is thrown if the
+     * coordinates are not in bounds, or if <code>obj</code> is not large
+     * enough to hold the pixel data.
+     * @param x the X coordinate of the pixel location
+     * @param y the Y coordinate of the pixel location
+     * @param obj a primitive array containing pixel data
+     * @param data the <code>DataBuffer</code> containing the image data
+     * @see #getDataElements(int, int, Object, DataBuffer)
+     */
+    public void setDataElements(int x, int y, Object obj, DataBuffer data) {
+        if ((x < 0) || (y < 0) || (x >= width) || (y >= height)) {
+            throw new ArrayIndexOutOfBoundsException
+                ("Coordinate out of bounds!");
+        }
+
+        int type = getTransferType();
+        int bitnum = dataBitOffset + x * pixelBitStride;
+        int index = y * scanlineStride + (bitnum / dataElementSize);
+        int shift = dataElementSize - (bitnum & (dataElementSize-1))
+                    - pixelBitStride;
+        int element = data.getElem(index);
+        element &= ~(bitMask << shift);
+
+        switch(type) {
+
+        case DataBuffer.TYPE_BYTE:
+
+            byte[] barray = (byte[])obj;
+            element |= ( ((int)(barray[0])&0xff) & bitMask) << shift;
+            data.setElem(index, element);
+            break;
+
+        case DataBuffer.TYPE_USHORT:
+
+            short[] sarray = (short[])obj;
+            element |= ( ((int)(sarray[0])&0xffff) & bitMask) << shift;
+            data.setElem(index, element);
+            break;
+
+        case DataBuffer.TYPE_INT:
+
+            int[] iarray = (int[])obj;
+            element |= (iarray[0] & bitMask) << shift;
+            data.setElem(index, element);
+            break;
+        }
+    }
+
+    /**
+     * Sets a pixel in the <code>DataBuffer</code> using an
+     * <code>int</code> array for input.
+     * <code>ArrayIndexOutOfBoundsException</code> is thrown if
+     * the coordinates are not in bounds.
+     * @param x the X coordinate of the pixel location
+     * @param y the Y coordinate of the pixel location
+     * @param iArray the input pixel in an <code>int</code> array
+     * @param data the <code>DataBuffer</code> containing the image data
+     * @see #getPixel(int, int, int[], DataBuffer)
+     */
+    public void setPixel(int x, int y, int[] iArray, DataBuffer data) {
+        if ((x < 0) || (y < 0) || (x >= width) || (y >= height)) {
+            throw new ArrayIndexOutOfBoundsException
+                ("Coordinate out of bounds!");
+        }
+        int bitnum = dataBitOffset + x * pixelBitStride;
+        int index = y * scanlineStride + (bitnum / dataElementSize);
+        int shift = dataElementSize - (bitnum & (dataElementSize-1))
+                    - pixelBitStride;
+        int element = data.getElem(index);
+        element &= ~(bitMask << shift);
+        element |= (iArray[0] & bitMask) << shift;
+        data.setElem(index,element);
+    }
+
+    public boolean equals(Object o) {
+        if ((o == null) || !(o instanceof MultiPixelPackedSampleModel)) {
+            return false;
+        }
+
+        MultiPixelPackedSampleModel that = (MultiPixelPackedSampleModel)o;
+        return this.width == that.width &&
+            this.height == that.height &&
+            this.numBands == that.numBands &&
+            this.dataType == that.dataType &&
+            this.pixelBitStride == that.pixelBitStride &&
+            this.bitMask == that.bitMask &&
+            this.pixelsPerDataElement == that.pixelsPerDataElement &&
+            this.dataElementSize == that.dataElementSize &&
+            this.dataBitOffset == that.dataBitOffset &&
+            this.scanlineStride == that.scanlineStride;
+    }
+
+    // If we implement equals() we must also implement hashCode
+    public int hashCode() {
+        int hash = 0;
+        hash = width;
+        hash <<= 8;
+        hash ^= height;
+        hash <<= 8;
+        hash ^= numBands;
+        hash <<= 8;
+        hash ^= dataType;
+        hash <<= 8;
+        hash ^= pixelBitStride;
+        hash <<= 8;
+        hash ^= bitMask;
+        hash <<= 8;
+        hash ^= pixelsPerDataElement;
+        hash <<= 8;
+        hash ^= dataElementSize;
+        hash <<= 8;
+        hash ^= dataBitOffset;
+        hash <<= 8;
+        hash ^= scanlineStride;
+        return hash;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/classes/java/awt/image/Raster.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,1777 @@
+/*
+ * Portions Copyright 1997-2007 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) Eastman Kodak Company, 1997
+ *** As  an unpublished  work pursuant to Title 17 of the United
+ *** States Code.  All rights reserved.
+ ******************************************************************
+ ******************************************************************
+ ******************************************************************/
+
+
+package java.awt.image;
+import java.awt.Rectangle;
+import java.awt.Point;
+
+import sun.awt.image.ByteInterleavedRaster;
+import sun.awt.image.ShortInterleavedRaster;
+import sun.awt.image.IntegerInterleavedRaster;
+import sun.awt.image.ByteBandedRaster;
+import sun.awt.image.ShortBandedRaster;
+import sun.awt.image.BytePackedRaster;
+import sun.awt.image.SunWritableRaster;
+
+/**
+ * A class representing a rectangular array of pixels.  A Raster
+ * encapsulates a DataBuffer that stores the sample values and a
+ * SampleModel that describes how to locate a given sample value in a
+ * DataBuffer.
+ * <p>
+ * A Raster defines values for pixels occupying a particular
+ * rectangular area of the plane, not necessarily including (0, 0).
+ * The rectangle, known as the Raster's bounding rectangle and
+ * available by means of the getBounds method, is defined by minX,
+ * minY, width, and height values.  The minX and minY values define
+ * the coordinate of the upper left corner of the Raster.  References
+ * to pixels outside of the bounding rectangle may result in an
+ * exception being thrown, or may result in references to unintended
+ * elements of the Raster's associated DataBuffer.  It is the user's
+ * responsibility to avoid accessing such pixels.
+ * <p>
+ * A SampleModel describes how samples of a Raster
+ * are stored in the primitive array elements of a DataBuffer.
+ * Samples may be stored one per data element, as in a
+ * PixelInterleavedSampleModel or BandedSampleModel, or packed several to
+ * an element, as in a SinglePixelPackedSampleModel or
+ * MultiPixelPackedSampleModel.  The SampleModel is also
+ * controls whether samples are sign extended, allowing unsigned
+ * data to be stored in signed Java data types such as byte, short, and
+ * int.
+ * <p>
+ * Although a Raster may live anywhere in the plane, a SampleModel
+ * makes use of a simple coordinate system that starts at (0, 0).  A
+ * Raster therefore contains a translation factor that allows pixel
+ * locations to be mapped between the Raster's coordinate system and
+ * that of the SampleModel.  The translation from the SampleModel
+ * coordinate system to that of the Raster may be obtained by the
+ * getSampleModelTranslateX and getSampleModelTranslateY methods.
+ * <p>
+ * A Raster may share a DataBuffer with another Raster either by
+ * explicit construction or by the use of the createChild and
+ * createTranslatedChild methods.  Rasters created by these methods
+ * can return a reference to the Raster they were created from by
+ * means of the getParent method.  For a Raster that was not
+ * constructed by means of a call to createTranslatedChild or
+ * createChild, getParent will return null.
+ * <p>
+ * The createTranslatedChild method returns a new Raster that
+ * shares all of the data of the current Raster, but occupies a
+ * bounding rectangle of the same width and height but with a
+ * different starting point.  For example, if the parent Raster
+ * occupied the region (10, 10) to (100, 100), and the translated
+ * Raster was defined to start at (50, 50), then pixel (20, 20) of the
+ * parent and pixel (60, 60) of the child occupy the same location in
+ * the DataBuffer shared by the two Rasters.  In the first case, (-10,
+ * -10) should be added to a pixel coordinate to obtain the
+ * corresponding SampleModel coordinate, and in the second case (-50,
+ * -50) should be added.
+ * <p>
+ * The translation between a parent and child Raster may be
+ * determined by subtracting the child's sampleModelTranslateX and
+ * sampleModelTranslateY values from those of the parent.
+ * <p>
+ * The createChild method may be used to create a new Raster
+ * occupying only a subset of its parent's bounding rectangle
+ * (with the same or a translated coordinate system) or
+ * with a subset of the bands of its parent.
+ * <p>
+ * All constructors are protected.  The correct way to create a
+ * Raster is to use one of the static create methods defined in this
+ * class.  These methods create instances of Raster that use the
+ * standard Interleaved, Banded, and Packed SampleModels and that may
+ * be processed more efficiently than a Raster created by combining
+ * an externally generated SampleModel and DataBuffer.
+ * @see java.awt.image.DataBuffer
+ * @see java.awt.image.SampleModel
+ * @see java.awt.image.PixelInterleavedSampleModel
+ * @see java.awt.image.BandedSampleModel
+ * @see java.awt.image.SinglePixelPackedSampleModel
+ * @see java.awt.image.MultiPixelPackedSampleModel
+ */
+public class Raster {
+
+    /**
+     * The SampleModel that describes how pixels from this Raster
+     * are stored in the DataBuffer.
+     */
+    protected SampleModel sampleModel;
+
+    /** The DataBuffer that stores the image data. */
+    protected DataBuffer dataBuffer;
+
+    /** The X coordinate of the upper-left pixel of this Raster. */
+    protected int minX;
+
+    /** The Y coordinate of the upper-left pixel of this Raster. */
+    protected int minY;
+
+    /** The width of this Raster. */
+    protected int width;
+
+    /** The height of this Raster. */
+    protected int height;
+
+    /**
+     * The X translation from the coordinate space of the
+     * Raster's SampleModel to that of the Raster.
+     */
+    protected int sampleModelTranslateX;
+
+    /**
+     * The Y translation from the coordinate space of the
+     * Raster's SampleModel to that of the Raster.
+     */
+    protected int sampleModelTranslateY;
+
+    /** The number of bands in the Raster. */
+    protected int numBands;
+
+    /** The number of DataBuffer data elements per pixel. */
+    protected int numDataElements;
+
+    /** The parent of this Raster, or null. */
+    protected Raster parent;
+
+    static private native void initIDs();
+    static {
+        ColorModel.loadLibraries();
+        initIDs();
+    }
+
+    /**
+     * Creates a Raster based on a PixelInterleavedSampleModel with the
+     * specified data type, width, height, and number of bands.
+     *
+     * <p> The upper left corner of the Raster is given by the
+     * location argument.  If location is null, (0, 0) will be used.
+     * The dataType parameter should be one of the enumerated values
+     * defined in the DataBuffer class.
+     *
+     * <p> Note that interleaved <code>DataBuffer.TYPE_INT</code>
+     * Rasters are not supported.  To create a 1-band Raster of type
+     * <code>DataBuffer.TYPE_INT</code>, use
+     * Raster.createPackedRaster().
+     * <p> The only dataTypes supported currently are TYPE_BYTE
+     * and TYPE_USHORT.
+     * @param dataType  the data type for storing samples
+     * @param w         the width in pixels of the image data
+     * @param h         the height in pixels of the image data
+     * @param bands     the number of bands
+     * @param location  the upper-left corner of the <code>Raster</code>
+     * @return a WritableRaster object with the specified data type,
+     *         width, height and number of bands.
+     * @throws RasterFormatException if <code>w</code> or <code>h</code>
+     *         is less than or equal to zero, or computing either
+     *         <code>location.x + w</code> or
+     *         <code>location.y + h</code> results in integer
+     *         overflow
+     */
+    public static WritableRaster createInterleavedRaster(int dataType,
+                                                         int w, int h,
+                                                         int bands,
+                                                         Point location) {
+        int[] bandOffsets = new int[bands];
+        for (int i = 0; i < bands; i++) {
+            bandOffsets[i] = i;
+        }
+        return createInterleavedRaster(dataType, w, h, w*bands, bands,
+                                       bandOffsets, location);
+    }
+
+    /**
+     * Creates a Raster based on a PixelInterleavedSampleModel with the
+     * specified data type, width, height, scanline stride, pixel
+     * stride, and band offsets.  The number of bands is inferred from
+     * bandOffsets.length.
+     *
+     * <p> The upper left corner of the Raster is given by the
+     * location argument.  If location is null, (0, 0) will be used.
+     * The dataType parameter should be one of the enumerated values
+     * defined in the DataBuffer class.
+     *
+     * <p> Note that interleaved <code>DataBuffer.TYPE_INT</code>
+     * Rasters are not supported.  To create a 1-band Raster of type
+     * <code>DataBuffer.TYPE_INT</code>, use
+     * Raster.createPackedRaster().
+     * <p> The only dataTypes supported currently are TYPE_BYTE
+     * and TYPE_USHORT.
+     * @param dataType  the data type for storing samples
+     * @param w         the width in pixels of the image data
+     * @param h         the height in pixels of the image data
+     * @param scanlineStride the line stride of the image data
+     * @param pixelStride the pixel stride of the image data
+     * @param bandOffsets the offsets of all bands
+     * @param location  the upper-left corner of the <code>Raster</code>
+     * @return a WritableRaster object with the specified data type,
+     *         width, height, scanline stride, pixel stride and band
+     *         offsets.
+     * @throws RasterFormatException if <code>w</code> or <code>h</code>
+     *         is less than or equal to zero, or computing either
+     *         <code>location.x + w</code> or
+     *         <code>location.y + h</code> results in integer
+     *         overflow
+     * @throws IllegalArgumentException if <code>dataType</code> is not
+     *         one of the supported data types, which are
+     *         <code>DataBuffer.TYPE_BYTE</code>, or
+     *         <code>DataBuffer.TYPE_USHORT</code>.
+     */
+    public static WritableRaster createInterleavedRaster(int dataType,
+                                                         int w, int h,
+                                                         int scanlineStride,
+                                                         int pixelStride,
+                                                         int bandOffsets[],
+                                                         Point location) {
+        DataBuffer d;
+        int bands = bandOffsets.length;
+
+        int maxBandOff = bandOffsets[0];
+        for (int i=1; i < bands; i++) {
+            if (bandOffsets[i] > maxBandOff) {
+                maxBandOff = bandOffsets[i];
+            }
+        }
+        int size = maxBandOff + scanlineStride*(h-1) + pixelStride*(w-1) + 1;
+        switch(dataType) {
+        case DataBuffer.TYPE_BYTE:
+            d = new DataBufferByte(size);
+            break;
+
+        case DataBuffer.TYPE_USHORT:
+            d = new DataBufferUShort(size);
+            break;
+
+        default:
+            throw new IllegalArgumentException("Unsupported data type " +
+                                                dataType);
+        }
+
+        return createInterleavedRaster(d, w, h, scanlineStride,
+                                       pixelStride, bandOffsets, location);
+    }
+
+    /**
+     * Creates a Raster based on a BandedSampleModel with the
+     * specified data type, width, height, and number of bands.
+     *
+     * <p> The upper left corner of the Raster is given by the
+     * location argument.  If location is null, (0, 0) will be used.
+     * The dataType parameter should be one of the enumerated values
+     * defined in the DataBuffer class.
+     *
+     * <p> The only dataTypes supported currently are TYPE_BYTE, TYPE_USHORT,
+     * and TYPE_INT.
+     * @param dataType  the data type for storing samples
+     * @param w         the width in pixels of the image data
+     * @param h         the height in pixels of the image data
+     * @param bands     the number of bands
+     * @param location  the upper-left corner of the <code>Raster</code>
+     * @return a WritableRaster object with the specified data type,
+     *         width, height and number of bands.
+     * @throws RasterFormatException if <code>w</code> or <code>h</code>
+     *         is less than or equal to zero, or computing either
+     *         <code>location.x + w</code> or
+     *         <code>location.y + h</code> results in integer
+     *         overflow
+     * @throws ArrayIndexOutOfBoundsException if <code>bands</code>
+     *         is less than 1
+     */
+    public static WritableRaster createBandedRaster(int dataType,
+                                                    int w, int h,
+                                                    int bands,
+                                                    Point location) {
+        if (bands < 1) {
+            throw new ArrayIndexOutOfBoundsException("Number of bands ("+
+                                                     bands+") must"+
+                                                     " be greater than 0");
+        }
+        int[] bankIndices = new int[bands];
+        int[] bandOffsets = new int[bands];
+        for (int i = 0; i < bands; i++) {
+            bankIndices[i] = i;
+            bandOffsets[i] = 0;
+        }
+
+        return createBandedRaster(dataType, w, h, w,
+                                  bankIndices, bandOffsets,
+                                  location);
+    }
+
+    /**
+     * Creates a Raster based on a BandedSampleModel with the
+     * specified data type, width, height, scanline stride, bank
+     * indices and band offsets.  The number of bands is inferred from
+     * bankIndices.length and bandOffsets.length, which must be the
+     * same.
+     *
+     * <p> The upper left corner of the Raster is given by the
+     * location argument.  The dataType parameter should be one of the
+     * enumerated values defined in the DataBuffer class.
+     *
+     * <p> The only dataTypes supported currently are TYPE_BYTE, TYPE_USHORT,
+     * and TYPE_INT.
+     * @param dataType  the data type for storing samples
+     * @param w         the width in pixels of the image data
+     * @param h         the height in pixels of the image data
+     * @param scanlineStride the line stride of the image data
+     * @param bankIndices the bank indices for each band
+     * @param bandOffsets the offsets of all bands
+     * @param location  the upper-left corner of the <code>Raster</code>
+     * @return a WritableRaster object with the specified data type,
+     *         width, height, scanline stride, bank indices and band
+     *         offsets.
+     * @throws RasterFormatException if <code>w</code> or <code>h</code>
+     *         is less than or equal to zero, or computing either
+     *         <code>location.x + w</code> or
+     *         <code>location.y + h</code> results in integer
+     *         overflow
+     * @throws IllegalArgumentException if <code>dataType</code> is not
+     *         one of the supported data types, which are
+     *         <code>DataBuffer.TYPE_BYTE</code>,
+     *         <code>DataBuffer.TYPE_USHORT</code>
+     *         or <code>DataBuffer.TYPE_INT</code>
+     * @throws ArrayIndexOutOfBoundsException if <code>bankIndices</code>
+     *         or <code>bandOffsets</code> is <code>null</code>
+     */
+    public static WritableRaster createBandedRaster(int dataType,
+                                                    int w, int h,
+                                                    int scanlineStride,
+                                                    int bankIndices[],
+                                                    int bandOffsets[],
+                                                    Point location) {
+        DataBuffer d;
+        int bands = bandOffsets.length;
+
+        if (bankIndices == null) {
+            throw new
+                ArrayIndexOutOfBoundsException("Bank indices array is null");
+        }
+        if (bandOffsets == null) {
+            throw new
+                ArrayIndexOutOfBoundsException("Band offsets array is null");
+        }
+
+        // Figure out the #banks and the largest band offset
+        int maxBank = bankIndices[0];
+        int maxBandOff = bandOffsets[0];
+        for (int i = 1; i < bands; i++) {
+            if (bankIndices[i] > maxBank) {
+                maxBank = bankIndices[i];
+            }
+            if (bandOffsets[i] > maxBandOff) {
+                maxBandOff = bandOffsets[i];
+            }
+        }
+        int banks = maxBank + 1;
+        int size = maxBandOff + scanlineStride*(h-1) + (w-1) + 1;
+
+        switch(dataType) {
+        case DataBuffer.TYPE_BYTE:
+            d = new DataBufferByte(size, banks);
+            break;
+
+        case DataBuffer.TYPE_USHORT:
+            d = new DataBufferUShort(size, banks);
+            break;
+
+        case DataBuffer.TYPE_INT:
+            d = new DataBufferInt(size, banks);
+            break;
+
+        default:
+            throw new IllegalArgumentException("Unsupported data type " +
+                                                dataType);
+        }
+
+        return createBandedRaster(d, w, h, scanlineStride,
+                                  bankIndices, bandOffsets, location);
+    }
+
+    /**
+     * Creates a Raster based on a SinglePixelPackedSampleModel with
+     * the specified data type, width, height, and band masks.
+     * The number of bands is inferred from bandMasks.length.
+     *
+     * <p> The upper left corner of the Raster is given by the
+     * location argument.  If location is null, (0, 0) will be used.
+     * The dataType parameter should be one of the enumerated values
+     * defined in the DataBuffer class.
+     *
+     * <p> The only dataTypes supported currently are TYPE_BYTE, TYPE_USHORT,
+     * and TYPE_INT.
+     * @param dataType  the data type for storing samples
+     * @param w         the width in pixels of the image data
+     * @param h         the height in pixels of the image data
+     * @param bandMasks an array containing an entry for each band
+     * @param location  the upper-left corner of the <code>Raster</code>
+     * @return a WritableRaster object with the specified data type,
+     *         width, height, and band masks.
+     * @throws RasterFormatException if <code>w</code> or <code>h</code>
+     *         is less than or equal to zero, or computing either
+     *         <code>location.x + w</code> or
+     *         <code>location.y + h</code> results in integer
+     *         overflow
+     * @throws IllegalArgumentException if <code>dataType</code> is not
+     *         one of the supported data types, which are
+     *         <code>DataBuffer.TYPE_BYTE</code>,
+     *         <code>DataBuffer.TYPE_USHORT</code>
+     *         or <code>DataBuffer.TYPE_INT</code>
+     */
+    public static WritableRaster createPackedRaster(int dataType,
+                                                    int w, int h,
+                                                    int bandMasks[],
+                                                    Point location) {
+        DataBuffer d;
+
+        switch(dataType) {
+        case DataBuffer.TYPE_BYTE:
+            d = new DataBufferByte(w*h);
+            break;
+
+        case DataBuffer.TYPE_USHORT:
+            d = new DataBufferUShort(w*h);
+            break;
+
+        case DataBuffer.TYPE_INT:
+            d = new DataBufferInt(w*h);
+            break;
+
+        default:
+            throw new IllegalArgumentException("Unsupported data type " +
+                                                dataType);
+        }
+
+        return createPackedRaster(d, w, h, w, bandMasks, location);
+    }
+
+    /**
+     * Creates a Raster based on a packed SampleModel with the
+     * specified data type, width, height, number of bands, and bits
+     * per band.  If the number of bands is one, the SampleModel will
+     * be a MultiPixelPackedSampleModel.
+     *
+     * <p> If the number of bands is more than one, the SampleModel
+     * will be a SinglePixelPackedSampleModel, with each band having
+     * bitsPerBand bits.  In either case, the requirements on dataType
+     * and bitsPerBand imposed by the corresponding SampleModel must
+     * be met.
+     *
+     * <p> The upper left corner of the Raster is given by the
+     * location argument.  If location is null, (0, 0) will be used.
+     * The dataType parameter should be one of the enumerated values
+     * defined in the DataBuffer class.
+     *
+     * <p> The only dataTypes supported currently are TYPE_BYTE, TYPE_USHORT,
+     * and TYPE_INT.
+     * @param dataType  the data type for storing samples
+     * @param w         the width in pixels of the image data
+     * @param h         the height in pixels of the image data
+     * @param bands     the number of bands
+     * @param bitsPerBand the number of bits per band
+     * @param location  the upper-left corner of the <code>Raster</code>
+     * @return a WritableRaster object with the specified data type,
+     *         width, height, number of bands, and bits per band.
+     * @throws RasterFormatException if <code>w</code> or <code>h</code>
+     *         is less than or equal to zero, or computing either
+     *         <code>location.x + w</code> or
+     *         <code>location.y + h</code> results in integer
+     *         overflow
+     * @throws IllegalArgumentException if the product of
+     *         <code>bitsPerBand</code> and <code>bands</code> is
+     *         greater than the number of bits held by
+     *         <code>dataType</code>
+     * @throws IllegalArgumentException if <code>bitsPerBand</code> or
+     *         <code>bands</code> is not greater than zero
+     * @throws IllegalArgumentException if <code>dataType</code> is not
+     *         one of the supported data types, which are
+     *         <code>DataBuffer.TYPE_BYTE</code>,
+     *         <code>DataBuffer.TYPE_USHORT</code>
+     *         or <code>DataBuffer.TYPE_INT</code>
+     */
+    public static WritableRaster createPackedRaster(int dataType,
+                                                    int w, int h,
+                                                    int bands,
+                                                    int bitsPerBand,
+                                                    Point location) {
+        DataBuffer d;
+
+        if (bands <= 0) {
+            throw new IllegalArgumentException("Number of bands ("+bands+
+                                               ") must be greater than 0");
+        }
+
+        if (bitsPerBand <= 0) {
+            throw new IllegalArgumentException("Bits per band ("+bitsPerBand+
+                                               ") must be greater than 0");
+        }
+
+        if (bands != 1) {
+            int[] masks = new int[bands];
+            int mask = (1 << bitsPerBand) - 1;
+            int shift = (bands-1)*bitsPerBand;
+
+            /* Make sure the total mask size will fit in the data type */
+            if (shift+bitsPerBand > DataBuffer.getDataTypeSize(dataType)) {
+                throw new IllegalArgumentException("bitsPerBand("+
+                                                   bitsPerBand+") * bands is "+
+                                                   " greater than data type "+
+                                                   "size.");
+            }
+            switch(dataType) {
+            case DataBuffer.TYPE_BYTE:
+            case DataBuffer.TYPE_USHORT:
+            case DataBuffer.TYPE_INT:
+                break;
+            default:
+                throw new IllegalArgumentException("Unsupported data type " +
+                                                    dataType);
+            }
+
+            for (int i = 0; i < bands; i++) {
+                masks[i] = mask << shift;
+                shift = shift - bitsPerBand;
+            }
+
+            return createPackedRaster(dataType, w, h, masks, location);
+        }
+        else {
+            double fw = w;
+            switch(dataType) {
+            case DataBuffer.TYPE_BYTE:
+                d = new DataBufferByte((int)(Math.ceil(fw/(8/bitsPerBand)))*h);
+                break;
+
+            case DataBuffer.TYPE_USHORT:
+                d = new DataBufferUShort((int)(Math.ceil(fw/(16/bitsPerBand)))*h);
+                break;
+
+            case DataBuffer.TYPE_INT:
+                d = new DataBufferInt((int)(Math.ceil(fw/(32/bitsPerBand)))*h);
+                break;
+
+            default:
+                throw new IllegalArgumentException("Unsupported data type " +
+                                                   dataType);
+            }
+
+            return createPackedRaster(d, w, h, bitsPerBand, location);
+        }
+    }
+
+    /**
+     * Creates a Raster based on a PixelInterleavedSampleModel with the
+     * specified DataBuffer, width, height, scanline stride, pixel
+     * stride, and band offsets.  The number of bands is inferred from
+     * bandOffsets.length.  The upper left corner of the Raster
+     * is given by the location argument.  If location is null, (0, 0)
+     * will be used.
+     * <p> Note that interleaved <code>DataBuffer.TYPE_INT</code>
+     * Rasters are not supported.  To create a 1-band Raster of type
+     * <code>DataBuffer.TYPE_INT</code>, use
+     * Raster.createPackedRaster().
+     * @param dataBuffer the <code>DataBuffer</code> that contains the
+     *        image data
+     * @param w         the width in pixels of the image data
+     * @param h         the height in pixels of the image data
+     * @param scanlineStride the line stride of the image data
+     * @param pixelStride the pixel stride of the image data
+     * @param bandOffsets the offsets of all bands
+     * @param location  the upper-left corner of the <code>Raster</code>
+     * @return a WritableRaster object with the specified
+     *         <code>DataBuffer</code>, width, height, scanline stride,
+     *         pixel stride and band offsets.
+     * @throws RasterFormatException if <code>w</code> or <code>h</code>
+     *         is less than or equal to zero, or computing either
+     *         <code>location.x + w</code> or
+     *         <code>location.y + h</code> results in integer
+     *         overflow
+     * @throws IllegalArgumentException if <code>dataType</code> is not
+     *         one of the supported data types, which are
+     *         <code>DataBuffer.TYPE_BYTE</code>,
+     *         <code>DataBuffer.TYPE_USHORT</code>
+     * @throws RasterFormatException if <code>dataBuffer</code> has more
+     *         than one bank.
+     * @throws NullPointerException if <code>dataBuffer</code> is null
+     */
+    public static WritableRaster createInterleavedRaster(DataBuffer dataBuffer,
+                                                         int w, int h,
+                                                         int scanlineStride,
+                                                         int pixelStride,
+                                                         int bandOffsets[],
+                                                         Point location) {
+        if (dataBuffer == null) {
+            throw new NullPointerException("DataBuffer cannot be null");
+        }
+        if (location == null) {
+            location = new Point(0, 0);
+        }
+        int dataType = dataBuffer.getDataType();
+
+        PixelInterleavedSampleModel csm =
+            new PixelInterleavedSampleModel(dataType, w, h,
+                                            pixelStride,
+                                            scanlineStride,
+                                            bandOffsets);
+        switch(dataType) {
+        case DataBuffer.TYPE_BYTE:
+            return new ByteInterleavedRaster(csm, dataBuffer, location);
+
+        case DataBuffer.TYPE_USHORT:
+            return new ShortInterleavedRaster(csm, dataBuffer, location);
+
+        default:
+            throw new IllegalArgumentException("Unsupported data type " +
+                                                dataType);
+        }
+    }
+
+    /**
+     * Creates a Raster based on a BandedSampleModel with the
+     * specified DataBuffer, width, height, scanline stride, bank
+     * indices, and band offsets.  The number of bands is inferred
+     * from bankIndices.length and bandOffsets.length, which must be
+     * the same.  The upper left corner of the Raster is given by the
+     * location argument.  If location is null, (0, 0) will be used.
+     * @param dataBuffer the <code>DataBuffer</code> that contains the
+     *        image data
+     * @param w         the width in pixels of the image data
+     * @param h         the height in pixels of the image data
+     * @param scanlineStride the line stride of the image data
+     * @param bankIndices the bank indices for each band
+     * @param bandOffsets the offsets of all bands
+     * @param location  the upper-left corner of the <code>Raster</code>
+     * @return a WritableRaster object with the specified
+     *         <code>DataBuffer</code>, width, height, scanline stride,
+     *         bank indices and band offsets.
+     * @throws RasterFormatException if <code>w</code> or <code>h</code>
+     *         is less than or equal to zero, or computing either
+     *         <code>location.x + w</code> or
+     *         <code>location.y + h</code> results in integer
+     *         overflow
+     * @throws IllegalArgumentException if <code>dataType</code> is not
+     *         one of the supported data types, which are
+     *         <code>DataBuffer.TYPE_BYTE</code>,
+     *         <code>DataBuffer.TYPE_USHORT</code>
+     *         or <code>DataBuffer.TYPE_INT</code>
+     * @throws NullPointerException if <code>dataBuffer</code> is null
+     */
+    public static WritableRaster createBandedRaster(DataBuffer dataBuffer,
+                                                    int w, int h,
+                                                    int scanlineStride,
+                                                    int bankIndices[],
+                                                    int bandOffsets[],
+                                                    Point location) {
+        if (dataBuffer == null) {
+            throw new NullPointerException("DataBuffer cannot be null");
+        }
+        if (location == null) {
+           location = new Point(0,0);
+        }
+        int dataType = dataBuffer.getDataType();
+
+        int bands = bankIndices.length;
+        if (bandOffsets.length != bands) {
+            throw new IllegalArgumentException(
+                                   "bankIndices.length != bandOffsets.length");
+        }
+
+        BandedSampleModel bsm =
+            new BandedSampleModel(dataType, w, h,
+                                  scanlineStride,
+                                  bankIndices, bandOffsets);
+
+        switch(dataType) {
+        case DataBuffer.TYPE_BYTE:
+            return new ByteBandedRaster(bsm, dataBuffer, location);
+
+        case DataBuffer.TYPE_USHORT:
+            return new ShortBandedRaster(bsm, dataBuffer, location);
+
+        case DataBuffer.TYPE_INT:
+            return new SunWritableRaster(bsm, dataBuffer, location);
+
+        default:
+            throw new IllegalArgumentException("Unsupported data type " +
+                                                dataType);
+        }
+    }
+
+    /**
+     * Creates a Raster based on a SinglePixelPackedSampleModel with
+     * the specified DataBuffer, width, height, scanline stride, and
+     * band masks.  The number of bands is inferred from bandMasks.length.
+     * The upper left corner of the Raster is given by
+     * the location argument.  If location is null, (0, 0) will be used.
+     * @param dataBuffer the <code>DataBuffer</code> that contains the
+     *        image data
+     * @param w         the width in pixels of the image data
+     * @param h         the height in pixels of the image data
+     * @param scanlineStride the line stride of the image data
+     * @param bandMasks an array containing an entry for each band
+     * @param location  the upper-left corner of the <code>Raster</code>
+     * @return a WritableRaster object with the specified
+     *         <code>DataBuffer</code>, width, height, scanline stride,
+     *         and band masks.
+     * @throws RasterFormatException if <code>w</code> or <code>h</code>
+     *         is less than or equal to zero, or computing either
+     *         <code>location.x + w</code> or
+     *         <code>location.y + h</code> results in integer
+     *         overflow
+     * @throws IllegalArgumentException if <code>dataType</code> is not
+     *         one of the supported data types, which are
+     *         <code>DataBuffer.TYPE_BYTE</code>,
+     *         <code>DataBuffer.TYPE_USHORT</code>
+     *         or <code>DataBuffer.TYPE_INT</code>
+     * @throws RasterFormatException if <code>dataBuffer</code> has more
+     *         than one bank.
+     * @throws NullPointerException if <code>dataBuffer</code> is null
+     */
+    public static WritableRaster createPackedRaster(DataBuffer dataBuffer,
+                                                    int w, int h,
+                                                    int scanlineStride,
+                                                    int bandMasks[],
+                                                    Point location) {
+        if (dataBuffer == null) {
+            throw new NullPointerException("DataBuffer cannot be null");
+        }
+        if (location == null) {
+           location = new Point(0,0);
+        }
+        int dataType = dataBuffer.getDataType();
+
+        SinglePixelPackedSampleModel sppsm =
+            new SinglePixelPackedSampleModel(dataType, w, h, scanlineStride,
+                                             bandMasks);
+
+        switch(dataType) {
+        case DataBuffer.TYPE_BYTE:
+            return new ByteInterleavedRaster(sppsm, dataBuffer, location);
+
+        case DataBuffer.TYPE_USHORT:
+            return new ShortInterleavedRaster(sppsm, dataBuffer, location);
+
+        case DataBuffer.TYPE_INT:
+            return new IntegerInterleavedRaster(sppsm, dataBuffer, location);
+
+        default:
+            throw new IllegalArgumentException("Unsupported data type " +
+                                                dataType);
+        }
+    }
+
+    /**
+     * Creates a Raster based on a MultiPixelPackedSampleModel with the
+     * specified DataBuffer, width, height, and bits per pixel.  The upper
+     * left corner of the Raster is given by the location argument.  If
+     * location is null, (0, 0) will be used.
+     * @param dataBuffer the <code>DataBuffer</code> that contains the
+     *        image data
+     * @param w         the width in pixels of the image data
+     * @param h         the height in pixels of the image data
+     * @param bitsPerPixel the number of bits for each pixel
+     * @param location  the upper-left corner of the <code>Raster</code>
+     * @return a WritableRaster object with the specified
+     *         <code>DataBuffer</code>, width, height, and
+     *         bits per pixel.
+     * @throws RasterFormatException if <code>w</code> or <code>h</code>
+     *         is less than or equal to zero, or computing either
+     *         <code>location.x + w</code> or
+     *         <code>location.y + h</code> results in integer
+     *         overflow
+     * @throws IllegalArgumentException if <code>dataType</code> is not
+     *         one of the supported data types, which are
+     *         <code>DataBuffer.TYPE_BYTE</code>,
+     *         <code>DataBuffer.TYPE_USHORT</code>
+     *         or <code>DataBuffer.TYPE_INT</code>
+     * @throws RasterFormatException if <code>dataBuffer</code> has more
+     *         than one bank.
+     * @throws NullPointerException if <code>dataBuffer</code> is null
+     */
+    public static WritableRaster createPackedRaster(DataBuffer dataBuffer,
+                                                    int w, int h,
+                                                    int bitsPerPixel,
+                                                    Point location) {
+        if (dataBuffer == null) {
+            throw new NullPointerException("DataBuffer cannot be null");
+        }
+        if (location == null) {
+           location = new Point(0,0);
+        }
+        int dataType = dataBuffer.getDataType();
+
+        if (dataType != DataBuffer.TYPE_BYTE &&
+            dataType != DataBuffer.TYPE_USHORT &&
+            dataType != DataBuffer.TYPE_INT) {
+            throw new IllegalArgumentException("Unsupported data type " +
+                                               dataType);
+        }
+
+        if (dataBuffer.getNumBanks() != 1) {
+            throw new
+                RasterFormatException("DataBuffer for packed Rasters"+
+                                      " must only have 1 bank.");
+        }
+
+        MultiPixelPackedSampleModel mppsm =
+                new MultiPixelPackedSampleModel(dataType, w, h, bitsPerPixel);
+
+        if (dataType == DataBuffer.TYPE_BYTE &&
+            (bitsPerPixel == 1 || bitsPerPixel == 2 || bitsPerPixel == 4)) {
+            return new BytePackedRaster(mppsm, dataBuffer, location);
+        } else {
+            return new SunWritableRaster(mppsm, dataBuffer, location);
+        }
+    }
+
+
+    /**
+     *  Creates a Raster with the specified SampleModel and DataBuffer.
+     *  The upper left corner of the Raster is given by the location argument.
+     *  If location is null, (0, 0) will be used.
+     *  @param sm the specified <code>SampleModel</code>
+     *  @param db the specified <code>DataBuffer</code>
+     *  @param location the upper-left corner of the <code>Raster</code>
+     *  @return a <code>Raster</code> with the specified
+     *          <code>SampleModel</code>, <code>DataBuffer</code>, and
+     *          location.
+     * @throws RasterFormatException if computing either
+     *         <code>location.x + sm.getWidth()</code> or
+     *         <code>location.y + sm.getHeight()</code> results in integer
+     *         overflow
+     * @throws RasterFormatException if <code>db</code> has more
+     *         than one bank and <code>sm</code> is a
+     *         PixelInterleavedSampleModel, SinglePixelPackedSampleModel,
+     *         or MultiPixelPackedSampleModel.
+     *  @throws NullPointerException if either SampleModel or DataBuffer is
+     *          null
+     */
+    public static Raster createRaster(SampleModel sm,
+                                      DataBuffer db,
+                                      Point location) {
+        if ((sm == null) || (db == null)) {
+            throw new NullPointerException("SampleModel and DataBuffer cannot be null");
+        }
+
+        if (location == null) {
+           location = new Point(0,0);
+        }
+        int dataType = sm.getDataType();
+
+        if (sm instanceof PixelInterleavedSampleModel) {
+            switch(dataType) {
+                case DataBuffer.TYPE_BYTE:
+                    return new ByteInterleavedRaster(sm, db, location);
+
+                case DataBuffer.TYPE_USHORT:
+                    return new ShortInterleavedRaster(sm, db, location);
+            }
+        } else if (sm instanceof SinglePixelPackedSampleModel) {
+            switch(dataType) {
+                case DataBuffer.TYPE_BYTE:
+                    return new ByteInterleavedRaster(sm, db, location);
+
+                case DataBuffer.TYPE_USHORT:
+                    return new ShortInterleavedRaster(sm, db, location);
+
+                case DataBuffer.TYPE_INT:
+                    return new IntegerInterleavedRaster(sm, db, location);
+            }
+        } else if (sm instanceof MultiPixelPackedSampleModel &&
+                   dataType == DataBuffer.TYPE_BYTE &&
+                   sm.getSampleSize(0) < 8) {
+            return new BytePackedRaster(sm, db, location);
+        }
+
+        // we couldn't do anything special - do the generic thing
+
+        return new Raster(sm,db,location);
+    }
+
+    /**
+     *  Creates a WritableRaster with the specified SampleModel.
+     *  The upper left corner of the Raster is given by the location argument.
+     *  If location is null, (0, 0) will be used.
+     *  @param sm the specified <code>SampleModel</code>
+     *  @param location the upper-left corner of the
+     *         <code>WritableRaster</code>
+     *  @return a <code>WritableRaster</code> with the specified
+     *          <code>SampleModel</code> and location.
+     *  @throws RasterFormatException if computing either
+     *          <code>location.x + sm.getWidth()</code> or
+     *          <code>location.y + sm.getHeight()</code> results in integer
+     *          overflow
+     */
+    public static WritableRaster createWritableRaster(SampleModel sm,
+                                                      Point location) {
+        if (location == null) {
+           location = new Point(0,0);
+        }
+
+        return createWritableRaster(sm, sm.createDataBuffer(), location);
+    }
+
+    /**
+     *  Creates a WritableRaster with the specified SampleModel and DataBuffer.
+     *  The upper left corner of the Raster is given by the location argument.
+     *  If location is null, (0, 0) will be used.
+     *  @param sm the specified <code>SampleModel</code>
+     *  @param db the specified <code>DataBuffer</code>
+     *  @param location the upper-left corner of the
+     *         <code>WritableRaster</code>
+     *  @return a <code>WritableRaster</code> with the specified
+     *          <code>SampleModel</code>, <code>DataBuffer</code>, and
+     *          location.
+     * @throws RasterFormatException if computing either
+     *         <code>location.x + sm.getWidth()</code> or
+     *         <code>location.y + sm.getHeight()</code> results in integer
+     *         overflow
+     * @throws RasterFormatException if <code>db</code> has more
+     *         than one bank and <code>sm</code> is a
+     *         PixelInterleavedSampleModel, SinglePixelPackedSampleModel,
+     *         or MultiPixelPackedSampleModel.
+     * @throws NullPointerException if either SampleModel or DataBuffer is null
+     */
+    public static WritableRaster createWritableRaster(SampleModel sm,
+                                                      DataBuffer db,
+                                                      Point location) {
+        if ((sm == null) || (db == null)) {
+            throw new NullPointerException("SampleModel and DataBuffer cannot be null");
+        }
+        if (location == null) {
+           location = new Point(0,0);
+        }
+
+        int dataType = sm.getDataType();
+
+        if (sm instanceof PixelInterleavedSampleModel) {
+            switch(dataType) {
+                case DataBuffer.TYPE_BYTE:
+                    return new ByteInterleavedRaster(sm, db, location);
+
+                case DataBuffer.TYPE_USHORT:
+                    return new ShortInterleavedRaster(sm, db, location);
+            }
+        } else if (sm instanceof SinglePixelPackedSampleModel) {
+            switch(dataType) {
+                case DataBuffer.TYPE_BYTE:
+                    return new ByteInterleavedRaster(sm, db, location);
+
+                case DataBuffer.TYPE_USHORT:
+                    return new ShortInterleavedRaster(sm, db, location);
+
+                case DataBuffer.TYPE_INT:
+                    return new IntegerInterleavedRaster(sm, db, location);
+            }
+        } else if (sm instanceof MultiPixelPackedSampleModel &&
+                   dataType == DataBuffer.TYPE_BYTE &&
+                   sm.getSampleSize(0) < 8) {
+            return new BytePackedRaster(sm, db, location);
+        }
+
+        // we couldn't do anything special - do the generic thing
+
+        return new SunWritableRaster(sm,db,location);
+    }
+
+    /**
+     *  Constructs a Raster with the given SampleModel.  The Raster's
+     *  upper left corner is origin and it is the same size as the
+     *  SampleModel.  A DataBuffer large enough to describe the
+     *  Raster is automatically created.
+     *  @param sampleModel     The SampleModel that specifies the layout
+     *  @param origin          The Point that specified the origin
+     *  @throws RasterFormatException if computing either
+     *          <code>origin.x + sampleModel.getWidth()</code> or
+     *          <code>origin.y + sampleModel.getHeight()</code> results in
+     *          integer overflow
+     *  @throws NullPointerException either <code>sampleModel</code> or
+     *          <code>origin</code> is null
+     */
+    protected Raster(SampleModel sampleModel,
+                     Point origin) {
+        this(sampleModel,
+             sampleModel.createDataBuffer(),
+             new Rectangle(origin.x,
+                           origin.y,
+                           sampleModel.getWidth(),
+                           sampleModel.getHeight()),
+             origin,
+             null);
+    }
+
+    /**
+     *  Constructs a Raster with the given SampleModel and DataBuffer.
+     *  The Raster's upper left corner is origin and it is the same size
+     *  as the SampleModel.  The DataBuffer is not initialized and must
+     *  be compatible with SampleModel.
+     *  @param sampleModel     The SampleModel that specifies the layout
+     *  @param dataBuffer      The DataBuffer that contains the image data
+     *  @param origin          The Point that specifies the origin
+     *  @throws RasterFormatException if computing either
+     *          <code>origin.x + sampleModel.getWidth()</code> or
+     *          <code>origin.y + sampleModel.getHeight()</code> results in
+     *          integer overflow
+     *  @throws NullPointerException either <code>sampleModel</code> or
+     *          <code>origin</code> is null
+     */
+    protected Raster(SampleModel sampleModel,
+                     DataBuffer dataBuffer,
+                     Point origin) {
+        this(sampleModel,
+             dataBuffer,
+             new Rectangle(origin.x,
+                           origin.y,
+                           sampleModel.getWidth(),
+                           sampleModel.getHeight()),
+             origin,
+             null);
+    }
+
+    /**
+     * Constructs a Raster with the given SampleModel, DataBuffer, and
+     * parent.  aRegion specifies the bounding rectangle of the new
+     * Raster.  When translated into the base Raster's coordinate
+     * system, aRegion must be contained by the base Raster.
+     * (The base Raster is the Raster's ancestor which has no parent.)
+     * sampleModelTranslate specifies the sampleModelTranslateX and
+     * sampleModelTranslateY values of the new Raster.
+     *
+     * Note that this constructor should generally be called by other
+     * constructors or create methods, it should not be used directly.
+     * @param sampleModel     The SampleModel that specifies the layout
+     * @param dataBuffer      The DataBuffer that contains the image data
+     * @param aRegion         The Rectangle that specifies the image area
+     * @param sampleModelTranslate  The Point that specifies the translation
+     *                        from SampleModel to Raster coordinates
+     * @param parent          The parent (if any) of this raster
+     * @throws NullPointerException if any of <code>sampleModel</code>,
+     *         <code>dataBuffer</code>, <code>aRegion</code> or
+     *         <code>sampleModelTranslate</code> is null
+     * @throws RasterFormatException if <code>aRegion</code> has width
+     *         or height less than or equal to zero, or computing either
+     *         <code>aRegion.x + aRegion.width</code> or
+     *         <code>aRegion.y + aRegion.height</code> results in integer
+     *         overflow
+     */
+    protected Raster(SampleModel sampleModel,
+                     DataBuffer dataBuffer,
+                     Rectangle aRegion,
+                     Point sampleModelTranslate,
+                     Raster parent) {
+
+        if ((sampleModel == null) || (dataBuffer == null) ||
+            (aRegion == null) || (sampleModelTranslate == null)) {
+            throw new NullPointerException("SampleModel, dataBuffer, aRegion and " +
+                                           "sampleModelTranslate cannot be null");
+        }
+       this.sampleModel = sampleModel;
+       this.dataBuffer = dataBuffer;
+       minX = aRegion.x;
+       minY = aRegion.y;
+       width = aRegion.width;
+       height = aRegion.height;
+       if (width <= 0 || height <= 0) {
+           throw new RasterFormatException("negative or zero " +
+               ((width <= 0) ? "width" : "height"));
+       }
+       if ((minX + width) < minX) {
+           throw new RasterFormatException(
+               "overflow condition for X coordinates of Raster");
+       }
+       if ((minY + height) < minY) {
+           throw new RasterFormatException(
+               "overflow condition for Y coordinates of Raster");
+       }
+
+       sampleModelTranslateX = sampleModelTranslate.x;
+       sampleModelTranslateY = sampleModelTranslate.y;
+
+       numBands = sampleModel.getNumBands();
+       numDataElements = sampleModel.getNumDataElements();
+       this.parent = parent;
+    }
+
+
+    /**
+     * Returns the parent Raster (if any) of this Raster or null.
+     * @return the parent Raster or <code>null</code>.
+     */
+    public Raster getParent() {
+        return parent;
+    }
+
+    /**
+     * Returns the X translation from the coordinate system of the
+     * SampleModel to that of the Raster.  To convert a pixel's X
+     * coordinate from the Raster coordinate system to the SampleModel
+     * coordinate system, this value must be subtracted.
+     * @return the X translation from the coordinate space of the
+     *         Raster's SampleModel to that of the Raster.
+     */
+    final public int getSampleModelTranslateX() {
+        return sampleModelTranslateX;
+    }
+
+    /**
+     * Returns the Y translation from the coordinate system of the
+     * SampleModel to that of the Raster.  To convert a pixel's Y
+     * coordinate from the Raster coordinate system to the SampleModel
+     * coordinate system, this value must be subtracted.
+     * @return the Y translation from the coordinate space of the
+     *         Raster's SampleModel to that of the Raster.
+     */
+    final public int getSampleModelTranslateY() {
+        return sampleModelTranslateY;
+    }
+
+    /**
+     * Create a compatible WritableRaster the same size as this Raster with
+     * the same SampleModel and a new initialized DataBuffer.
+     * @return a compatible <code>WritableRaster</code> with the same sample
+     *         model and a new data buffer.
+     */
+    public WritableRaster createCompatibleWritableRaster() {
+        return new SunWritableRaster(sampleModel, new Point(0,0));
+    }
+
+    /**
+     * Create a compatible WritableRaster with the specified size, a new
+     * SampleModel, and a new initialized DataBuffer.
+     * @param w the specified width of the new <code>WritableRaster</code>
+     * @param h the specified height of the new <code>WritableRaster</code>
+     * @return a compatible <code>WritableRaster</code> with the specified
+     *         size and a new sample model and data buffer.
+     * @exception RasterFormatException if the width or height is less than
+     *                               or equal to zero.
+     */
+    public WritableRaster createCompatibleWritableRaster(int w, int h) {
+        if (w <= 0 || h <=0) {
+            throw new RasterFormatException("negative " +
+                                          ((w <= 0) ? "width" : "height"));
+        }
+
+        SampleModel sm = sampleModel.createCompatibleSampleModel(w,h);
+
+        return new SunWritableRaster(sm, new Point(0,0));
+    }
+
+    /**
+     * Create a compatible WritableRaster with location (minX, minY)
+     * and size (width, height) specified by rect, a
+     * new SampleModel, and a new initialized DataBuffer.
+     * @param rect a <code>Rectangle</code> that specifies the size and
+     *        location of the <code>WritableRaster</code>
+     * @return a compatible <code>WritableRaster</code> with the specified
+     *         size and location and a new sample model and data buffer.
+     * @throws RasterFormatException if <code>rect</code> has width
+     *         or height less than or equal to zero, or computing either
+     *         <code>rect.x + rect.width</code> or
+     *         <code>rect.y + rect.height</code> results in integer
+     *         overflow
+     * @throws NullPointerException if <code>rect</code> is null
+     */
+    public WritableRaster createCompatibleWritableRaster(Rectangle rect) {
+        if (rect == null) {
+            throw new NullPointerException("Rect cannot be null");
+        }
+        return createCompatibleWritableRaster(rect.x, rect.y,
+                                              rect.width, rect.height);
+    }
+
+    /**
+     * Create a compatible WritableRaster with the specified
+     * location (minX, minY) and size (width, height), a
+     * new SampleModel, and a new initialized DataBuffer.
+     * @param x the X coordinate of the upper-left corner of
+     *        the <code>WritableRaster</code>
+     * @param y the Y coordinate of the upper-left corner of
+     *        the <code>WritableRaster</code>
+     * @param w the specified width of the <code>WritableRaster</code>
+     * @param h the specified height of the <code>WritableRaster</code>
+     * @return a compatible <code>WritableRaster</code> with the specified
+     *         size and location and a new sample model and data buffer.
+     * @throws RasterFormatException if <code>w</code> or <code>h</code>
+     *         is less than or equal to zero, or computing either
+     *         <code>x + w</code> or
+     *         <code>y + h</code> results in integer
+     *         overflow
+     */
+    public WritableRaster createCompatibleWritableRaster(int x, int y,
+                                                         int w, int h) {
+        WritableRaster ret = createCompatibleWritableRaster(w, h);
+        return ret.createWritableChild(0,0,w,h,x,y,null);
+    }
+
+    /**
+     * Create a Raster with the same size, SampleModel and DataBuffer
+     * as this one, but with a different location.  The new Raster
+     * will possess a reference to the current Raster, accessible
+     * through its getParent() method.
+     *
+     * @param childMinX the X coordinate of the upper-left
+     *        corner of the new <code>Raster</code>
+     * @param childMinY the Y coordinate of the upper-left
+     *        corner of the new <code>Raster</code>
+     * @return a new <code>Raster</code> with the same size, SampleModel,
+     *         and DataBuffer as this <code>Raster</code>, but with the
+     *         specified location.
+     * @throws RasterFormatException if  computing either
+     *         <code>childMinX + this.getWidth()</code> or
+     *         <code>childMinY + this.getHeight()</code> results in integer
+     *         overflow
+     */
+    public Raster createTranslatedChild(int childMinX, int childMinY) {
+        return createChild(minX,minY,width,height,
+                           childMinX,childMinY,null);
+    }
+
+    /**
+     * Returns a new Raster which shares all or part of this Raster's
+     * DataBuffer.  The new Raster will possess a reference to the
+     * current Raster, accessible through its getParent() method.
+     *
+     * <p> The parentX, parentY, width and height parameters
+     * form a Rectangle in this Raster's coordinate space,
+     * indicating the area of pixels to be shared.  An error will
+     * be thrown if this Rectangle is not contained with the bounds
+     * of the current Raster.
+     *
+     * <p> The new Raster may additionally be translated to a
+     * different coordinate system for the plane than that used by the current
+     * Raster.  The childMinX and childMinY parameters give the new
+     * (x, y) coordinate of the upper-left pixel of the returned
+     * Raster; the coordinate (childMinX, childMinY) in the new Raster
+     * will map to the same pixel as the coordinate (parentX, parentY)
+     * in the current Raster.
+     *
+     * <p> The new Raster may be defined to contain only a subset of
+     * the bands of the current Raster, possibly reordered, by means
+     * of the bandList parameter.  If bandList is null, it is taken to
+     * include all of the bands of the current Raster in their current
+     * order.
+     *
+     * <p> To create a new Raster that contains a subregion of the current
+     * Raster, but shares its coordinate system and bands,
+     * this method should be called with childMinX equal to parentX,
+     * childMinY equal to parentY, and bandList equal to null.
+     *
+     * @param parentX The X coordinate of the upper-left corner
+     *        in this Raster's coordinates
+     * @param parentY The Y coordinate of the upper-left corner
+     *        in this Raster's coordinates
+     * @param width      Width of the region starting at (parentX, parentY)
+     * @param height     Height of the region starting at (parentX, parentY).
+     * @param childMinX The X coordinate of the upper-left corner
+     *                   of the returned Raster
+     * @param childMinY The Y coordinate of the upper-left corner
+     *                   of the returned Raster
+     * @param bandList   Array of band indices, or null to use all bands
+     * @return a new <code>Raster</code>.
+     * @exception RasterFormatException if the specified subregion is outside
+     *                               of the raster bounds.
+     * @throws RasterFormatException if <code>width</code> or
+     *         <code>height</code>
+     *         is less than or equal to zero, or computing any of
+     *         <code>parentX + width</code>, <code>parentY + height</code>,
+     *         <code>childMinX + width</code>, or
+     *         <code>childMinY + height</code> results in integer
+     *         overflow
+     */
+    public Raster createChild(int parentX, int parentY,
+                              int width, int height,
+                              int childMinX, int childMinY,
+                              int bandList[]) {
+        if (parentX < this.minX) {
+            throw new RasterFormatException("parentX lies outside raster");
+        }
+        if (parentY < this.minY) {
+            throw new RasterFormatException("parentY lies outside raster");
+        }
+        if ((parentX + width < parentX) ||
+            (parentX + width > this.width + this.minX)) {
+            throw new RasterFormatException("(parentX + width) is outside raster");
+        }
+        if ((parentY + height < parentY) ||
+            (parentY + height > this.height + this.minY)) {
+            throw new RasterFormatException("(parentY + height) is outside raster");
+        }
+
+        SampleModel subSampleModel;
+        // Note: the SampleModel for the child Raster should have the same
+        // width and height as that for the parent, since it represents
+        // the physical layout of the pixel data.  The child Raster's width
+        // and height represent a "virtual" view of the pixel data, so
+        // they may be different than those of the SampleModel.
+        if (bandList == null) {
+            subSampleModel = sampleModel;
+        } else {
+            subSampleModel = sampleModel.createSubsetSampleModel(bandList);
+        }
+
+        int deltaX = childMinX - parentX;
+        int deltaY = childMinY - parentY;
+
+        return new Raster(subSampleModel, getDataBuffer(),
+                          new Rectangle(childMinX, childMinY, width, height),
+                          new Point(sampleModelTranslateX + deltaX,
+                                    sampleModelTranslateY + deltaY), this);
+    }
+
+    /**
+     * Returns the bounding Rectangle of this Raster. This function returns
+     * the same information as getMinX/MinY/Width/Height.
+     * @return the bounding box of this <code>Raster</code>.
+     */
+    public Rectangle getBounds() {
+        return new Rectangle(minX, minY, width, height);
+    }
+
+    /** Returns the minimum valid X coordinate of the Raster.
+     *  @return the minimum x coordinate of this <code>Raster</code>.
+     */
+    final public int getMinX() {
+        return minX;
+    }
+
+    /** Returns the minimum valid Y coordinate of the Raster.
+     *  @return the minimum y coordinate of this <code>Raster</code>.
+     */
+    final public int getMinY() {
+        return minY;
+    }
+
+    /** Returns the width in pixels of the Raster.
+     *  @return the width of this <code>Raster</code>.
+     */
+    final public int getWidth() {
+        return width;
+    }
+
+    /** Returns the height in pixels of the Raster.
+     *  @return the height of this <code>Raster</code>.
+     */
+    final public int getHeight() {
+        return height;
+    }
+
+    /** Returns the number of bands (samples per pixel) in this Raster.
+     *  @return the number of bands of this <code>Raster</code>.
+     */
+    final public int getNumBands() {
+        return numBands;
+    }
+
+    /**
+     *  Returns the number of data elements needed to transfer one pixel
+     *  via the getDataElements and setDataElements methods.  When pixels
+     *  are transferred via these methods, they may be transferred in a
+     *  packed or unpacked format, depending on the implementation of the
+     *  underlying SampleModel.  Using these methods, pixels are transferred
+     *  as an array of getNumDataElements() elements of a primitive type given
+     *  by getTransferType().  The TransferType may or may not be the same
+     *  as the storage data type of the DataBuffer.
+     *  @return the number of data elements.
+     */
+    final public int getNumDataElements() {
+        return sampleModel.getNumDataElements();
+    }
+
+    /**
+     *  Returns the TransferType used to transfer pixels via the
+     *  getDataElements and setDataElements methods.  When pixels
+     *  are transferred via these methods, they may be transferred in a
+     *  packed or unpacked format, depending on the implementation of the
+     *  underlying SampleModel.  Using these methods, pixels are transferred
+     *  as an array of getNumDataElements() elements of a primitive type given
+     *  by getTransferType().  The TransferType may or may not be the same
+     *  as the storage data type of the DataBuffer.  The TransferType will
+     *  be one of the types defined in DataBuffer.
+     *  @return this transfer type.
+     */
+    final public int getTransferType() {
+        return sampleModel.getTransferType();
+    }
+
+    /** Returns the DataBuffer associated with this Raster.
+     *  @return the <code>DataBuffer</code> of this <code>Raster</code>.
+     */
+    public DataBuffer getDataBuffer() {
+        return dataBuffer;
+    }
+
+    /** Returns the SampleModel that describes the layout of the image data.
+     *  @return the <code>SampleModel</code> of this <code>Raster</code>.
+     */
+    public SampleModel getSampleModel() {
+        return sampleModel;
+    }
+
+    /**
+     * Returns data for a single pixel in a primitive array of type
+     * TransferType.  For image data supported by the Java 2D(tm) API,
+     * this will be one of DataBuffer.TYPE_BYTE, DataBuffer.TYPE_USHORT,
+     * DataBuffer.TYPE_INT, DataBuffer.TYPE_SHORT, DataBuffer.TYPE_FLOAT,
+     * or DataBuffer.TYPE_DOUBLE.  Data may be returned in a packed format,
+     * thus increasing efficiency for data transfers.
+     * An ArrayIndexOutOfBoundsException may be thrown
+     * if the coordinates are not in bounds.  However, explicit bounds
+     * checking is not guaranteed.
+     * A ClassCastException will be thrown if the input object is non null
+     * and references anything other than an array of TransferType.
+     * @see java.awt.image.SampleModel#getDataElements(int, int, Object, DataBuffer)
+     * @param x        The X coordinate of the pixel location
+     * @param y        The Y coordinate of the pixel location
+     * @param outData  An object reference to an array of type defined by
+     *                 getTransferType() and length getNumDataElements().
+     *                 If null, an array of appropriate type and size will be
+     *                 allocated
+     * @return         An object reference to an array of type defined by
+     *                 getTransferType() with the requested pixel data.
+     *
+     * @throws ArrayIndexOutOfBoundsException if the coordinates are not
+     * in bounds, or if outData is too small to hold the output.
+     */
+    public Object getDataElements(int x, int y, Object outData) {
+        return sampleModel.getDataElements(x - sampleModelTranslateX,
+                                           y - sampleModelTranslateY,
+                                           outData, dataBuffer);
+    }
+
+    /**
+     * Returns the pixel data for the specified rectangle of pixels in a
+     * primitive array of type TransferType.
+     * For image data supported by the Java 2D API, this
+     * will be one of DataBuffer.TYPE_BYTE, DataBuffer.TYPE_USHORT,
+     * DataBuffer.TYPE_INT, DataBuffer.TYPE_SHORT, DataBuffer.TYPE_FLOAT,
+     * or DataBuffer.TYPE_DOUBLE.  Data may be returned in a packed format,
+     * thus increasing efficiency for data transfers.
+     * An ArrayIndexOutOfBoundsException may be thrown
+     * if the coordinates are not in bounds.  However, explicit bounds
+     * checking is not guaranteed.
+     * A ClassCastException will be thrown if the input object is non null
+     * and references anything other than an array of TransferType.
+     * @see java.awt.image.SampleModel#getDataElements(int, int, int, int, Object, DataBuffer)
+     * @param x    The X coordinate of the upper-left pixel location
+     * @param y    The Y coordinate of the upper-left pixel location
+     * @param w    Width of the pixel rectangle
+     * @param h   Height of the pixel rectangle
+     * @param outData  An object reference to an array of type defined by
+     *                 getTransferType() and length w*h*getNumDataElements().
+     *                 If null, an array of appropriate type and size will be
+     *                 allocated.
+     * @return         An object reference to an array of type defined by
+     *                 getTransferType() with the requested pixel data.
+     *
+     * @throws ArrayIndexOutOfBoundsException if the coordinates are not
+     * in bounds, or if outData is too small to hold the output.
+     */
+    public Object getDataElements(int x, int y, int w, int h, Object outData) {
+        return sampleModel.getDataElements(x - sampleModelTranslateX,
+                                           y - sampleModelTranslateY,
+                                           w, h, outData, dataBuffer);
+    }
+
+    /**
+     * Returns the samples in an array of int for the specified pixel.
+     * An ArrayIndexOutOfBoundsException may be thrown
+     * if the coordinates are not in bounds.  However, explicit bounds
+     * checking is not guaranteed.
+     * @param x The X coordinate of the pixel location
+     * @param y The Y coordinate of the pixel location
+     * @param iArray An optionally preallocated int array
+     * @return the samples for the specified pixel.
+     *
+     * @throws ArrayIndexOutOfBoundsException if the coordinates are not
+     * in bounds, or if iArray is too small to hold the output.
+     */
+    public int[] getPixel(int x, int y, int iArray[]) {
+        return sampleModel.getPixel(x - sampleModelTranslateX,
+                                    y - sampleModelTranslateY,
+                                    iArray, dataBuffer);
+    }
+
+    /**
+     * Returns the samples in an array of float for the
+     * specified pixel.
+     * An ArrayIndexOutOfBoundsException may be thrown
+     * if the coordinates are not in bounds.  However, explicit bounds
+     * checking is not guaranteed.
+     * @param x The X coordinate of the pixel location
+     * @param y The Y coordinate of the pixel location
+     * @param fArray An optionally preallocated float array
+     * @return the samples for the specified pixel.
+     *
+     * @throws ArrayIndexOutOfBoundsException if the coordinates are not
+     * in bounds, or if fArray is too small to hold the output.
+     */
+    public float[] getPixel(int x, int y, float fArray[]) {
+        return sampleModel.getPixel(x - sampleModelTranslateX,
+                                    y - sampleModelTranslateY,
+                                    fArray, dataBuffer);
+    }
+
+    /**
+     * Returns the samples in an array of double for the specified pixel.
+     * An ArrayIndexOutOfBoundsException may be thrown
+     * if the coordinates are not in bounds.  However, explicit bounds
+     * checking is not guaranteed.
+     * @param x The X coordinate of the pixel location
+     * @param y The Y coordinate of the pixel location
+     * @param dArray An optionally preallocated double array
+     * @return the samples for the specified pixel.
+     *
+     * @throws ArrayIndexOutOfBoundsException if the coordinates are not
+     * in bounds, or if dArray is too small to hold the output.
+     */
+    public double[] getPixel(int x, int y, double dArray[]) {
+        return sampleModel.getPixel(x - sampleModelTranslateX,
+                                    y - sampleModelTranslateY,
+                                    dArray, dataBuffer);
+    }
+
+    /**
+     * Returns an int array containing all samples for a rectangle of pixels,
+     * one sample per array element.
+     * An ArrayIndexOutOfBoundsException may be thrown
+     * if the coordinates are not in bounds.  However, explicit bounds
+     * checking is not guaranteed.
+     * @param x      The X coordinate of the upper-left pixel location
+     * @param y      The Y coordinate of the upper-left pixel location
+     * @param w      Width of the pixel rectangle
+     * @param h      Height of the pixel rectangle
+     * @param iArray An optionally pre-allocated int array
+     * @return the samples for the specified rectangle of pixels.
+     *
+     * @throws ArrayIndexOutOfBoundsException if the coordinates are not
+     * in bounds, or if iArray is too small to hold the output.
+     */
+    public int[] getPixels(int x, int y, int w, int h, int iArray[]) {
+        return sampleModel.getPixels(x - sampleModelTranslateX,
+                                     y - sampleModelTranslateY, w, h,
+                                     iArray, dataBuffer);
+    }
+
+    /**
+     * Returns a float array containing all samples for a rectangle of pixels,
+     * one sample per array element.
+     * An ArrayIndexOutOfBoundsException may be thrown
+     * if the coordinates are not in bounds.  However, explicit bounds
+     * checking is not guaranteed.
+     * @param x        The X coordinate of the pixel location
+     * @param y        The Y coordinate of the pixel location
+     * @param w        Width of the pixel rectangle
+     * @param h        Height of the pixel rectangle
+     * @param fArray   An optionally pre-allocated float array
+     * @return the samples for the specified rectangle of pixels.
+     *
+     * @throws ArrayIndexOutOfBoundsException if the coordinates are not
+     * in bounds, or if fArray is too small to hold the output.
+     */
+    public float[] getPixels(int x, int y, int w, int h,
+                             float fArray[]) {
+        return sampleModel.getPixels(x - sampleModelTranslateX,
+                                     y - sampleModelTranslateY, w, h,
+                                     fArray, dataBuffer);
+    }
+
+    /**
+     * Returns a double array containing all samples for a rectangle of pixels,
+     * one sample per array element.
+     * An ArrayIndexOutOfBoundsException may be thrown
+     * if the coordinates are not in bounds.  However, explicit bounds
+     * checking is not guaranteed.
+     * @param x        The X coordinate of the upper-left pixel location
+     * @param y        The Y coordinate of the upper-left pixel location
+     * @param w        Width of the pixel rectangle
+     * @param h        Height of the pixel rectangle
+     * @param dArray   An optionally pre-allocated double array
+     * @return the samples for the specified rectangle of pixels.
+     *
+     * @throws ArrayIndexOutOfBoundsException if the coordinates are not
+     * in bounds, or if dArray is too small to hold the output.
+     */
+    public double[] getPixels(int x, int y, int w, int h,
+                              double dArray[]) {
+        return sampleModel.getPixels(x - sampleModelTranslateX,
+                                     y - sampleModelTranslateY,
+                                     w, h, dArray, dataBuffer);
+    }
+
+
+    /**
+     * Returns the sample in a specified band for the pixel located
+     * at (x,y) as an int.
+     * An ArrayIndexOutOfBoundsException may be thrown
+     * if the coordinates are not in bounds.  However, explicit bounds
+     * checking is not guaranteed.
+     * @param x        The X coordinate of the pixel location
+     * @param y        The Y coordinate of the pixel location
+     * @param b        The band to return
+     * @return the sample in the specified band for the pixel at the
+     *         specified coordinate.
+     *
+     * @throws ArrayIndexOutOfBoundsException if the coordinates or
+     * the band index are not in bounds.
+     */
+    public int getSample(int x, int y, int b) {
+        return sampleModel.getSample(x - sampleModelTranslateX,
+                                     y - sampleModelTranslateY, b,
+                                     dataBuffer);
+    }
+
+    /**
+     * Returns the sample in a specified band
+     * for the pixel located at (x,y) as a float.
+     * An ArrayIndexOutOfBoundsException may be thrown
+     * if the coordinates are not in bounds.  However, explicit bounds
+     * checking is not guaranteed.
+     * @param x        The X coordinate of the pixel location
+     * @param y        The Y coordinate of the pixel location
+     * @param b        The band to return
+     * @return the sample in the specified band for the pixel at the
+     *         specified coordinate.
+     *
+     * @throws ArrayIndexOutOfBoundsException if the coordinates or
+     * the band index are not in bounds.
+     */
+    public float getSampleFloat(int x, int y, int b) {
+        return sampleModel.getSampleFloat(x - sampleModelTranslateX,
+                                          y - sampleModelTranslateY, b,
+                                          dataBuffer);
+    }
+
+    /**
+     * Returns the sample in a specified band
+     * for a pixel located at (x,y) as a double.
+     * An ArrayIndexOutOfBoundsException may be thrown
+     * if the coordinates are not in bounds.  However, explicit bounds
+     * checking is not guaranteed.
+     * @param x        The X coordinate of the pixel location
+     * @param y        The Y coordinate of the pixel location
+     * @param b        The band to return
+     * @return the sample in the specified band for the pixel at the
+     *         specified coordinate.
+     *
+     * @throws ArrayIndexOutOfBoundsException if the coordinates or
+     * the band index are not in bounds.
+     */
+    public double getSampleDouble(int x, int y, int b) {
+        return sampleModel.getSampleDouble(x - sampleModelTranslateX,
+                                           y - sampleModelTranslateY,
+                                           b, dataBuffer);
+    }
+
+    /**
+     * Returns the samples for a specified band for the specified rectangle
+     * of pixels in an int array, one sample per array element.
+     * An ArrayIndexOutOfBoundsException may be thrown
+     * if the coordinates are not in bounds.  However, explicit bounds
+     * checking is not guaranteed.
+     * @param x        The X coordinate of the upper-left pixel location
+     * @param y        The Y coordinate of the upper-left pixel location
+     * @param w        Width of the pixel rectangle
+     * @param h        Height of the pixel rectangle
+     * @param b        The band to return
+     * @param iArray   An optionally pre-allocated int array
+     * @return the samples for the specified band for the specified
+     *         rectangle of pixels.
+     *
+     * @throws ArrayIndexOutOfBoundsException if the coordinates or
+     * the band index are not in bounds, or if iArray is too small to
+     * hold the output.
+     */
+    public int[] getSamples(int x, int y, int w, int h, int b,
+                            int iArray[]) {
+        return sampleModel.getSamples(x - sampleModelTranslateX,
+                                      y - sampleModelTranslateY,
+                                      w, h, b, iArray,
+                                      dataBuffer);
+    }
+
+    /**
+     * Returns the samples for a specified band for the specified rectangle
+     * of pixels in a float array, one sample per array element.
+     * An ArrayIndexOutOfBoundsException may be thrown
+     * if the coordinates are not in bounds.  However, explicit bounds
+     * checking is not guaranteed.
+     * @param x        The X coordinate of the upper-left pixel location
+     * @param y        The Y coordinate of the upper-left pixel location
+     * @param w        Width of the pixel rectangle
+     * @param h        Height of the pixel rectangle
+     * @param b        The band to return
+     * @param fArray   An optionally pre-allocated float array
+     * @return the samples for the specified band for the specified
+     *         rectangle of pixels.
+     *
+     * @throws ArrayIndexOutOfBoundsException if the coordinates or
+     * the band index are not in bounds, or if fArray is too small to
+     * hold the output.
+     */
+    public float[] getSamples(int x, int y, int w, int h, int b,
+                              float fArray[]) {
+        return sampleModel.getSamples(x - sampleModelTranslateX,
+                                      y - sampleModelTranslateY,
+                                      w, h, b, fArray, dataBuffer);
+    }
+
+    /**
+     * Returns the samples for a specified band for a specified rectangle
+     * of pixels in a double array, one sample per array element.
+     * An ArrayIndexOutOfBoundsException may be thrown
+     * if the coordinates are not in bounds.  However, explicit bounds
+     * checking is not guaranteed.
+     * @param x        The X coordinate of the upper-left pixel location
+     * @param y        The Y coordinate of the upper-left pixel location
+     * @param w        Width of the pixel rectangle
+     * @param h        Height of the pixel rectangle
+     * @param b        The band to return
+     * @param dArray   An optionally pre-allocated double array
+     * @return the samples for the specified band for the specified
+     *         rectangle of pixels.
+     *
+     * @throws ArrayIndexOutOfBoundsException if the coordinates or
+     * the band index are not in bounds, or if dArray is too small to
+     * hold the output.
+     */
+    public double[] getSamples(int x, int y, int w, int h, int b,
+                               double dArray[]) {
+         return sampleModel.getSamples(x - sampleModelTranslateX,
+                                       y - sampleModelTranslateY,
+                                       w, h, b, dArray, dataBuffer);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/classes/java/awt/image/RenderedImage.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,217 @@
+/*
+ * Portions Copyright 1997-2000 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) Eastman Kodak Company, 1997
+ *** As  an unpublished  work pursuant to Title 17 of the United
+ *** States Code.  All rights reserved.
+ ******************************************************************
+ ******************************************************************
+ ******************************************************************/
+
+package java.awt.image;
+import java.awt.Rectangle;
+import java.util.Dictionary;
+import java.util.Vector;
+
+/**
+ * RenderedImage is a common interface for objects which contain
+ * or can produce image data in the form of Rasters.  The image
+ * data may be stored/produced as a single tile or a regular array
+ * of tiles.
+ */
+
+public interface RenderedImage {
+
+    /**
+     * Returns a vector of RenderedImages that are the immediate sources of
+     * image data for this RenderedImage.  This method returns null if
+     * the RenderedImage object has no information about its immediate
+     * sources.  It returns an empty Vector if the RenderedImage object has
+     * no immediate sources.
+     * @return a Vector of <code>RenderedImage</code> objects.
+     */
+    Vector<RenderedImage> getSources();
+
+    /**
+     * Gets a property from the property set of this image.  The set of
+     * properties and whether it is immutable is determined by the
+     * implementing class.  This method returns
+     * java.awt.Image.UndefinedProperty if the specified property is
+     * not defined for this RenderedImage.
+     * @param name the name of the property
+     * @return the property indicated by the specified name.
+     * @see java.awt.Image#UndefinedProperty
+     */
+    Object getProperty(String name);
+
+    /**
+      * Returns an array of names recognized by
+      * {@link #getProperty(String) getProperty(String)}
+      * or <code>null</code>, if no property names are recognized.
+      * @return a <code>String</code> array containing all of the
+      * property names that <code>getProperty(String)</code> recognizes;
+      * or <code>null</code> if no property names are recognized.
+      */
+    String[] getPropertyNames();
+
+    /**
+     * Returns the ColorModel associated with this image.  All Rasters
+     * returned from this image will have this as their ColorModel.  This
+     * can return null.
+     * @return the <code>ColorModel</code> of this image.
+     */
+    ColorModel getColorModel();
+
+    /**
+     * Returns the SampleModel associated with this image.  All Rasters
+     * returned from this image will have this as their SampleModel.
+     * @return the <code>SampleModel</code> of this image.
+     */
+    SampleModel getSampleModel();
+
+    /**
+     * Returns the width of the RenderedImage.
+     * @return the width of this <code>RenderedImage</code>.
+     */
+    int getWidth();
+
+    /**
+     * Returns the height of the RenderedImage.
+     * @return the height of this <code>RenderedImage</code>.
+     */
+    int getHeight();
+
+    /**
+     * Returns the minimum X coordinate (inclusive) of the RenderedImage.
+     * @return the X coordinate of this <code>RenderedImage</code>.
+     */
+    int getMinX();
+
+    /**
+     * Returns the minimum Y coordinate (inclusive) of the RenderedImage.
+     * @return the Y coordinate of this <code>RenderedImage</code>.
+     */
+    int getMinY();
+
+    /**
+     * Returns the number of tiles in the X direction.
+     * @return the number of tiles in the X direction.
+     */
+    int getNumXTiles();
+
+    /**
+     * Returns the number of tiles in the Y direction.
+     * @return the number of tiles in the Y direction.
+     */
+    int getNumYTiles();
+
+    /**
+     *  Returns the minimum tile index in the X direction.
+     *  @return the minimum tile index in the X direction.
+     */
+    int getMinTileX();
+
+    /**
+     *  Returns the minimum tile index in the Y direction.
+     *  @return the minimum tile index in the X direction.
+     */
+    int getMinTileY();
+
+    /**
+     *  Returns the tile width in pixels.  All tiles must have the same
+     *  width.
+     *  @return the tile width in pixels.
+     */
+    int getTileWidth();
+
+    /**
+     *  Returns the tile height in pixels.  All tiles must have the same
+     *  height.
+     *  @return the tile height in pixels.
+     */
+    int getTileHeight();
+
+    /**
+     * Returns the X offset of the tile grid relative to the origin,
+     * i.e., the X coordinate of the upper-left pixel of tile (0, 0).
+     * (Note that tile (0, 0) may not actually exist.)
+     * @return the X offset of the tile grid relative to the origin.
+     */
+    int getTileGridXOffset();
+
+    /**
+     * Returns the Y offset of the tile grid relative to the origin,
+     * i.e., the Y coordinate of the upper-left pixel of tile (0, 0).
+     * (Note that tile (0, 0) may not actually exist.)
+     * @return the Y offset of the tile grid relative to the origin.
+     */
+    int getTileGridYOffset();
+
+    /**
+     * Returns tile (tileX, tileY).  Note that tileX and tileY are indices
+     * into the tile array, not pixel locations.  The Raster that is returned
+     * is live and will be updated if the image is changed.
+     * @param tileX the X index of the requested tile in the tile array
+     * @param tileY the Y index of the requested tile in the tile array
+     * @return the tile given the specified indices.
+     */
+   Raster getTile(int tileX, int tileY);
+
+    /**
+     * Returns the image as one large tile (for tile based
+     * images this will require fetching the whole image
+     * and copying the image data over).  The Raster returned is
+     * a copy of the image data and will not be updated if the image
+     * is changed.
+     * @return the image as one large tile.
+     */
+    Raster getData();
+
+    /**
+     * Computes and returns an arbitrary region of the RenderedImage.
+     * The Raster returned is a copy of the image data and will not
+     * be updated if the image is changed.
+     * @param rect the region of the RenderedImage to be returned.
+     * @return the region of the <code>RenderedImage</code>
+     * indicated by the specified <code>Rectangle</code>.
+     */
+    Raster getData(Rectangle rect);
+
+    /**
+     * Computes an arbitrary rectangular region of the RenderedImage
+     * and copies it into a caller-supplied WritableRaster.  The region
+     * to be computed is determined from the bounds of the supplied
+     * WritableRaster.  The supplied WritableRaster must have a
+     * SampleModel that is compatible with this image.  If raster is null,
+     * an appropriate WritableRaster is created.
+     * @param raster a WritableRaster to hold the returned portion of the
+     *               image, or null.
+     * @return a reference to the supplied or created WritableRaster.
+     */
+    WritableRaster copyData(WritableRaster raster);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/classes/java/awt/image/SampleModel.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,1393 @@
+/*
+ * Portions Copyright 1997-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) Eastman Kodak Company, 1997
+ *** As  an unpublished  work pursuant to Title 17 of the United
+ *** States Code.  All rights reserved.
+ ******************************************************************
+ ******************************************************************
+ ******************************************************************/
+
+package java.awt.image;
+
+/**
+ *  This abstract class defines an interface for extracting samples of pixels
+ *  in an image.  All image data is expressed as a collection of pixels.
+ *  Each pixel consists of a number of samples. A sample is a datum
+ *  for one band of an image and a band consists of all samples of a
+ *  particular type in an image.  For example, a pixel might contain
+ *  three samples representing its red, green and blue components.
+ *  There are three bands in the image containing this pixel.  One band
+ *  consists of all the red samples from all pixels in the
+ *  image.  The second band consists of all the green samples and
+ *  the remaining band consists of all of the blue samples.  The pixel
+ *  can be stored in various formats.  For example, all samples from
+ *  a particular band can be stored contiguously or all samples from a
+ *  single pixel can be stored contiguously.
+ *  <p>
+ *  Subclasses of SampleModel specify the types of samples they can
+ *  represent (e.g. unsigned 8-bit byte, signed 16-bit short, etc.)
+ *  and may specify how the samples are organized in memory.
+ *  In the Java 2D(tm) API, built-in image processing operators may
+ *  not operate on all possible sample types, but generally will work
+ *  for unsigned integral samples of 16 bits or less.  Some operators
+ *  support a wider variety of sample types.
+ *  <p>
+ *  A collection of pixels is represented as a Raster, which consists of
+ *  a DataBuffer and a SampleModel.  The SampleModel allows access to
+ *  samples in the DataBuffer and may provide low-level information that
+ *  a programmer can use to directly manipulate samples and pixels in the
+ *  DataBuffer.
+ *  <p>
+ *  This class is generally a fall back method for dealing with
+ *  images.  More efficient code will cast the SampleModel to the
+ *  appropriate subclass and extract the information needed to directly
+ *  manipulate pixels in the DataBuffer.
+ *
+ *  @see java.awt.image.DataBuffer
+ *  @see java.awt.image.Raster
+ *  @see java.awt.image.ComponentSampleModel
+ *  @see java.awt.image.PixelInterleavedSampleModel
+ *  @see java.awt.image.BandedSampleModel
+ *  @see java.awt.image.MultiPixelPackedSampleModel
+ *  @see java.awt.image.SinglePixelPackedSampleModel
+ */
+
+public abstract class SampleModel
+{
+
+    /** Width in pixels of the region of image data that this SampleModel
+     *  describes.
+     */
+    protected int width;
+
+    /** Height in pixels of the region of image data that this SampleModel
+     *  describes.
+     */
+    protected int height;
+
+    /** Number of bands of the image data that this SampleModel describes. */
+    protected int numBands;
+
+    /** Data type of the DataBuffer storing the pixel data.
+     *  @see java.awt.image.DataBuffer
+     */
+    protected int dataType;
+
+    static private native void initIDs();
+    static {
+        ColorModel.loadLibraries();
+        initIDs();
+    }
+
+    /**
+     * Constructs a SampleModel with the specified parameters.
+     * @param dataType  The data type of the DataBuffer storing the pixel data.
+     * @param w         The width (in pixels) of the region of image data.
+     * @param h         The height (in pixels) of the region of image data.
+     * @param numBands  The number of bands of the image data.
+     * @throws IllegalArgumentException if <code>w</code> or <code>h</code>
+     *         is not greater than 0
+     * @throws IllegalArgumentException if the product of <code>w</code>
+     *         and <code>h</code> is greater than
+     *         <code>Integer.MAX_VALUE</code>
+     * @throws IllegalArgumentException if <code>dataType</code> is not
+     *         one of the supported data types
+     */
+    public SampleModel(int dataType, int w, int h, int numBands)
+    {
+        float size = (float)w*h;
+        if (w <= 0 || h <= 0) {
+            throw new IllegalArgumentException("Width ("+w+") and height ("+
+                                               h+") must be > 0");
+        }
+        if (size >= Integer.MAX_VALUE) {
+            throw new IllegalArgumentException("Dimensions (width="+w+
+                                               " height="+h+") are too large");
+        }
+
+        if (dataType < DataBuffer.TYPE_BYTE ||
+            (dataType > DataBuffer.TYPE_DOUBLE &&
+             dataType != DataBuffer.TYPE_UNDEFINED))
+        {
+            throw new IllegalArgumentException("Unsupported dataType: "+
+                                               dataType);
+        }
+
+        if (numBands <= 0) {
+            throw new IllegalArgumentException("Number of bands must be > 0");
+        }
+
+        this.dataType = dataType;
+        this.width = w;
+        this.height = h;
+        this.numBands = numBands;
+    }
+
+    /** Returns the width in pixels.
+     *  @return the width in pixels of the region of image data
+     *          that this <code>SampleModel</code> describes.
+     */
+    final public int getWidth() {
+         return width;
+    }
+
+    /** Returns the height in pixels.
+     *  @return the height in pixels of the region of image data
+     *          that this <code>SampleModel</code> describes.
+     */
+    final public int getHeight() {
+         return height;
+    }
+
+    /** Returns the total number of bands of image data.
+     *  @return the number of bands of image data that this
+     *          <code>SampleModel</code> describes.
+     */
+    final public int getNumBands() {
+         return numBands;
+    }
+
+    /** Returns the number of data elements needed to transfer a pixel
+     *  via the getDataElements and setDataElements methods.  When pixels
+     *  are transferred via these methods, they may be transferred in a
+     *  packed or unpacked format, depending on the implementation of the
+     *  SampleModel.  Using these methods, pixels are transferred as an
+     *  array of getNumDataElements() elements of a primitive type given
+     *  by getTransferType().  The TransferType may or may not be the same
+     *  as the storage DataType.
+     *  @return the number of data elements.
+     *  @see #getDataElements(int, int, Object, DataBuffer)
+     *  @see #getDataElements(int, int, int, int, Object, DataBuffer)
+     *  @see #setDataElements(int, int, Object, DataBuffer)
+     *  @see #setDataElements(int, int, int, int, Object, DataBuffer)
+     *  @see #getTransferType
+     */
+    public abstract int getNumDataElements();
+
+    /** Returns the data type of the DataBuffer storing the pixel data.
+     *  @return the data type.
+     */
+    final public int getDataType() {
+        return dataType;
+    }
+
+    /** Returns the TransferType used to transfer pixels via the
+     *  getDataElements and setDataElements methods.  When pixels
+     *  are transferred via these methods, they may be transferred in a
+     *  packed or unpacked format, depending on the implementation of the
+     *  SampleModel.  Using these methods, pixels are transferred as an
+     *  array of getNumDataElements() elements of a primitive type given
+     *  by getTransferType().  The TransferType may or may not be the same
+     *  as the storage DataType.  The TransferType will be one of the types
+     *  defined in DataBuffer.
+     *  @return the transfer type.
+     *  @see #getDataElements(int, int, Object, DataBuffer)
+     *  @see #getDataElements(int, int, int, int, Object, DataBuffer)
+     *  @see #setDataElements(int, int, Object, DataBuffer)
+     *  @see #setDataElements(int, int, int, int, Object, DataBuffer)
+     *  @see #getNumDataElements
+     *  @see java.awt.image.DataBuffer
+     */
+    public int getTransferType() {
+        return dataType;
+    }
+
+    /**
+     * Returns the samples for a specified pixel in an int array,
+     * one sample per array element.
+     * ArrayIndexOutOfBoundsException may be thrown if the coordinates are
+     * not in bounds.
+     * @param x         The X coordinate of the pixel location
+     * @param y         The Y coordinate of the pixel location
+     * @param iArray    If non-null, returns the samples in this array
+     * @param data      The DataBuffer containing the image data
+     * @return the samples for the specified pixel.
+     * @see #setPixel(int, int, int[], DataBuffer)
+     *
+     * @throws NullPointerException if data is null.
+     * @throws ArrayIndexOutOfBoundsException if the coordinates are
+     * not in bounds, or if iArray is too small to hold the output.
+     */
+    public int[] getPixel(int x, int y, int iArray[], DataBuffer data) {
+
+        int pixels[];
+
+        if (iArray != null)
+            pixels = iArray;
+        else
+            pixels = new int[numBands];
+
+        for (int i=0; i<numBands; i++) {
+            pixels[i] = getSample(x, y, i, data);
+        }
+
+        return pixels;
+    }
+
+    /**
+     * Returns data for a single pixel in a primitive array of type
+     * TransferType.  For image data supported by the Java 2D API, this
+     * will be one of DataBuffer.TYPE_BYTE, DataBuffer.TYPE_USHORT,
+     * DataBuffer.TYPE_INT, DataBuffer.TYPE_SHORT, DataBuffer.TYPE_FLOAT,
+     * or DataBuffer.TYPE_DOUBLE.  Data may be returned in a packed format,
+     * thus increasing efficiency for data transfers. Generally, obj
+     * should be passed in as null, so that the Object will be created
+     * automatically and will be of the right primitive data type.
+     * <p>
+     * The following code illustrates transferring data for one pixel from
+     * DataBuffer <code>db1</code>, whose storage layout is described by
+     * SampleModel <code>sm1</code>, to DataBuffer <code>db2</code>, whose
+     * storage layout is described by SampleModel <code>sm2</code>.
+     * The transfer will generally be more efficient than using
+     * getPixel/setPixel.
+     * <pre>
+     *       SampleModel sm1, sm2;
+     *       DataBuffer db1, db2;
+     *       sm2.setDataElements(x, y, sm1.getDataElements(x, y, null, db1), db2);
+     * </pre>
+     * Using getDataElements/setDataElements to transfer between two
+     * DataBuffer/SampleModel pairs is legitimate if the SampleModels have
+     * the same number of bands, corresponding bands have the same number of
+     * bits per sample, and the TransferTypes are the same.
+     * <p>
+     * If obj is non-null, it should be a primitive array of type TransferType.
+     * Otherwise, a ClassCastException is thrown.  An
+     * ArrayIndexOutOfBoundsException may be thrown if the coordinates are
+     * not in bounds, or if obj is non-null and is not large enough to hold
+     * the pixel data.
+     * @param x         The X coordinate of the pixel location.
+     * @param y         The Y coordinate of the pixel location.
+     * @param obj       If non-null, a primitive array in which to return
+     *                  the pixel data.
+     * @param data      The DataBuffer containing the image data.
+     * @return the data elements for the specified pixel.
+     * @see #getNumDataElements
+     * @see #getTransferType
+     * @see java.awt.image.DataBuffer
+     * @see #setDataElements(int, int, Object, DataBuffer)
+     *
+     * @throws NullPointerException if data is null.
+     * @throws ArrayIndexOutOfBoundsException if the coordinates are
+     * not in bounds, or if obj is too small to hold the output.
+     */
+    public abstract Object getDataElements(int x, int y,
+                                           Object obj, DataBuffer data);
+
+    /**
+     * Returns the pixel data for the specified rectangle of pixels in a
+     * primitive array of type TransferType.
+     * For image data supported by the Java 2D API, this
+     * will be one of DataBuffer.TYPE_BYTE, DataBuffer.TYPE_USHORT,
+     * DataBuffer.TYPE_INT, DataBuffer.TYPE_SHORT, DataBuffer.TYPE_FLOAT,
+     * or DataBuffer.TYPE_DOUBLE.  Data may be returned in a packed format,
+     * thus increasing efficiency for data transfers. Generally, obj
+     * should be passed in as null, so that the Object will be created
+     * automatically and will be of the right primitive data type.
+     * <p>
+     * The following code illustrates transferring data for a rectangular
+     * region of pixels from
+     * DataBuffer <code>db1</code>, whose storage layout is described by
+     * SampleModel <code>sm1</code>, to DataBuffer <code>db2</code>, whose
+     * storage layout is described by SampleModel <code>sm2</code>.
+     * The transfer will generally be more efficient than using
+     * getPixels/setPixels.
+     * <pre>
+     *       SampleModel sm1, sm2;
+     *       DataBuffer db1, db2;
+     *       sm2.setDataElements(x, y, w, h, sm1.getDataElements(x, y, w,
+     *                           h, null, db1), db2);
+     * </pre>
+     * Using getDataElements/setDataElements to transfer between two
+     * DataBuffer/SampleModel pairs is legitimate if the SampleModels have
+     * the same number of bands, corresponding bands have the same number of
+     * bits per sample, and the TransferTypes are the same.
+     * <p>
+     * If obj is non-null, it should be a primitive array of type TransferType.
+     * Otherwise, a ClassCastException is thrown.  An
+     * ArrayIndexOutOfBoundsException may be thrown if the coordinates are
+     * not in bounds, or if obj is non-null and is not large enough to hold
+     * the pixel data.
+     * @param x         The minimum X coordinate of the pixel rectangle.
+     * @param y         The minimum Y coordinate of the pixel rectangle.
+     * @param w         The width of the pixel rectangle.
+     * @param h         The height of the pixel rectangle.
+     * @param obj       If non-null, a primitive array in which to return
+     *                  the pixel data.
+     * @param data      The DataBuffer containing the image data.
+     * @return the data elements for the specified region of pixels.
+     * @see #getNumDataElements
+     * @see #getTransferType
+     * @see #setDataElements(int, int, int, int, Object, DataBuffer)
+     * @see java.awt.image.DataBuffer
+     *
+     * @throws NullPointerException if data is null.
+     * @throws ArrayIndexOutOfBoundsException if the coordinates are
+     * not in bounds, or if obj is too small to hold the output.
+     */
+    public Object getDataElements(int x, int y, int w, int h,
+                                  Object obj, DataBuffer data) {
+
+        int type = getTransferType();
+        int numDataElems = getNumDataElements();
+        int cnt = 0;
+        Object o = null;
+
+        switch(type) {
+
+        case DataBuffer.TYPE_BYTE:
+
+            byte[] btemp;
+            byte[] bdata;
+
+            if (obj == null)
+                bdata = new byte[numDataElems*w*h];
+            else
+                bdata = (byte[])obj;
+
+            for (int i=y; i<y+h; i++) {
+                for (int j=x; j<x+w; j++) {
+                    o = getDataElements(j, i, o, data);
+                    btemp = (byte[])o;
+                    for (int k=0; k<numDataElems; k++) {
+                        bdata[cnt++] = btemp[k];
+                    }
+                }
+            }
+            obj = (Object)bdata;
+            break;
+
+        case DataBuffer.TYPE_USHORT:
+        case DataBuffer.TYPE_SHORT:
+
+            short[] sdata;
+            short[] stemp;
+
+            if (obj == null)
+                sdata = new short[numDataElems*w*h];
+            else
+                sdata = (short[])obj;
+
+            for (int i=y; i<y+h; i++) {
+                for (int j=x; j<x+w; j++) {
+                    o = getDataElements(j, i, o, data);
+                    stemp = (short[])o;
+                    for (int k=0; k<numDataElems; k++) {
+                        sdata[cnt++] = stemp[k];
+                    }
+                }
+            }
+
+            obj = (Object)sdata;
+            break;
+
+        case DataBuffer.TYPE_INT:
+
+            int[] idata;
+            int[] itemp;
+
+            if (obj == null)
+                idata = new int[numDataElems*w*h];
+            else
+                idata = (int[])obj;
+
+            for (int i=y; i<y+h; i++) {
+                for (int j=x; j<x+w; j++) {
+                    o = getDataElements(j, i, o, data);
+                    itemp = (int[])o;
+                    for (int k=0; k<numDataElems; k++) {
+                        idata[cnt++] = itemp[k];
+                    }
+                }
+            }
+
+            obj = (Object)idata;
+            break;
+
+        case DataBuffer.TYPE_FLOAT:
+
+            float[] fdata;
+            float[] ftemp;
+
+            if (obj == null)
+                fdata = new float[numDataElems*w*h];
+            else
+                fdata = (float[])obj;
+
+            for (int i=y; i<y+h; i++) {
+                for (int j=x; j<x+w; j++) {
+                    o = getDataElements(j, i, o, data);
+                    ftemp = (float[])o;
+                    for (int k=0; k<numDataElems; k++) {
+                        fdata[cnt++] = ftemp[k];
+                    }
+                }
+            }
+
+            obj = (Object)fdata;
+            break;
+
+        case DataBuffer.TYPE_DOUBLE:
+
+            double[] ddata;
+            double[] dtemp;
+
+            if (obj == null)
+                ddata = new double[numDataElems*w*h];
+            else
+                ddata = (double[])obj;
+
+            for (int i=y; i<y+h; i++) {
+                for (int j=x; j<x+w; j++) {
+                    o = getDataElements(j, i, o, data);
+                    dtemp = (double[])o;
+                    for (int k=0; k<numDataElems; k++) {
+                        ddata[cnt++] = dtemp[k];
+                    }
+                }
+            }
+
+            obj = (Object)ddata;
+            break;
+        }
+
+        return obj;
+    }
+
+    /**
+     * Sets the data for a single pixel in the specified DataBuffer from a
+     * primitive array of type TransferType.  For image data supported by
+     * the Java 2D API, this will be one of DataBuffer.TYPE_BYTE,
+     * DataBuffer.TYPE_USHORT, DataBuffer.TYPE_INT, DataBuffer.TYPE_SHORT,
+     * DataBuffer.TYPE_FLOAT, or DataBuffer.TYPE_DOUBLE.  Data in the array
+     * may be in a packed format, thus increasing efficiency for data
+     * transfers.
+     * <p>
+     * The following code illustrates transferring data for one pixel from
+     * DataBuffer <code>db1</code>, whose storage layout is described by
+     * SampleModel <code>sm1</code>, to DataBuffer <code>db2</code>, whose
+     * storage layout is described by SampleModel <code>sm2</code>.
+     * The transfer will generally be more efficient than using
+     * getPixel/setPixel.
+     * <pre>
+     *       SampleModel sm1, sm2;
+     *       DataBuffer db1, db2;
+     *       sm2.setDataElements(x, y, sm1.getDataElements(x, y, null, db1),
+     *                           db2);
+     * </pre>
+     * Using getDataElements/setDataElements to transfer between two
+     * DataBuffer/SampleModel pairs is legitimate if the SampleModels have
+     * the same number of bands, corresponding bands have the same number of
+     * bits per sample, and the TransferTypes are the same.
+     * <p>
+     * obj must be a primitive array of type TransferType.  Otherwise,
+     * a ClassCastException is thrown.  An
+     * ArrayIndexOutOfBoundsException may be thrown if the coordinates are
+     * not in bounds, or if obj is not large enough to hold the pixel data.
+     * @param x         The X coordinate of the pixel location.
+     * @param y         The Y coordinate of the pixel location.
+     * @param obj       A primitive array containing pixel data.
+     * @param data      The DataBuffer containing the image data.
+     * @see #getNumDataElements
+     * @see #getTransferType
+     * @see #getDataElements(int, int, Object, DataBuffer)
+     * @see java.awt.image.DataBuffer
+     *
+     * @throws NullPointerException if data is null.
+     * @throws ArrayIndexOutOfBoundsException if the coordinates are
+     * not in bounds, or if obj is too small to hold the input.
+     */
+    public abstract void setDataElements(int x, int y,
+                                         Object obj, DataBuffer data);
+
+    /**
+     * Sets the data for a rectangle of pixels in the specified DataBuffer
+     * from a primitive array of type TransferType.  For image data supported
+     * by the Java 2D API, this will be one of DataBuffer.TYPE_BYTE,
+     * DataBuffer.TYPE_USHORT, DataBuffer.TYPE_INT, DataBuffer.TYPE_SHORT,
+     * DataBuffer.TYPE_FLOAT, or DataBuffer.TYPE_DOUBLE.  Data in the array
+     * may be in a packed format, thus increasing efficiency for data
+     * transfers.
+     * <p>
+     * The following code illustrates transferring data for a rectangular
+     * region of pixels from
+     * DataBuffer <code>db1</code>, whose storage layout is described by
+     * SampleModel <code>sm1</code>, to DataBuffer <code>db2</code>, whose
+     * storage layout is described by SampleModel <code>sm2</code>.
+     * The transfer will generally be more efficient than using
+     * getPixels/setPixels.
+     * <pre>
+     *       SampleModel sm1, sm2;
+     *       DataBuffer db1, db2;
+     *       sm2.setDataElements(x, y, w, h, sm1.getDataElements(x, y, w, h,
+     *                           null, db1), db2);
+     * </pre>
+     * Using getDataElements/setDataElements to transfer between two
+     * DataBuffer/SampleModel pairs is legitimate if the SampleModels have
+     * the same number of bands, corresponding bands have the same number of
+     * bits per sample, and the TransferTypes are the same.
+     * <p>
+     * obj must be a primitive array of type TransferType.  Otherwise,
+     * a ClassCastException is thrown.  An
+     * ArrayIndexOutOfBoundsException may be thrown if the coordinates are
+     * not in bounds, or if obj is not large enough to hold the pixel data.
+     * @param x         The minimum X coordinate of the pixel rectangle.
+     * @param y         The minimum Y coordinate of the pixel rectangle.
+     * @param w         The width of the pixel rectangle.
+     * @param h         The height of the pixel rectangle.
+     * @param obj       A primitive array containing pixel data.
+     * @param data      The DataBuffer containing the image data.
+     * @see #getNumDataElements
+     * @see #getTransferType
+     * @see #getDataElements(int, int, int, int, Object, DataBuffer)
+     * @see java.awt.image.DataBuffer
+     *
+     * @throws NullPointerException if data is null.
+     * @throws ArrayIndexOutOfBoundsException if the coordinates are
+     * not in bounds, or if obj is too small to hold the input.
+     */
+    public void setDataElements(int x, int y, int w, int h,
+                                Object obj, DataBuffer data) {
+
+        int cnt = 0;
+        Object o = null;
+        int type = getTransferType();
+        int numDataElems = getNumDataElements();
+
+        switch(type) {
+
+        case DataBuffer.TYPE_BYTE:
+
+            byte[] barray = (byte[])obj;
+            byte[] btemp = new byte[numDataElems];
+
+            for (int i=y; i<y+h; i++) {
+                for (int j=x; j<x+w; j++) {
+                    for (int k=0; k<numDataElems; k++) {
+                        btemp[k] = barray[cnt++];
+                    }
+
+                    setDataElements(j, i, btemp, data);
+                }
+            }
+            break;
+
+        case DataBuffer.TYPE_USHORT:
+        case DataBuffer.TYPE_SHORT:
+
+            short[] sarray = (short[])obj;
+            short[] stemp = new short[numDataElems];
+
+            for (int i=y; i<y+h; i++) {
+                for (int j=x; j<x+w; j++) {
+                    for (int k=0; k<numDataElems; k++) {
+                        stemp[k] = sarray[cnt++];
+                    }
+
+                    setDataElements(j, i, stemp, data);
+                }
+            }
+            break;
+
+        case DataBuffer.TYPE_INT:
+
+            int[] iArray = (int[])obj;
+            int[] itemp = new int[numDataElems];
+
+            for (int i=y; i<y+h; i++) {
+                for (int j=x; j<x+w; j++) {
+                    for (int k=0; k<numDataElems; k++) {
+                        itemp[k] = iArray[cnt++];
+                    }
+
+                    setDataElements(j, i, itemp, data);
+                }
+            }
+            break;
+
+        case DataBuffer.TYPE_FLOAT:
+
+            float[] fArray = (float[])obj;
+            float[] ftemp = new float[numDataElems];
+
+            for (int i=y; i<y+h; i++) {
+                for (int j=x; j<x+w; j++) {
+                    for (int k=0; k<numDataElems; k++) {
+                        ftemp[k] = fArray[cnt++];
+                    }
+
+                    setDataElements(j, i, ftemp, data);
+                }
+            }
+            break;
+
+        case DataBuffer.TYPE_DOUBLE:
+
+            double[] dArray = (double[])obj;
+            double[] dtemp = new double[numDataElems];
+
+            for (int i=y; i<y+h; i++) {
+                for (int j=x; j<x+w; j++) {
+                    for (int k=0; k<numDataElems; k++) {
+                        dtemp[k] = dArray[cnt++];
+                    }
+
+                    setDataElements(j, i, dtemp, data);
+                }
+            }
+            break;
+        }
+
+    }
+
+    /**
+     * Returns the samples for the specified pixel in an array of float.
+     * ArrayIndexOutOfBoundsException may be thrown if the coordinates are
+     * not in bounds.
+     * @param x         The X coordinate of the pixel location.
+     * @param y         The Y coordinate of the pixel location.
+     * @param fArray    If non-null, returns the samples in this array.
+     * @param data      The DataBuffer containing the image data.
+     * @return the samples for the specified pixel.
+     * @see #setPixel(int, int, float[], DataBuffer)
+     *
+     * @throws NullPointerException if data is null.
+     * @throws ArrayIndexOutOfBoundsException if the coordinates are
+     * not in bounds, or if fArray is too small to hold the output.
+     */
+    public float[] getPixel(int x, int y, float fArray[],
+                            DataBuffer data) {
+
+        float pixels[];
+
+        if (fArray != null)
+            pixels = fArray;
+        else
+            pixels = new float[numBands];
+
+        for (int i=0; i<numBands; i++)
+            pixels[i] = getSampleFloat(x, y, i, data);
+
+        return pixels;
+    }
+
+    /**
+     * Returns the samples for the specified pixel in an array of double.
+     * ArrayIndexOutOfBoundsException may be thrown if the coordinates are
+     * not in bounds.
+     * @param x         The X coordinate of the pixel location.
+     * @param y         The Y coordinate of the pixel location.
+     * @param dArray    If non-null, returns the samples in this array.
+     * @param data      The DataBuffer containing the image data.
+     * @return the samples for the specified pixel.
+     * @see #setPixel(int, int, double[], DataBuffer)
+     *
+     * @throws NullPointerException if data is null.
+     * @throws ArrayIndexOutOfBoundsException if the coordinates are
+     * not in bounds, or if dArray is too small to hold the output.
+     */
+    public double[] getPixel(int x, int y, double dArray[],
+                             DataBuffer data) {
+
+        double pixels[];
+
+        if(dArray != null)
+            pixels = dArray;
+        else
+            pixels = new double[numBands];
+
+        for (int i=0; i<numBands; i++)
+            pixels[i] = getSampleDouble(x, y, i, data);
+
+        return pixels;
+    }
+
+    /**
+     * Returns all samples for a rectangle of pixels in an
+     * int array, one sample per array element.
+     * ArrayIndexOutOfBoundsException may be thrown if the coordinates are
+     * not in bounds.
+     * @param x         The X coordinate of the upper left pixel location.
+     * @param y         The Y coordinate of the upper left pixel location.
+     * @param w         The width of the pixel rectangle.
+     * @param h         The height of the pixel rectangle.
+     * @param iArray    If non-null, returns the samples in this array.
+     * @param data      The DataBuffer containing the image data.
+     * @return the samples for the specified region of pixels.
+     * @see #setPixels(int, int, int, int, int[], DataBuffer)
+     *
+     * @throws NullPointerException if data is null.
+     * @throws ArrayIndexOutOfBoundsException if the coordinates are
+     * not in bounds, or if iArray is too small to hold the output.
+     */
+    public int[] getPixels(int x, int y, int w, int h,
+                           int iArray[], DataBuffer data) {
+
+        int pixels[];
+        int Offset=0;
+
+        if (iArray != null)
+            pixels = iArray;
+        else
+            pixels = new int[numBands * w * h];
+
+        for (int i=y; i<(h+y); i++) {
+            for (int j=x; j<(w+x); j++) {
+                for(int k=0; k<numBands; k++) {
+                    pixels[Offset++] = getSample(j, i, k, data);
+                }
+            }
+        }
+
+        return pixels;
+    }
+
+    /**
+     * Returns all samples for a rectangle of pixels in a float
+     * array, one sample per array element.
+     * ArrayIndexOutOfBoundsException may be thrown if the coordinates are
+     * not in bounds.
+     * @param x         The X coordinate of the upper left pixel location.
+     * @param y         The Y coordinate of the upper left pixel location.
+     * @param w         The width of the pixel rectangle.
+     * @param h         The height of the pixel rectangle.
+     * @param fArray    If non-null, returns the samples in this array.
+     * @param data      The DataBuffer containing the image data.
+     * @return the samples for the specified region of pixels.
+     * @see #setPixels(int, int, int, int, float[], DataBuffer)
+     *
+     * @throws NullPointerException if data is null.
+     * @throws ArrayIndexOutOfBoundsException if the coordinates are
+     * not in bounds, or if fArray is too small to hold the output.
+     */
+    public float[] getPixels(int x, int y, int w, int h,
+                             float fArray[], DataBuffer data) {
+
+        float pixels[];
+        int Offset = 0;
+
+        if (fArray != null)
+            pixels = fArray;
+        else
+            pixels = new float[numBands * w * h];
+
+        for (int i=y; i<(h+y); i++) {
+            for(int j=x; j<(w+x); j++) {
+                for(int k=0; k<numBands; k++) {
+                    pixels[Offset++] = getSampleFloat(j, i, k, data);
+                }
+            }
+        }
+
+        return pixels;
+    }
+
+    /**
+     * Returns all samples for a rectangle of pixels in a double
+     * array, one sample per array element.
+     * ArrayIndexOutOfBoundsException may be thrown if the coordinates are
+     * not in bounds.
+     * @param x         The X coordinate of the upper left pixel location.
+     * @param y         The Y coordinate of the upper left pixel location.
+     * @param w         The width of the pixel rectangle.
+     * @param h         The height of the pixel rectangle.
+     * @param dArray    If non-null, returns the samples in this array.
+     * @param data      The DataBuffer containing the image data.
+     * @return the samples for the specified region of pixels.
+     * @see #setPixels(int, int, int, int, double[], DataBuffer)
+     *
+     * @throws NullPointerException if data is null.
+     * @throws ArrayIndexOutOfBoundsException if the coordinates are
+     * not in bounds, or if dArray is too small to hold the output.
+     */
+    public double[] getPixels(int x, int y, int w, int h,
+                              double dArray[], DataBuffer data) {
+        double pixels[];
+        int    Offset = 0;
+
+        if (dArray != null)
+            pixels = dArray;
+        else
+            pixels = new double[numBands * w * h];
+
+        // Fix 4217412
+        for (int i=y; i<(h+y); i++) {
+            for (int j=x; j<(w+x); j++) {
+                for (int k=0; k<numBands; k++) {
+                    pixels[Offset++] = getSampleDouble(j, i, k, data);
+                }
+            }
+        }
+
+        return pixels;
+    }
+
+
+    /**
+     * Returns the sample in a specified band for the pixel located
+     * at (x,y) as an int.
+     * ArrayIndexOutOfBoundsException may be thrown if the coordinates are
+     * not in bounds.
+     * @param x         The X coordinate of the pixel location.
+     * @param y         The Y coordinate of the pixel location.
+     * @param b         The band to return.
+     * @param data      The DataBuffer containing the image data.
+     * @return the sample in a specified band for the specified pixel.
+     * @see #setSample(int, int, int, int, DataBuffer)
+     *
+     * @throws NullPointerException if data is null.
+     * @throws ArrayIndexOutOfBoundsException if the coordinates or
+     * the band index are not in bounds.
+     */
+    public abstract int getSample(int x, int y, int b, DataBuffer data);
+
+
+    /**
+     * Returns the sample in a specified band
+     * for the pixel located at (x,y) as a float.
+     * ArrayIndexOutOfBoundsException may be thrown if the coordinates are
+     * not in bounds.
+     * @param x         The X coordinate of the pixel location.
+     * @param y         The Y coordinate of the pixel location.
+     * @param b         The band to return.
+     * @param data      The DataBuffer containing the image data.
+     * @return the sample in a specified band for the specified pixel.
+     *
+     * @throws NullPointerException if data is null.
+     * @throws ArrayIndexOutOfBoundsException if the coordinates or
+     * the band index are not in bounds.
+     */
+    public float getSampleFloat(int x, int y, int b, DataBuffer data) {
+
+        float sample;
+        sample = (float) getSample(x, y, b, data);
+        return sample;
+    }
+
+    /**
+     * Returns the sample in a specified band
+     * for a pixel located at (x,y) as a double.
+     * ArrayIndexOutOfBoundsException may be thrown if the coordinates are
+     * not in bounds.
+     * @param x         The X coordinate of the pixel location.
+     * @param y         The Y coordinate of the pixel location.
+     * @param b         The band to return.
+     * @param data      The DataBuffer containing the image data.
+     * @return the sample in a specified band for the specified pixel.
+     *
+     * @throws NullPointerException if data is null.
+     * @throws ArrayIndexOutOfBoundsException if the coordinates or
+     * the band index are not in bounds.
+     */
+    public double getSampleDouble(int x, int y, int b, DataBuffer data) {
+
+        double sample;
+
+        sample = (double) getSample(x, y, b, data);
+        return sample;
+    }
+
+    /**
+     * Returns the samples for a specified band for the specified rectangle
+     * of pixels in an int array, one sample per array element.
+     * ArrayIndexOutOfBoundsException may be thrown if the coordinates are
+     * not in bounds.
+     * @param x         The X coordinate of the upper left pixel location.
+     * @param y         The Y coordinate of the upper left pixel location.
+     * @param w         The width of the pixel rectangle.
+     * @param h         The height of the pixel rectangle.
+     * @param b         The band to return.
+     * @param iArray    If non-null, returns the samples in this array.
+     * @param data      The DataBuffer containing the image data.
+     * @return the samples for the specified band for the specified region
+     *         of pixels.
+     * @see #setSamples(int, int, int, int, int, int[], DataBuffer)
+     *
+     * @throws NullPointerException if data is null.
+     * @throws ArrayIndexOutOfBoundsException if the coordinates or
+     * the band index are not in bounds, or if iArray is too small to
+     * hold the output.
+     */
+    public int[] getSamples(int x, int y, int w, int h, int b,
+                            int iArray[], DataBuffer data) {
+        int pixels[];
+        int Offset=0;
+
+        if (iArray != null)
+            pixels = iArray;
+        else
+            pixels = new int[w * h];
+
+        for(int i=y; i<(h+y); i++) {
+            for (int j=x; j<(w+x); j++) {
+                pixels[Offset++] = getSample(j, i, b, data);
+            }
+        }
+
+        return pixels;
+    }
+
+    /**
+     * Returns the samples for a specified band for the specified rectangle
+     * of pixels in a float array, one sample per array element.
+     * ArrayIndexOutOfBoundsException may be thrown if the coordinates are
+     * not in bounds.
+     * @param x         The X coordinate of the upper left pixel location.
+     * @param y         The Y coordinate of the upper left pixel location.
+     * @param w         The width of the pixel rectangle.
+     * @param h         The height of the pixel rectangle.
+     * @param b         The band to return.
+     * @param fArray    If non-null, returns the samples in this array.
+     * @param data      The DataBuffer containing the image data.
+     * @return the samples for the specified band for the specified region
+     *         of pixels.
+     * @see #setSamples(int, int, int, int, int, float[], DataBuffer)
+     *
+     * @throws NullPointerException if data is null.
+     * @throws ArrayIndexOutOfBoundsException if the coordinates or
+     * the band index are not in bounds, or if fArray is too small to
+     * hold the output.
+     */
+    public float[] getSamples(int x, int y, int w, int h,
+                              int b, float fArray[],
+                              DataBuffer data) {
+        float pixels[];
+        int   Offset=0;
+
+        if (fArray != null)
+            pixels = fArray;
+        else
+            pixels = new float[w * h];
+
+        for (int i=y; i<(h+y); i++) {
+            for (int j=x; j<(w+x); j++) {
+                pixels[Offset++] = getSampleFloat(j, i, b, data);
+            }
+        }
+
+        return pixels;
+    }
+
+    /**
+     * Returns the samples for a specified band for a specified rectangle
+     * of pixels in a double array, one sample per array element.
+     * ArrayIndexOutOfBoundsException may be thrown if the coordinates are
+     * not in bounds.
+     * @param x         The X coordinate of the upper left pixel location.
+     * @param y         The Y coordinate of the upper left pixel location.
+     * @param w         The width of the pixel rectangle.
+     * @param h         The height of the pixel rectangle.
+     * @param b         The band to return.
+     * @param dArray    If non-null, returns the samples in this array.
+     * @param data      The DataBuffer containing the image data.
+     * @return the samples for the specified band for the specified region
+     *         of pixels.
+     * @see #setSamples(int, int, int, int, int, double[], DataBuffer)
+     *
+     * @throws NullPointerException if data is null.
+     * @throws ArrayIndexOutOfBoundsException if the coordinates or
+     * the band index are not in bounds, or if dArray is too small to
+     * hold the output.
+     */
+    public double[] getSamples(int x, int y, int w, int h,
+                               int b, double dArray[],
+                               DataBuffer data) {
+        double pixels[];
+        int    Offset=0;
+
+        if (dArray != null)
+            pixels = dArray;
+        else
+            pixels = new double[w * h];
+
+        for (int i=y; i<(y+h); i++) {
+            for (int j=x; j<(x+w); j++) {
+                pixels[Offset++] = getSampleDouble(j, i, b, data);
+            }
+        }
+
+        return pixels;
+    }
+
+    /**
+     * Sets a pixel in  the DataBuffer using an int array of samples for input.
+     * ArrayIndexOutOfBoundsException may be thrown if the coordinates are
+     * not in bounds.
+     * @param x         The X coordinate of the pixel location.
+     * @param y         The Y coordinate of the pixel location.
+     * @param iArray    The input samples in an int array.
+     * @param data      The DataBuffer containing the image data.
+     * @see #getPixel(int, int, int[], DataBuffer)
+     *
+     * @throws NullPointerException if iArray or data is null.
+     * @throws ArrayIndexOutOfBoundsException if the coordinates are
+     * not in bounds, or if iArray is too small to hold the input.
+     */
+    public void setPixel(int x, int y, int iArray[], DataBuffer data) {
+
+        for (int i=0; i<numBands; i++)
+            setSample(x, y, i, iArray[i], data);
+    }
+
+    /**
+     * Sets a pixel in the DataBuffer using a float array of samples for input.
+     * ArrayIndexOutOfBoundsException may be thrown if the coordinates are
+     * not in bounds.
+     * @param x         The X coordinate of the pixel location.
+     * @param y         The Y coordinate of the pixel location.
+     * @param fArray    The input samples in a float array.
+     * @param data      The DataBuffer containing the image data.
+     * @see #getPixel(int, int, float[], DataBuffer)
+     *
+     * @throws NullPointerException if fArray or data is null.
+     * @throws ArrayIndexOutOfBoundsException if the coordinates are
+     * not in bounds, or if fArray is too small to hold the input.
+     */
+    public void setPixel(int x, int y, float fArray[], DataBuffer data) {
+
+        for (int i=0; i<numBands; i++)
+            setSample(x, y, i, fArray[i], data);
+    }
+
+    /**
+     * Sets a pixel in the DataBuffer using a double array of samples
+     * for input.
+     * @param x         The X coordinate of the pixel location.
+     * @param y         The Y coordinate of the pixel location.
+     * @param dArray    The input samples in a double array.
+     * @param data      The DataBuffer containing the image data.
+     * @see #getPixel(int, int, double[], DataBuffer)
+     *
+     * @throws NullPointerException if dArray or data is null.
+     * @throws ArrayIndexOutOfBoundsException if the coordinates are
+     * not in bounds, or if fArray is too small to hold the input.
+     */
+    public void setPixel(int x, int y, double dArray[], DataBuffer data) {
+
+        for (int i=0; i<numBands; i++)
+            setSample(x, y, i, dArray[i], data);
+    }
+
+    /**
+     * Sets all samples for a rectangle of pixels from an int array containing
+     * one sample per array element.
+     * ArrayIndexOutOfBoundsException may be thrown if the coordinates are
+     * not in bounds.
+     * @param x         The X coordinate of the upper left pixel location.
+     * @param y         The Y coordinate of the upper left pixel location.
+     * @param w         The width of the pixel rectangle.
+     * @param h         The height of the pixel rectangle.
+     * @param iArray    The input samples in an int array.
+     * @param data      The DataBuffer containing the image data.
+     * @see #getPixels(int, int, int, int, int[], DataBuffer)
+     *
+     * @throws NullPointerException if iArray or data is null.
+     * @throws ArrayIndexOutOfBoundsException if the coordinates are
+     * not in bounds, or if iArray is too small to hold the input.
+     */
+    public void setPixels(int x, int y, int w, int h,
+                          int iArray[], DataBuffer data) {
+        int Offset=0;
+
+        for (int i=y; i<(y+h); i++) {
+            for (int j=x; j<(x+w); j++) {
+                for (int k=0; k<numBands; k++) {
+                    setSample(j, i, k, iArray[Offset++], data);
+                }
+            }
+        }
+    }
+
+    /**
+     * Sets all samples for a rectangle of pixels from a float array containing
+     * one sample per array element.
+     * ArrayIndexOutOfBoundsException may be thrown if the coordinates are
+     * not in bounds.
+     * @param x         The X coordinate of the upper left pixel location.
+     * @param y         The Y coordinate of the upper left pixel location.
+     * @param w         The width of the pixel rectangle.
+     * @param h         The height of the pixel rectangle.
+     * @param fArray    The input samples in a float array.
+     * @param data      The DataBuffer containing the image data.
+     * @see #getPixels(int, int, int, int, float[], DataBuffer)
+     *
+     * @throws NullPointerException if fArray or data is null.
+     * @throws ArrayIndexOutOfBoundsException if the coordinates are
+     * not in bounds, or if fArray is too small to hold the input.
+     */
+    public void setPixels(int x, int y, int w, int h,
+                          float fArray[], DataBuffer data) {
+        int Offset=0;
+
+        for (int i=y; i<(y+h); i++) {
+            for (int j=x; j<(x+w); j++) {
+                for(int k=0; k<numBands; k++) {
+                    setSample(j, i, k, fArray[Offset++], data);
+                }
+            }
+        }
+    }
+
+    /**
+     * Sets all samples for a rectangle of pixels from a double array
+     * containing one sample per array element.
+     * ArrayIndexOutOfBoundsException may be thrown if the coordinates are
+     * not in bounds.
+     * @param x         The X coordinate of the upper left pixel location.
+     * @param y         The Y coordinate of the upper left pixel location.
+     * @param w         The width of the pixel rectangle.
+     * @param h         The height of the pixel rectangle.
+     * @param dArray    The input samples in a double array.
+     * @param data      The DataBuffer containing the image data.
+     * @see #getPixels(int, int, int, int, double[], DataBuffer)
+     *
+     * @throws NullPointerException if dArray or data is null.
+     * @throws ArrayIndexOutOfBoundsException if the coordinates are
+     * not in bounds, or if dArray is too small to hold the input.
+     */
+    public void setPixels(int x, int y, int w, int h,
+                          double dArray[], DataBuffer data) {
+        int Offset=0;
+
+        for (int i=y; i<(y+h); i++) {
+            for (int j=x; j<(x+w); j++) {
+                for (int k=0; k<numBands; k++) {
+                    setSample(j, i, k, dArray[Offset++], data);
+                }
+            }
+        }
+    }
+
+    /**
+     * Sets a sample in the specified band for the pixel located at (x,y)
+     * in the DataBuffer using an int for input.
+     * ArrayIndexOutOfBoundsException may be thrown if the coordinates are
+     * not in bounds.
+     * @param x         The X coordinate of the pixel location.
+     * @param y         The Y coordinate of the pixel location.
+     * @param b         The band to set.
+     * @param s         The input sample as an int.
+     * @param data      The DataBuffer containing the image data.
+     * @see #getSample(int, int, int,  DataBuffer)
+     *
+     * @throws NullPointerException if data is null.
+     * @throws ArrayIndexOutOfBoundsException if the coordinates or
+     * the band index are not in bounds.
+     */
+    public abstract void setSample(int x, int y, int b,
+                                   int s,
+                                   DataBuffer data);
+
+    /**
+     * Sets a sample in the specified band for the pixel located at (x,y)
+     * in the DataBuffer using a float for input.
+     * The default implementation of this method casts the input
+     * float sample to an int and then calls the
+     * <code>setSample(int, int, int, DataBuffer)</code> method using
+     * that int value.
+     * ArrayIndexOutOfBoundsException may be thrown if the coordinates are
+     * not in bounds.
+     * @param x         The X coordinate of the pixel location.
+     * @param y         The Y coordinate of the pixel location.
+     * @param b         The band to set.
+     * @param s         The input sample as a float.
+     * @param data      The DataBuffer containing the image data.
+     * @see #getSample(int, int, int, DataBuffer)
+     *
+     * @throws NullPointerException if data is null.
+     * @throws ArrayIndexOutOfBoundsException if the coordinates or
+     * the band index are not in bounds.
+     */
+    public void setSample(int x, int y, int b,
+                          float s ,
+                          DataBuffer data) {
+        int sample = (int)s;
+
+        setSample(x, y, b, sample, data);
+    }
+
+    /**
+     * Sets a sample in the specified band for the pixel located at (x,y)
+     * in the DataBuffer using a double for input.
+     * The default implementation of this method casts the input
+     * double sample to an int and then calls the
+     * <code>setSample(int, int, int, DataBuffer)</code> method using
+     * that int value.
+     * ArrayIndexOutOfBoundsException may be thrown if the coordinates are
+     * not in bounds.
+     * @param x         The X coordinate of the pixel location.
+     * @param y         The Y coordinate of the pixel location.
+     * @param b         The band to set.
+     * @param s         The input sample as a double.
+     * @param data      The DataBuffer containing the image data.
+     * @see #getSample(int, int, int, DataBuffer)
+     *
+     * @throws NullPointerException if data is null.
+     * @throws ArrayIndexOutOfBoundsException if the coordinates or
+     * the band index are not in bounds.
+     */
+    public void setSample(int x, int y, int b,
+                          double s,
+                          DataBuffer data) {
+        int sample = (int)s;
+
+        setSample(x, y, b, sample, data);
+    }
+
+    /**
+     * Sets the samples in the specified band for the specified rectangle
+     * of pixels from an int array containing one sample per array element.
+     * ArrayIndexOutOfBoundsException may be thrown if the coordinates are
+     * not in bounds.
+     * @param x         The X coordinate of the upper left pixel location.
+     * @param y         The Y coordinate of the upper left pixel location.
+     * @param w         The width of the pixel rectangle.
+     * @param h         The height of the pixel rectangle.
+     * @param b         The band to set.
+     * @param iArray    The input samples in an int array.
+     * @param data      The DataBuffer containing the image data.
+     * @see #getSamples(int, int, int, int, int, int[], DataBuffer)
+     *
+     * @throws NullPointerException if iArray or data is null.
+     * @throws ArrayIndexOutOfBoundsException if the coordinates or
+     * the band index are not in bounds, or if iArray is too small to
+     * hold the input.
+     */
+    public void setSamples(int x, int y, int w, int h, int b,
+                           int iArray[], DataBuffer data) {
+
+        int Offset=0;
+
+        for (int i=y; i<(y+h); i++) {
+            for (int j=x; j<(x+w); j++) {
+                setSample(j, i, b, iArray[Offset++], data);
+            }
+        }
+    }
+
+    /**
+     * Sets the samples in the specified band for the specified rectangle
+     * of pixels from a float array containing one sample per array element.
+     * ArrayIndexOutOfBoundsException may be thrown if the coordinates are
+     * not in bounds.
+     * @param x         The X coordinate of the upper left pixel location.
+     * @param y         The Y coordinate of the upper left pixel location.
+     * @param w         The width of the pixel rectangle.
+     * @param h         The height of the pixel rectangle.
+     * @param b         The band to set.
+     * @param fArray    The input samples in a float array.
+     * @param data      The DataBuffer containing the image data.
+     * @see #getSamples(int, int, int, int, int, float[], DataBuffer)
+     *
+     * @throws NullPointerException if fArray or data is null.
+     * @throws ArrayIndexOutOfBoundsException if the coordinates or
+     * the band index are not in bounds, or if fArray is too small to
+     * hold the input.
+     */
+    public void setSamples(int x, int y, int w, int h, int b,
+                           float fArray[], DataBuffer data) {
+        int Offset=0;
+
+        for (int i=y; i<(y+h); i++) {
+            for (int j=x; j<(x+w); j++) {
+                setSample(j, i, b, fArray[Offset++], data);
+            }
+        }
+    }
+
+    /**
+     * Sets the samples in the specified band for the specified rectangle
+     * of pixels from a double array containing one sample per array element.
+     * ArrayIndexOutOfBoundsException may be thrown if the coordinates are
+     * not in bounds.
+     * @param x         The X coordinate of the upper left pixel location.
+     * @param y         The Y coordinate of the upper left pixel location.
+     * @param w         The width of the pixel rectangle.
+     * @param h         The height of the pixel rectangle.
+     * @param b         The band to set.
+     * @param dArray    The input samples in a double array.
+     * @param data      The DataBuffer containing the image data.
+     * @see #getSamples(int, int, int, int, int, double[], DataBuffer)
+     *
+     * @throws NullPointerException if dArray or data is null.
+     * @throws ArrayIndexOutOfBoundsException if the coordinates or
+     * the band index are not in bounds, or if dArray is too small to
+     * hold the input.
+     */
+    public void setSamples(int x, int y, int w, int h, int b,
+                           double dArray[], DataBuffer data) {
+        int Offset=0;
+
+        for (int i=y; i<(y+h); i++) {
+            for (int j=x; j<(x+w); j++) {
+                setSample(j, i, b, dArray[Offset++], data);
+            }
+        }
+    }
+
+    /**
+     *  Creates a SampleModel which describes data in this SampleModel's
+     *  format, but with a different width and height.
+     *  @param w the width of the image data
+     *  @param h the height of the image data
+     *  @return a <code>SampleModel</code> describing the same image
+     *          data as this <code>SampleModel</code>, but with a
+     *          different size.
+     */
+    public abstract SampleModel createCompatibleSampleModel(int w, int h);
+
+    /**
+     * Creates a new SampleModel
+     * with a subset of the bands of this
+     * SampleModel.
+     * @param bands the subset of bands of this <code>SampleModel</code>
+     * @return a <code>SampleModel</code> with a subset of bands of this
+     *         <code>SampleModel</code>.
+     */
+    public abstract SampleModel createSubsetSampleModel(int bands[]);
+
+    /**
+     * Creates a DataBuffer that corresponds to this SampleModel.
+     * The DataBuffer's width and height will match this SampleModel's.
+     * @return a <code>DataBuffer</code> corresponding to this
+     *         <code>SampleModel</code>.
+     */
+    public abstract DataBuffer createDataBuffer();
+
+    /** Returns the size in bits of samples for all bands.
+     *  @return the size of samples for all bands.
+     */
+    public abstract int[] getSampleSize();
+
+    /** Returns the size in bits of samples for the specified band.
+     *  @param band the specified band
+     *  @return the size of the samples of the specified band.
+     */
+    public abstract int getSampleSize(int band);
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/classes/java/awt/image/SinglePixelPackedSampleModel.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,805 @@
+/*
+ * Portions Copyright 1997-2001 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) Eastman Kodak Company, 1997
+ *** As  an unpublished  work pursuant to Title 17 of the United
+ *** States Code.  All rights reserved.
+ ******************************************************************
+ ******************************************************************
+ ******************************************************************/
+
+package java.awt.image;
+
+import java.util.Arrays;
+
+/**
+ *  This class represents pixel data packed such that the N samples which make
+ *  up a single pixel are stored in a single data array element, and each data
+ *  data array element holds samples for only one pixel.
+ *  This class supports
+ *  {@link DataBuffer#TYPE_BYTE TYPE_BYTE},
+ *  {@link DataBuffer#TYPE_USHORT TYPE_USHORT},
+ *  {@link DataBuffer#TYPE_INT TYPE_INT} data types.
+ *  All data array elements reside
+ *  in the first bank of a DataBuffer.  Accessor methods are provided so
+ *  that the image data can be manipulated directly. Scanline stride is the
+ *  number of data array elements between a given sample and the corresponding
+ *  sample in the same column of the next scanline. Bit masks are the masks
+ *  required to extract the samples representing the bands of the pixel.
+ *  Bit offsets are the offsets in bits into the data array
+ *  element of the samples representing the bands of the pixel.
+ * <p>
+ * The following code illustrates extracting the bits of the sample
+ * representing band <code>b</code> for pixel <code>x,y</code>
+ * from DataBuffer <code>data</code>:
+ * <pre>
+ *      int sample = data.getElem(y * scanlineStride + x);
+ *      sample = (sample & bitMasks[b]) >>> bitOffsets[b];
+ * </pre>
+ */
+
+public class SinglePixelPackedSampleModel extends SampleModel
+{
+    /** Bit masks for all bands of the image data. */
+    private int bitMasks[];
+
+    /** Bit Offsets for all bands of the image data. */
+    private int bitOffsets[];
+
+    /** Bit sizes for all the bands of the image data. */
+    private int bitSizes[];
+
+    /** Maximum bit size. */
+    private int maxBitSize;
+
+    /** Line stride of the region of image data described by this
+     *  SinglePixelPackedSampleModel.
+     */
+    private int scanlineStride;
+
+    private static native void initIDs();
+    static {
+        ColorModel.loadLibraries();
+        initIDs();
+    }
+
+    /**
+     * Constructs a SinglePixelPackedSampleModel with bitMasks.length bands.
+     * Each sample is stored in a data array element in the position of
+     * its corresponding bit mask.  Each bit mask must be contiguous and
+     * masks must not overlap.
+     * @param dataType  The data type for storing samples.
+     * @param w         The width (in pixels) of the region of the
+     *                  image data described.
+     * @param h         The height (in pixels) of the region of the
+     *                  image data described.
+     * @param bitMasks  The bit masks for all bands.
+     * @throws IllegalArgumentException if <code>dataType</code> is not
+     *         either <code>DataBuffer.TYPE_BYTE</code>,
+     *         <code>DataBuffer.TYPE_USHORT</code>, or
+     *         <code>DataBuffer.TYPE_INT</code>
+     */
+    public SinglePixelPackedSampleModel(int dataType, int w, int h,
+                                   int bitMasks[]) {
+        this(dataType, w, h, w, bitMasks);
+        if (dataType != DataBuffer.TYPE_BYTE &&
+            dataType != DataBuffer.TYPE_USHORT &&
+            dataType != DataBuffer.TYPE_INT) {
+            throw new IllegalArgumentException("Unsupported data type "+
+                                               dataType);
+        }
+    }
+
+    /**
+     * Constructs a SinglePixelPackedSampleModel with bitMasks.length bands
+     * and a scanline stride equal to scanlineStride data array elements.
+     * Each sample is stored in a data array element in the position of
+     * its corresponding bit mask.  Each bit mask must be contiguous and
+     * masks must not overlap.
+     * @param dataType  The data type for storing samples.
+     * @param w         The width (in pixels) of the region of
+     *                  image data described.
+     * @param h         The height (in pixels) of the region of
+     *                  image data described.
+     * @param scanlineStride The line stride of the image data.
+     * @param bitMasks The bit masks for all bands.
+     * @throws IllegalArgumentException if <code>w</code> or
+     *         <code>h</code> is not greater than 0
+     * @throws IllegalArgumentException if any mask in
+     *         <code>bitMask</code> is not contiguous
+     * @throws IllegalArgumentException if <code>dataType</code> is not
+     *         either <code>DataBuffer.TYPE_BYTE</code>,
+     *         <code>DataBuffer.TYPE_USHORT</code>, or
+     *         <code>DataBuffer.TYPE_INT</code>
+     */
+    public SinglePixelPackedSampleModel(int dataType, int w, int h,
+                                   int scanlineStride, int bitMasks[]) {
+        super(dataType, w, h, bitMasks.length);
+        if (dataType != DataBuffer.TYPE_BYTE &&
+            dataType != DataBuffer.TYPE_USHORT &&
+            dataType != DataBuffer.TYPE_INT) {
+            throw new IllegalArgumentException("Unsupported data type "+
+                                               dataType);
+        }
+        this.dataType = dataType;
+        this.bitMasks = (int[]) bitMasks.clone();
+        this.scanlineStride = scanlineStride;
+
+        this.bitOffsets = new int[numBands];
+        this.bitSizes = new int[numBands];
+
+        this.maxBitSize = 0;
+        for (int i=0; i<numBands; i++) {
+            int bitOffset = 0, bitSize = 0, mask;
+            mask = bitMasks[i];
+
+            if (mask != 0) {
+                while ((mask & 1) == 0) {
+                    mask = mask >>> 1;
+                    bitOffset++;
+                }
+                while ((mask & 1) == 1) {
+                    mask = mask >>> 1;
+                    bitSize++;
+                }
+                if (mask != 0) {
+                    throw new IllegalArgumentException("Mask "+bitMasks[i]+
+                                                       " must be contiguous");
+                }
+            }
+            bitOffsets[i] = bitOffset;
+            bitSizes[i] = bitSize;
+            if (bitSize > maxBitSize) {
+                maxBitSize = bitSize;
+            }
+        }
+    }
+
+    /**
+     * Returns the number of data elements needed to transfer one pixel
+     * via the getDataElements and setDataElements methods.
+     * For a SinglePixelPackedSampleModel, this is one.
+     */
+    public int getNumDataElements() {
+        return 1;
+    }
+
+    /**
+     * Returns the size of the buffer (in data array elements)
+     * needed for a data buffer that matches this
+     * SinglePixelPackedSampleModel.
+     */
+    private long getBufferSize() {
+      long size = scanlineStride * (height-1) + width;
+      return size;
+    }
+
+    /**
+     * Creates a new SinglePixelPackedSampleModel with the specified
+     * width and height.  The new SinglePixelPackedSampleModel will have the
+     * same storage data type and bit masks as this
+     * SinglePixelPackedSampleModel.
+     * @param w the width of the resulting <code>SampleModel</code>
+     * @param h the height of the resulting <code>SampleModel</code>
+     * @return a <code>SinglePixelPackedSampleModel</code> with the
+     *         specified width and height.
+     * @throws IllegalArgumentException if <code>w</code> or
+     *         <code>h</code> is not greater than 0
+     */
+    public SampleModel createCompatibleSampleModel(int w, int h) {
+      SampleModel sampleModel = new SinglePixelPackedSampleModel(dataType, w, h,
+                                                              bitMasks);
+      return sampleModel;
+    }
+
+    /**
+     * Creates a DataBuffer that corresponds to this
+     * SinglePixelPackedSampleModel.  The DataBuffer's data type and size
+     * will be consistent with this SinglePixelPackedSampleModel.  The
+     * DataBuffer will have a single bank.
+     */
+    public DataBuffer createDataBuffer() {
+        DataBuffer dataBuffer = null;
+
+        int size = (int)getBufferSize();
+        switch (dataType) {
+        case DataBuffer.TYPE_BYTE:
+            dataBuffer = new DataBufferByte(size);
+            break;
+        case DataBuffer.TYPE_USHORT:
+            dataBuffer = new DataBufferUShort(size);
+            break;
+        case DataBuffer.TYPE_INT:
+            dataBuffer = new DataBufferInt(size);
+            break;
+        }
+        return dataBuffer;
+    }
+
+    /** Returns the number of bits per sample for all bands. */
+    public int[] getSampleSize() {
+        int mask;
+        int sampleSize[] = new int [numBands];
+        for (int i=0; i<numBands; i++) {
+            sampleSize[i] = 0;
+            mask = bitMasks[i] >>> bitOffsets[i];
+            while ((mask & 1) != 0) {
+                sampleSize[i] ++;
+                mask = mask >>> 1;
+            }
+        }
+
+        return sampleSize;
+    }
+
+    /** Returns the number of bits per sample for the specified band. */
+    public int getSampleSize(int band) {
+        int sampleSize = 0;
+        int mask = bitMasks[band] >>> bitOffsets[band];
+        while ((mask & 1) != 0) {
+            sampleSize ++;
+            mask = mask >>> 1;
+        }
+
+        return sampleSize;
+    }
+
+    /** Returns the offset (in data array elements) of pixel (x,y).
+     *  The data element containing pixel <code>x,y</code>
+     *  can be retrieved from a DataBuffer <code>data</code> with a
+     *  SinglePixelPackedSampleModel <code>sppsm</code> as:
+     * <pre>
+     *        data.getElem(sppsm.getOffset(x, y));
+     * </pre>
+     * @param x the X coordinate of the specified pixel
+     * @param y the Y coordinate of the specified pixel
+     * @return the offset of the specified pixel.
+     */
+    public int getOffset(int x, int y) {
+        int offset = y * scanlineStride + x;
+        return offset;
+    }
+
+    /** Returns the bit offsets into the data array element representing
+     *  a pixel for all bands.
+     *  @return the bit offsets representing a pixel for all bands.
+     */
+    public int [] getBitOffsets() {
+      return (int[])bitOffsets.clone();
+    }
+
+    /** Returns the bit masks for all bands.
+     *  @return the bit masks for all bands.
+     */
+    public int [] getBitMasks() {
+      return (int[])bitMasks.clone();
+    }
+
+    /** Returns the scanline stride of this SinglePixelPackedSampleModel.
+     *  @return the scanline stride of this
+     *          <code>SinglePixelPackedSampleModel</code>.
+     */
+    public int getScanlineStride() {
+      return scanlineStride;
+    }
+
+    /**
+     * This creates a new SinglePixelPackedSampleModel with a subset of the
+     * bands of this SinglePixelPackedSampleModel.  The new
+     * SinglePixelPackedSampleModel can be used with any DataBuffer that the
+     * existing SinglePixelPackedSampleModel can be used with.  The new
+     * SinglePixelPackedSampleModel/DataBuffer combination will represent
+     * an image with a subset of the bands of the original
+     * SinglePixelPackedSampleModel/DataBuffer combination.
+     * @exception RasterFormatException if the length of the bands argument is
+     *                                  greater than the number of bands in
+     *                                  the sample model.
+     */
+    public SampleModel createSubsetSampleModel(int bands[]) {
+        if (bands.length > numBands)
+            throw new RasterFormatException("There are only " +
+                                            numBands +
+                                            " bands");
+        int newBitMasks[] = new int[bands.length];
+        for (int i=0; i<bands.length; i++)
+            newBitMasks[i] = bitMasks[bands[i]];
+
+        return new SinglePixelPackedSampleModel(this.dataType, width, height,
+                                           this.scanlineStride, newBitMasks);
+    }
+
+    /**
+     * Returns data for a single pixel in a primitive array of type
+     * TransferType.  For a SinglePixelPackedSampleModel, the array will
+     * have one element, and the type will be the same as the storage
+     * data type.  Generally, obj
+     * should be passed in as null, so that the Object will be created
+     * automatically and will be of the right primitive data type.
+     * <p>
+     * The following code illustrates transferring data for one pixel from
+     * DataBuffer <code>db1</code>, whose storage layout is described by
+     * SinglePixelPackedSampleModel <code>sppsm1</code>, to
+     * DataBuffer <code>db2</code>, whose storage layout is described by
+     * SinglePixelPackedSampleModel <code>sppsm2</code>.
+     * The transfer will generally be more efficient than using
+     * getPixel/setPixel.
+     * <pre>
+     *       SinglePixelPackedSampleModel sppsm1, sppsm2;
+     *       DataBufferInt db1, db2;
+     *       sppsm2.setDataElements(x, y, sppsm1.getDataElements(x, y, null,
+     *                              db1), db2);
+     * </pre>
+     * Using getDataElements/setDataElements to transfer between two
+     * DataBuffer/SampleModel pairs is legitimate if the SampleModels have
+     * the same number of bands, corresponding bands have the same number of
+     * bits per sample, and the TransferTypes are the same.
+     * <p>
+     * If obj is non-null, it should be a primitive array of type TransferType.
+     * Otherwise, a ClassCastException is thrown.  An
+     * ArrayIndexOutOfBoundsException may be thrown if the coordinates are
+     * not in bounds, or if obj is non-null and is not large enough to hold
+     * the pixel data.
+     * @param x         The X coordinate of the pixel location.
+     * @param y         The Y coordinate of the pixel location.
+     * @param obj       If non-null, a primitive array in which to return
+     *                  the pixel data.
+     * @param data      The DataBuffer containing the image data.
+     * @return the data for the specified pixel.
+     * @see #setDataElements(int, int, Object, DataBuffer)
+     */
+    public Object getDataElements(int x, int y, Object obj, DataBuffer data) {
+        // Bounds check for 'b' will be performed automatically
+        if ((x < 0) || (y < 0) || (x >= width) || (y >= height)) {
+            throw new ArrayIndexOutOfBoundsException
+                ("Coordinate out of bounds!");
+        }
+
+        int type = getTransferType();
+
+        switch(type) {
+
+        case DataBuffer.TYPE_BYTE:
+
+            byte[] bdata;
+
+            if (obj == null)
+                bdata = new byte[1];
+            else
+                bdata = (byte[])obj;
+
+            bdata[0] = (byte)data.getElem(y * scanlineStride + x);
+
+            obj = (Object)bdata;
+            break;
+
+        case DataBuffer.TYPE_USHORT:
+
+            short[] sdata;
+
+            if (obj == null)
+                sdata = new short[1];
+            else
+                sdata = (short[])obj;
+
+            sdata[0] = (short)data.getElem(y * scanlineStride + x);
+
+            obj = (Object)sdata;
+            break;
+
+        case DataBuffer.TYPE_INT:
+
+            int[] idata;
+
+            if (obj == null)
+                idata = new int[1];
+            else
+                idata = (int[])obj;
+
+            idata[0] = data.getElem(y * scanlineStride + x);
+
+            obj = (Object)idata;
+            break;
+        }
+
+        return obj;
+    }
+
+    /**
+     * Returns all samples in for the specified pixel in an int array.
+     * ArrayIndexOutOfBoundsException may be thrown if the coordinates are
+     * not in bounds.
+     * @param x         The X coordinate of the pixel location.
+     * @param y         The Y coordinate of the pixel location.
+     * @param iArray    If non-null, returns the samples in this array
+     * @param data      The DataBuffer containing the image data.
+     * @return all samples for the specified pixel.
+     * @see #setPixel(int, int, int[], DataBuffer)
+     */
+    public int [] getPixel(int x, int y, int iArray[], DataBuffer data) {
+        if ((x < 0) || (y < 0) || (x >= width) || (y >= height)) {
+            throw new ArrayIndexOutOfBoundsException
+                ("Coordinate out of bounds!");
+        }
+        int pixels[];
+        if (iArray == null) {
+            pixels = new int [numBands];
+        } else {
+            pixels = iArray;
+        }
+
+        int value = data.getElem(y * scanlineStride + x);
+        for (int i=0; i<numBands; i++) {
+            pixels[i] = (value & bitMasks[i]) >>> bitOffsets[i];
+        }
+        return pixels;
+    }
+
+    /**
+     * Returns all samples for the specified rectangle of pixels in
+     * an int array, one sample per array element.
+     * ArrayIndexOutOfBoundsException may be thrown if the coordinates are
+     * not in bounds.
+     * @param x         The X coordinate of the upper left pixel location.
+     * @param y         The Y coordinate of the upper left pixel location.
+     * @param w         The width of the pixel rectangle.
+     * @param h         The height of the pixel rectangle.
+     * @param iArray    If non-null, returns the samples in this array.
+     * @param data      The DataBuffer containing the image data.
+     * @return all samples for the specified region of pixels.
+     * @see #setPixels(int, int, int, int, int[], DataBuffer)
+     */
+    public int[] getPixels(int x, int y, int w, int h,
+                           int iArray[], DataBuffer data) {
+        if ((x < 0) || (y < 0) || (x + w > width) || (y + h > height)) {
+            throw new ArrayIndexOutOfBoundsException
+                ("Coordinate out of bounds!");
+        }
+        int pixels[];
+        if (iArray != null) {
+           pixels = iArray;
+        } else {
+           pixels = new int [w*h*numBands];
+        }
+        int lineOffset = y*scanlineStride + x;
+        int dstOffset = 0;
+
+        for (int i = 0; i < h; i++) {
+           for (int j = 0; j < w; j++) {
+              int value = data.getElem(lineOffset+j);
+              for (int k=0; k < numBands; k++) {
+                  pixels[dstOffset++] =
+                     ((value & bitMasks[k]) >>> bitOffsets[k]);
+              }
+           }
+           lineOffset += scanlineStride;
+        }
+        return pixels;
+    }
+
+    /**
+     * Returns as int the sample in a specified band for the pixel
+     * located at (x,y).
+     * ArrayIndexOutOfBoundsException may be thrown if the coordinates are
+     * not in bounds.
+     * @param x         The X coordinate of the pixel location.
+     * @param y         The Y coordinate of the pixel location.
+     * @param b         The band to return.
+     * @param data      The DataBuffer containing the image data.
+     * @return the sample in a specified band for the specified
+     *         pixel.
+     * @see #setSample(int, int, int, int, DataBuffer)
+     */
+    public int getSample(int x, int y, int b, DataBuffer data) {
+        // Bounds check for 'b' will be performed automatically
+        if ((x < 0) || (y < 0) || (x >= width) || (y >= height)) {
+            throw new ArrayIndexOutOfBoundsException
+                ("Coordinate out of bounds!");
+        }
+        int sample = data.getElem(y * scanlineStride + x);
+        return ((sample & bitMasks[b]) >>> bitOffsets[b]);
+    }
+
+    /**
+     * Returns the samples for a specified band for the specified rectangle
+     * of pixels in an int array, one sample per array element.
+     * ArrayIndexOutOfBoundsException may be thrown if the coordinates are
+     * not in bounds.
+     * @param x         The X coordinate of the upper left pixel location.
+     * @param y         The Y coordinate of the upper left pixel location.
+     * @param w         The width of the pixel rectangle.
+     * @param h         The height of the pixel rectangle.
+     * @param b         The band to return.
+     * @param iArray    If non-null, returns the samples in this array.
+     * @param data      The DataBuffer containing the image data.
+     * @return the samples for the specified band for the specified
+     *         region of pixels.
+     * @see #setSamples(int, int, int, int, int, int[], DataBuffer)
+     */
+    public int[] getSamples(int x, int y, int w, int h, int b,
+                           int iArray[], DataBuffer data) {
+        // Bounds check for 'b' will be performed automatically
+        if ((x < 0) || (y < 0) || (x + w > width) || (y + h > height)) {
+            throw new ArrayIndexOutOfBoundsException
+                ("Coordinate out of bounds!");
+        }
+        int samples[];
+        if (iArray != null) {
+           samples = iArray;
+        } else {
+           samples = new int [w*h];
+        }
+        int lineOffset = y*scanlineStride + x;
+        int dstOffset = 0;
+
+        for (int i = 0; i < h; i++) {
+           for (int j = 0; j < w; j++) {
+              int value = data.getElem(lineOffset+j);
+              samples[dstOffset++] =
+                 ((value & bitMasks[b]) >>> bitOffsets[b]);
+           }
+           lineOffset += scanlineStride;
+        }
+        return samples;
+    }
+
+    /**
+     * Sets the data for a single pixel in the specified DataBuffer from a
+     * primitive array of type TransferType.  For a
+     * SinglePixelPackedSampleModel, only the first element of the array
+     * will hold valid data, and the type of the array must be the same as
+     * the storage data type of the SinglePixelPackedSampleModel.
+     * <p>
+     * The following code illustrates transferring data for one pixel from
+     * DataBuffer <code>db1</code>, whose storage layout is described by
+     * SinglePixelPackedSampleModel <code>sppsm1</code>,
+     * to DataBuffer <code>db2</code>, whose storage layout is described by
+     * SinglePixelPackedSampleModel <code>sppsm2</code>.
+     * The transfer will generally be more efficient than using
+     * getPixel/setPixel.
+     * <pre>
+     *       SinglePixelPackedSampleModel sppsm1, sppsm2;
+     *       DataBufferInt db1, db2;
+     *       sppsm2.setDataElements(x, y, sppsm1.getDataElements(x, y, null,
+     *                              db1), db2);
+     * </pre>
+     * Using getDataElements/setDataElements to transfer between two
+     * DataBuffer/SampleModel pairs is legitimate if the SampleModels have
+     * the same number of bands, corresponding bands have the same number of
+     * bits per sample, and the TransferTypes are the same.
+     * <p>
+     * obj must be a primitive array of type TransferType.  Otherwise,
+     * a ClassCastException is thrown.  An
+     * ArrayIndexOutOfBoundsException may be thrown if the coordinates are
+     * not in bounds, or if obj is not large enough to hold the pixel data.
+     * @param x         The X coordinate of the pixel location.
+     * @param y         The Y coordinate of the pixel location.
+     * @param obj       A primitive array containing pixel data.
+     * @param data      The DataBuffer containing the image data.
+     * @see #getDataElements(int, int, Object, DataBuffer)
+     */
+    public void setDataElements(int x, int y, Object obj, DataBuffer data) {
+        if ((x < 0) || (y < 0) || (x >= width) || (y >= height)) {
+            throw new ArrayIndexOutOfBoundsException
+                ("Coordinate out of bounds!");
+        }
+
+        int type = getTransferType();
+
+        switch(type) {
+
+        case DataBuffer.TYPE_BYTE:
+
+            byte[] barray = (byte[])obj;
+            data.setElem(y*scanlineStride+x, ((int)barray[0])&0xff);
+            break;
+
+        case DataBuffer.TYPE_USHORT:
+
+            short[] sarray = (short[])obj;
+            data.setElem(y*scanlineStride+x, ((int)sarray[0])&0xffff);
+            break;
+
+        case DataBuffer.TYPE_INT:
+
+            int[] iarray = (int[])obj;
+            data.setElem(y*scanlineStride+x, iarray[0]);
+            break;
+        }
+    }
+
+    /**
+     * Sets a pixel in the DataBuffer using an int array of samples for input.
+     * ArrayIndexOutOfBoundsException may be thrown if the coordinates are
+     * not in bounds.
+     * @param x         The X coordinate of the pixel location.
+     * @param y         The Y coordinate of the pixel location.
+     * @param iArray    The input samples in an int array.
+     * @param data      The DataBuffer containing the image data.
+     * @see #getPixel(int, int, int[], DataBuffer)
+     */
+    public void setPixel(int x, int y,
+                         int iArray[],
+                         DataBuffer data) {
+        if ((x < 0) || (y < 0) || (x >= width) || (y >= height)) {
+            throw new ArrayIndexOutOfBoundsException
+                ("Coordinate out of bounds!");
+        }
+        int lineOffset = y * scanlineStride + x;
+        int value = data.getElem(lineOffset);
+        for (int i=0; i < numBands; i++) {
+            value &= ~bitMasks[i];
+            value |= ((iArray[i] << bitOffsets[i]) & bitMasks[i]);
+        }
+        data.setElem(lineOffset, value);
+    }
+
+    /**
+     * Sets all samples for a rectangle of pixels from an int array containing
+     * one sample per array element.
+     * ArrayIndexOutOfBoundsException may be thrown if the coordinates are
+     * not in bounds.
+     * @param x         The X coordinate of the upper left pixel location.
+     * @param y         The Y coordinate of the upper left pixel location.
+     * @param w         The width of the pixel rectangle.
+     * @param h         The height of the pixel rectangle.
+     * @param iArray    The input samples in an int array.
+     * @param data      The DataBuffer containing the image data.
+     * @see #getPixels(int, int, int, int, int[], DataBuffer)
+     */
+    public void setPixels(int x, int y, int w, int h,
+                          int iArray[], DataBuffer data) {
+        if ((x < 0) || (y < 0) || (x + w > width) || (y + h > height)) {
+            throw new ArrayIndexOutOfBoundsException
+                ("Coordinate out of bounds!");
+        }
+
+        int lineOffset = y*scanlineStride + x;
+        int srcOffset = 0;
+
+        for (int i = 0; i < h; i++) {
+           for (int j = 0; j < w; j++) {
+               int value = data.getElem(lineOffset+j);
+               for (int k=0; k < numBands; k++) {
+                   value &= ~bitMasks[k];
+                   int srcValue = iArray[srcOffset++];
+                   value |= ((srcValue << bitOffsets[k])
+                             & bitMasks[k]);
+               }
+               data.setElem(lineOffset+j, value);
+           }
+           lineOffset += scanlineStride;
+        }
+    }
+
+    /**
+     * Sets a sample in the specified band for the pixel located at (x,y)
+     * in the DataBuffer using an int for input.
+     * ArrayIndexOutOfBoundsException may be thrown if the coordinates are
+     * not in bounds.
+     * @param x         The X coordinate of the pixel location.
+     * @param y         The Y coordinate of the pixel location.
+     * @param b         The band to set.
+     * @param s         The input sample as an int.
+     * @param data      The DataBuffer containing the image data.
+     * @see #getSample(int, int, int, DataBuffer)
+     */
+    public void setSample(int x, int y, int b, int s,
+                          DataBuffer data) {
+        // Bounds check for 'b' will be performed automatically
+        if ((x < 0) || (y < 0) || (x >= width) || (y >= height)) {
+            throw new ArrayIndexOutOfBoundsException
+                ("Coordinate out of bounds!");
+        }
+        int value = data.getElem(y*scanlineStride + x);
+        value &= ~bitMasks[b];
+        value |= (s << bitOffsets[b]) & bitMasks[b];
+        data.setElem(y*scanlineStride + x,value);
+    }
+
+    /**
+     * Sets the samples in the specified band for the specified rectangle
+     * of pixels from an int array containing one sample per array element.
+     * ArrayIndexOutOfBoundsException may be thrown if the coordinates are
+     * not in bounds.
+     * @param x         The X coordinate of the upper left pixel location.
+     * @param y         The Y coordinate of the upper left pixel location.
+     * @param w         The width of the pixel rectangle.
+     * @param h         The height of the pixel rectangle.
+     * @param b         The band to set.
+     * @param iArray    The input samples in an int array.
+     * @param data      The DataBuffer containing the image data.
+     * @see #getSamples(int, int, int, int, int, int[], DataBuffer)
+     */
+    public void setSamples(int x, int y, int w, int h, int b,
+                          int iArray[], DataBuffer data) {
+        // Bounds check for 'b' will be performed automatically
+        if ((x < 0) || (y < 0) || (x + w > width) || (y + h > height)) {
+            throw new ArrayIndexOutOfBoundsException
+                ("Coordinate out of bounds!");
+        }
+        int lineOffset = y*scanlineStride + x;
+        int srcOffset = 0;
+
+        for (int i = 0; i < h; i++) {
+           for (int j = 0; j < w; j++) {
+              int value = data.getElem(lineOffset+j);
+              value &= ~bitMasks[b];
+              int sample = iArray[srcOffset++];
+              value |= ((int)sample << bitOffsets[b]) & bitMasks[b];
+              data.setElem(lineOffset+j,value);
+           }
+           lineOffset += scanlineStride;
+        }
+    }
+
+    public boolean equals(Object o) {
+        if ((o == null) || !(o instanceof SinglePixelPackedSampleModel)) {
+            return false;
+        }
+
+        SinglePixelPackedSampleModel that = (SinglePixelPackedSampleModel)o;
+        return this.width == that.width &&
+            this.height == that.height &&
+            this.numBands == that.numBands &&
+            this.dataType == that.dataType &&
+            Arrays.equals(this.bitMasks, that.bitMasks) &&
+            Arrays.equals(this.bitOffsets, that.bitOffsets) &&
+            Arrays.equals(this.bitSizes, that.bitSizes) &&
+            this.maxBitSize == that.maxBitSize &&
+            this.scanlineStride == that.scanlineStride;
+    }
+
+    // If we implement equals() we must also implement hashCode
+    public int hashCode() {
+        int hash = 0;
+        hash = width;
+        hash <<= 8;
+        hash ^= height;
+        hash <<= 8;
+        hash ^= numBands;
+        hash <<= 8;
+        hash ^= dataType;
+        hash <<= 8;
+        for (int i = 0; i < bitMasks.length; i++) {
+            hash ^= bitMasks[i];
+            hash <<= 8;
+        }
+        for (int i = 0; i < bitOffsets.length; i++) {
+            hash ^= bitOffsets[i];
+            hash <<= 8;
+        }
+        for (int i = 0; i < bitSizes.length; i++) {
+            hash ^= bitSizes[i];
+            hash <<= 8;
+        }
+        hash ^= maxBitSize;
+        hash <<= 8;
+        hash ^= scanlineStride;
+        return hash;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/classes/java/awt/image/WritableRaster.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,741 @@
+/*
+ * Portions Copyright 1997-2007 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) Eastman Kodak Company, 1997
+ *** As  an unpublished  work pursuant to Title 17 of the United
+ *** States Code.  All rights reserved.
+ ******************************************************************
+ ******************************************************************
+ ******************************************************************/
+
+package java.awt.image;
+import java.awt.Rectangle;
+import java.awt.Point;
+
+/**
+ * This class extends Raster to provide pixel writing capabilities.
+ * Refer to the class comment for Raster for descriptions of how
+ * a Raster stores pixels.
+ *
+ * <p> The constructors of this class are protected.  To instantiate
+ * a WritableRaster, use one of the createWritableRaster factory methods
+ * in the Raster class.
+ */
+public class WritableRaster extends Raster {
+
+    /**
+     *  Constructs a WritableRaster with the given SampleModel.  The
+     *  WritableRaster's upper left corner is origin and it is the
+     *  same size as the  SampleModel.  A DataBuffer large enough to
+     *  describe the WritableRaster is automatically created.
+     *  @param sampleModel     The SampleModel that specifies the layout.
+     *  @param origin          The Point that specifies the origin.
+     *  @throws RasterFormatException if computing either
+     *          <code>origin.x + sampleModel.getWidth()</code> or
+     *          <code>origin.y + sampleModel.getHeight()</code> results
+     *          in integer overflow
+     */
+    protected WritableRaster(SampleModel sampleModel,
+                             Point origin) {
+        this(sampleModel,
+             sampleModel.createDataBuffer(),
+             new Rectangle(origin.x,
+                           origin.y,
+                           sampleModel.getWidth(),
+                           sampleModel.getHeight()),
+             origin,
+             null);
+    }
+
+    /**
+     *  Constructs a WritableRaster with the given SampleModel and DataBuffer.
+     *  The WritableRaster's upper left corner is origin and it is the same
+     *  size as the SampleModel.  The DataBuffer is not initialized and must
+     *  be compatible with SampleModel.
+     *  @param sampleModel     The SampleModel that specifies the layout.
+     *  @param dataBuffer      The DataBuffer that contains the image data.
+     *  @param origin          The Point that specifies the origin.
+     *  @throws RasterFormatException if computing either
+     *          <code>origin.x + sampleModel.getWidth()</code> or
+     *          <code>origin.y + sampleModel.getHeight()</code> results
+     *          in integer overflow
+     */
+    protected WritableRaster(SampleModel sampleModel,
+                             DataBuffer dataBuffer,
+                             Point origin) {
+        this(sampleModel,
+             dataBuffer,
+             new Rectangle(origin.x,
+                           origin.y,
+                           sampleModel.getWidth(),
+                           sampleModel.getHeight()),
+             origin,
+             null);
+    }
+
+    /**
+     * Constructs a WritableRaster with the given SampleModel, DataBuffer,
+     * and parent.  aRegion specifies the bounding rectangle of the new
+     * Raster.  When translated into the base Raster's coordinate
+     * system, aRegion must be contained by the base Raster.
+     * (The base Raster is the Raster's ancestor which has no parent.)
+     * sampleModelTranslate specifies the sampleModelTranslateX and
+     * sampleModelTranslateY values of the new Raster.
+     *
+     * Note that this constructor should generally be called by other
+     * constructors or create methods, it should not be used directly.
+     * @param sampleModel     The SampleModel that specifies the layout.
+     * @param dataBuffer      The DataBuffer that contains the image data.
+     * @param aRegion         The Rectangle that specifies the image area.
+     * @param sampleModelTranslate  The Point that specifies the translation
+     *                        from SampleModel to Raster coordinates.
+     * @param parent          The parent (if any) of this raster.
+     * @throws RasterFormatException if <code>aRegion</code> has width
+     *         or height less than or equal to zero, or computing either
+     *         <code>aRegion.x + aRegion.width</code> or
+     *         <code>aRegion.y + aRegion.height</code> results in integer
+     *         overflow
+     */
+    protected WritableRaster(SampleModel sampleModel,
+                             DataBuffer dataBuffer,
+                             Rectangle aRegion,
+                             Point sampleModelTranslate,
+                             WritableRaster parent){
+        super(sampleModel,dataBuffer,aRegion,sampleModelTranslate,parent);
+    }
+
+    /** Returns the parent WritableRaster (if any) of this WritableRaster,
+     *  or else null.
+     *  @return the parent of this <code>WritableRaster</code>, or
+     *          <code>null</code>.
+     */
+    public WritableRaster getWritableParent() {
+        return (WritableRaster)parent;
+    }
+
+    /**
+     * Create a WritableRaster with the same size, SampleModel and DataBuffer
+     * as this one, but with a different location.  The new WritableRaster
+     * will possess a reference to the current WritableRaster, accessible
+     * through its getParent() and getWritableParent() methods.
+     *
+     * @param childMinX X coord of the upper left corner of the new Raster.
+     * @param childMinY Y coord of the upper left corner of the new Raster.
+     * @return a <code>WritableRaster</code> the same as this one except
+     *         for the specified location.
+     * @throws RasterFormatException if  computing either
+     *         <code>childMinX + this.getWidth()</code> or
+     *         <code>childMinY + this.getHeight()</code> results in integer
+     *         overflow
+     */
+    public WritableRaster createWritableTranslatedChild(int childMinX,
+                                                        int childMinY) {
+        return createWritableChild(minX,minY,width,height,
+                                   childMinX,childMinY,null);
+    }
+
+    /**
+     * Returns a new WritableRaster which shares all or part of this
+     * WritableRaster's DataBuffer.  The new WritableRaster will
+     * possess a reference to the current WritableRaster, accessible
+     * through its getParent() and getWritableParent() methods.
+     *
+     * <p> The parentX, parentY, width and height parameters form a
+     * Rectangle in this WritableRaster's coordinate space, indicating
+     * the area of pixels to be shared.  An error will be thrown if
+     * this Rectangle is not contained with the bounds of the current
+     * WritableRaster.
+     *
+     * <p> The new WritableRaster may additionally be translated to a
+     * different coordinate system for the plane than that used by the current
+     * WritableRaster.  The childMinX and childMinY parameters give
+     * the new (x, y) coordinate of the upper-left pixel of the
+     * returned WritableRaster; the coordinate (childMinX, childMinY)
+     * in the new WritableRaster will map to the same pixel as the
+     * coordinate (parentX, parentY) in the current WritableRaster.
+     *
+     * <p> The new WritableRaster may be defined to contain only a
+     * subset of the bands of the current WritableRaster, possibly
+     * reordered, by means of the bandList parameter.  If bandList is
+     * null, it is taken to include all of the bands of the current
+     * WritableRaster in their current order.
+     *
+     * <p> To create a new WritableRaster that contains a subregion of
+     * the current WritableRaster, but shares its coordinate system
+     * and bands, this method should be called with childMinX equal to
+     * parentX, childMinY equal to parentY, and bandList equal to
+     * null.
+     *
+     * @param parentX    X coordinate of the upper left corner in this
+     *                   WritableRaster's coordinates.
+     * @param parentY    Y coordinate of the upper left corner in this
+     *                   WritableRaster's coordinates.
+     * @param w          Width of the region starting at (parentX, parentY).
+     * @param h          Height of the region starting at (parentX, parentY).
+     * @param childMinX  X coordinate of the upper left corner of
+     *                   the returned WritableRaster.
+     * @param childMinY  Y coordinate of the upper left corner of
+     *                   the returned WritableRaster.
+     * @param bandList   Array of band indices, or null to use all bands.
+     * @return a <code>WritableRaster</code> sharing all or part of the
+     *         <code>DataBuffer</code> of this <code>WritableRaster</code>.
+     * @exception RasterFormatException if the subregion is outside of the
+     *                               raster bounds.
+     * @throws RasterFormatException if <code>w</code> or
+     *         <code>h</code>
+     *         is less than or equal to zero, or computing any of
+     *         <code>parentX + w</code>, <code>parentY + h</code>,
+     *         <code>childMinX + w</code>, or
+     *         <code>childMinY + h</code> results in integer
+     *         overflow
+     */
+    public WritableRaster createWritableChild(int parentX, int parentY,
+                                              int w, int h,
+                                              int childMinX, int childMinY,
+                                              int bandList[]) {
+        if (parentX < this.minX) {
+            throw new RasterFormatException("parentX lies outside raster");
+        }
+        if (parentY < this.minY) {
+            throw new RasterFormatException("parentY lies outside raster");
+        }
+        if ((parentX+w < parentX) || (parentX+w > this.width + this.minX)) {
+            throw new RasterFormatException("(parentX + width) is outside raster");
+        }
+        if ((parentY+h < parentY) || (parentY+h > this.height + this.minY)) {
+            throw new RasterFormatException("(parentY + height) is outside raster");
+        }
+
+        SampleModel sm;
+        // Note: the SampleModel for the child Raster should have the same
+        // width and height as that for the parent, since it represents
+        // the physical layout of the pixel data.  The child Raster's width
+        // and height represent a "virtual" view of the pixel data, so
+        // they may be different than those of the SampleModel.
+        if (bandList != null) {
+            sm = sampleModel.createSubsetSampleModel(bandList);
+        }
+        else {
+            sm = sampleModel;
+        }
+
+        int deltaX = childMinX - parentX;
+        int deltaY = childMinY - parentY;
+
+        return new WritableRaster(sm,
+                                  getDataBuffer(),
+                                  new Rectangle(childMinX,childMinY,
+                                                w, h),
+                                  new Point(sampleModelTranslateX+deltaX,
+                                            sampleModelTranslateY+deltaY),
+                                  this);
+    }
+
+    /**
+     * Sets the data for a single pixel from a
+     * primitive array of type TransferType.  For image data supported by
+     * the Java 2D(tm) API, this will be one of DataBuffer.TYPE_BYTE,
+     * DataBuffer.TYPE_USHORT, DataBuffer.TYPE_INT, DataBuffer.TYPE_SHORT,
+     * DataBuffer.TYPE_FLOAT, or DataBuffer.TYPE_DOUBLE.  Data in the array
+     * may be in a packed format, thus increasing efficiency for data
+     * transfers.
+     * An ArrayIndexOutOfBoundsException may be thrown if the coordinates are
+     * not in bounds, or if inData is not large enough to hold the pixel data.
+     * However, explicit bounds checking is not guaranteed.
+     * A ClassCastException will be thrown if the input object is not null
+     * and references anything other than an array of TransferType.
+     * @see java.awt.image.SampleModel#setDataElements(int, int, Object, DataBuffer)
+     * @param x        The X coordinate of the pixel location.
+     * @param y        The Y coordinate of the pixel location.
+     * @param inData   An object reference to an array of type defined by
+     *                 getTransferType() and length getNumDataElements()
+     *                 containing the pixel data to place at x,y.
+     *
+     * @throws ArrayIndexOutOfBoundsException if the coordinates are not
+     * in bounds, or if inData is too small to hold the input.
+     */
+    public void setDataElements(int x, int y, Object inData) {
+        sampleModel.setDataElements(x-sampleModelTranslateX,
+                                    y-sampleModelTranslateY,
+                                    inData, dataBuffer);
+    }
+
+    /**
+     * Sets the data for a rectangle of pixels from an input Raster.
+     * The input Raster must be compatible with this WritableRaster
+     * in that they must have the same number of bands, corresponding bands
+     * must have the same number of bits per sample, the TransferTypes
+     * and NumDataElements must be the same, and the packing used by
+     * the getDataElements/setDataElements must be identical.
+     * An ArrayIndexOutOfBoundsException may be thrown if the coordinates are
+     * not in bounds.
+     * However, explicit bounds checking is not guaranteed.
+     * @param x        The X coordinate of the pixel location.
+     * @param y        The Y coordinate of the pixel location.
+     * @param inRaster Raster containing data to place at x,y.
+     *
+     * @throws NullPointerException if inRaster is null.
+     * @throws ArrayIndexOutOfBoundsException if the coordinates are not
+     * in bounds.
+     */
+    public void setDataElements(int x, int y, Raster inRaster) {
+        int dstOffX = x+inRaster.getMinX();
+        int dstOffY = y+inRaster.getMinY();
+        int width  = inRaster.getWidth();
+        int height = inRaster.getHeight();
+        if ((dstOffX < this.minX) || (dstOffY < this.minY) ||
+            (dstOffX + width > this.minX + this.width) ||
+            (dstOffY + height > this.minY + this.height)) {
+            throw new ArrayIndexOutOfBoundsException
+                ("Coordinate out of bounds!");
+        }
+
+        int srcOffX = inRaster.getMinX();
+        int srcOffY = inRaster.getMinY();
+        Object tdata = null;
+
+        for (int startY=0; startY < height; startY++) {
+            tdata = inRaster.getDataElements(srcOffX, srcOffY+startY,
+                                             width, 1, tdata);
+            setDataElements(dstOffX, dstOffY+startY,
+                            width, 1, tdata);
+        }
+    }
+
+    /**
+     * Sets the data for a rectangle of pixels from a
+     * primitive array of type TransferType.  For image data supported by
+     * the Java 2D API, this will be one of DataBuffer.TYPE_BYTE,
+     * DataBuffer.TYPE_USHORT, DataBuffer.TYPE_INT, DataBuffer.TYPE_SHORT,
+     * DataBuffer.TYPE_FLOAT, or DataBuffer.TYPE_DOUBLE.  Data in the array
+     * may be in a packed format, thus increasing efficiency for data
+     * transfers.
+     * An ArrayIndexOutOfBoundsException may be thrown if the coordinates are
+     * not in bounds, or if inData is not large enough to hold the pixel data.
+     * However, explicit bounds checking is not guaranteed.
+     * A ClassCastException will be thrown if the input object is not null
+     * and references anything other than an array of TransferType.
+     * @see java.awt.image.SampleModel#setDataElements(int, int, int, int, Object, DataBuffer)
+     * @param x        The X coordinate of the upper left pixel location.
+     * @param y        The Y coordinate of the upper left pixel location.
+     * @param w        Width of the pixel rectangle.
+     * @param h        Height of the pixel rectangle.
+     * @param inData   An object reference to an array of type defined by
+     *                 getTransferType() and length w*h*getNumDataElements()
+     *                 containing the pixel data to place between x,y and
+     *                 x+w-1, y+h-1.
+     *
+     * @throws NullPointerException if inData is null.
+     * @throws ArrayIndexOutOfBoundsException if the coordinates are not
+     * in bounds, or if inData is too small to hold the input.
+     */
+    public void setDataElements(int x, int y, int w, int h, Object inData) {
+        sampleModel.setDataElements(x-sampleModelTranslateX,
+                                    y-sampleModelTranslateY,
+                                    w,h,inData,dataBuffer);
+    }
+
+    /**
+     * Copies pixels from Raster srcRaster to this WritableRaster.  Each pixel
+     * in srcRaster is copied to the same x,y address in this raster, unless
+     * the address falls outside the bounds of this raster.  srcRaster
+     * must have the same number of bands as this WritableRaster.  The
+     * copy is a simple copy of source samples to the corresponding destination
+     * samples.
+     * <p>
+     * If all samples of both source and destination Rasters are of
+     * integral type and less than or equal to 32 bits in size, then calling
+     * this method is equivalent to executing the following code for all
+     * <code>x,y</code> addresses valid in both Rasters.
+     * <pre>
+     *       Raster srcRaster;
+     *       WritableRaster dstRaster;
+     *       for (int b = 0; b < srcRaster.getNumBands(); b++) {
+     *           dstRaster.setSample(x, y, b, srcRaster.getSample(x, y, b));
+     *       }
+     * </pre>
+     * Thus, when copying an integral type source to an integral type
+     * destination, if the source sample size is greater than the destination
+     * sample size for a particular band, the high order bits of the source
+     * sample are truncated.  If the source sample size is less than the
+     * destination size for a particular band, the high order bits of the
+     * destination are zero-extended or sign-extended depending on whether
+     * srcRaster's SampleModel treats the sample as a signed or unsigned
+     * quantity.
+     * <p>
+     * When copying a float or double source to an integral type destination,
+     * each source sample is cast to the destination type.  When copying an
+     * integral type source to a float or double destination, the source
+     * is first converted to a 32-bit int (if necessary), using the above
+     * rules for integral types, and then the int is cast to float or
+     * double.
+     * <p>
+     * @param srcRaster  The  Raster from which to copy pixels.
+     *
+     * @throws NullPointerException if srcRaster is null.
+     */
+    public void setRect(Raster srcRaster) {
+        setRect(0,0,srcRaster);
+    }
+
+    /**
+     * Copies pixels from Raster srcRaster to this WritableRaster.
+     * For each (x, y) address in srcRaster, the corresponding pixel
+     * is copied to address (x+dx, y+dy) in this WritableRaster,
+     * unless (x+dx, y+dy) falls outside the bounds of this raster.
+     * srcRaster must have the same number of bands as this WritableRaster.
+     * The copy is a simple copy of source samples to the corresponding
+     * destination samples.  For details, see
+     * {@link WritableRaster#setRect(Raster)}.
+     *
+     * @param dx        The X translation factor from src space to dst space
+     *                  of the copy.
+     * @param dy        The Y translation factor from src space to dst space
+     *                  of the copy.
+     * @param srcRaster The Raster from which to copy pixels.
+     *
+     * @throws NullPointerException if srcRaster is null.
+     */
+    public void setRect(int dx, int dy, Raster srcRaster) {
+        int width  = srcRaster.getWidth();
+        int height = srcRaster.getHeight();
+        int srcOffX = srcRaster.getMinX();
+        int srcOffY = srcRaster.getMinY();
+        int dstOffX = dx+srcOffX;
+        int dstOffY = dy+srcOffY;
+
+        // Clip to this raster
+        if (dstOffX < this.minX) {
+            int skipX = this.minX - dstOffX;
+            width -= skipX;
+            srcOffX += skipX;
+            dstOffX = this.minX;
+        }
+        if (dstOffY < this.minY) {
+            int skipY = this.minY - dstOffY;
+            height -= skipY;
+            srcOffY += skipY;
+            dstOffY = this.minY;
+        }
+        if (dstOffX+width > this.minX+this.width) {
+            width = this.minX + this.width - dstOffX;
+        }
+        if (dstOffY+height > this.minY+this.height) {
+            height = this.minY + this.height - dstOffY;
+        }
+
+        if (width <= 0 || height <= 0) {
+            return;
+        }
+
+        switch (srcRaster.getSampleModel().getDataType()) {
+        case DataBuffer.TYPE_BYTE:
+        case DataBuffer.TYPE_SHORT:
+        case DataBuffer.TYPE_USHORT:
+        case DataBuffer.TYPE_INT:
+            int[] iData = null;
+            for (int startY=0; startY < height; startY++) {
+                // Grab one scanline at a time
+                iData =
+                    srcRaster.getPixels(srcOffX, srcOffY+startY, width, 1,
+                                        iData);
+                setPixels(dstOffX, dstOffY+startY, width, 1, iData);
+            }
+            break;
+
+        case DataBuffer.TYPE_FLOAT:
+            float[] fData = null;
+            for (int startY=0; startY < height; startY++) {
+                fData =
+                    srcRaster.getPixels(srcOffX, srcOffY+startY, width, 1,
+                                        fData);
+                setPixels(dstOffX, dstOffY+startY, width, 1, fData);
+            }
+            break;
+
+        case DataBuffer.TYPE_DOUBLE:
+            double[] dData = null;
+            for (int startY=0; startY < height; startY++) {
+                // Grab one scanline at a time
+                dData =
+                    srcRaster.getPixels(srcOffX, srcOffY+startY, width, 1,
+                                        dData);
+                setPixels(dstOffX, dstOffY+startY, width, 1, dData);
+            }
+            break;
+        }
+    }
+
+    /**
+     * Sets a pixel in the DataBuffer using an int array of samples for input.
+     * An ArrayIndexOutOfBoundsException may be thrown if the coordinates are
+     * not in bounds.
+     * However, explicit bounds checking is not guaranteed.
+     * @param x      The X coordinate of the pixel location.
+     * @param y      The Y coordinate of the pixel location.
+     * @param iArray The input samples in a int array.
+     *
+     * @throws NullPointerException if iArray is null.
+     * @throws ArrayIndexOutOfBoundsException if the coordinates are not
+     * in bounds, or if iArray is too small to hold the input.
+     */
+    public void setPixel(int x, int y, int iArray[]) {
+        sampleModel.setPixel(x-sampleModelTranslateX,y-sampleModelTranslateY,
+                             iArray,dataBuffer);
+    }
+
+    /**
+     * Sets a pixel in the DataBuffer using a float array of samples for input.
+     * An ArrayIndexOutOfBoundsException may be thrown if the coordinates are
+     * not in bounds.
+     * However, explicit bounds checking is not guaranteed.
+     * @param x      The X coordinate of the pixel location.
+     * @param y      The Y coordinate of the pixel location.
+     * @param fArray The input samples in a float array.
+     *
+     * @throws NullPointerException if fArray is null.
+     * @throws ArrayIndexOutOfBoundsException if the coordinates are not
+     * in bounds, or if fArray is too small to hold the input.
+     */
+    public void setPixel(int x, int y, float fArray[]) {
+        sampleModel.setPixel(x-sampleModelTranslateX,y-sampleModelTranslateY,
+                             fArray,dataBuffer);
+    }
+
+    /**
+     * Sets a pixel in the DataBuffer using a double array of samples for input.
+     * An ArrayIndexOutOfBoundsException may be thrown if the coordinates are
+     * not in bounds.
+     * However, explicit bounds checking is not guaranteed.
+     * @param x      The X coordinate of the pixel location.
+     * @param y      The Y coordinate of the pixel location.
+     * @param dArray The input samples in a double array.
+     *
+     * @throws NullPointerException if dArray is null.
+     * @throws ArrayIndexOutOfBoundsException if the coordinates are not
+     * in bounds, or if dArray is too small to hold the input.
+     */
+    public void setPixel(int x, int y, double dArray[]) {
+        sampleModel.setPixel(x-sampleModelTranslateX,y-sampleModelTranslateY,
+                             dArray,dataBuffer);
+    }
+
+    /**
+     * Sets all samples for a rectangle of pixels from an int array containing
+     * one sample per array element.
+     * An ArrayIndexOutOfBoundsException may be thrown if the coordinates are
+     * not in bounds.
+     * However, explicit bounds checking is not guaranteed.
+     * @param x        The X coordinate of the upper left pixel location.
+     * @param y        The Y coordinate of the upper left pixel location.
+     * @param w        Width of the pixel rectangle.
+     * @param h        Height of the pixel rectangle.
+     * @param iArray   The input int pixel array.
+     *
+     * @throws NullPointerException if iArray is null.
+     * @throws ArrayIndexOutOfBoundsException if the coordinates are not
+     * in bounds, or if iArray is too small to hold the input.
+     */
+    public void setPixels(int x, int y, int w, int h, int iArray[]) {
+        sampleModel.setPixels(x-sampleModelTranslateX,y-sampleModelTranslateY,
+                              w,h,iArray,dataBuffer);
+    }
+
+    /**
+     * Sets all samples for a rectangle of pixels from a float array containing
+     * one sample per array element.
+     * An ArrayIndexOutOfBoundsException may be thrown if the coordinates are
+     * not in bounds.
+     * However, explicit bounds checking is not guaranteed.
+     * @param x        The X coordinate of the upper left pixel location.
+     * @param y        The Y coordinate of the upper left pixel location.
+     * @param w        Width of the pixel rectangle.
+     * @param h        Height of the pixel rectangle.
+     * @param fArray   The input float pixel array.
+     *
+     * @throws NullPointerException if fArray is null.
+     * @throws ArrayIndexOutOfBoundsException if the coordinates are not
+     * in bounds, or if fArray is too small to hold the input.
+     */
+    public void setPixels(int x, int y, int w, int h, float fArray[]) {
+        sampleModel.setPixels(x-sampleModelTranslateX,y-sampleModelTranslateY,
+                              w,h,fArray,dataBuffer);
+    }
+
+    /**
+     * Sets all samples for a rectangle of pixels from a double array containing
+     * one sample per array element.
+     * An ArrayIndexOutOfBoundsException may be thrown if the coordinates are
+     * not in bounds.
+     * However, explicit bounds checking is not guaranteed.
+     * @param x        The X coordinate of the upper left pixel location.
+     * @param y        The Y coordinate of the upper left pixel location.
+     * @param w        Width of the pixel rectangle.
+     * @param h        Height of the pixel rectangle.
+     * @param dArray   The input double pixel array.
+     *
+     * @throws NullPointerException if dArray is null.
+     * @throws ArrayIndexOutOfBoundsException if the coordinates are not
+     * in bounds, or if dArray is too small to hold the input.
+     */
+    public void setPixels(int x, int y, int w, int h, double dArray[]) {
+        sampleModel.setPixels(x-sampleModelTranslateX,y-sampleModelTranslateY,
+                              w,h,dArray,dataBuffer);
+    }
+
+    /**
+     * Sets a sample in the specified band for the pixel located at (x,y)
+     * in the DataBuffer using an int for input.
+     * An ArrayIndexOutOfBoundsException may be thrown if the coordinates are
+     * not in bounds.
+     * However, explicit bounds checking is not guaranteed.
+     * @param x        The X coordinate of the pixel location.
+     * @param y        The Y coordinate of the pixel location.
+     * @param b        The band to set.
+     * @param s        The input sample.
+     *
+     * @throws ArrayIndexOutOfBoundsException if the coordinates or
+     * the band index are not in bounds.
+     */
+    public void setSample(int x, int y, int b, int s) {
+        sampleModel.setSample(x-sampleModelTranslateX,
+                              y-sampleModelTranslateY, b, s,
+                              dataBuffer);
+    }
+
+    /**
+     * Sets a sample in the specified band for the pixel located at (x,y)
+     * in the DataBuffer using a float for input.
+     * An ArrayIndexOutOfBoundsException may be thrown if the coordinates are
+     * not in bounds.
+     * However, explicit bounds checking is not guaranteed.
+     * @param x        The X coordinate of the pixel location.
+     * @param y        The Y coordinate of the pixel location.
+     * @param b        The band to set.
+     * @param s        The input sample as a float.
+     *
+     * @throws ArrayIndexOutOfBoundsException if the coordinates or
+     * the band index are not in bounds.
+     */
+    public void setSample(int x, int y, int b, float s){
+        sampleModel.setSample(x-sampleModelTranslateX,y-sampleModelTranslateY,
+                              b,s,dataBuffer);
+    }
+
+    /**
+     * Sets a sample in the specified band for the pixel located at (x,y)
+     * in the DataBuffer using a double for input.
+     * An ArrayIndexOutOfBoundsException may be thrown if the coordinates are
+     * not in bounds.
+     * However, explicit bounds checking is not guaranteed.
+     * @param x        The X coordinate of the pixel location.
+     * @param y        The Y coordinate of the pixel location.
+     * @param b        The band to set.
+     * @param s        The input sample as a double.
+     *
+     * @throws ArrayIndexOutOfBoundsException if the coordinates or
+     * the band index are not in bounds.
+     */
+    public void setSample(int x, int y, int b, double s){
+        sampleModel.setSample(x-sampleModelTranslateX,y-sampleModelTranslateY,
+                                    b,s,dataBuffer);
+    }
+
+    /**
+     * Sets the samples in the specified band for the specified rectangle
+     * of pixels from an int array containing one sample per array element.
+     * An ArrayIndexOutOfBoundsException may be thrown if the coordinates are
+     * not in bounds.
+     * However, explicit bounds checking is not guaranteed.
+     * @param x        The X coordinate of the upper left pixel location.
+     * @param y        The Y coordinate of the upper left pixel location.
+     * @param w        Width of the pixel rectangle.
+     * @param h        Height of the pixel rectangle.
+     * @param b        The band to set.
+     * @param iArray   The input int sample array.
+     *
+     * @throws NullPointerException if iArray is null.
+     * @throws ArrayIndexOutOfBoundsException if the coordinates or
+     * the band index are not in bounds, or if iArray is too small to
+     * hold the input.
+     */
+    public void setSamples(int x, int y, int w, int h, int b,
+                           int iArray[]) {
+        sampleModel.setSamples(x-sampleModelTranslateX,y-sampleModelTranslateY,
+                               w,h,b,iArray,dataBuffer);
+    }
+
+    /**
+     * Sets the samples in the specified band for the specified rectangle
+     * of pixels from a float array containing one sample per array element.
+     * An ArrayIndexOutOfBoundsException may be thrown if the coordinates are
+     * not in bounds.
+     * However, explicit bounds checking is not guaranteed.
+     * @param x        The X coordinate of the upper left pixel location.
+     * @param y        The Y coordinate of the upper left pixel location.
+     * @param w        Width of the pixel rectangle.
+     * @param h        Height of the pixel rectangle.
+     * @param b        The band to set.
+     * @param fArray   The input float sample array.
+     *
+     * @throws NullPointerException if fArray is null.
+     * @throws ArrayIndexOutOfBoundsException if the coordinates or
+     * the band index are not in bounds, or if fArray is too small to
+     * hold the input.
+     */
+    public void setSamples(int x, int y, int w, int h, int b,
+                           float fArray[]) {
+        sampleModel.setSamples(x-sampleModelTranslateX,y-sampleModelTranslateY,
+                               w,h,b,fArray,dataBuffer);
+    }
+
+    /**
+     * Sets the samples in the specified band for the specified rectangle
+     * of pixels from a double array containing one sample per array element.
+     * An ArrayIndexOutOfBoundsException may be thrown if the coordinates are
+     * not in bounds.
+     * However, explicit bounds checking is not guaranteed.
+     * @param x        The X coordinate of the upper left pixel location.
+     * @param y        The Y coordinate of the upper left pixel location.
+     * @param w        Width of the pixel rectangle.
+     * @param h        Height of the pixel rectangle.
+     * @param b        The band to set.
+     * @param dArray   The input double sample array.
+     *
+     * @throws NullPointerException if dArray is null.
+     * @throws ArrayIndexOutOfBoundsException if the coordinates or
+     * the band index are not in bounds, or if dArray is too small to
+     * hold the input.
+     */
+    public void setSamples(int x, int y, int w, int h, int b,
+                           double dArray[]) {
+        sampleModel.setSamples(x-sampleModelTranslateX,y-sampleModelTranslateY,
+                              w,h,b,dArray,dataBuffer);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/classes/java/awt/image/WritableRenderedImage.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,151 @@
+/*
+ * Portions Copyright 1997-2000 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) Eastman Kodak Company, 1997
+ *** As  an unpublished  work pursuant to Title 17 of the United
+ *** States Code.  All rights reserved.
+ ******************************************************************
+ ******************************************************************
+ ******************************************************************/
+
+package java.awt.image;
+import java.awt.Point;
+
+/**
+ * WriteableRenderedImage is a common interface for objects which
+ * contain or can produce image data in the form of Rasters and
+ * which can be modified and/or written over.  The image
+ * data may be stored/produced as a single tile or a regular array
+ * of tiles.
+ * <p>
+ * WritableRenderedImage provides notification to other interested
+ * objects when a tile is checked out for writing (via the
+ * getWritableTile method) and when the last writer of a particular
+ * tile relinquishes its access (via a call to releaseWritableTile).
+ * Additionally, it allows any caller to determine whether any tiles
+ * are currently checked out (via hasTileWriters), and to obtain a
+ * list of such tiles (via getWritableTileIndices, in the form of a Vector
+ * of Point objects).
+ * <p>
+ * Objects wishing to be notified of changes in tile writability must
+ * implement the TileObserver interface, and are added by a
+ * call to addTileObserver.  Multiple calls to
+ * addTileObserver for the same object will result in multiple
+ * notifications.  An existing observer may reduce its notifications
+ * by calling removeTileObserver; if the observer had no
+ * notifications the operation is a no-op.
+ * <p>
+ * It is necessary for a WritableRenderedImage to ensure that
+ * notifications occur only when the first writer acquires a tile and
+ * the last writer releases it.
+ *
+ */
+
+public interface WritableRenderedImage extends RenderedImage
+{
+
+  /**
+   * Adds an observer.  If the observer is already present,
+   * it will receive multiple notifications.
+   * @param to the specified <code>TileObserver</code>
+   */
+  public void addTileObserver(TileObserver to);
+
+  /**
+   * Removes an observer.  If the observer was not registered,
+   * nothing happens.  If the observer was registered for multiple
+   * notifications, it will now be registered for one fewer.
+   * @param to the specified <code>TileObserver</code>
+   */
+  public void removeTileObserver(TileObserver to);
+
+  /**
+   * Checks out a tile for writing.
+   *
+   * The WritableRenderedImage is responsible for notifying all
+   * of its TileObservers when a tile goes from having
+   * no writers to having one writer.
+   *
+   * @param tileX the X index of the tile.
+   * @param tileY the Y index of the tile.
+   * @return a writable tile.
+   */
+  public WritableRaster getWritableTile(int tileX, int tileY);
+
+  /**
+   * Relinquishes the right to write to a tile.  If the caller
+   * continues to write to the tile, the results are undefined.
+   * Calls to this method should only appear in matching pairs
+   * with calls to getWritableTile; any other use will lead
+   * to undefined results.
+   *
+   * The WritableRenderedImage is responsible for notifying all of
+   * its TileObservers when a tile goes from having one writer
+   * to having no writers.
+   *
+   * @param tileX the X index of the tile.
+   * @param tileY the Y index of the tile.
+   */
+  public void releaseWritableTile(int tileX, int tileY);
+
+  /**
+   * Returns whether a tile is currently checked out for writing.
+   *
+   * @param tileX the X index of the tile.
+   * @param tileY the Y index of the tile.
+   * @return <code>true</code> if specified tile is checked out
+   *         for writing; <code>false</code> otherwise.
+   */
+  public boolean isTileWritable(int tileX, int tileY);
+
+  /**
+   * Returns an array of Point objects indicating which tiles
+   * are checked out for writing.  Returns null if none are
+   * checked out.
+   * @return an array containing the locations of tiles that are
+   *         checked out for writing.
+   */
+  public Point[] getWritableTileIndices();
+
+  /**
+   * Returns whether any tile is checked out for writing.
+   * Semantically equivalent to (getWritableTileIndices() != null).
+   * @return <code>true</code> if any tiles are checked out for
+   *         writing; <code>false</code> otherwise.
+   */
+  public boolean hasTileWriters();
+
+  /**
+   * Sets a rect of the image to the contents of the Raster r, which is
+   * assumed to be in the same coordinate space as the WritableRenderedImage.
+   * The operation is clipped to the bounds of the WritableRenderedImage.
+   * @param r the specified <code>Raster</code>
+   */
+  public void setData(Raster r);
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/classes/java/awt/image/renderable/ContextualRenderedImageFactory.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,143 @@
+/*
+ * Portions Copyright 1998-2000 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) Eastman Kodak Company, 1997                      ***
+ *** As  an unpublished  work pursuant to Title 17 of the United    ***
+ *** States Code.  All rights reserved.                             ***
+ **********************************************************************
+ **********************************************************************
+ **********************************************************************/
+
+package java.awt.image.renderable;
+import java.awt.geom.Rectangle2D;
+import java.awt.image.RenderedImage;
+
+/**
+ * ContextualRenderedImageFactory provides an interface for the
+ * functionality that may differ between instances of
+ * RenderableImageOp.  Thus different operations on RenderableImages
+ * may be performed by a single class such as RenderedImageOp through
+ * the use of multiple instances of ContextualRenderedImageFactory.
+ * The name ContextualRenderedImageFactory is commonly shortened to
+ * "CRIF."
+ *
+ * <p> All operations that are to be used in a rendering-independent
+ * chain must implement ContextualRenderedImageFactory.
+ *
+ * <p> Classes that implement this interface must provide a
+ * constructor with no arguments.
+ */
+public interface ContextualRenderedImageFactory extends RenderedImageFactory {
+
+    /**
+     * Maps the operation's output RenderContext into a RenderContext
+     * for each of the operation's sources.  This is useful for
+     * operations that can be expressed in whole or in part simply as
+     * alterations in the RenderContext, such as an affine mapping, or
+     * operations that wish to obtain lower quality renderings of
+     * their sources in order to save processing effort or
+     * transmission bandwith.  Some operations, such as blur, can also
+     * use this mechanism to avoid obtaining sources of higher quality
+     * than necessary.
+     *
+     * @param i the index of the source image.
+     * @param renderContext the RenderContext being applied to the operation.
+     * @param paramBlock a ParameterBlock containing the operation's
+     *        sources and parameters.
+     * @param image the RenderableImage being rendered.
+     * @return a <code>RenderContext</code> for
+     *         the source at the specified index of the parameters
+     *         Vector contained in the specified ParameterBlock.
+     */
+    RenderContext mapRenderContext(int i,
+                                   RenderContext renderContext,
+                                   ParameterBlock paramBlock,
+                                   RenderableImage image);
+
+    /**
+     * Creates a rendering, given a RenderContext and a ParameterBlock
+     * containing the operation's sources and parameters.  The output
+     * is a RenderedImage that takes the RenderContext into account to
+     * determine its dimensions and placement on the image plane.
+     * This method houses the "intelligence" that allows a
+     * rendering-independent operation to adapt to a specific
+     * RenderContext.
+     *
+     * @param renderContext The RenderContext specifying the rendering
+     * @param paramBlock a ParameterBlock containing the operation's
+     *        sources and parameters
+     * @return a <code>RenderedImage</code> from the sources and parameters
+     *         in the specified ParameterBlock and according to the
+     *         rendering instructions in the specified RenderContext.
+     */
+    RenderedImage create(RenderContext renderContext,
+                         ParameterBlock paramBlock);
+
+    /**
+     * Returns the bounding box for the output of the operation,
+     * performed on a given set of sources, in rendering-independent
+     * space.  The bounds are returned as a Rectangle2D, that is, an
+     * axis-aligned rectangle with floating-point corner coordinates.
+     *
+     * @param paramBlock a ParameterBlock containing the operation's
+     *        sources and parameters.
+     * @return a Rectangle2D specifying the rendering-independent
+     *         bounding box of the output.
+     */
+    Rectangle2D getBounds2D(ParameterBlock paramBlock);
+
+    /**
+     * Gets the appropriate instance of the property specified by the name
+     * parameter.  This method must determine which instance of a property to
+     * return when there are multiple sources that each specify the property.
+     *
+     * @param paramBlock a ParameterBlock containing the operation's
+     *        sources and parameters.
+     * @param name a String naming the desired property.
+     * @return an object reference to the value of the property requested.
+     */
+    Object getProperty(ParameterBlock paramBlock, String name);
+
+    /**
+     * Returns a list of names recognized by getProperty.
+     * @return the list of property names.
+     */
+    String[] getPropertyNames();
+
+    /**
+     * Returns true if successive renderings (that is, calls to
+     * create(RenderContext, ParameterBlock)) with the same arguments
+     * may produce different results.  This method may be used to
+     * determine whether an existing rendering may be cached and
+     * reused.  It is always safe to return true.
+     * @return <code>true</code> if successive renderings with the
+     *         same arguments might produce different results;
+     *         <code>false</code> otherwise.
+     */
+    boolean isDynamic();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/classes/java/awt/image/renderable/RenderContext.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,272 @@
+/*
+ * Portions Copyright 1998-2000 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) Eastman Kodak Company, 1997                      ***
+ *** As  an unpublished  work pursuant to Title 17 of the United    ***
+ *** States Code.  All rights reserved.                             ***
+ **********************************************************************
+ **********************************************************************
+ **********************************************************************/
+
+package java.awt.image.renderable;
+import java.util.*;
+import java.awt.geom.*;
+import java.awt.*;
+import java.awt.image.*;
+
+/**
+ * A RenderContext encapsulates the information needed to produce a
+ * specific rendering from a RenderableImage.  It contains the area to
+ * be rendered specified in rendering-independent terms, the
+ * resolution at which the rendering is to be performed, and hints
+ * used to control the rendering process.
+ *
+ * <p> Users create RenderContexts and pass them to the
+ * RenderableImage via the createRendering method.  Most of the methods of
+ * RenderContexts are not meant to be used directly by applications,
+ * but by the RenderableImage and operator classes to which it is
+ * passed.
+ *
+ * <p> The AffineTransform parameter passed into and out of this class
+ * are cloned.  The RenderingHints and Shape parameters are not
+ * necessarily cloneable and are therefore only reference copied.
+ * Altering RenderingHints or Shape instances that are in use by
+ * instances of RenderContext may have undesired side effects.
+ */
+public class RenderContext implements Cloneable {
+
+    /** Table of hints. May be null. */
+    RenderingHints hints;
+
+    /** Transform to convert user coordinates to device coordinates.  */
+    AffineTransform usr2dev;
+
+    /** The area of interest.  May be null. */
+    Shape aoi;
+
+    // Various constructors that allow different levels of
+    // specificity. If the Shape is missing the whole renderable area
+    // is assumed. If hints is missing no hints are assumed.
+
+    /**
+     * Constructs a RenderContext with a given transform.
+     * The area of interest is supplied as a Shape,
+     * and the rendering hints are supplied as a RenderingHints object.
+     *
+     * @param usr2dev an AffineTransform.
+     * @param aoi a Shape representing the area of interest.
+     * @param hints a RenderingHints object containing rendering hints.
+     */
+    public RenderContext(AffineTransform usr2dev,
+                         Shape aoi,
+                         RenderingHints hints) {
+        this.hints = hints;
+        this.aoi = aoi;
+        this.usr2dev = (AffineTransform)usr2dev.clone();
+    }
+
+    /**
+     * Constructs a RenderContext with a given transform.
+     * The area of interest is taken to be the entire renderable area.
+     * No rendering hints are used.
+     *
+     * @param usr2dev an AffineTransform.
+     */
+    public RenderContext(AffineTransform usr2dev) {
+        this(usr2dev, null, null);
+    }
+
+    /**
+     * Constructs a RenderContext with a given transform and rendering hints.
+     * The area of interest is taken to be the entire renderable area.
+     *
+     * @param usr2dev an AffineTransform.
+     * @param hints a RenderingHints object containing rendering hints.
+     */
+    public RenderContext(AffineTransform usr2dev, RenderingHints hints) {
+        this(usr2dev, null, hints);
+    }
+
+    /**
+     * Constructs a RenderContext with a given transform and area of interest.
+     * The area of interest is supplied as a Shape.
+     * No rendering hints are used.
+     *
+     * @param usr2dev an AffineTransform.
+     * @param aoi a Shape representing the area of interest.
+     */
+    public RenderContext(AffineTransform usr2dev, Shape aoi) {
+        this(usr2dev, aoi, null);
+    }
+
+    /**
+     * Gets the rendering hints of this <code>RenderContext</code>.
+     * @return a <code>RenderingHints</code> object that represents
+     * the rendering hints of this <code>RenderContext</code>.
+     * @see #setRenderingHints(RenderingHints)
+     */
+    public RenderingHints getRenderingHints() {
+        return hints;
+    }
+
+    /**
+     * Sets the rendering hints of this <code>RenderContext</code>.
+     * @param hints a <code>RenderingHints</code> object that represents
+     * the rendering hints to assign to this <code>RenderContext</code>.
+     * @see #getRenderingHints
+     */
+    public void setRenderingHints(RenderingHints hints) {
+        this.hints = hints;
+    }
+
+    /**
+     * Sets the current user-to-device AffineTransform contained
+     * in the RenderContext to a given transform.
+     *
+     * @param newTransform the new AffineTransform.
+     * @see #getTransform
+     */
+    public void setTransform(AffineTransform newTransform) {
+        usr2dev = (AffineTransform)newTransform.clone();
+    }
+
+    /**
+     * Modifies the current user-to-device transform by prepending another
+     * transform.  In matrix notation the operation is:
+     * <pre>
+     * [this] = [modTransform] x [this]
+     * </pre>
+     *
+     * @param modTransform the AffineTransform to prepend to the
+     *        current usr2dev transform.
+     * @since 1.3
+     */
+    public void preConcatenateTransform(AffineTransform modTransform) {
+        this.preConcetenateTransform(modTransform);
+    }
+
+    /**
+     * Modifies the current user-to-device transform by prepending another
+     * transform.  In matrix notation the operation is:
+     * <pre>
+     * [this] = [modTransform] x [this]
+     * </pre>
+     * This method does the same thing as the preConcatenateTransform
+     * method.  It is here for backward compatibility with previous releases
+     * which misspelled the method name.
+     *
+     * @param modTransform the AffineTransform to prepend to the
+     *        current usr2dev transform.
+     * @deprecated     replaced by
+     *                 <code>preConcatenateTransform(AffineTransform)</code>.
+     */
+    @Deprecated
+    public void preConcetenateTransform(AffineTransform modTransform) {
+        usr2dev.preConcatenate(modTransform);
+    }
+
+    /**
+     * Modifies the current user-to-device transform by appending another
+     * transform.  In matrix notation the operation is:
+     * <pre>
+     * [this] = [this] x [modTransform]
+     * </pre>
+     *
+     * @param modTransform the AffineTransform to append to the
+     *        current usr2dev transform.
+     * @since 1.3
+     */
+    public void concatenateTransform(AffineTransform modTransform) {
+        this.concetenateTransform(modTransform);
+    }
+
+    /**
+     * Modifies the current user-to-device transform by appending another
+     * transform.  In matrix notation the operation is:
+     * <pre>
+     * [this] = [this] x [modTransform]
+     * </pre>
+     * This method does the same thing as the concatenateTransform
+     * method.  It is here for backward compatibility with previous releases
+     * which misspelled the method name.
+     *
+     * @param modTransform the AffineTransform to append to the
+     *        current usr2dev transform.
+     * @deprecated     replaced by
+     *                 <code>concatenateTransform(AffineTransform)</code>.
+     */
+    @Deprecated
+    public void concetenateTransform(AffineTransform modTransform) {
+        usr2dev.concatenate(modTransform);
+    }
+
+    /**
+     * Gets the current user-to-device AffineTransform.
+     *
+     * @return a reference to the current AffineTransform.
+     * @see #setTransform(AffineTransform)
+     */
+    public AffineTransform getTransform() {
+        return (AffineTransform)usr2dev.clone();
+    }
+
+    /**
+     * Sets the current area of interest.  The old area is discarded.
+     *
+     * @param newAoi The new area of interest.
+     * @see #getAreaOfInterest
+     */
+    public void setAreaOfInterest(Shape newAoi) {
+        aoi = newAoi;
+    }
+
+    /**
+     * Gets the ares of interest currently contained in the
+     * RenderContext.
+     *
+     * @return a reference to the area of interest of the RenderContext,
+     *         or null if none is specified.
+     * @see #setAreaOfInterest(Shape)
+     */
+    public Shape getAreaOfInterest() {
+        return aoi;
+    }
+
+    /**
+     * Makes a copy of a RenderContext. The area of interest is copied
+     * by reference.  The usr2dev AffineTransform and hints are cloned,
+     * while the area of interest is copied by reference.
+     *
+     * @return the new cloned RenderContext.
+     */
+    public Object clone() {
+        RenderContext newRenderContext = new RenderContext(usr2dev,
+                                                           aoi, hints);
+        return newRenderContext;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/classes/java/awt/image/renderable/RenderableImage.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,198 @@
+/*
+ * Portions Copyright 1998-2000 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) Eastman Kodak Company, 1997                      ***
+ *** As  an unpublished  work pursuant to Title 17 of the United    ***
+ *** States Code.  All rights reserved.                             ***
+ **********************************************************************
+ **********************************************************************
+ **********************************************************************/
+
+package java.awt.image.renderable;
+import java.util.Vector;
+import java.awt.RenderingHints;
+import java.awt.image.*;
+
+/**
+ * A RenderableImage is a common interface for rendering-independent
+ * images (a notion which subsumes resolution independence).  That is,
+ * images which are described and have operations applied to them
+ * independent of any specific rendering of the image.  For example, a
+ * RenderableImage can be rotated and cropped in
+ * resolution-independent terms.  Then, it can be rendered for various
+ * specific contexts, such as a draft preview, a high-quality screen
+ * display, or a printer, each in an optimal fashion.
+ *
+ * <p> A RenderedImage is returned from a RenderableImage via the
+ * createRendering() method, which takes a RenderContext.  The
+ * RenderContext specifies how the RenderedImage should be
+ * constructed.  Note that it is not possible to extract pixels
+ * directly from a RenderableImage.
+ *
+ * <p> The createDefaultRendering() and createScaledRendering() methods are
+ * convenience methods that construct an appropriate RenderContext
+ * internally.  All of the rendering methods may return a reference to a
+ * previously produced rendering.
+ */
+public interface RenderableImage {
+
+    /**
+     * String constant that can be used to identify a property on
+     * a RenderedImage obtained via the createRendering or
+     * createScaledRendering methods.  If such a property exists,
+     * the value of the propoery will be a RenderingHints object
+     * specifying which hints were observed in creating the rendering.
+     */
+     static final String HINTS_OBSERVED = "HINTS_OBSERVED";
+
+    /**
+     * Returns a vector of RenderableImages that are the sources of
+     * image data for this RenderableImage. Note that this method may
+     * return an empty vector, to indicate that the image has no sources,
+     * or null, to indicate that no information is available.
+     *
+     * @return a (possibly empty) Vector of RenderableImages, or null.
+     */
+    Vector<RenderableImage> getSources();
+
+    /**
+     * Gets a property from the property set of this image.
+     * If the property name is not recognized, java.awt.Image.UndefinedProperty
+     * will be returned.
+     *
+     * @param name the name of the property to get, as a String.
+     * @return a reference to the property Object, or the value
+     *         java.awt.Image.UndefinedProperty.
+     */
+    Object getProperty(String name);
+
+    /**
+     * Returns a list of names recognized by getProperty.
+     * @return a list of property names.
+     */
+    String[] getPropertyNames();
+
+    /**
+     * Returns true if successive renderings (that is, calls to
+     * createRendering() or createScaledRendering()) with the same arguments
+     * may produce different results.  This method may be used to
+     * determine whether an existing rendering may be cached and
+     * reused.  It is always safe to return true.
+     * @return <code>true</code> if successive renderings with the
+     *         same arguments might produce different results;
+     *         <code>false</code> otherwise.
+     */
+    boolean isDynamic();
+
+    /**
+     * Gets the width in user coordinate space.  By convention, the
+     * usual width of a RenderableImage is equal to the image's aspect
+     * ratio (width divided by height).
+     *
+     * @return the width of the image in user coordinates.
+     */
+    float getWidth();
+
+    /**
+     * Gets the height in user coordinate space.  By convention, the
+     * usual height of a RenderedImage is equal to 1.0F.
+     *
+     * @return the height of the image in user coordinates.
+     */
+    float getHeight();
+
+    /**
+     * Gets the minimum X coordinate of the rendering-independent image data.
+     * @return the minimum X coordinate of the rendering-independent image
+     * data.
+     */
+    float getMinX();
+
+    /**
+     * Gets the minimum Y coordinate of the rendering-independent image data.
+     * @return the minimum Y coordinate of the rendering-independent image
+     * data.
+     */
+    float getMinY();
+
+    /**
+     * Creates a RenderedImage instance of this image with width w, and
+     * height h in pixels.  The RenderContext is built automatically
+     * with an appropriate usr2dev transform and an area of interest
+     * of the full image.  All the rendering hints come from hints
+     * passed in.
+     *
+     * <p> If w == 0, it will be taken to equal
+     * Math.round(h*(getWidth()/getHeight())).
+     * Similarly, if h == 0, it will be taken to equal
+     * Math.round(w*(getHeight()/getWidth())).  One of
+     * w or h must be non-zero or else an IllegalArgumentException
+     * will be thrown.
+     *
+     * <p> The created RenderedImage may have a property identified
+     * by the String HINTS_OBSERVED to indicate which RenderingHints
+     * were used to create the image.  In addition any RenderedImages
+     * that are obtained via the getSources() method on the created
+     * RenderedImage may have such a property.
+     *
+     * @param w the width of rendered image in pixels, or 0.
+     * @param h the height of rendered image in pixels, or 0.
+     * @param hints a RenderingHints object containg hints.
+     * @return a RenderedImage containing the rendered data.
+     */
+    RenderedImage createScaledRendering(int w, int h, RenderingHints hints);
+
+    /**
+     * Returnd a RenderedImage instance of this image with a default
+     * width and height in pixels.  The RenderContext is built
+     * automatically with an appropriate usr2dev transform and an area
+     * of interest of the full image.  The rendering hints are
+     * empty.  createDefaultRendering may make use of a stored
+     * rendering for speed.
+     *
+     * @return a RenderedImage containing the rendered data.
+     */
+    RenderedImage createDefaultRendering();
+
+    /**
+     * Creates a RenderedImage that represented a rendering of this image
+     * using a given RenderContext.  This is the most general way to obtain a
+     * rendering of a RenderableImage.
+     *
+     * <p> The created RenderedImage may have a property identified
+     * by the String HINTS_OBSERVED to indicate which RenderingHints
+     * (from the RenderContext) were used to create the image.
+     * In addition any RenderedImages
+     * that are obtained via the getSources() method on the created
+     * RenderedImage may have such a property.
+     *
+     * @param renderContext the RenderContext to use to produce the rendering.
+     * @return a RenderedImage containing the rendered data.
+     */
+    RenderedImage createRendering(RenderContext renderContext);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/classes/java/awt/image/renderable/RenderableImageOp.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,350 @@
+/*
+ * Portions Copyright 1998-2000 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) Eastman Kodak Company, 1997                      ***
+ *** As  an unpublished  work pursuant to Title 17 of the United    ***
+ *** States Code.  All rights reserved.                             ***
+ **********************************************************************
+ **********************************************************************
+ **********************************************************************/
+
+package java.awt.image.renderable;
+import java.awt.geom.AffineTransform;
+import java.awt.geom.Rectangle2D;
+import java.awt.image.RenderedImage;
+import java.awt.RenderingHints;
+import java.util.Hashtable;
+import java.util.Vector;
+
+/**
+ * This class handles the renderable aspects of an operation with help
+ * from its associated instance of a ContextualRenderedImageFactory.
+ */
+public class RenderableImageOp implements RenderableImage {
+
+    /** A ParameterBlock containing source and parameters. */
+    ParameterBlock paramBlock;
+
+    /** The associated ContextualRenderedImageFactory. */
+    ContextualRenderedImageFactory myCRIF;
+
+    /** The bounding box of the results of this RenderableImageOp. */
+    Rectangle2D boundingBox;
+
+
+    /**
+     * Constructs a RenderedImageOp given a
+     * ContextualRenderedImageFactory object, and
+     * a ParameterBlock containing RenderableImage sources and other
+     * parameters.  Any RenderedImage sources referenced by the
+     * ParameterBlock will be ignored.
+     *
+     * @param CRIF a ContextualRenderedImageFactory object
+     * @param paramBlock a ParameterBlock containing this operation's source
+     *        images and other parameters necessary for the operation
+     *        to run.
+     */
+    public RenderableImageOp(ContextualRenderedImageFactory CRIF,
+                             ParameterBlock paramBlock) {
+        this.myCRIF = CRIF;
+        this.paramBlock = (ParameterBlock) paramBlock.clone();
+    }
+
+    /**
+     * Returns a vector of RenderableImages that are the sources of
+     * image data for this RenderableImage. Note that this method may
+     * return an empty vector, to indicate that the image has no sources,
+     * or null, to indicate that no information is available.
+     *
+     * @return a (possibly empty) Vector of RenderableImages, or null.
+     */
+    public Vector<RenderableImage> getSources() {
+        return getRenderableSources();
+    }
+
+    private Vector getRenderableSources() {
+        Vector sources = null;
+
+        if (paramBlock.getNumSources() > 0) {
+            sources = new Vector();
+            int i = 0;
+            while (i < paramBlock.getNumSources()) {
+                Object o = paramBlock.getSource(i);
+                if (o instanceof RenderableImage) {
+                    sources.add((RenderableImage)o);
+                    i++;
+                } else {
+                    break;
+                }
+            }
+        }
+        return sources;
+    }
+
+    /**
+     * Gets a property from the property set of this image.
+     * If the property name is not recognized, java.awt.Image.UndefinedProperty
+     * will be returned.
+     *
+     * @param name the name of the property to get, as a String.
+     * @return a reference to the property Object, or the value
+     *         java.awt.Image.UndefinedProperty.
+     */
+    public Object getProperty(String name) {
+        return myCRIF.getProperty(paramBlock, name);
+    }
+
+    /**
+     * Return a list of names recognized by getProperty.
+     * @return a list of property names.
+     */
+    public String[] getPropertyNames() {
+        return myCRIF.getPropertyNames();
+    }
+
+    /**
+     * Returns true if successive renderings (that is, calls to
+     * createRendering() or createScaledRendering()) with the same arguments
+     * may produce different results.  This method may be used to
+     * determine whether an existing rendering may be cached and
+     * reused.  The CRIF's isDynamic method will be called.
+     * @return <code>true</code> if successive renderings with the
+     *         same arguments might produce different results;
+     *         <code>false</code> otherwise.
+     */
+    public boolean isDynamic() {
+        return myCRIF.isDynamic();
+    }
+
+    /**
+     * Gets the width in user coordinate space.  By convention, the
+     * usual width of a RenderableImage is equal to the image's aspect
+     * ratio (width divided by height).
+     *
+     * @return the width of the image in user coordinates.
+     */
+    public float getWidth() {
+        if (boundingBox == null) {
+            boundingBox = myCRIF.getBounds2D(paramBlock);
+        }
+        return (float)boundingBox.getWidth();
+    }
+
+    /**
+     * Gets the height in user coordinate space.  By convention, the
+     * usual height of a RenderedImage is equal to 1.0F.
+     *
+     * @return the height of the image in user coordinates.
+     */
+    public float getHeight() {
+        if (boundingBox == null) {
+            boundingBox = myCRIF.getBounds2D(paramBlock);
+        }
+        return (float)boundingBox.getHeight();
+    }
+
+    /**
+     * Gets the minimum X coordinate of the rendering-independent image data.
+     */
+    public float getMinX() {
+        if (boundingBox == null) {
+            boundingBox = myCRIF.getBounds2D(paramBlock);
+        }
+        return (float)boundingBox.getMinX();
+    }
+
+    /**
+     * Gets the minimum Y coordinate of the rendering-independent image data.
+     */
+    public float getMinY() {
+        if (boundingBox == null) {
+            boundingBox = myCRIF.getBounds2D(paramBlock);
+        }
+        return (float)boundingBox.getMinY();
+    }
+
+    /**
+     * Change the current ParameterBlock of the operation, allowing
+     * editing of image rendering chains.  The effects of such a
+     * change will be visible when a new rendering is created from
+     * this RenderableImageOp or any dependent RenderableImageOp.
+     *
+     * @param paramBlock the new ParameterBlock.
+     * @return the old ParameterBlock.
+     * @see #getParameterBlock
+     */
+    public ParameterBlock setParameterBlock(ParameterBlock paramBlock) {
+        ParameterBlock oldParamBlock = this.paramBlock;
+        this.paramBlock = (ParameterBlock)paramBlock.clone();
+        return oldParamBlock;
+    }
+
+    /**
+     * Returns a reference to the current parameter block.
+     * @return the <code>ParameterBlock</code> of this
+     *         <code>RenderableImageOp</code>.
+     * @see #setParameterBlock(ParameterBlock)
+     */
+    public ParameterBlock getParameterBlock() {
+        return paramBlock;
+    }
+
+    /**
+     * Creates a RenderedImage instance of this image with width w, and
+     * height h in pixels.  The RenderContext is built automatically
+     * with an appropriate usr2dev transform and an area of interest
+     * of the full image.  All the rendering hints come from hints
+     * passed in.
+     *
+     * <p> If w == 0, it will be taken to equal
+     * Math.round(h*(getWidth()/getHeight())).
+     * Similarly, if h == 0, it will be taken to equal
+     * Math.round(w*(getHeight()/getWidth())).  One of
+     * w or h must be non-zero or else an IllegalArgumentException
+     * will be thrown.
+     *
+     * <p> The created RenderedImage may have a property identified
+     * by the String HINTS_OBSERVED to indicate which RenderingHints
+     * were used to create the image.  In addition any RenderedImages
+     * that are obtained via the getSources() method on the created
+     * RenderedImage may have such a property.
+     *
+     * @param w the width of rendered image in pixels, or 0.
+     * @param h the height of rendered image in pixels, or 0.
+     * @param hints a RenderingHints object containg hints.
+     * @return a RenderedImage containing the rendered data.
+     */
+    public RenderedImage createScaledRendering(int w, int h,
+                                               RenderingHints hints) {
+        // DSR -- code to try to get a unit scale
+        double sx = (double)w/getWidth();
+        double sy = (double)h/getHeight();
+        if (Math.abs(sx/sy - 1.0) < 0.01) {
+            sx = sy;
+        }
+        AffineTransform usr2dev = AffineTransform.getScaleInstance(sx, sy);
+        RenderContext newRC = new RenderContext(usr2dev, hints);
+        return createRendering(newRC);
+    }
+
+    /**
+     * Gets a RenderedImage instance of this image with a default
+     * width and height in pixels.  The RenderContext is built
+     * automatically with an appropriate usr2dev transform and an area
+     * of interest of the full image.  All the rendering hints come
+     * from hints passed in.  Implementors of this interface must be
+     * sure that there is a defined default width and height.
+     *
+     * @return a RenderedImage containing the rendered data.
+     */
+    public RenderedImage createDefaultRendering() {
+        AffineTransform usr2dev = new AffineTransform(); // Identity
+        RenderContext newRC = new RenderContext(usr2dev);
+        return createRendering(newRC);
+    }
+
+    /**
+     * Creates a RenderedImage which represents this
+     * RenderableImageOp (including its Renderable sources) rendered
+     * according to the given RenderContext.
+     *
+     * <p> This method supports chaining of either Renderable or
+     * RenderedImage operations.  If sources in
+     * the ParameterBlock used to construct the RenderableImageOp are
+     * RenderableImages, then a three step process is followed:
+     *
+     * <ol>
+     * <li> mapRenderContext() is called on the associated CRIF for
+     * each RenderableImage source;
+     * <li> createRendering() is called on each of the RenderableImage sources
+     * using the backwards-mapped RenderContexts obtained in step 1,
+     * resulting in a rendering of each source;
+     * <li> ContextualRenderedImageFactory.create() is called
+     * with a new ParameterBlock containing the parameters of
+     * the RenderableImageOp and the RenderedImages that were created by the
+     * createRendering() calls.
+     * </ol>
+     *
+     * <p> If the elements of the source Vector of
+     * the ParameterBlock used to construct the RenderableImageOp are
+     * instances of RenderedImage, then the CRIF.create() method is
+     * called immediately using the original ParameterBlock.
+     * This provides a basis case for the recursion.
+     *
+     * <p> The created RenderedImage may have a property identified
+     * by the String HINTS_OBSERVED to indicate which RenderingHints
+     * (from the RenderContext) were used to create the image.
+     * In addition any RenderedImages
+     * that are obtained via the getSources() method on the created
+     * RenderedImage may have such a property.
+     *
+     * @param renderContext The RenderContext to use to perform the rendering.
+     * @return a RenderedImage containing the desired output image.
+     */
+    public RenderedImage createRendering(RenderContext renderContext) {
+        RenderedImage image = null;
+        RenderContext rcOut = null;
+
+        // Clone the original ParameterBlock; if the ParameterBlock
+        // contains RenderableImage sources, they will be replaced by
+        // RenderedImages.
+        ParameterBlock renderedParamBlock = (ParameterBlock)paramBlock.clone();
+        Vector sources = getRenderableSources();
+
+        try {
+            // This assumes that if there is no renderable source, that there
+            // is a rendered source in paramBlock
+
+            if (sources != null) {
+                Vector renderedSources = new Vector();
+                for (int i = 0; i < sources.size(); i++) {
+                    rcOut = myCRIF.mapRenderContext(i, renderContext,
+                                                    paramBlock, this);
+                    RenderedImage rdrdImage =
+                       ((RenderableImage)sources.elementAt(i)).createRendering(rcOut);
+                    if (rdrdImage == null) {
+                        return null;
+                    }
+
+                    // Add this rendered image to the ParameterBlock's
+                    // list of RenderedImages.
+                    renderedSources.addElement(rdrdImage);
+                }
+
+                if (renderedSources.size() > 0) {
+                    renderedParamBlock.setSources(renderedSources);
+                }
+            }
+
+            return myCRIF.create(renderContext, renderedParamBlock);
+        } catch (ArrayIndexOutOfBoundsException e) {
+            // This should never happen
+            return null;
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/classes/java/awt/image/renderable/RenderableImageProducer.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,219 @@
+/*
+ * Portions Copyright 1998 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) Eastman Kodak Company, 1997                      ***
+ *** As  an unpublished  work pursuant to Title 17 of the United    ***
+ *** States Code.  All rights reserved.                             ***
+ **********************************************************************
+ **********************************************************************
+ **********************************************************************/
+
+package java.awt.image.renderable;
+import java.awt.color.ColorSpace;
+import java.awt.image.ColorModel;
+import java.awt.image.DataBuffer;
+import java.awt.image.DirectColorModel;
+import java.awt.image.ImageConsumer;
+import java.awt.image.ImageProducer;
+import java.awt.image.Raster;
+import java.awt.image.RenderedImage;
+import java.awt.image.SampleModel;
+import java.util.Enumeration;
+import java.util.Vector;
+
+/**
+ * An adapter class that implements ImageProducer to allow the
+ * asynchronous production of a RenderableImage.  The size of the
+ * ImageConsumer is determined by the scale factor of the usr2dev
+ * transform in the RenderContext.  If the RenderContext is null, the
+ * default rendering of the RenderableImage is used.  This class
+ * implements an asynchronous production that produces the image in
+ * one thread at one resolution.  This class may be subclassed to
+ * implement versions that will render the image using several
+ * threads.  These threads could render either the same image at
+ * progressively better quality, or different sections of the image at
+ * a single resolution.
+ */
+public class RenderableImageProducer implements ImageProducer, Runnable {
+
+    /** The RenderableImage source for the producer. */
+    RenderableImage rdblImage;
+
+    /** The RenderContext to use for producing the image. */
+    RenderContext rc;
+
+    /** A Vector of image consumers. */
+    Vector ics = new Vector();
+
+    /**
+     * Constructs a new RenderableImageProducer from a RenderableImage
+     * and a RenderContext.
+     *
+     * @param rdblImage the RenderableImage to be rendered.
+     * @param rc the RenderContext to use for producing the pixels.
+     */
+    public RenderableImageProducer(RenderableImage rdblImage,
+                                   RenderContext rc) {
+        this.rdblImage = rdblImage;
+        this.rc = rc;
+    }
+
+    /**
+     * Sets a new RenderContext to use for the next startProduction() call.
+     *
+     * @param rc the new RenderContext.
+     */
+    public synchronized void setRenderContext(RenderContext rc) {
+        this.rc = rc;
+    }
+
+   /**
+     * Adds an ImageConsumer to the list of consumers interested in
+     * data for this image.
+     *
+     * @param ic an ImageConsumer to be added to the interest list.
+     */
+    public synchronized void addConsumer(ImageConsumer ic) {
+        if (!ics.contains(ic)) {
+            ics.addElement(ic);
+        }
+    }
+
+    /**
+     * Determine if an ImageConsumer is on the list of consumers
+     * currently interested in data for this image.
+     *
+     * @param ic the ImageConsumer to be checked.
+     * @return true if the ImageConsumer is on the list; false otherwise.
+     */
+    public synchronized boolean isConsumer(ImageConsumer ic) {
+        return ics.contains(ic);
+    }
+
+    /**
+     * Remove an ImageConsumer from the list of consumers interested in
+     * data for this image.
+     *
+     * @param ic the ImageConsumer to be removed.
+     */
+    public synchronized void removeConsumer(ImageConsumer ic) {
+        ics.removeElement(ic);
+    }
+
+    /**
+     * Adds an ImageConsumer to the list of consumers interested in
+     * data for this image, and immediately starts delivery of the
+     * image data through the ImageConsumer interface.
+     *
+     * @param ic the ImageConsumer to be added to the list of consumers.
+     */
+    public synchronized void startProduction(ImageConsumer ic) {
+        addConsumer(ic);
+        // Need to build a runnable object for the Thread.
+        Thread thread = new Thread(this, "RenderableImageProducer Thread");
+        thread.start();
+    }
+
+    /**
+     * Requests that a given ImageConsumer have the image data delivered
+     * one more time in top-down, left-right order.
+     *
+     * @param ic the ImageConsumer requesting the resend.
+     */
+    public void requestTopDownLeftRightResend(ImageConsumer ic) {
+        // So far, all pixels are already sent in TDLR order
+    }
+
+    /**
+     * The runnable method for this class. This will produce an image using
+     * the current RenderableImage and RenderContext and send it to all the
+     * ImageConsumer currently registered with this class.
+     */
+    public void run() {
+        // First get the rendered image
+        RenderedImage rdrdImage;
+        if (rc != null) {
+            rdrdImage = rdblImage.createRendering(rc);
+        } else {
+            rdrdImage = rdblImage.createDefaultRendering();
+        }
+
+        // And its ColorModel
+        ColorModel colorModel = rdrdImage.getColorModel();
+        Raster raster = rdrdImage.getData();
+        SampleModel sampleModel = raster.getSampleModel();
+        DataBuffer dataBuffer = raster.getDataBuffer();
+
+        if (colorModel == null) {
+            colorModel = ColorModel.getRGBdefault();
+        }
+        int minX = raster.getMinX();
+        int minY = raster.getMinY();
+        int width = raster.getWidth();
+        int height = raster.getHeight();
+
+        Enumeration icList;
+        ImageConsumer ic;
+        // Set up the ImageConsumers
+        icList = ics.elements();
+        while (icList.hasMoreElements()) {
+            ic = (ImageConsumer)icList.nextElement();
+            ic.setDimensions(width,height);
+            ic.setHints(ImageConsumer.TOPDOWNLEFTRIGHT |
+                        ImageConsumer.COMPLETESCANLINES |
+                        ImageConsumer.SINGLEPASS |
+                        ImageConsumer.SINGLEFRAME);
+        }
+
+        // Get RGB pixels from the raster scanline by scanline and
+        // send to consumers.
+        int pix[] = new int[width];
+        int i,j;
+        int numBands = sampleModel.getNumBands();
+        int tmpPixel[] = new int[numBands];
+        for (j = 0; j < height; j++) {
+            for(i = 0; i < width; i++) {
+                sampleModel.getPixel(i, j, tmpPixel, dataBuffer);
+                pix[i] = colorModel.getDataElement(tmpPixel, 0);
+            }
+            // Now send the scanline to the Consumers
+            icList = ics.elements();
+            while (icList.hasMoreElements()) {
+                ic = (ImageConsumer)icList.nextElement();
+                ic.setPixels(0, j, width, 1, colorModel, pix, 0, width);
+            }
+        }
+
+        // Now tell the consumers we're done.
+        icList = ics.elements();
+        while (icList.hasMoreElements()) {
+            ic = (ImageConsumer)icList.nextElement();
+            ic.imageComplete(ImageConsumer.STATICIMAGEDONE);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/classes/java/awt/image/renderable/RenderedImageFactory.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,78 @@
+/*
+ * Portions Copyright 1998 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) Eastman Kodak Company, 1997                      ***
+ *** As  an unpublished  work pursuant to Title 17 of the United    ***
+ *** States Code.  All rights reserved.                             ***
+ **********************************************************************
+ **********************************************************************
+ **********************************************************************/
+
+package java.awt.image.renderable;
+import java.awt.image.RenderedImage;
+import java.awt.RenderingHints;
+
+/**
+ * The RenderedImageFactory interface (often abbreviated RIF) is
+ * intended to be implemented by classes that wish to act as factories
+ * to produce different renderings, for example by executing a series
+ * of BufferedImageOps on a set of sources, depending on a specific
+ * set of parameters, properties, and rendering hints.
+ */
+public interface RenderedImageFactory {
+
+  /**
+   * Creates a RenderedImage representing the results of an imaging
+   * operation (or chain of operations) for a given ParameterBlock and
+   * RenderingHints.  The RIF may also query any source images
+   * referenced by the ParameterBlock for their dimensions,
+   * SampleModels, properties, etc., as necessary.
+   *
+   * <p> The create() method can return null if the
+   * RenderedImageFactory is not capable of producing output for the
+   * given set of source images and parameters.  For example, if a
+   * RenderedImageFactory is only capable of performing a 3x3
+   * convolution on single-banded image data, and the source image has
+   * multiple bands or the convolution Kernel is 5x5, null should be
+   * returned.
+   *
+   * <p> Hints should be taken into account, but can be ignored.
+   * The created RenderedImage may have a property identified
+   * by the String HINTS_OBSERVED to indicate which RenderingHints
+   * were used to create the image.  In addition any RenderedImages
+   * that are obtained via the getSources() method on the created
+   * RenderedImage may have such a property.
+   *
+   * @param paramBlock a ParameterBlock containing sources and parameters
+   *        for the RenderedImage to be created.
+   * @param hints a RenderingHints object containing hints.
+   * @return A RenderedImage containing the desired output.
+   */
+  RenderedImage create(ParameterBlock paramBlock,
+                       RenderingHints hints);
+}
--- a/jdk/src/share/classes/java/beans/DefaultPersistenceDelegate.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/java/beans/DefaultPersistenceDelegate.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2000-2008 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
@@ -164,53 +164,19 @@
         return new Expression(oldInstance, oldInstance.getClass(), "new", constructorArgs);
     }
 
-    private Method findMethod(Class type, String property) throws IntrospectionException {
+    private Method findMethod(Class type, String property) {
         if (property == null) {
             throw new IllegalArgumentException("Property name is null");
         }
-        BeanInfo info = Introspector.getBeanInfo(type);
-        for (PropertyDescriptor pd : info.getPropertyDescriptors()) {
-            if (property.equals(pd.getName())) {
-                Method method = pd.getReadMethod();
-                if (method != null) {
-                    return method;
-                }
-                throw new IllegalStateException("Could not find getter for the property " + property);
-            }
-        }
-        throw new IllegalStateException("Could not find property by the name " + property);
-    }
-
-    // This is a workaround for a bug in the introspector.
-    // PropertyDescriptors are not shared amongst subclasses.
-    private boolean isTransient(Class type, PropertyDescriptor pd) {
-        if (type == null) {
-            return false;
+        PropertyDescriptor pd = getPropertyDescriptor(type, property);
+        if (pd == null) {
+            throw new IllegalStateException("Could not find property by the name " + property);
         }
-        // This code was mistakenly deleted - it may be fine and
-        // is more efficient than the code below. This should
-        // all disappear anyway when property descriptors are shared
-        // by the introspector.
-        /*
-        Method getter = pd.getReadMethod();
-        Class declaringClass = getter.getDeclaringClass();
-        if (declaringClass == type) {
-            return Boolean.TRUE.equals(pd.getValue("transient"));
+        Method method = pd.getReadMethod();
+        if (method == null) {
+            throw new IllegalStateException("Could not find getter for the property " + property);
         }
-        */
-        String pName = pd.getName();
-        BeanInfo info = MetaData.getBeanInfo(type);
-        PropertyDescriptor[] propertyDescriptors = info.getPropertyDescriptors();
-        for (int i = 0; i < propertyDescriptors.length; ++i ) {
-            PropertyDescriptor pd2 = propertyDescriptors[i];
-            if (pName.equals(pd2.getName())) {
-                Object value = pd2.getValue("transient");
-                if (value != null) {
-                    return Boolean.TRUE.equals(value);
-                }
-            }
-        }
-        return isTransient(type.getSuperclass(), pd);
+        return method;
     }
 
     private static boolean equals(Object o1, Object o2) {
@@ -221,7 +187,7 @@
         Method getter = pd.getReadMethod();
         Method setter = pd.getWriteMethod();
 
-        if (getter != null && setter != null && !isTransient(type, pd)) {
+        if (getter != null && setter != null) {
             Expression oldGetExp = new Expression(oldInstance, getter.getName(), new Object[]{});
             Expression newGetExp = new Expression(newInstance, getter.getName(), new Object[]{});
             Object oldValue = oldGetExp.getValue();
@@ -254,14 +220,19 @@
 
     // Write out the properties of this instance.
     private void initBean(Class type, Object oldInstance, Object newInstance, Encoder out) {
-        // System.out.println("initBean: " + oldInstance);
-        BeanInfo info = MetaData.getBeanInfo(type);
-
+        BeanInfo info;
+        try {
+            info = Introspector.getBeanInfo(type);
+        } catch (IntrospectionException exception) {
+            return;
+        }
         // Properties
-        PropertyDescriptor[] propertyDescriptors = info.getPropertyDescriptors();
-        for (int i = 0; i < propertyDescriptors.length; ++i ) {
+        for (PropertyDescriptor d : info.getPropertyDescriptors()) {
+            if (d.isTransient()) {
+                continue;
+            }
             try {
-                doProperty(type, propertyDescriptors[i], oldInstance, newInstance, out);
+                doProperty(type, d, oldInstance, newInstance, out);
             }
             catch (Exception e) {
                 out.getExceptionListener().exceptionThrown(e);
@@ -295,9 +266,10 @@
         if (!java.awt.Component.class.isAssignableFrom(type)) {
             return; // Just handle the listeners of Components for now.
         }
-        EventSetDescriptor[] eventSetDescriptors = info.getEventSetDescriptors();
-        for (int e = 0; e < eventSetDescriptors.length; e++) {
-            EventSetDescriptor d = eventSetDescriptors[e];
+        for (EventSetDescriptor d : info.getEventSetDescriptors()) {
+            if (d.isTransient()) {
+                continue;
+            }
             Class listenerType = d.getListenerType();
 
 
@@ -408,4 +380,15 @@
             initBean(type, oldInstance, newInstance, out);
         }
     }
+
+    private static PropertyDescriptor getPropertyDescriptor(Class type, String property) {
+        try {
+            for (PropertyDescriptor pd : Introspector.getBeanInfo(type).getPropertyDescriptors()) {
+                if (property.equals(pd.getName()))
+                    return pd;
+            }
+        } catch (IntrospectionException exception) {
+        }
+        return null;
+    }
 }
--- a/jdk/src/share/classes/java/beans/EventSetDescriptor.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/java/beans/EventSetDescriptor.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 1996-2005 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1996-2008 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
@@ -369,6 +369,7 @@
             setClass0(method.getDeclaringClass());
         }
         addMethodDescriptor = new MethodDescriptor(method);
+        setTransient(method.getAnnotation(Transient.class));
     }
 
     /**
@@ -389,6 +390,7 @@
             setClass0(method.getDeclaringClass());
         }
         removeMethodDescriptor = new MethodDescriptor(method);
+        setTransient(method.getAnnotation(Transient.class));
     }
 
     /**
@@ -411,6 +413,7 @@
             setClass0(method.getDeclaringClass());
         }
         getMethodDescriptor = new MethodDescriptor(method);
+        setTransient(method.getAnnotation(Transient.class));
     }
 
     /**
--- a/jdk/src/share/classes/java/beans/FeatureDescriptor.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/java/beans/FeatureDescriptor.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 1996-2004 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1996-2008 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
@@ -32,7 +32,9 @@
 import java.lang.ref.SoftReference;
 
 import java.lang.reflect.Method;
-import java.lang.reflect.Type;
+
+import java.util.Enumeration;
+import java.util.Hashtable;
 
 /**
  * The FeatureDescriptor class is the common baseclass for PropertyDescriptor,
@@ -46,6 +48,7 @@
  */
 
 public class FeatureDescriptor {
+    private static final String TRANSIENT = "transient";
 
     private Reference<Class> classRef;
 
@@ -187,10 +190,7 @@
      * @param value  The value.
      */
     public void setValue(String attributeName, Object value) {
-        if (table == null) {
-            table = new java.util.Hashtable();
-        }
-        table.put(attributeName, value);
+        getTable().put(attributeName, value);
     }
 
     /**
@@ -201,10 +201,9 @@
      *     the attribute is unknown.
      */
     public Object getValue(String attributeName) {
-        if (table == null) {
-           return null;
-        }
-        return table.get(attributeName);
+        return (this.table != null)
+                ? this.table.get(attributeName)
+                : null;
     }
 
     /**
@@ -214,11 +213,8 @@
      * @return  An enumeration of the locale-independent names of any
      *    attributes that have been registered with setValue.
      */
-    public java.util.Enumeration<String> attributeNames() {
-        if (table == null) {
-            table = new java.util.Hashtable();
-        }
-        return table.keys();
+    public Enumeration<String> attributeNames() {
+        return getTable().keys();
     }
 
     /**
@@ -268,18 +264,56 @@
         addTable(old.table);
     }
 
-    private void addTable(java.util.Hashtable t) {
-        if (t == null) {
-            return;
+    /**
+     * Copies all values from the specified attribute table.
+     * If some attribute is exist its value should be overridden.
+     *
+     * @param table  the attribute table with new values
+     */
+    private void addTable(Hashtable<String, Object> table) {
+        if ((table != null) && !table.isEmpty()) {
+            getTable().putAll(table);
+        }
+    }
+
+    /**
+     * Returns the initialized attribute table.
+     *
+     * @return the initialized attribute table
+     */
+    private Hashtable<String, Object> getTable() {
+        if (this.table == null) {
+            this.table = new Hashtable<String, Object>();
         }
-        java.util.Enumeration keys = t.keys();
-        while (keys.hasMoreElements()) {
-            String key = (String)keys.nextElement();
-            Object value = t.get(key);
-            setValue(key, value);
+        return this.table;
+    }
+
+    /**
+     * Sets the "transient" attribute according to the annotation.
+     * If the "transient" attribute is already set
+     * it should not be changed.
+     *
+     * @param annotation  the annotation of the element of the feature
+     */
+    void setTransient(Transient annotation) {
+        if ((annotation != null) && (null == getValue(TRANSIENT))) {
+            setValue(TRANSIENT, annotation.value());
         }
     }
 
+    /**
+     * Indicates whether the feature is transient.
+     *
+     * @return {@code true} if the feature is transient,
+     *         {@code false} otherwise
+     */
+    boolean isTransient() {
+        Object value = getValue(TRANSIENT);
+        return (value instanceof Boolean)
+                ? (Boolean) value
+                : false;
+    }
+
     // Package private methods for recreating the weak/soft referent
 
     void setClass0(Class cls) {
@@ -293,39 +327,6 @@
     }
 
     /**
-     * Create a Reference wrapper for the object.
-     *
-     * @param obj object that will be wrapped
-     * @param soft true if a SoftReference should be created; otherwise Soft
-     * @return a Reference or null if obj is null.
-     */
-    static Reference createReference(Object obj, boolean soft) {
-        Reference ref = null;
-        if (obj != null) {
-            if (soft) {
-                ref = new SoftReference(obj);
-            } else {
-                ref = new WeakReference(obj);
-            }
-        }
-        return ref;
-    }
-
-    // Convenience method which creates a WeakReference.
-    static Reference createReference(Object obj) {
-        return createReference(obj, false);
-    }
-
-    /**
-     * Returns an object from a Reference wrapper.
-     *
-     * @return the Object in a wrapper or null.
-     */
-    static Object getObject(Reference ref) {
-        return (ref == null) ? null : (Object)ref.get();
-    }
-
-    /**
      * Creates a new soft reference that refers to the given object.
      *
      * @return a new soft reference or <code>null</code> if object is <code>null</code>
@@ -391,5 +392,5 @@
     private String shortDescription;
     private String name;
     private String displayName;
-    private java.util.Hashtable table;
+    private Hashtable<String, Object> table;
 }
--- a/jdk/src/share/classes/java/beans/IndexedPropertyDescriptor.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/java/beans/IndexedPropertyDescriptor.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 1996-2004 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1996-2008 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
@@ -231,6 +231,7 @@
 
         indexedReadMethodName = readMethod.getName();
         this.indexedReadMethodRef = getSoftReference(readMethod);
+        setTransient(readMethod.getAnnotation(Transient.class));
     }
 
 
@@ -303,6 +304,7 @@
 
         indexedWriteMethodName = writeMethod.getName();
         this.indexedWriteMethodRef = getSoftReference(writeMethod);
+        setTransient(writeMethod.getAnnotation(Transient.class));
     }
 
     /**
--- a/jdk/src/share/classes/java/beans/MetaData.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/java/beans/MetaData.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2000-2008 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
@@ -1352,7 +1352,6 @@
 
 class MetaData {
     private static Hashtable internalPersistenceDelegates = new Hashtable();
-    private static Hashtable transientProperties = new Hashtable();
 
     private static PersistenceDelegate nullPersistenceDelegate = new NullPersistenceDelegate();
     private static PersistenceDelegate enumPersistenceDelegate = new EnumPersistenceDelegate();
@@ -1383,94 +1382,6 @@
 
         internalPersistenceDelegates.put("java.util.JumboEnumSet", new java_util_EnumSet_PersistenceDelegate());
         internalPersistenceDelegates.put("java.util.RegularEnumSet", new java_util_EnumSet_PersistenceDelegate());
-
-// Transient properties
-
-  // awt
-
-    // Infinite graphs.
-        removeProperty("java.awt.geom.RectangularShape", "frame");
-        // removeProperty("java.awt.Rectangle2D", "frame");
-        // removeProperty("java.awt.Rectangle", "frame");
-
-        removeProperty("java.awt.Rectangle", "bounds");
-        removeProperty("java.awt.Dimension", "size");
-        removeProperty("java.awt.Point", "location");
-
-        // The color and font properties in Component need special treatment, see above.
-        removeProperty("java.awt.Component", "foreground");
-        removeProperty("java.awt.Component", "background");
-        removeProperty("java.awt.Component", "font");
-
-        // The visible property of Component needs special treatment because of Windows.
-        removeProperty("java.awt.Component", "visible");
-
-        // This property throws an exception if accessed when there is no child.
-        removeProperty("java.awt.ScrollPane", "scrollPosition");
-
-        // 4917458 this should be removed for XAWT since it may throw
-        // an unsupported exception if there isn't any input methods.
-        // This shouldn't be a problem since these are added behind
-        // the scenes automatically.
-        removeProperty("java.awt.im.InputContext", "compositionEnabled");
-
-  // swing
-
-        // The size properties in JComponent need special treatment, see above.
-        removeProperty("javax.swing.JComponent", "minimumSize");
-        removeProperty("javax.swing.JComponent", "preferredSize");
-        removeProperty("javax.swing.JComponent", "maximumSize");
-
-        // These properties have platform specific implementations
-        // and should not appear in archives.
-        removeProperty("javax.swing.ImageIcon", "image");
-        removeProperty("javax.swing.ImageIcon", "imageObserver");
-
-        // This property unconditionally throws a "not implemented" exception.
-        removeProperty("javax.swing.JMenuBar", "helpMenu");
-
-        // The scrollBars in a JScrollPane are dynamic and should not
-        // be archived. The row and columns headers are changed by
-        // components like JTable on "addNotify".
-        removeProperty("javax.swing.JScrollPane", "verticalScrollBar");
-        removeProperty("javax.swing.JScrollPane", "horizontalScrollBar");
-        removeProperty("javax.swing.JScrollPane", "rowHeader");
-        removeProperty("javax.swing.JScrollPane", "columnHeader");
-
-        removeProperty("javax.swing.JViewport", "extentSize");
-
-        // Renderers need special treatment, since their properties
-        // change during rendering.
-        removeProperty("javax.swing.table.JTableHeader", "defaultRenderer");
-        removeProperty("javax.swing.JList", "cellRenderer");
-
-        removeProperty("javax.swing.JList", "selectedIndices");
-
-        // The lead and anchor selection indexes are best ignored.
-        // Selection is rarely something that should persist from
-        // development to deployment.
-        removeProperty("javax.swing.DefaultListSelectionModel", "leadSelectionIndex");
-        removeProperty("javax.swing.DefaultListSelectionModel", "anchorSelectionIndex");
-
-        // The selection must come after the text itself.
-        removeProperty("javax.swing.JComboBox", "selectedIndex");
-
-        // All selection information should come after the JTabbedPane is built
-        removeProperty("javax.swing.JTabbedPane", "selectedIndex");
-        removeProperty("javax.swing.JTabbedPane", "selectedComponent");
-
-        // PENDING: The "disabledIcon" property is often computed from the icon property.
-        removeProperty("javax.swing.AbstractButton", "disabledIcon");
-        removeProperty("javax.swing.JLabel", "disabledIcon");
-
-        // The caret property throws errors when it it set beyond
-        // the extent of the text. We could just set it after the
-        // text, but this is probably not something we want to archive anyway.
-        removeProperty("javax.swing.text.JTextComponent", "caret");
-        removeProperty("javax.swing.text.JTextComponent", "caretPosition");
-        // The selectionStart must come after the text itself.
-        removeProperty("javax.swing.text.JTextComponent", "selectionStart");
-        removeProperty("javax.swing.text.JTextComponent", "selectionEnd");
     }
 
     /*pp*/ static boolean equals(Object o1, Object o2) {
@@ -1509,18 +1420,6 @@
         // }
 
         String typeName = type.getName();
-
-        // Check to see if there are properties that have been lazily registered for removal.
-        if (getBeanAttribute(type, "transient_init") == null) {
-            Vector tp = (Vector)transientProperties.get(typeName);
-            if (tp != null) {
-                for(int i = 0; i < tp.size(); i++) {
-                    setPropertyAttribute(type, (String)tp.get(i), "transient", Boolean.TRUE);
-                }
-            }
-            setBeanAttribute(type, "transient_init", Boolean.TRUE);
-        }
-
         PersistenceDelegate pd = (PersistenceDelegate)getBeanAttribute(type, "persistenceDelegate");
         if (pd == null) {
             pd = (PersistenceDelegate)internalPersistenceDelegates.get(typeName);
@@ -1583,55 +1482,11 @@
         return true;
     }
 
-    // Wrapper for Introspector.getBeanInfo to handle exception handling.
-    // Note: this relys on new 1.4 Introspector semantics which cache the BeanInfos
-    public static BeanInfo getBeanInfo(Class type) {
-        BeanInfo info = null;
+    private static Object getBeanAttribute(Class type, String attribute) {
         try {
-            info = Introspector.getBeanInfo(type);
-        } catch (Throwable e) {
-            e.printStackTrace();
-        }
-
-        return info;
-    }
-
-    private static PropertyDescriptor getPropertyDescriptor(Class type, String propertyName) {
-        BeanInfo info = getBeanInfo(type);
-        PropertyDescriptor[] propertyDescriptors = info.getPropertyDescriptors();
-        // System.out.println("Searching for: " + propertyName + " in " + type);
-        for(int i = 0; i < propertyDescriptors.length; i++) {
-            PropertyDescriptor pd  = propertyDescriptors[i];
-            if (propertyName.equals(pd.getName())) {
-                return pd;
-            }
+            return Introspector.getBeanInfo(type).getBeanDescriptor().getValue(attribute);
+        } catch (IntrospectionException exception) {
+            return null;
         }
-        return null;
-    }
-
-    private static void setPropertyAttribute(Class type, String property, String attribute, Object value) {
-        PropertyDescriptor pd = getPropertyDescriptor(type, property);
-        if (pd == null) {
-            System.err.println("Warning: property " + property + " is not defined on " + type);
-            return;
-        }
-        pd.setValue(attribute, value);
-    }
-
-    private static void setBeanAttribute(Class type, String attribute, Object value) {
-        getBeanInfo(type).getBeanDescriptor().setValue(attribute, value);
-    }
-
-    private static Object getBeanAttribute(Class type, String attribute) {
-        return getBeanInfo(type).getBeanDescriptor().getValue(attribute);
-    }
-
-    private static void removeProperty(String typeName, String property) {
-        Vector tp = (Vector)transientProperties.get(typeName);
-        if (tp == null) {
-            tp = new Vector();
-            transientProperties.put(typeName, tp);
-        }
-        tp.add(property);
     }
 }
--- a/jdk/src/share/classes/java/beans/PropertyDescriptor.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/java/beans/PropertyDescriptor.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 1996-2004 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1996-2008 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
@@ -256,6 +256,7 @@
 
         readMethodName = readMethod.getName();
         this.readMethodRef = getSoftReference(readMethod);
+        setTransient(readMethod.getAnnotation(Transient.class));
     }
 
     /**
@@ -320,7 +321,7 @@
 
         writeMethodName = writeMethod.getName();
         this.writeMethodRef = getSoftReference(writeMethod);
-
+        setTransient(writeMethod.getAnnotation(Transient.class));
     }
 
     private Method getReadMethod0() {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/classes/java/beans/Transient.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,68 @@
+/*
+ * Copyright 2008 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 java.beans;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * Indicates that an attribute called "transient"
+ * should be declared with the given {@code value}
+ * when the {@link Introspector} constructs
+ * a {@link PropertyDescriptor} or {@link EventSetDescriptor}
+ * classes associated with the annotated code element.
+ * A {@code true} value for the "transient" attribute
+ * indicates to encoders derived from {@link Encoder}
+ * that this feature should be ignored.
+ * <p/>
+ * The {@code Transient} annotation may be be used
+ * in any of the methods that are involved
+ * in a {@link FeatureDescriptor} subclass
+ * to identify the transient feature in the annotated class and its subclasses.
+ * Normally, the method that starts with "get" is the best place
+ * to put the annotation and it is this declaration
+ * that takes precedence in the case of multiple annotations
+ * being defined for the same feature.
+ * <p/>
+ * To declare a feature non-transient in a class
+ * whose superclass declares it transient,
+ * use {@code @Transient(false)}.
+ * In all cases, the {@link Introspector} decides
+ * if a feature is transient by referring to the annotation
+ * on the most specific superclass.
+ * If no {@code Transient} annotation is present
+ * in any superclass the feature is not transient.
+ *
+ * @since 1.7
+ */
+@Target({METHOD})
+@Retention(RUNTIME)
+public @interface Transient {
+    boolean value() default true;
+}
--- a/jdk/src/share/classes/java/lang/management/ClassLoadingMXBean.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/java/lang/management/ClassLoadingMXBean.java	Thu Jun 12 13:50:55 2008 -0700
@@ -35,7 +35,7 @@
  * that can be obtained by calling
  * the {@link ManagementFactory#getClassLoadingMXBean} method or
  * from the {@link ManagementFactory#getPlatformMBeanServer
- * platform <tt>MBeanServer</tt>} method.
+ * platform <tt>MBeanServer</tt>}.
  *
  * <p>The <tt>ObjectName</tt> for uniquely identifying the MXBean for
  * the class loading system within an <tt>MBeanServer</tt> is:
@@ -44,6 +44,10 @@
  *        <tt>java.lang:type=ClassLoading</tt>}
  * </blockquote>
  *
+ * It can be obtained by calling the
+ * {@link PlatformManagedObject#getObjectName} method.
+ *
+ * @see ManagementFactory#getPlatformMXBeans(Class)
  * @see <a href="../../../javax/management/package-summary.html">
  *      JMX Specification.</a>
  * @see <a href="package-summary.html#examples">
@@ -52,7 +56,7 @@
  * @author  Mandy Chung
  * @since   1.5
  */
-public interface ClassLoadingMXBean {
+public interface ClassLoadingMXBean extends PlatformManagedObject {
 
     /**
      * Returns the total number of classes that have been loaded since
--- a/jdk/src/share/classes/java/lang/management/CompilationMXBean.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/java/lang/management/CompilationMXBean.java	Thu Jun 12 13:50:55 2008 -0700
@@ -44,6 +44,10 @@
  *         <tt>java.lang:type=Compilation</tt>}
  * </blockquote>
  *
+ * It can be obtained by calling the
+ * {@link PlatformManagedObject#getObjectName} method.
+ *
+ * @see ManagementFactory#getPlatformMXBeans(Class)
  * @see <a href="../../../javax/management/package-summary.html">
  *      JMX Specification.</a>
  * @see <a href="package-summary.html#examples">
@@ -52,7 +56,7 @@
  * @author  Mandy Chung
  * @since   1.5
  */
-public interface CompilationMXBean {
+public interface CompilationMXBean extends PlatformManagedObject {
     /**
      * Returns the name of the Just-in-time (JIT) compiler.
      *
--- a/jdk/src/share/classes/java/lang/management/GarbageCollectorMXBean.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/java/lang/management/GarbageCollectorMXBean.java	Thu Jun 12 13:50:55 2008 -0700
@@ -48,9 +48,13 @@
  *    <tt>java.lang:type=GarbageCollector</tt>}<tt>,name=</tt><i>collector's name</i>
  * </blockquote>
  *
+ * It can be obtained by calling the
+ * {@link PlatformManagedObject#getObjectName} method.
+ *
  * A platform usually includes additional platform-dependent information
  * specific to a garbage collection algorithm for monitoring.
  *
+ * @see ManagementFactory#getPlatformMXBeans(Class)
  * @see MemoryMXBean
  *
  * @see <a href="../../../javax/management/package-summary.html">
--- a/jdk/src/share/classes/java/lang/management/ManagementFactory.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/java/lang/management/ManagementFactory.java	Thu Jun 12 13:50:55 2008 -0700
@@ -24,17 +24,31 @@
  */
 
 package java.lang.management;
+import javax.management.DynamicMBean;
 import javax.management.MBeanServer;
 import javax.management.MBeanServerConnection;
+import javax.management.MBeanServerFactory;
 import javax.management.MBeanServerPermission;
+import javax.management.NotificationEmitter;
+import javax.management.ObjectInstance;
 import javax.management.ObjectName;
+import javax.management.InstanceAlreadyExistsException;
 import javax.management.InstanceNotFoundException;
 import javax.management.MalformedObjectNameException;
+import javax.management.MBeanRegistrationException;
+import javax.management.NotCompliantMBeanException;
+import javax.management.StandardEmitterMBean;
+import javax.management.StandardMBean;
+import java.util.Collections;
+import java.util.ArrayList;
 import java.util.List;
 import java.security.AccessController;
 import java.security.Permission;
 import java.security.PrivilegedAction;
+import java.security.PrivilegedActionException;
+import java.security.PrivilegedExceptionAction;
 import javax.management.JMX;
+import sun.management.ManagementFactoryHelper;
 
 /**
  * The <tt>ManagementFactory</tt> class is a factory class for getting
@@ -49,13 +63,16 @@
  * <ul>
  * <li><i>Direct access to an MXBean interface</i>
  *     <ol type="a">
- *     <li>Get the MXBean instance through the static factory method
+ *     <li>Get the MXBean instance through the static factory method,
+ *         or the {@link #getPlatformMXBeans(Class)} method
  *         and access the MXBean locally of the running
  *         virtual machine.
  *         </li>
  *     <li>Construct an MXBean proxy instance that forwards the
  *         method calls to a given {@link MBeanServer MBeanServer} by calling
- *         {@link #newPlatformMXBeanProxy newPlatfromMXBeanProxy}.
+ *         the {@link #newPlatformMXBeanProxy newPlatformMXBeanProxy} method
+ *         or the {@link #getPlatformMXBeans(MBeanServerConnection, Class)}
+ *         method.
  *         A proxy is typically constructed to remotely access
  *         an MXBean of another running virtual machine.
  *         </li>
@@ -83,6 +100,10 @@
  * a set of basic data types described below.
  * See <a href="../../../javax/management/MXBean.html#MXBean-spec">
  * the specification of MXBeans</a> for details.
+ * All platform MXBean interfaces extend {@link PlatformManagedObject}s
+ * and new methods may be added in these interfaces
+ * in future Java SE releases.
+ * <p>
  * A JMX management application and the platform <tt>MBeanServer</tt>
  * can interoperate without requiring classes for MXBean specific
  * data types.
@@ -191,7 +212,10 @@
  * <h4><a name="MXBeanNames">MXBean Names</a></h4>
  * Each platform MXBean for a Java virtual machine has a unique
  * {@link javax.management.ObjectName ObjectName} for
- * registration in the platform <tt>MBeanServer</tt>.
+ * registration in the platform <tt>MBeanServer</tt> that can
+ * be obtained by calling the {@link PlatformManagedObject#getObjectName}
+ * method.
+ *
  * A Java virtual machine has a single instance of the following management
  * interfaces:
  *
@@ -275,7 +299,7 @@
  * </blockquote>
  *
  * @see <a href="../../../javax/management/package-summary.html">
- *      JMX Specification.</a>
+ *      JMX Specification</a>
  * @see <a href="package-summary.html#examples">
  *      Ways to Access Management Metrics</a>
  * @see java.util.logging.LoggingMXBean
@@ -368,7 +392,7 @@
      * the Java virtual machine.
      */
     public static ClassLoadingMXBean getClassLoadingMXBean() {
-        return sun.management.ManagementFactory.getClassLoadingMXBean();
+        return ManagementFactoryHelper.getClassLoadingMXBean();
     }
 
     /**
@@ -378,7 +402,7 @@
      * @return a {@link MemoryMXBean} object for the Java virtual machine.
      */
     public static MemoryMXBean getMemoryMXBean() {
-        return sun.management.ManagementFactory.getMemoryMXBean();
+        return ManagementFactoryHelper.getMemoryMXBean();
     }
 
     /**
@@ -388,7 +412,7 @@
      * @return a {@link ThreadMXBean} object for the Java virtual machine.
      */
     public static ThreadMXBean getThreadMXBean() {
-        return sun.management.ManagementFactory.getThreadMXBean();
+        return ManagementFactoryHelper.getThreadMXBean();
     }
 
     /**
@@ -399,7 +423,7 @@
 
      */
     public static RuntimeMXBean getRuntimeMXBean() {
-        return sun.management.ManagementFactory.getRuntimeMXBean();
+        return ManagementFactoryHelper.getRuntimeMXBean();
     }
 
     /**
@@ -412,7 +436,7 @@
      *   no compilation system.
      */
     public static CompilationMXBean getCompilationMXBean() {
-        return sun.management.ManagementFactory.getCompilationMXBean();
+        return ManagementFactoryHelper.getCompilationMXBean();
     }
 
     /**
@@ -423,7 +447,7 @@
      * the Java virtual machine.
      */
     public static OperatingSystemMXBean getOperatingSystemMXBean() {
-        return sun.management.ManagementFactory.getOperatingSystemMXBean();
+        return ManagementFactoryHelper.getOperatingSystemMXBean();
     }
 
     /**
@@ -436,7 +460,7 @@
      *
      */
     public static List<MemoryPoolMXBean> getMemoryPoolMXBeans() {
-        return sun.management.ManagementFactory.getMemoryPoolMXBeans();
+        return ManagementFactoryHelper.getMemoryPoolMXBeans();
     }
 
     /**
@@ -449,7 +473,7 @@
      *
      */
     public static List<MemoryManagerMXBean> getMemoryManagerMXBeans() {
-        return sun.management.ManagementFactory.getMemoryManagerMXBeans();
+        return ManagementFactoryHelper.getMemoryManagerMXBeans();
     }
 
 
@@ -465,7 +489,7 @@
      *
      */
     public static List<GarbageCollectorMXBean> getGarbageCollectorMXBeans() {
-        return sun.management.ManagementFactory.getGarbageCollectorMXBeans();
+        return ManagementFactoryHelper.getGarbageCollectorMXBeans();
     }
 
     private static MBeanServer platformMBeanServer;
@@ -518,8 +542,25 @@
         }
 
         if (platformMBeanServer == null) {
-            platformMBeanServer =
-                sun.management.ManagementFactory.createPlatformMBeanServer();
+            platformMBeanServer = MBeanServerFactory.createMBeanServer();
+            for (PlatformComponent pc : PlatformComponent.values()) {
+                List<? extends PlatformManagedObject> list =
+                    pc.getMXBeans(pc.getMXBeanInterface());
+                for (PlatformManagedObject o : list) {
+                    // Each PlatformComponent represents one management
+                    // interface. Some MXBean may extend another one.
+                    // The MXBean instances for one platform component
+                    // (returned by pc.getMXBeans()) might be also
+                    // the MXBean instances for another platform component.
+                    // e.g. com.sun.management.GarbageCollectorMXBean
+                    //
+                    // So need to check if an MXBean instance is registered
+                    // before registering into the platform MBeanServer
+                    if (!platformMBeanServer.isRegistered(o.getObjectName())) {
+                        addMXBean(platformMBeanServer, o);
+                    }
+                }
+            }
         }
         return platformMBeanServer;
     }
@@ -657,6 +698,136 @@
         }
     }
 
+    /**
+     * Returns the list of platform MXBeans that implement
+     * the given {@code mxbeanInterface} in the running Java
+     * virtual machine.
+     * The returned list may contain zero, one, or more instances.
+     * The number of instances in the returned list is defined
+     * in the specification of the given management interface.
+     *
+     * @param mxbeanInterface a management interface for a platform
+     *                        MXBean
+     *
+     * @return the list of platform MXBeans that implements
+     * {@code mxbeanInterface}.
+     *
+     * @throws IllegalArgumentException if {@code mxbeanInterface}
+     * is not a management interface for the platform.
+     *
+     * @since 1.7
+     */
+    public static <T extends PlatformManagedObject> List<T>
+            getPlatformMXBeans(Class<T> mxbeanInterface) {
+        String className = mxbeanInterface.getName();
+        for (PlatformComponent component: PlatformComponent.values()) {
+            // comparing the class name first instead of the Class instance
+            // to avoid causing unnecessary class loading of
+            // the other MXBean interfaces
+            if (className.equals(component.getMXBeanInterfaceName())) {
+                if (component.getMXBeanInterface() == mxbeanInterface) {
+                    return component.getMXBeans(mxbeanInterface);
+                }
+            }
+        }
+        throw new IllegalArgumentException(mxbeanInterface.getName() +
+            " is not implemented by any of the platform MXBeans.");
+    }
+
+    /**
+     * Returns the list of the platform MXBean proxies for
+     * forwarding the method calls of the {@code mxbeanInterface}
+     * through the given {@code MBeanServerConnection}.
+     * The returned list may contain zero, one, or more instances.
+     * The number of instances in the returned list is defined
+     * in the specification of the given management interface.
+     *
+     * @param connection the {@code MBeanServerConnection} to forward to.
+     * @param mxbeanInterface a management interface for a platform
+     *                        MXBean
+     *
+     * @return the list of platform MXBean proxies for
+     * forwarding the method calls of the {@code mxbeanInterface}
+     * through the given {@code MBeanServerConnection}.
+     *
+     * @throws IllegalArgumentException if {@code mxbeanInterface}
+     * is not a management interface for the platform.
+     *
+     * @throws java.io.IOException if a communication problem
+     * occurred when accessing the {@code MBeanServerConnection}.
+     *
+     * @since 1.7
+     */
+    public static <T extends PlatformManagedObject>
+        List<T> getPlatformMXBeans(MBeanServerConnection connection,
+                                   Class<T> mxbeanInterface)
+        throws java.io.IOException
+    {
+        String className = mxbeanInterface.getName();
+        for (PlatformComponent component: PlatformComponent.values()) {
+            // comparing the class name first instead of the Class instance
+            // to avoid causing unnecessary class loading of
+            // the other MXBean interfaces
+            if (className.equals(component.getMXBeanInterfaceName())) {
+                if (component.getMXBeanInterface() == mxbeanInterface) {
+                    return component.getMXBeans(connection,
+                                                mxbeanInterface);
+                }
+            }
+        }
+        throw new IllegalArgumentException(mxbeanInterface.getName() +
+            " is not implemented by any of the platform MXBeans.");
+    }
+
+    /**
+     * Returns a list of {@code Class} objects, subinterface of
+     * {@link PlatformManagedObject}, representing
+     * all management interfaces for
+     * monitoring and managing the Java platform.
+     *
+     * @return a list of {@code Class} objects, subinterface of
+     * {@link PlatformManagedObject} representing
+     * the management interfaces for
+     * monitoring and managing the Java platform.
+     *
+     * @since 1.7
+     */
+    public static List<Class<? extends PlatformManagedObject>> getAllPlatformMXBeanInterfaces() {
+        List<Class<? extends PlatformManagedObject>> result =
+            new ArrayList<Class<? extends PlatformManagedObject>>();
+        for (PlatformComponent component: PlatformComponent.values()) {
+            result.add(component.getMXBeanInterface());
+        }
+        return result;
+    }
+
     private static final String NOTIF_EMITTER =
         "javax.management.NotificationEmitter";
+
+    /**
+     * Registers an MXBean.
+     */
+    private static void addMXBean(final MBeanServer mbs, final PlatformManagedObject pmo) {
+        // Make DynamicMBean out of MXBean by wrapping it with a StandardMBean
+        final DynamicMBean dmbean;
+        if (pmo instanceof NotificationEmitter) {
+            dmbean = new StandardEmitterMBean(pmo, null, true, (NotificationEmitter) pmo);
+        } else {
+            dmbean = new StandardMBean(pmo, null, true);
+        }
+
+        try {
+            AccessController.doPrivileged(new PrivilegedExceptionAction<Void>() {
+                public Void run() throws InstanceAlreadyExistsException,
+                                         MBeanRegistrationException,
+                                         NotCompliantMBeanException {
+                    mbs.registerMBean(dmbean, pmo.getObjectName());
+                    return null;
+                }
+            });
+        } catch (PrivilegedActionException e) {
+            throw new RuntimeException(e.getException());
+        }
+    }
+
 }
--- a/jdk/src/share/classes/java/lang/management/MemoryMXBean.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/java/lang/management/MemoryMXBean.java	Thu Jun 12 13:50:55 2008 -0700
@@ -46,6 +46,9 @@
  *           <tt>java.lang:type=Memory</tt>}
  * </blockquote>
  *
+ * It can be obtained by calling the
+ * {@link PlatformManagedObject#getObjectName} method.
+ *
  * <h4> Memory </h4>
  * The memory system of the Java virtual machine manages
  * the following kinds of memory:
@@ -190,6 +193,7 @@
  * emitter.addNotificationListener(listener, null, null);
  * </pre></blockquote>
  *
+ * @see ManagementFactory#getPlatformMXBeans(Class)
  * @see <a href="../../../javax/management/package-summary.html">
  *      JMX Specification.</a>
  * @see <a href="package-summary.html#examples">
@@ -198,7 +202,7 @@
  * @author  Mandy Chung
  * @since   1.5
  */
-public interface MemoryMXBean {
+public interface MemoryMXBean extends PlatformManagedObject {
     /**
      * Returns the approximate number of objects for which
      * finalization is pending.
--- a/jdk/src/share/classes/java/lang/management/MemoryManagerMXBean.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/java/lang/management/MemoryManagerMXBean.java	Thu Jun 12 13:50:55 2008 -0700
@@ -45,6 +45,10 @@
  *    <tt>java.lang:type=MemoryManager</tt>}<tt>,name=</tt><i>manager's name</i>
  * </blockquote>
  *
+ * It can be obtained by calling the
+ * {@link PlatformManagedObject#getObjectName} method.
+ *
+ * @see ManagementFactory#getPlatformMXBeans(Class)
  * @see MemoryMXBean
  *
  * @see <a href="../../../javax/management/package-summary.html">
@@ -55,7 +59,7 @@
  * @author  Mandy Chung
  * @since   1.5
  */
-public interface MemoryManagerMXBean {
+public interface MemoryManagerMXBean extends PlatformManagedObject {
     /**
      * Returns the name representing this memory manager.
      *
--- a/jdk/src/share/classes/java/lang/management/MemoryPoolMXBean.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/java/lang/management/MemoryPoolMXBean.java	Thu Jun 12 13:50:55 2008 -0700
@@ -46,6 +46,9 @@
  *    <tt>java.lang:type=MemoryPool</tt>}<tt>,name=</tt><i>pool's name</i>
  * </blockquote>
  *
+ * It can be obtained by calling the
+ * {@link PlatformManagedObject#getObjectName} method.
+ *
  * <h4>Memory Type</h4>
  * <p>The Java virtual machine has a heap for object allocation and also
  * maintains non-heap memory for the method area and the Java virtual
@@ -349,6 +352,7 @@
  * described above for the <a href="#UsageThreshold">usage threshold</a>
  * in a similar fashion.
  *
+ * @see ManagementFactory#getPlatformMXBeans(Class)
  * @see <a href="../../../javax/management/package-summary.html">
  *      JMX Specification.</a>
  * @see <a href="package-summary.html#examples">
@@ -357,7 +361,7 @@
  * @author  Mandy Chung
  * @since   1.5
  */
-public interface MemoryPoolMXBean {
+public interface MemoryPoolMXBean extends PlatformManagedObject {
     /**
      * Returns the name representing this memory pool.
      *
--- a/jdk/src/share/classes/java/lang/management/OperatingSystemMXBean.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/java/lang/management/OperatingSystemMXBean.java	Thu Jun 12 13:50:55 2008 -0700
@@ -44,10 +44,14 @@
  *      <tt>java.lang:type=OperatingSystem</tt>}
  * </blockquote>
  *
+ * It can be obtained by calling the
+ * {@link PlatformManagedObject#getObjectName} method.
+ *
  * <p> This interface defines several convenient methods for accessing
  * system properties about the operating system on which the Java
  * virtual machine is running.
  *
+ * @see ManagementFactory#getPlatformMXBeans(Class)
  * @see <a href="../../../javax/management/package-summary.html">
  *      JMX Specification.</a>
  * @see <a href="package-summary.html#examples">
@@ -56,7 +60,7 @@
  * @author  Mandy Chung
  * @since   1.5
  */
-public interface OperatingSystemMXBean {
+public interface OperatingSystemMXBean extends PlatformManagedObject {
     /**
      * Returns the operating system name.
      * This method is equivalent to <tt>System.getProperty("os.name")</tt>.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/classes/java/lang/management/PlatformComponent.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,382 @@
+/*
+ * Copyright 2008 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 java.lang.management;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.logging.LoggingMXBean;
+import java.util.logging.LogManager;
+import javax.management.MBeanServerConnection;
+import javax.management.MalformedObjectNameException;
+import javax.management.ObjectName;
+
+import com.sun.management.HotSpotDiagnosticMXBean;
+import com.sun.management.UnixOperatingSystemMXBean;
+
+import sun.management.ManagementFactoryHelper;
+
+/**
+ * This enum class defines the list of platform components
+ * that provides monitoring and management support.
+ * Each enum represents one MXBean interface. A MXBean
+ * instance could implement one or more MXBean interfaces.
+ *
+ * For example, com.sun.management.GarbageCollectorMXBean
+ * extends java.lang.management.GarbageCollectorMXBean
+ * and there is one set of garbage collection MXBean instances,
+ * each of which implements both c.s.m. and j.l.m. interfaces.
+ * There are two separate enums GARBAGE_COLLECTOR
+ * and SUN_GARBAGE_COLLECTOR so that ManagementFactory.getPlatformMXBeans(Class)
+ * will return the list of MXBeans of the specified type.
+ *
+ * To add a new MXBean interface for the Java platform,
+ * add a new enum constant and implement the MXBeanFetcher.
+ */
+enum PlatformComponent {
+
+    /**
+     * Class loading system of the Java virtual machine.
+     */
+    CLASS_LOADING(
+        "java.lang.management.ClassLoadingMXBean",
+        "java.lang", "ClassLoading", defaultKeyProperties(),
+        new MXBeanFetcher<ClassLoadingMXBean>() {
+            public List<ClassLoadingMXBean> getMXBeans() {
+                return Collections.singletonList(ManagementFactoryHelper.getClassLoadingMXBean());
+            }
+        }),
+
+    /**
+     * Compilation system of the Java virtual machine.
+     */
+    COMPILATION(
+        "java.lang.management.CompilationMXBean",
+        "java.lang", "Compilation", defaultKeyProperties(),
+        new MXBeanFetcher<CompilationMXBean>() {
+            public List<CompilationMXBean> getMXBeans() {
+                CompilationMXBean m = ManagementFactoryHelper.getCompilationMXBean();
+                if (m == null) {
+                   return Collections.emptyList();
+                } else {
+                   return Collections.singletonList(m);
+                }
+            }
+        }),
+
+    /**
+     * Memory system of the Java virtual machine.
+     */
+    MEMORY(
+        "java.lang.management.MemoryMXBean",
+        "java.lang", "Memory", defaultKeyProperties(),
+        new MXBeanFetcher<MemoryMXBean>() {
+            public List<MemoryMXBean> getMXBeans() {
+                return Collections.singletonList(ManagementFactoryHelper.getMemoryMXBean());
+            }
+        }),
+
+    /**
+     * Garbage Collector in the Java virtual machine.
+     */
+    GARBAGE_COLLECTOR(
+        "java.lang.management.GarbageCollectorMXBean",
+        "java.lang", "GarbageCollector", keyProperties("name"),
+        new MXBeanFetcher<GarbageCollectorMXBean>() {
+            public List<GarbageCollectorMXBean> getMXBeans() {
+                return ManagementFactoryHelper.
+                           getGarbageCollectorMXBeans();
+            }
+        }),
+
+    /**
+     * Memory manager in the Java virtual machine.
+     */
+    MEMORY_MANAGER(
+        "java.lang.management.MemoryManagerMXBean",
+        "java.lang", "MemoryManager", keyProperties("name"),
+        new MXBeanFetcher<MemoryManagerMXBean>() {
+            public List<MemoryManagerMXBean> getMXBeans() {
+                return ManagementFactoryHelper.getMemoryManagerMXBeans();
+            }
+        },
+        GARBAGE_COLLECTOR),
+
+    /**
+     * Memory pool in the Java virtual machine.
+     */
+    MEMORY_POOL(
+        "java.lang.management.MemoryPoolMXBean",
+        "java.lang", "MemoryPool", keyProperties("name"),
+        new MXBeanFetcher<MemoryPoolMXBean>() {
+            public List<MemoryPoolMXBean> getMXBeans() {
+                return ManagementFactoryHelper.getMemoryPoolMXBeans();
+            }
+        }),
+
+    /**
+     * Operating system on which the Java virtual machine is running
+     */
+    OPERATING_SYSTEM(
+        "java.lang.management.OperatingSystemMXBean",
+        "java.lang", "OperatingSystem", defaultKeyProperties(),
+        new MXBeanFetcher<OperatingSystemMXBean>() {
+            public List<OperatingSystemMXBean> getMXBeans() {
+                return Collections.singletonList(ManagementFactoryHelper.getOperatingSystemMXBean());
+            }
+        }),
+
+    /**
+     * Runtime system of the Java virtual machine.
+     */
+    RUNTIME(
+        "java.lang.management.RuntimeMXBean",
+        "java.lang", "Runtime", defaultKeyProperties(),
+        new MXBeanFetcher<RuntimeMXBean>() {
+            public List<RuntimeMXBean> getMXBeans() {
+                return Collections.singletonList(ManagementFactoryHelper.getRuntimeMXBean());
+            }
+        }),
+
+    /**
+     * Threading system of the Java virtual machine.
+     */
+    THREADING(
+        "java.lang.management.ThreadMXBean",
+        "java.lang", "Threading", defaultKeyProperties(),
+        new MXBeanFetcher<ThreadMXBean>() {
+            public List<ThreadMXBean> getMXBeans() {
+                return Collections.singletonList(ManagementFactoryHelper.getThreadMXBean());
+            }
+        }),
+
+
+    /**
+     * Logging facility.
+     */
+    LOGGING(
+        "java.util.logging.LoggingMXBean",
+        "java.util.logging", "Logging", defaultKeyProperties(),
+        new MXBeanFetcher<LoggingMXBean>() {
+            public List<LoggingMXBean> getMXBeans() {
+                return Collections.singletonList(LogManager.getLoggingMXBean());
+            }
+        }),
+
+    // Sun Platform Extension
+
+    /**
+     * Sun extension garbage collector that performs collections in cycles.
+     */
+    SUN_GARBAGE_COLLECTOR(
+        "com.sun.management.GarbageCollectorMXBean",
+        "java.lang", "GarbageCollector", keyProperties("name"),
+        new MXBeanFetcher<com.sun.management.GarbageCollectorMXBean>() {
+            public List<com.sun.management.GarbageCollectorMXBean> getMXBeans() {
+                return getGcMXBeanList(com.sun.management.GarbageCollectorMXBean.class);
+            }
+        }),
+
+    /**
+     * Sun extension operating system on which the Java virtual machine
+     * is running.
+     */
+    SUN_OPERATING_SYSTEM(
+        "com.sun.management.OperatingSystemMXBean",
+        "java.lang", "OperatingSystem", defaultKeyProperties(),
+        new MXBeanFetcher<com.sun.management.OperatingSystemMXBean>() {
+            public List<com.sun.management.OperatingSystemMXBean> getMXBeans() {
+                return getOSMXBeanList(com.sun.management.OperatingSystemMXBean.class);
+            }
+        }),
+
+    /**
+     * Unix operating system.
+     */
+    SUN_UNIX_OPERATING_SYSTEM(
+        "com.sun.management.UnixOperatingSystemMXBean",
+        "java.lang", "OperatingSystem", defaultKeyProperties(),
+        new MXBeanFetcher<UnixOperatingSystemMXBean>() {
+            public List<UnixOperatingSystemMXBean> getMXBeans() {
+                return getOSMXBeanList(com.sun.management.UnixOperatingSystemMXBean.class);
+            }
+        }),
+
+    /**
+     * Diagnostic support for the HotSpot Virtual Machine.
+     */
+    HOTSPOT_DIAGNOSTIC(
+        "com.sun.management.HotSpotDiagnosticMXBean",
+        "com.sun.management", "HotSpotDiagnostic", defaultKeyProperties(),
+        new MXBeanFetcher<HotSpotDiagnosticMXBean>() {
+            public List<HotSpotDiagnosticMXBean> getMXBeans() {
+                return Collections.singletonList(ManagementFactoryHelper.getDiagnosticMXBean());
+            }
+        });
+
+
+    /**
+     * A task that returns the MXBeans for a component.
+     */
+    interface MXBeanFetcher<T extends PlatformManagedObject> {
+        public List<T> getMXBeans();
+    }
+
+    /*
+     * Returns a list of the GC MXBeans of the given type.
+     */
+    private static <T extends GarbageCollectorMXBean>
+            List<T> getGcMXBeanList(Class<T> gcMXBeanIntf) {
+        List<GarbageCollectorMXBean> list =
+            ManagementFactoryHelper.getGarbageCollectorMXBeans();
+        List<T> result = new ArrayList<T>(list.size());
+        for (GarbageCollectorMXBean m : list) {
+            if (gcMXBeanIntf.isInstance(m)) {
+                result.add(gcMXBeanIntf.cast(m));
+            }
+        }
+        return result;
+    }
+
+    /*
+     * Returns the OS mxbean instance of the given type.
+     */
+    private static <T extends OperatingSystemMXBean>
+            List<T> getOSMXBeanList(Class<T> osMXBeanIntf) {
+        OperatingSystemMXBean m =
+            ManagementFactoryHelper.getOperatingSystemMXBean();
+        if (osMXBeanIntf.isInstance(m)) {
+            return Collections.singletonList(osMXBeanIntf.cast(m));
+        } else {
+            return Collections.emptyList();
+        }
+    }
+
+    private final String mxbeanInterfaceName;
+    private final String domain;
+    private final String type;
+    private final Set<String> keyProperties;
+    private final MXBeanFetcher fetcher;
+    private final PlatformComponent[] subComponents;
+
+    private PlatformComponent(String intfName,
+                              String domain, String type,
+                              Set<String> keyProperties,
+                              MXBeanFetcher fetcher) {
+        this.mxbeanInterfaceName = intfName;
+        this.domain = domain;
+        this.type = type;
+        this.keyProperties = keyProperties;
+        this.fetcher = fetcher;
+        this.subComponents = new PlatformComponent[0];
+    }
+    private PlatformComponent(String intfName,
+                              String domain, String type,
+                              Set<String> keyProperties,
+                              MXBeanFetcher fetcher,
+                              PlatformComponent... subComponents) {
+        this.mxbeanInterfaceName = intfName;
+        this.domain = domain;
+        this.type = type;
+        this.keyProperties = keyProperties;
+        this.fetcher = fetcher;
+        this.subComponents = subComponents;
+    }
+
+    private static Set<String> defaultKeyProps;
+    private static Set<String> defaultKeyProperties() {
+        if (defaultKeyProps == null) {
+            defaultKeyProps = Collections.singleton("type");
+        }
+        return defaultKeyProps;
+    }
+
+    private static Set<String> keyProperties(String... keyNames) {
+        Set<String> set = new HashSet<String>();
+        set.add("type");
+        for (String s : keyNames) {
+            set.add(s);
+        }
+        return set;
+    }
+
+    String getMXBeanInterfaceName() {
+        return mxbeanInterfaceName;
+    }
+
+    @SuppressWarnings("unchecked")
+    Class<? extends PlatformManagedObject> getMXBeanInterface() {
+        try {
+            // Lazy loading the MXBean interface only when it is needed
+            return (Class<? extends PlatformManagedObject>)
+                       Class.forName(mxbeanInterfaceName, false, null);
+        } catch (ClassNotFoundException x) {
+            throw new AssertionError(x);
+        }
+    }
+
+    @SuppressWarnings("unchecked")
+    <T extends PlatformManagedObject>
+        List<T> getMXBeans(Class<T> mxbeanInterface)
+    {
+        return fetcher.getMXBeans();
+    }
+
+    <T extends PlatformManagedObject>
+        List<T> getMXBeans(MBeanServerConnection mbs, Class<T> mxbeanInterface)
+        throws java.io.IOException
+    {
+        List<T> result = new ArrayList<T>();
+        for (ObjectName on : getObjectNames(mbs)) {
+            result.add(ManagementFactory.
+                newPlatformMXBeanProxy(mbs,
+                                       on.getCanonicalName(),
+                                       mxbeanInterface)
+            );
+        }
+        return result;
+    }
+
+    private Set<ObjectName> getObjectNames(MBeanServerConnection mbs)
+        throws java.io.IOException
+    {
+        String domainAndType = domain + ":type=" + type;
+        if (keyProperties.size() > 1) {
+            // if there are more than 1 key properties (i.e. other than "type")
+            domainAndType += ",*";
+        }
+        ObjectName on = com.sun.jmx.mbeanserver.Util.newObjectName(domainAndType);
+        Set<ObjectName> set =  mbs.queryNames(on, null);
+        for (PlatformComponent pc : subComponents) {
+            set.addAll(pc.getObjectNames(mbs));
+        }
+        return set;
+    }
+
+    private static final long serialVersionUID = 6992337162326171013L;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/classes/java/lang/management/PlatformManagedObject.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,61 @@
+/*
+ * Copyright 2008 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 java.lang.management;
+
+import javax.management.ObjectName;
+
+/**
+ * A platform managed object is a {@linkplain javax.management.MXBean JMX MXBean}
+ * for monitoring and managing a component in the Java platform.
+ * Each platform managed object has a unique
+ * <a href="ManagementFactory.html#MXBean">object name</a>
+ * for the {@linkplain ManagementFactory.getPlatformMBeanServer
+ * platform MBeanServer} access.
+ * All platform MXBeans will implement this interface.
+ *
+ * <p>
+ * Note:
+ * The platform MXBean interfaces (i.e. all subinterfaces
+ * of {@code PlatformManagedObject}) are implemented
+ * by the Java platform only.  New methods may be added in these interfaces
+ * in future Java SE releases.
+ * In addition, this {@code PlatformManagedObject} interface is only
+ * intended for the management interfaces for the platform to extend but
+ * not for applications.
+ *
+ * @see <a href="ManagementFactory.html#MXBean">Platform MXBeans</a>
+ * @since 1.7
+ */
+public interface PlatformManagedObject {
+    /**
+     * Returns an {@link ObjectName ObjectName} instance representing
+     * the object name of this platform managed object.
+     *
+     * @return an {@link ObjectName ObjectName} instance representing
+     * the object name of this platform managed object.
+     */
+    public ObjectName getObjectName();
+}
--- a/jdk/src/share/classes/java/lang/management/RuntimeMXBean.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/java/lang/management/RuntimeMXBean.java	Thu Jun 12 13:50:55 2008 -0700
@@ -44,9 +44,13 @@
  *           <tt>java.lang:type=Runtime</tt>}
  * </blockquote>
  *
+ * It can be obtained by calling the
+ * {@link PlatformManagedObject#getObjectName} method.
+ *
  * <p> This interface defines several convenient methods for accessing
  * system properties about the Java virtual machine.
  *
+ * @see ManagementFactory#getPlatformMXBeans(Class)
  * @see <a href="../../../javax/management/package-summary.html">
  *      JMX Specification.</a>
  * @see <a href="package-summary.html#examples">
@@ -55,7 +59,7 @@
  * @author  Mandy Chung
  * @since   1.5
  */
-public interface RuntimeMXBean {
+public interface RuntimeMXBean extends PlatformManagedObject {
     /**
      * Returns the name representing the running Java virtual machine.
      * The returned name string can be any arbitrary string and
--- a/jdk/src/share/classes/java/lang/management/ThreadInfo.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/java/lang/management/ThreadInfo.java	Thu Jun 12 13:50:55 2008 -0700
@@ -26,6 +26,7 @@
 package java.lang.management;
 
 import javax.management.openmbean.CompositeData;
+import sun.management.ManagementFactoryHelper;
 import sun.management.ThreadInfoCompositeData;
 import static java.lang.Thread.State.*;
 
@@ -220,12 +221,9 @@
                             LockInfo[] lockedSynchronizers) {
         this.threadId = t.getId();
         this.threadName = t.getName();
-        this.threadState =
-            sun.management.ManagementFactory.toThreadState(state);
-        this.suspended =
-            sun.management.ManagementFactory.isThreadSuspended(state);
-        this.inNative =
-            sun.management.ManagementFactory.isThreadRunningNative(state);
+        this.threadState = ManagementFactoryHelper.toThreadState(state);
+        this.suspended = ManagementFactoryHelper.isThreadSuspended(state);
+        this.inNative = ManagementFactoryHelper.isThreadRunningNative(state);
         this.blockedCount = blockedCount;
         this.blockedTime = blockedTime;
         this.waitedCount = waitedCount;
--- a/jdk/src/share/classes/java/lang/management/ThreadMXBean.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/java/lang/management/ThreadMXBean.java	Thu Jun 12 13:50:55 2008 -0700
@@ -46,6 +46,9 @@
  *           <tt>java.lang:type=Threading</tt>}
  * </blockquote>
  *
+ * It can be obtained by calling the
+ * {@link PlatformManagedObject#getObjectName} method.
+ *
  * <h4>Thread ID</h4>
  * Thread ID is a positive long value returned by calling the
  * {@link java.lang.Thread#getId} method for a thread.
@@ -108,6 +111,7 @@
  * {@link #findDeadlockedThreads} methods to find deadlocks in
  * the running application.
  *
+ * @see ManagementFactory#getPlatformMXBeans(Class)
  * @see <a href="../../../javax/management/package-summary.html">
  *      JMX Specification.</a>
  * @see <a href="package-summary.html#examples">
@@ -117,7 +121,7 @@
  * @since   1.5
  */
 
-public interface ThreadMXBean {
+public interface ThreadMXBean extends PlatformManagedObject {
     /**
      * Returns the current number of live threads including both
      * daemon and non-daemon threads.
--- a/jdk/src/share/classes/java/net/CookieManager.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/java/net/CookieManager.java	Thu Jun 12 13:50:55 2008 -0700
@@ -205,11 +205,31 @@
         if (cookieJar == null)
             return Collections.unmodifiableMap(cookieMap);
 
+        boolean secureLink = "https".equalsIgnoreCase(uri.getScheme());
         List<HttpCookie> cookies = new java.util.ArrayList<HttpCookie>();
+        String path = uri.getPath();
+        if (path == null || path.isEmpty()) {
+            path = "/";
+        }
         for (HttpCookie cookie : cookieJar.get(uri)) {
             // apply path-matches rule (RFC 2965 sec. 3.3.4)
-            if (pathMatches(uri.getPath(), cookie.getPath())) {
-                cookies.add(cookie);
+            // and check for the possible "secure" tag (i.e. don't send
+            // 'secure' cookies over unsecure links)
+            if (pathMatches(path, cookie.getPath()) &&
+                    (secureLink || !cookie.getSecure())) {
+                // Let's check the authorize port list if it exists
+                String ports = cookie.getPortlist();
+                if (ports != null && !ports.isEmpty()) {
+                    int port = uri.getPort();
+                    if (port == -1) {
+                        port = "https".equals(uri.getScheme()) ? 443 : 80;
+                    }
+                    if (isInPortList(ports, port)) {
+                        cookies.add(cookie);
+                    }
+                } else {
+                    cookies.add(cookie);
+                }
             }
         }
 
@@ -251,8 +271,46 @@
                 try {
                     List<HttpCookie> cookies = HttpCookie.parse(headerValue);
                     for (HttpCookie cookie : cookies) {
-                        if (shouldAcceptInternal(uri, cookie)) {
-                            cookieJar.add(uri, cookie);
+                        if (cookie.getPath() == null) {
+                            // If no path is specified, then by default
+                            // the path is the directory of the page/doc
+                            String path = uri.getPath();
+                            if (!path.endsWith("/")) {
+                                int i = path.lastIndexOf("/");
+                                if (i > 0) {
+                                    path = path.substring(0, i + 1);
+                                } else {
+                                    path = "/";
+                                }
+                            }
+                            cookie.setPath(path);
+                        }
+                        String ports = cookie.getPortlist();
+                        if (ports != null) {
+                            int port = uri.getPort();
+                            if (port == -1) {
+                                port = "https".equals(uri.getScheme()) ? 443 : 80;
+                            }
+                            if (ports.isEmpty()) {
+                                // Empty port list means this should be restricted
+                                // to the incoming URI port
+                                cookie.setPortlist("" + port );
+                                if (shouldAcceptInternal(uri, cookie)) {
+                                    cookieJar.add(uri, cookie);
+                                }
+                            } else {
+                                // Only store cookies with a port list
+                                // IF the URI port is in that list, as per
+                                // RFC 2965 section 3.3.2
+                                if (isInPortList(ports, port) &&
+                                        shouldAcceptInternal(uri, cookie)) {
+                                    cookieJar.add(uri, cookie);
+                                }
+                            }
+                        } else {
+                            if (shouldAcceptInternal(uri, cookie)) {
+                                cookieJar.add(uri, cookie);
+                            }
                         }
                     }
                 } catch (IllegalArgumentException e) {
@@ -276,6 +334,32 @@
     }
 
 
+    static private boolean isInPortList(String lst, int port) {
+        int i = lst.indexOf(",");
+        int val = -1;
+        while (i > 0) {
+            try {
+                val = Integer.parseInt(lst.substring(0, i));
+                if (val == port) {
+                    return true;
+                }
+            } catch (NumberFormatException numberFormatException) {
+            }
+            lst = lst.substring(i+1);
+            i = lst.indexOf(",");
+        }
+        if (!lst.isEmpty()) {
+            try {
+                val = Integer.parseInt(lst);
+                if (val == port) {
+                    return true;
+                }
+            } catch (NumberFormatException numberFormatException) {
+            }
+        }
+        return false;
+    }
+
     /*
      * path-matches algorithm, as defined by RFC 2965
      */
--- a/jdk/src/share/classes/java/net/HttpCookie.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/java/net/HttpCookie.java	Thu Jun 12 13:50:55 2008 -0700
@@ -92,9 +92,14 @@
 
 
     //
-    // date format used by Netscape's cookie draft
+    // date formats used by Netscape's cookie draft
+    // as well as formats seen on various sites
     //
-    private final static String NETSCAPE_COOKIE_DATE_FORMAT = "EEE',' dd-MMM-yyyy HH:mm:ss 'GMT'";
+    private final static String[] COOKIE_DATE_FORMATS = {
+        "EEE',' dd-MMM-yyyy HH:mm:ss 'GMT'",
+        "EEE',' dd MMM yyyy HH:mm:ss 'GMT'",
+        "EEE MMM dd yyyy HH:mm:ss 'GMT'Z"
+    };
 
     //
     // constant strings represent set-cookie header token
@@ -148,6 +153,7 @@
         secure = false;
 
         whenCreated = System.currentTimeMillis();
+        portlist = null;
     }
 
 
@@ -505,14 +511,14 @@
 
 
     /**
-     * Indicates to the browser whether the cookie should only be sent
-     * using a secure protocol, such as HTTPS or SSL.
+     * Indicates whether the cookie should only be sent using a secure protocol,
+     * such as HTTPS or SSL.
      *
      * <p>The default value is <code>false</code>.
      *
-     * @param flag      if <code>true</code>, sends the cookie from the browser
-     *                  to the server using only when using a secure protocol;
-     *                  if <code>false</code>, sent on any protocol
+     * @param flag      If <code>true</code>, the cookie can only be sent over
+     *                  a secure protocol like https.
+     *                  If <code>false</code>, it can be sent over any protocol.
      *
      * @see #getSecure
      *
@@ -526,12 +532,12 @@
 
 
     /**
-     * Returns <code>true</code> if the browser is sending cookies
-     * only over a secure protocol, or <code>false</code> if the
-     * browser can send cookies using any protocol.
+     * Returns <code>true</code> if sending this cookie should be
+     * restricted to a secure protocol, or <code>false</code> if the
+     * it can be sent using any protocol.
      *
-     * @return          <code>true</code> if the browser can use
-     *                  any standard protocol; otherwise, <code>false</code>
+     * @return          <code>false</code> if the cookie can be sent over
+     *                  any standard protocol; otherwise, <code>true</code>
      *
      * @see #setSecure
      *
@@ -748,6 +754,7 @@
      *
      * @return  a string form of the cookie. The string has the defined format
      */
+    @Override
     public String toString() {
         if (getVersion() > 0) {
             return toRFC2965HeaderString();
@@ -768,6 +775,7 @@
      * @return          <tt>true</tt> if 2 http cookies equal to each other;
      *                  otherwise, <tt>false</tt>
      */
+    @Override
     public boolean equals(Object obj) {
         if (obj == this)
             return true;
@@ -798,6 +806,7 @@
      *
      * @return          this http cookie's hash code
      */
+    @Override
     public int hashCode() {
         int h1 = name.toLowerCase().hashCode();
         int h2 = (domain!=null) ? domain.toLowerCase().hashCode() : 0;
@@ -811,6 +820,7 @@
      *
      * @return          a clone of this http cookie
      */
+    @Override
     public Object clone() {
         try {
             return super.clone();
@@ -978,7 +988,7 @@
             });
         assignors.put("port", new CookieAttributeAssignor(){
                 public void assign(HttpCookie cookie, String attrName, String attrValue) {
-                    if (cookie.getPortlist() == null) cookie.setPortlist(attrValue);
+                    if (cookie.getPortlist() == null) cookie.setPortlist(attrValue == null ? "" : attrValue);
                 }
             });
         assignors.put("secure", new CookieAttributeAssignor(){
@@ -1050,24 +1060,31 @@
         return sb.toString();
     }
 
+    private static SimpleDateFormat[] cDateFormats = null;
+    static {
+            cDateFormats = new SimpleDateFormat[COOKIE_DATE_FORMATS.length];
+            for (int i = 0; i < COOKIE_DATE_FORMATS.length; i++) {
+                cDateFormats[i] = new SimpleDateFormat(COOKIE_DATE_FORMATS[i]);
+                cDateFormats[i].setTimeZone(TimeZone.getTimeZone("GMT"));
+            }
+    }
     /*
-     * @param dateString        a date string in format of
-     *                          "EEE',' dd-MMM-yyyy HH:mm:ss 'GMT'",
-     *                          which defined in Netscape cookie spec
+     * @param dateString        a date string in one of the formats
+     *                          defined in Netscape cookie spec
      *
      * @return                  delta seconds between this cookie's creation
      *                          time and the time specified by dateString
      */
     private long expiryDate2DeltaSeconds(String dateString) {
-        SimpleDateFormat df = new SimpleDateFormat(NETSCAPE_COOKIE_DATE_FORMAT);
-        df.setTimeZone(TimeZone.getTimeZone("GMT"));
+        for (SimpleDateFormat df : cDateFormats) {
+            try {
+                Date date = df.parse(dateString);
+                return (date.getTime() - whenCreated) / 1000;
+            } catch (Exception e) {
 
-        try {
-            Date date = df.parse(dateString);
-            return (date.getTime() - whenCreated) / 1000;
-        } catch (Exception e) {
-            return 0;
+            }
         }
+        return 0;
     }
 
 
--- a/jdk/src/share/classes/java/net/Socket.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/java/net/Socket.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 1995-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1995-2008 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
@@ -253,7 +253,8 @@
      *
      * @param host the name of the remote host, or <code>null</code> for the loopback address.
      * @param port the remote port
-     * @param localAddr the local address the socket is bound to
+     * @param localAddr the local address the socket is bound to, or
+     *        <code>null</code> for the <code>anyLocal</code> address.
      * @param localPort the local port the socket is bound to, or
      *        <code>zero</code> for a system selected free port.
      * @exception  IOException  if an I/O error occurs when creating the socket.
--- a/jdk/src/share/classes/java/security/AccessControlContext.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/java/security/AccessControlContext.java	Thu Jun 12 13:50:55 2008 -0700
@@ -101,13 +101,14 @@
     }
 
     /**
-     * Create an AccessControlContext with the given set of ProtectionDomains.
+     * Create an AccessControlContext with the given array of ProtectionDomains.
      * Context must not be null. Duplicate domains will be removed from the
      * context.
      *
      * @param context the ProtectionDomains associated with this context.
      * The non-duplicate domains are copied from the array. Subsequent
      * changes to the array will not affect this AccessControlContext.
+     * @throws NullPointerException if <code>context</code> is <code>null</code>
      */
     public AccessControlContext(ProtectionDomain context[])
     {
@@ -125,8 +126,10 @@
                 if ((context[i] != null) &&  (!v.contains(context[i])))
                     v.add(context[i]);
             }
-            this.context = new ProtectionDomain[v.size()];
-            this.context = v.toArray(this.context);
+            if (!v.isEmpty()) {
+                this.context = new ProtectionDomain[v.size()];
+                this.context = v.toArray(this.context);
+            }
         }
     }
 
--- a/jdk/src/share/classes/java/security/BasicPermission.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/java/security/BasicPermission.java	Thu Jun 12 13:50:55 2008 -0700
@@ -27,12 +27,10 @@
 
 import java.security.*;
 import java.util.Enumeration;
-import java.util.Iterator;
 import java.util.Map;
 import java.util.HashMap;
 import java.util.Hashtable;
 import java.util.Collections;
-import java.util.StringTokenizer;
 import java.io.ObjectStreamField;
 import java.io.ObjectOutputStream;
 import java.io.ObjectInputStream;
@@ -64,14 +62,8 @@
  * @see java.security.Permission
  * @see java.security.Permissions
  * @see java.security.PermissionCollection
- * @see java.lang.RuntimePermission
- * @see java.security.SecurityPermission
- * @see java.util.PropertyPermission
- * @see java.awt.AWTPermission
- * @see java.net.NetPermission
  * @see java.lang.SecurityManager
  *
- *
  * @author Marianne Mueller
  * @author Roland Schemers
  */
@@ -95,7 +87,6 @@
      * initialize a BasicPermission object. Common to all constructors.
      *
      */
-
     private void init(String name)
     {
         if (name == null)
@@ -213,8 +204,8 @@
      * and has the same name as this object.
      * <P>
      * @param obj the object we are testing for equality with this object.
-     * @return true if <i>obj</i> is a BasicPermission, and has the same name
-     *  as this BasicPermission object, false otherwise.
+     * @return true if <i>obj</i>'s class is the same as this object's class
+     *  and has the same name as this BasicPermission object, false otherwise.
      */
     public boolean equals(Object obj) {
         if (obj == this)
@@ -237,7 +228,6 @@
      *
      * @return a hash code value for this object.
      */
-
     public int hashCode() {
         return this.getName().hashCode();
     }
@@ -266,7 +256,6 @@
      * @return a new PermissionCollection object suitable for
      * storing BasicPermissions.
      */
-
     public PermissionCollection newPermissionCollection() {
         return new BasicPermissionCollection(this.getClass());
     }
--- a/jdk/src/share/classes/java/text/DictionaryBasedBreakIterator.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/java/text/DictionaryBasedBreakIterator.java	Thu Jun 12 13:50:55 2008 -0700
@@ -384,7 +384,7 @@
             // on the last character of a legal word.  Push that position onto
             // the possible-break-positions stack
             if (dictionary.getNextState(state, 0) == -1) {
-                possibleBreakPositions.push(new Integer(text.getIndex()));
+                possibleBreakPositions.push(Integer.valueOf(text.getIndex()));
             }
 
             // look up the new state to transition to in the dictionary
@@ -395,7 +395,7 @@
             // and we've successfully traversed the whole range.  Drop out
             // of the loop.
             if (state == -1) {
-                currentBreakPositions.push(new Integer(text.getIndex()));
+                currentBreakPositions.push(Integer.valueOf(text.getIndex()));
                 break;
             }
 
@@ -496,7 +496,7 @@
         if (!currentBreakPositions.isEmpty()) {
             currentBreakPositions.pop();
         }
-        currentBreakPositions.push(new Integer(endPos));
+        currentBreakPositions.push(Integer.valueOf(endPos));
 
         // create a regular array to hold the break positions and copy
         // the break positions from the stack to the array (in addition,
--- a/jdk/src/share/classes/java/text/MessageFormat.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/java/text/MessageFormat.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1286,7 +1286,7 @@
                             characterIterators.add(
                                          createAttributedCharacterIterator(
                                          subIterator, Field.ARGUMENT,
-                                         new Integer(argumentNumber)));
+                                         Integer.valueOf(argumentNumber)));
                             last = result.length();
                         }
                         arg = null;
@@ -1296,7 +1296,7 @@
                         characterIterators.add(
                                  createAttributedCharacterIterator(
                                  arg, Field.ARGUMENT,
-                                 new Integer(argumentNumber)));
+                                 Integer.valueOf(argumentNumber)));
                         last = result.length();
                     }
                 }
--- a/jdk/src/share/classes/java/util/IdentityHashMap.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/java/util/IdentityHashMap.java	Thu Jun 12 13:50:55 2008 -0700
@@ -188,7 +188,6 @@
     /**
      * Use NULL_KEY for key if it is null.
      */
-
     private static Object maskNull(Object key) {
         return (key == null ? NULL_KEY : key);
     }
@@ -378,8 +377,8 @@
      */
     public boolean containsValue(Object value) {
         Object[] tab = table;
-        for (int i = 1; i < tab.length; i+= 2)
-            if (tab[i] == value)
+        for (int i = 1; i < tab.length; i += 2)
+            if (tab[i] == value && tab[i - 1] != null)
                 return true;
 
         return false;
@@ -905,7 +904,6 @@
      * view the first time this view is requested.  The view is stateless,
      * so there's no reason to create more than one.
      */
-
     private transient Set<Map.Entry<K,V>> entrySet = null;
 
     /**
--- a/jdk/src/share/classes/java/util/TreeMap.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/java/util/TreeMap.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 1997-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-2008 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
@@ -1021,7 +1021,7 @@
     }
 
     Iterator<K> descendingKeyIterator() {
-        return new DescendingKeyIterator(getFirstEntry());
+        return new DescendingKeyIterator(getLastEntry());
     }
 
     static final class KeySet<E> extends AbstractSet<E> implements NavigableSet<E> {
--- a/jdk/src/share/classes/java/util/logging/Logging.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/java/util/logging/Logging.java	Thu Jun 12 13:50:55 2008 -0700
@@ -29,6 +29,8 @@
 import java.util.List;
 import java.util.ArrayList;
 
+import javax.management.ObjectName;
+
 /**
  * Logging is the implementation class of LoggingMXBean.
  *
@@ -115,4 +117,7 @@
         }
     }
 
+    public ObjectName getObjectName() {
+        return com.sun.jmx.mbeanserver.Util.newObjectName(LogManager.LOGGING_MXBEAN_NAME);
+    }
 }
--- a/jdk/src/share/classes/java/util/logging/LoggingMXBean.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/java/util/logging/LoggingMXBean.java	Thu Jun 12 13:50:55 2008 -0700
@@ -25,6 +25,8 @@
 
 package java.util.logging;
 
+import java.lang.management.PlatformManagedObject;
+
 /**
  * The management interface for the logging facility.
  *
@@ -43,14 +45,17 @@
  *           <tt>java.util.logging:type=Logging</tt>}
  * </blockquote>
  *
- * @see java.lang.management.ManagementFactory
+ * It can be obtained by calling the
+ * {@link PlatformManagedObject#getObjectName} method.
+ *
+ * @see java.lang.management.ManagementFactory#getPlatformMXBeans(Class)
  *
  * @author  Ron Mann
  * @author  Mandy Chung
  * @since   1.5
  *
  */
-public interface LoggingMXBean {
+public interface LoggingMXBean extends PlatformManagedObject {
 
     /**
      * Returns the list of currently registered loggers. This method
--- a/jdk/src/share/classes/java/util/regex/Pattern.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/java/util/regex/Pattern.java	Thu Jun 12 13:50:55 2008 -0700
@@ -2844,7 +2844,15 @@
     /**
      *  Utility method for parsing unicode escape sequences.
      */
-    private int u() {
+    private int cursor() {
+        return cursor;
+    }
+
+    private void setcursor(int pos) {
+        cursor = pos;
+    }
+
+    private int uxxxx() {
         int n = 0;
         for (int i = 0; i < 4; i++) {
             int ch = read();
@@ -2856,6 +2864,20 @@
         return n;
     }
 
+    private int u() {
+        int n = uxxxx();
+        if (Character.isHighSurrogate((char)n)) {
+            int cur = cursor();
+            if (read() == '\\' && read() == 'u') {
+                int n2 = uxxxx();
+                if (Character.isLowSurrogate((char)n2))
+                    return Character.toCodePoint((char)n, (char)n2);
+            }
+            setcursor(cur);
+        }
+        return n;
+    }
+
     //
     // Utility methods for code point support
     //
--- a/jdk/src/share/classes/javax/imageio/stream/ImageInputStreamImpl.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/javax/imageio/stream/ImageInputStreamImpl.java	Thu Jun 12 13:50:55 2008 -0700
@@ -778,8 +778,8 @@
      */
     public void mark() {
         try {
-            markByteStack.push(new Long(getStreamPosition()));
-            markBitStack.push(new Integer(getBitOffset()));
+            markByteStack.push(Long.valueOf(getStreamPosition()));
+            markBitStack.push(Integer.valueOf(getBitOffset()));
         } catch (IOException e) {
         }
     }
--- a/jdk/src/share/classes/javax/management/AndQueryExp.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/javax/management/AndQueryExp.java	Thu Jun 12 13:50:55 2008 -0700
@@ -100,12 +100,13 @@
    /**
     * Returns a string representation of this AndQueryExp
     */
-   public String toString() {
-     return "(" + exp1 + ") and (" + exp2 + ")";
-   }
+    @Override
+    public String toString() {
+        return "(" + exp1 + ") and (" + exp2 + ")";
+    }
 
-   @Override
-   String toQueryString() {
+    @Override
+    String toQueryString() {
         // Parentheses are only added if needed to disambiguate.
         return parens(exp1) + " and " + parens(exp2);
    }
--- a/jdk/src/share/classes/javax/management/BetweenQueryExp.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/javax/management/BetweenQueryExp.java	Thu Jun 12 13:50:55 2008 -0700
@@ -135,6 +135,7 @@
     /**
      * Returns the string representing the object.
      */
+    @Override
     public String toString()  {
         return "(" + exp1 + ") between (" + exp2 + ") and (" + exp3 + ")";
     }
--- a/jdk/src/share/classes/javax/management/BinaryRelQueryExp.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/javax/management/BinaryRelQueryExp.java	Thu Jun 12 13:50:55 2008 -0700
@@ -187,11 +187,11 @@
     /**
      * Returns the string representing the object.
      */
+    @Override
     public String toString()  {
         return "(" + exp1 + ") " + relOpString() + " (" + exp2 + ")";
     }
 
-    @Override
     String toQueryString() {
         return exp1 + " " + relOpString() + " " + exp2;
     }
--- a/jdk/src/share/classes/javax/management/NotQueryExp.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/javax/management/NotQueryExp.java	Thu Jun 12 13:50:55 2008 -0700
@@ -91,7 +91,6 @@
         return "not (" + exp + ")";
     }
 
-    @Override
     String toQueryString() {
         return "not (" + Query.toString(exp) + ")";
     }
--- a/jdk/src/share/classes/javax/management/NumericValueExp.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/javax/management/NumericValueExp.java	Thu Jun 12 13:50:55 2008 -0700
@@ -83,7 +83,7 @@
      * <p>The <b>serialVersionUID</b> of this class is <code>-4679739485102359104L</code>.
      */
     private static final ObjectStreamField[] serialPersistentFields;
-    private Number val = new Double(0);
+    private Number val = 0.0;
 
     private static boolean compat = false;
     static {
@@ -213,11 +213,11 @@
         }
         if (isLong)
         {
-          this.val = new Long(longVal);
+          this.val = longVal;
         }
         else
         {
-          this.val = new Double(doubleVal);
+          this.val = doubleVal;
         }
       }
       else
--- a/jdk/src/share/classes/javax/management/ObjectName.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/javax/management/ObjectName.java	Thu Jun 12 13:50:55 2008 -0700
@@ -223,8 +223,7 @@
  * @since 1.5
  */
 @SuppressWarnings("serial") // don't complain serialVersionUID not constant
-public class ObjectName extends ToQueryString
-        implements Comparable<ObjectName>, QueryExp {
+public class ObjectName implements Comparable<ObjectName>, QueryExp {
 
     /**
      * A structure recording property structure and
@@ -450,7 +449,7 @@
         // parses domain part
     domain_parsing:
         while (index < len) {
-            switch (c = name_chars[index]) {
+            switch (name_chars[index]) {
                 case ':' :
                     _domain_length = index++;
                     break domain_parsing;
@@ -620,7 +619,7 @@
                     case '\n' :
                         final String ichar = ((c1=='\n')?"\\n":""+c1);
                         throw new MalformedObjectNameException(
-                                                 "Invalid character '" + c1 +
+                                                 "Invalid character '" + ichar +
                                                  "' in value part of property");
                     default :
                         in_index++;
@@ -1781,7 +1780,6 @@
         return getSerializedNameString();
     }
 
-    @Override
     String toQueryString() {
         return "LIKE " + Query.value(toString());
     }
--- a/jdk/src/share/classes/javax/management/OrQueryExp.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/javax/management/OrQueryExp.java	Thu Jun 12 13:50:55 2008 -0700
@@ -100,6 +100,7 @@
     /**
      * Returns a string representation of this OrQueryExp
      */
+    @Override
     public String toString() {
         return "(" + exp1 + ") or (" + exp2 + ")";
     }
--- a/jdk/src/share/classes/javax/management/Query.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/javax/management/Query.java	Thu Jun 12 13:50:55 2008 -0700
@@ -979,8 +979,18 @@
          if (query == null)
              return null;
 
-         if (query instanceof ToQueryString)
-             return ((ToQueryString) query).toQueryString();
+         // This is ugly. At one stage we had a non-public class called
+         // ToQueryString with the toQueryString() method, and every class
+         // mentioned here inherited from that class. But that interfered
+         // with serialization of custom subclasses of e.g. QueryEval. Even
+         // though we could make it work by adding a public constructor to this
+         // non-public class, that seemed fragile because according to the
+         // serialization spec it shouldn't work. If only non-public interfaces
+         // could have non-public methods.
+         if (query instanceof ObjectName)
+             return ((ObjectName) query).toQueryString();
+         if (query instanceof QueryEval)
+             return ((QueryEval) query).toQueryString();
 
          return query.toString();
      }
--- a/jdk/src/share/classes/javax/management/QueryEval.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/javax/management/QueryEval.java	Thu Jun 12 13:50:55 2008 -0700
@@ -25,20 +25,15 @@
 
 package javax.management;
 
-
 // java import
 import java.io.Serializable;
 
-// RI import
-import javax.management.MBeanServer;
-
-
 /**
  * Allows a query to be performed in the context of a specific MBean server.
  *
  * @since 1.5
  */
-public abstract class QueryEval extends ToQueryString implements Serializable {
+public abstract class QueryEval implements Serializable {
 
     /* Serial version */
     private static final long serialVersionUID = 2675899265640874796L;
@@ -80,4 +75,10 @@
     public static MBeanServer getMBeanServer() {
         return server.get();
     }
+
+    // Subclasses in this package can override this method to return a different
+    // string.
+    String toQueryString() {
+        return toString();
+    }
 }
--- a/jdk/src/share/classes/javax/management/StandardMBean.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/javax/management/StandardMBean.java	Thu Jun 12 13:50:55 2008 -0700
@@ -750,7 +750,7 @@
      * @return the Descriptor for the new MBeanInfo.
      */
     Descriptor getDescriptor(MBeanInfo info, boolean immutableInfo) {
-        ImmutableDescriptor desc = null;
+        ImmutableDescriptor desc;
         if (info == null ||
             info.getDescriptor() == null ||
             info.getDescriptor().getFieldNames().length == 0) {
--- a/jdk/src/share/classes/javax/management/loading/MLet.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/javax/management/loading/MLet.java	Thu Jun 12 13:50:55 2008 -0700
@@ -591,8 +591,8 @@
              // Instantiate the class specified in the
              // CODE or OBJECT section of the MLet tag
              //
-             Object o = null;
-             ObjectInstance objInst = null;
+             Object o;
+             ObjectInstance objInst;
 
              if (code != null && serName != null) {
                  final String msg =
@@ -1131,11 +1131,17 @@
              return null;
          } finally {
              // Cleanup ...
-             if (tmpFile!=null) try {
-                 tmpFile.delete();
-             } catch (Exception x) {
-                 MLET_LOGGER.logp(Level.FINEST, MLet.class.getName(),
-                         "getTmpDir", "Failed to delete temporary file", x);
+             if (tmpFile!=null) {
+                 try {
+                     boolean deleted = tmpFile.delete();
+                     if (!deleted) {
+                         MLET_LOGGER.logp(Level.FINEST, MLet.class.getName(),
+                                 "getTmpDir", "Failed to delete temp file");
+                     }
+                 } catch (Exception x) {
+                     MLET_LOGGER.logp(Level.FINEST, MLet.class.getName(),
+                             "getTmpDir", "Failed to delete temporary file", x);
+                 }
              }
         }
      }
@@ -1178,25 +1184,8 @@
     * Removes any white space from a string. This is used to
     * convert strings such as "Windows NT" to "WindowsNT".
     */
-     private String removeSpace(String s) {
-         s = s.trim();
-         int j = s.indexOf(' ');
-         if (j == -1) {
-             return s;
-         }
-         String temp = "";
-         int k = 0;
-         while (j != -1) {
-             s = s.substring(k);
-             j = s.indexOf(' ');
-             if (j != -1) {
-                 temp = temp + s.substring(0, j);
-             } else {
-                 temp = temp + s.substring(0);
-             }
-             k = j + 1;
-         }
-         return temp;
+     private static String removeSpace(String s) {
+         return s.trim().replace(" ", "");
      }
 
      /**
--- a/jdk/src/share/classes/javax/management/loading/MLetParser.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/javax/management/loading/MLetParser.java	Thu Jun 12 13:50:55 2008 -0700
@@ -240,14 +240,12 @@
                                 MLET_LOGGER.logp(Level.FINER,
                                         MLetParser.class.getName(),
                                         mth, requiresCodeWarning);
-                                atts = null;
                                 throw new IOException(requiresCodeWarning);
                             }
                             if (atts.get("archive") == null) {
                                 MLET_LOGGER.logp(Level.FINER,
                                         MLetParser.class.getName(),
                                         mth, requiresJarsWarning);
-                                atts = null;
                                 throw new IOException(requiresJarsWarning);
                             }
                         }
@@ -265,7 +263,7 @@
     public List<MLetContent> parseURL(String urlname) throws IOException {
         // Parse the document
         //
-        URL url = null;
+        URL url;
         if (urlname.indexOf(':') <= 1) {
             String userDir = System.getProperty("user.dir");
             String prot;
--- a/jdk/src/share/classes/javax/management/modelmbean/DescriptorSupport.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/javax/management/modelmbean/DescriptorSupport.java	Thu Jun 12 13:50:55 2008 -0700
@@ -591,8 +591,6 @@
         Set returnedSet = descriptorMap.entrySet();
 
         int i = 0;
-        Object currValue = null;
-        Map.Entry currElement = null;
 
         if (MODELMBEAN_LOGGER.isLoggable(Level.FINEST)) {
             MODELMBEAN_LOGGER.logp(Level.FINEST,
@@ -600,7 +598,7 @@
                     "getFields()", "Returning " + numberOfEntries + " fields");
         }
         for (Iterator iter = returnedSet.iterator(); iter.hasNext(); i++) {
-            currElement = (Map.Entry) iter.next();
+            Map.Entry currElement = (Map.Entry) iter.next();
 
             if (currElement == null) {
                 if (MODELMBEAN_LOGGER.isLoggable(Level.FINEST)) {
@@ -609,7 +607,7 @@
                             "getFields()", "Element is null");
                 }
             } else {
-                currValue = currElement.getValue();
+                Object currValue = currElement.getValue();
                 if (currValue == null) {
                     responseFields[i] = currElement.getKey() + "=";
                 } else {
@@ -1127,7 +1125,7 @@
             final char c = entities[i].charAt(0);
             final String entity = entities[i].substring(1);
             charToEntityMap[c] = entity;
-            entityToCharMap.put(entity, new Character(c));
+            entityToCharMap.put(entity, c);
         }
     }
 
@@ -1325,13 +1323,11 @@
     // utility to convert to int, returns -2 if bogus.
 
     private long toNumeric(String inStr) {
-        long result = -2;
         try {
-            result = java.lang.Long.parseLong(inStr);
+            return java.lang.Long.parseLong(inStr);
         } catch (Exception e) {
             return -2;
         }
-        return result;
     }
 
 
--- a/jdk/src/share/classes/javax/management/modelmbean/ModelMBeanAttributeInfo.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/javax/management/modelmbean/ModelMBeanAttributeInfo.java	Thu Jun 12 13:50:55 2008 -0700
@@ -432,7 +432,7 @@
          */
         private Descriptor validDescriptor(final Descriptor in) throws RuntimeOperationsException {
 
-            Descriptor clone = null;
+            Descriptor clone;
             if (in == null) {
                 clone = new DescriptorSupport();
                 MODELMBEAN_LOGGER.finer("Null Descriptor, creating new.");
--- a/jdk/src/share/classes/javax/management/modelmbean/ModelMBeanConstructorInfo.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/javax/management/modelmbean/ModelMBeanConstructorInfo.java	Thu Jun 12 13:50:55 2008 -0700
@@ -393,7 +393,7 @@
          * @exception RuntimeOperationsException if Descriptor is invalid
          */
         private Descriptor validDescriptor(final Descriptor in) throws RuntimeOperationsException {
-           Descriptor clone = null;
+           Descriptor clone;
             if (in == null) {
                 clone = new DescriptorSupport();
                 MODELMBEAN_LOGGER.finer("Null Descriptor, creating new.");
--- a/jdk/src/share/classes/javax/management/modelmbean/ModelMBeanInfoSupport.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/javax/management/modelmbean/ModelMBeanInfoSupport.java	Thu Jun 12 13:50:55 2008 -0700
@@ -944,7 +944,7 @@
      * @exception RuntimeOperationsException if Descriptor is invalid
      */
     private Descriptor validDescriptor(final Descriptor in) throws RuntimeOperationsException {
-        Descriptor clone = null;
+        Descriptor clone;
         if (in == null) {
             clone = new DescriptorSupport();
             MODELMBEAN_LOGGER.finer("Null Descriptor, creating new.");
--- a/jdk/src/share/classes/javax/management/modelmbean/ModelMBeanNotificationInfo.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/javax/management/modelmbean/ModelMBeanNotificationInfo.java	Thu Jun 12 13:50:55 2008 -0700
@@ -328,7 +328,7 @@
      * @exception RuntimeOperationsException if Descriptor is invalid
      */
     private Descriptor validDescriptor(final Descriptor in) throws RuntimeOperationsException {
-        Descriptor clone = null;
+        Descriptor clone;
         if (in == null) {
             clone = new DescriptorSupport();
             MODELMBEAN_LOGGER.finer("Null Descriptor, creating new.");
--- a/jdk/src/share/classes/javax/management/modelmbean/ModelMBeanOperationInfo.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/javax/management/modelmbean/ModelMBeanOperationInfo.java	Thu Jun 12 13:50:55 2008 -0700
@@ -424,7 +424,7 @@
          */
         private Descriptor validDescriptor(final Descriptor in)
         throws RuntimeOperationsException {
-            Descriptor clone = null;
+            Descriptor clone;
             if (in == null) {
                 clone = new DescriptorSupport();
                 MODELMBEAN_LOGGER.finer("Null Descriptor, creating new.");
--- a/jdk/src/share/classes/javax/management/modelmbean/RequiredModelMBean.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/javax/management/modelmbean/RequiredModelMBean.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1425,9 +1425,7 @@
         }
 
         /* Check attributeDescriptor for getMethod */
-        ModelMBeanAttributeInfo attrInfo=null;
-        Descriptor attrDescr=null;
-        Object response = null;
+        Object response;
 
         try {
             if (modelMBeanInfo == null)
@@ -1435,14 +1433,14 @@
                       "getAttribute failed: ModelMBeanInfo not found for "+
                       attrName);
 
-            attrInfo = modelMBeanInfo.getAttribute(attrName);
+            ModelMBeanAttributeInfo attrInfo = modelMBeanInfo.getAttribute(attrName);
             Descriptor mmbDesc = modelMBeanInfo.getMBeanDescriptor();
 
             if (attrInfo == null)
                 throw new AttributeNotFoundException("getAttribute failed:"+
                       " ModelMBeanAttributeInfo not found for " + attrName);
 
-            attrDescr = attrInfo.getDescriptor();
+            Descriptor attrDescr = attrInfo.getDescriptor();
             if (attrDescr != null) {
                 if (!attrInfo.isReadable())
                     throw new AttributeNotFoundException(
@@ -1684,14 +1682,13 @@
             "getAttributes(String[])","Entry");
         }
 
-        AttributeList responseList = null;
         if (attrNames == null)
             throw new RuntimeOperationsException(new
                 IllegalArgumentException("attributeNames must not be null"),
                 "Exception occurred trying to get attributes of a "+
                 "RequiredModelMBean");
 
-        responseList = new AttributeList();
+        AttributeList responseList = new AttributeList();
         for (int i = 0; i < attrNames.length; i++) {
             try {
                 responseList.add(new Attribute(attrNames[i],
@@ -1833,8 +1830,6 @@
                 throw new AttributeNotFoundException("setAttribute failed: "
                                           + attrName + " is not writable ");
 
-            Object setResponse = null;
-
             String attrSetMethod = (String)
                 (attrDescr.getFieldValue("setMethod"));
             String attrGetMethod = (String)
@@ -1873,9 +1868,9 @@
                 }
                 updateDescriptor = true;
             } else {
-                setResponse = invoke(attrSetMethod,
-                                 (new Object[] {attrValue}),
-                                 (new String[] {attrType}) );
+                invoke(attrSetMethod,
+                       (new Object[] {attrValue}),
+                       (new String[] {attrType}) );
             }
 
             /* change cached value */
@@ -2023,8 +2018,6 @@
     private synchronized void writeToLog(String logFileName,
                                          String logEntry) throws Exception {
 
-        PrintStream logOut = null;
-        FileOutputStream fos = null;
         if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
             MODELMBEAN_LOGGER.logp(Level.FINER,
                     RequiredModelMBean.class.getName(),
@@ -2041,9 +2034,9 @@
             return;
         }
 
+        FileOutputStream fos = new FileOutputStream(logFileName, true);
         try {
-            fos = new FileOutputStream(logFileName, true);
-            logOut = new PrintStream(fos);
+            PrintStream logOut = new PrintStream(fos);
             logOut.println(logEntry);
             logOut.close();
             if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
@@ -2062,6 +2055,8 @@
                         logFileName);
             }
             throw e;
+        } finally {
+            fos.close();
         }
     }
 
--- a/jdk/src/share/classes/javax/management/monitor/CounterMonitor.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/javax/management/monitor/CounterMonitor.java	Thu Jun 12 13:50:55 2008 -0700
@@ -740,16 +740,16 @@
                 //
                 switch (o.getType()) {
                     case INTEGER:
-                        o.setThreshold(new Integer((int)threshold_value));
+                        o.setThreshold(Integer.valueOf((int)threshold_value));
                         break;
                     case BYTE:
-                        o.setThreshold(new Byte((byte)threshold_value));
+                        o.setThreshold(Byte.valueOf((byte)threshold_value));
                         break;
                     case SHORT:
-                        o.setThreshold(new Short((short)threshold_value));
+                        o.setThreshold(Short.valueOf((short)threshold_value));
                         break;
                     case LONG:
-                        o.setThreshold(new Long(threshold_value));
+                        o.setThreshold(Long.valueOf(threshold_value));
                         break;
                     default:
                         // Should never occur...
@@ -810,10 +810,10 @@
             derived += modulus.longValue();
 
         switch (o.getType()) {
-        case INTEGER: o.setDerivedGauge(new Integer((int) derived)); break;
-        case BYTE: o.setDerivedGauge(new Byte((byte) derived)); break;
-        case SHORT: o.setDerivedGauge(new Short((short) derived)); break;
-        case LONG: o.setDerivedGauge(new Long(derived)); break;
+        case INTEGER: o.setDerivedGauge(Integer.valueOf((int) derived)); break;
+        case BYTE: o.setDerivedGauge(Byte.valueOf((byte) derived)); break;
+        case SHORT: o.setDerivedGauge(Short.valueOf((short) derived)); break;
+        case LONG: o.setDerivedGauge(Long.valueOf(derived)); break;
         default:
             // Should never occur...
             MONITOR_LOGGER.logp(Level.FINEST, CounterMonitor.class.getName(),
--- a/jdk/src/share/classes/javax/management/monitor/GaugeMonitor.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/javax/management/monitor/GaugeMonitor.java	Thu Jun 12 13:50:55 2008 -0700
@@ -636,28 +636,28 @@
         Number der;
         switch (o.getType()) {
         case INTEGER:
-            der = new Integer(((Integer)scanGauge).intValue() -
-                              ((Integer)prev).intValue());
+            der = Integer.valueOf(((Integer)scanGauge).intValue() -
+                                  ((Integer)prev).intValue());
             break;
         case BYTE:
-            der = new Byte((byte)(((Byte)scanGauge).byteValue() -
-                                  ((Byte)prev).byteValue()));
+            der = Byte.valueOf((byte)(((Byte)scanGauge).byteValue() -
+                                      ((Byte)prev).byteValue()));
             break;
         case SHORT:
-            der = new Short((short)(((Short)scanGauge).shortValue() -
-                                    ((Short)prev).shortValue()));
+            der = Short.valueOf((short)(((Short)scanGauge).shortValue() -
+                                        ((Short)prev).shortValue()));
             break;
         case LONG:
-            der = new Long(((Long)scanGauge).longValue() -
-                           ((Long)prev).longValue());
+            der = Long.valueOf(((Long)scanGauge).longValue() -
+                               ((Long)prev).longValue());
             break;
         case FLOAT:
-            der = new Float(((Float)scanGauge).floatValue() -
-                            ((Float)prev).floatValue());
+            der = Float.valueOf(((Float)scanGauge).floatValue() -
+                                ((Float)prev).floatValue());
             break;
         case DOUBLE:
-            der = new Double(((Double)scanGauge).doubleValue() -
-                             ((Double)prev).doubleValue());
+            der = Double.valueOf(((Double)scanGauge).doubleValue() -
+                                 ((Double)prev).doubleValue());
             break;
         default:
             // Should never occur...
--- a/jdk/src/share/classes/javax/management/monitor/Monitor.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/javax/management/monitor/Monitor.java	Thu Jun 12 13:50:55 2008 -0700
@@ -367,7 +367,7 @@
     /**
      * Constant used to initialize all the numeric values.
      */
-    static final Integer INTEGER_ZERO = new Integer(0);
+    static final Integer INTEGER_ZERO = 0;
 
 
     /*
@@ -1122,12 +1122,12 @@
      */
     private void monitor(ObservedObject o, int index, int an[]) {
 
-        String attribute = null;
+        String attribute;
         String notifType = null;
         String msg = null;
         Object derGauge = null;
         Object trigger = null;
-        ObjectName object = null;
+        ObjectName object;
         Comparable<?> value = null;
         MonitorNotification alarm = null;
 
@@ -1565,7 +1565,7 @@
         final ThreadGroup group;
         final AtomicInteger threadNumber = new AtomicInteger(1);
         final String namePrefix;
-        final String nameSuffix = "]";
+        static final String nameSuffix = "]";
 
         public DaemonThreadFactory(String poolName) {
             SecurityManager s = System.getSecurityManager();
--- a/jdk/src/share/classes/javax/management/openmbean/ArrayType.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/javax/management/openmbean/ArrayType.java	Thu Jun 12 13:50:55 2008 -0700
@@ -726,7 +726,7 @@
             value += dimension;
             value += elementType.hashCode();
             value += Boolean.valueOf(primitiveArray).hashCode();
-            myHashCode = new Integer(value);
+            myHashCode = Integer.valueOf(value);
         }
 
         // return always the same hash code for this instance (immutable)
--- a/jdk/src/share/classes/javax/management/openmbean/CompositeType.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/javax/management/openmbean/CompositeType.java	Thu Jun 12 13:50:55 2008 -0700
@@ -426,7 +426,7 @@
                 value += key.hashCode();
                 value += this.nameToType.get(key).hashCode();
             }
-            myHashCode = new Integer(value);
+            myHashCode = Integer.valueOf(value);
         }
 
         // return always the same hash code for this instance (immutable)
--- a/jdk/src/share/classes/javax/management/openmbean/OpenMBeanAttributeInfoSupport.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/javax/management/openmbean/OpenMBeanAttributeInfoSupport.java	Thu Jun 12 13:50:55 2008 -0700
@@ -769,7 +769,6 @@
                 "array with same dimensions";
             throw new IllegalArgumentException(msg);
         }
-        Class<?> targetComponentClass = targetArrayClass.getComponentType();
         OpenType<?> componentOpenType;
         if (dim == 1)
             componentOpenType = baseType;
--- a/jdk/src/share/classes/javax/management/openmbean/OpenMBeanConstructorInfoSupport.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/javax/management/openmbean/OpenMBeanConstructorInfoSupport.java	Thu Jun 12 13:50:55 2008 -0700
@@ -252,7 +252,7 @@
             int value = 0;
             value += this.getName().hashCode();
             value += Arrays.asList(this.getSignature()).hashCode();
-            myHashCode = new Integer(value);
+            myHashCode = Integer.valueOf(value);
         }
 
         // return always the same hash code for this instance (immutable)
--- a/jdk/src/share/classes/javax/management/openmbean/OpenMBeanInfoSupport.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/javax/management/openmbean/OpenMBeanInfoSupport.java	Thu Jun 12 13:50:55 2008 -0700
@@ -347,7 +347,7 @@
             value += arraySetHash(this.getConstructors());
             value += arraySetHash(this.getOperations());
             value += arraySetHash(this.getNotifications());
-            myHashCode = new Integer(value);
+            myHashCode = Integer.valueOf(value);
         }
 
         // return always the same hash code for this instance (immutable)
--- a/jdk/src/share/classes/javax/management/openmbean/OpenMBeanOperationInfoSupport.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/javax/management/openmbean/OpenMBeanOperationInfoSupport.java	Thu Jun 12 13:50:55 2008 -0700
@@ -352,7 +352,7 @@
             value += Arrays.asList(this.getSignature()).hashCode();
             value += this.getReturnOpenType().hashCode();
             value += this.getImpact();
-            myHashCode = new Integer(value);
+            myHashCode = Integer.valueOf(value);
         }
 
         // return always the same hash code for this instance (immutable)
--- a/jdk/src/share/classes/javax/management/openmbean/SimpleType.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/javax/management/openmbean/SimpleType.java	Thu Jun 12 13:50:55 2008 -0700
@@ -257,7 +257,7 @@
         // Calculate the hash code value if it has not yet been done (ie 1st call to hashCode())
         //
         if (myHashCode == null) {
-            myHashCode = new Integer(this.getClassName().hashCode());
+            myHashCode = Integer.valueOf(this.getClassName().hashCode());
         }
 
         // return always the same hash code for this instance (immutable)
--- a/jdk/src/share/classes/javax/management/openmbean/TabularType.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/javax/management/openmbean/TabularType.java	Thu Jun 12 13:50:55 2008 -0700
@@ -332,7 +332,7 @@
             for (Iterator k = indexNames.iterator(); k.hasNext();  ) {
                 value += k.next().hashCode();
             }
-            myHashCode = new Integer(value);
+            myHashCode = Integer.valueOf(value);
         }
 
         // return always the same hash code for this instance (immutable)
--- a/jdk/src/share/classes/javax/management/relation/RelationNotification.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/javax/management/relation/RelationNotification.java	Thu Jun 12 13:50:55 2008 -0700
@@ -369,7 +369,7 @@
      * @return a {@link List} of {@link ObjectName}.
      */
     public List<ObjectName> getMBeansToUnregister() {
-        List<ObjectName> result = null;
+        List<ObjectName> result;
         if (unregisterMBeanList != null) {
             result = new ArrayList<ObjectName>(unregisterMBeanList);
         } else {
@@ -397,7 +397,7 @@
      * @return the old value of the updated role.
      */
     public List<ObjectName> getOldRoleValue() {
-        List<ObjectName> result = null;
+        List<ObjectName> result;
         if (oldRoleValue != null) {
             result = new ArrayList<ObjectName>(oldRoleValue);
         } else {
@@ -412,7 +412,7 @@
      * @return the new value of the updated role.
      */
     public List<ObjectName> getNewRoleValue() {
-        List<ObjectName> result = null;
+        List<ObjectName> result;
         if (newRoleValue != null) {
             result = new ArrayList<ObjectName>(newRoleValue);
         } else {
--- a/jdk/src/share/classes/javax/management/relation/RelationService.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/javax/management/relation/RelationService.java	Thu Jun 12 13:50:55 2008 -0700
@@ -35,6 +35,7 @@
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
+import java.util.concurrent.atomic.AtomicLong;
 import java.util.logging.Level;
 
 import javax.management.Attribute;
@@ -122,7 +123,7 @@
     // Internal counter to provide sequence numbers for notifications sent by:
     // - the Relation Service
     // - a relation handled by the Relation Service
-    private Long myNtfSeqNbrCounter = new Long(0);
+    private final AtomicLong atomicSeqNo = new AtomicLong();
 
     // ObjectName used to register the Relation Service in the MBean Server
     private ObjectName myObjName = null;
@@ -256,19 +257,6 @@
         return;
     }
 
-    // Returns internal counter to be used for Sequence Numbers of
-    // notifications to be raised by:
-    // - a relation handled by this Relation Service (when updated)
-    // - the Relation Service
-    private Long getNotificationSequenceNumber() {
-        Long result = null;
-        synchronized(myNtfSeqNbrCounter) {
-            result = new Long(myNtfSeqNbrCounter.longValue() + 1);
-            myNtfSeqNbrCounter = new Long(result.longValue());
-        }
-        return result;
-    }
-
     //
     // Relation type handling
     //
@@ -369,7 +357,7 @@
      * @return ArrayList of relation type names (Strings)
      */
     public List<String> getAllRelationTypeNames() {
-        ArrayList<String> result = null;
+        ArrayList<String> result;
         synchronized(myRelType2ObjMap) {
             result = new ArrayList<String>(myRelType2ObjMap.keySet());
         }
@@ -684,7 +672,7 @@
         // Can throw InstanceNotFoundException (but detected above)
         // No MBeanException as no exception raised by this method, and no
         // ReflectionException
-        String relId = null;
+        String relId;
         try {
             relId = (String)(myMBeanServer.getAttribute(relationObjectName,
                                                         "RelationId"));
@@ -707,7 +695,7 @@
         // Can throw InstanceNotFoundException (but detected above)
         // No MBeanException as no exception raised by this method, no
         // ReflectionException
-        ObjectName relServObjName = null;
+        ObjectName relServObjName;
         try {
             relServObjName = (ObjectName)
                 (myMBeanServer.getAttribute(relationObjectName,
@@ -737,7 +725,7 @@
         // Can throw InstanceNotFoundException (but detected above)
         // No MBeanException as no exception raised by this method, no
         // ReflectionException
-        String relTypeName = null;
+        String relTypeName;
         try {
             relTypeName = (String)(myMBeanServer.getAttribute(relationObjectName,
                                                               "RelationTypeName"));
@@ -758,7 +746,7 @@
         // Can throw InstanceNotFoundException (but detected above)
         // No MBeanException as no exception raised by this method, no
         // ReflectionException
-        RoleList roleList = null;
+        RoleList roleList;
         try {
             roleList = (RoleList)(myMBeanServer.invoke(relationObjectName,
                                                        "retrieveAllRoles",
@@ -912,7 +900,7 @@
      * @return ArrayList of String
      */
     public List<String> getAllRelationIds() {
-        List<String> result = null;
+        List<String> result;
         synchronized(myRelId2ObjMap) {
             result = new ArrayList<String>(myRelId2ObjMap.keySet());
         }
@@ -948,7 +936,7 @@
         RELATION_LOGGER.entering(RelationService.class.getName(),
                 "checkRoleReading", new Object[] {roleName, relationTypeName});
 
-        Integer result = null;
+        Integer result;
 
         // Can throw a RelationTypeNotFoundException
         RelationType relType = getRelationType(relationTypeName);
@@ -965,7 +953,7 @@
                                    false);
 
         } catch (RoleInfoNotFoundException exc) {
-            result = new Integer(RoleStatus.NO_ROLE_WITH_NAME);
+            result = Integer.valueOf(RoleStatus.NO_ROLE_WITH_NAME);
         }
 
         RELATION_LOGGER.exiting(RelationService.class.getName(),
@@ -1021,13 +1009,13 @@
             writeChkFlag = false;
         }
 
-        RoleInfo roleInfo = null;
+        RoleInfo roleInfo;
         try {
             roleInfo = relType.getRoleInfo(roleName);
         } catch (RoleInfoNotFoundException exc) {
             RELATION_LOGGER.exiting(RelationService.class.getName(),
                     "checkRoleWriting");
-            return new Integer(RoleStatus.NO_ROLE_WITH_NAME);
+            return Integer.valueOf(RoleStatus.NO_ROLE_WITH_NAME);
         }
 
         Integer result = checkRoleInt(2,
@@ -1436,7 +1424,7 @@
 
         // Relation id to relation type name map
         // First retrieves the relation type name
-        String relTypeName = null;
+        String relTypeName;
         synchronized(myRelId2RelTypeMap) {
             relTypeName = myRelId2RelTypeMap.get(relationId);
             myRelId2RelTypeMap.remove(relationId);
@@ -1641,7 +1629,7 @@
 
                 // List of relation ids of interest regarding the selected
                 // relation type
-                List<String> relIdList = null;
+                List<String> relIdList;
                 if (relationTypeName == null) {
                     // Considers all relations
                     relIdList = new ArrayList<String>(allRelIdSet);
@@ -1655,7 +1643,7 @@
                     for (String currRelId : allRelIdSet) {
 
                         // Retrieves its relation type
-                        String currRelTypeName = null;
+                        String currRelTypeName;
                         synchronized(myRelId2RelTypeMap) {
                             currRelTypeName =
                                 myRelId2RelTypeMap.get(currRelId);
@@ -1952,7 +1940,7 @@
         // Can throw a RelationNotFoundException
         Object relObj = getRelation(relationId);
 
-        RoleResult result = null;
+        RoleResult result;
 
         if (relObj instanceof RelationSupport) {
             // Internal relation
@@ -2022,7 +2010,7 @@
         // Can throw a RelationNotFoundException
         Object relObj = getRelation(relationId);
 
-        RoleResult result = null;
+        RoleResult result;
 
         if (relObj instanceof RelationSupport) {
             // Internal relation
@@ -2073,7 +2061,7 @@
         // Can throw a RelationNotFoundException
         Object relObj = getRelation(relationId);
 
-        Integer result = null;
+        Integer result;
 
         if (relObj instanceof RelationSupport) {
             // Internal relation
@@ -2268,7 +2256,7 @@
         // Can throw a RelationNotFoundException
         Object relObj = getRelation(relationId);
 
-        RoleResult result = null;
+        RoleResult result;
 
         if (relObj instanceof RelationSupport) {
             // Internal relation
@@ -2390,7 +2378,7 @@
         // Can throw a RelationNotFoundException
         Object relObj = getRelation(relationId);
 
-        String result = null;
+        String result;
 
         if (relObj instanceof RelationSupport) {
             // Internal relation
@@ -2473,7 +2461,7 @@
 
                 // Note: do both tests as a relation can be an MBean and be
                 //       itself referenced in another relation :)
-                String relId = null;
+                String relId;
                 synchronized(myRelMBeanObjName2RelIdMap){
                     relId = myRelMBeanObjName2RelIdMap.get(mbeanName);
                 }
@@ -2511,9 +2499,6 @@
         RELATION_LOGGER.entering(RelationService.class.getName(),
                 "getNotificationInfo");
 
-        MBeanNotificationInfo[] ntfInfoArray =
-            new MBeanNotificationInfo[1];
-
         String ntfClass = "javax.management.relation.RelationNotification";
 
         String[] ntfTypes = new String[] {
@@ -2615,7 +2600,7 @@
                 "getRelationType", relationTypeName);
 
         // No null relation type accepted, so can use get()
-        RelationType relType = null;
+        RelationType relType;
         synchronized(myRelType2ObjMap) {
             relType = (myRelType2ObjMap.get(relationTypeName));
         }
@@ -2659,7 +2644,7 @@
                 "getRelation", relationId);
 
         // No null relation  accepted, so can use get()
-        Object rel = null;
+        Object rel;
         synchronized(myRelId2ObjMap) {
             rel = myRelId2ObjMap.get(relationId);
         }
@@ -3077,7 +3062,7 @@
                 // Retrieves corresponding role info
                 // Can throw a RoleInfoNotFoundException to be converted into a
                 // RoleNotFoundException
-                RoleInfo roleInfo = null;
+                RoleInfo roleInfo;
                 try {
                     roleInfo = relType.getRoleInfo(currRoleName);
                 } catch (RoleInfoNotFoundException exc) {
@@ -3227,7 +3212,7 @@
         if (!(roleName.equals(expName))) {
             RELATION_LOGGER.exiting(RelationService.class.getName(),
                     "checkRoleInt");
-            return new Integer(RoleStatus.NO_ROLE_WITH_NAME);
+            return Integer.valueOf(RoleStatus.NO_ROLE_WITH_NAME);
         }
 
         // Checks read access if required
@@ -3236,7 +3221,7 @@
             if (!isReadable) {
                 RELATION_LOGGER.exiting(RelationService.class.getName(),
                         "checkRoleInt");
-                return new Integer(RoleStatus.ROLE_NOT_READABLE);
+                return Integer.valueOf(RoleStatus.ROLE_NOT_READABLE);
             } else {
                 // End of check :)
                 RELATION_LOGGER.exiting(RelationService.class.getName(),
@@ -3572,7 +3557,7 @@
         // Relation type name
         // Note: do not use getRelationTypeName() as if it is a relation MBean
         //       it is already unregistered.
-        String relTypeName = null;
+        String relTypeName;
         synchronized(myRelId2RelTypeMap) {
             relTypeName = (myRelId2RelTypeMap.get(relationId));
         }
@@ -3609,7 +3594,7 @@
         }
 
         // Sequence number
-        Long seqNbr = getNotificationSequenceNumber();
+        Long seqNo = atomicSeqNo.incrementAndGet();
 
         // Timestamp
         Date currDate = new Date();
@@ -3625,7 +3610,7 @@
             // Creation or removal
             ntf = new RelationNotification(ntfType,
                                            this,
-                                           seqNbr.longValue(),
+                                           seqNo.longValue(),
                                            timeStamp,
                                            message,
                                            relationId,
@@ -3640,7 +3625,7 @@
                 // Update
                 ntf = new RelationNotification(ntfType,
                                                this,
-                                               seqNbr.longValue(),
+                                               seqNo.longValue(),
                                                timeStamp,
                                                message,
                                                relationId,
@@ -3732,7 +3717,7 @@
             //
             // Shall not throw RelationTypeNotFoundException or
             // RoleInfoNotFoundException
-            RoleInfo currRoleInfo = null;
+            RoleInfo currRoleInfo;
             try {
                 currRoleInfo = getRoleInfo(currRelTypeName,
                                            currRoleName);
--- a/jdk/src/share/classes/javax/management/relation/RelationSupport.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/javax/management/relation/RelationSupport.java	Thu Jun 12 13:50:55 2008 -0700
@@ -34,6 +34,7 @@
 import java.util.Map;
 import java.util.List;
 
+import java.util.concurrent.atomic.AtomicBoolean;
 import static com.sun.jmx.defaults.JmxProperties.RELATION_LOGGER;
 import static com.sun.jmx.mbeanserver.Util.cast;
 import javax.management.InstanceNotFoundException;
@@ -110,7 +111,7 @@
     private Map<String,Role> myRoleName2ValueMap = new HashMap<String,Role>();
 
     // Flag to indicate if the object has been added in the Relation Service
-    private Boolean myInRelServFlg = null;
+    private final AtomicBoolean myInRelServFlg = new AtomicBoolean();
 
     //
     // Constructors
@@ -403,7 +404,7 @@
                 "getRoleCardinality", roleName);
 
         // Try to retrieve the role
-        Role role = null;
+        Role role;
         synchronized(myRoleName2ValueMap) {
             // No null Role is allowed, so direct use of get()
             role = (myRoleName2ValueMap.get(roleName));
@@ -427,7 +428,7 @@
 
         RELATION_LOGGER.exiting(RelationSupport.class.getName(),
                 "getRoleCardinality");
-        return new Integer(roleValue.size());
+        return roleValue.size();
     }
 
     /**
@@ -701,11 +702,7 @@
      * the Relation Service.
      */
     public Boolean isInRelationService() {
-        Boolean result = null;
-        synchronized(myInRelServFlg) {
-            result = Boolean.valueOf(myInRelServFlg.booleanValue());
-        }
-        return result;
+        return myInRelServFlg.get();
     }
 
     public void setRelationServiceManagementFlag(Boolean flag)
@@ -715,10 +712,7 @@
             String excMsg = "Invalid parameter.";
             throw new IllegalArgumentException(excMsg);
         }
-        synchronized(myInRelServFlg) {
-            myInRelServFlg = Boolean.valueOf(flag.booleanValue());
-        }
-        return;
+        myInRelServFlg.set(flag);
     }
 
     //
@@ -790,7 +784,7 @@
 
         int pbType = 0;
 
-        Role role = null;
+        Role role;
         synchronized(myRoleName2ValueMap) {
             // No null Role is allowed, so direct use of get()
             role = (myRoleName2ValueMap.get(roleName));
@@ -801,7 +795,7 @@
 
         } else {
             // Checks if the role is readable
-            Integer status = null;
+            Integer status;
 
             if (relationServCallFlg) {
 
@@ -851,7 +845,7 @@
             pbType = status.intValue();
         }
 
-        Object result = null;
+        Object result;
 
         if (pbType == 0) {
             // Role can be retrieved
@@ -937,7 +931,7 @@
         for (int i = 0; i < roleNameArray.length; i++) {
             String currRoleName = roleNameArray[i];
 
-            Object currResult = null;
+            Object currResult;
 
             // Can throw RelationServiceNotRegisteredException
             //
@@ -1102,13 +1096,13 @@
         // handle initialization of role when creating the relation
         // (roles provided in the RoleList parameter are directly set but
         // roles automatically initialized are set using setRole())
-        Role role = null;
+        Role role;
         synchronized(myRoleName2ValueMap) {
             role = (myRoleName2ValueMap.get(roleName));
         }
 
         List<ObjectName> oldRoleValue;
-        Boolean initFlg = null;
+        Boolean initFlg;
 
         if (role == null) {
             initFlg = true;
@@ -1122,7 +1116,7 @@
         // Checks if the role can be set: is writable (except if
         // initialization) and correct value
         try {
-            Integer status = null;
+            Integer status;
 
             if (relationServCallFlg) {
 
@@ -1314,7 +1308,7 @@
             Object[] params = new Object[3];
             params[0] = myRelId;
             params[1] = newRole;
-            params[2] = ((ArrayList)oldRoleValue);
+            params[2] = oldRoleValue;
             String[] signature = new String[3];
             signature[0] = "java.lang.String";
             signature[1] = "javax.management.relation.Role";
@@ -1598,7 +1592,6 @@
         myRelTypeName = relationTypeName;
         // Can throw InvalidRoleValueException
         initRoleMap(list);
-        myInRelServFlg = Boolean.FALSE;
 
         RELATION_LOGGER.exiting(RelationSupport.class.getName(), "initMembers");
         return;
@@ -1710,7 +1703,7 @@
                 roleName, relationServCallFlg, relationServ});
 
         // Retrieves current role value
-        Role role = null;
+        Role role;
         synchronized(myRoleName2ValueMap) {
             role = (myRoleName2ValueMap.get(roleName));
         }
--- a/jdk/src/share/classes/javax/management/remote/JMXConnectorFactory.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/javax/management/remote/JMXConnectorFactory.java	Thu Jun 12 13:50:55 2008 -0700
@@ -435,7 +435,7 @@
 
         Iterator<JMXConnectorProvider> providers =
                 getProviderIterator(JMXConnectorProvider.class, loader);
-        JMXConnector connection = null;
+        JMXConnector connection;
         IOException exception = null;
         while(providers.hasNext()) {
             try {
@@ -450,7 +450,7 @@
                                  "] Service provider exception: " + e);
                 if (!(e instanceof MalformedURLException)) {
                     if (exception == null) {
-                        if (exception instanceof IOException) {
+                        if (e instanceof IOException) {
                             exception = (IOException) e;
                         } else {
                             exception = EnvHelp.initCause(
--- a/jdk/src/share/classes/javax/management/remote/JMXConnectorServerFactory.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/javax/management/remote/JMXConnectorServerFactory.java	Thu Jun 12 13:50:55 2008 -0700
@@ -215,12 +215,10 @@
                 JMXConnectorFactory.
                 getProviderIterator(JMXConnectorServerProvider.class, loader);
 
-        JMXConnectorServer connection = null;
         IOException exception = null;
         while (providers.hasNext()) {
             try {
-                connection = providers.next().newJMXConnectorServer(url, map, mbs);
-                return connection;
+                return providers.next().newJMXConnectorServer(url, map, mbs);
             } catch (JMXProviderException e) {
                 throw e;
             } catch (Exception e) {
@@ -230,7 +228,7 @@
                                  "] Service provider exception: " + e);
                 if (!(e instanceof MalformedURLException)) {
                     if (exception == null) {
-                        if (exception instanceof IOException) {
+                        if (e instanceof IOException) {
                             exception = (IOException) e;
                         } else {
                             exception = EnvHelp.initCause(
--- a/jdk/src/share/classes/javax/management/remote/JMXServiceURL.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/javax/management/remote/JMXServiceURL.java	Thu Jun 12 13:50:55 2008 -0700
@@ -162,8 +162,6 @@
                                             requiredPrefix);
         }
 
-        int[] ptr = new int[1];
-
         // Parse the protocol name
         final int protoStart = requiredPrefixLength;
         final int protoEnd = indexOf(serviceURL, ':', protoStart);
@@ -664,11 +662,6 @@
         hostNameBitSet.set('.');
     }
 
-    private static void addCharsToBitSet(BitSet set, String chars) {
-        for (int i = 0; i < chars.length(); i++)
-            set.set(chars.charAt(i));
-    }
-
     /**
      * The value returned by {@link #getProtocol()}.
      */
--- a/jdk/src/share/classes/javax/management/remote/rmi/RMIConnector.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/javax/management/remote/rmi/RMIConnector.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1376,12 +1376,12 @@
 
         protected Integer addListenerForMBeanRemovedNotif()
                 throws IOException, InstanceNotFoundException {
-            MarshalledObject<NotificationFilter> sFilter = null;
             NotificationFilterSupport clientFilter =
                 new NotificationFilterSupport();
             clientFilter.enableType(
                 MBeanServerNotification.UNREGISTRATION_NOTIFICATION);
-            sFilter = new MarshalledObject<NotificationFilter>(clientFilter);
+            MarshalledObject<NotificationFilter> sFilter =
+                new MarshalledObject<NotificationFilter>(clientFilter);
 
             Integer[] listenerIDs;
             final ObjectName[] names =
@@ -1434,7 +1434,7 @@
                                               connectionId,
                                               clientNotifCounter++,
                                               message,
-                                              new Long(number));
+                                              Long.valueOf(number));
             sendNotification(n);
         }
     }
@@ -1593,7 +1593,7 @@
 
         protected void doStart() throws IOException {
             // Get RMIServer stub from directory or URL encoding if needed.
-            RMIServer stub = null;
+            RMIServer stub;
             try {
                 stub = (rmiServer!=null)?rmiServer:
                     findRMIServer(jmxServiceURL, env);
@@ -2532,7 +2532,7 @@
      * A static WeakReference to an {@link org.omg.CORBA.ORB ORB} to
      * connect unconnected stubs.
      **/
-    private static WeakReference<ORB> orb = null;
+    private static volatile WeakReference<ORB> orb = null;
 
     // TRACES & DEBUG
     //---------------
--- a/jdk/src/share/classes/javax/management/remote/rmi/RMIConnectorServer.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/javax/management/remote/rmi/RMIConnectorServer.java	Thu Jun 12 13:50:55 2008 -0700
@@ -365,7 +365,7 @@
                 // Access file property specified, create an instance
                 // of the MBeanServerFileAccessController class
                 //
-                MBeanServerForwarder mbsf = null;
+                MBeanServerForwarder mbsf;
                 try {
                     mbsf = new MBeanServerFileAccessController(accessFile);
                 } catch (IOException e) {
--- a/jdk/src/share/classes/javax/management/timer/Timer.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/javax/management/timer/Timer.java	Thu Jun 12 13:50:55 2008 -0700
@@ -344,13 +344,11 @@
         //
         if (isActive == true) {
 
-            TimerAlarmClock alarmClock;
-
             for (Object[] obj : timerTable.values()) {
 
                 // Stop all the TimerAlarmClock.
                 //
-                alarmClock = (TimerAlarmClock)obj[ALARM_CLOCK_INDEX];
+                TimerAlarmClock alarmClock = (TimerAlarmClock)obj[ALARM_CLOCK_INDEX];
                 if (alarmClock != null) {
 //                     alarmClock.interrupt();
 //                     try {
@@ -364,7 +362,6 @@
 //                     //
 
                     alarmClock.cancel();
-                    alarmClock = null;
                 }
             }
 
@@ -458,8 +455,7 @@
 
         // Create and add the timer notification into the timer table.
         //
-        Integer notifID = null;
-        notifID = new Integer(++counterID);
+        Integer notifID = Integer.valueOf(++counterID);
 
         // The sequenceNumber and the timeStamp attributes are updated
         // when the notification is emitted by the timer.
@@ -486,8 +482,8 @@
 
         obj[TIMER_NOTIF_INDEX] = (Object)notif;
         obj[TIMER_DATE_INDEX] = (Object)d;
-        obj[TIMER_PERIOD_INDEX] = (Object) new Long(period);
-        obj[TIMER_NB_OCCUR_INDEX] = (Object) new Long(nbOccurences);
+        obj[TIMER_PERIOD_INDEX] = (Object) period;
+        obj[TIMER_NB_OCCUR_INDEX] = (Object) nbOccurences;
         obj[ALARM_CLOCK_INDEX] = (Object)alarmClock;
         obj[FIXED_RATE_INDEX] = Boolean.valueOf(fixedRate);
 
@@ -678,7 +674,6 @@
 //             // Remove the reference on the TimerAlarmClock.
 //             //
             alarmClock.cancel();
-            alarmClock = null;
         }
 
         // Remove the timer notification from the timer table.
@@ -755,7 +750,6 @@
                   //
 //             }
             alarmClock.cancel();
-            alarmClock = null;
         }
 
         // Remove all the timer notifications from the timer table.
@@ -906,8 +900,7 @@
 
         Object[] obj = timerTable.get(id);
         if (obj != null) {
-            Long period = (Long)obj[TIMER_PERIOD_INDEX];
-            return (new Long(period.longValue()));
+            return (Long)obj[TIMER_PERIOD_INDEX];
         }
         return null;
     }
@@ -924,8 +917,7 @@
 
         Object[] obj = timerTable.get(id);
         if (obj != null) {
-            Long nbOccurences = (Long)obj[TIMER_NB_OCCUR_INDEX];
-            return (new Long(nbOccurences.longValue()));
+            return (Long)obj[TIMER_NB_OCCUR_INDEX];
         }
         return null;
     }
@@ -1096,7 +1088,7 @@
             if ((nbOccurences.longValue() == 0) || (nbOccurences.longValue() > 1)) {
 
                 date.setTime(date.getTime() + period.longValue());
-                obj[TIMER_NB_OCCUR_INDEX] = new Long(java.lang.Math.max(0L, (nbOccurences.longValue() - 1)));
+                obj[TIMER_NB_OCCUR_INDEX] = Long.valueOf(java.lang.Math.max(0L, (nbOccurences.longValue() - 1)));
                 nbOccurences = (Long)obj[TIMER_NB_OCCUR_INDEX];
 
                 if (isActive == true) {
@@ -1146,9 +1138,6 @@
 //                         // Ignore...
 //                     }
                     alarmClock.cancel();
-                    // Remove the reference on the TimerAlarmClock.
-                    //
-                    alarmClock = null;
                 }
                 timerTable.remove(notifID);
             }
@@ -1165,10 +1154,6 @@
 //                 }
 
                    alarmClock.cancel();
-
-                // Remove the reference on the TimerAlarmClock.
-                //
-                alarmClock = null;
             }
             timerTable.remove(notifID);
         }
--- a/jdk/src/share/classes/javax/net/ssl/SSLContext.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/javax/net/ssl/SSLContext.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 1999-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1999-2008 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
@@ -134,6 +134,7 @@
      * @exception NoSuchAlgorithmException if no Provider supports a
      *          TrustManagerFactorySpi implementation for the
      *          specified protocol.
+     * @exception NullPointerException if protocol is null.
      *
      * @see java.security.Provider
      */
@@ -175,6 +176,7 @@
      *          registered in the security provider list.
      *
      * @throws IllegalArgumentException if the provider name is null or empty.
+     * @throws NullPointerException if protocol is null.
      *
      * @see java.security.Provider
      */
@@ -210,6 +212,7 @@
      *          from the specified Provider object.
      *
      * @throws IllegalArgumentException if the provider name is null.
+     * @throws NullPointerException if protocol is null.
      *
      * @see java.security.Provider
      */
--- a/jdk/src/share/classes/javax/net/ssl/SSLSocket.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/javax/net/ssl/SSLSocket.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 1997-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-2008 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
@@ -212,8 +212,10 @@
      * @param host name of the host with which to connect, or
      *        <code>null</code> for the loopback address.
      * @param port number of the server's port
-     * @param clientAddress the client's host
-     * @param clientPort number of the client's port
+     * @param clientAddress the client's address the socket is bound to, or
+     *        <code>null</code> for the <code>anyLocal</code> address.
+     * @param clientPort the client's port the socket is bound to, or
+     *        <code>zero</code> for a system selected free port.
      * @throws IOException if an I/O error occurs when creating the socket
      * @throws SecurityException if a security manager exists and its
      *         <code>checkConnect</code> method doesn't allow the operation.
@@ -241,8 +243,10 @@
      *
      * @param address the server's host
      * @param port its port
-     * @param clientAddress the client's host
-     * @param clientPort number of the client's port
+     * @param clientAddress the client's address the socket is bound to, or
+     *        <code>null</code> for the <code>anyLocal</code> address.
+     * @param clientPort the client's port the socket is bound to, or
+     *        <code>zero</code> for a system selected free port.
      * @throws IOException if an I/O error occurs when creating the socket
      * @throws SecurityException if a security manager exists and its
      *         <code>checkConnect</code> method doesn't allow the operation.
--- a/jdk/src/share/classes/javax/net/ssl/TrustManagerFactory.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/javax/net/ssl/TrustManagerFactory.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 1999-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1999-2008 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
@@ -129,6 +129,7 @@
      * @exception NoSuchAlgorithmException if no Provider supports a
      *          TrustManagerFactorySpi implementation for the
      *          specified algorithm.
+     * @exception NullPointerException if algorithm is null.
      *
      * @see java.security.Provider
      */
@@ -171,6 +172,7 @@
      *          registered in the security provider list.
      *
      * @throws IllegalArgumentException if the provider name is null or empty.
+     * @throws NullPointerException if algorithm is null.
      *
      * @see java.security.Provider
      */
@@ -208,6 +210,7 @@
      *          from the specified Provider object.
      *
      * @throws IllegalArgumentException if the provider is null.
+     * @throws NullPointerException if algorithm is null.
      *
      * @see java.security.Provider
      */
@@ -274,6 +277,8 @@
     /**
      * Returns one trust manager for each type of trust material.
      *
+     * @throws IllegalStateException if the factory is not initialized.
+     *
      * @return the trust managers
      */
     public final TrustManager[] getTrustManagers() {
--- a/jdk/src/share/classes/javax/net/ssl/TrustManagerFactorySpi.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/javax/net/ssl/TrustManagerFactorySpi.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 1999-2001 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1999-2008 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
@@ -74,6 +74,8 @@
     /**
      * Returns one trust manager for each type of trust material.
      *
+     * @throws IllegalStateException if the factory is not initialized.
+     *
      * @return the trust managers
      */
     protected abstract TrustManager[] engineGetTrustManagers();
--- a/jdk/src/share/classes/javax/print/attribute/standard/ReferenceUriSchemesSupported.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/javax/print/attribute/standard/ReferenceUriSchemesSupported.java	Thu Jun 12 13:50:55 2008 -0700
@@ -44,7 +44,7 @@
  * print request's, print job's, or print service's attribute set.
  * <P>
  * The Internet Assigned Numbers Authority maintains the
- * <A HREF="http://www.isi.edu/in-notes/iana/assignments/url-schemes">official
+ * <A HREF="http://www.iana.org/assignments/uri-schemes.html">official
  * list of URI schemes</A>.
  * <p>
  * Class ReferenceUriSchemesSupported defines enumeration values for widely
--- a/jdk/src/share/classes/javax/security/auth/kerberos/KerberosTicket.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/javax/security/auth/kerberos/KerberosTicket.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2000-2008 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
@@ -253,7 +253,24 @@
                          Date endTime,
                          Date renewTill,
                          InetAddress[] clientAddresses) {
+        if (sessionKey == null)
+           throw new IllegalArgumentException("Session key for ticket"
+                                              + " cannot be null");
+        init(asn1Encoding, client, server,
+             new KeyImpl(sessionKey, keyType), flags, authTime,
+             startTime, endTime, renewTill, clientAddresses);
+    }
 
+    private void init(byte[] asn1Encoding,
+                         KerberosPrincipal client,
+                         KerberosPrincipal server,
+                         KeyImpl sessionKey,
+                         boolean[] flags,
+                         Date authTime,
+                         Date startTime,
+                         Date endTime,
+                         Date renewTill,
+                         InetAddress[] clientAddresses) {
         if (asn1Encoding == null)
            throw new IllegalArgumentException("ASN.1 encoding of ticket"
                                               + " cannot be null");
@@ -269,10 +286,8 @@
                                               + " cannot be null");
         this.server = server;
 
-        if (sessionKey == null)
-           throw new IllegalArgumentException("Session key for ticket"
-                                              + " cannot be null");
-        this.sessionKey = new KeyImpl(sessionKey, keyType);
+        // Caller needs to make sure `sessionKey` will not be null
+        this.sessionKey = sessionKey;
 
         if (flags != null) {
            if (flags.length >= NUM_FLAGS)
@@ -291,17 +306,22 @@
                 throw new IllegalArgumentException("The renewable period "
                        + "end time cannot be null for renewable tickets.");
 
-           this.renewTill = renewTill;
+           this.renewTill = new Date(renewTill.getTime());
         }
 
-        this.authTime = authTime;
-
-        this.startTime = (startTime != null? startTime: authTime);
+        if (authTime != null) {
+            this.authTime = new Date(authTime.getTime());
+        }
+        if (startTime != null) {
+            this.startTime = new Date(startTime.getTime());
+        } else {
+            this.startTime = this.authTime;
+        }
 
         if (endTime == null)
            throw new IllegalArgumentException("End time for ticket validity"
                                               + " cannot be null");
-        this.endTime = endTime;
+        this.endTime = new Date(endTime.getTime());
 
         if (clientAddresses != null)
            this.clientAddresses = clientAddresses.clone();
@@ -440,7 +460,7 @@
      *         or null if not set.
      */
     public final java.util.Date getAuthTime() {
-        return (authTime == null) ? null : new Date(authTime.getTime());
+        return (authTime == null) ? null : (Date)authTime.clone();
     }
 
     /**
@@ -450,7 +470,7 @@
      *         or null if not set.
      */
     public final java.util.Date getStartTime() {
-        return (startTime == null) ? null : new Date(startTime.getTime());
+        return (startTime == null) ? null : (Date)startTime.clone();
     }
 
     /**
@@ -459,7 +479,7 @@
      * @return the expiration time for this ticket's validity period.
      */
     public final java.util.Date getEndTime() {
-        return endTime;
+        return (Date) endTime.clone();
     }
 
     /**
@@ -469,7 +489,7 @@
      * @return the latest expiration time for this ticket.
      */
     public final java.util.Date getRenewTill() {
-        return (renewTill == null) ? null: new Date(renewTill.getTime());
+        return (renewTill == null) ? null: (Date)renewTill.clone();
     }
 
     /**
@@ -745,4 +765,20 @@
 
         return true;
     }
+
+    private void readObject(ObjectInputStream s)
+        throws IOException, ClassNotFoundException {
+        s.defaultReadObject();
+        if (sessionKey == null) {
+           throw new InvalidObjectException("Session key cannot be null");
+        }
+        try {
+            init(asn1Encoding, client, server, sessionKey,
+                 flags, authTime, startTime, endTime,
+                 renewTill, clientAddresses);
+        } catch (IllegalArgumentException iae) {
+            throw (InvalidObjectException)
+                new InvalidObjectException(iae.getMessage()).initCause(iae);
+        }
+    }
 }
--- a/jdk/src/share/classes/javax/swing/AbstractButton.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/javax/swing/AbstractButton.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 1997-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-2008 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
@@ -29,7 +29,9 @@
 import java.awt.image.*;
 import java.text.*;
 import java.awt.geom.*;
-import java.beans.*;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.beans.Transient;
 import java.util.Enumeration;
 import java.util.Vector;
 import java.io.Serializable;
@@ -645,6 +647,7 @@
      * @see #setDisabledIcon
      * @see javax.swing.LookAndFeel#getDisabledIcon
      */
+    @Transient
     public Icon getDisabledIcon() {
         if (disabledIcon == null) {
             disabledIcon = UIManager.getLookAndFeel().getDisabledIcon(this, getIcon());
@@ -2047,14 +2050,14 @@
                     null, AccessibleState.SELECTED);
                 accessibleContext.firePropertyChange(
                     AccessibleContext.ACCESSIBLE_VALUE_PROPERTY,
-                    new Integer(0), new Integer(1));
+                    Integer.valueOf(0), Integer.valueOf(1));
             } else {
                 accessibleContext.firePropertyChange(
                     AccessibleContext.ACCESSIBLE_STATE_PROPERTY,
                     AccessibleState.SELECTED, null);
                 accessibleContext.firePropertyChange(
                     AccessibleContext.ACCESSIBLE_VALUE_PROPERTY,
-                    new Integer(1), new Integer(0));
+                    Integer.valueOf(1), Integer.valueOf(0));
             }
         }
     }
@@ -2552,9 +2555,9 @@
          */
         public Number getCurrentAccessibleValue() {
             if (isSelected()) {
-                return new Integer(1);
+                return Integer.valueOf(1);
             } else {
-                return new Integer(0);
+                return Integer.valueOf(0);
             }
         }
 
@@ -2583,7 +2586,7 @@
          * @return an Integer of 0.
          */
         public Number getMinimumAccessibleValue() {
-            return new Integer(0);
+            return Integer.valueOf(0);
         }
 
         /**
@@ -2592,7 +2595,7 @@
          * @return An Integer of 1.
          */
         public Number getMaximumAccessibleValue() {
-            return new Integer(1);
+            return Integer.valueOf(1);
         }
 
 
--- a/jdk/src/share/classes/javax/swing/DebugGraphicsInfo.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/javax/swing/DebugGraphicsInfo.java	Thu Jun 12 13:50:55 2008 -0700
@@ -49,7 +49,7 @@
             componentToDebug = new Hashtable();
         }
         if (debug > 0) {
-            componentToDebug.put(component, new Integer(debug));
+            componentToDebug.put(component, Integer.valueOf(debug));
         } else {
             componentToDebug.remove(component);
         }
--- a/jdk/src/share/classes/javax/swing/DefaultListSelectionModel.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/javax/swing/DefaultListSelectionModel.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 1997-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-2008 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
@@ -28,6 +28,7 @@
 import java.util.EventListener;
 import java.util.BitSet;
 import java.io.Serializable;
+import java.beans.Transient;
 
 import javax.swing.event.*;
 
@@ -714,11 +715,13 @@
     }
 
     /** {@inheritDoc} */
+    @Transient
     public int getAnchorSelectionIndex() {
         return anchorIndex;
     }
 
     /** {@inheritDoc} */
+    @Transient
     public int getLeadSelectionIndex() {
         return leadIndex;
     }
--- a/jdk/src/share/classes/javax/swing/ImageIcon.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/javax/swing/ImageIcon.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 1997-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-2008 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,6 +27,7 @@
 import java.awt.*;
 import java.awt.image.*;
 import java.beans.ConstructorProperties;
+import java.beans.Transient;
 import java.net.URL;
 
 import java.io.Serializable;
@@ -336,6 +337,7 @@
      * Returns this icon's <code>Image</code>.
      * @return the <code>Image</code> object for this <code>ImageIcon</code>
      */
+    @Transient
     public Image getImage() {
         return image;
     }
@@ -436,6 +438,7 @@
      *
      * @return the image observer, which may be null
      */
+    @Transient
     public ImageObserver getImageObserver() {
         return imageObserver;
     }
--- a/jdk/src/share/classes/javax/swing/JComboBox.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/javax/swing/JComboBox.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 1997-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-2008 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,7 +24,9 @@
  */
 package javax.swing;
 
-import java.beans.*;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.beans.Transient;
 import java.util.*;
 
 import java.awt.*;
@@ -636,6 +638,7 @@
      *                  or -1 if no item is selected or if
      *                  the currently selected item is not in the list
      */
+    @Transient
     public int getSelectedIndex() {
         Object sObject = dataModel.getSelectedItem();
         int i,c;
--- a/jdk/src/share/classes/javax/swing/JComponent.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/javax/swing/JComponent.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 1997-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-2008 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
@@ -43,7 +43,10 @@
 import java.awt.peer.LightweightPeer;
 import java.awt.dnd.DropTarget;
 import java.awt.font.FontRenderContext;
-import java.beans.*;
+import java.beans.PropertyChangeListener;
+import java.beans.VetoableChangeListener;
+import java.beans.VetoableChangeSupport;
+import java.beans.Transient;
 
 import java.applet.Applet;
 
@@ -1634,6 +1637,7 @@
      * @see #setPreferredSize
      * @see ComponentUI
      */
+    @Transient
     public Dimension getPreferredSize() {
         if (isPreferredSizeSet()) {
             return super.getPreferredSize();
@@ -1675,6 +1679,7 @@
      * @see #setMaximumSize
      * @see ComponentUI
      */
+    @Transient
     public Dimension getMaximumSize() {
         if (isMaximumSizeSet()) {
             return super.getMaximumSize();
@@ -1714,6 +1719,7 @@
      * @see #setMinimumSize
      * @see ComponentUI
      */
+    @Transient
     public Dimension getMinimumSize() {
         if (isMinimumSizeSet()) {
             return super.getMinimumSize();
--- a/jdk/src/share/classes/javax/swing/JEditorPane.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/javax/swing/JEditorPane.java	Thu Jun 12 13:50:55 2008 -0700
@@ -429,9 +429,8 @@
             // different url or POST method, load the new content
 
             int p = getAsynchronousLoadPriority(getDocument());
-            if ((postData == null) || (p < 0)) {
-                // Either we do not have POST data, or should submit the data
-                // synchronously.
+            if (p < 0) {
+                // open stream synchronously
                 InputStream in = getStream(page);
                 if (kit != null) {
                     Document doc = initializeModel(kit, page);
@@ -440,22 +439,13 @@
                     // view notifications slowing it down (i.e. best synchronous
                     // behavior) or set the model and start to feed it on a separate
                     // thread (best asynchronous behavior).
-                    synchronized(this) {
-                        if (loading != null) {
-                            // we are loading asynchronously, so we need to cancel
-                            // the old stream.
-                            loading.cancel();
-                            loading = null;
-                        }
-                    }
                     p = getAsynchronousLoadPriority(doc);
                     if (p >= 0) {
                         // load asynchronously
                         setDocument(doc);
                         synchronized(this) {
-                            loading = new PageStream(in);
-                            Thread pl = new PageLoader(doc, loading, p, loaded, page);
-                            pl.start();
+                            pageLoader = new PageLoader(doc, in, loaded, page);
+                            pageLoader.execute();
                         }
                         return;
                     }
@@ -464,11 +454,15 @@
                     reloaded = true;
                 }
             } else {
-                // We have POST data and should send it asynchronously.
-                // Send (and subsequentally read) data in separate thread.
+                // we may need to cancel background loading
+                if (pageLoader != null) {
+                    pageLoader.cancel(true);
+                }
+
+                // Do everything in a background thread.
                 // Model initialization is deferred to that thread, too.
-                Thread pl = new PageLoader(null, null, p, loaded, page);
-                pl.start();
+                pageLoader = new PageLoader(null, null, loaded, page);
+                pageLoader.execute();
                 return;
             }
         }
@@ -604,44 +598,38 @@
 
 
     /**
-     * Thread to load a stream into the text document model.
+     * Loads a stream into the text document model.
      */
-    class PageLoader extends Thread {
+    class PageLoader extends SwingWorker<URL, Object> {
 
         /**
          * Construct an asynchronous page loader.
          */
-        PageLoader(Document doc, InputStream in, int priority, URL old,
-                   URL page) {
-            setPriority(priority);
+        PageLoader(Document doc, InputStream in, URL old, URL page) {
             this.in = in;
             this.old = old;
             this.page = page;
             this.doc = doc;
         }
 
-        boolean pageLoaded = false;
-
         /**
          * Try to load the document, then scroll the view
          * to the reference (if specified).  When done, fire
          * a page property change event.
          */
-        public void run() {
+        protected URL doInBackground() {
+            boolean pageLoaded = false;
             try {
                 if (in == null) {
                     in = getStream(page);
                     if (kit == null) {
                         // We received document of unknown content type.
-                        UIManager.getLookAndFeel().provideErrorFeedback(
-                                JEditorPane.this);
-                        return;
-                    }
-                    // Access to <code>loading</code> should be synchronized.
-                    synchronized(JEditorPane.this) {
-                        in = loading = new PageStream(in);
+                        UIManager.getLookAndFeel().
+                                provideErrorFeedback(JEditorPane.this);
+                        return old;
                     }
                 }
+
                 if (doc == null) {
                     try {
                         SwingUtilities.invokeAndWait(new Runnable() {
@@ -653,11 +641,11 @@
                     } catch (InvocationTargetException ex) {
                         UIManager.getLookAndFeel().provideErrorFeedback(
                                                             JEditorPane.this);
-                        return;
+                        return old;
                     } catch (InterruptedException ex) {
                         UIManager.getLookAndFeel().provideErrorFeedback(
                                                             JEditorPane.this);
-                        return;
+                        return old;
                     }
                 }
 
@@ -682,16 +670,14 @@
             } catch (IOException ioe) {
                 UIManager.getLookAndFeel().provideErrorFeedback(JEditorPane.this);
             } finally {
-                synchronized(JEditorPane.this) {
-                    loading = null;
+                if (pageLoaded) {
+                    SwingUtilities.invokeLater(new Runnable() {
+                        public void run() {
+                            JEditorPane.this.firePropertyChange("page", old, page);
+                        }
+                    });
                 }
-                SwingUtilities.invokeLater(new Runnable() {
-                    public void run() {
-                        if (pageLoaded) {
-                            firePropertyChange("page", old, page);
-                        }
-                    }
-                });
+                return (pageLoaded ? page : old);
             }
         }
 
@@ -718,51 +704,6 @@
         Document doc;
     }
 
-    static class PageStream extends FilterInputStream {
-
-        boolean canceled;
-
-        public PageStream(InputStream i) {
-            super(i);
-            canceled = false;
-        }
-
-        /**
-         * Cancel the loading of the stream by throwing
-         * an IOException on the next request.
-         */
-        public synchronized void cancel() {
-            canceled = true;
-        }
-
-        protected synchronized void checkCanceled() throws IOException {
-            if (canceled) {
-                throw new IOException("page canceled");
-            }
-        }
-
-        public int read() throws IOException {
-            checkCanceled();
-            return super.read();
-        }
-
-        public long skip(long n) throws IOException {
-            checkCanceled();
-            return super.skip(n);
-        }
-
-        public int available() throws IOException {
-            checkCanceled();
-            return super.available();
-        }
-
-        public void reset() throws IOException {
-            checkCanceled();
-            super.reset();
-        }
-
-    }
-
     /**
      * Fetches a stream for the given URL, which is about to
      * be loaded by the <code>setPage</code> method.  By
@@ -1179,11 +1120,6 @@
      * current selection.  The replacement text will have the
      * attributes currently defined for input.  If the component is not
      * editable, beep and return.
-     * <p>
-     * This method is thread safe, although most Swing methods
-     * are not. Please see
-     * <A HREF="http://java.sun.com/docs/books/tutorial/uiswing/misc/threads.html">How
-     * to Use Threads</A> for more information.
      *
      * @param content  the content to replace the selection with.  This
      *   value can be <code>null</code>
@@ -1454,11 +1390,6 @@
      * create a StringReader and call the read method.  In this case the model
      * would be replaced after it was initialized with the contents of the
      * string.
-     * <p>
-     * This method is thread safe, although most Swing methods
-     * are not. Please see
-     * <A HREF="http://java.sun.com/docs/books/tutorial/uiswing/misc/threads.html">How
-     * to Use Threads</A> for more information.
      *
      * @param t the new text to be set; if <code>null</code> the old
      *    text will be deleted
@@ -1573,11 +1504,7 @@
 
     // --- variables ---------------------------------------
 
-    /**
-     * Stream currently loading asynchronously (potentially cancelable).
-     * Access to this variable should be synchronized.
-     */
-    PageStream loading;
+    private SwingWorker<URL, Object> pageLoader;
 
     /**
      * Current content binding of the editor.
--- a/jdk/src/share/classes/javax/swing/JInternalFrame.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/javax/swing/JInternalFrame.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1285,7 +1285,7 @@
      *     description: Specifies what desktop layer is used.
      */
     public void setLayer(int layer) {
-      this.setLayer(new Integer(layer));
+      this.setLayer(Integer.valueOf(layer));
     }
 
     /**
@@ -2092,7 +2092,7 @@
          * have a value
          */
         public Number getCurrentAccessibleValue() {
-            return new Integer(getLayer());
+            return Integer.valueOf(getLayer());
         }
 
         /**
@@ -2116,7 +2116,7 @@
          * have a minimum value
          */
         public Number getMinimumAccessibleValue() {
-            return new Integer(Integer.MIN_VALUE);
+            return Integer.MIN_VALUE;
         }
 
         /**
@@ -2126,7 +2126,7 @@
          * have a maximum value
          */
         public Number getMaximumAccessibleValue() {
-            return new Integer(Integer.MAX_VALUE);
+            return Integer.MAX_VALUE;
         }
 
     } // AccessibleJInternalFrame
--- a/jdk/src/share/classes/javax/swing/JLabel.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/javax/swing/JLabel.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 1997-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-2008 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
@@ -31,6 +31,7 @@
 import java.awt.*;
 import java.text.*;
 import java.awt.geom.*;
+import java.beans.Transient;
 
 import java.io.ObjectOutputStream;
 import java.io.ObjectInputStream;
@@ -422,6 +423,7 @@
      * @see javax.swing.LookAndFeel#getDisabledIcon
      * @see ImageIcon
      */
+    @Transient
     public Icon getDisabledIcon() {
         if (!disabledIconSet && disabledIcon == null && defaultIcon != null) {
             disabledIcon = UIManager.getLookAndFeel().getDisabledIcon(this, defaultIcon);
--- a/jdk/src/share/classes/javax/swing/JList.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/javax/swing/JList.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 1997-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-2008 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
@@ -31,7 +31,9 @@
 import java.util.Vector;
 import java.util.Locale;
 
-import java.beans.*;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.beans.Transient;
 
 import javax.swing.event.*;
 import javax.accessibility.*;
@@ -724,6 +726,7 @@
      * @return the value of the {@code cellRenderer} property
      * @see #setCellRenderer
      */
+    @Transient
     public ListCellRenderer getCellRenderer() {
         return cellRenderer;
     }
@@ -2153,6 +2156,7 @@
      * @see #removeSelectionInterval
      * @see #addListSelectionListener
      */
+    @Transient
     public int[] getSelectedIndices() {
         ListSelectionModel sm = getSelectionModel();
         int iMin = sm.getMinSelectionIndex();
--- a/jdk/src/share/classes/javax/swing/JMenuBar.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/javax/swing/JMenuBar.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 1997-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-2008 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
@@ -32,6 +32,7 @@
 import java.awt.Point;
 import java.awt.Rectangle;
 import java.awt.event.*;
+import java.beans.Transient;
 import java.util.Vector;
 import java.util.Enumeration;
 
@@ -236,6 +237,7 @@
      *
      * @return the <code>JMenu</code> that delivers help to the user
      */
+    @Transient
     public JMenu getHelpMenu() {
         throw new Error("getHelpMenu() not yet implemented.");
     }
--- a/jdk/src/share/classes/javax/swing/JOptionPane.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/javax/swing/JOptionPane.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1512,7 +1512,7 @@
 
         iFrame.putClientProperty("JInternalFrame.frameType", "optionDialog");
         iFrame.putClientProperty("JInternalFrame.messageType",
-                                 new Integer(getMessageType()));
+                                 Integer.valueOf(getMessageType()));
 
         iFrame.addInternalFrameListener(new InternalFrameAdapter() {
             public void internalFrameClosing(InternalFrameEvent e) {
--- a/jdk/src/share/classes/javax/swing/JProgressBar.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/javax/swing/JProgressBar.java	Thu Jun 12 13:50:55 2008 -0700
@@ -775,9 +775,9 @@
                 accessibleContext.firePropertyChange(
                         AccessibleContext.ACCESSIBLE_VALUE_PROPERTY,
                         (oldModel== null
-                         ? null : new Integer(oldModel.getValue())),
+                         ? null : Integer.valueOf(oldModel.getValue())),
                         (newModel== null
-                         ? null : new Integer(newModel.getValue())));
+                         ? null : Integer.valueOf(newModel.getValue())));
             }
 
             if (model != null) {
@@ -850,8 +850,8 @@
         if (accessibleContext != null) {
             accessibleContext.firePropertyChange(
                     AccessibleContext.ACCESSIBLE_VALUE_PROPERTY,
-                    new Integer(oldValue),
-                    new Integer(brm.getValue()));
+                    Integer.valueOf(oldValue),
+                    Integer.valueOf(brm.getValue()));
         }
     }
 
@@ -1087,7 +1087,7 @@
          * @return the current value of this object
          */
         public Number getCurrentAccessibleValue() {
-            return new Integer(getValue());
+            return Integer.valueOf(getValue());
         }
 
         /**
@@ -1110,7 +1110,7 @@
          * @return the minimum value of this object
          */
         public Number getMinimumAccessibleValue() {
-            return new Integer(getMinimum());
+            return Integer.valueOf(getMinimum());
         }
 
         /**
@@ -1120,7 +1120,7 @@
          */
         public Number getMaximumAccessibleValue() {
             // TIGER - 4422362
-            return new Integer(model.getMaximum() - model.getExtent());
+            return Integer.valueOf(model.getMaximum() - model.getExtent());
         }
 
     } // AccessibleJProgressBar
--- a/jdk/src/share/classes/javax/swing/JScrollBar.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/javax/swing/JScrollBar.java	Thu Jun 12 13:50:55 2008 -0700
@@ -314,7 +314,7 @@
         BoundedRangeModel oldModel = model;
         if (model != null) {
             model.removeChangeListener(fwdAdjustmentEvents);
-            oldValue = new Integer(model.getValue());
+            oldValue = Integer.valueOf(model.getValue());
         }
         model = newModel;
         if (model != null) {
@@ -465,8 +465,8 @@
         if (accessibleContext != null) {
             accessibleContext.firePropertyChange(
                     AccessibleContext.ACCESSIBLE_VALUE_PROPERTY,
-                    new Integer(oldValue),
-                    new Integer(m.getValue()));
+                    Integer.valueOf(oldValue),
+                    Integer.valueOf(m.getValue()));
         }
     }
 
@@ -611,8 +611,8 @@
         if (accessibleContext != null) {
             accessibleContext.firePropertyChange(
                     AccessibleContext.ACCESSIBLE_VALUE_PROPERTY,
-                    new Integer(oldValue),
-                    new Integer(m.getValue()));
+                    Integer.valueOf(oldValue),
+                    Integer.valueOf(m.getValue()));
         }
     }
 
@@ -880,7 +880,7 @@
          * @return The current value of this object.
          */
         public Number getCurrentAccessibleValue() {
-            return new Integer(getValue());
+            return Integer.valueOf(getValue());
         }
 
         /**
@@ -903,7 +903,7 @@
          * @return The minimum value of this object.
          */
         public Number getMinimumAccessibleValue() {
-            return new Integer(getMinimum());
+            return Integer.valueOf(getMinimum());
         }
 
         /**
--- a/jdk/src/share/classes/javax/swing/JScrollPane.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/javax/swing/JScrollPane.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 1997-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-2008 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
@@ -43,8 +43,9 @@
 import java.io.ObjectInputStream;
 import java.io.IOException;
 
-import java.beans.*;
-
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.beans.Transient;
 
 /**
  * Provides a scrollable view of a lightweight component.
@@ -822,6 +823,7 @@
      * @return the <code>horizontalScrollBar</code> property
      * @see #setHorizontalScrollBar
      */
+    @Transient
     public JScrollBar getHorizontalScrollBar() {
         return horizontalScrollBar;
     }
@@ -880,6 +882,7 @@
      * @return the <code>verticalScrollBar</code> property
      * @see #setVerticalScrollBar
      */
+    @Transient
     public JScrollBar getVerticalScrollBar() {
         return verticalScrollBar;
     }
@@ -1012,6 +1015,7 @@
      * @return the <code>rowHeader</code> property
      * @see #setRowHeader
      */
+    @Transient
     public JViewport getRowHeader() {
         return rowHeader;
     }
@@ -1081,6 +1085,7 @@
      * @return the <code>columnHeader</code> property
      * @see #setColumnHeader
      */
+    @Transient
     public JViewport getColumnHeader() {
         return columnHeader;
     }
--- a/jdk/src/share/classes/javax/swing/JSlider.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/javax/swing/JSlider.java	Thu Jun 12 13:50:55 2008 -0700
@@ -485,9 +485,9 @@
                 accessibleContext.firePropertyChange(
                                                     AccessibleContext.ACCESSIBLE_VALUE_PROPERTY,
                                                     (oldModel == null
-                                                     ? null : new Integer(oldModel.getValue())),
+                                                     ? null : Integer.valueOf(oldModel.getValue())),
                                                     (newModel == null
-                                                     ? null : new Integer(newModel.getValue())));
+                                                     ? null : Integer.valueOf(newModel.getValue())));
             }
         }
 
@@ -538,8 +538,8 @@
         if (accessibleContext != null) {
             accessibleContext.firePropertyChange(
                                                 AccessibleContext.ACCESSIBLE_VALUE_PROPERTY,
-                                                new Integer(oldValue),
-                                                new Integer(m.getValue()));
+                                                Integer.valueOf(oldValue),
+                                                Integer.valueOf(m.getValue()));
         }
     }
 
@@ -581,7 +581,7 @@
     public void setMinimum(int minimum) {
         int oldMin = getModel().getMinimum();
         getModel().setMinimum(minimum);
-        firePropertyChange( "minimum", new Integer( oldMin ), new Integer( minimum ) );
+        firePropertyChange( "minimum", Integer.valueOf( oldMin ), Integer.valueOf( minimum ) );
     }
 
 
@@ -622,7 +622,7 @@
     public void setMaximum(int maximum) {
         int oldMax = getModel().getMaximum();
         getModel().setMaximum(maximum);
-        firePropertyChange( "maximum", new Integer( oldMax ), new Integer( maximum ) );
+        firePropertyChange( "maximum", Integer.valueOf( oldMax ), Integer.valueOf( maximum ) );
     }
 
 
@@ -989,7 +989,7 @@
 
             void createLabels() {
                 for ( int labelIndex = start; labelIndex <= getMaximum(); labelIndex += increment ) {
-                    put( new Integer( labelIndex ), new LabelUIResource( ""+labelIndex, JLabel.CENTER ) );
+                    put( Integer.valueOf( labelIndex ), new LabelUIResource( ""+labelIndex, JLabel.CENTER ) );
                 }
             }
         }
@@ -1463,7 +1463,7 @@
          * @return The current value of this object.
          */
         public Number getCurrentAccessibleValue() {
-            return new Integer(getValue());
+            return Integer.valueOf(getValue());
         }
 
         /**
@@ -1486,7 +1486,7 @@
          * @return The minimum value of this object.
          */
         public Number getMinimumAccessibleValue() {
-            return new Integer(getMinimum());
+            return Integer.valueOf(getMinimum());
         }
 
         /**
@@ -1497,7 +1497,7 @@
         public Number getMaximumAccessibleValue() {
             // TIGER - 4422362
             BoundedRangeModel model = JSlider.this.getModel();
-            return new Integer(model.getMaximum() - model.getExtent());
+            return Integer.valueOf(model.getMaximum() - model.getExtent());
         }
     } // AccessibleJSlider
 }
--- a/jdk/src/share/classes/javax/swing/JSplitPane.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/javax/swing/JSplitPane.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1195,7 +1195,7 @@
          * @return a localized String describing the value of this object
          */
         public Number getCurrentAccessibleValue() {
-            return new Integer(getDividerLocation());
+            return Integer.valueOf(getDividerLocation());
         }
 
 
@@ -1220,7 +1220,7 @@
          * @return The minimum value of this object.
          */
         public Number getMinimumAccessibleValue() {
-            return new Integer(getUI().getMinimumDividerLocation(
+            return Integer.valueOf(getUI().getMinimumDividerLocation(
                                                         JSplitPane.this));
         }
 
@@ -1231,7 +1231,7 @@
          * @return The maximum value of this object.
          */
         public Number getMaximumAccessibleValue() {
-            return new Integer(getUI().getMaximumDividerLocation(
+            return Integer.valueOf(getUI().getMaximumDividerLocation(
                                                         JSplitPane.this));
         }
 
--- a/jdk/src/share/classes/javax/swing/JTabbedPane.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/javax/swing/JTabbedPane.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 1997-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-2008 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,7 +27,7 @@
 
 import java.awt.*;
 import java.awt.event.*;
-import java.beans.*;
+import java.beans.Transient;
 import java.util.*;
 import javax.swing.event.*;
 import javax.swing.plaf.*;
@@ -563,6 +563,7 @@
      * @return the index of the selected tab
      * @see #setSelectedIndex
      */
+    @Transient
     public int getSelectedIndex() {
         return model.getSelectedIndex();
     }
@@ -648,6 +649,7 @@
      * @return the component corresponding to the selected tab
      * @see #setSelectedComponent
      */
+    @Transient
     public Component getSelectedComponent() {
         int index = getSelectedIndex();
         if (index == -1) {
@@ -967,7 +969,7 @@
         // currently no IndexPropertyChangeEvent.  Once
         // IndexPropertyChangeEvents have been added this code should be
         // modified to use it.
-        putClientProperty("__index_to_remove__", new Integer(index));
+        putClientProperty("__index_to_remove__", Integer.valueOf(index));
 
         /* if the selected tab is after the removal */
         if (selected > index) {
--- a/jdk/src/share/classes/javax/swing/JTable.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/javax/swing/JTable.java	Thu Jun 12 13:50:55 2008 -0700
@@ -7680,7 +7680,7 @@
          */
         public Accessible getAccessibleRowDescription(int r) {
             if (r < 0 || r >= getAccessibleRowCount()) {
-                throw new IllegalArgumentException(new Integer(r).toString());
+                throw new IllegalArgumentException(Integer.toString(r));
             }
             if (rowDescription == null) {
                 return null;
@@ -7698,7 +7698,7 @@
          */
         public void setAccessibleRowDescription(int r, Accessible a) {
             if (r < 0 || r >= getAccessibleRowCount()) {
-                throw new IllegalArgumentException(new Integer(r).toString());
+                throw new IllegalArgumentException(Integer.toString(r));
             }
             if (rowDescription == null) {
                 int numRows = getAccessibleRowCount();
@@ -7716,7 +7716,7 @@
          */
         public Accessible getAccessibleColumnDescription(int c) {
             if (c < 0 || c >= getAccessibleColumnCount()) {
-                throw new IllegalArgumentException(new Integer(c).toString());
+                throw new IllegalArgumentException(Integer.toString(c));
             }
             if (columnDescription == null) {
                 return null;
@@ -7734,7 +7734,7 @@
          */
         public void setAccessibleColumnDescription(int c, Accessible a) {
             if (c < 0 || c >= getAccessibleColumnCount()) {
-                throw new IllegalArgumentException(new Integer(c).toString());
+                throw new IllegalArgumentException(Integer.toString(c));
             }
             if (columnDescription == null) {
                 int numColumns = getAccessibleColumnCount();
--- a/jdk/src/share/classes/javax/swing/JTextArea.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/javax/swing/JTextArea.java	Thu Jun 12 13:50:55 2008 -0700
@@ -267,7 +267,7 @@
         Document doc = getDocument();
         if (doc != null) {
             int old = getTabSize();
-            doc.putProperty(PlainDocument.tabSizeAttribute, new Integer(size));
+            doc.putProperty(PlainDocument.tabSizeAttribute, Integer.valueOf(size));
             firePropertyChange("tabSize", old, size);
         }
     }
@@ -444,11 +444,6 @@
     /**
      * Inserts the specified text at the specified position.  Does nothing
      * if the model is null or if the text is null or empty.
-     * <p>
-     * This method is thread safe, although most Swing methods
-     * are not. Please see
-     * <A HREF="http://java.sun.com/docs/books/tutorial/uiswing/misc/threads.html">How
-     * to Use Threads</A> for more information.
      *
      * @param str the text to insert
      * @param pos the position at which to insert >= 0
@@ -471,11 +466,6 @@
     /**
      * Appends the given text to the end of the document.  Does nothing if
      * the model is null or the string is null or empty.
-     * <p>
-     * This method is thread safe, although most Swing methods
-     * are not. Please see
-     * <A HREF="http://java.sun.com/docs/books/tutorial/uiswing/misc/threads.html">How
-     * to Use Threads</A> for more information.
      *
      * @param str the text to insert
      * @see #insert
@@ -494,11 +484,6 @@
      * Replaces text from the indicated start to end position with the
      * new text specified.  Does nothing if the model is null.  Simply
      * does a delete if the new string is null or empty.
-     * <p>
-     * This method is thread safe, although most Swing methods
-     * are not. Please see
-     * <A HREF="http://java.sun.com/docs/books/tutorial/uiswing/misc/threads.html">How
-     * to Use Threads</A> for more information.
      *
      * @param str the text to use as the replacement
      * @param start the start position >= 0
--- a/jdk/src/share/classes/javax/swing/JTextPane.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/javax/swing/JTextPane.java	Thu Jun 12 13:50:55 2008 -0700
@@ -167,11 +167,6 @@
      * current selection.  The replacement text will have the
      * attributes currently defined for input at the point of
      * insertion.  If the document is not editable, beep and return.
-     * <p>
-     * This method is thread safe, although most Swing methods
-     * are not. Please see
-     * <A HREF="http://java.sun.com/docs/books/tutorial/uiswing/misc/threads.html">How
-     * to Use Threads</A> for more information.
      *
      * @param content  the content to replace the selection with
      */
@@ -229,11 +224,6 @@
      * a value of <code>0.75</code> will cause 75 percent of the
      * component to be above the baseline, and 25 percent of the
      * component to be below the baseline.
-     * <p>
-     * This method is thread safe, although most Swing methods
-     * are not. Please see
-     * <A HREF="http://java.sun.com/docs/books/tutorial/uiswing/misc/threads.html">How
-     * to Use Threads</A> for more information.
      *
      * @param c    the component to insert
      */
@@ -252,11 +242,6 @@
      * current position of the caret.  This is represented in
      * the associated document as an attribute of one character
      * of content.
-     * <p>
-     * This method is thread safe, although most Swing methods
-     * are not. Please see
-     * <A HREF="http://java.sun.com/docs/books/tutorial/uiswing/misc/threads.html">How
-     * to Use Threads</A> for more information.
      *
      * @param g    the icon to insert
      * @see Icon
@@ -320,11 +305,6 @@
      * through the logical style assigned to the paragraph, which
      * in term may resolve through some hierarchy completely
      * independent of the element hierarchy in the document.
-     * <p>
-     * This method is thread safe, although most Swing methods
-     * are not. Please see
-     * <A HREF="http://java.sun.com/docs/books/tutorial/uiswing/misc/threads.html">How
-     * to Use Threads</A> for more information.
      *
      * @param s  the logical style to assign to the paragraph,
      *          or <code>null</code> for no style
@@ -367,11 +347,6 @@
      * is no selection, the attributes are applied to
      * the input attribute set which defines the attributes
      * for any new text that gets inserted.
-     * <p>
-     * This method is thread safe, although most Swing methods
-     * are not. Please see
-     * <A HREF="http://java.sun.com/docs/books/tutorial/uiswing/misc/threads.html">How
-     * to Use Threads</A> for more information.
      *
      * @param attr the attributes
      * @param replace if true, then replace the existing attributes first
@@ -412,11 +387,6 @@
      * to the paragraphs that intersect the selection.
      * If there is no selection, the attributes are applied
      * to the paragraph at the current caret position.
-     * <p>
-     * This method is thread safe, although most Swing methods
-     * are not. Please see
-     * <A HREF="http://java.sun.com/docs/books/tutorial/uiswing/misc/threads.html">How
-     * to Use Threads</A> for more information.
      *
      * @param attr the non-<code>null</code> attributes
      * @param replace if true, replace the existing attributes first
--- a/jdk/src/share/classes/javax/swing/JViewport.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/javax/swing/JViewport.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 1997-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-2008 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
@@ -30,6 +30,7 @@
 import java.awt.image.VolatileImage;
 import java.awt.peer.ComponentPeer;
 import java.applet.Applet;
+import java.beans.Transient;
 import javax.swing.plaf.ViewportUI;
 
 import javax.swing.event.*;
@@ -1257,6 +1258,7 @@
      *
      * @return a <code>Dimension</code> object giving the size of the view
      */
+    @Transient
     public Dimension getExtentSize() {
         return getSize();
     }
--- a/jdk/src/share/classes/javax/swing/MenuSelectionManager.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/javax/swing/MenuSelectionManager.java	Thu Jun 12 13:50:55 2008 -0700
@@ -218,9 +218,9 @@
         int selectionSize;
         p = event.getPoint();
 
-        Component source = (Component)event.getSource();
+        Component source = event.getComponent();
 
-        if (!source.isShowing()) {
+        if ((source != null) && !source.isShowing()) {
             // This can happen if a mouseReleased removes the
             // containing component -- bug 4146684
             return;
@@ -236,7 +236,9 @@
             return;
         }
 
-        SwingUtilities.convertPointToScreen(p,source);
+        if (source != null) {
+            SwingUtilities.convertPointToScreen(p, source);
+        }
 
         screenX = p.x;
         screenY = p.y;
--- a/jdk/src/share/classes/javax/swing/Popup.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/javax/swing/Popup.java	Thu Jun 12 13:50:55 2008 -0700
@@ -229,7 +229,15 @@
             // Popups are typically transient and most likely won't benefit
             // from true double buffering.  Turn it off here.
             getRootPane().setUseTrueDoubleBuffering(false);
-            setAlwaysOnTop(true);
+            // Try to set "always-on-top" for the popup window.
+            // Applets usually don't have sufficient permissions to do it.
+            // In this case simply ignore the exception.
+            try {
+                setAlwaysOnTop(true);
+            } catch (SecurityException se) {
+                // setAlwaysOnTop is restricted,
+                // the exception is ignored
+            }
         }
 
         public void update(Graphics g) {
--- a/jdk/src/share/classes/javax/swing/ScrollPaneLayout.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/javax/swing/ScrollPaneLayout.java	Thu Jun 12 13:50:55 2008 -0700
@@ -488,10 +488,14 @@
         Dimension viewSize = null;
         Component view = null;
 
-        if (viewport !=  null) {
+        if (viewport != null) {
             extentSize = viewport.getPreferredSize();
             view = viewport.getView();
-            viewSize  = view.getPreferredSize();
+            if (view != null) {
+                viewSize = view.getPreferredSize();
+            } else {
+                viewSize = new Dimension(0, 0);
+            }
         }
 
         /* If there's a viewport add its preferredSize.
--- a/jdk/src/share/classes/javax/swing/SpinnerNumberModel.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/javax/swing/SpinnerNumberModel.java	Thu Jun 12 13:50:55 2008 -0700
@@ -144,7 +144,7 @@
      *     <code>minimum &lt;= value &lt;= maximum</code>
      */
     public SpinnerNumberModel(int value, int minimum, int maximum, int stepSize) {
-        this(new Integer(value), new Integer(minimum), new Integer(maximum), new Integer(stepSize));
+        this(Integer.valueOf(value), Integer.valueOf(minimum), Integer.valueOf(maximum), Integer.valueOf(stepSize));
     }
 
 
@@ -171,7 +171,7 @@
      * <code>stepSize</code> equal to one, and an initial value of zero.
      */
     public SpinnerNumberModel() {
-        this(new Integer(0), null, null, new Integer(1));
+        this(Integer.valueOf(0), null, null, Integer.valueOf(1));
     }
 
 
@@ -333,16 +333,16 @@
             long v = value.longValue() + (stepSize.longValue() * (long)dir);
 
             if (value instanceof Long) {
-                newValue = new Long(v);
+                newValue = Long.valueOf(v);
             }
             else if (value instanceof Integer) {
-                newValue = new Integer((int)v);
+                newValue = Integer.valueOf((int)v);
             }
             else if (value instanceof Short) {
-                newValue = new Short((short)v);
+                newValue = Short.valueOf((short)v);
             }
             else {
-                newValue = new Byte((byte)v);
+                newValue = Byte.valueOf((byte)v);
             }
         }
 
--- a/jdk/src/share/classes/javax/swing/TablePrintable.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/javax/swing/TablePrintable.java	Thu Jun 12 13:50:55 2008 -0700
@@ -215,7 +215,7 @@
         }
 
         // to pass the page number when formatting the header and footer text
-        Object[] pageNumber = new Object[]{new Integer(pageIndex + 1)};
+        Object[] pageNumber = new Object[]{Integer.valueOf(pageIndex + 1)};
 
         // fetch the formatted header text, if any
         String headerText = null;
--- a/jdk/src/share/classes/javax/swing/border/TitledBorder.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/javax/swing/border/TitledBorder.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 1997-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-2008 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
@@ -642,6 +642,9 @@
         if (c == null) {
             throw new NullPointerException("Must supply non-null component");
         }
+        if (width < 0) {
+            throw new IllegalArgumentException("Width must be >= 0");
+        }
         if (height < 0) {
             throw new IllegalArgumentException("Height must be >= 0");
         }
--- a/jdk/src/share/classes/javax/swing/colorchooser/AbstractColorChooserPanel.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/javax/swing/colorchooser/AbstractColorChooserPanel.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 1998-2001 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1998-2008 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
@@ -26,9 +26,7 @@
 package javax.swing.colorchooser;
 
 import java.awt.*;
-import java.io.Serializable;
 import javax.swing.*;
-import javax.swing.event.*;
 
 /**
  * This is the abstract superclass for color choosers.  If you want to add
@@ -55,17 +53,6 @@
     private JColorChooser chooser;
 
     /**
-     *
-     */
-    private ChangeListener colorListener;
-
-    /**
-     *
-     */
-    private boolean dirty  = true;
-
-
-    /**
       * Invoked automatically when the model's state changes.
       * It is also called by <code>installChooserPanel</code> to allow
       * you to set up the initial state of your chooser.
@@ -157,8 +144,6 @@
         chooser = enclosingChooser;
         buildChooser();
         updateChooser();
-        colorListener = new ModelListener();
-        getColorSelectionModel().addChangeListener(colorListener);
     }
 
     /**
@@ -166,7 +151,6 @@
      * If override this, be sure to call <code>super</code>.
      */
   public void uninstallChooserPanel(JColorChooser enclosingChooser) {
-        getColorSelectionModel().removeChangeListener(colorListener);
         chooser = null;
     }
 
@@ -192,10 +176,6 @@
      * @param g  the <code>Graphics</code> object
      */
     public void paint(Graphics g) {
-        if (dirty) {
-            updateChooser();
-            dirty = false;
-        }
         super.paint(g);
     }
 
@@ -222,18 +202,4 @@
         }
         return defaultValue;
     }
-
-    /**
-     *
-     */
-    class ModelListener implements ChangeListener, Serializable {
-        public void stateChanged(ChangeEvent e) {
-          if (isShowing()) {  // isVisible
-                updateChooser();
-                dirty = false;
-            } else {
-                dirty = true;
-            }
-        }
-    }
 }
--- a/jdk/src/share/classes/javax/swing/filechooser/FileSystemView.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/javax/swing/filechooser/FileSystemView.java	Thu Jun 12 13:50:55 2008 -0700
@@ -26,26 +26,18 @@
 package javax.swing.filechooser;
 
 
-import javax.swing.event.*;
 import javax.swing.*;
 
 import java.awt.Image;
 import java.io.File;
-import java.io.FileFilter;
-import java.io.FilenameFilter;
 import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.text.MessageFormat;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
 import java.util.Vector;
+import java.lang.ref.WeakReference;
 import java.beans.PropertyChangeListener;
 import java.beans.PropertyChangeEvent;
 
-
-import java.lang.reflect.*;
-
 import sun.awt.shell.*;
 
 /**
@@ -74,18 +66,11 @@
     static FileSystemView unixFileSystemView = null;
     //static FileSystemView macFileSystemView = null;
     static FileSystemView genericFileSystemView = null;
-    static boolean useSystemExtensionsHiding = false;
+
+    private boolean useSystemExtensionHiding =
+            UIManager.getDefaults().getBoolean("FileChooser.useSystemExtensionHiding");
 
     public static FileSystemView getFileSystemView() {
-        useSystemExtensionsHiding = UIManager.getDefaults().getBoolean("FileChooser.useSystemExtensionHiding");
-        UIManager.addPropertyChangeListener(new PropertyChangeListener() {
-            public void propertyChange(PropertyChangeEvent e) {
-               if (e.getPropertyName().equals("lookAndFeel")) {
-                   useSystemExtensionsHiding = UIManager.getDefaults().getBoolean("FileChooser.useSystemExtensionHiding");
-               }
-            }
-        });
-
         if(File.separatorChar == '\\') {
             if(windowsFileSystemView == null) {
                 windowsFileSystemView = new WindowsFileSystemView();
@@ -113,6 +98,26 @@
         return genericFileSystemView;
     }
 
+    public FileSystemView() {
+        final WeakReference<FileSystemView> weakReference = new WeakReference<FileSystemView>(this);
+
+        UIManager.addPropertyChangeListener(new PropertyChangeListener() {
+            public void propertyChange(PropertyChangeEvent evt) {
+                FileSystemView fileSystemView = weakReference.get();
+
+                if (fileSystemView == null) {
+                    // FileSystemView was destroyed
+                    UIManager.removePropertyChangeListener(this);
+                } else {
+                    if (evt.getPropertyName().equals("lookAndFeel")) {
+                        fileSystemView.useSystemExtensionHiding =
+                                UIManager.getDefaults().getBoolean("FileChooser.useSystemExtensionHiding");
+                    }
+                }
+            }
+        });
+    }
+
     /**
      * Determines if the given file is a root in the navigatable tree(s).
      * Examples: Windows 98 has one root, the Desktop folder. DOS has one root
@@ -170,7 +175,7 @@
         if (f != null) {
             name = f.getName();
             if (!name.equals("..") && !name.equals(".") &&
-                (useSystemExtensionsHiding ||
+                (useSystemExtensionHiding ||
                  !isFileSystem(f) ||
                  isFileSystemRoot(f)) &&
                 ((f instanceof ShellFolder) ||
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicButtonUI.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicButtonUI.java	Thu Jun 12 13:50:55 2008 -0700
@@ -109,7 +109,7 @@
             LookAndFeel.installProperty(b, "rolloverEnabled", rollover);
         }
 
-        LookAndFeel.installProperty(b, "iconTextGap", new Integer(4));
+        LookAndFeel.installProperty(b, "iconTextGap", Integer.valueOf(4));
     }
 
     protected void installListeners(AbstractButton b) {
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicColorChooserUI.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicColorChooserUI.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 1997-2004 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-2008 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
@@ -30,16 +30,12 @@
 import javax.swing.event.*;
 import javax.swing.border.*;
 import javax.swing.plaf.*;
-import java.util.*;
 import java.awt.*;
-import java.awt.image.*;
 import java.awt.event.*;
 import java.beans.PropertyChangeEvent;
 import java.beans.PropertyChangeListener;
-import java.io.Serializable;
 
 import sun.swing.DefaultLookup;
-import sun.swing.UIAction;
 
 /**
  * Provides the basic look and feel for a JColorChooser.
@@ -212,9 +208,24 @@
     protected void uninstallListeners() {
         chooser.removePropertyChangeListener( propertyChangeListener );
         chooser.getSelectionModel().removeChangeListener(previewListener);
+        previewListener = null;
         previewPanel.removeMouseListener(getHandler());
     }
 
+    private void selectionChanged(ColorSelectionModel model) {
+        if (this.previewPanel != null) {
+            this.previewPanel.setForeground(model.getSelectedColor());
+            this.previewPanel.repaint();
+        }
+        AbstractColorChooserPanel[] panels = this.chooser.getChooserPanels();
+        if (panels != null) {
+            for (AbstractColorChooserPanel panel : panels) {
+                if (panel != null) {
+                    panel.updateChooser();
+                }
+            }
+        }
+    }
 
     private class Handler implements ChangeListener, MouseListener,
             PropertyChangeListener {
@@ -222,11 +233,7 @@
         // ChangeListener
         //
         public void stateChanged(ChangeEvent evt) {
-            ColorSelectionModel model = (ColorSelectionModel)evt.getSource();
-            if (previewPanel != null) {
-                previewPanel.setForeground(model.getSelectedColor());
-                previewPanel.repaint();
-            }
+            selectionChanged((ColorSelectionModel) evt.getSource());
         }
 
         //
@@ -302,13 +309,19 @@
                     newPanels[i].installChooserPanel(chooser);
                 }
             }
-
-            if (prop == JColorChooser.PREVIEW_PANEL_PROPERTY) {
+            else if (prop == JColorChooser.PREVIEW_PANEL_PROPERTY) {
                 if (evt.getNewValue() != previewPanel) {
                     installPreviewPanel();
                 }
             }
-            if (prop == "componentOrientation") {
+            else if (prop == JColorChooser.SELECTION_MODEL_PROPERTY) {
+                ColorSelectionModel oldModel = (ColorSelectionModel) evt.getOldValue();
+                oldModel.removeChangeListener(previewListener);
+                ColorSelectionModel newModel = (ColorSelectionModel) evt.getNewValue();
+                newModel.addChangeListener(previewListener);
+                selectionChanged(newModel);
+            }
+            else if (prop == "componentOrientation") {
                 ComponentOrientation o =
                     (ComponentOrientation)evt.getNewValue();
                 JColorChooser cc = (JColorChooser)evt.getSource();
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicLookAndFeel.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicLookAndFeel.java	Thu Jun 12 13:50:55 2008 -0700
@@ -654,7 +654,7 @@
                 "javax.swing.plaf.basic.BasicIconFactory",
                 "getRadioButtonMenuItemIcon");
 
-        Object menuItemAcceleratorDelimiter = new String("+");
+        Object menuItemAcceleratorDelimiter = "+";
 
         // *** OptionPane value objects
 
@@ -1364,6 +1364,7 @@
                         "LEFT", "positiveUnitIncrement",
                      "KP_LEFT", "positiveUnitIncrement",
                  }),
+            "Slider.onlyLeftMouseButtonDrag", Boolean.TRUE,
 
             // *** Spinner
             "Spinner.font", monospacedPlain12,
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicMenuItemUI.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicMenuItemUI.java	Thu Jun 12 13:50:55 2008 -0700
@@ -146,7 +146,7 @@
             menuItem.setMargin(UIManager.getInsets(prefix + ".margin"));
         }
 
-        LookAndFeel.installProperty(menuItem, "iconTextGap", new Integer(4));
+        LookAndFeel.installProperty(menuItem, "iconTextGap", Integer.valueOf(4));
         defaultTextIconGap = menuItem.getIconTextGap();
 
         LookAndFeel.installBorder(menuItem, prefix + ".border");
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicOptionPaneUI.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicOptionPaneUI.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1195,10 +1195,10 @@
                 if (options == null) {
                     if (optionType == JOptionPane.OK_CANCEL_OPTION &&
                         buttonIndex == 1) {
-                        optionPane.setValue(new Integer(2));
+                        optionPane.setValue(Integer.valueOf(2));
 
                     } else {
-                        optionPane.setValue(new Integer(buttonIndex));
+                        optionPane.setValue(Integer.valueOf(buttonIndex));
                     }
                 } else {
                     optionPane.setValue(options[buttonIndex]);
@@ -1393,7 +1393,7 @@
             if (getName() == CLOSE) {
                 JOptionPane optionPane = (JOptionPane)e.getSource();
 
-                optionPane.setValue(new Integer(JOptionPane.CLOSED_OPTION));
+                optionPane.setValue(Integer.valueOf(JOptionPane.CLOSED_OPTION));
             }
         }
     }
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicSliderUI.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicSliderUI.java	Thu Jun 12 13:50:55 2008 -0700
@@ -552,20 +552,28 @@
         contentRect.height = focusRect.height - (focusInsets.top + focusInsets.bottom);
     }
 
+    private int getTickSpacing() {
+        int majorTickSpacing = slider.getMajorTickSpacing();
+        int minorTickSpacing = slider.getMinorTickSpacing();
+
+        int result;
+
+        if (minorTickSpacing > 0) {
+            result = minorTickSpacing;
+        } else if (majorTickSpacing > 0) {
+            result = majorTickSpacing;
+        } else {
+            result = 0;
+        }
+
+        return result;
+    }
+
     protected void calculateThumbLocation() {
         if ( slider.getSnapToTicks() ) {
             int sliderValue = slider.getValue();
             int snappedValue = sliderValue;
-            int majorTickSpacing = slider.getMajorTickSpacing();
-            int minorTickSpacing = slider.getMinorTickSpacing();
-            int tickSpacing = 0;
-
-            if ( minorTickSpacing > 0 ) {
-                tickSpacing = minorTickSpacing;
-            }
-            else if ( majorTickSpacing > 0 ) {
-                tickSpacing = majorTickSpacing;
-            }
+            int tickSpacing = getTickSpacing();
 
             if ( tickSpacing != 0 ) {
                 // If it's not on a tick, change the value
@@ -1273,28 +1281,34 @@
 
     public void scrollByBlock(int direction)    {
         synchronized(slider)    {
-
-            int oldValue = slider.getValue();
             int blockIncrement =
                 (slider.getMaximum() - slider.getMinimum()) / 10;
-            if (blockIncrement <= 0 &&
-                slider.getMaximum() > slider.getMinimum()) {
-
+            if (blockIncrement == 0) {
                 blockIncrement = 1;
             }
 
+            if (slider.getSnapToTicks()) {
+                int tickSpacing = getTickSpacing();
+
+                if (blockIncrement < tickSpacing) {
+                    blockIncrement = tickSpacing;
+                }
+            }
+
             int delta = blockIncrement * ((direction > 0) ? POSITIVE_SCROLL : NEGATIVE_SCROLL);
-            slider.setValue(oldValue + delta);
+            slider.setValue(slider.getValue() + delta);
         }
     }
 
     public void scrollByUnit(int direction) {
         synchronized(slider)    {
+            int delta = ((direction > 0) ? POSITIVE_SCROLL : NEGATIVE_SCROLL);
 
-            int oldValue = slider.getValue();
-            int delta = 1 * ((direction > 0) ? POSITIVE_SCROLL : NEGATIVE_SCROLL);
+            if (slider.getSnapToTicks()) {
+                delta *= getTickSpacing();
+            }
 
-            slider.setValue(oldValue + delta);
+            slider.setValue(slider.getValue() + delta);
         }
     }
 
@@ -1573,6 +1587,11 @@
 
             // Clicked in the Thumb area?
             if (thumbRect.contains(currentMouseX, currentMouseY)) {
+                if (UIManager.getBoolean("Slider.onlyLeftMouseButtonDrag")
+                        && !SwingUtilities.isLeftMouseButton(e)) {
+                    return;
+                }
+
                 switch (slider.getOrientation()) {
                 case JSlider.VERTICAL:
                     offset = currentMouseY - thumbRect.y;
@@ -1584,6 +1603,11 @@
                 isDragging = true;
                 return;
             }
+
+            if (!SwingUtilities.isLeftMouseButton(e)) {
+                return;
+            }
+
             isDragging = false;
             slider.setValueIsAdjusting(true);
 
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicTabbedPaneUI.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicTabbedPaneUI.java	Thu Jun 12 13:50:55 2008 -0700
@@ -539,7 +539,7 @@
         }
         mnemonicInputMap.put(KeyStroke.getKeyStroke(mnemonic, Event.ALT_MASK),
                              "setSelectedIndex");
-        mnemonicToIndexMap.put(new Integer(mnemonic), new Integer(index));
+        mnemonicToIndexMap.put(Integer.valueOf(mnemonic), Integer.valueOf(index));
     }
 
     /**
@@ -2231,7 +2231,7 @@
                         mnemonic  -= ('a' - 'A');
                     }
                     Integer index = (Integer)ui.mnemonicToIndexMap.
-                                 get(new Integer(mnemonic));
+                                 get(Integer.valueOf(mnemonic));
                     if (index != null && pane.isEnabledAt(index.intValue())) {
                         pane.setSelectedIndex(index.intValue());
                     }
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicToolBarUI.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicToolBarUI.java	Thu Jun 12 13:50:55 2008 -0700
@@ -178,7 +178,7 @@
         dragWindow = null;
         dockingSource = null;
 
-        c.putClientProperty( FOCUSED_COMP_INDEX, new Integer( focusedCompIndex ) );
+        c.putClientProperty( FOCUSED_COMP_INDEX, Integer.valueOf( focusedCompIndex ) );
     }
 
     protected void installDefaults( )
--- a/jdk/src/share/classes/javax/swing/plaf/metal/MetalIconFactory.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/javax/swing/plaf/metal/MetalIconFactory.java	Thu Jun 12 13:50:55 2008 -0700
@@ -2278,18 +2278,16 @@
     }
 
     public void paintIcon( Component c, Graphics g, int x, int y ) {
-        JSlider slider = (JSlider)c;
-
-        boolean leftToRight = MetalUtils.isLeftToRight(slider);
+        boolean leftToRight = MetalUtils.isLeftToRight(c);
 
         g.translate( x, y );
 
         // Draw the frame
-        if ( slider.hasFocus() ) {
+        if ( c.hasFocus() ) {
             g.setColor( MetalLookAndFeel.getPrimaryControlInfo() );
         }
         else {
-            g.setColor( slider.isEnabled() ? MetalLookAndFeel.getPrimaryControlInfo() :
+            g.setColor( c.isEnabled() ? MetalLookAndFeel.getPrimaryControlInfo() :
                                              MetalLookAndFeel.getControlDarkShadow() );
         }
 
@@ -2309,7 +2307,7 @@
         }
 
         // Fill in the background
-        if ( slider.hasFocus() ) {
+        if ( c.hasFocus() ) {
             g.setColor( c.getForeground() );
         }
         else {
@@ -2338,8 +2336,8 @@
 
         // Draw the bumps
         int offset = (leftToRight) ? 2 : 8;
-        if ( slider.isEnabled() ) {
-            if ( slider.hasFocus() ) {
+        if ( c.isEnabled() ) {
+            if ( c.hasFocus() ) {
                 primaryBumps.paintIcon( c, g, offset, 2 );
             }
             else {
@@ -2348,8 +2346,8 @@
         }
 
         // Draw the highlight
-        if ( slider.isEnabled() ) {
-            g.setColor( slider.hasFocus() ? MetalLookAndFeel.getPrimaryControl()
+        if ( c.isEnabled() ) {
+            g.setColor( c.hasFocus() ? MetalLookAndFeel.getPrimaryControl()
                         : MetalLookAndFeel.getControlHighlight() );
             if (leftToRight) {
                 g.drawLine( 1, 1, 8, 1 );
@@ -2389,16 +2387,14 @@
     }
 
     public void paintIcon( Component c, Graphics g, int x, int y ) {
-        JSlider slider = (JSlider)c;
-
         g.translate( x, y );
 
         // Draw the frame
-        if ( slider.hasFocus() ) {
+        if ( c.hasFocus() ) {
             g.setColor( MetalLookAndFeel.getPrimaryControlInfo() );
         }
         else {
-            g.setColor( slider.isEnabled() ? MetalLookAndFeel.getPrimaryControlInfo() :
+            g.setColor( c.isEnabled() ? MetalLookAndFeel.getPrimaryControlInfo() :
                                              MetalLookAndFeel.getControlDarkShadow() );
         }
 
@@ -2409,7 +2405,7 @@
         g.drawLine(  7,15 , 14,8 );  // right slant
 
         // Fill in the background
-        if ( slider.hasFocus() ) {
+        if ( c.hasFocus() ) {
             g.setColor( c.getForeground() );
         }
         else {
@@ -2425,8 +2421,8 @@
         g.drawLine( 7,14 ,  7,14 );
 
         // Draw the bumps
-        if ( slider.isEnabled() ) {
-            if ( slider.hasFocus() ) {
+        if ( c.isEnabled() ) {
+            if ( c.hasFocus() ) {
                 primaryBumps.paintIcon( c, g, 2, 2 );
             }
             else {
@@ -2435,8 +2431,8 @@
         }
 
         // Draw the highlight
-        if ( slider.isEnabled() ) {
-            g.setColor( slider.hasFocus() ? MetalLookAndFeel.getPrimaryControl()
+        if ( c.isEnabled() ) {
+            g.setColor( c.hasFocus() ? MetalLookAndFeel.getPrimaryControl()
                         : MetalLookAndFeel.getControlHighlight() );
             g.drawLine( 1, 1, 13, 1 );
             g.drawLine( 1, 1, 1, 8 );
--- a/jdk/src/share/classes/javax/swing/plaf/metal/MetalLookAndFeel.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/javax/swing/plaf/metal/MetalLookAndFeel.java	Thu Jun 12 13:50:55 2008 -0700
@@ -455,7 +455,7 @@
 
         Insets zeroInsets = new InsetsUIResource(0, 0, 0, 0);
 
-        Integer zero = new Integer(0);
+        Integer zero = Integer.valueOf(0);
 
         Object textFieldBorder =
             new SwingLazyValue("javax.swing.plaf.metal.MetalBorders",
@@ -904,7 +904,7 @@
             "ProgressBar.selectionBackground", primaryControlDarkShadow,
             "ProgressBar.border", progressBarBorder,
             "ProgressBar.cellSpacing", zero,
-            "ProgressBar.cellLength", new Integer(1),
+            "ProgressBar.cellLength", Integer.valueOf(1),
 
             // Combo Box
             "ComboBox.background", control,
@@ -971,7 +971,7 @@
             "DesktopIcon.font", controlTextValue,
             "DesktopIcon.foreground", controlTextColor,
             "DesktopIcon.background", control,
-            "DesktopIcon.width", new Integer(160),
+            "DesktopIcon.width", Integer.valueOf(160),
 
             "Desktop.ancestorInputMap",
                new UIDefaults.LazyInputMap(new Object[] {
--- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthArrowButton.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthArrowButton.java	Thu Jun 12 13:50:55 2008 -0700
@@ -53,7 +53,7 @@
 
     public void setDirection(int dir) {
         direction = dir;
-        putClientProperty("__arrow_direction__", new Integer(dir));
+        putClientProperty("__arrow_direction__", Integer.valueOf(dir));
         repaint();
     }
 
--- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthDesktopPaneUI.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthDesktopPaneUI.java	Thu Jun 12 13:50:55 2008 -0700
@@ -96,7 +96,7 @@
             }
             taskBar.setBackground(desktop.getBackground());
             desktop.add(taskBar,
-                new Integer(JLayeredPane.PALETTE_LAYER.intValue() + 1));
+                Integer.valueOf(JLayeredPane.PALETTE_LAYER.intValue() + 1));
             if (desktop.isShowing()) {
                 taskBar.adjustSize();
             }
--- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthSplitPaneUI.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthSplitPaneUI.java	Thu Jun 12 13:50:55 2008 -0700
@@ -127,7 +127,7 @@
         if (style != oldStyle) {
             Object value = style.get(context, "SplitPane.size");
             if (value == null) {
-                value = new Integer(6);
+                value = Integer.valueOf(6);
             }
             LookAndFeel.installProperty(splitPane, "dividerSize", value);
 
--- a/jdk/src/share/classes/javax/swing/table/JTableHeader.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/javax/swing/table/JTableHeader.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 1997-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-2008 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,6 +37,7 @@
 import javax.accessibility.*;
 
 import java.beans.PropertyChangeListener;
+import java.beans.Transient;
 
 import java.io.ObjectOutputStream;
 import java.io.ObjectInputStream;
@@ -325,6 +326,7 @@
      * @return the default renderer
      * @since 1.3
      */
+    @Transient
     public TableCellRenderer getDefaultRenderer() {
         return defaultRenderer;
     }
--- a/jdk/src/share/classes/javax/swing/table/TableColumn.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/javax/swing/table/TableColumn.java	Thu Jun 12 13:50:55 2008 -0700
@@ -281,7 +281,7 @@
 
     private void firePropertyChange(String propertyName, int oldValue, int newValue) {
         if (oldValue != newValue) {
-            firePropertyChange(propertyName, new Integer(oldValue), new Integer(newValue));
+            firePropertyChange(propertyName, Integer.valueOf(oldValue), Integer.valueOf(newValue));
         }
     }
 
--- a/jdk/src/share/classes/javax/swing/text/AbstractDocument.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/javax/swing/text/AbstractDocument.java	Thu Jun 12 13:50:55 2008 -0700
@@ -351,7 +351,7 @@
      *   loaded asynchronously
      */
     public void setAsynchronousLoadPriority(int p) {
-        Integer loadPriority = (p >= 0) ? new Integer(p) : null;
+        Integer loadPriority = (p >= 0) ? Integer.valueOf(p) : null;
         putProperty(AbstractDocument.AsyncLoadPriority, loadPriority);
     }
 
@@ -2675,7 +2675,7 @@
          */
         BidiElement(Element parent, int start, int end, int level) {
             super(parent, new SimpleAttributeSet(), start, end);
-            addAttribute(StyleConstants.BidiLevel, new Integer(level));
+            addAttribute(StyleConstants.BidiLevel, Integer.valueOf(level));
             //System.out.println("BidiElement: start = " + start
             //                   + " end = " + end + " level = " + level );
         }
--- a/jdk/src/share/classes/javax/swing/text/JTextComponent.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/javax/swing/text/JTextComponent.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 1997-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-2008 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
@@ -29,6 +29,7 @@
 import java.security.AccessController;
 import java.security.PrivilegedAction;
 
+import java.beans.Transient;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.Hashtable;
@@ -571,6 +572,7 @@
      *
      * @return the caret
      */
+    @Transient
     public Caret getCaret() {
         return caret;
     }
@@ -1349,11 +1351,6 @@
      * This is the method that is used by the default implementation
      * of the action for inserting content that gets bound to the
      * keymap actions.
-     * <p>
-     * This method is thread safe, although most Swing methods
-     * are not. Please see
-     * <A HREF="http://java.sun.com/docs/books/tutorial/uiswing/misc/threads.html">How
-     * to Use Threads</A> for more information.
      *
      * @param content  the content to replace the selection with
      */
@@ -1677,6 +1674,7 @@
      * @return the position of the text insertion caret for the
      *  text component >= 0
      */
+    @Transient
     public int getCaretPosition() {
         return caret.getDot();
     }
@@ -1687,12 +1685,8 @@
      * or empty, has the effect of simply deleting the old text.
      * When text has been inserted, the resulting caret location
      * is determined by the implementation of the caret class.
+     *
      * <p>
-     * This method is thread safe, although most Swing methods
-     * are not. Please see
-     * <A HREF="http://java.sun.com/docs/books/tutorial/uiswing/misc/threads.html">How
-     * to Use Threads</A> for more information.
-     *
      * Note that text is not a bound property, so no <code>PropertyChangeEvent
      * </code> is fired when it changes. To listen for changes to the text,
      * use <code>DocumentListener</code>.
@@ -1806,6 +1800,7 @@
      *
      * @return the start position >= 0
      */
+    @Transient
     public int getSelectionStart() {
         int start = Math.min(caret.getDot(), caret.getMark());
         return start;
@@ -1838,6 +1833,7 @@
      *
      * @return the end position >= 0
      */
+    @Transient
     public int getSelectionEnd() {
         int end = Math.max(caret.getDot(), caret.getMark());
         return end;
--- a/jdk/src/share/classes/javax/swing/text/NumberFormatter.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/javax/swing/text/NumberFormatter.java	Thu Jun 12 13:50:55 2008 -0700
@@ -173,23 +173,24 @@
      */
     private Object convertValueToValueClass(Object value, Class valueClass) {
         if (valueClass != null && (value instanceof Number)) {
+            Number numberValue = (Number)value;
             if (valueClass == Integer.class) {
-                return new Integer(((Number)value).intValue());
+                return Integer.valueOf(numberValue.intValue());
             }
             else if (valueClass == Long.class) {
-                return new Long(((Number)value).longValue());
+                return Long.valueOf(numberValue.longValue());
             }
             else if (valueClass == Float.class) {
-                return new Float(((Number)value).floatValue());
+                return Float.valueOf(numberValue.floatValue());
             }
             else if (valueClass == Double.class) {
-                return new Double(((Number)value).doubleValue());
+                return Double.valueOf(numberValue.doubleValue());
             }
             else if (valueClass == Byte.class) {
-                return new Byte(((Number)value).byteValue());
+                return Byte.valueOf(numberValue.byteValue());
             }
             else if (valueClass == Short.class) {
-                return new Short(((Number)value).shortValue());
+                return Short.valueOf(numberValue.shortValue());
             }
         }
         return value;
--- a/jdk/src/share/classes/javax/swing/text/PlainDocument.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/javax/swing/text/PlainDocument.java	Thu Jun 12 13:50:55 2008 -0700
@@ -89,7 +89,7 @@
      */
     public PlainDocument(Content c) {
         super(c);
-        putProperty(tabSizeAttribute, new Integer(8));
+        putProperty(tabSizeAttribute, Integer.valueOf(8));
         defaultRoot = createDefaultRoot();
     }
 
--- a/jdk/src/share/classes/javax/swing/text/Segment.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/javax/swing/text/Segment.java	Thu Jun 12 13:50:55 2008 -0700
@@ -118,7 +118,7 @@
         if (array != null) {
             return new String(array, offset, count);
         }
-        return new String();
+        return "";
     }
 
     // --- CharacterIterator methods -------------------------------------
--- a/jdk/src/share/classes/javax/swing/text/StyleConstants.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/javax/swing/text/StyleConstants.java	Thu Jun 12 13:50:55 2008 -0700
@@ -296,7 +296,7 @@
      * @param o the bidi level value
      */
     public static void setBidiLevel(MutableAttributeSet a, int o) {
-        a.addAttribute(BidiLevel, new Integer(o));
+        a.addAttribute(BidiLevel, Integer.valueOf(o));
     }
 
     /**
@@ -386,7 +386,7 @@
      * @param s the font size
      */
     public static void setFontSize(MutableAttributeSet a, int s) {
-        a.addAttribute(FontSize, new Integer(s));
+        a.addAttribute(FontSize, Integer.valueOf(s));
     }
 
     /**
@@ -753,7 +753,7 @@
      * @param align the alignment value
      */
     public static void setAlignment(MutableAttributeSet a, int align) {
-        a.addAttribute(Alignment, new Integer(align));
+        a.addAttribute(Alignment, Integer.valueOf(align));
     }
 
     /**
--- a/jdk/src/share/classes/javax/swing/text/html/AccessibleHTML.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/javax/swing/text/html/AccessibleHTML.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1970,7 +1970,7 @@
 
                     for (int i = 0; i < nRows; i++) {
                         if (isAccessibleRowSelected(i)) {
-                            vec.addElement(new Integer(i));
+                            vec.addElement(Integer.valueOf(i));
                         }
                     }
                     int retval[] = new int[vec.size()];
@@ -1995,7 +1995,7 @@
 
                     for (int i = 0; i < nColumns; i++) {
                         if (isAccessibleColumnSelected(i)) {
-                            vec.addElement(new Integer(i));
+                            vec.addElement(Integer.valueOf(i));
                         }
                     }
                     int retval[] = new int[vec.size()];
@@ -2139,7 +2139,7 @@
                 private int columnCount = 0;
 
                 public void addHeader(TableCellElementInfo cellInfo, int rowNumber) {
-                    Integer rowInteger = new Integer(rowNumber);
+                    Integer rowInteger = Integer.valueOf(rowNumber);
                     ArrayList list = (ArrayList)headers.get(rowInteger);
                     if (list == null) {
                         list = new ArrayList();
@@ -2201,7 +2201,7 @@
                 }
 
                 private TableCellElementInfo getElementInfoAt(int r, int c) {
-                    ArrayList list = (ArrayList)headers.get(new Integer(r));
+                    ArrayList list = (ArrayList)headers.get(Integer.valueOf(r));
                     if (list != null) {
                         return (TableCellElementInfo)list.get(c);
                     } else {
--- a/jdk/src/share/classes/javax/swing/text/html/CSS.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/javax/swing/text/html/CSS.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1099,7 +1099,7 @@
      */
     static String colorToHex(Color color) {
 
-      String colorstr = new String("#");
+      String colorstr = "#";
 
       // Red
       String str = Integer.toHexString(color.getRed());
--- a/jdk/src/share/classes/javax/swing/text/html/HTMLEditorKit.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/javax/swing/text/html/HTMLEditorKit.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1899,8 +1899,8 @@
                     // assistive technologies listening for such events.
                     comp.getAccessibleContext().firePropertyChange(
                         AccessibleContext.ACCESSIBLE_HYPERTEXT_OFFSET,
-                        new Integer(kit.prevHypertextOffset),
-                        new Integer(e.getDot()));
+                        Integer.valueOf(kit.prevHypertextOffset),
+                        Integer.valueOf(e.getDot()));
                 }
             }
         }
--- a/jdk/src/share/classes/javax/swing/text/html/parser/AttributeList.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/javax/swing/text/html/parser/AttributeList.java	Thu Jun 12 13:50:55 2008 -0700
@@ -132,7 +132,7 @@
     static Hashtable attributeTypes = new Hashtable();
 
     static void defineAttributeType(String nm, int val) {
-        Integer num = new Integer(val);
+        Integer num = Integer.valueOf(val);
         attributeTypes.put(nm, num);
         attributeTypes.put(num, nm);
     }
@@ -154,11 +154,11 @@
         defineAttributeType("NUTOKEN", NUTOKEN);
         defineAttributeType("NUTOKENS", NUTOKENS);
 
-        attributeTypes.put("fixed", new Integer(FIXED));
-        attributeTypes.put("required", new Integer(REQUIRED));
-        attributeTypes.put("current", new Integer(CURRENT));
-        attributeTypes.put("conref", new Integer(CONREF));
-        attributeTypes.put("implied", new Integer(IMPLIED));
+        attributeTypes.put("fixed", Integer.valueOf(FIXED));
+        attributeTypes.put("required", Integer.valueOf(REQUIRED));
+        attributeTypes.put("current", Integer.valueOf(CURRENT));
+        attributeTypes.put("conref", Integer.valueOf(CONREF));
+        attributeTypes.put("implied", Integer.valueOf(IMPLIED));
     }
 
     public static int name2type(String nm) {
@@ -167,6 +167,6 @@
     }
 
     public static String type2name(int tp) {
-        return (String)attributeTypes.get(new Integer(tp));
+        return (String)attributeTypes.get(Integer.valueOf(tp));
     }
 }
--- a/jdk/src/share/classes/javax/swing/text/html/parser/DTD.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/javax/swing/text/html/parser/DTD.java	Thu Jun 12 13:50:55 2008 -0700
@@ -113,7 +113,7 @@
      *    <code>ch</code> character
      */
     public Entity getEntity(int ch) {
-        return (Entity)entityHash.get(new Integer(ch));
+        return (Entity)entityHash.get(Integer.valueOf(ch));
     }
 
     /**
@@ -178,7 +178,7 @@
                 switch (type & ~GENERAL) {
                   case CDATA:
                   case SDATA:
-                    entityHash.put(new Integer(data[0]), ent);
+                      entityHash.put(Integer.valueOf(data[0]), ent);
                     break;
                 }
             }
--- a/jdk/src/share/classes/javax/swing/text/html/parser/Element.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/javax/swing/text/html/parser/Element.java	Thu Jun 12 13:50:55 2008 -0700
@@ -162,10 +162,10 @@
     static Hashtable contentTypes = new Hashtable();
 
     static {
-        contentTypes.put("CDATA", new Integer(CDATA));
-        contentTypes.put("RCDATA", new Integer(RCDATA));
-        contentTypes.put("EMPTY", new Integer(EMPTY));
-        contentTypes.put("ANY", new Integer(ANY));
+        contentTypes.put("CDATA", Integer.valueOf(CDATA));
+        contentTypes.put("RCDATA", Integer.valueOf(RCDATA));
+        contentTypes.put("EMPTY", Integer.valueOf(EMPTY));
+        contentTypes.put("ANY", Integer.valueOf(ANY));
     }
 
     public static int name2type(String nm) {
--- a/jdk/src/share/classes/javax/swing/text/html/parser/Entity.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/javax/swing/text/html/parser/Entity.java	Thu Jun 12 13:50:55 2008 -0700
@@ -110,15 +110,15 @@
     static Hashtable entityTypes = new Hashtable();
 
     static {
-        entityTypes.put("PUBLIC", new Integer(PUBLIC));
-        entityTypes.put("CDATA", new Integer(CDATA));
-        entityTypes.put("SDATA", new Integer(SDATA));
-        entityTypes.put("PI", new Integer(PI));
-        entityTypes.put("STARTTAG", new Integer(STARTTAG));
-        entityTypes.put("ENDTAG", new Integer(ENDTAG));
-        entityTypes.put("MS", new Integer(MS));
-        entityTypes.put("MD", new Integer(MD));
-        entityTypes.put("SYSTEM", new Integer(SYSTEM));
+        entityTypes.put("PUBLIC", Integer.valueOf(PUBLIC));
+        entityTypes.put("CDATA", Integer.valueOf(CDATA));
+        entityTypes.put("SDATA", Integer.valueOf(SDATA));
+        entityTypes.put("PI", Integer.valueOf(PI));
+        entityTypes.put("STARTTAG", Integer.valueOf(STARTTAG));
+        entityTypes.put("ENDTAG", Integer.valueOf(ENDTAG));
+        entityTypes.put("MS", Integer.valueOf(MS));
+        entityTypes.put("MD", Integer.valueOf(MD));
+        entityTypes.put("SYSTEM", Integer.valueOf(SYSTEM));
     }
 
     /**
--- a/jdk/src/share/classes/javax/swing/text/html/parser/Parser.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/javax/swing/text/html/parser/Parser.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1842,7 +1842,7 @@
             String elemStr = getString(0);
 
             if (elemStr.equals("image")) {
-                elemStr = new String("img");
+                elemStr = "img";
             }
 
             /* determine if this element is part of the dtd. */
--- a/jdk/src/share/classes/javax/swing/text/rtf/RTFAttributes.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/javax/swing/text/rtf/RTFAttributes.java	Thu Jun 12 13:50:55 2008 -0700
@@ -281,7 +281,7 @@
         public AssertiveAttribute(int d, Object s, String r, int v)
         {
             super(d, s, r);
-            swingValue = new Integer(v);
+            swingValue = Integer.valueOf(v);
         }
 
         public boolean set(MutableAttributeSet target)
@@ -343,7 +343,7 @@
         public NumericAttribute(int d, Object s,
                                 String r, int ds, int dr)
         {
-            this(d, s, r, new Integer(ds), dr, 1f);
+            this(d, s, r, Integer.valueOf(ds), dr, 1f);
         }
 
         public NumericAttribute(int d, Object s,
@@ -377,7 +377,7 @@
             Number swingValue;
 
             if (scale == 1f)
-                swingValue = new Integer(parameter);
+                swingValue = Integer.valueOf(parameter);
             else
                 swingValue = new Float(parameter / scale);
             target.addAttribute(swingName, swingValue);
--- a/jdk/src/share/classes/javax/swing/text/rtf/RTFGenerator.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/javax/swing/text/rtf/RTFGenerator.java	Thu Jun 12 13:50:55 2008 -0700
@@ -83,11 +83,7 @@
     static public final String defaultFontFamily = "Helvetica";
 
     /* constants so we can avoid allocating objects in inner loops */
-    /* these should all be final, but javac seems to be a bit buggy */
-    static protected Integer One, Zero;
-    static protected Boolean False;
-    static protected Float ZeroPointZero;
-    static private Object MagicToken;
+    final static private Object MagicToken;
 
     /* An array of character-keyword pairs. This could be done
        as a dictionary (and lookup would be quicker), but that
@@ -98,11 +94,7 @@
     static protected CharacterKeywordPair[] textKeywords;
 
     static {
-        One = new Integer(1);
-        Zero = new Integer(0);
-        False = Boolean.valueOf(false);
         MagicToken = new Object();
-        ZeroPointZero = new Float(0);
 
         Dictionary textKeywordDictionary = RTFReader.textKeywords;
         Enumeration keys = textKeywordDictionary.keys();
@@ -142,7 +134,7 @@
 public RTFGenerator(OutputStream to)
 {
     colorTable = new Hashtable();
-    colorTable.put(defaultRTFColor, new Integer(0));
+    colorTable.put(defaultRTFColor, Integer.valueOf(0));
     colorCount = 1;
 
     fontTable = new Hashtable();
@@ -693,7 +685,7 @@
 {
     writeControlWord("pard");
 
-    currentAttributes.addAttribute(StyleConstants.Alignment,       Zero);
+    currentAttributes.addAttribute(StyleConstants.Alignment, Integer.valueOf(0));
 
     int wordIndex;
     int wordCount = RTFAttributes.attributes.length;
--- a/jdk/src/share/classes/javax/swing/tree/DefaultTreeSelectionModel.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/javax/swing/tree/DefaultTreeSelectionModel.java	Thu Jun 12 13:50:55 2008 -0700
@@ -157,8 +157,8 @@
             selectionMode = TreeSelectionModel.DISCONTIGUOUS_TREE_SELECTION;
         if(oldMode != selectionMode && changeSupport != null)
             changeSupport.firePropertyChange(SELECTION_MODE_PROPERTY,
-                                             new Integer(oldMode),
-                                             new Integer(selectionMode));
+                                             Integer.valueOf(oldMode),
+                                             Integer.valueOf(selectionMode));
     }
 
     /**
--- a/jdk/src/share/classes/sun/applet/AppletPanel.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/sun/applet/AppletPanel.java	Thu Jun 12 13:50:55 2008 -0700
@@ -285,7 +285,7 @@
                 //System.out.println("SEND0= " + id);
                 queue = new Queue();
             }
-            Integer eventId = new Integer(id);
+            Integer eventId = Integer.valueOf(id);
             queue.enqueue(eventId);
             notifyAll();
         }
--- a/jdk/src/share/classes/sun/applet/AppletViewer.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/sun/applet/AppletViewer.java	Thu Jun 12 13:50:55 2008 -0700
@@ -587,9 +587,9 @@
         Dimension d = panel.size();
         Insets in = panel.insets();
         panel.atts.put("width",
-                       new Integer(d.width - (in.left + in.right)).toString());
+                       Integer.toString(d.width - (in.left + in.right)));
         panel.atts.put("height",
-                       new Integer(d.height - (in.top + in.bottom)).toString());
+                       Integer.toString(d.height - (in.top + in.bottom)));
     }
 
     /**
--- a/jdk/src/share/classes/sun/awt/FontConfiguration.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/sun/awt/FontConfiguration.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1956,7 +1956,7 @@
             /*Init these tables to allow componentFontNameID, fontfileNameIDs
               to start from "1".
             */
-            componentFontNameIDs.put("", new Short((short)0));
+            componentFontNameIDs.put("", Short.valueOf((short)0));
 
             fontfileNameIDs = new HashMap<String, Short>();
             filenames = new HashMap<Short, Short>();
--- a/jdk/src/share/classes/sun/awt/im/InputContext.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/sun/awt/im/InputContext.java	Thu Jun 12 13:50:55 2008 -0700
@@ -556,7 +556,7 @@
             }
             usedInputMethods.put(inputMethodLocator.deriveLocator(null), inputMethod);
             perInputMethodState.put(inputMethod,
-                                    new Boolean(clientWindowNotificationEnabled));
+                                    Boolean.valueOf(clientWindowNotificationEnabled));
             enableClientWindowNotification(inputMethod, false);
             if (this == inputMethodWindowContext) {
                 inputMethod.hideWindows();
@@ -921,7 +921,7 @@
             if (perInputMethodState == null) {
                 perInputMethodState = new HashMap(5);
             }
-            perInputMethodState.put(requester, new Boolean(enable));
+            perInputMethodState.put(requester, Boolean.valueOf(enable));
             return;
         }
 
--- a/jdk/src/share/classes/sun/awt/image/SunVolatileImage.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/sun/awt/image/SunVolatileImage.java	Thu Jun 12 13:50:55 2008 -0700
@@ -165,7 +165,8 @@
         {
             return new BufImgVolatileSurfaceManager(this, context);
         }
-        return SurfaceManagerFactory.createVolatileManager(this, context);
+        SurfaceManagerFactory smf = SurfaceManagerFactory.getInstance();
+        return smf.createVolatileManager(this, context);
     }
 
     private Color getForeground() {
--- a/jdk/src/share/classes/sun/font/AttributeValues.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/sun/font/AttributeValues.java	Thu Jun 12 13:50:55 2008 -0700
@@ -887,10 +887,10 @@
 
         try {
             AffineTransform rtxi = rtx.createInverse();
+            double dx = tx.getTranslateX();
+            double dy = tx.getTranslateY();
             tx.preConcatenate(rtxi);
             if (andTranslation) {
-                double dx = tx.getTranslateX();
-                double dy = tx.getTranslateY();
                 if (dx != 0 || dy != 0) {
                     tx.setTransform(tx.getScaleX(), tx.getShearY(),
                                     tx.getShearX(), tx.getScaleY(), 0, 0);
--- a/jdk/src/share/classes/sun/font/FileFontStrike.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/sun/font/FileFontStrike.java	Thu Jun 12 13:50:55 2008 -0700
@@ -27,6 +27,7 @@
 
 import java.lang.ref.SoftReference;
 import java.awt.Font;
+import java.awt.GraphicsEnvironment;
 import java.awt.Rectangle;
 import java.awt.geom.AffineTransform;
 import java.awt.geom.GeneralPath;
@@ -105,6 +106,19 @@
     boolean useNatives;
     NativeStrike[] nativeStrikes;
 
+    /* Used only for communication to native layer */
+    private int intPtSize;
+
+    /* Perform global initialisation needed for Windows native rasterizer */
+    private static native boolean initNative();
+    private static boolean isXPorLater = false;
+    static {
+        if (FontManager.isWindows && !FontManager.useT2K &&
+            !GraphicsEnvironment.isHeadless()) {
+            isXPorLater = initNative();
+        }
+    }
+
     FileFontStrike(FileFont fileFont, FontStrikeDesc desc) {
         super(fileFont, desc);
         this.fileFont = fileFont;
@@ -165,7 +179,7 @@
          * should not segment unless there's another reason to do so.
          */
         float ptSize = (float)matrix[3]; // interpreted only when meaningful.
-        int iSize = (int)ptSize;
+        int iSize = intPtSize = (int)ptSize;
         boolean isSimpleTx = (at.getType() & complexTX) == 0;
         segmentedCache =
             (numGlyphs > SEGSIZE << 3) ||
@@ -189,8 +203,26 @@
             FontManager.deRegisterBadFont(fileFont);
             return;
         }
-
-        if (fileFont.checkUseNatives() && desc.aaHint==0 && !algoStyle) {
+        /* First, see if native code should be used to create the glyph.
+         * GDI will return the integer metrics, not fractional metrics, which
+         * may be requested for this strike, so we would require here that :
+         * desc.fmHint != INTVAL_FRACTIONALMETRICS_ON
+         * except that the advance returned by GDI is always overwritten by
+         * the JDK rasteriser supplied one (see getGlyphImageFromWindows()).
+         */
+        if (FontManager.isWindows && isXPorLater &&
+            !FontManager.useT2K &&
+            !GraphicsEnvironment.isHeadless() &&
+            !fileFont.useJavaRasterizer &&
+            (desc.aaHint == INTVAL_TEXT_ANTIALIAS_LCD_HRGB ||
+             desc.aaHint == INTVAL_TEXT_ANTIALIAS_LCD_HBGR) &&
+            (matrix[1] == 0.0 && matrix[2] == 0.0 &&
+             matrix[0] == matrix[3] &&
+             matrix[0] >= 3.0 && matrix[0] <= 100.0) &&
+            !((TrueTypeFont)fileFont).useEmbeddedBitmapsForSize(intPtSize)) {
+            useNatives = true;
+        }
+        else if (fileFont.checkUseNatives() && desc.aaHint==0 && !algoStyle) {
             /* Check its a simple scale of a pt size in the range
              * where native bitmaps typically exist (6-36 pts) */
             if (matrix[1] == 0.0 && matrix[2] == 0.0 &&
@@ -208,7 +240,16 @@
                 }
             }
         }
-
+        if (FontManager.logging && FontManager.isWindows) {
+            FontManager.logger.info
+                ("Strike for " + fileFont + " at size = " + intPtSize +
+                 " use natives = " + useNatives +
+                 " useJavaRasteriser = " + fileFont.useJavaRasterizer +
+                 " AAHint = " + desc.aaHint +
+                 " Has Embedded bitmaps = " +
+                 ((TrueTypeFont)fileFont).
+                 useEmbeddedBitmapsForSize(intPtSize));
+        }
         this.disposer = new FontStrikeDisposer(fileFont, desc, pScalerContext);
 
         /* Always get the image and the advance together for smaller sizes
@@ -217,7 +258,12 @@
          * "maximumSizeForGetImageWithAdvance".
          * This should be no greater than OutlineTextRender.THRESHOLD.
          */
-        getImageWithAdvance = at.getScaleY() <= 48.0;
+        double maxSz = 48.0;
+        getImageWithAdvance =
+            Math.abs(at.getScaleX()) <= maxSz &&
+            Math.abs(at.getScaleY()) <= maxSz &&
+            Math.abs(at.getShearX()) <= maxSz &&
+            Math.abs(at.getShearY()) <= maxSz;
 
         /* Some applications request advance frequently during layout.
          * If we are not getting and caching the image with the advance,
@@ -250,8 +296,50 @@
         return fileFont.getNumGlyphs();
     }
 
+    long getGlyphImageFromNative(int glyphCode) {
+        if (FontManager.isWindows) {
+            return getGlyphImageFromWindows(glyphCode);
+        } else {
+            return getGlyphImageFromX11(glyphCode);
+        }
+    }
+
+    /* There's no global state conflicts, so this method is not
+     * presently synchronized.
+     */
+    private native long _getGlyphImageFromWindows(String family,
+                                                  int style,
+                                                  int size,
+                                                  int glyphCode,
+                                                  boolean fracMetrics);
+
+    long getGlyphImageFromWindows(int glyphCode) {
+        String family = fileFont.getFamilyName(null);
+        int style = desc.style & Font.BOLD | desc.style & Font.ITALIC
+            | fileFont.getStyle();
+        int size = intPtSize;
+        long ptr = _getGlyphImageFromWindows
+            (family, style, size, glyphCode,
+             desc.fmHint == INTVAL_FRACTIONALMETRICS_ON);
+        if (ptr != 0) {
+            /* Get the advance from the JDK rasterizer. This is mostly
+             * necessary for the fractional metrics case, but there are
+             * also some very small number (<0.25%) of marginal cases where
+             * there is some rounding difference between windows and JDK.
+             * After these are resolved, we can restrict this extra
+             * work to the FM case.
+             */
+            float advance = getGlyphAdvance(glyphCode, false);
+            StrikeCache.unsafe.putFloat(ptr + StrikeCache.xAdvanceOffset,
+                                        advance);
+            return ptr;
+        } else {
+            return fileFont.getGlyphImage(pScalerContext, glyphCode);
+        }
+    }
+
     /* Try the native strikes first, then try the fileFont strike */
-    long getGlyphImageFromNative(int glyphCode) {
+    long getGlyphImageFromX11(int glyphCode) {
         long glyphPtr;
         char charCode = fileFont.glyphToCharMap[glyphCode];
         for (int i=0;i<nativeStrikes.length;i++) {
@@ -271,13 +359,19 @@
         if (glyphCode >= INVISIBLE_GLYPHS) {
             return StrikeCache.invisibleGlyphPtr;
         }
-        long glyphPtr;
+        long glyphPtr = 0L;
         if ((glyphPtr = getCachedGlyphPtr(glyphCode)) != 0L) {
             return glyphPtr;
         } else {
             if (useNatives) {
                 glyphPtr = getGlyphImageFromNative(glyphCode);
-            } else {
+                if (glyphPtr == 0L && FontManager.logging) {
+                    FontManager.logger.info
+                        ("Strike for " + fileFont +
+                         " at size = " + intPtSize +
+                         " couldn't get native glyph for code = " + glyphCode);
+                 }
+            } if (glyphPtr == 0L) {
                 glyphPtr = fileFont.getGlyphImage(pScalerContext,
                                                   glyphCode);
             }
@@ -295,10 +389,10 @@
             } else if ((images[i] = getCachedGlyphPtr(glyphCode)) != 0L) {
                 continue;
             } else {
-                long glyphPtr;
+                long glyphPtr = 0L;
                 if (useNatives) {
                     glyphPtr = getGlyphImageFromNative(glyphCode);
-                } else {
+                } if (glyphPtr == 0L) {
                     glyphPtr = fileFont.getGlyphImage(pScalerContext,
                                                       glyphCode);
                 }
@@ -327,10 +421,11 @@
             } else if ((images[i] = getCachedGlyphPtr(glyphCode)) != 0L) {
                 continue;
             } else {
-                long glyphPtr;
+                long glyphPtr = 0L;
                 if (useNatives) {
                     glyphPtr = getGlyphImageFromNative(glyphCode);
-                } else {
+                }
+                if (glyphPtr == 0L) {
                     glyphPtr = fileFont.getGlyphImage(pScalerContext,
                                                       glyphCode);
                 }
@@ -454,11 +549,16 @@
         }
     }
 
+    float getGlyphAdvance(int glyphCode) {
+        return getGlyphAdvance(glyphCode, true);
+    }
+
     /* Metrics info is always retrieved. If the GlyphInfo address is non-zero
      * then metrics info there is valid and can just be copied.
-     * This is in user space coordinates.
+     * This is in user space coordinates unless getUserAdv == false.
+     * Device space advance should not be propagated out of this class.
      */
-    float getGlyphAdvance(int glyphCode) {
+    private float getGlyphAdvance(int glyphCode, boolean getUserAdv) {
         float advance;
 
         if (glyphCode >= INVISIBLE_GLYPHS) {
@@ -480,11 +580,11 @@
             }
         }
 
-        if (invertDevTx != null) {
+        if (invertDevTx != null || !getUserAdv) {
             /* If there is a device transform need x & y advance to
              * transform back into user space.
              */
-            advance = getGlyphMetrics(glyphCode).x;
+            advance = getGlyphMetrics(glyphCode, getUserAdv).x;
         } else {
             long glyphPtr;
             if (getImageWithAdvance) {
@@ -620,6 +720,10 @@
     }
 
     Point2D.Float getGlyphMetrics(int glyphCode) {
+        return getGlyphMetrics(glyphCode, true);
+    }
+
+    private Point2D.Float getGlyphMetrics(int glyphCode, boolean getUserAdv) {
         Point2D.Float metrics = new Point2D.Float();
 
         // !!! or do we force sgv user glyphs?
@@ -627,7 +731,7 @@
             return metrics;
         }
         long glyphPtr;
-        if (getImageWithAdvance) {
+        if (getImageWithAdvance && getUserAdv) {
             /* A heuristic optimisation says that for most cases its
              * worthwhile retrieving the image at the same time as the
              * metrics. So here we get the image data even if its not
@@ -644,9 +748,9 @@
             metrics.y = StrikeCache.unsafe.getFloat
                 (glyphPtr + StrikeCache.yAdvanceOffset);
             /* advance is currently in device space, need to convert back
-             * into user space.
+             * into user space, unless getUserAdv == false.
              * This must not include the translation component. */
-            if (invertDevTx != null) {
+            if (invertDevTx != null && getUserAdv) {
                 invertDevTx.deltaTransform(metrics, metrics);
             }
         } else {
@@ -657,7 +761,7 @@
              * we first obtain this information, then the image, and never
              * will access this value again.
              */
-            Integer key = new Integer(glyphCode);
+            Integer key = Integer.valueOf(glyphCode);
             Point2D.Float value = null;
             ConcurrentHashMap<Integer, Point2D.Float> glyphMetricsMap = null;
             if (glyphMetricsMapRef != null) {
@@ -675,9 +779,9 @@
             if (value == null) {
                 fileFont.getGlyphMetrics(pScalerContext, glyphCode, metrics);
                 /* advance is currently in device space, need to convert back
-                 * into user space.
+                 * into user space, unless getUserAdv == false.
                  */
-                if (invertDevTx != null) {
+                if (invertDevTx != null && getUserAdv) {
                     invertDevTx.deltaTransform(metrics, metrics);
                 }
                 value = new Point2D.Float(metrics.x, metrics.y);
@@ -724,7 +828,7 @@
             boundsMap = new ConcurrentHashMap<Integer, Rectangle2D.Float>();
         }
 
-        Integer key = new Integer(glyphCode);
+        Integer key = Integer.valueOf(glyphCode);
         Rectangle2D.Float bounds = boundsMap.get(key);
 
         if (bounds == null) {
--- a/jdk/src/share/classes/sun/font/Font2D.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/sun/font/Font2D.java	Thu Jun 12 13:50:55 2008 -0700
@@ -241,6 +241,13 @@
         if (font.isTransformed()) {
             glyphTx.concatenate(font.getTransform());
         }
+        if (glyphTx.getTranslateX() != 0 || glyphTx.getTranslateY() != 0) {
+            glyphTx.setTransform(glyphTx.getScaleX(),
+                                 glyphTx.getShearY(),
+                                 glyphTx.getShearX(),
+                                 glyphTx.getScaleY(),
+                                 0.0, 0.0);
+        }
         FontStrikeDesc desc = new FontStrikeDesc(devTx, glyphTx,
                                                  font.getStyle(), aa, fm);
         return getStrike(desc, false);
@@ -266,6 +273,13 @@
         at.scale(ptSize, ptSize);
         if (font.isTransformed()) {
             at.concatenate(font.getTransform());
+            if (at.getTranslateX() != 0 || at.getTranslateY() != 0) {
+                at.setTransform(at.getScaleX(),
+                                at.getShearY(),
+                                at.getShearX(),
+                                at.getScaleY(),
+                                0.0, 0.0);
+            }
         }
         int aa = FontStrikeDesc.getAAHintIntVal(this, font, frc);
         int fm = FontStrikeDesc.getFMHintIntVal(frc.getFractionalMetricsHint());
--- a/jdk/src/share/classes/sun/font/FontManager.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/sun/font/FontManager.java	Thu Jun 12 13:50:55 2008 -0700
@@ -93,7 +93,6 @@
      */
     private static final int CHANNELPOOLSIZE = 20;
     private static int lastPoolIndex = 0;
-    private static int poolSize = 0;
     private static FileFont fontFileCache[] = new FileFont[CHANNELPOOLSIZE];
 
     /* Need to implement a simple linked list scheme for fast
@@ -245,9 +244,11 @@
                osName = System.getProperty("os.name", "unknownOS");
                isSolaris = osName.startsWith("SunOS");
 
+               String t2kStr = System.getProperty("sun.java2d.font.scaler");
+               if (t2kStr != null) {
+                   useT2K = "t2k".equals(t2kStr);
+               }
                if (isSolaris) {
-                   String t2kStr= System.getProperty("sun.java2d.font.scaler");
-                   useT2K = "t2k".equals(t2kStr);
                    String version = System.getProperty("os.version", "unk");
                    isSolaris8 = version.equals("5.8");
                    isSolaris9 = version.equals("5.9");
@@ -283,29 +284,32 @@
     private static native void initIDs();
 
     public static void addToPool(FileFont font) {
-        boolean added = false;
+
+        FileFont fontFileToClose = null;
+        int freeSlot = -1;
+
         synchronized (fontFileCache) {
-            /* use poolSize to quickly detect if there's any free slots.
-             * This is a performance tweak based on the assumption that
-             * if this is executed at all often, its because there are many
-             * fonts being used and the pool will be full, and we will save
-             * a fruitless iteration
+            /* Avoid duplicate entries in the pool, and don't close() it,
+             * since this method is called only from within open().
+             * Seeing a duplicate is most likely to happen if the thread
+             * was interrupted during a read, forcing perhaps repeated
+             * close and open calls and it eventually it ends up pointing
+             * at the same slot.
              */
-            if (poolSize < CHANNELPOOLSIZE) {
-                for (int i=0; i<CHANNELPOOLSIZE; i++) {
-                    if (fontFileCache[i] == null) {
-                        fontFileCache[i] = font;
-                        poolSize++;
-                        added = true;
-                        break;
-                    }
+            for (int i=0;i<CHANNELPOOLSIZE;i++) {
+                if (fontFileCache[i] == font) {
+                    return;
+                }
+                if (fontFileCache[i] == null && freeSlot < 0) {
+                    freeSlot = i;
                 }
-                assert added;
+            }
+            if (freeSlot >= 0) {
+                fontFileCache[freeSlot] = font;
+                return;
             } else {
-                // is it possible for this to be the same font?
-                assert fontFileCache[lastPoolIndex] != font;
-                /* replace with new font,  poolSize is unchanged. */
-                fontFileCache[lastPoolIndex].close();
+                /* replace with new font. */
+                fontFileToClose = fontFileCache[lastPoolIndex];
                 fontFileCache[lastPoolIndex] = font;
                 /* lastPoolIndex is updated so that the least recently opened
                  * file will be closed next.
@@ -313,6 +317,19 @@
                 lastPoolIndex = (lastPoolIndex+1) % CHANNELPOOLSIZE;
             }
         }
+        /* Need to close the font file outside of the synchronized block,
+         * since its possible some other thread is in an open() call on
+         * this font file, and could be holding its lock and the pool lock.
+         * Releasing the pool lock allows that thread to continue, so it can
+         * then release the lock on this font, allowing the close() call
+         * below to proceed.
+         * Also, calling close() is safe because any other thread using
+         * the font we are closing() synchronizes all reading, so we
+         * will not close the file while its in use.
+         */
+        if (fontFileToClose != null) {
+            fontFileToClose.close();
+        }
     }
 
     /*
@@ -334,7 +351,6 @@
             for (int i=0; i<CHANNELPOOLSIZE; i++) {
                 if (fontFileCache[i] == font) {
                     fontFileCache[i] = null;
-                    poolSize--;
                 }
             }
         }
@@ -2124,7 +2140,7 @@
 
     private static void addLCIDMapEntry(Map<String, Short> map,
                                         String key, short value) {
-        map.put(key, new Short(value));
+        map.put(key, Short.valueOf(value));
     }
 
     private static synchronized void createLCIDMap() {
--- a/jdk/src/share/classes/sun/font/FontResolver.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/sun/font/FontResolver.java	Thu Jun 12 13:50:55 2008 -0700
@@ -117,7 +117,7 @@
                 Font2D font2D = FontManager.getFont2D(font);
                 if (font2D.hasSupplementaryChars()) {
                     fonts.add(font);
-                    indices.add(new Integer(i));
+                    indices.add(Integer.valueOf(i));
                 }
             }
 
--- a/jdk/src/share/classes/sun/font/GlyphLayout.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/sun/font/GlyphLayout.java	Thu Jun 12 13:50:55 2008 -0700
@@ -85,7 +85,7 @@
     private GVData _gvdata;
 
     // cached glyph layout data for reuse
-    private static GlyphLayout cache;  // reusable
+    private static volatile GlyphLayout cache;  // reusable
 
     private LayoutEngineFactory _lef;  // set when get is called, unset when done is called
     private TextRecord _textRecord;    // the text we're working on, used by iterators
--- a/jdk/src/share/classes/sun/font/PhysicalStrike.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/sun/font/PhysicalStrike.java	Thu Jun 12 13:50:55 2008 -0700
@@ -114,7 +114,7 @@
      */
     Point2D.Float getGlyphPoint(int glyphCode, int ptNumber) {
         Point2D.Float gp = null;
-        Integer ptKey = new Integer(glyphCode<<16|ptNumber);
+        Integer ptKey = Integer.valueOf(glyphCode<<16|ptNumber);
         if (glyphPointMapCache == null) {
             synchronized (this) {
                 if (glyphPointMapCache == null) {
--- a/jdk/src/share/classes/sun/font/TrueTypeFont.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/sun/font/TrueTypeFont.java	Thu Jun 12 13:50:55 2008 -0700
@@ -893,6 +893,31 @@
         return null;
     }
 
+    /* Used to determine if this size has embedded bitmaps, which
+     * for CJK fonts should be used in preference to LCD glyphs.
+     */
+    boolean useEmbeddedBitmapsForSize(int ptSize) {
+        if (!supportsCJK) {
+            return false;
+        }
+        if (getDirectoryEntry(EBLCTag) == null) {
+            return false;
+        }
+        ByteBuffer eblcTable = getTableBuffer(EBLCTag);
+        int numSizes = eblcTable.getInt(4);
+        /* The bitmapSizeTable's start at offset of 8.
+         * Each bitmapSizeTable entry is 48 bytes.
+         * The offset of ppemY in the entry is 45.
+         */
+        for (int i=0;i<numSizes;i++) {
+            int ppemY = eblcTable.get(8+(i*48)+45) &0xff;
+            if (ppemY == ptSize) {
+                return true;
+            }
+        }
+        return false;
+    }
+
     public String getFullName() {
         return fullName;
     }
--- a/jdk/src/share/classes/sun/font/Type1Font.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/sun/font/Type1Font.java	Thu Jun 12 13:50:55 2008 -0700
@@ -589,7 +589,7 @@
 
     protected synchronized FontScaler getScaler() {
         if (scaler == null) {
-            return FontManager.getScaler(this, 0, false, fileSize);
+            scaler = FontManager.getScaler(this, 0, false, fileSize);
         }
 
         return scaler;
--- a/jdk/src/share/classes/sun/java2d/SunGraphics2D.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/sun/java2d/SunGraphics2D.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1374,7 +1374,7 @@
                   SunHints.Value.get(SunHints.INTKEY_FRACTIONALMETRICS,
                                      fractionalMetricsHint));
         model.put(SunHints.KEY_TEXT_ANTIALIAS_LCD_CONTRAST,
-                  new Integer(lcdTextContrast));
+                  Integer.valueOf(lcdTextContrast));
         Object value;
         switch (interpolationHint) {
         case SunHints.INTVAL_INTERPOLATION_NEAREST_NEIGHBOR:
@@ -2805,6 +2805,9 @@
         }
 
         if (font.hasLayoutAttributes()) {
+            if (str.length() == 0) {
+                return;
+            }
             new TextLayout(str, font, getFontRenderContext()).draw(this, x, y);
             return;
         }
@@ -2831,6 +2834,9 @@
         }
 
         if (font.hasLayoutAttributes()) {
+            if (str.length() == 0) {
+                return;
+            }
             new TextLayout(str, font, getFontRenderContext()).draw(this, x, y);
             return;
         }
@@ -2856,6 +2862,9 @@
         if (iterator == null) {
             throw new NullPointerException("AttributedCharacterIterator is null");
         }
+        if (iterator.getBeginIndex() == iterator.getEndIndex()) {
+            return; /* nothing to draw */
+        }
         TextLayout tl = new TextLayout(iterator, getFontRenderContext());
         tl.draw(this, (float) x, (float) y);
     }
@@ -2865,6 +2874,9 @@
         if (iterator == null) {
             throw new NullPointerException("AttributedCharacterIterator is null");
         }
+        if (iterator.getBeginIndex() == iterator.getEndIndex()) {
+            return; /* nothing to draw */
+        }
         TextLayout tl = new TextLayout(iterator, getFontRenderContext());
         tl.draw(this, x, y);
     }
@@ -2900,6 +2912,9 @@
             throw new ArrayIndexOutOfBoundsException("bad offset/length");
         }
         if (font.hasLayoutAttributes()) {
+            if (data.length == 0) {
+                return;
+            }
             new TextLayout(new String(data, offset, length),
                            font, getFontRenderContext()).draw(this, x, y);
             return;
@@ -2934,6 +2949,9 @@
             chData[i] = (char)(data[i+offset] & 0xff);
         }
         if (font.hasLayoutAttributes()) {
+            if (data.length == 0) {
+                return;
+            }
             new TextLayout(new String(chData),
                            font, getFontRenderContext()).draw(this, x, y);
             return;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/classes/sun/java2d/SurfaceManagerFactory.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,91 @@
+/*
+ * Copyright 2003-2008 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.java2d;
+
+import sun.awt.image.SunVolatileImage;
+import sun.awt.image.VolatileSurfaceManager;
+
+/**
+ * This factory creates platform specific VolatileSurfaceManager
+ * implementations.
+ *
+ * There are two platform specific SurfaceManagerFactories in OpenJDK,
+ * UnixSurfaceManagerFactory and WindowsSurfaceManagerFactory.
+ * The actually used SurfaceManagerFactory is set by the respective platform
+ * GraphicsEnvironment implementations in the static initializer.
+ */
+public abstract class SurfaceManagerFactory {
+
+    /**
+     * The single shared instance.
+     */
+    private static SurfaceManagerFactory instance;
+
+    /**
+     * Returns the surface manager factory instance. This returns a factory
+     * that has been set by {@link #setInstance(SurfaceManagerFactory)}.
+     *
+     * @return the surface manager factory
+     */
+    public synchronized static SurfaceManagerFactory getInstance() {
+
+        if (instance == null) {
+            throw new IllegalStateException("No SurfaceManagerFactory set.");
+        }
+        return instance;
+    }
+
+    /**
+     * Sets the surface manager factory. This may only be called once, and it
+     * may not be set back to {@code null} when the factory is already
+     * instantiated.
+     *
+     * @param factory the factory to set
+     */
+    public synchronized static void setInstance(SurfaceManagerFactory factory) {
+
+        if (factory == null) {
+            // We don't want to allow setting this to null at any time.
+            throw new IllegalArgumentException("factory must be non-null");
+        }
+
+        if (instance != null) {
+            // We don't want to re-set the instance at any time.
+            throw new IllegalStateException("The surface manager factory is already initialized");
+        }
+
+        instance = factory;
+    }
+
+    /**
+     * Creates a new instance of a VolatileSurfaceManager given any
+     * arbitrary SunVolatileImage.  An optional context Object can be supplied
+     * as a way for the caller to pass pipeline-specific context data to
+     * the VolatileSurfaceManager (such as a backbuffer handle, for example).
+     */
+     public abstract VolatileSurfaceManager
+         createVolatileManager(SunVolatileImage image, Object context);
+}
--- a/jdk/src/share/classes/sun/java2d/loops/SurfaceType.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/sun/java2d/loops/SurfaceType.java	Thu Jun 12 13:50:55 2008 -0700
@@ -408,7 +408,7 @@
             if (unusedUID > 255) {
                 throw new InternalError("surface type id overflow");
             }
-            i = new Integer(unusedUID++);
+            i = Integer.valueOf(unusedUID++);
             surfaceUIDMap.put(desc, i);
         }
         return i.intValue();
--- a/jdk/src/share/classes/sun/management/ClassLoadingImpl.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/sun/management/ClassLoadingImpl.java	Thu Jun 12 13:50:55 2008 -0700
@@ -26,6 +26,8 @@
 package sun.management;
 
 import java.lang.management.ClassLoadingMXBean;
+import java.lang.management.ManagementFactory;
+import javax.management.ObjectName;
 
 /**
  * Implementation class for the class loading subsystem.
@@ -62,9 +64,13 @@
     }
 
     public void setVerbose(boolean value) {
-        ManagementFactory.checkControlAccess();
+        Util.checkControlAccess();
 
         setVerboseClass(value);
     }
     native static void setVerboseClass(boolean value);
+
+    public ObjectName getObjectName() {
+        return Util.newObjectName(ManagementFactory.CLASS_LOADING_MXBEAN_NAME);
+    }
 }
--- a/jdk/src/share/classes/sun/management/CompilationImpl.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/sun/management/CompilationImpl.java	Thu Jun 12 13:50:55 2008 -0700
@@ -26,6 +26,8 @@
 package sun.management;
 
 import java.lang.management.CompilationMXBean;
+import java.lang.management.ManagementFactory;
+import javax.management.ObjectName;
 
 /**
  * Implementation class for the compilation subsystem.
@@ -46,7 +48,7 @@
         this.jvm = vm;
         this.name = jvm.getCompilerName();
         if (name == null) {
-            throw new InternalError("Null compiler name");
+            throw new AssertionError("Null compiler name");
         }
     }
 
@@ -67,4 +69,9 @@
         return jvm.getTotalCompileTime();
     }
 
+    public ObjectName getObjectName() {
+        return Util.newObjectName(ManagementFactory.COMPILATION_MXBEAN_NAME);
+    }
+
+
 }
--- a/jdk/src/share/classes/sun/management/GarbageCollectorImpl.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/sun/management/GarbageCollectorImpl.java	Thu Jun 12 13:50:55 2008 -0700
@@ -34,6 +34,7 @@
 import javax.management.openmbean.CompositeData;
 import javax.management.MBeanInfo;
 import javax.management.MBeanAttributeInfo;
+import javax.management.ObjectName;
 
 import java.util.List;
 import java.util.ListIterator;
@@ -88,4 +89,8 @@
         return info;
     }
 
+    public ObjectName getObjectName() {
+        return Util.newObjectName(ManagementFactory.GARBAGE_COLLECTOR_MXBEAN_DOMAIN_TYPE, getName());
+    }
+
 }
--- a/jdk/src/share/classes/sun/management/GcInfoBuilder.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/sun/management/GcInfoBuilder.java	Thu Jun 12 13:50:55 2008 -0700
@@ -145,7 +145,7 @@
                         allItemTypes[i] = SimpleType.DOUBLE;
                         break;
                     default:
-                        throw new InternalError(
+                        throw new AssertionError(
                             "Unsupported type [" + gcExtItemTypes[i] + "]");
                 }
             }
--- a/jdk/src/share/classes/sun/management/GcInfoCompositeData.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/sun/management/GcInfoCompositeData.java	Thu Jun 12 13:50:55 2008 -0700
@@ -80,19 +80,19 @@
             };
         } catch (OpenDataException e) {
             // Should never reach here
-            throw Util.newAssertionError(e);
+            throw new AssertionError(e);
         }
 
         // Get the item values for the extension attributes
         final int gcExtItemCount = builder.getGcExtItemCount();
         if (gcExtItemCount == 0 &&
             gcExtItemValues != null && gcExtItemValues.length != 0) {
-            throw new InternalError("Unexpected Gc Extension Item Values");
+            throw new AssertionError("Unexpected Gc Extension Item Values");
         }
 
         if (gcExtItemCount > 0 && (gcExtItemValues == null ||
              gcExtItemCount != gcExtItemValues.length)) {
-            throw new InternalError("Unmatched Gc Extension Item Values");
+            throw new AssertionError("Unmatched Gc Extension Item Values");
         }
 
         Object[] values = new Object[baseGcInfoItemValues.length +
@@ -111,7 +111,7 @@
                                             values);
         } catch (OpenDataException e) {
             // Should never reach here
-            throw Util.newInternalError(e);
+            throw new AssertionError(e);
         }
     }
 
@@ -141,10 +141,10 @@
                 MappedMXBeanType.getMappedType(m.getGenericReturnType());
         } catch (NoSuchMethodException e) {
             // Should never reach here
-            throw Util.newAssertionError(e);
+            throw new AssertionError(e);
         } catch (OpenDataException e) {
             // Should never reach here
-            throw Util.newAssertionError(e);
+            throw new AssertionError(e);
         }
     }
 
@@ -186,10 +186,10 @@
             return cast(memoryUsageMapType.toJavaTypeData(td));
         } catch (InvalidObjectException e) {
             // Should never reach here
-            throw Util.newAssertionError(e);
+            throw new AssertionError(e);
         } catch (OpenDataException e) {
             // Should never reach here
-            throw Util.newAssertionError(e);
+            throw new AssertionError(e);
         }
     }
 
@@ -205,10 +205,10 @@
             return cast(memoryUsageMapType.toJavaTypeData(td));
         } catch (InvalidObjectException e) {
             // Should never reach here
-            throw Util.newAssertionError(e);
+            throw new AssertionError(e);
         } catch (OpenDataException e) {
             // Should never reach here
-            throw Util.newAssertionError(e);
+            throw new AssertionError(e);
         }
     }
 
--- a/jdk/src/share/classes/sun/management/HotSpotDiagnostic.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/sun/management/HotSpotDiagnostic.java	Thu Jun 12 13:50:55 2008 -0700
@@ -28,6 +28,8 @@
 import java.util.*;
 import java.io.IOException;
 import java.lang.reflect.Method;
+import javax.management.ObjectName;
+
 import com.sun.management.HotSpotDiagnosticMXBean;
 import com.sun.management.VMOption;
 
@@ -72,7 +74,7 @@
             throw new NullPointerException("value cannot be null");
         }
 
-        ManagementFactory.checkControlAccess();
+        Util.checkControlAccess();
         Flag flag = Flag.getFlag(name);
         if (flag == null) {
             throw new IllegalArgumentException("VM option \"" +
@@ -113,4 +115,8 @@
                 v.getClass().getName());
         }
     }
+
+    public ObjectName getObjectName() {
+        return Util.newObjectName("com.sun.management:type=HotSpotDiagnostic");
+    }
 }
--- a/jdk/src/share/classes/sun/management/HotspotCompilation.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/sun/management/HotspotCompilation.java	Thu Jun 12 13:50:55 2008 -0700
@@ -131,7 +131,7 @@
         }
 
         // FIXME: should tolerate if counter doesn't exist
-        throw new InternalError("Counter " + name + " does not exist");
+        throw new AssertionError("Counter " + name + " does not exist");
     }
 
     private void initCompilerCounters() {
--- a/jdk/src/share/classes/sun/management/HotspotInternal.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/sun/management/HotspotInternal.java	Thu Jun 12 13:50:55 2008 -0700
@@ -39,6 +39,9 @@
 public class HotspotInternal
     implements HotspotInternalMBean, MBeanRegistration {
 
+    private final static String HOTSPOT_INTERNAL_MBEAN_NAME =
+        "sun.management:type=HotspotInternal";
+    private static ObjectName objName = Util.newObjectName(HOTSPOT_INTERNAL_MBEAN_NAME);
     private MBeanServer server = null;
 
     /**
@@ -52,16 +55,16 @@
                                   ObjectName name) throws java.lang.Exception {
         // register all internal MBeans when this MBean is instantiated
         // and to be registered in a MBeanServer.
-        ManagementFactory.registerInternalMBeans(server);
+        ManagementFactoryHelper.registerInternalMBeans(server);
         this.server = server;
-        return ManagementFactory.getHotspotInternalObjectName();
+        return objName;
     }
 
     public void postRegister(Boolean registrationDone) {};
 
     public void preDeregister() throws java.lang.Exception {
         // unregister all internal MBeans when this MBean is unregistered.
-        ManagementFactory.unregisterInternalMBeans(server);
+        ManagementFactoryHelper.unregisterInternalMBeans(server);
     }
 
     public void postDeregister() {};
--- a/jdk/src/share/classes/sun/management/LockDataConverter.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/sun/management/LockDataConverter.java	Thu Jun 12 13:50:55 2008 -0700
@@ -73,7 +73,7 @@
         try {
             return (CompositeData) getAttribute("LockInfo");
         } catch (Exception e) {
-            throw Util.newInternalError(e);
+            throw new AssertionError(e);
         }
     }
 
@@ -81,7 +81,7 @@
         try {
             return (CompositeData[]) getAttribute("LockedSynchronizers");
         } catch (Exception e) {
-            throw Util.newInternalError(e);
+            throw new AssertionError(e);
         }
     }
 
@@ -89,7 +89,7 @@
         try {
             setAttribute(new Attribute("LockInfo", cd));
         } catch (Exception e) {
-            throw Util.newInternalError(e);
+            throw new AssertionError(e);
         }
         return getLockInfo();
     }
@@ -98,7 +98,7 @@
         try {
             setAttribute(new Attribute("LockedSynchronizers", cd));
         } catch (Exception e) {
-            throw Util.newInternalError(e);
+            throw new AssertionError(e);
         }
         return getLockedSynchronizers();
     }
--- a/jdk/src/share/classes/sun/management/ManagementFactory.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/sun/management/ManagementFactory.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2003-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2008 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
@@ -25,445 +25,17 @@
 
 package sun.management;
 
-import java.lang.management.*;
-import java.util.logging.LogManager;
-
-import javax.management.DynamicMBean;
-import javax.management.MBeanServer;
-import javax.management.MBeanServerFactory;
-import javax.management.MBeanInfo;
-import javax.management.NotificationEmitter;
-import javax.management.ObjectName;
-import javax.management.ObjectInstance;
-import javax.management.InstanceAlreadyExistsException;
-import javax.management.InstanceNotFoundException;
-import javax.management.MBeanRegistrationException;
-import javax.management.NotCompliantMBeanException;
-import javax.management.MalformedObjectNameException;
-import javax.management.RuntimeOperationsException;
-import javax.management.StandardEmitterMBean;
-import javax.management.StandardMBean;
-import java.security.AccessController;
-import java.security.Permission;
-import java.security.PrivilegedActionException;
-import java.security.PrivilegedExceptionAction;
-import sun.security.action.LoadLibraryAction;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
-import java.util.Iterator;
-import java.util.ListIterator;
-import com.sun.management.OSMBeanFactory;
-import com.sun.management.HotSpotDiagnosticMXBean;
-
-import static java.lang.management.ManagementFactory.*;
+import java.lang.management.MemoryManagerMXBean;
+import java.lang.management.MemoryPoolMXBean;
+import java.lang.management.GarbageCollectorMXBean;
 
 /**
- * ManagementFactory provides static factory methods to create
- * instances of the management interface.
+ * ManagementFactory class provides the methods that the HotSpot VM
+ * will invoke. So the class and method names cannot be renamed.
  */
-public class ManagementFactory {
+class ManagementFactory {
     private ManagementFactory() {};
 
-    private static VMManagement jvm;
-
-    private static boolean mbeansCreated = false;
-    private static ClassLoadingImpl    classMBean = null;
-    private static MemoryImpl          memoryMBean = null;
-    private static ThreadImpl          threadMBean = null;
-    private static RuntimeImpl         runtimeMBean = null;
-    private static CompilationImpl     compileMBean = null;
-    private static OperatingSystemImpl osMBean = null;
-
-    public static synchronized ClassLoadingMXBean getClassLoadingMXBean() {
-        if (classMBean == null) {
-            classMBean = new ClassLoadingImpl(jvm);
-        }
-        return classMBean;
-    }
-
-    public static synchronized MemoryMXBean getMemoryMXBean() {
-        if (memoryMBean == null) {
-            memoryMBean = new MemoryImpl(jvm);
-        }
-        return memoryMBean;
-    }
-
-    public static synchronized ThreadMXBean getThreadMXBean() {
-        if (threadMBean == null) {
-            threadMBean = new ThreadImpl(jvm);
-        }
-        return threadMBean;
-    }
-
-    public static synchronized RuntimeMXBean getRuntimeMXBean() {
-        if (runtimeMBean == null) {
-            runtimeMBean = new RuntimeImpl(jvm);
-        }
-        return runtimeMBean;
-    }
-
-    public static synchronized CompilationMXBean getCompilationMXBean() {
-        if (compileMBean == null && jvm.getCompilerName() != null) {
-            compileMBean = new CompilationImpl(jvm);
-        }
-        return compileMBean;
-    }
-
-    public static synchronized OperatingSystemMXBean getOperatingSystemMXBean() {
-        if (osMBean == null) {
-            osMBean = (OperatingSystemImpl)
-                          OSMBeanFactory.getOperatingSystemMXBean(jvm);
-        }
-        return osMBean;
-    }
-
-    public static List<MemoryPoolMXBean> getMemoryPoolMXBeans() {
-        MemoryPoolMXBean[] pools = MemoryImpl.getMemoryPools();
-        List<MemoryPoolMXBean> list = new ArrayList<MemoryPoolMXBean>(pools.length);
-        for (int i = 0; i < pools.length; i++) {
-            MemoryPoolMXBean p = pools[i];
-            list.add(p);
-        }
-        return list;
-    }
-
-    public static List<MemoryManagerMXBean> getMemoryManagerMXBeans() {
-        MemoryManagerMXBean[]  mgrs = MemoryImpl.getMemoryManagers();
-        List<MemoryManagerMXBean> result = new ArrayList<MemoryManagerMXBean>(mgrs.length);
-        for (int i = 0; i < mgrs.length; i++) {
-            MemoryManagerMXBean m = mgrs[i];
-            result.add(m);
-        }
-        return result;
-    }
-
-    public static List<GarbageCollectorMXBean> getGarbageCollectorMXBeans() {
-        MemoryManagerMXBean[]  mgrs = MemoryImpl.getMemoryManagers();
-        List<GarbageCollectorMXBean> result = new ArrayList<GarbageCollectorMXBean>(mgrs.length);
-        for (int i = 0; i < mgrs.length; i++) {
-            if (mgrs[i] instanceof GarbageCollectorMXBean) {
-                GarbageCollectorMXBean gc = (GarbageCollectorMXBean) mgrs[i];
-                result.add(gc);
-            }
-        }
-        return result;
-    }
-
-    private static HotSpotDiagnostic hsDiagMBean = null;
-    private static HotspotRuntime hsRuntimeMBean = null;
-    private static HotspotClassLoading hsClassMBean = null;
-    private static HotspotThread hsThreadMBean = null;
-    private static HotspotCompilation hsCompileMBean = null;
-    private static HotspotMemory hsMemoryMBean = null;
-
-    public static synchronized HotSpotDiagnosticMXBean getDiagnosticMXBean() {
-        if (hsDiagMBean == null) {
-            hsDiagMBean = new HotSpotDiagnostic();
-        }
-        return hsDiagMBean;
-    }
-
-    /**
-
-    /**
-     * This method is for testing only.
-     */
-    public static synchronized HotspotRuntimeMBean getHotspotRuntimeMBean() {
-        if (hsRuntimeMBean == null) {
-            hsRuntimeMBean = new HotspotRuntime(jvm);
-        }
-        return hsRuntimeMBean;
-    }
-
-    /**
-     * This method is for testing only.
-     */
-    public static synchronized HotspotClassLoadingMBean getHotspotClassLoadingMBean() {
-        if (hsClassMBean == null) {
-            hsClassMBean = new HotspotClassLoading(jvm);
-        }
-        return hsClassMBean;
-    }
-
-    /**
-     * This method is for testing only.
-     */
-    public static synchronized HotspotThreadMBean getHotspotThreadMBean() {
-        if (hsThreadMBean == null) {
-            hsThreadMBean = new HotspotThread(jvm);
-        }
-        return hsThreadMBean;
-    }
-
-    /**
-     * This method is for testing only.
-     */
-    public static synchronized HotspotMemoryMBean getHotspotMemoryMBean() {
-        if (hsMemoryMBean == null) {
-            hsMemoryMBean = new HotspotMemory(jvm);
-        }
-        return hsMemoryMBean;
-    }
-
-    /**
-     * This method is for testing only.
-     */
-    public static synchronized HotspotCompilationMBean getHotspotCompilationMBean() {
-        if (hsCompileMBean == null) {
-            hsCompileMBean = new HotspotCompilation(jvm);
-        }
-        return hsCompileMBean;
-    }
-
-    private static Permission monitorPermission =
-        new ManagementPermission("monitor");
-    private static Permission controlPermission =
-        new ManagementPermission("control");
-
-    /**
-     * Check that the current context is trusted to perform monitoring
-     * or management.
-     * <p>
-     * If the check fails we throw a SecurityException, otherwise
-     * we return normally.
-     *
-     * @exception  SecurityException  if a security manager exists and if
-     *             the caller does not have ManagementPermission("control").
-     */
-    static void checkAccess(Permission p)
-         throws SecurityException {
-        SecurityManager sm = System.getSecurityManager();
-        if (sm != null) {
-            sm.checkPermission(p);
-        }
-    }
-
-    static void checkMonitorAccess() throws SecurityException {
-        checkAccess(monitorPermission);
-    }
-    static void checkControlAccess() throws SecurityException {
-        checkAccess(controlPermission);
-    }
-
-    /**
-     * Registers an MXBean and throws exception if an instance with the same
-     * name exists.
-     *
-     * This method makes a DynamicMBean out of an MXBean by wrapping it with a
-     * StandardMBean (StandardEmitterMBean if the supplied emitter is not null),
-     * so it can be registered in an MBeanServer which does not have support for
-     * MXBeans.
-     */
-    private static void addMXBean(MBeanServer mbs, Object mbean,
-                                  String mbeanName, NotificationEmitter emitter) {
-        // Make DynamicMBean out of MXBean by wrapping it with a StandardMBean
-        //
-        final DynamicMBean dmbean;
-        if (emitter == null) {
-            dmbean = new StandardMBean(mbean, null, true);
-        } else {
-            dmbean = new StandardEmitterMBean(mbean, null, true, emitter);
-        }
-        addMBean(mbs, dmbean, mbeanName, false);
-    }
-
-    /**
-     * Registers a Standard MBean or a Dynamic MBean and throws
-     * exception if an instance with the same name exists.
-     */
-    private static void addMBean(MBeanServer mbs, Object mbean, String mbeanName) {
-        addMBean(mbs, mbean, mbeanName, false);
-    }
-
-    private static void addMBean(MBeanServer mbs, Object mbean,
-                                 String mbeanName, boolean ignoreConflicts) {
-        try {
-            final ObjectName objName = new ObjectName(mbeanName);
-
-            // inner class requires these fields to be final
-            final MBeanServer mbs0 = mbs;
-            final Object mbean0 = mbean;
-            final boolean ignore = ignoreConflicts;
-            AccessController.doPrivileged(new PrivilegedExceptionAction<Object>() {
-                public Object run() throws InstanceAlreadyExistsException,
-                                           MBeanRegistrationException,
-                                           NotCompliantMBeanException {
-                    try {
-                        ObjectInstance o = mbs0.registerMBean(mbean0,
-                                                              objName);
-                        return null;
-                    } catch (InstanceAlreadyExistsException e) {
-                        // if an instance with the object name exists in
-                        // the MBeanServer ignore the exception
-                        // if ignoreConflicts is true;
-                        // otherwise, throws exception.
-                        if (!ignore) {
-                             throw e;
-                        }
-                    }
-                    return null;
-                }
-            });
-        } catch (PrivilegedActionException e) {
-            throw Util.newException(e.getException());
-        } catch (MalformedObjectNameException e) {
-            // should not reach here
-            throw Util.newException(e);
-        }
-    }
-
-    public static MBeanServer createPlatformMBeanServer() {
-        MBeanServer mbs = MBeanServerFactory.createMBeanServer();
-        // Register all the platform MBeans to this MBeanServer
-        addMXBean(mbs, getClassLoadingMXBean(),
-                  CLASS_LOADING_MXBEAN_NAME, null);
-        addMXBean(mbs, getMemoryMXBean(),
-                  MEMORY_MXBEAN_NAME, (NotificationEmitter) getMemoryMXBean());
-        addMXBean(mbs, getOperatingSystemMXBean(),
-                  OPERATING_SYSTEM_MXBEAN_NAME, null);
-        addMXBean(mbs, getRuntimeMXBean(),
-                  RUNTIME_MXBEAN_NAME, null);
-        addMXBean(mbs, getThreadMXBean(),
-                  THREAD_MXBEAN_NAME, null);
-        addMXBean(mbs, getDiagnosticMXBean(),
-                  HOTSPOT_DIAGNOSTIC_MXBEAN_NAME, null);
-
-        // CompilationMBean may not exist
-        if (getCompilationMXBean() != null) {
-            addMXBean(mbs, getCompilationMXBean(),
-                      COMPILATION_MXBEAN_NAME, null);
-        }
-
-        // Register MBeans for memory pools and memory managers
-        addMemoryManagers(mbs);
-        addMemoryPools(mbs);
-
-        // Register platform extension
-        addMXBean(mbs, LogManager.getLoggingMXBean(),
-                  LogManager.LOGGING_MXBEAN_NAME, null);
-
-        return mbs;
-    }
-
-    private final static String HOTSPOT_DIAGNOSTIC_MXBEAN_NAME =
-        "com.sun.management:type=HotSpotDiagnostic";
-
-    private final static String HOTSPOT_CLASS_LOADING_MBEAN_NAME =
-        "sun.management:type=HotspotClassLoading";
-
-    private final static String HOTSPOT_COMPILATION_MBEAN_NAME =
-        "sun.management:type=HotspotCompilation";
-
-    private final static String HOTSPOT_MEMORY_MBEAN_NAME =
-        "sun.management:type=HotspotMemory";
-
-    private static final String HOTSPOT_RUNTIME_MBEAN_NAME =
-        "sun.management:type=HotspotRuntime";
-
-    private final static String HOTSPOT_THREAD_MBEAN_NAME =
-        "sun.management:type=HotspotThreading";
-
-    private final static String HOTSPOT_INTERNAL_MBEAN_NAME =
-        "sun.management:type=HotspotInternal";
-
-    private static ObjectName hsInternalObjName = null;
-    static synchronized ObjectName getHotspotInternalObjectName() {
-        if (hsInternalObjName == null) {
-            try {
-                hsInternalObjName = new ObjectName(HOTSPOT_INTERNAL_MBEAN_NAME);
-            } catch (MalformedObjectNameException e) {
-                // should not reach here
-                throw Util.newException(e);
-            }
-        }
-        return hsInternalObjName;
-    }
-
-    static void registerInternalMBeans(MBeanServer mbs) {
-        // register all internal MBeans if not registered
-        // No exception is thrown if a MBean with that object name
-        // already registered (i.e. ignore if name conflicts).
-        addMBean(mbs, getHotspotClassLoadingMBean(),
-            HOTSPOT_CLASS_LOADING_MBEAN_NAME, true);
-        addMBean(mbs, getHotspotMemoryMBean(),
-            HOTSPOT_MEMORY_MBEAN_NAME, true);
-        addMBean(mbs, getHotspotRuntimeMBean(),
-            HOTSPOT_RUNTIME_MBEAN_NAME, true);
-        addMBean(mbs, getHotspotThreadMBean(),
-            HOTSPOT_THREAD_MBEAN_NAME, true);
-
-        // CompilationMBean may not exist
-        if (getCompilationMXBean() != null) {
-            addMBean(mbs, getHotspotCompilationMBean(),
-                HOTSPOT_COMPILATION_MBEAN_NAME, true);
-        }
-    }
-
-    private static void unregisterMBean(MBeanServer mbs, String mbeanName) {
-        try {
-            final ObjectName objName = new ObjectName(mbeanName);
-
-            // inner class requires these fields to be final
-            final MBeanServer mbs0 = mbs;
-            AccessController.doPrivileged(new PrivilegedExceptionAction<Object>() {
-                public Object run() throws MBeanRegistrationException,
-                                           RuntimeOperationsException  {
-                    try {
-                        mbs0.unregisterMBean(objName);
-                    } catch (InstanceNotFoundException e) {
-                        // ignore exception if not found
-                    }
-                    return null;
-                }
-            });
-        } catch (PrivilegedActionException e) {
-            throw Util.newException(e.getException());
-        } catch (MalformedObjectNameException e) {
-            // should not reach here
-            throw Util.newException(e);
-        }
-    }
-
-    static void unregisterInternalMBeans(MBeanServer mbs) {
-        // unregister all internal MBeans
-        unregisterMBean(mbs, HOTSPOT_CLASS_LOADING_MBEAN_NAME);
-        unregisterMBean(mbs, HOTSPOT_MEMORY_MBEAN_NAME);
-        unregisterMBean(mbs, HOTSPOT_RUNTIME_MBEAN_NAME);
-        unregisterMBean(mbs, HOTSPOT_THREAD_MBEAN_NAME);
-
-        // CompilationMBean may not exist
-        if (getCompilationMXBean() != null) {
-            unregisterMBean(mbs, HOTSPOT_COMPILATION_MBEAN_NAME);
-        }
-    }
-
-    private static synchronized void addMemoryPools(MBeanServer mbs) {
-
-        // Get a list of memory pools
-        MemoryPoolMXBean[] newPools = MemoryImpl.getMemoryPools();
-
-        for (int i = 0; i < newPools.length; i++) {
-            String poolObjNameString = Util.getMBeanObjectName(newPools[i]);
-            addMXBean(mbs, newPools[i], poolObjNameString, null);
-        }
-    }
-
-    // Register all memory managers with the MBeanServer;
-    private static synchronized void addMemoryManagers(MBeanServer mbs) {
-
-        // Get a list of memory managers
-        MemoryManagerMXBean[] newMgrs = MemoryImpl.getMemoryManagers();
-
-        for (int i = 0; i < newMgrs.length; i++) {
-            String mgrObjNameString = Util.getMBeanObjectName(newMgrs[i]);
-            addMXBean(mbs, newMgrs[i], mgrObjNameString, null);
-        }
-    }
-
     // Invoked by the VM
     private static MemoryPoolMXBean createMemoryPool
         (String name, boolean isHeap, long uThreshold, long gcThreshold) {
@@ -480,29 +52,4 @@
         // ignore type parameter which is for future extension
         return new GarbageCollectorImpl(name);
     }
-
-    static {
-        AccessController.doPrivileged(new LoadLibraryAction("management"));
-        jvm = new VMManagementImpl();
-    }
-
-    public static boolean isThreadSuspended(int state) {
-        return ((state & JMM_THREAD_STATE_FLAG_SUSPENDED) != 0);
-    }
-
-    public static boolean isThreadRunningNative(int state) {
-        return ((state & JMM_THREAD_STATE_FLAG_NATIVE) != 0);
-    }
-
-    public static Thread.State toThreadState(int state) {
-        // suspended and native bits may be set in state
-        int threadStatus = state & ~JMM_THREAD_STATE_FLAG_MASK;
-        return sun.misc.VM.toThreadState(threadStatus);
-    }
-
-    // These values are defined in jmm.h
-    private static final int JMM_THREAD_STATE_FLAG_MASK = 0xFFF00000;
-    private static final int JMM_THREAD_STATE_FLAG_SUSPENDED = 0x00100000;
-    private static final int JMM_THREAD_STATE_FLAG_NATIVE = 0x00400000;
-
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/classes/sun/management/ManagementFactoryHelper.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,340 @@
+/*
+ * Copyright 2003-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 sun.management;
+
+import java.lang.management.*;
+import java.util.logging.LogManager;
+
+import javax.management.DynamicMBean;
+import javax.management.MBeanServer;
+import javax.management.MBeanServerFactory;
+import javax.management.MBeanInfo;
+import javax.management.NotificationEmitter;
+import javax.management.ObjectName;
+import javax.management.ObjectInstance;
+import javax.management.InstanceAlreadyExistsException;
+import javax.management.InstanceNotFoundException;
+import javax.management.MBeanRegistrationException;
+import javax.management.NotCompliantMBeanException;
+import javax.management.RuntimeOperationsException;
+import javax.management.StandardEmitterMBean;
+import javax.management.StandardMBean;
+import java.security.AccessController;
+import java.security.PrivilegedActionException;
+import java.security.PrivilegedExceptionAction;
+import sun.security.action.LoadLibraryAction;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+import java.util.Iterator;
+import java.util.ListIterator;
+import com.sun.management.OSMBeanFactory;
+import com.sun.management.HotSpotDiagnosticMXBean;
+
+import static java.lang.management.ManagementFactory.*;
+
+/**
+ * ManagementFactoryHelper provides static factory methods to create
+ * instances of the management interface.
+ */
+public class ManagementFactoryHelper {
+    private ManagementFactoryHelper() {};
+
+    private static VMManagement jvm;
+
+    private static boolean mbeansCreated = false;
+    private static ClassLoadingImpl    classMBean = null;
+    private static MemoryImpl          memoryMBean = null;
+    private static ThreadImpl          threadMBean = null;
+    private static RuntimeImpl         runtimeMBean = null;
+    private static CompilationImpl     compileMBean = null;
+    private static OperatingSystemImpl osMBean = null;
+
+    public static synchronized ClassLoadingMXBean getClassLoadingMXBean() {
+        if (classMBean == null) {
+            classMBean = new ClassLoadingImpl(jvm);
+        }
+        return classMBean;
+    }
+
+    public static synchronized MemoryMXBean getMemoryMXBean() {
+        if (memoryMBean == null) {
+            memoryMBean = new MemoryImpl(jvm);
+        }
+        return memoryMBean;
+    }
+
+    public static synchronized ThreadMXBean getThreadMXBean() {
+        if (threadMBean == null) {
+            threadMBean = new ThreadImpl(jvm);
+        }
+        return threadMBean;
+    }
+
+    public static synchronized RuntimeMXBean getRuntimeMXBean() {
+        if (runtimeMBean == null) {
+            runtimeMBean = new RuntimeImpl(jvm);
+        }
+        return runtimeMBean;
+    }
+
+    public static synchronized CompilationMXBean getCompilationMXBean() {
+        if (compileMBean == null && jvm.getCompilerName() != null) {
+            compileMBean = new CompilationImpl(jvm);
+        }
+        return compileMBean;
+    }
+
+    public static synchronized OperatingSystemMXBean getOperatingSystemMXBean() {
+        if (osMBean == null) {
+            osMBean = (OperatingSystemImpl)
+                          OSMBeanFactory.getOperatingSystemMXBean(jvm);
+        }
+        return osMBean;
+    }
+
+    public static List<MemoryPoolMXBean> getMemoryPoolMXBeans() {
+        MemoryPoolMXBean[] pools = MemoryImpl.getMemoryPools();
+        List<MemoryPoolMXBean> list = new ArrayList<MemoryPoolMXBean>(pools.length);
+        for (MemoryPoolMXBean p : pools) {
+            list.add(p);
+        }
+        return list;
+    }
+
+    public static List<MemoryManagerMXBean> getMemoryManagerMXBeans() {
+        MemoryManagerMXBean[]  mgrs = MemoryImpl.getMemoryManagers();
+        List<MemoryManagerMXBean> result = new ArrayList<MemoryManagerMXBean>(mgrs.length);
+        for (MemoryManagerMXBean m : mgrs) {
+            result.add(m);
+        }
+        return result;
+    }
+
+    public static List<GarbageCollectorMXBean> getGarbageCollectorMXBeans() {
+        MemoryManagerMXBean[]  mgrs = MemoryImpl.getMemoryManagers();
+        List<GarbageCollectorMXBean> result = new ArrayList<GarbageCollectorMXBean>(mgrs.length);
+        for (MemoryManagerMXBean m : mgrs) {
+            if (GarbageCollectorMXBean.class.isInstance(m)) {
+                 result.add(GarbageCollectorMXBean.class.cast(m));
+            }
+        }
+        return result;
+    }
+
+    private static HotSpotDiagnostic hsDiagMBean = null;
+    private static HotspotRuntime hsRuntimeMBean = null;
+    private static HotspotClassLoading hsClassMBean = null;
+    private static HotspotThread hsThreadMBean = null;
+    private static HotspotCompilation hsCompileMBean = null;
+    private static HotspotMemory hsMemoryMBean = null;
+
+    public static synchronized HotSpotDiagnosticMXBean getDiagnosticMXBean() {
+        if (hsDiagMBean == null) {
+            hsDiagMBean = new HotSpotDiagnostic();
+        }
+        return hsDiagMBean;
+    }
+
+    /**
+
+    /**
+     * This method is for testing only.
+     */
+    public static synchronized HotspotRuntimeMBean getHotspotRuntimeMBean() {
+        if (hsRuntimeMBean == null) {
+            hsRuntimeMBean = new HotspotRuntime(jvm);
+        }
+        return hsRuntimeMBean;
+    }
+
+    /**
+     * This method is for testing only.
+     */
+    public static synchronized HotspotClassLoadingMBean getHotspotClassLoadingMBean() {
+        if (hsClassMBean == null) {
+            hsClassMBean = new HotspotClassLoading(jvm);
+        }
+        return hsClassMBean;
+    }
+
+    /**
+     * This method is for testing only.
+     */
+    public static synchronized HotspotThreadMBean getHotspotThreadMBean() {
+        if (hsThreadMBean == null) {
+            hsThreadMBean = new HotspotThread(jvm);
+        }
+        return hsThreadMBean;
+    }
+
+    /**
+     * This method is for testing only.
+     */
+    public static synchronized HotspotMemoryMBean getHotspotMemoryMBean() {
+        if (hsMemoryMBean == null) {
+            hsMemoryMBean = new HotspotMemory(jvm);
+        }
+        return hsMemoryMBean;
+    }
+
+    /**
+     * This method is for testing only.
+     */
+    public static synchronized HotspotCompilationMBean getHotspotCompilationMBean() {
+        if (hsCompileMBean == null) {
+            hsCompileMBean = new HotspotCompilation(jvm);
+        }
+        return hsCompileMBean;
+    }
+
+    /**
+     * Registers a given MBean if not registered in the MBeanServer;
+     * otherwise, just return.
+     */
+    private static void addMBean(MBeanServer mbs, Object mbean, String mbeanName) {
+        try {
+            final ObjectName objName = Util.newObjectName(mbeanName);
+
+            // inner class requires these fields to be final
+            final MBeanServer mbs0 = mbs;
+            final Object mbean0 = mbean;
+            AccessController.doPrivileged(new PrivilegedExceptionAction<Void>() {
+                public Void run() throws MBeanRegistrationException,
+                                         NotCompliantMBeanException {
+                    try {
+                        mbs0.registerMBean(mbean0, objName);
+                        return null;
+                    } catch (InstanceAlreadyExistsException e) {
+                        // if an instance with the object name exists in
+                        // the MBeanServer ignore the exception
+                    }
+                    return null;
+                }
+            });
+        } catch (PrivilegedActionException e) {
+            throw Util.newException(e.getException());
+        }
+    }
+
+    private final static String HOTSPOT_CLASS_LOADING_MBEAN_NAME =
+        "sun.management:type=HotspotClassLoading";
+
+    private final static String HOTSPOT_COMPILATION_MBEAN_NAME =
+        "sun.management:type=HotspotCompilation";
+
+    private final static String HOTSPOT_MEMORY_MBEAN_NAME =
+        "sun.management:type=HotspotMemory";
+
+    private static final String HOTSPOT_RUNTIME_MBEAN_NAME =
+        "sun.management:type=HotspotRuntime";
+
+    private final static String HOTSPOT_THREAD_MBEAN_NAME =
+        "sun.management:type=HotspotThreading";
+
+    static void registerInternalMBeans(MBeanServer mbs) {
+        // register all internal MBeans if not registered
+        // No exception is thrown if a MBean with that object name
+        // already registered
+        addMBean(mbs, getHotspotClassLoadingMBean(),
+            HOTSPOT_CLASS_LOADING_MBEAN_NAME);
+        addMBean(mbs, getHotspotMemoryMBean(),
+            HOTSPOT_MEMORY_MBEAN_NAME);
+        addMBean(mbs, getHotspotRuntimeMBean(),
+            HOTSPOT_RUNTIME_MBEAN_NAME);
+        addMBean(mbs, getHotspotThreadMBean(),
+            HOTSPOT_THREAD_MBEAN_NAME);
+
+        // CompilationMBean may not exist
+        if (getCompilationMXBean() != null) {
+            addMBean(mbs, getHotspotCompilationMBean(),
+                HOTSPOT_COMPILATION_MBEAN_NAME);
+        }
+    }
+
+    private static void unregisterMBean(MBeanServer mbs, String mbeanName) {
+        try {
+            final ObjectName objName = Util.newObjectName(mbeanName);
+
+            // inner class requires these fields to be final
+            final MBeanServer mbs0 = mbs;
+            AccessController.doPrivileged(new PrivilegedExceptionAction<Void>() {
+                public Void run() throws MBeanRegistrationException,
+                                           RuntimeOperationsException  {
+                    try {
+                        mbs0.unregisterMBean(objName);
+                    } catch (InstanceNotFoundException e) {
+                        // ignore exception if not found
+                    }
+                    return null;
+                }
+            });
+        } catch (PrivilegedActionException e) {
+            throw Util.newException(e.getException());
+        }
+    }
+
+    static void unregisterInternalMBeans(MBeanServer mbs) {
+        // unregister all internal MBeans
+        unregisterMBean(mbs, HOTSPOT_CLASS_LOADING_MBEAN_NAME);
+        unregisterMBean(mbs, HOTSPOT_MEMORY_MBEAN_NAME);
+        unregisterMBean(mbs, HOTSPOT_RUNTIME_MBEAN_NAME);
+        unregisterMBean(mbs, HOTSPOT_THREAD_MBEAN_NAME);
+
+        // CompilationMBean may not exist
+        if (getCompilationMXBean() != null) {
+            unregisterMBean(mbs, HOTSPOT_COMPILATION_MBEAN_NAME);
+        }
+    }
+
+    static {
+        AccessController.doPrivileged(new LoadLibraryAction("management"));
+        jvm = new VMManagementImpl();
+    }
+
+    public static boolean isThreadSuspended(int state) {
+        return ((state & JMM_THREAD_STATE_FLAG_SUSPENDED) != 0);
+    }
+
+    public static boolean isThreadRunningNative(int state) {
+        return ((state & JMM_THREAD_STATE_FLAG_NATIVE) != 0);
+    }
+
+    public static Thread.State toThreadState(int state) {
+        // suspended and native bits may be set in state
+        int threadStatus = state & ~JMM_THREAD_STATE_FLAG_MASK;
+        return sun.misc.VM.toThreadState(threadStatus);
+    }
+
+    // These values are defined in jmm.h
+    private static final int JMM_THREAD_STATE_FLAG_MASK = 0xFFF00000;
+    private static final int JMM_THREAD_STATE_FLAG_SUSPENDED = 0x00100000;
+    private static final int JMM_THREAD_STATE_FLAG_NATIVE = 0x00400000;
+
+}
--- a/jdk/src/share/classes/sun/management/MappedMXBeanType.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/sun/management/MappedMXBeanType.java	Thu Jun 12 13:50:55 2008 -0700
@@ -735,14 +735,14 @@
             throws OpenDataException, InvalidObjectException {
 
             if (fromMethod == null) {
-                throw new InternalError("Does not support data conversion");
+                throw new AssertionError("Does not support data conversion");
             }
 
             try {
                 return fromMethod.invoke(null, data);
             } catch (IllegalAccessException e) {
                 // should never reach here
-                throw Util.newAssertionError(e);
+                throw new AssertionError(e);
             } catch (InvocationTargetException e) {
                 final OpenDataException ode =
                     new OpenDataException("Failed to invoke " +
@@ -785,7 +785,7 @@
             t = new InProgress();
         } catch (OpenDataException e) {
             // Should not reach here
-            throw Util.newAssertionError(e);
+            throw new AssertionError(e);
         }
         inProgress = t;
     }
@@ -807,9 +807,9 @@
                 } catch (ClassNotFoundException e) {
                     // the classes that these predefined types declare
                     // must exist!
-                    throw Util.newAssertionError(e);
+                    throw new AssertionError(e);
                 } catch (OpenDataException e) {
-                    throw Util.newAssertionError(e);
+                    throw new AssertionError(e);
                 }
 
                 if (c.getName().startsWith("java.lang.")) {
@@ -821,12 +821,12 @@
                         // OK: must not be a primitive wrapper
                     } catch (IllegalAccessException e) {
                         // Should not reach here
-                       throw Util.newAssertionError(e);
+                       throw new AssertionError(e);
                     }
                 }
             }
         } catch (OpenDataException e) {
-            throw Util.newAssertionError(e);
+            throw new AssertionError(e);
         }
     }
 
--- a/jdk/src/share/classes/sun/management/MemoryImpl.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/sun/management/MemoryImpl.java	Thu Jun 12 13:50:55 2008 -0700
@@ -25,13 +25,13 @@
 
 package sun.management;
 
+import java.lang.management.ManagementFactory;
 import java.lang.management.MemoryMXBean;
 import java.lang.management.MemoryUsage;
 import java.lang.management.MemoryNotificationInfo;
 import java.lang.management.MemoryManagerMXBean;
 import java.lang.management.MemoryPoolMXBean;
 import javax.management.ObjectName;
-import javax.management.MalformedObjectNameException;
 import javax.management.MBeanNotificationInfo;
 import javax.management.Notification;
 import javax.management.NotificationEmitter;
@@ -88,7 +88,7 @@
     }
 
     public void setVerbose(boolean value) {
-        ManagementFactory.checkControlAccess();
+        Util.checkControlAccess();
 
         setVerboseGC(value);
     }
@@ -150,19 +150,6 @@
         return ++seqNumber;
     }
 
-    private static ObjectName objname = null;
-    private static synchronized ObjectName getObjectName() {
-        if (objname != null) return objname;
-
-        try {
-            objname = new ObjectName(java.lang.management.ManagementFactory.MEMORY_MXBEAN_NAME);
-        } catch (MalformedObjectNameException e) {
-            // should never reach here
-            throw Util.newInternalError(e);
-        }
-        return objname;
-    }
-
     static void createNotification(String notifType,
                                    String poolName,
                                    MemoryUsage usage,
@@ -175,7 +162,7 @@
         long timestamp = System.currentTimeMillis();
         String msg = getNotifMsg(notifType);
         Notification notif = new Notification(notifType,
-                                              getObjectName(),
+                                              mbean.getObjectName(),
                                               getNextSeqNumber(),
                                               timestamp,
                                               msg);
@@ -189,4 +176,8 @@
         mbean.sendNotification(notif);
     }
 
+    public ObjectName getObjectName() {
+        return Util.newObjectName(ManagementFactory.MEMORY_MXBEAN_NAME);
+    }
+
 }
--- a/jdk/src/share/classes/sun/management/MemoryManagerImpl.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/sun/management/MemoryManagerImpl.java	Thu Jun 12 13:50:55 2008 -0700
@@ -25,9 +25,12 @@
 
 package sun.management;
 
+import java.lang.management.ManagementFactory;
 import java.lang.management.MemoryManagerMXBean;
 import java.lang.management.MemoryPoolMXBean;
 
+import javax.management.ObjectName;
+
 /**
  * Implementation class for a memory manager.
  * Standard and committed hotspot-specific metrics if any.
@@ -73,4 +76,8 @@
     }
     private native MemoryPoolMXBean[] getMemoryPools0();
 
+    public ObjectName getObjectName() {
+        return Util.newObjectName(ManagementFactory.MEMORY_MANAGER_MXBEAN_DOMAIN_TYPE, getName());
+    }
+
 }
--- a/jdk/src/share/classes/sun/management/MemoryNotifInfoCompositeData.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/sun/management/MemoryNotifInfoCompositeData.java	Thu Jun 12 13:50:55 2008 -0700
@@ -69,7 +69,7 @@
                                             memoryNotifInfoItemValues);
         } catch (OpenDataException e) {
             // Should never reach here
-            throw Util.newInternalError(e);
+            throw new AssertionError(e);
         }
     }
 
@@ -80,7 +80,7 @@
                 MappedMXBeanType.toOpenType(MemoryNotificationInfo.class);
         } catch (OpenDataException e) {
             // Should never reach here
-            throw Util.newInternalError(e);
+            throw new AssertionError(e);
         }
     }
 
--- a/jdk/src/share/classes/sun/management/MemoryPoolImpl.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/sun/management/MemoryPoolImpl.java	Thu Jun 12 13:50:55 2008 -0700
@@ -25,12 +25,13 @@
 
 package sun.management;
 
+import java.lang.management.ManagementFactory;
 import java.lang.management.MemoryPoolMXBean;
-
 import java.lang.management.MemoryUsage;
 import java.lang.management.MemoryType;
 import java.lang.management.MemoryManagerMXBean;
 import javax.management.openmbean.CompositeData;
+import javax.management.ObjectName;
 
 import static java.lang.management.MemoryNotificationInfo.*;
 
@@ -114,7 +115,7 @@
                 "Usage threshold is not supported");
         }
 
-        ManagementFactory.checkControlAccess();
+        Util.checkControlAccess();
 
         MemoryUsage usage = getUsage0();
         if (newThreshold < 0) {
@@ -159,7 +160,7 @@
     }
 
     public void resetPeakUsage() {
-        ManagementFactory.checkControlAccess();
+        Util.checkControlAccess();
 
         synchronized (this) {
             // synchronized since getPeakUsage may be called concurrently
@@ -211,7 +212,7 @@
                 "CollectionUsage threshold is not supported");
         }
 
-        ManagementFactory.checkControlAccess();
+        Util.checkControlAccess();
 
         MemoryUsage usage = getUsage0();
         if (newThreshold < 0) {
@@ -304,7 +305,7 @@
         }
         void triggerAction() {
             // Should not reach here
-            throw new InternalError();
+            throw new AssertionError("Should not reach here");
         }
         void clearAction() {
             // do nothing
@@ -332,10 +333,15 @@
         }
         void triggerAction() {
             // Should not reach here
-            throw new InternalError();
+            throw new AssertionError("Should not reach here");
         }
         void clearAction() {
             // do nothing
         }
     }
+
+    public ObjectName getObjectName() {
+        return Util.newObjectName(ManagementFactory.MEMORY_POOL_MXBEAN_DOMAIN_TYPE, getName());
+    }
+
 }
--- a/jdk/src/share/classes/sun/management/MemoryUsageCompositeData.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/sun/management/MemoryUsageCompositeData.java	Thu Jun 12 13:50:55 2008 -0700
@@ -68,7 +68,7 @@
                                             memoryUsageItemValues);
         } catch (OpenDataException e) {
             // Should never reach here
-            throw Util.newInternalError(e);
+            throw new AssertionError(e);
         }
     }
 
@@ -79,7 +79,7 @@
                 MappedMXBeanType.toOpenType(MemoryUsage.class);
         } catch (OpenDataException e) {
             // Should never reach here
-            throw Util.newInternalError(e);
+            throw new AssertionError(e);
         }
     }
 
--- a/jdk/src/share/classes/sun/management/MonitorInfoCompositeData.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/sun/management/MonitorInfoCompositeData.java	Thu Jun 12 13:50:55 2008 -0700
@@ -81,7 +81,7 @@
                                             values);
         } catch (OpenDataException e) {
             // Should never reach here
-            throw Util.newInternalError(e);
+            throw new AssertionError(e);
         }
     }
 
@@ -95,7 +95,7 @@
             monitorInfoItemNames = (String[]) s.toArray(new String[0]);
         } catch (OpenDataException e) {
             // Should never reach here
-            throw Util.newInternalError(e);
+            throw new AssertionError(e);
         }
     }
 
--- a/jdk/src/share/classes/sun/management/NotificationEmitterSupport.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/sun/management/NotificationEmitterSupport.java	Thu Jun 12 13:50:55 2008 -0700
@@ -156,7 +156,7 @@
                     li.listener.handleNotification(notification, li.handback);
                 } catch (Exception e) {
                     e.printStackTrace();
-                    throw new InternalError("Error in invoking listener");
+                    throw new AssertionError("Error in invoking listener");
                 }
             }
         }
--- a/jdk/src/share/classes/sun/management/OperatingSystemImpl.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/sun/management/OperatingSystemImpl.java	Thu Jun 12 13:50:55 2008 -0700
@@ -26,6 +26,8 @@
 package sun.management;
 
 import java.lang.management.OperatingSystemMXBean;
+import java.lang.management.ManagementFactory;
+import javax.management.ObjectName;
 import sun.misc.Unsafe;
 
 /**
@@ -71,4 +73,9 @@
              return -1.0;
         }
     }
+    public ObjectName getObjectName() {
+        return Util.newObjectName(ManagementFactory.OPERATING_SYSTEM_MXBEAN_NAME);
+    }
+
 }
+
--- a/jdk/src/share/classes/sun/management/RuntimeImpl.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/sun/management/RuntimeImpl.java	Thu Jun 12 13:50:55 2008 -0700
@@ -26,6 +26,7 @@
 package sun.management;
 
 import java.lang.management.RuntimeMXBean;
+import java.lang.management.ManagementFactory;
 
 import java.util.List;
 import java.util.HashMap;
@@ -38,6 +39,7 @@
 import javax.management.openmbean.OpenType;
 import javax.management.openmbean.SimpleType;
 import javax.management.openmbean.OpenDataException;
+import javax.management.ObjectName;
 
 /**
  * Implementation class for the runtime subsystem.
@@ -104,12 +106,12 @@
             throw new UnsupportedOperationException(
                 "Boot class path mechanism is not supported");
         }
-        ManagementFactory.checkMonitorAccess();
+        Util.checkMonitorAccess();
         return jvm.getBootClassPath();
     }
 
     public List<String> getInputArguments() {
-        ManagementFactory.checkMonitorAccess();
+        Util.checkMonitorAccess();
         return jvm.getVmArguments();
     }
 
@@ -145,4 +147,9 @@
 
         return map;
     }
+
+    public ObjectName getObjectName() {
+        return Util.newObjectName(ManagementFactory.RUNTIME_MXBEAN_NAME);
+    }
+
 }
--- a/jdk/src/share/classes/sun/management/StackTraceElementCompositeData.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/sun/management/StackTraceElementCompositeData.java	Thu Jun 12 13:50:55 2008 -0700
@@ -76,7 +76,7 @@
                                             stackTraceElementItemValues);
         } catch (OpenDataException e) {
             // Should never reach here
-            throw Util.newInternalError(e);
+            throw new AssertionError(e);
         }
     }
 
@@ -87,7 +87,7 @@
                 MappedMXBeanType.toOpenType(StackTraceElement.class);
         } catch (OpenDataException e) {
             // Should never reach here
-            throw Util.newInternalError(e);
+            throw new AssertionError(e);
         }
     }
 
--- a/jdk/src/share/classes/sun/management/ThreadImpl.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/sun/management/ThreadImpl.java	Thu Jun 12 13:50:55 2008 -0700
@@ -26,6 +26,7 @@
 package sun.management;
 
 import java.lang.management.ThreadMXBean;
+import java.lang.management.ManagementFactory;
 
 import java.lang.management.ThreadInfo;
 import java.lang.management.LockInfo;
@@ -33,6 +34,8 @@
 import java.util.Map;
 import java.util.HashMap;
 
+import javax.management.ObjectName;
+
 /**
  * Implementation class for the thread subsystem.
  * Standard and committed hotspot-specific metrics if any.
@@ -102,7 +105,7 @@
     }
 
     public long[] getAllThreadIds() {
-        ManagementFactory.checkMonitorAccess();
+        Util.checkMonitorAccess();
 
         Thread[] threads = getThreads();
         int length = threads.length;
@@ -156,7 +159,7 @@
                 "Invalid maxDepth parameter: " + maxDepth);
         }
 
-        ManagementFactory.checkMonitorAccess();
+        Util.checkMonitorAccess();
 
         ThreadInfo[] infos = new ThreadInfo[ids.length];
         if (maxDepth == Integer.MAX_VALUE) {
@@ -175,7 +178,7 @@
                 "Thread contention monitoring is not supported");
         }
 
-        ManagementFactory.checkControlAccess();
+        Util.checkControlAccess();
 
         synchronized (this) {
             if (contentionMonitoringEnabled != enable) {
@@ -297,7 +300,7 @@
                 "Thread CPU time measurement is not supported");
         }
 
-        ManagementFactory.checkControlAccess();
+        Util.checkControlAccess();
         synchronized (this) {
             if (cpuTimeEnabled != enable) {
                 // update VM of the state change
@@ -308,7 +311,7 @@
     }
 
     public long[] findMonitorDeadlockedThreads() {
-        ManagementFactory.checkMonitorAccess();
+        Util.checkMonitorAccess();
 
         Thread[] threads = findMonitorDeadlockedThreads0();
         if (threads == null) {
@@ -329,7 +332,7 @@
                 "Monitoring of Synchronizer Usage is not supported.");
         }
 
-        ManagementFactory.checkMonitorAccess();
+        Util.checkMonitorAccess();
 
         Thread[] threads = findDeadlockedThreads0();
         if (threads == null) {
@@ -345,7 +348,7 @@
     }
 
     public void resetPeakThreadCount() {
-        ManagementFactory.checkControlAccess();
+        Util.checkControlAccess();
         resetPeakThreadCount0();
     }
 
@@ -373,7 +376,7 @@
                 "Monitoring of Synchronizer Usage is not supported.");
         }
 
-        ManagementFactory.checkMonitorAccess();
+        Util.checkMonitorAccess();
         return dumpThreads0(ids, lockedMonitors, lockedSynchronizers);
     }
 
@@ -388,7 +391,7 @@
                 "Monitoring of Synchronizer Usage is not supported.");
         }
 
-        ManagementFactory.checkMonitorAccess();
+        Util.checkMonitorAccess();
         return dumpThreads0(null, lockedMonitors, lockedSynchronizers);
     }
 
@@ -410,4 +413,10 @@
 
     // tid == 0 to reset contention times for all threads
     private static native void resetContentionTimes0(long tid);
+
+    public ObjectName getObjectName() {
+        return Util.newObjectName(ManagementFactory.THREAD_MXBEAN_NAME);
+    }
+
 }
+
--- a/jdk/src/share/classes/sun/management/ThreadInfoCompositeData.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/sun/management/ThreadInfoCompositeData.java	Thu Jun 12 13:50:55 2008 -0700
@@ -126,7 +126,7 @@
                                             threadInfoItemValues);
         } catch (OpenDataException e) {
             // Should never reach here
-            throw Util.newInternalError(e);
+            throw new AssertionError(e);
         }
     }
 
@@ -209,7 +209,7 @@
                                   v5ItemTypes);
         } catch (OpenDataException e) {
             // Should never reach here
-            throw Util.newInternalError(e);
+            throw new AssertionError(e);
         }
 
         // Each CompositeData object has its CompositeType associated
--- a/jdk/src/share/classes/sun/management/Util.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/sun/management/Util.java	Thu Jun 12 13:50:55 2008 -0700
@@ -26,48 +26,58 @@
 package sun.management;
 
 import java.lang.management.*;
+import java.util.List;
+import java.security.Permission;
+import javax.management.ObjectName;
+import javax.management.MalformedObjectNameException;
+
 import static java.lang.management.ManagementFactory.*;
-import java.util.List;
 
 class Util {
-    static String getMBeanObjectName(MemoryPoolMXBean pool) {
-        return MEMORY_POOL_MXBEAN_DOMAIN_TYPE +
-            ",name=" + pool.getName();
+    static RuntimeException newException(Exception e) {
+        throw new RuntimeException(e);
+    }
+
+    private static final String[] EMPTY_STRING_ARRAY = new String[0];
+    static String[] toStringArray(List<String> list) {
+        return (String[]) list.toArray(EMPTY_STRING_ARRAY);
+    }
+
+    static ObjectName newObjectName(String name) {
+        return com.sun.jmx.mbeanserver.Util.newObjectName(name);
+    }
+
+    public static ObjectName newObjectName(String domainAndType, String name) {
+        return newObjectName(domainAndType + ",name=" + name);
     }
 
-    static String getMBeanObjectName(MemoryManagerMXBean mgr) {
-        if (mgr instanceof GarbageCollectorMXBean) {
-            return getMBeanObjectName((GarbageCollectorMXBean) mgr);
-        } else {
-            return MEMORY_MANAGER_MXBEAN_DOMAIN_TYPE +
-                ",name=" + mgr.getName();
+    private static ManagementPermission monitorPermission =
+        new ManagementPermission("monitor");
+    private static ManagementPermission controlPermission =
+        new ManagementPermission("control");
+
+    /**
+     * Check that the current context is trusted to perform monitoring
+     * or management.
+     * <p>
+     * If the check fails we throw a SecurityException, otherwise
+     * we return normally.
+     *
+     * @exception  SecurityException  if a security manager exists and if
+     *             the caller does not have ManagementPermission("control").
+     */
+    static void checkAccess(ManagementPermission p)
+         throws SecurityException {
+        SecurityManager sm = System.getSecurityManager();
+        if (sm != null) {
+            sm.checkPermission(p);
         }
     }
 
-    static String getMBeanObjectName(GarbageCollectorMXBean gc) {
-        return GARBAGE_COLLECTOR_MXBEAN_DOMAIN_TYPE +
-            ",name=" + gc.getName();
-    }
-
-    static RuntimeException newException(Exception e) {
-        RuntimeException e1 = new RuntimeException(e.getMessage());
-        e1.initCause(e);
-        return e1;
+    static void checkMonitorAccess() throws SecurityException {
+        checkAccess(monitorPermission);
     }
-
-    static InternalError newInternalError(Exception e) {
-        InternalError e1 = new InternalError(e.getMessage());
-        e1.initCause(e);
-        return e1;
-    }
-    static AssertionError newAssertionError(Exception e) {
-        AssertionError e1 = new AssertionError(e.getMessage());
-        e1.initCause(e);
-        return e1;
-    }
-
-    private static String[] EMPTY_STRING_ARRAY = new String[0];
-    static String[] toStringArray(List<String> list) {
-        return (String[]) list.toArray(EMPTY_STRING_ARRAY);
+    static void checkControlAccess() throws SecurityException {
+        checkAccess(controlPermission);
     }
 }
--- a/jdk/src/share/classes/sun/management/VMManagementImpl.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/sun/management/VMManagementImpl.java	Thu Jun 12 13:50:55 2008 -0700
@@ -59,7 +59,7 @@
     static {
         version = getVersion0();
         if (version == null) {
-            throw new InternalError("Invalid Management Version");
+            throw new AssertionError("Invalid Management Version");
         }
         initOptionalSupportFields();
     }
@@ -244,7 +244,7 @@
             // was set
             noPerfData = true;
         } catch (IOException e) {
-            throw new InternalError(e.getMessage());
+            throw new AssertionError(e);
         }
         return perfInstr;
     }
--- a/jdk/src/share/classes/sun/management/VMOptionCompositeData.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/sun/management/VMOptionCompositeData.java	Thu Jun 12 13:50:55 2008 -0700
@@ -69,7 +69,7 @@
                                             vmOptionItemValues);
         } catch (OpenDataException e) {
             // Should never reach here
-            throw Util.newInternalError(e);
+            throw new AssertionError(e);
         }
     }
 
@@ -80,7 +80,7 @@
                 MappedMXBeanType.toOpenType(VMOption.class);
         } catch (OpenDataException e) {
             // Should never reach here
-            throw Util.newInternalError(e);
+            throw new AssertionError(e);
         }
     }
 
--- a/jdk/src/share/classes/sun/misc/URLClassPath.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/sun/misc/URLClassPath.java	Thu Jun 12 13:50:55 2008 -0700
@@ -961,6 +961,7 @@
      * from a file URL that refers to a directory.
      */
     private static class FileLoader extends Loader {
+        /* Canonicalized File */
         private File dir;
 
         FileLoader(URL url) throws IOException {
@@ -970,7 +971,7 @@
             }
             String path = url.getFile().replace('/', File.separatorChar);
             path = ParseUtil.decode(path);
-            dir = new File(path);
+            dir = (new File(path)).getCanonicalFile();
         }
 
         /*
@@ -997,8 +998,19 @@
 
                 if (check)
                     URLClassPath.check(url);
-                final File file =
-                    new File(dir, name.replace('/', File.separatorChar));
+
+                final File file;
+                if (name.indexOf("..") != -1) {
+                    file = (new File(dir, name.replace('/', File.separatorChar)))
+                          .getCanonicalFile();
+                    if ( !((file.getPath()).startsWith(dir.getPath())) ) {
+                        /* outside of base dir */
+                        return null;
+                    }
+                } else {
+                    file = new File(dir, name.replace('/', File.separatorChar));
+                }
+
                 if (file.exists()) {
                     return new Resource() {
                         public String getName() { return name; };
--- a/jdk/src/share/classes/sun/net/www/protocol/http/DigestAuthentication.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/sun/net/www/protocol/http/DigestAuthentication.java	Thu Jun 12 13:50:55 2008 -0700
@@ -36,6 +36,7 @@
 import sun.net.www.HeaderParser;
 import java.security.MessageDigest;
 import java.security.NoSuchAlgorithmException;
+import static sun.net.www.protocol.http.HttpURLConnection.HTTP_CONNECT;
 
 
 /**
@@ -210,10 +211,38 @@
 
     /**
      * Reclaculates the request-digest and returns it.
+     *
+     * <P> Used in the common case where the requestURI is simply the
+     * abs_path.
+     *
+     * @param  url
+     *         the URL
+     *
+     * @param  method
+     *         the HTTP method
+     *
      * @return the value of the HTTP header this authentication wants set
      */
     String getHeaderValue(URL url, String method) {
-        return getHeaderValueImpl (url.getFile(), method);
+        return getHeaderValueImpl(url.getFile(), method);
+    }
+
+    /**
+     * Reclaculates the request-digest and returns it.
+     *
+     * <P> Used when the requestURI is not the abs_path. The exact
+     * requestURI can be passed as a String.
+     *
+     * @param  requestURI
+     *         the Request-URI from the HTTP request line
+     *
+     * @param  method
+     *         the HTTP method
+     *
+     * @return the value of the HTTP header this authentication wants set
+     */
+    String getHeaderValue(String requestURI, String method) {
+        return getHeaderValueImpl(requestURI, method);
     }
 
     /**
@@ -249,7 +278,16 @@
         params.setOpaque (p.findValue("opaque"));
         params.setQop (p.findValue("qop"));
 
-        String uri = conn.getURL().getFile();
+        String uri;
+        String method;
+        if (type == PROXY_AUTHENTICATION &&
+                conn.tunnelState() == HttpURLConnection.TunnelState.SETUP) {
+            uri = HttpURLConnection.connectRequestURI(conn.getURL());
+            method = HTTP_CONNECT;
+        } else {
+            uri = conn.getURL().getFile();
+            method = conn.getMethod();
+        }
 
         if (params.nonce == null || authMethod == null || pw == null || realm == null) {
             return false;
@@ -275,7 +313,7 @@
             params.setNewCnonce();
         }
 
-        String value = getHeaderValueImpl (uri, conn.getMethod());
+        String value = getHeaderValueImpl (uri, method);
         if (value != null) {
             conn.setAuthenticationProperty(getHeaderName(), value);
             return true;
--- a/jdk/src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java	Thu Jun 12 13:50:55 2008 -0700
@@ -75,6 +75,8 @@
 
     private static Logger logger = Logger.getLogger("sun.net.www.protocol.http.HttpURLConnection");
 
+    static String HTTP_CONNECT = "CONNECT";
+
     static final String version;
     public static final String userAgent;
 
@@ -266,6 +268,20 @@
     /* If we decide we want to reuse a client, we put it here */
     private HttpClient reuseClient = null;
 
+    /* Tunnel states */
+    enum TunnelState {
+        /* No tunnel */
+        NONE,
+
+        /* Setting up a tunnel */
+        SETUP,
+
+        /* Tunnel has been successfully setup */
+        TUNNELING
+    }
+
+    private TunnelState tunnelState = TunnelState.NONE;
+
     /* Redefine timeouts from java.net.URLConnection as we nee -1 to mean
      * not set. This is to ensure backward compatibility.
      */
@@ -338,7 +354,7 @@
          * others that have been set
          */
         // send any pre-emptive authentication
-        if (http.usingProxy) {
+        if (http.usingProxy && tunnelState() != TunnelState.TUNNELING) {
             setPreemptiveProxyAuthentication(requests);
         }
         if (!setRequests) {
@@ -1404,11 +1420,17 @@
             String raw = auth.raw();
             if (proxyAuthentication.isAuthorizationStale (raw)) {
                 /* we can retry with the current credentials */
-                requests.set (proxyAuthentication.getHeaderName(),
-                              proxyAuthentication.getHeaderValue(
-                                                     url, method));
+                String value;
+                if (tunnelState() == TunnelState.SETUP &&
+                      proxyAuthentication instanceof DigestAuthentication) {
+                    value = ((DigestAuthentication)proxyAuthentication)
+                            .getHeaderValue(connectRequestURI(url), HTTP_CONNECT);
+                } else {
+                    value = proxyAuthentication.getHeaderValue(url, method);
+                }
+                requests.set(proxyAuthentication.getHeaderName(), value);
                 currentProxyCredentials = proxyAuthentication;
-                return  proxyAuthentication;
+                return proxyAuthentication;
             } else {
                 proxyAuthentication.removeFromCache();
             }
@@ -1419,6 +1441,24 @@
     }
 
     /**
+     * Returns the tunnel state.
+     *
+     * @return  the state
+     */
+    TunnelState tunnelState() {
+        return tunnelState;
+    }
+
+    /**
+     * Set the tunneling status.
+     *
+     * @param  the state
+     */
+    void setTunnelState(TunnelState tunnelState) {
+        this.tunnelState = tunnelState;
+    }
+
+    /**
      * establish a tunnel through proxy server
      */
     public synchronized void doTunneling() throws IOException {
@@ -1437,6 +1477,9 @@
         boolean inNegotiateProxy = false;
 
         try {
+            /* Actively setting up a tunnel */
+            setTunnelState(TunnelState.SETUP);
+
             do {
                 if (!checkReuseConnection()) {
                     proxiedConnect(url, proxyHost, proxyPort, false);
@@ -1450,6 +1493,9 @@
                 // so ProgressSource is null.
                 http.parseHTTP(responses, null, this);
 
+                /* Log the response to the CONNECT */
+                logger.fine(responses.toString());
+
                 statusLine = responses.getValue(0);
                 StringTokenizer st = new StringTokenizer(statusLine);
                 st.nextToken();
@@ -1509,11 +1555,13 @@
                 }
 
                 if (respCode == HTTP_OK) {
+                    setTunnelState(TunnelState.TUNNELING);
                     break;
                 }
                 // we don't know how to deal with other response code
                 // so disconnect and report error
                 disconnectInternal();
+                setTunnelState(TunnelState.NONE);
                 break;
             } while (retryTunnel < maxRedirects);
 
@@ -1535,6 +1583,14 @@
         responses.reset();
     }
 
+    static String connectRequestURI(URL url) {
+        String host = url.getHost();
+        int port = url.getPort();
+        port = port != -1 ? port : url.getDefaultPort();
+
+        return host + ":" + port;
+    }
+
     /**
      * send a CONNECT request for establishing a tunnel to proxy server
      */
@@ -1548,8 +1604,7 @@
         // otherwise, there may have 2 http methods in headers
         if (setRequests) requests.set(0, null, null);
 
-        requests.prepend("CONNECT " + url.getHost() + ":"
-                         + (port != -1 ? port : url.getDefaultPort())
+        requests.prepend(HTTP_CONNECT + " " + connectRequestURI(url)
                          + " " + httpVersion, null);
         requests.setIfNotSet("User-Agent", userAgent);
 
@@ -1563,6 +1618,10 @@
         requests.setIfNotSet("Accept", acceptString);
 
         setPreemptiveProxyAuthentication(requests);
+
+         /* Log the CONNECT request */
+        logger.fine(requests.toString());
+
         http.writeRequests(requests, null);
         // remove CONNECT header
         requests.set(0, null, null);
@@ -1576,9 +1635,17 @@
             = AuthenticationInfo.getProxyAuth(http.getProxyHostUsed(),
                                               http.getProxyPortUsed());
         if (pauth != null && pauth.supportsPreemptiveAuthorization()) {
+            String value;
+            if (tunnelState() == TunnelState.SETUP &&
+                    pauth instanceof DigestAuthentication) {
+                value = ((DigestAuthentication)pauth)
+                        .getHeaderValue(connectRequestURI(url), HTTP_CONNECT);
+            } else {
+                value = pauth.getHeaderValue(url, method);
+            }
+
             // Sets "Proxy-authorization"
-            requests.set(pauth.getHeaderName(),
-                                 pauth.getHeaderValue(url,method));
+            requests.set(pauth.getHeaderName(), value);
             currentProxyCredentials = pauth;
         }
     }
--- a/jdk/src/share/classes/sun/net/www/protocol/http/InMemoryCookieStore.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/sun/net/www/protocol/http/InMemoryCookieStore.java	Thu Jun 12 13:50:55 2008 -0700
@@ -35,7 +35,6 @@
 import java.util.HashMap;
 import java.util.Collections;
 import java.util.Iterator;
-import java.util.Comparator;
 import java.util.concurrent.locks.ReentrantLock;
 
 /**
@@ -89,7 +88,9 @@
             if (cookie.getMaxAge() != 0) {
                 cookieJar.add(cookie);
                 // and add it to domain index
-                addIndex(domainIndex, cookie.getDomain(), cookie);
+                if (cookie.getDomain() != null) {
+                    addIndex(domainIndex, cookie.getDomain(), cookie);
+                }
                 // add it to uri index, too
                 addIndex(uriIndex, getEffectiveURI(uri), cookie);
             }
@@ -113,12 +114,13 @@
         }
 
         List<HttpCookie> cookies = new ArrayList<HttpCookie>();
+        boolean secureLink = "https".equalsIgnoreCase(uri.getScheme());
         lock.lock();
         try {
             // check domainIndex first
-            getInternal(cookies, domainIndex, new DomainComparator(uri.getHost()));
+            getInternal1(cookies, domainIndex, uri.getHost(), secureLink);
             // check uriIndex then
-            getInternal(cookies, uriIndex, getEffectiveURI(uri));
+            getInternal2(cookies, uriIndex, getEffectiveURI(uri), secureLink);
         } finally {
             lock.unlock();
         }
@@ -217,19 +219,96 @@
     /* ---------------- Private operations -------------- */
 
 
-    static class DomainComparator implements Comparable<String> {
-        String host = null;
+    /*
+     * This is almost the same as HttpCookie.domainMatches except for
+     * one difference: It won't reject cookies when the 'H' part of the
+     * domain contains a dot ('.').
+     * I.E.: RFC 2965 section 3.3.2 says that if host is x.y.domain.com
+     * and the cookie domain is .domain.com, then it should be rejected.
+     * However that's not how the real world works. Browsers don't reject and
+     * some sites, like yahoo.com do actually expect these cookies to be
+     * passed along.
+     * And should be used for 'old' style cookies (aka Netscape type of cookies)
+     */
+    private boolean netscapeDomainMatches(String domain, String host)
+    {
+        if (domain == null || host == null) {
+            return false;
+        }
 
-        public DomainComparator(String host) {
-            this.host = host;
+        // if there's no embedded dot in domain and domain is not .local
+        boolean isLocalDomain = ".local".equalsIgnoreCase(domain);
+        int embeddedDotInDomain = domain.indexOf('.');
+        if (embeddedDotInDomain == 0) {
+            embeddedDotInDomain = domain.indexOf('.', 1);
+        }
+        if (!isLocalDomain && (embeddedDotInDomain == -1 || embeddedDotInDomain == domain.length() - 1)) {
+            return false;
+        }
+
+        // if the host name contains no dot and the domain name is .local
+        int firstDotInHost = host.indexOf('.');
+        if (firstDotInHost == -1 && isLocalDomain) {
+            return true;
         }
 
-        public int compareTo(String domain) {
-            if (HttpCookie.domainMatches(domain, host)) {
-                return 0;
-            } else {
-                return -1;
+        int domainLength = domain.length();
+        int lengthDiff = host.length() - domainLength;
+        if (lengthDiff == 0) {
+            // if the host name and the domain name are just string-compare euqal
+            return host.equalsIgnoreCase(domain);
+        } else if (lengthDiff > 0) {
+            // need to check H & D component
+            String H = host.substring(0, lengthDiff);
+            String D = host.substring(lengthDiff);
+
+            return (D.equalsIgnoreCase(domain));
+        } else if (lengthDiff == -1) {
+            // if domain is actually .host
+            return (domain.charAt(0) == '.' &&
+                    host.equalsIgnoreCase(domain.substring(1)));
+        }
+
+        return false;
+    }
+
+    private void getInternal1(List<HttpCookie> cookies, Map<String, List<HttpCookie>> cookieIndex,
+            String host, boolean secureLink) {
+        // Use a separate list to handle cookies that need to be removed so
+        // that there is no conflict with iterators.
+        ArrayList<HttpCookie> toRemove = new ArrayList<HttpCookie>();
+        for (Map.Entry<String, List<HttpCookie>> entry : cookieIndex.entrySet()) {
+            String domain = entry.getKey();
+            List<HttpCookie> lst = entry.getValue();
+            for (HttpCookie c : lst) {
+                if ((c.getVersion() == 0 && netscapeDomainMatches(domain, host)) ||
+                        (c.getVersion() == 1 && HttpCookie.domainMatches(domain, host))) {
+                    if ((cookieJar.indexOf(c) != -1)) {
+                        // the cookie still in main cookie store
+                        if (!c.hasExpired()) {
+                            // don't add twice and make sure it's the proper
+                            // security level
+                            if ((secureLink || !c.getSecure()) &&
+                                    !cookies.contains(c)) {
+                                cookies.add(c);
+                            }
+                        } else {
+                            toRemove.add(c);
+                        }
+                    } else {
+                        // the cookie has beed removed from main store,
+                        // so also remove it from domain indexed store
+                        toRemove.add(c);
+                    }
+                }
             }
+            // Clear up the cookies that need to be removed
+            for (HttpCookie c : toRemove) {
+                lst.remove(c);
+                cookieJar.remove(c);
+
+            }
+            toRemove.clear();
         }
     }
 
@@ -237,9 +316,9 @@
     // @param cookieIndex       the index
     // @param comparator        the prediction to decide whether or not
     //                          a cookie in index should be returned
-    private <T> void getInternal(List<HttpCookie> cookies,
+    private <T> void getInternal2(List<HttpCookie> cookies,
                                 Map<T, List<HttpCookie>> cookieIndex,
-                                Comparable<T> comparator)
+                                Comparable<T> comparator, boolean secureLink)
     {
         for (T index : cookieIndex.keySet()) {
             if (comparator.compareTo(index) == 0) {
@@ -253,7 +332,8 @@
                             // the cookie still in main cookie store
                             if (!ck.hasExpired()) {
                                 // don't add twice
-                                if (!cookies.contains(ck))
+                                if ((secureLink || !ck.getSecure()) &&
+                                        !cookies.contains(ck))
                                     cookies.add(ck);
                             } else {
                                 it.remove();
@@ -292,14 +372,14 @@
 
 
     //
-    // for cookie purpose, the effective uri should only be scheme://authority
+    // for cookie purpose, the effective uri should only be http://host
     // the path will be taken into account when path-match algorithm applied
     //
     private URI getEffectiveURI(URI uri) {
         URI effectiveURI = null;
         try {
-            effectiveURI = new URI(uri.getScheme(),
-                                   uri.getAuthority(),
+            effectiveURI = new URI("http",
+                                   uri.getHost(),
                                    null,  // path component
                                    null,  // query component
                                    null   // fragment component
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/classes/sun/nio/cs/CharsetMapping.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,351 @@
+/*
+ * Copyright 2008 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.nio.cs;
+
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.OutputStream;
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import java.util.*;
+import java.security.*;
+
+public class CharsetMapping {
+    public final static char UNMAPPABLE_DECODING = '\uFFFD';
+    public final static int  UNMAPPABLE_ENCODING = -1;
+
+    char[] b2cSB;                //singlebyte b->c
+    char[] b2cDB1;               //dobulebyte b->c /db1
+    char[] b2cDB2;               //dobulebyte b->c /db2
+
+    int    b2Min, b2Max;         //min/max(start/end) value of 2nd byte
+    int    b1MinDB1, b1MaxDB1;   //min/Max(start/end) value of 1st byte/db1
+    int    b1MinDB2, b1MaxDB2;   //min/Max(start/end) value of 1st byte/db2
+    int    dbSegSize;
+
+    char[] c2b;
+    char[] c2bIndex;
+
+    // Supplementary
+    char[] b2cSupp;
+    char[] c2bSupp;
+
+    // Composite
+    Entry[] b2cComp;
+    Entry[] c2bComp;
+
+    public char decodeSingle(int b) {
+        return b2cSB[b];
+    }
+
+    public char decodeDouble(int b1, int b2) {
+        if (b2 >= b2Min && b2 < b2Max) {
+            b2 -= b2Min;
+            if (b1 >= b1MinDB1 && b1 <= b1MaxDB1) {
+                b1 -= b1MinDB1;
+                return b2cDB1[b1 * dbSegSize + b2];
+            }
+            if (b1 >= b1MinDB2 && b1 <= b1MaxDB2) {
+                b1 -= b1MinDB2;
+                return b2cDB2[b1 * dbSegSize + b2];
+            }
+        }
+        return UNMAPPABLE_DECODING;
+    }
+
+    // for jis0213 all supplementary characters are in 0x2xxxx range,
+    // so only the xxxx part is now stored, should actually store the
+    // codepoint value instead.
+    public char[] decodeSurrogate(int db, char[] cc) {
+        int end = b2cSupp.length / 2;
+        int i = Arrays.binarySearch(b2cSupp, 0, end, (char)db);
+        if (i >= 0) {
+            Character.toChars(b2cSupp[end + i] + 0x20000, cc, 0);
+            return cc;
+        }
+        return null;
+    }
+
+    public char[] decodeComposite(Entry comp, char[] cc) {
+        int i = findBytes(b2cComp, comp);
+        if (i >= 0) {
+            cc[0] = (char)b2cComp[i].cp;
+            cc[1] = (char)b2cComp[i].cp2;
+            return cc;
+        }
+        return null;
+    }
+
+    public int encodeChar(char ch) {
+        int index = c2bIndex[ch >> 8];
+        if (index == 0xffff)
+            return UNMAPPABLE_ENCODING;
+        return c2b[index + (ch & 0xff)];
+    }
+
+    public int encodeSurrogate(char hi, char lo) {
+        char c = (char)Character.toCodePoint(hi, lo);
+        int end = c2bSupp.length / 2;
+        int i = Arrays.binarySearch(c2bSupp, 0, end, c);
+        if (i >= 0)
+            return c2bSupp[end + i];
+        return UNMAPPABLE_ENCODING;
+    }
+
+    public boolean isCompositeBase(Entry comp) {
+        if (comp.cp <= 0x31f7 && comp.cp >= 0xe6) {
+            return (findCP(c2bComp, comp) >= 0);
+        }
+        return false;
+    }
+
+    public int encodeComposite(Entry comp) {
+        int i = findComp(c2bComp, comp);
+        if (i >= 0)
+            return c2bComp[i].bs;
+        return UNMAPPABLE_ENCODING;
+    }
+
+    // init the CharsetMapping object from the .dat binary file
+    public static CharsetMapping get(final InputStream is) {
+        return AccessController.doPrivileged(new PrivilegedAction<CharsetMapping>() {
+            public CharsetMapping run() {
+                return new CharsetMapping().load(is);
+            }
+        });
+    }
+
+    public static class Entry {
+        public int bs;   //byte sequence reps
+        public int cp;   //Unicode codepoint
+        public int cp2;  //CC of composite
+    }
+
+    static Comparator<Entry> comparatorBytes =
+        new Comparator<Entry>() {
+            public int compare(Entry m1, Entry m2) {
+                return m1.bs - m2.bs;
+            }
+            public boolean equals(Object obj) {
+                return this == obj;
+            }
+    };
+
+    static Comparator<Entry> comparatorCP =
+        new Comparator<Entry>() {
+            public int compare(Entry m1, Entry m2) {
+                return m1.cp - m2.cp;
+            }
+            public boolean equals(Object obj) {
+                return this == obj;
+            }
+    };
+
+    static Comparator<Entry> comparatorComp =
+        new Comparator<Entry>() {
+            public int compare(Entry m1, Entry m2) {
+                 int v = m1.cp - m2.cp;
+                 if (v == 0)
+                   v = m1.cp2 - m2.cp2;
+                 return v;
+            }
+            public boolean equals(Object obj) {
+                return this == obj;
+            }
+    };
+
+    static int findBytes(Entry[] a, Entry k) {
+        return Arrays.binarySearch(a, 0, a.length, k, comparatorBytes);
+    }
+
+    static int findCP(Entry[] a, Entry k) {
+        return Arrays.binarySearch(a, 0, a.length, k, comparatorCP);
+    }
+
+    static int findComp(Entry[] a, Entry k) {
+        return Arrays.binarySearch(a, 0, a.length, k, comparatorComp);
+    }
+
+    /*****************************************************************************/
+    // tags of different charset mapping tables
+    private final static int MAP_SINGLEBYTE      = 0x1; // 0..256  : c
+    private final static int MAP_DOUBLEBYTE1     = 0x2; // min..max: c
+    private final static int MAP_DOUBLEBYTE2     = 0x3; // min..max: c [DB2]
+    private final static int MAP_SUPPLEMENT      = 0x5; //           db,c
+    private final static int MAP_SUPPLEMENT_C2B  = 0x6; //           c,db
+    private final static int MAP_COMPOSITE       = 0x7; //           db,base,cc
+    private final static int MAP_INDEXC2B        = 0x8; // index table of c->bb
+
+    private static final boolean readNBytes(InputStream in, byte[] bb, int N)
+        throws IOException
+    {
+        int off = 0;
+        while (N > 0) {
+            int n = in.read(bb, off, N);
+            if (n == -1)
+                return false;
+            N = N - n;
+            off += n;
+        }
+        return true;
+    }
+
+    int off = 0;
+    byte[] bb;
+    private char[] readCharArray() {
+        // first 2 bytes are the number of "chars" stored in this table
+        int size  = ((bb[off++]&0xff)<<8) | (bb[off++]&0xff);
+        char [] cc = new char[size];
+        for (int i = 0; i < size; i++) {
+            cc[i] = (char)(((bb[off++]&0xff)<<8) | (bb[off++]&0xff));
+        }
+        return cc;
+    }
+
+    void readSINGLEBYTE() {
+        char[] map = readCharArray();
+        for (int i = 0; i < map.length; i++) {
+            char c = map[i];
+            if (c != UNMAPPABLE_DECODING) {
+                c2b[c2bIndex[c >> 8] + (c&0xff)] = (char)i;
+            }
+        }
+        b2cSB = map;
+    }
+
+    void readINDEXC2B() {
+        char[] map = readCharArray();
+        for (int i = map.length - 1; i >= 0; i--) {
+            if (c2b == null && map[i] != -1) {
+                c2b = new char[map[i] + 256];
+                Arrays.fill(c2b, (char)UNMAPPABLE_ENCODING);
+                break;
+            }
+        }
+        c2bIndex = map;
+    }
+
+    char[] readDB(int b1Min, int b2Min, int segSize) {
+        char[] map = readCharArray();
+        for (int i = 0; i < map.length; i++) {
+            char c = map[i];
+            if (c != UNMAPPABLE_DECODING) {
+                int b1 = i / segSize;
+                int b2 = i % segSize;
+                int b = (b1 + b1Min)* 256 + (b2 + b2Min);
+                //System.out.printf("    DB %x\t%x%n", b, c & 0xffff);
+                c2b[c2bIndex[c >> 8] + (c&0xff)] = (char)(b);
+            }
+        }
+        return map;
+    }
+
+    void readDOUBLEBYTE1() {
+        b1MinDB1 = ((bb[off++]&0xff)<<8) | (bb[off++]&0xff);
+        b1MaxDB1 = ((bb[off++]&0xff)<<8) | (bb[off++]&0xff);
+        b2Min =    ((bb[off++]&0xff)<<8) | (bb[off++]&0xff);
+        b2Max =    ((bb[off++]&0xff)<<8) | (bb[off++]&0xff);
+        dbSegSize = b2Max - b2Min + 1;
+        b2cDB1 = readDB(b1MinDB1, b2Min, dbSegSize);
+    }
+
+    void readDOUBLEBYTE2() {
+        b1MinDB2 = ((bb[off++]&0xff)<<8) | (bb[off++]&0xff);
+        b1MaxDB2 = ((bb[off++]&0xff)<<8) | (bb[off++]&0xff);
+        b2Min =    ((bb[off++]&0xff)<<8) | (bb[off++]&0xff);
+        b2Max =    ((bb[off++]&0xff)<<8) | (bb[off++]&0xff);
+        dbSegSize = b2Max - b2Min + 1;
+        b2cDB2 = readDB(b1MinDB2, b2Min, dbSegSize);
+    }
+
+    void readCOMPOSITE() {
+        char[] map = readCharArray();
+        int mLen = map.length/3;
+        b2cComp = new Entry[mLen];
+        c2bComp = new Entry[mLen];
+        for (int i = 0, j= 0; i < mLen; i++) {
+            Entry m = new Entry();
+            m.bs = map[j++];
+            m.cp = map[j++];
+            m.cp2 = map[j++];
+            b2cComp[i] = m;
+            c2bComp[i] = m;
+        }
+        Arrays.sort(c2bComp, 0, c2bComp.length, comparatorComp);
+    }
+
+    CharsetMapping load(InputStream in) {
+        try {
+            // The first 4 bytes are the size of the total data followed in
+            // this .dat file.
+            int len = ((in.read()&0xff) << 24) | ((in.read()&0xff) << 16) |
+                      ((in.read()&0xff) << 8) | (in.read()&0xff);
+            bb = new byte[len];
+            off = 0;
+            //System.out.printf("In : Total=%d%n", len);
+            // Read in all bytes
+            if (!readNBytes(in, bb, len))
+                throw new RuntimeException("Corrupted data file");
+            in.close();
+
+            while (off < len) {
+                int type = ((bb[off++]&0xff)<<8) | (bb[off++]&0xff);
+                switch(type) {
+                case MAP_INDEXC2B:
+                    readINDEXC2B();
+                    break;
+                case MAP_SINGLEBYTE:
+                    readSINGLEBYTE();
+                    break;
+                case MAP_DOUBLEBYTE1:
+                    readDOUBLEBYTE1();
+                    break;
+                case MAP_DOUBLEBYTE2:
+                    readDOUBLEBYTE2();
+                    break;
+                case MAP_SUPPLEMENT:
+                    b2cSupp = readCharArray();
+                    break;
+                case MAP_SUPPLEMENT_C2B:
+                    c2bSupp = readCharArray();
+                    break;
+                case MAP_COMPOSITE:
+                    readCOMPOSITE();
+                    break;
+                default:
+                    throw new RuntimeException("Corrupted data file");
+                }
+            }
+            bb = null;
+            return this;
+        } catch (IOException x) {
+            x.printStackTrace();
+            return null;
+        }
+    }
+}
--- a/jdk/src/share/classes/sun/nio/cs/UTF_8.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/sun/nio/cs/UTF_8.java	Thu Jun 12 13:50:55 2008 -0700
@@ -326,7 +326,7 @@
 
                         case 12: case 13:
                             // 6 bytes, 31 bits
-                            if (src.remaining() < 4)
+                            if (src.remaining() < 5)
                                 return CoderResult.UNDERFLOW;
                             if (!isContinuation(b2 = src.get()))
                                 return CoderResult.malformedForLength(1);
--- a/jdk/src/share/classes/sun/nio/cs/ext/ExtendedCharsets.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/sun/nio/cs/ext/ExtendedCharsets.java	Thu Jun 12 13:50:55 2008 -0700
@@ -23,9 +23,6 @@
  * have any questions.
  */
 
-/*
- */
-
 package sun.nio.cs.ext;
 
 import java.lang.ref.SoftReference;
@@ -183,6 +180,25 @@
                     "csISO159JISX02121990"
                 });
 
+        charset("x-SJIS_0213", "SJIS_0213",
+                new String[] {
+                    "sjis-0213",
+                    "sjis_0213",
+                    "sjis:2004",
+                    "sjis_0213:2004",
+                    "shift_jis_0213:2004",
+                    "shift_jis:2004"
+                });
+
+        charset("x-MS932_0213", "MS932_0213",
+                new String[] {
+                    "MS932-0213",
+                    "MS932_0213",
+                    "MS932:2004",
+                    "windows-932-0213",
+                    "windows-932:2004"
+                });
+
         charset("EUC-JP", "EUC_JP",
                 new String[] {
                     "euc_jp", // JDK historical
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/classes/sun/nio/cs/ext/MS932_0213.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,80 @@
+/*
+ * Copyright 2008 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.nio.cs.ext;
+
+import java.nio.charset.Charset;
+import java.nio.charset.CharsetEncoder;
+import java.nio.charset.CharsetDecoder;
+
+public class MS932_0213 extends Charset {
+    public MS932_0213() {
+        super("x-MS932_0213", ExtendedCharsets.aliasesFor("MS932_0213"));
+    }
+
+    public boolean contains(Charset cs) {
+        return ((cs.name().equals("US-ASCII"))
+                || (cs instanceof MS932)
+                || (cs instanceof MS932_0213));
+    }
+
+    public CharsetDecoder newDecoder() {
+        return new Decoder(this);
+    }
+
+    public CharsetEncoder newEncoder() {
+        return new Encoder(this);
+    }
+
+    protected static class Decoder extends SJIS_0213.Decoder {
+        MS932DB.Decoder decMS932;
+        protected Decoder(Charset cs) {
+            super(cs);
+            decMS932 = new MS932DB.Decoder(cs);
+        }
+
+        protected char decodeDouble(int b1, int b2) {
+            char c = decMS932.decodeDouble(b1, b2);
+            if (c == DoubleByteDecoder.REPLACE_CHAR)
+                return super.decodeDouble(b1, b2);
+            return c;
+        }
+    }
+
+    protected static class Encoder extends SJIS_0213.Encoder {
+        MS932DB.Encoder encMS932;
+        protected Encoder(Charset cs) {
+            super(cs);
+            encMS932 = new MS932DB.Encoder(cs);
+        }
+
+        protected int encodeChar(char ch) {
+            int db = encMS932.encodeDouble(ch);
+            if (db == 0)
+                return super.encodeChar(ch);
+            return db;
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/classes/sun/nio/cs/ext/SJIS_0213.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,398 @@
+/*
+ * Copyright 2008 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.nio.cs.ext;
+
+import java.nio.ByteBuffer;
+import java.nio.CharBuffer;
+import java.nio.charset.Charset;
+import java.nio.charset.CharsetEncoder;
+import java.nio.charset.CharsetDecoder;
+import java.nio.charset.CoderResult;
+import java.util.Arrays;
+import sun.nio.cs.CharsetMapping;
+
+/*
+ *  5 types of entry in SJIS_X_0213/Unicode mapping table
+ *
+ *  (1)Single-Byte
+ *     JIS_X_0213 does not define single-byte character itself, the
+ *     JIS_X_0201 entries are added in for sjis implementation.
+ *
+ *  (2)Double-Byte SJIS <-> BMP Unicode
+ *     ex: 0x8140 U+3000    # IDEOGRAPHIC SPACE
+ *
+ *  (3)Double-Byte SJIS <-> Supplementary
+ *     ex: 0xFCF0 U+2A61A   # <cjk> [2000] [Unicode3.1]
+ *
+ *  (4)Double-Byte SJIS <-> Composite
+ *   ex: 0x83F6 U+31F7+309A # [2000]
+ *
+ *  (5)"Windows-only" special mapping entries
+ *     are handled by MS932_0213.
+ */
+
+public class SJIS_0213 extends Charset {
+    public SJIS_0213() {
+        super("x-SJIS_0213", ExtendedCharsets.aliasesFor("SJIS_0213"));
+    }
+
+    public boolean contains(Charset cs) {
+        return ((cs.name().equals("US-ASCII"))
+                || (cs instanceof SJIS)
+                || (cs instanceof SJIS_0213));
+    }
+
+    public CharsetDecoder newDecoder() {
+        return new Decoder(this);
+    }
+
+    public CharsetEncoder newEncoder() {
+        return new Encoder(this);
+    }
+
+    static CharsetMapping mapping =
+        CharsetMapping.get(SJIS_0213.class.getResourceAsStream("sjis0213.dat"));
+
+    protected static class Decoder extends CharsetDecoder {
+        protected static final char UNMAPPABLE = CharsetMapping.UNMAPPABLE_DECODING;
+
+        protected Decoder(Charset cs) {
+            super(cs, 0.5f, 1.0f);
+        }
+
+        private CoderResult decodeArrayLoop(ByteBuffer src, CharBuffer dst) {
+            byte[] sa = src.array();
+            int sp = src.arrayOffset() + src.position();
+            int sl = src.arrayOffset() + src.limit();
+
+            char[] da = dst.array();
+            int dp = dst.arrayOffset() + dst.position();
+            int dl = dst.arrayOffset() + dst.limit();
+
+            try {
+                while (sp < sl) {
+                    int b1 = sa[sp] & 0xff;
+                    char c = decodeSingle(b1);
+                    int inSize = 1, outSize = 1;
+                    char[] cc = null;
+                    if (c == UNMAPPABLE) {
+                        if (sl - sp < 2)
+                            return CoderResult.UNDERFLOW;
+                        int b2 = sa[sp + 1] & 0xff;
+                        c = decodeDouble(b1, b2);
+                        inSize++;
+                        if (c == UNMAPPABLE) {
+                            cc = decodeDoubleEx(b1, b2);
+                            if (cc == null) {
+                                if (decodeSingle(b2) == UNMAPPABLE)
+                                    return CoderResult.unmappableForLength(2);
+                                else
+                                    return CoderResult.unmappableForLength(1);
+                            }
+                            outSize++;
+                        }
+                    }
+                    if (dl - dp < outSize)
+                        return CoderResult.OVERFLOW;
+                    if (outSize == 2) {
+                        da[dp++] = cc[0];
+                        da[dp++] = cc[1];
+                    } else {
+                        da[dp++] = c;
+                    }
+                    sp += inSize;
+                }
+                return CoderResult.UNDERFLOW;
+            } finally {
+                src.position(sp - src.arrayOffset());
+                dst.position(dp - dst.arrayOffset());
+            }
+        }
+
+        private CoderResult decodeBufferLoop(ByteBuffer src, CharBuffer dst) {
+            int mark = src.position();
+            try {
+                while (src.hasRemaining()) {
+                    char[] cc = null;
+                    int b1 = src.get() & 0xff;
+                    char c = decodeSingle(b1);
+                    int inSize = 1, outSize = 1;
+                    if (c == UNMAPPABLE) {
+                        if (src.remaining() < 1)
+                            return CoderResult.UNDERFLOW;
+                        int b2 = src.get() & 0xff;
+                        inSize++;
+                        c = decodeDouble(b1, b2);
+                        if (c == UNMAPPABLE) {
+                            cc = decodeDoubleEx(b1, b2);
+                            if (cc == null) {
+                                if (decodeSingle(b2) == UNMAPPABLE)
+                                    return CoderResult.unmappableForLength(2);
+                                else
+                                    return CoderResult.unmappableForLength(1);
+                            }
+                            outSize++;
+                        }
+                    }
+                    if (dst.remaining() < outSize)
+                        return CoderResult.OVERFLOW;
+                    if (outSize == 2) {
+                        dst.put(cc[0]);
+                        dst.put(cc[1]);
+                    } else {
+                        dst.put(c);
+                    }
+                    mark += inSize;
+                }
+                return CoderResult.UNDERFLOW;
+            } finally {
+                src.position(mark);
+            }
+        }
+
+        protected CoderResult decodeLoop(ByteBuffer src, CharBuffer dst) {
+            if (src.hasArray() && dst.hasArray())
+                return decodeArrayLoop(src, dst);
+            else
+                return decodeBufferLoop(src, dst);
+        }
+
+        protected char decodeSingle(int b) {
+            return mapping.decodeSingle(b);
+        }
+
+        protected char decodeDouble(int b1, int b2) {
+            return mapping.decodeDouble(b1, b2);
+        }
+
+        private char[] cc = new char[2];
+        private CharsetMapping.Entry comp = new CharsetMapping.Entry();
+        protected char[] decodeDoubleEx(int b1, int b2) {
+            int db = (b1 << 8) | b2;
+            if (mapping.decodeSurrogate(db, cc) != null)
+                return cc;
+            comp.bs = db;
+            if (mapping.decodeComposite(comp, cc) != null)
+                return cc;
+            return null;
+        }
+    }
+
+    protected static class Encoder extends CharsetEncoder {
+        protected static final int UNMAPPABLE = CharsetMapping.UNMAPPABLE_ENCODING;
+        protected static final int MAX_SINGLEBYTE = 0xff;
+
+        protected Encoder(Charset cs) {
+            super(cs, 2.0f, 2.0f);
+        }
+
+        public boolean canEncode(char c) {
+            return (encodeChar(c) != UNMAPPABLE);
+        }
+
+        protected int encodeChar(char ch) {
+            return mapping.encodeChar(ch);
+        }
+
+        protected int encodeSurrogate(char hi, char lo) {
+            return mapping.encodeSurrogate(hi, lo);
+        }
+
+        private CharsetMapping.Entry comp = new CharsetMapping.Entry();
+        protected int encodeComposite(char base, char cc) {
+            comp.cp = base;
+            comp.cp2 = cc;
+            return mapping.encodeComposite(comp);
+        }
+
+        protected boolean isCompositeBase(char ch) {
+            comp.cp = ch;
+            return mapping.isCompositeBase(comp);
+        }
+
+        // Unlike surrogate pair, the base character of a base+cc composite
+        // itself is a legal codepoint in 0213, if we simply return UNDERFLOW
+        // when a base candidate is the last input char in the CharBuffer, like
+        // what we do for the surrogte pair, encoding will fail if this base
+        // character is indeed the last character of the input char sequence.
+        // Keep this base candidate in "leftoverBase" so we can flush it out
+        // at the end of the encoding circle.
+        char leftoverBase = 0;
+        protected CoderResult encodeArrayLoop(CharBuffer src, ByteBuffer dst) {
+            char[] sa = src.array();
+            int sp = src.arrayOffset() + src.position();
+            int sl = src.arrayOffset() + src.limit();
+            byte[] da = dst.array();
+            int dp = dst.arrayOffset() + dst.position();
+            int dl = dst.arrayOffset() + dst.limit();
+
+            try {
+                while (sp < sl) {
+                    int db;
+                    char c = sa[sp];
+                    if (leftoverBase != 0) {
+                        boolean isComp = false;
+                        db = encodeComposite(leftoverBase, c);
+                        if (db == UNMAPPABLE)
+                            db = encodeChar(leftoverBase);
+                        else
+                            isComp = true;
+                        if (dl - dp < 2)
+                            return CoderResult.OVERFLOW;
+                        da[dp++] = (byte)(db >> 8);
+                        da[dp++] = (byte)db;
+                        leftoverBase = 0;
+                        if (isComp) {
+                            sp++;
+                            continue;
+                        }
+                    }
+                    if (isCompositeBase(c)) {
+                        leftoverBase = c;
+                    } else {
+                        db = encodeChar(c);
+                        if (db > MAX_SINGLEBYTE) {      // DoubleByte
+                            if (dl - dp < 2)
+                                return CoderResult.OVERFLOW;
+                            da[dp++] = (byte)(db >> 8);
+                            da[dp++] = (byte)db;
+                        } else if (db != UNMAPPABLE) {  // SingleByte
+                            if (dl <= dp)
+                                return CoderResult.OVERFLOW;
+                            da[dp++] = (byte)db;
+                        } else if (Character.isHighSurrogate(c)) {
+                            if ((sp + 1) == sl)
+                                return CoderResult.UNDERFLOW;
+                            char c2 = sa[sp + 1];
+                            if (!Character.isLowSurrogate(c2))
+                                return CoderResult.malformedForLength(1);
+                            db = encodeSurrogate(c, c2);
+                            if (db == UNMAPPABLE)
+                                return CoderResult.unmappableForLength(2);
+                            if (dl - dp < 2)
+                                return CoderResult.OVERFLOW;
+                            da[dp++] = (byte)(db >> 8);
+                            da[dp++] = (byte)db;
+                            sp++;
+                        } else {
+                            return CoderResult.unmappableForLength(1);
+                        }
+                    }
+                    sp++;
+                }
+                return CoderResult.UNDERFLOW;
+            } finally {
+                src.position(sp - src.arrayOffset());
+                dst.position(dp - dst.arrayOffset());
+            }
+        }
+
+        protected CoderResult encodeBufferLoop(CharBuffer src, ByteBuffer dst) {
+            int mark = src.position();
+            try {
+                while (src.hasRemaining()) {
+                    int db;
+                    char c = src.get();
+                    if (leftoverBase != 0) {
+                        boolean isComp = false;
+                        db = encodeComposite(leftoverBase, c);
+                        if (db == UNMAPPABLE)
+                            db = encodeChar(leftoverBase);
+                        else
+                            isComp = true;
+                        if (dst.remaining() < 2)
+                            return CoderResult.OVERFLOW;
+                        dst.put((byte)(db >> 8));
+                        dst.put((byte)(db));
+                        leftoverBase = 0;
+                        if (isComp) {
+                            mark++;
+                            continue;
+                        }
+                    }
+                    if (isCompositeBase(c)) {
+                        leftoverBase = c;
+                    } else {
+                        db = encodeChar(c);
+                        if (db > MAX_SINGLEBYTE) {        // DoubleByte
+                            if (dst.remaining() < 2)
+                                return CoderResult.OVERFLOW;
+                            dst.put((byte)(db >> 8));
+                            dst.put((byte)(db));
+                        } else if (db != UNMAPPABLE) {    // Single-byte
+                            if (dst.remaining() < 1)
+                                return CoderResult.OVERFLOW;
+                            dst.put((byte)db);
+                        } else if (Character.isHighSurrogate(c)) {
+                            if (!src.hasRemaining())     // Surrogates
+                                return CoderResult.UNDERFLOW;
+                            char c2 = src.get();
+                            if (!Character.isLowSurrogate(c2))
+                                return CoderResult.malformedForLength(1);
+                            db = encodeSurrogate(c, c2);
+                            if (db == UNMAPPABLE)
+                                return CoderResult.unmappableForLength(2);
+                            if (dst.remaining() < 2)
+                                return CoderResult.OVERFLOW;
+                            dst.put((byte)(db >> 8));
+                            dst.put((byte)(db));
+                            mark++;
+                        } else {
+                            return CoderResult.unmappableForLength(1);
+                        }
+                    }
+                    mark++;
+                }
+                return CoderResult.UNDERFLOW;
+            } finally {
+                src.position(mark);
+            }
+        }
+
+        protected CoderResult encodeLoop(CharBuffer src, ByteBuffer dst) {
+            if (src.hasArray() && dst.hasArray())
+                return encodeArrayLoop(src, dst);
+            else
+                return encodeBufferLoop(src, dst);
+        }
+
+        protected CoderResult implFlush(ByteBuffer dst) {
+            if (leftoverBase > 0) {
+                if (dst.remaining() < 2)
+                    return CoderResult.OVERFLOW;
+                int db = encodeChar(leftoverBase);
+                dst.put((byte)(db >> 8));
+                dst.put((byte)(db));
+                leftoverBase = 0;
+            }
+            return CoderResult.UNDERFLOW;
+        }
+
+        protected void implReset() {
+            leftoverBase = 0;
+        }
+    }
+}
--- a/jdk/src/share/classes/sun/print/PSPathGraphics.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/sun/print/PSPathGraphics.java	Thu Jun 12 13:50:55 2008 -0700
@@ -344,8 +344,15 @@
         double devScaleX = devResX / DEFAULT_USER_RES;
         double devScaleY = devResY / DEFAULT_USER_RES;
 
-        if (scaleX > devScaleX) scaleX = devScaleX;
-        if (scaleY > devScaleY) scaleY = devScaleY;
+        /* check if rotated or sheared */
+        int transformType = fullTransform.getType();
+        boolean clampScale = ((transformType &
+                               (AffineTransform.TYPE_GENERAL_ROTATION |
+                                AffineTransform.TYPE_GENERAL_TRANSFORM)) != 0);
+        if (clampScale) {
+            if (scaleX > devScaleX) scaleX = devScaleX;
+            if (scaleY > devScaleY) scaleY = devScaleY;
+        }
 
         /* We do not need to draw anything if either scaling
          * factor is zero.
--- a/jdk/src/share/classes/sun/print/PSPrinterJob.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/sun/print/PSPrinterJob.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1536,16 +1536,16 @@
             execCmd = new String[ncomps];
             execCmd[n++] = "/usr/bin/lpr";
             if ((pFlags & PRINTER) != 0) {
-                execCmd[n++] = new String("-P" + printer);
+                execCmd[n++] = "-P" + printer;
             }
             if ((pFlags & BANNER) != 0) {
-                execCmd[n++] = new String("-J"  + banner);
+                execCmd[n++] = "-J"  + banner;
             }
             if ((pFlags & COPIES) != 0) {
-                execCmd[n++] = new String("-#" + new Integer(copies).toString());
+                execCmd[n++] = "-#" + copies;
             }
             if ((pFlags & NOSHEET) != 0) {
-                execCmd[n++] = new String("-h");
+                execCmd[n++] = "-h";
             }
             if ((pFlags & OPTIONS) != 0) {
                 execCmd[n++] = new String(options);
@@ -1556,19 +1556,19 @@
             execCmd[n++] = "/usr/bin/lp";
             execCmd[n++] = "-c";           // make a copy of the spool file
             if ((pFlags & PRINTER) != 0) {
-                execCmd[n++] = new String("-d" + printer);
+                execCmd[n++] = "-d" + printer;
             }
             if ((pFlags & BANNER) != 0) {
-                execCmd[n++] = new String("-t"  + banner);
+                execCmd[n++] = "-t"  + banner;
             }
             if ((pFlags & COPIES) != 0) {
-                execCmd[n++] = new String("-n" + new Integer(copies).toString());
+                execCmd[n++] = "-n" + copies;
             }
             if ((pFlags & NOSHEET) != 0) {
-                execCmd[n++] = new String("-o nobanner");
+                execCmd[n++] = "-o nobanner";
             }
             if ((pFlags & OPTIONS) != 0) {
-                execCmd[n++] = new String("-o" + options);
+                execCmd[n++] = "-o" + options;
             }
         }
         execCmd[n++] = spoolFile;
--- a/jdk/src/share/classes/sun/print/RasterPrinterJob.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/sun/print/RasterPrinterJob.java	Thu Jun 12 13:50:55 2008 -0700
@@ -245,7 +245,7 @@
     /**
      * The name of the job being printed.
      */
-    private String mDocName = new String("Java Printing");
+    private String mDocName = "Java Printing";
 
 
     /**
--- a/jdk/src/share/classes/sun/print/ServiceDialog.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/sun/print/ServiceDialog.java	Thu Jun 12 13:50:55 2008 -0700
@@ -2149,48 +2149,55 @@
                         }
                     }
                 }
-            }
-            rbPortrait.setEnabled(pSupported);
-            rbLandscape.setEnabled(lSupported);
-            rbRevPortrait.setEnabled(rpSupported);
-            rbRevLandscape.setEnabled(rlSupported);
-
-            OrientationRequested or = (OrientationRequested)asCurrent.get(orCategory);
-            if (or == null ||
-                !psCurrent.isAttributeValueSupported(or, docFlavor, asCurrent)) {
-
-                or = (OrientationRequested)psCurrent.getDefaultAttributeValue(orCategory);
-                // need to validate if default is not supported
-                if (!psCurrent.isAttributeValueSupported(or, docFlavor, asCurrent)) {
-                    or = null;
-                    Object values =
-                        psCurrent.getSupportedAttributeValues(orCategory,
-                                                              docFlavor,
-                                                              asCurrent);
-                    if (values instanceof OrientationRequested[]) {
-                        OrientationRequested[] orValues =
+
+                rbPortrait.setEnabled(pSupported);
+                rbLandscape.setEnabled(lSupported);
+                rbRevPortrait.setEnabled(rpSupported);
+                rbRevLandscape.setEnabled(rlSupported);
+
+                OrientationRequested or = (OrientationRequested)asCurrent.get(orCategory);
+                if (or == null ||
+                    !psCurrent.isAttributeValueSupported(or, docFlavor, asCurrent)) {
+
+                    or = (OrientationRequested)psCurrent.getDefaultAttributeValue(orCategory);
+                    // need to validate if default is not supported
+                    if (!psCurrent.isAttributeValueSupported(or, docFlavor, asCurrent)) {
+                        or = null;
+                        values =
+                            psCurrent.getSupportedAttributeValues(orCategory,
+                                                                  docFlavor,
+                                                                  asCurrent);
+                        if (values instanceof OrientationRequested[]) {
+                            OrientationRequested[] orValues =
                                                 (OrientationRequested[])values;
-                        if (orValues.length > 1) {
-                            // get the first in the list
-                            or = orValues[0];
+                            if (orValues.length > 1) {
+                                // get the first in the list
+                                or = orValues[0];
+                            }
                         }
                     }
-                }
-
-                if (or == null) {
-                    or = OrientationRequested.PORTRAIT;
+
+                    if (or == null) {
+                        or = OrientationRequested.PORTRAIT;
+                    }
+                    asCurrent.add(or);
                 }
-                asCurrent.add(or);
-            }
-
-            if (or == OrientationRequested.PORTRAIT) {
-                rbPortrait.setSelected(true);
-            } else if (or == OrientationRequested.LANDSCAPE) {
-                rbLandscape.setSelected(true);
-            } else if (or == OrientationRequested.REVERSE_PORTRAIT) {
-                rbRevPortrait.setSelected(true);
-            } else { // if (or == OrientationRequested.REVERSE_LANDSCAPE)
-                rbRevLandscape.setSelected(true);
+
+                if (or == OrientationRequested.PORTRAIT) {
+                    rbPortrait.setSelected(true);
+                } else if (or == OrientationRequested.LANDSCAPE) {
+                    rbLandscape.setSelected(true);
+                } else if (or == OrientationRequested.REVERSE_PORTRAIT) {
+                    rbRevPortrait.setSelected(true);
+                } else { // if (or == OrientationRequested.REVERSE_LANDSCAPE)
+                    rbRevLandscape.setSelected(true);
+                }
+                } else {
+                rbPortrait.setEnabled(pSupported);
+                rbLandscape.setEnabled(lSupported);
+                rbRevPortrait.setEnabled(rpSupported);
+                rbRevLandscape.setEnabled(rlSupported);
+
             }
         }
     }
--- a/jdk/src/share/classes/sun/security/pkcs11/SunPKCS11.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/sun/security/pkcs11/SunPKCS11.java	Thu Jun 12 13:50:55 2008 -0700
@@ -720,9 +720,13 @@
     }
 
     private boolean hasValidToken() {
+        /* Commented out to work with Solaris softtoken impl which
+           returns 0-value flags, e.g. both REMOVABLE_DEVICE and
+           TOKEN_PRESENT are false, when it can't access the token.
         if (removable == false) {
             return true;
         }
+        */
         Token token = this.token;
         return (token != null) && token.isValid();
     }
@@ -752,7 +756,7 @@
         if (slotInfo == null) {
             slotInfo = p11.C_GetSlotInfo(slotID);
         }
-        if ((slotInfo.flags & CKF_TOKEN_PRESENT) == 0) {
+        if (removable && (slotInfo.flags & CKF_TOKEN_PRESENT) == 0) {
             createPoller();
             return;
         }
--- a/jdk/src/share/classes/sun/swing/FilePane.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/sun/swing/FilePane.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1285,7 +1285,6 @@
 
     int lastIndex = -1;
     File editFile = null;
-    int editX = 20;
 
     private int getEditIndex() {
         return lastIndex;
@@ -1315,7 +1314,9 @@
      * @param index visual index of the file to be edited
      */
     private void editFileName(int index) {
-        File currentDirectory = getFileChooser().getCurrentDirectory();
+        JFileChooser chooser = getFileChooser();
+        File currentDirectory = chooser.getCurrentDirectory();
+
         if (readOnly || !canWrite(currentDirectory)) {
             return;
         }
@@ -1332,9 +1333,15 @@
                 editCell.setNextFocusableComponent(list);
             }
             list.add(editCell);
-            editCell.setText(getFileChooser().getName(editFile));
+            editCell.setText(chooser.getName(editFile));
             ComponentOrientation orientation = list.getComponentOrientation();
             editCell.setComponentOrientation(orientation);
+
+            Icon icon = chooser.getIcon(editFile);
+
+            // PENDING - grab padding (4) below from defaults table.
+            int editX = icon == null ? 20 : icon.getIconWidth() + 4;
+
             if (orientation.isLeftToRight()) {
                 editCell.setBounds(editX + r.x, r.y, r.width - editX, r.height);
             } else {
@@ -1458,11 +1465,6 @@
             Icon icon = getFileChooser().getIcon(file);
             if (icon != null) {
                 setIcon(icon);
-
-                if (isSelected) {
-                    // PENDING - grab padding (4) below from defaults table.
-                    editX = icon.getIconWidth() + 4;
-                }
             } else {
                 if (getFileChooser().getFileSystemView().isTraversable(file)) {
                     setText(fileName+File.separator);
--- a/jdk/src/share/classes/sun/swing/WindowsPlacesBar.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/sun/swing/WindowsPlacesBar.java	Thu Jun 12 13:50:55 2008 -0700
@@ -93,11 +93,18 @@
             if (index >= 0 && index < folderName.length() - 1) {
                 folderName = folderName.substring(index + 1);
             }
-            Icon icon = null;
+            Icon icon;
             if (files[i] instanceof ShellFolder) {
                 // We want a large icon, fsv only gives us a small.
                 ShellFolder sf = (ShellFolder)files[i];
-                icon = new ImageIcon(sf.getIcon(true), sf.getFolderType());
+                Image image = sf.getIcon(true);
+
+                if (image == null) {
+                    // Get default image
+                    image = (Image) ShellFolder.get("shell32LargeIcon 1");
+                }
+
+                icon = image == null ? null : new ImageIcon(image, sf.getFolderType());
             } else {
                 icon = fsv.getSystemIcon(files[i]);
             }
--- a/jdk/src/share/classes/sun/text/normalizer/VersionInfo.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/classes/sun/text/normalizer/VersionInfo.java	Thu Jun 12 13:50:55 2008 -0700
@@ -116,7 +116,7 @@
             throw new IllegalArgumentException(INVALID_VERSION_NUMBER_);
         }
         int     version = getInt(major, minor, milli, micro);
-        Integer key     = new Integer(version);
+        Integer key     = Integer.valueOf(version);
         Object  result  = MAP_.get(key);
         if (result == null) {
             result = new VersionInfo(version);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/classes/sun/tracing/MultiplexProviderFactory.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,144 @@
+/*
+ * Copyright 2008 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.tracing;
+
+import java.lang.reflect.Method;
+import java.lang.reflect.InvocationTargetException;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.logging.Logger;
+
+import com.sun.tracing.ProviderFactory;
+import com.sun.tracing.Provider;
+import com.sun.tracing.Probe;
+
+/**
+ * Factory class to create tracing Providers.
+ *
+ * This factory creates a "multiplex provider", which is a provider that
+ * encapsulates a list of providers and whose probes trigger a corresponding
+ * trigger in each of the encapsulated providers' probes.
+ *
+ * This is used when there are multiple tracing frameworks activated at once.
+ * A user-defined provider gets implementation for each of the activated
+ * frameworks and this multiplex framework is what is ultimately passed
+ * back to the user.  All probe triggers are multiplexed to each
+ * active framework.
+ *
+ * @since 1.7
+ */
+public class MultiplexProviderFactory extends ProviderFactory {
+
+    private Set<ProviderFactory> factories;
+
+    public MultiplexProviderFactory(Set<ProviderFactory> factories) {
+        this.factories = factories;
+    }
+
+    public <T extends Provider> T createProvider(Class<T> cls) {
+        HashSet<Provider> providers = new HashSet<Provider>();
+        for (ProviderFactory factory : factories) {
+            providers.add(factory.createProvider(cls));
+        }
+        MultiplexProvider provider = new MultiplexProvider(cls, providers);
+        try {
+            provider.init();
+        } catch (Exception e) {
+            // Probably a permission problem (can't get declared members)
+            Logger.getAnonymousLogger().warning(
+                "Could not initialize tracing provider: " + e.getMessage());
+        }
+        return provider.newProxyInstance();
+    }
+}
+
+class MultiplexProvider extends ProviderSkeleton {
+
+    private Set<Provider> providers;
+
+    protected ProbeSkeleton createProbe(Method m) {
+        return new MultiplexProbe(m, providers);
+    }
+
+    MultiplexProvider(Class<? extends Provider> type, Set<Provider> providers) {
+        super(type);
+        this.providers = providers;
+    }
+
+    public void dispose() {
+        for (Provider p : providers) {
+            p.dispose();
+        }
+        super.dispose();
+    }
+}
+
+class MultiplexProbe extends ProbeSkeleton {
+
+    private Set<Probe> probes;
+
+    MultiplexProbe(Method m, Set<Provider> providers) {
+        super(m.getParameterTypes());
+        probes = new HashSet<Probe>();
+        for (Provider p : providers) {
+            Probe probe = p.getProbe(m);
+            if (probe != null) {
+                probes.add(probe);
+            }
+        }
+    }
+
+    public boolean isEnabled() {
+        for (Probe p : probes) {
+            if (p.isEnabled()) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    public void uncheckedTrigger(Object[] args) {
+        for (Probe p : probes) {
+            try {
+                // try the fast path
+                ProbeSkeleton ps = (ProbeSkeleton)p;
+                ps.uncheckedTrigger(args);
+            } catch (ClassCastException e) {
+                // Probe.trigger takes an "Object ..." varargs parameter,
+                // so we can't call it directly.
+                try {
+                    Method m = Probe.class.getMethod(
+                        "trigger", Class.forName("[java.lang.Object"));
+                    m.invoke(p, args);
+                } catch (Exception e1) {
+                    assert false; // This shouldn't happen
+                }
+            }
+        }
+    }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/classes/sun/tracing/NullProviderFactory.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,91 @@
+/*
+ * Copyright 2008 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.tracing;
+
+import java.lang.reflect.Method;
+import java.util.logging.Logger;
+
+import com.sun.tracing.ProviderFactory;
+import com.sun.tracing.Provider;
+
+/**
+ * Factory class to create tracing Providers.
+ *
+ * This factory will create tracing instances that do nothing.
+ * It is used when no tracing is desired, but Provider instances still
+ * must be generated so that tracing calls in the application continue to
+ * run.
+ *
+ * @since 1.7
+ */
+public class NullProviderFactory extends ProviderFactory {
+
+    /**
+     * Creates and returns a Null provider.
+     *
+     * See comments at {@code ProviderSkeleton.createProvider()} for more
+     * details.
+     *
+     * @return a provider whose probe trigger are no-ops.
+     */
+    public <T extends Provider> T createProvider(Class<T> cls) {
+        NullProvider provider = new NullProvider(cls);
+        try {
+            provider.init();
+        } catch (Exception e) {
+            // Probably a permission problem (can't get declared members)
+            Logger.getAnonymousLogger().warning(
+                "Could not initialize tracing provider: " + e.getMessage());
+        }
+        return provider.newProxyInstance();
+    }
+}
+
+class NullProvider extends ProviderSkeleton {
+
+    NullProvider(Class<? extends Provider> type) {
+        super(type);
+    }
+
+    protected ProbeSkeleton createProbe(Method m) {
+        return new NullProbe(m.getParameterTypes());
+    }
+}
+
+class NullProbe extends ProbeSkeleton {
+
+    public NullProbe(Class<?>[] parameters) {
+        super(parameters);
+    }
+
+    public boolean isEnabled() {
+        return false;
+    }
+
+    public void uncheckedTrigger(Object[] args) {
+    }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/classes/sun/tracing/PrintStreamProviderFactory.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,127 @@
+/*
+ * Copyright 2008 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.tracing;
+
+import java.lang.reflect.Method;
+import java.io.PrintStream;
+import java.util.HashMap;
+import java.util.logging.Logger;
+
+import com.sun.tracing.ProviderFactory;
+import com.sun.tracing.Provider;
+import com.sun.tracing.ProviderName;
+import com.sun.tracing.Probe;
+import com.sun.tracing.ProbeName;
+
+/**
+ * Factory class to create tracing Providers.
+ *
+ * This factory will create tracing instances that print to a PrintStream
+ * when activated.
+ *
+ * @since 1.7
+ */
+public class PrintStreamProviderFactory extends ProviderFactory {
+
+    private PrintStream stream;
+
+    public PrintStreamProviderFactory(PrintStream stream) {
+        this.stream = stream;
+    }
+
+    public <T extends Provider> T createProvider(Class<T> cls) {
+        PrintStreamProvider provider = new PrintStreamProvider(cls, stream);
+        try {
+            provider.init();
+        } catch (Exception e) {
+            // Probably a permission problem (can't get declared members)
+            Logger.getAnonymousLogger().warning(
+                "Could not initialize tracing provider: " + e.getMessage());
+        }
+        return provider.newProxyInstance();
+    }
+}
+
+class PrintStreamProvider extends ProviderSkeleton {
+
+    private PrintStream stream;
+    private String providerName;
+
+    protected ProbeSkeleton createProbe(Method m) {
+        String probeName = getAnnotationString(m, ProbeName.class, m.getName());
+        return new PrintStreamProbe(this, probeName, m.getParameterTypes());
+    }
+
+    PrintStreamProvider(Class<? extends Provider> type, PrintStream stream) {
+        super(type);
+        this.stream = stream;
+        this.providerName = getProviderName();
+    }
+
+    PrintStream getStream() {
+        return stream;
+    }
+
+    String getName() {
+        return providerName;
+    }
+}
+
+class PrintStreamProbe extends ProbeSkeleton {
+
+    private PrintStreamProvider provider;
+    private String name;
+
+    PrintStreamProbe(PrintStreamProvider p, String name, Class<?>[] params) {
+        super(params);
+        this.provider = p;
+        this.name = name;
+    }
+
+    public boolean isEnabled() {
+        return true;
+    }
+
+    public void uncheckedTrigger(Object[] args) {
+        StringBuffer sb = new StringBuffer();
+        sb.append(provider.getName());
+        sb.append(".");
+        sb.append(name);
+        sb.append("(");
+        boolean first = true;
+        for (Object o : args) {
+            if (first == false) {
+                sb.append(",");
+            } else {
+                first = false;
+            }
+            sb.append(o.toString());
+        }
+        sb.append(")");
+        provider.getStream().println(sb.toString());
+    }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/classes/sun/tracing/ProbeSkeleton.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,90 @@
+/*
+ * Copyright 2008 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.tracing;
+
+import java.lang.reflect.Method;
+import java.lang.reflect.Field;
+import com.sun.tracing.Probe;
+
+/**
+ * Provides common code for implementation of {@code Probe} classes.
+ *
+ * @since 1.7
+ */
+public abstract class ProbeSkeleton implements Probe {
+
+    protected Class<?>[] parameters;
+
+    protected ProbeSkeleton(Class<?>[] parameters) {
+        this.parameters = parameters;
+    }
+
+    public abstract boolean isEnabled();  // framework-dependent
+
+    /**
+     * Triggers the probe with verified arguments.
+     *
+     * The caller of this method must have already determined that the
+     * arity and types of the arguments match what the probe was
+     * declared with.
+     */
+    public abstract void uncheckedTrigger(Object[] args); // framework-dependent
+
+    private static boolean isAssignable(Object o, Class<?> formal) {
+        if (o != null) {
+            if ( !formal.isInstance(o) ) {
+                if ( formal.isPrimitive() ) { // o might be a boxed primitive
+                    try {
+                        // Yuck.  There must be a better way of doing this
+                        Field f = o.getClass().getField("TYPE");
+                        return formal.isAssignableFrom((Class<?>)f.get(null));
+                    } catch (Exception e) {
+                        /* fall-through. */
+                    }
+                }
+                return false;
+            }
+        }
+        return true;
+    }
+
+    /**
+     * Performs a type-check of the parameters before triggering the probe.
+     */
+    public void trigger(Object ... args) {
+        if (args.length != parameters.length) {
+            throw new IllegalArgumentException("Wrong number of arguments");
+        } else {
+            for (int i = 0; i < parameters.length; ++i) {
+                if ( !isAssignable(args[i], parameters[i]) ) {
+                    throw new IllegalArgumentException(
+                            "Wrong type of argument at position " + i);
+                }
+            }
+            uncheckedTrigger(args);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/classes/sun/tracing/ProviderSkeleton.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,243 @@
+/*
+ * Copyright 2008 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.tracing;
+
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.Method;
+import java.lang.reflect.Proxy;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.AnnotatedElement;
+import java.lang.annotation.Annotation;
+import java.util.HashMap;
+
+import com.sun.tracing.Provider;
+import com.sun.tracing.Probe;
+import com.sun.tracing.ProviderName;
+
+/**
+ * Provides a common code for implementation of {@code Provider} classes.
+ *
+ * Each tracing subsystem needs to provide three classes, a factory
+ * (derived from {@code ProviderFactory}, a provider (a subclass of
+ * {@code Provider}, and a probe type (subclass of {@code ProbeSkeleton}).
+ *
+ * The factory object takes a user-defined interface and provides an
+ * implementation of it whose method calls will trigger probes in the
+ * tracing framework.
+ *
+ * The framework's provider class, and its instances, are not seen by the
+ * user at all -- they usually sit in the background and receive and dispatch
+ * the calls to the user's provider interface.  The {@code ProviderSkeleton}
+ * class provides almost all of the implementation needed by a framework
+ * provider.  Framework providers must only provide a constructor and
+ * disposal method, and implement the {@code createProbe} method to create
+ * an appropriate {@code ProbeSkeleton} subclass.
+ *
+ * The framework's probe class provides the implementation of the two
+ * probe methods, {@code isEnabled()} and {@code uncheckedTrigger()}.  Both are
+ * framework-dependent implementations.
+ *
+ * @since 1.7
+ */
+
+public abstract class ProviderSkeleton implements InvocationHandler, Provider {
+
+    protected boolean active; // set to false after dispose() is called
+    protected Class<? extends Provider> providerType; // user's interface
+    protected HashMap<Method, ProbeSkeleton> probes; // methods to probes
+
+
+    /**
+     * Creates a framework-specific probe subtype.
+     *
+     * This method is implemented by the framework's provider and returns
+     * framework-specific probes for a method.
+     *
+     * @param method A method in the user's interface
+     * @return a subclass of ProbeSkeleton for the particular framework.
+     */
+    protected abstract ProbeSkeleton createProbe(Method method);
+
+    /**
+     * Initializes the provider.
+     *
+     * @param type the user's interface
+     */
+    protected ProviderSkeleton(Class<? extends Provider> type) {
+        this.active = false; // in case of some error during initialization
+        this.providerType = type;
+        this.probes = new HashMap<Method,ProbeSkeleton>();
+    }
+
+    /**
+     * Post-constructor initialization routine.
+     *
+     * Subclass instances must be initialized before they can create probes.
+     * It is up to the factory implementations to call this after construction.
+     */
+    public void init() {
+        for (Method m : providerType.getDeclaredMethods()) {
+            if ( m.getReturnType() != Void.TYPE ) {
+                throw new IllegalArgumentException(
+                   "Return value of method is not void");
+            } else {
+                probes.put(m, createProbe(m));
+            }
+        }
+        this.active = true;
+    }
+
+    /**
+     * Magic routine which creates an implementation of the user's interface.
+     *
+     * This method creates the instance of the user's interface which is
+     * passed back to the user.  Every call upon that interface will be
+     * redirected to the {@code invoke()} method of this class (until
+     * overridden by the VM).
+     *
+     * @return an implementation of the user's interface
+     */
+    @SuppressWarnings("unchecked")
+    public <T extends Provider> T newProxyInstance() {
+        return (T)Proxy.newProxyInstance(providerType.getClassLoader(),
+               new Class<?>[] { providerType }, this);
+    }
+
+    /**
+     * Triggers a framework probe when a user interface method is called.
+     *
+     * This method dispatches a user interface method call to the appropriate
+     * probe associated with this framework.
+     *
+     * If the invoked method is not a user-defined member of the interface,
+     * then it is a member of {@code Provider} or {@code Object} and we
+     * invoke the method directly.
+     *
+     * @param proxy the instance whose method was invoked
+     * @param method the method that was called
+     * @param args the arguments passed in the call.
+     * @return always null, if the method is a user-defined probe
+     */
+    public Object invoke(Object proxy, Method method, Object[] args) {
+        if (method.getDeclaringClass() != providerType) {
+            try {
+                return method.invoke(this, args);
+            } catch (IllegalAccessException e) {
+                assert false;
+            } catch (InvocationTargetException e) {
+                assert false;
+            }
+        } else if (active) {
+            ProbeSkeleton p = probes.get(method);
+            if (p != null) {
+                // Skips argument check -- already done by javac
+                p.uncheckedTrigger(args);
+            }
+        }
+        return null;
+    }
+
+    /**
+     * Direct accessor for {@code Probe} objects.
+     *
+     * @param m the method corresponding to a probe
+     * @return the method associated probe object, or null
+     */
+    public Probe getProbe(Method m) {
+        return active ? probes.get(m) : null;
+    }
+
+    /**
+     * Default provider disposal method.
+     *
+     * This is overridden in subclasses as needed.
+     */
+    public void dispose() {
+        active = false;
+        probes.clear();
+    }
+
+    /**
+     * Gets the user-specified provider name for the user's interface.
+     *
+     * If the user's interface has a {@ProviderName} annotation, that value
+     * is used.  Otherwise we use the simple name of the user interface's class.
+     * @return the provider name
+     */
+    protected String getProviderName() {
+        return getAnnotationString(
+                providerType, ProviderName.class, providerType.getSimpleName());
+    }
+
+    /**
+     * Utility method for getting a string value from an annotation.
+     *
+     * Used for getting a string value from an annotation with a 'value' method.
+     *
+     * @param element the element that was annotated, either a class or method
+     * @param annotation the class of the annotation we're interested in
+     * @param defaultValue the value to return if the annotation doesn't
+     * exist, doesn't have a "value", or the value is empty.
+     */
+    protected static String getAnnotationString(
+            AnnotatedElement element, Class<? extends Annotation> annotation,
+            String defaultValue) {
+        String ret = (String)getAnnotationValue(
+                element, annotation, "value", defaultValue);
+        return ret.isEmpty() ? defaultValue : ret;
+    }
+
+    /**
+     * Utility method for calling an arbitrary method in an annotation.
+     *
+     * @param element the element that was annotated, either a class or method
+     * @param annotation the class of the annotation we're interested in
+     * @param methodName the name of the method in the annotation we wish
+     * to call.
+     * @param defaultValue the value to return if the annotation doesn't
+     * exist, or we couldn't invoke the method for some reason.
+     * @return the result of calling the annotation method, or the default.
+     */
+    protected static Object getAnnotationValue(
+            AnnotatedElement element, Class<? extends Annotation> annotation,
+            String methodName, Object defaultValue) {
+        Object ret = defaultValue;
+        try {
+            Method m = annotation.getMethod(methodName);
+            Annotation a = element.getAnnotation(annotation);
+            ret = m.invoke(a);
+        } catch (NoSuchMethodException e) {
+            assert false;
+        } catch (IllegalAccessException e) {
+            assert false;
+        } catch (InvocationTargetException e) {
+            assert false;
+        } catch (NullPointerException e) {
+            assert false;
+        }
+        return ret;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/classes/sun/tracing/dtrace/Activation.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,107 @@
+/*
+ * Copyright 2008 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.tracing.dtrace;
+
+import java.lang.ref.WeakReference;
+import java.lang.ref.ReferenceQueue;
+import java.security.Permission;
+import java.util.HashSet;
+
+class Activation {
+    private SystemResource resource;
+    private int referenceCount;
+
+    Activation(String moduleName, DTraceProvider[] providers) {
+        SecurityManager security = System.getSecurityManager();
+        if (security != null) {
+            Permission perm =
+                new RuntimePermission("com.sun.tracing.dtrace.createProvider");
+            security.checkPermission(perm);
+        }
+        referenceCount = providers.length;
+        for (DTraceProvider p : providers) {
+            p.setActivation(this);
+        }
+        resource = new SystemResource(
+            this, JVM.activate(moduleName, providers));
+    }
+
+    void disposeProvider(DTraceProvider p) {
+        if (--referenceCount == 0) {
+            resource.dispose();
+        }
+    }
+}
+
+/**
+ * The native resource part of an Activation.
+ *
+ * This holds the native handle.
+ *
+ * If the user loses a reference to a set of Providers without disposing them,
+ * and GC determines the Activation is unreachable, then the next
+ * activation or flush call will automatically dispose the unreachable objects
+ *
+ * The SystemResource instances are creating during activation, and
+ * unattached during disposal.  When created, they always have a
+ * strong reference to them via the {@code resources} static member.  Explicit
+ * {@code dispose} calls will unregister the native resource and remove
+ * references to the SystemResource object.  Absent an explicit dispose,
+ * when their associated Activation object becomes garbage, the SystemResource
+ * object will be enqueued on the reference queue and disposed at the
+ * next call to {@code flush}.
+ */
+class SystemResource extends WeakReference<Activation> {
+
+    private long handle;
+
+    private static ReferenceQueue<Activation> referenceQueue =
+        referenceQueue = new ReferenceQueue<Activation>();
+    static HashSet<SystemResource> resources = new HashSet<SystemResource>();
+
+    SystemResource(Activation activation, long handle) {
+        super(activation, referenceQueue);
+        this.handle = handle;
+        flush();
+        resources.add(this);
+    }
+
+    void dispose() {
+        JVM.dispose(handle);
+        resources.remove(this);
+        handle = 0;
+    }
+
+    static void flush() {
+        SystemResource resource = null;
+        while ((resource = (SystemResource)referenceQueue.poll()) != null) {
+            if (resource.handle != 0) {
+                resource.dispose();
+            }
+        }
+    }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/classes/sun/tracing/dtrace/DTraceProbe.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,82 @@
+/*
+ * Copyright 2008 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.tracing.dtrace;
+
+import java.lang.reflect.Method;
+import java.lang.reflect.InvocationTargetException;
+
+import sun.tracing.ProbeSkeleton;
+
+class DTraceProbe extends ProbeSkeleton {
+    private Object proxy;
+    private Method declared_method;
+    private Method implementing_method;
+
+    DTraceProbe(Object proxy, Method m) {
+        super(m.getParameterTypes());
+        this.proxy = proxy;
+        this.declared_method = m;
+        try {
+            // The JVM will override the proxy method's implementation with
+            // a version that will invoke the probe.
+            this.implementing_method =  proxy.getClass().getMethod(
+                m.getName(), m.getParameterTypes());
+        } catch (NoSuchMethodException e) {
+            throw new RuntimeException("Internal error, wrong proxy class");
+        }
+    }
+
+    public boolean isEnabled() {
+        return JVM.isEnabled(implementing_method);
+    }
+
+    public void uncheckedTrigger(Object[] args) {
+        try {
+            implementing_method.invoke(proxy, args);
+        } catch (IllegalAccessException e) {
+            assert false;
+        } catch (InvocationTargetException e) {
+            assert false;
+        }
+    }
+
+    String getProbeName() {
+        return DTraceProvider.getProbeName(declared_method);
+    }
+
+    String getFunctionName() {
+        return DTraceProvider.getFunctionName(declared_method);
+    }
+
+    Method getMethod() {
+        return implementing_method;
+    }
+
+    Class<?>[] getParameterTypes() {
+        return this.parameters;
+    }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/classes/sun/tracing/dtrace/DTraceProvider.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,230 @@
+/*
+ * Copyright 2008 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.tracing.dtrace;
+
+import java.lang.reflect.Method;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Modifier;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.annotation.Annotation;
+import java.util.HashMap;
+
+import sun.tracing.ProviderSkeleton;
+import sun.tracing.ProbeSkeleton;
+import com.sun.tracing.Provider;
+import com.sun.tracing.ProviderName;
+import com.sun.tracing.ProbeName;
+import com.sun.tracing.dtrace.Attributes;
+import com.sun.tracing.dtrace.ModuleName;
+import com.sun.tracing.dtrace.FunctionName;
+import com.sun.tracing.dtrace.StabilityLevel;
+import com.sun.tracing.dtrace.DependencyClass;
+
+import sun.misc.ProxyGenerator;
+
+class DTraceProvider extends ProviderSkeleton {
+
+    private Activation activation;
+    private Object proxy;
+
+    // For proxy generation
+    private final static Class[] constructorParams = { InvocationHandler.class };
+    private final String proxyClassNamePrefix = "$DTraceTracingProxy";
+
+    static final String DEFAULT_MODULE = "java_tracing";
+    static final String DEFAULT_FUNCTION = "unspecified";
+
+    private static long nextUniqueNumber = 0;
+    private static synchronized long getUniqueNumber() {
+        return nextUniqueNumber++;
+    }
+
+    protected ProbeSkeleton createProbe(Method m) {
+        return new DTraceProbe(proxy, m);
+    }
+
+    DTraceProvider(Class<? extends Provider> type) {
+        super(type);
+    }
+
+    void setProxy(Object p) {
+        proxy = p;
+    }
+
+    void setActivation(Activation a) {
+        this.activation = a;
+    }
+
+    public void dispose() {
+        if (activation != null) {
+            activation.disposeProvider(this);
+            activation = null;
+        }
+        super.dispose();
+    }
+
+    /**
+     * Magic routine which creates an implementation of the user's interface.
+     *
+     * This method uses the ProxyGenerator directly to bypass the
+     * java.lang.reflect.proxy cache so that we get a unique class each
+     * time it's called and can't accidently reuse a $Proxy class.
+     *
+     * @return an implementation of the user's interface
+     */
+    @SuppressWarnings("unchecked")
+    public <T extends Provider> T newProxyInstance() {
+        /*
+         * Choose a name for the proxy class to generate.
+         */
+        long num = getUniqueNumber();
+
+        String proxyPkg = "";
+        if (!Modifier.isPublic(providerType.getModifiers())) {
+            String name = providerType.getName();
+            int n = name.lastIndexOf('.');
+            proxyPkg = ((n == -1) ? "" : name.substring(0, n + 1));
+        }
+
+        String proxyName = proxyPkg + proxyClassNamePrefix + num;
+
+        /*
+         * Generate the specified proxy class.
+         */
+        Class<?> proxyClass = null;
+        byte[] proxyClassFile = ProxyGenerator.generateProxyClass(
+                proxyName, new Class<?>[] { providerType });
+        try {
+            proxyClass = JVM.defineClass(
+                providerType.getClassLoader(), proxyName,
+                proxyClassFile, 0, proxyClassFile.length);
+        } catch (ClassFormatError e) {
+            /*
+             * A ClassFormatError here means that (barring bugs in the
+             * proxy class generation code) there was some other
+             * invalid aspect of the arguments supplied to the proxy
+             * class creation (such as virtual machine limitations
+             * exceeded).
+             */
+            throw new IllegalArgumentException(e.toString());
+        }
+
+        /*
+         * Invoke its constructor with the designated invocation handler.
+         */
+        try {
+            Constructor cons = proxyClass.getConstructor(constructorParams);
+            return (T)cons.newInstance(new Object[] { this });
+        } catch (NoSuchMethodException e) {
+            throw new InternalError(e.toString());
+        } catch (IllegalAccessException e) {
+            throw new InternalError(e.toString());
+        } catch (InstantiationException e) {
+            throw new InternalError(e.toString());
+        } catch (InvocationTargetException e) {
+            throw new InternalError(e.toString());
+        }
+    }
+
+    // In the normal case, the proxy object's method implementations will call
+    // this method (it usually calls the ProviderSkeleton's version).  That
+    // method uses the passed 'method' object to lookup the associated
+    // 'ProbeSkeleton' and calls uncheckedTrigger() on that probe to cause the
+    // probe to fire.  DTrace probes are different in that the proxy class's
+    // methods are immediately overridden with native code to fire the probe
+    // directly.  So this method should never get invoked.  We also wire up the
+    // DTraceProbe.uncheckedTrigger() method to call the proxy method instead
+    // of doing the work itself.
+    public Object invoke(Object proxy, Method method, Object[] args) {
+        if (method.getDeclaringClass() != providerType) {
+            try {
+                return method.invoke(this, args);
+            } catch (IllegalAccessException e) {
+                assert false;
+            } catch (InvocationTargetException e) {
+                assert false;
+            }
+        } else if (active) {
+            assert false : "This method should have been overridden by the JVM";
+        }
+        return null;
+    }
+
+    public String getProviderName() {
+        return super.getProviderName();
+    }
+
+    String getModuleName() {
+        return getAnnotationString(
+            providerType, ModuleName.class, DEFAULT_MODULE);
+    }
+
+    static String getProbeName(Method method) {
+        return getAnnotationString(
+            method, ProbeName.class, method.getName());
+    }
+
+    static String getFunctionName(Method method) {
+        return getAnnotationString(
+            method, FunctionName.class, DEFAULT_FUNCTION);
+    }
+
+    DTraceProbe[] getProbes() {
+        return probes.values().toArray(new DTraceProbe[0]);
+    }
+
+    StabilityLevel getNameStabilityFor(Class<? extends Annotation> type) {
+        Attributes attrs = (Attributes)getAnnotationValue(
+            providerType, type, "value", null);
+        if (attrs == null) {
+            return StabilityLevel.PRIVATE;
+        } else {
+            return attrs.name();
+        }
+    }
+
+    StabilityLevel getDataStabilityFor(Class<? extends Annotation> type) {
+        Attributes attrs = (Attributes)getAnnotationValue(
+            providerType, type, "value", null);
+        if (attrs == null) {
+            return StabilityLevel.PRIVATE;
+        } else {
+            return attrs.data();
+        }
+    }
+
+    DependencyClass getDependencyClassFor(Class<? extends Annotation> type) {
+        Attributes attrs = (Attributes)getAnnotationValue(
+            providerType, type, "value", null);
+        if (attrs == null) {
+            return DependencyClass.UNKNOWN;
+        } else {
+            return attrs.dependency();
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/classes/sun/tracing/dtrace/DTraceProviderFactory.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,164 @@
+/*
+ * Copyright 2008 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.tracing.dtrace;
+
+import java.util.Map;
+import java.util.Set;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.logging.Logger;
+import java.security.Permission;
+
+import com.sun.tracing.ProviderFactory;
+import com.sun.tracing.Provider;
+
+/**
+ * Factory class to create JSDT Providers.
+ *
+ * This class contains methods to create an instance of a Provider
+ * interface which can be used to place tracepoints in an application.
+ * Method calls upon that instance trigger DTrace probes that
+ * are visible from DTrace scripts.   Such calls have no other
+ * side effects in the application.
+ * <p>
+ * The DTrace script mechanisms for listing and matching probes will not see
+ * nor match any probes until the provider they reside in is created by a
+ * call to {@code createProvider()} (or {@code createProviders()}).
+ * <p>
+ * Providers that are created should be disposed of when they are no longer
+ * needed to free up system resources, at which point the associated
+ * DTrace probes will no longer be available to DTrace.  One disposes a
+ * provider by calling
+ * {@link com.sun.tracing.Provider#dispose Provider.dispose()} on a
+ * created provider instance.
+ *
+ * @since 1.7
+ */
+public final class DTraceProviderFactory extends ProviderFactory {
+    /**
+     * Creates an instance of a provider which can then be used to trigger
+     * DTrace probes.
+     *
+     * The provider specification, provided as an argument, should only
+     * contain methods which have a 'void' return type and String or
+     * integer-based typed arguments (long, int, short, char, byte, or boolean).
+     *
+     * @param cls A user-defined interface which extends {@code Provider}.
+     * @return An instance of the interface which is used to trigger
+     * the DTrace probes.
+     * @throws java.lang.SecurityException if a security manager has been
+     * installed and it denies
+     * RuntimePermission("com.sun.dtrace.jsdt.createProvider")
+     * @throws java.lang.IllegalArgumentException if the interface contains
+     * methods that do not return null, or that contain arguments that are
+     * not String or integer types.
+     */
+    public <T extends Provider> T createProvider(Class<T> cls) {
+        DTraceProvider jsdt = new DTraceProvider(cls);
+        T proxy = jsdt.newProxyInstance();
+        jsdt.setProxy(proxy);
+        try {
+            jsdt.init();
+            new Activation(jsdt.getModuleName(), new DTraceProvider[] { jsdt });
+        } catch (Exception e) {
+            // Probably a permission problem (can't get declared members)
+            Logger.getAnonymousLogger().warning(
+                "Could not initialize tracing provider: " + e.getMessage());
+            jsdt.dispose();
+        }
+        return proxy;
+    }
+
+    /**
+     * Creates multiple providers at once.
+     *
+     * This method batches together a number of provider instantiations.
+     * It works similarly
+     * to {@code createProvider}, but operates on a set of providers instead
+     * of one at a time.  This method is in place since some DTrace
+     * implementations limit the number of times that providers can be
+     * created.  When numerous providers can be created at once with this
+     * method, it will count only as a single creation point to DTrace, thus
+     * it uses less system resources.
+     * <p>
+     * All of the probes in the providers will be visible to DTrace after
+     * this call and all will remain visible until all of the providers
+     * are disposed.
+     * <p>
+     * The {@code moduleName} parameter will override any {@code ModuleName}
+     * annotation associated with any of the providers in the set.
+     * All of the probes created by this call will share the same
+     * module name.
+     * <p>
+     * @param providers a set of provider specification interfaces
+     * @param moduleName the module name to associate with all probes
+     * @return A map which maps the provider interface specification to an
+     * implementing instance.
+     * @throws java.lang.SecurityException if a security manager has been
+     * installed and it denies
+     * RuntimePermission("com.sun.dtrace.jsdt.createProvider")
+     * @throws java.lang.IllegalArgumentException if any of the interface
+     * contains methods that do not return null, or that contain arguments
+     * that are not String or integer types.
+     */
+    public Map<Class<? extends Provider>,Provider> createProviders(
+            Set<Class<? extends Provider>> providers, String moduleName) {
+        HashMap<Class<? extends Provider>,Provider> map =
+            new HashMap<Class<? extends Provider>,Provider>();
+        HashSet<DTraceProvider> jsdts = new HashSet<DTraceProvider>();
+        for (Class<? extends Provider> cls : providers) {
+            DTraceProvider jsdt = new DTraceProvider(cls);
+            jsdts.add(jsdt);
+            map.put(cls, jsdt.newProxyInstance());
+        }
+        new Activation(moduleName, jsdts.toArray(new DTraceProvider[0]));
+        return map;
+    }
+
+    /**
+     * Used to check the status of DTrace support in the underlying JVM and
+     * operating system.
+     *
+     * This is an informative method only - the Java-level effects of
+     * creating providers and triggering probes will not change whether or
+     * not DTrace is supported by the underlying systems.
+     *
+     * @return true if DTrace is supported
+     */
+    public static boolean isSupported() {
+        try {
+            SecurityManager security = System.getSecurityManager();
+            if (security != null) {
+                Permission perm = new RuntimePermission(
+                        "com.sun.tracing.dtrace.createProvider");
+                security.checkPermission(perm);
+            }
+            return JVM.isSupported();
+        } catch (SecurityException e) {
+            return false;
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/classes/sun/tracing/dtrace/JVM.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,70 @@
+/*
+ * Copyright 2008 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.tracing.dtrace;
+
+import java.lang.reflect.Method;
+
+/**
+ * Container class for JVM interface native methods
+ *
+ * @since 1.7
+ */
+class JVM {
+
+    static {
+      java.security.AccessController.doPrivileged(
+              new sun.security.action.LoadLibraryAction("jsdt"));
+    }
+
+    static long activate(String moduleName, DTraceProvider[] providers) {
+        return activate0(moduleName, providers);
+    }
+
+    static void dispose(long handle) {
+        dispose0(handle);
+    }
+
+    static boolean isEnabled(Method m) {
+        return isEnabled0(m);
+    }
+
+    static boolean isSupported() {
+        return isSupported0();
+    }
+
+    static Class<?> defineClass(
+            ClassLoader loader, String name, byte[] b, int off, int len) {
+        return defineClass0(loader, name, b, off, len);
+    }
+
+    private static native long activate0(
+        String moduleName, DTraceProvider[] providers);
+    private static native void dispose0(long activation_handle);
+    private static native boolean isEnabled0(Method m);
+    private static native boolean isSupported0();
+    private static native Class<?> defineClass0(
+        ClassLoader loader, String name, byte[] b, int off, int len);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/classes/sun/tracing/package-info.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,57 @@
+/*
+ * Copyright 2008 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 package contains internal common code for implementing tracing
+ * frameworks, and defined a number of existing frameworks.
+ * <p>
+ * There are four tracing frameworks currently defined.  The "Null" and
+ * "Multiplex" frameworks are used internally as part of the implementation.
+ * The "DTrace" framework is the prime consumer framework at the moment,
+ * while the "PrintStream" framework is a functional, but hidden, framework
+ * which can be used to track probe firings.  All but the "DTrace" framework
+ * are defined in this package.  The "DTrace" framework is implemented in the
+ * {@code sun.tracing.dtrace} package.
+ * <p>
+ * This package also contains the {@code ProviderSkeleton} class, which
+ * holds most of the common code needed for implementing frameworks.
+ * <p>
+ * The "Null" framework is used when there are no other active frameworks.
+ * It accomplishes absolutely nothing and is merely a placeholder so that
+ * the application can call the tracing routines without error.
+ * <p>
+ * The "Multiplex" framework is used when there are multiple active frameworks.
+ * It is initialized with the framework factories and create providers and
+ * probes that dispatch to each active framework in turn.
+ * <p>
+ * The "PrintStream" framework is currently a debugging framework which
+ * dispatches trace calls to a user-defined PrintStream class, defined by
+ * a property.  It may some day be opened up to general use.
+ * <p>
+ * See the {@code sun.tracing.dtrace} and {@code com.sun.tracing.dtrace}
+ * packages for information on the "DTrace" framework.
+ */
+
+package sun.tracing;
--- a/jdk/src/share/javavm/export/jvm.h	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/javavm/export/jvm.h	Thu Jun 12 13:50:55 2008 -0700
@@ -591,6 +591,80 @@
 JNIEXPORT jboolean JNICALL
 JVM_SupportsCX8(void);
 
+/*
+ * com.sun.dtrace.jsdt support
+ */
+
+#define JVM_TRACING_DTRACE_VERSION 1
+
+/*
+ * Structure to pass one probe description to JVM
+ */
+typedef struct {
+    jmethodID method;
+    jstring   function;
+    jstring   name;
+    void*            reserved[4];     // for future use
+} JVM_DTraceProbe;
+
+/**
+ * Encapsulates the stability ratings for a DTrace provider field
+ */
+typedef struct {
+    jint nameStability;
+    jint dataStability;
+    jint dependencyClass;
+} JVM_DTraceInterfaceAttributes;
+
+/*
+ * Structure to pass one provider description to JVM
+ */
+typedef struct {
+    jstring                       name;
+    JVM_DTraceProbe*              probes;
+    jint                          probe_count;
+    JVM_DTraceInterfaceAttributes providerAttributes;
+    JVM_DTraceInterfaceAttributes moduleAttributes;
+    JVM_DTraceInterfaceAttributes functionAttributes;
+    JVM_DTraceInterfaceAttributes nameAttributes;
+    JVM_DTraceInterfaceAttributes argsAttributes;
+    void*                         reserved[4]; // for future use
+} JVM_DTraceProvider;
+
+/*
+ * Get the version number the JVM was built with
+ */
+JNIEXPORT jint JNICALL
+JVM_DTraceGetVersion(JNIEnv* env);
+
+/*
+ * Register new probe with given signature, return global handle
+ *
+ * The version passed in is the version that the library code was
+ * built with.
+ */
+JNIEXPORT jlong JNICALL
+JVM_DTraceActivate(JNIEnv* env, jint version, jstring module_name,
+  jint providers_count, JVM_DTraceProvider* providers);
+
+/*
+ * Check JSDT probe
+ */
+JNIEXPORT jboolean JNICALL
+JVM_DTraceIsProbeEnabled(JNIEnv* env, jmethodID method);
+
+/*
+ * Destroy custom DOF
+ */
+JNIEXPORT void JNICALL
+JVM_DTraceDispose(JNIEnv* env, jlong activation_handle);
+
+/*
+ * Check to see if DTrace is supported by OS
+ */
+JNIEXPORT jboolean JNICALL
+JVM_DTraceIsSupported(JNIEnv* env);
+
 /*************************************************************************
  PART 2: Support for the Verifier and Class File Format Checker
  ************************************************************************/
Binary file jdk/src/share/lib/cmm/lcms/GRAY.pf has changed
Binary file jdk/src/share/lib/cmm/lcms/LINEAR_RGB.pf has changed
Binary file jdk/src/share/lib/cmm/lcms/PYCC.pf has changed
--- a/jdk/src/share/native/java/net/net_util.c	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/native/java/net/net_util.c	Thu Jun 12 13:50:55 2008 -0700
@@ -112,6 +112,7 @@
             (*env)->SetIntField(env, iaObj, ia_familyID, IPv4);
         } else {
             static jclass inet6Cls = 0;
+            jint scope;
             if (inet6Cls == 0) {
                 jclass c = (*env)->FindClass(env, "java/net/Inet6Address");
                 CHECK_NULL_RETURN(c, NULL);
@@ -129,7 +130,10 @@
             (*env)->SetObjectField(env, iaObj, ia6_ipaddressID, ipaddress);
 
             (*env)->SetIntField(env, iaObj, ia_familyID, IPv6);
-            (*env)->SetIntField(env, iaObj, ia6_scopeidID, getScopeID(him));
+            scope = getScopeID(him);
+            (*env)->SetIntField(env, iaObj, ia6_scopeidID, scope);
+            if (scope > 0)
+                (*env)->SetBooleanField(env, iaObj, ia6_scopeidsetID, JNI_TRUE);
         }
         *port = ntohs(him6->sin6_port);
     } else
--- a/jdk/src/share/native/sun/font/freetypeScaler.c	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/native/sun/font/freetypeScaler.c	Thu Jun 12 13:50:55 2008 -0700
@@ -368,7 +368,7 @@
         //text can not be smaller than 1 point
         ptsz = 1.0;
     }
-    context->ptsz = (((int) ptsz) << 6);
+    context->ptsz = (int)(ptsz * 64);
     context->transform.xx =  FloatToFTFixed((float)dmat[0]/ptsz);
     context->transform.yx = -FloatToFTFixed((float)dmat[1]/ptsz);
     context->transform.xy = -FloatToFTFixed((float)dmat[2]/ptsz);
@@ -779,13 +779,24 @@
     }
 
     if (context->fmType == TEXT_FM_ON) {
-        glyphInfo->advanceX = FT26Dot6ToFloat(ftglyph->advance.x);
-        glyphInfo->advanceY = FT26Dot6ToFloat(-ftglyph->advance.y);
-    } else {
+        double advh = FTFixedToFloat(ftglyph->linearHoriAdvance);
         glyphInfo->advanceX =
-           (float) ROUND(FT26Dot6ToFloat(ftglyph->advance.x));
+            (float) (advh * FTFixedToFloat(context->transform.xx));
         glyphInfo->advanceY =
-           (float) ROUND(FT26Dot6ToFloat(-ftglyph->advance.y));
+            (float) (advh * FTFixedToFloat(context->transform.xy));
+    } else {
+        if (!ftglyph->advance.y) {
+            glyphInfo->advanceX =
+                (float) ROUND(FT26Dot6ToFloat(ftglyph->advance.x));
+            glyphInfo->advanceY = 0;
+        } else if (!ftglyph->advance.x) {
+            glyphInfo->advanceX = 0;
+            glyphInfo->advanceY =
+                (float) ROUND(FT26Dot6ToFloat(-ftglyph->advance.y));
+        } else {
+            glyphInfo->advanceX = FT26Dot6ToFloat(ftglyph->advance.x);
+            glyphInfo->advanceY = FT26Dot6ToFloat(-ftglyph->advance.y);
+        }
     }
 
     if (imageSize == 0) {
@@ -974,7 +985,7 @@
 
     FT_Outline_Translate(&ftglyph->outline,
                          FloatToF26Dot6(xpos),
-                         FloatToF26Dot6(ypos));
+                         -FloatToF26Dot6(ypos));
 
     return &ftglyph->outline;
 }
--- a/jdk/src/share/native/sun/java2d/loops/AlphaMacros.h	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/native/sun/java2d/loops/AlphaMacros.h	Thu Jun 12 13:50:55 2008 -0700
@@ -416,7 +416,8 @@
                             MultiplyAndStore ## STRATEGY ## Comps(res, \
                                                                   srcF, res);\
                         } \
-                        if (!(DST ## IsPremultiplied) && resA && \
+                        if (!(DST ## IsOpaque) && \
+                            !(DST ## IsPremultiplied) && resA && \
                             resA < MaxValFor ## STRATEGY) \
                         { \
                             DivideAndStore ## STRATEGY ## Comps(res, \
@@ -475,7 +476,8 @@
                         MultiplyAndStore ## STRATEGY ## Comps(res, \
                                                               srcF, res); \
                     } \
-                    if (!(DST ## IsPremultiplied) && resA && \
+                    if (!(DST ## IsOpaque) && \
+                        !(DST ## IsPremultiplied) && resA && \
                         resA < MaxValFor ## STRATEGY) \
                     { \
                         DivideAndStore ## STRATEGY ## Comps(res, res, resA); \
@@ -797,7 +799,8 @@
                             Store ## STRATEGY ## CompsUsingOp(res, +=, tmp); \
                         } \
                     } \
-                    if (!(TYPE ## IsPremultiplied) && resA && \
+                    if (!(TYPE ## IsOpaque) && \
+                        !(TYPE ## IsPremultiplied) && resA && \
                         resA < MaxValFor ## STRATEGY) \
                     { \
                         DivideAndStore ## STRATEGY ## Comps(res, res, resA); \
@@ -831,7 +834,8 @@
                 Postload ## STRATEGY ## From ## TYPE(pRas, DstPix, res); \
                 MultiplyAddAndStore ## STRATEGY ## Comps(res, \
                                                          dstF, res, src); \
-                if (!(TYPE ## IsPremultiplied) && resA && \
+                if (!(TYPE ## IsOpaque) && \
+                    !(TYPE ## IsPremultiplied) && resA && \
                     resA < MaxValFor ## STRATEGY) \
                 { \
                     DivideAndStore ## STRATEGY ## Comps(res, res, resA); \
--- a/jdk/src/share/native/sun/java2d/loops/ByteGray.h	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/native/sun/java2d/loops/ByteGray.h	Thu Jun 12 13:50:55 2008 -0700
@@ -36,6 +36,8 @@
 typedef jubyte  ByteGrayPixelType;
 typedef jubyte  ByteGrayDataType;
 
+#define ByteGrayIsOpaque 1
+
 #define ByteGrayPixelStride     1
 #define ByteGrayBitsPerPixel    8
 
--- a/jdk/src/share/native/sun/java2d/loops/FourByteAbgr.h	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/native/sun/java2d/loops/FourByteAbgr.h	Thu Jun 12 13:50:55 2008 -0700
@@ -34,6 +34,8 @@
 typedef jint    FourByteAbgrPixelType;
 typedef jubyte  FourByteAbgrDataType;
 
+#define FourByteAbgrIsOpaque 0
+
 #define FourByteAbgrPixelStride         4
 
 #define DeclareFourByteAbgrLoadVars(PREFIX)
--- a/jdk/src/share/native/sun/java2d/loops/FourByteAbgrPre.h	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/native/sun/java2d/loops/FourByteAbgrPre.h	Thu Jun 12 13:50:55 2008 -0700
@@ -34,6 +34,8 @@
 typedef jint    FourByteAbgrPrePixelType;
 typedef jubyte  FourByteAbgrPreDataType;
 
+#define FourByteAbgrPreIsOpaque 0
+
 #define FourByteAbgrPrePixelStride              4
 
 #define DeclareFourByteAbgrPreLoadVars(PREFIX)
--- a/jdk/src/share/native/sun/java2d/loops/Index12Gray.h	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/native/sun/java2d/loops/Index12Gray.h	Thu Jun 12 13:50:55 2008 -0700
@@ -37,6 +37,8 @@
 typedef jushort Index12GrayPixelType;
 typedef jushort Index12GrayDataType;
 
+#define Index12GrayIsOpaque 1
+
 #define Index12GrayPixelStride          2
 #define Index12GrayBitsPerPixel        12
 
--- a/jdk/src/share/native/sun/java2d/loops/Index8Gray.h	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/native/sun/java2d/loops/Index8Gray.h	Thu Jun 12 13:50:55 2008 -0700
@@ -37,6 +37,8 @@
 typedef jubyte  Index8GrayPixelType;
 typedef jubyte  Index8GrayDataType;
 
+#define Index8GrayIsOpaque 1
+
 #define Index8GrayPixelStride           1
 #define Index8GrayBitsPerPixel          8
 
--- a/jdk/src/share/native/sun/java2d/loops/IntArgb.h	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/native/sun/java2d/loops/IntArgb.h	Thu Jun 12 13:50:55 2008 -0700
@@ -38,6 +38,8 @@
 typedef jint    IntArgbPixelType;
 typedef jint    IntArgbDataType;
 
+#define IntArgbIsOpaque 0
+
 #define IntArgbPixelStride      4
 
 #define DeclareIntArgbLoadVars(PREFIX)
--- a/jdk/src/share/native/sun/java2d/loops/IntArgbBm.h	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/native/sun/java2d/loops/IntArgbBm.h	Thu Jun 12 13:50:55 2008 -0700
@@ -38,6 +38,8 @@
 typedef jint    IntArgbBmPixelType;
 typedef jint    IntArgbBmDataType;
 
+#define IntArgbBmIsOpaque 0
+
 #define IntArgbBmPixelStride    4
 
 #define DeclareIntArgbBmLoadVars(PREFIX)
--- a/jdk/src/share/native/sun/java2d/loops/IntArgbPre.h	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/native/sun/java2d/loops/IntArgbPre.h	Thu Jun 12 13:50:55 2008 -0700
@@ -36,6 +36,8 @@
 typedef jint    IntArgbPrePixelType;
 typedef jint    IntArgbPreDataType;
 
+#define IntArgbPreIsOpaque 0
+
 #define IntArgbPrePixelStride   4
 
 #define DeclareIntArgbPreLoadVars(PREFIX)
--- a/jdk/src/share/native/sun/java2d/loops/IntBgr.h	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/native/sun/java2d/loops/IntBgr.h	Thu Jun 12 13:50:55 2008 -0700
@@ -38,6 +38,8 @@
 typedef jint    IntBgrPixelType;
 typedef jint    IntBgrDataType;
 
+#define IntBgrIsOpaque 1
+
 #define IntBgrPixelStride       4
 
 #define DeclareIntBgrLoadVars(PREFIX)
--- a/jdk/src/share/native/sun/java2d/loops/IntRgb.h	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/native/sun/java2d/loops/IntRgb.h	Thu Jun 12 13:50:55 2008 -0700
@@ -38,6 +38,8 @@
 typedef jint    IntRgbPixelType;
 typedef jint    IntRgbDataType;
 
+#define IntRgbIsOpaque 1
+
 #define IntRgbPixelStride       4
 
 #define DeclareIntRgbLoadVars(PREFIX)
--- a/jdk/src/share/native/sun/java2d/loops/IntRgbx.h	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/native/sun/java2d/loops/IntRgbx.h	Thu Jun 12 13:50:55 2008 -0700
@@ -36,6 +36,8 @@
 typedef jint    IntRgbxPixelType;
 typedef jint    IntRgbxDataType;
 
+#define IntRgbxIsOpaque 1
+
 #define IntRgbxPixelStride      4
 
 #define DeclareIntRgbxLoadVars(PREFIX)
--- a/jdk/src/share/native/sun/java2d/loops/LoopMacros.h	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/native/sun/java2d/loops/LoopMacros.h	Thu Jun 12 13:50:55 2008 -0700
@@ -1610,8 +1610,12 @@
                        MUL8(SRC_PREFIX ## A, mixValSrc); \
                 MultMultAddAndStore4ByteArgbComps(dst, mixValDst, dst, \
                                                   mixValSrc, SRC_PREFIX); \
-                Store ## DST ## From4ByteArgb(DST_PTR, pix, PIXEL_INDEX, \
-                                              dstA, dstR, dstG, dstB); \
+                if (!(DST ## IsOpaque) && \
+                    !(DST ## IsPremultiplied) && dstA && dstA < 255) { \
+                    DivideAndStore4ByteArgbComps(dst, dst, dstA); \
+                } \
+                Store ## DST ## From4ByteArgbComps(DST_PTR, pix, \
+                                                   PIXEL_INDEX, dst); \
             } else { \
                 Store ## DST ## PixelData(DST_PTR, PIXEL_INDEX, \
                                           FG_PIXEL, PREFIX); \
@@ -1793,8 +1797,12 @@
                 dstR = gammaLut[dstR]; \
                 dstG = gammaLut[dstG]; \
                 dstB = gammaLut[dstB]; \
-                Store ## DST ## From4ByteArgb(DST_PTR, pix, PIXEL_INDEX, \
-                                              dstA, dstR, dstG, dstB); \
+                if (!(DST ## IsOpaque) && \
+                    !(DST ## IsPremultiplied) && dstA && dstA < 255) { \
+                    DivideAndStore4ByteArgbComps(dst, dst, dstA); \
+                } \
+                Store ## DST ## From4ByteArgbComps(DST_PTR, pix, \
+                                                   PIXEL_INDEX, dst); \
             } else { \
                 Store ## DST ## PixelData(DST_PTR, PIXEL_INDEX, \
                                           FG_PIXEL, PREFIX); \
--- a/jdk/src/share/native/sun/java2d/loops/ThreeByteBgr.h	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/native/sun/java2d/loops/ThreeByteBgr.h	Thu Jun 12 13:50:55 2008 -0700
@@ -34,6 +34,8 @@
 typedef jint    ThreeByteBgrPixelType;
 typedef jubyte  ThreeByteBgrDataType;
 
+#define ThreeByteBgrIsOpaque 1
+
 #define ThreeByteBgrPixelStride         3
 
 #define DeclareThreeByteBgrLoadVars(PREFIX)
--- a/jdk/src/share/native/sun/java2d/loops/Ushort4444Argb.h	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/native/sun/java2d/loops/Ushort4444Argb.h	Thu Jun 12 13:50:55 2008 -0700
@@ -34,6 +34,8 @@
 typedef jushort Ushort4444ArgbPixelType;
 typedef jushort Ushort4444ArgbDataType;
 
+#define Ushort4444ArgbIsOpaque 0
+
 #define Ushort4444ArgbPixelStride               2
 
 #define DeclareUshort4444ArgbLoadVars(PREFIX)
--- a/jdk/src/share/native/sun/java2d/loops/Ushort555Rgb.h	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/native/sun/java2d/loops/Ushort555Rgb.h	Thu Jun 12 13:50:55 2008 -0700
@@ -34,6 +34,8 @@
 typedef jushort Ushort555RgbPixelType;
 typedef jushort Ushort555RgbDataType;
 
+#define Ushort555RgbIsOpaque 1
+
 #define Ushort555RgbPixelStride         2
 
 #define DeclareUshort555RgbLoadVars(PREFIX)
--- a/jdk/src/share/native/sun/java2d/loops/Ushort555Rgbx.h	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/native/sun/java2d/loops/Ushort555Rgbx.h	Thu Jun 12 13:50:55 2008 -0700
@@ -34,6 +34,8 @@
 typedef jushort Ushort555RgbxPixelType;
 typedef jushort Ushort555RgbxDataType;
 
+#define Ushort555RgbxIsOpaque 1
+
 #define Ushort555RgbxPixelStride        2
 
 #define DeclareUshort555RgbxLoadVars(PREFIX)
--- a/jdk/src/share/native/sun/java2d/loops/Ushort565Rgb.h	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/native/sun/java2d/loops/Ushort565Rgb.h	Thu Jun 12 13:50:55 2008 -0700
@@ -34,6 +34,8 @@
 typedef jushort Ushort565RgbPixelType;
 typedef jushort Ushort565RgbDataType;
 
+#define Ushort565RgbIsOpaque 1
+
 #define Ushort565RgbPixelStride         2
 
 #define DeclareUshort565RgbLoadVars(PREFIX)
--- a/jdk/src/share/native/sun/java2d/loops/UshortGray.h	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/share/native/sun/java2d/loops/UshortGray.h	Thu Jun 12 13:50:55 2008 -0700
@@ -36,6 +36,8 @@
 typedef jushort UshortGrayPixelType;
 typedef jushort UshortGrayDataType;
 
+#define UshortGrayIsOpaque 1
+
 #define UshortGrayPixelStride           2
 #define UshortGrayBitsPerPixel         16
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/native/sun/tracing/dtrace/JVM.c	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,324 @@
+/*
+ * Copyright 2008 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.
+ */
+
+#include <stdlib.h>
+
+#include "jvm.h"
+#include "jni.h"
+#include "jni_util.h"
+
+#include "jvm_symbols.h"
+#include "sun_tracing_dtrace_JVM.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+static JvmSymbols* jvm_symbols = NULL;
+
+static void initialize() {
+    static int initialized = 0;
+    if (initialized == 0) {
+        jvm_symbols = lookupJvmSymbols();
+        initialized = 1;
+    }
+}
+
+/*
+ * Class:     sun_tracing_dtrace_JVM
+ * Method:    isSupported0
+ * Signature: ()I
+ */
+JNIEXPORT jboolean JNICALL Java_sun_tracing_dtrace_JVM_isSupported0(
+        JNIEnv* env, jclass cls) {
+    initialize();
+    if (jvm_symbols != NULL) {
+        return jvm_symbols->IsSupported(env) ? JNI_TRUE : JNI_FALSE;
+    } else {
+        return JNI_FALSE;
+    }
+}
+
+// Macros that cause an immediate return if we detect an exception
+#define CHECK if ((*env)->ExceptionOccurred(env)) { return; }
+#define CHECK_(x) if ((*env)->ExceptionOccurred(env)) { return x; }
+
+static void readProbeData (
+        JNIEnv* env, jobject probe, JVM_DTraceProbe* jvm_probe) {
+    jclass clazz;
+    jmethodID mid;
+    jobject method;
+
+    if (jvm_probe == NULL) {
+        return; // just in case
+    }
+
+    clazz = (*env)->GetObjectClass(env, probe); CHECK
+
+    mid = (*env)->GetMethodID(
+        env, clazz, "getFunctionName", "()Ljava/lang/String;"); CHECK
+    jvm_probe->function = (jstring)(*env)->CallObjectMethod(
+        env, probe, mid); CHECK
+
+    mid = (*env)->GetMethodID(
+        env, clazz, "getProbeName", "()Ljava/lang/String;"); CHECK
+    jvm_probe->name = (jstring)(*env)->CallObjectMethod(env, probe, mid); CHECK
+
+    mid = (*env)->GetMethodID(
+        env, clazz, "getMethod", "()Ljava/lang/reflect/Method;"); CHECK
+    method = (*env)->CallObjectMethod(env, probe, mid); CHECK
+    jvm_probe->method = (*env)->FromReflectedMethod(env, method); CHECK
+}
+
+static void readFieldInterfaceAttributes(
+        char* annotationName, JNIEnv* env, jobject provider,
+        JVM_DTraceInterfaceAttributes* attrs) {
+    jobject result;
+    jobject result_clazz;
+    jclass provider_clazz;
+    jclass annotation_clazz;
+    jmethodID get;
+    jmethodID enc;
+
+    provider_clazz = (*env)->GetObjectClass(env, provider); CHECK
+    annotation_clazz = (*env)->FindClass(env, annotationName); CHECK
+
+    get = (*env)->GetMethodID(env, provider_clazz, "getNameStabilityFor",
+        "(Ljava/lang/Class;)Lcom/sun/tracing/dtrace/StabilityLevel;"); CHECK
+    result = (*env)->CallObjectMethod(
+        env, provider, get, annotation_clazz); CHECK
+    result_clazz = (*env)->GetObjectClass(env, result); CHECK
+    enc = (*env)->GetMethodID(env, result_clazz, "getEncoding", "()I"); CHECK
+    attrs->nameStability = (*env)->CallIntMethod(env, result, enc); CHECK
+
+    get = (*env)->GetMethodID(env, provider_clazz, "getDataStabilityFor",
+        "(Ljava/lang/Class;)Lcom/sun/tracing/dtrace/StabilityLevel;"); CHECK
+    result = (*env)->CallObjectMethod(
+        env, provider, get, annotation_clazz); CHECK
+    result_clazz = (*env)->GetObjectClass(env, result); CHECK
+    enc = (*env)->GetMethodID(env, result_clazz, "getEncoding", "()I"); CHECK
+    attrs->dataStability = (*env)->CallIntMethod(env, result, enc); CHECK
+
+    get = (*env)->GetMethodID(env, provider_clazz, "getDependencyClassFor",
+        "(Ljava/lang/Class;)Lcom/sun/tracing/dtrace/DependencyClass;"); CHECK
+    result = (*env)->CallObjectMethod(
+        env, provider, get, annotation_clazz); CHECK
+    result_clazz = (*env)->GetObjectClass(env, result); CHECK
+    enc = (*env)->GetMethodID(env, result_clazz, "getEncoding", "()I"); CHECK
+    attrs->dependencyClass = (*env)->CallIntMethod(env, result, enc); CHECK
+}
+
+static void readInterfaceAttributes(
+        JNIEnv* env, jobject provider, JVM_DTraceProvider* jvm_provider) {
+    readFieldInterfaceAttributes("com/sun/tracing/dtrace/ProviderAttributes",
+        env, provider, &(jvm_provider->providerAttributes));
+    readFieldInterfaceAttributes("com/sun/tracing/dtrace/ModuleAttributes",
+        env, provider, &(jvm_provider->moduleAttributes));
+    readFieldInterfaceAttributes("com/sun/tracing/dtrace/FunctionAttributes",
+        env, provider, &(jvm_provider->functionAttributes));
+    readFieldInterfaceAttributes("com/sun/tracing/dtrace/NameAttributes",
+        env, provider, &(jvm_provider->nameAttributes));
+    readFieldInterfaceAttributes("com/sun/tracing/dtrace/ArgsAttributes",
+        env, provider, &(jvm_provider->argsAttributes));
+}
+
+static void readProviderData(
+        JNIEnv* env, jobject provider, JVM_DTraceProvider* jvm_provider) {
+    jmethodID mid;
+    jobjectArray probes;
+    jsize i;
+    jclass clazz = (*env)->GetObjectClass(env, provider); CHECK
+    mid = (*env)->GetMethodID(
+        env, clazz, "getProbes", "()[Lsun/tracing/dtrace/DTraceProbe;"); CHECK
+    probes = (jobjectArray)(*env)->CallObjectMethod(
+        env, provider, mid); CHECK
+
+    // Fill JVM structure, describing provider
+    jvm_provider->probe_count = (*env)->GetArrayLength(env, probes); CHECK
+    jvm_provider->probes = (JVM_DTraceProbe*)calloc(
+        jvm_provider->probe_count, sizeof(*jvm_provider->probes));
+    mid = (*env)->GetMethodID(
+        env, clazz, "getProviderName", "()Ljava/lang/String;"); CHECK
+    jvm_provider->name = (jstring)(*env)->CallObjectMethod(
+        env, provider, mid); CHECK
+
+    readInterfaceAttributes(env, provider, jvm_provider); CHECK
+
+    for (i = 0; i < jvm_provider->probe_count; ++i) {
+        jobject probe = (*env)->GetObjectArrayElement(env, probes, i); CHECK
+        readProbeData(env, probe, &jvm_provider->probes[i]); CHECK
+    }
+}
+
+/*
+ * Class:     sun_tracing_dtrace_JVM
+ * Method:    activate0
+ * Signature: ()J
+ */
+JNIEXPORT jlong JNICALL Java_sun_tracing_dtrace_JVM_activate0(
+        JNIEnv* env, jclass cls, jstring moduleName, jobjectArray providers) {
+    jlong handle = 0;
+    jsize num_providers;
+    jsize i;
+    JVM_DTraceProvider* jvm_providers;
+
+    initialize();
+
+    if (jvm_symbols == NULL) {
+      return 0;
+    }
+
+    num_providers = (*env)->GetArrayLength(env, providers); CHECK_(0L)
+
+    jvm_providers = (JVM_DTraceProvider*)calloc(
+        num_providers, sizeof(*jvm_providers));
+
+    for (i = 0; i < num_providers; ++i) {
+        JVM_DTraceProvider* p = &(jvm_providers[i]);
+        jobject provider = (*env)->GetObjectArrayElement(
+            env, providers, i);
+        readProviderData(env, provider, p);
+    }
+
+    handle = jvm_symbols->Activate(
+        env, JVM_TRACING_DTRACE_VERSION, moduleName,
+        num_providers, jvm_providers);
+
+    for (i = 0; i < num_providers; ++i) {
+        JVM_DTraceProvider* p = &(jvm_providers[i]);
+        free(p->probes);
+    }
+    free(jvm_providers);
+
+    return handle;
+}
+
+/*
+ * Class:     sun_tracing_dtrace_JVM
+ * Method:    dispose0
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL Java_sun_tracing_dtrace_JVM_dispose0(
+        JNIEnv* env, jclass cls, jlong handle) {
+    if (jvm_symbols != NULL && handle != 0) {
+        jvm_symbols->Dispose(env, handle);
+    }
+}
+
+/*
+ * Class:     sun_tracing_dtrace_JVM
+ * Method:    isEnabled0
+ * Signature: (Ljava/lang/String;Ljava/lang/String;)Z
+ */
+JNIEXPORT jboolean JNICALL Java_sun_tracing_dtrace_JVM_isEnabled0(
+        JNIEnv* env, jclass cls, jobject method) {
+    jmethodID mid;
+    if (jvm_symbols != NULL && method != NULL) {
+        mid = (*env)->FromReflectedMethod(env, method);
+        return jvm_symbols->IsProbeEnabled(env, mid);
+    }
+    return JNI_FALSE;
+}
+
+/*
+ * Class:     sun_tracing_dtrace_JVM
+ * Method:    defineClass0
+ * Signature: (Ljava/lang/ClassLoader;Ljava/lang/String;[BII)Ljava/lang/Class;
+ *
+ * The implementation of this native static method is a copy of that of
+ * the native instance method Java_java_lang_ClassLoader_defineClass0()
+ * with the implicit "this" parameter becoming the "loader" parameter.
+ *
+ * This code was cloned and modified from java_lang_reflect_Proxy
+ */
+JNIEXPORT jclass JNICALL
+Java_sun_tracing_dtrace_JVM_defineClass0(
+        JNIEnv *env, jclass ignore, jobject loader, jstring name, jbyteArray data,
+        jint offset, jint length)
+{
+    jbyte *body;
+    char *utfName;
+    jclass result = 0;
+    char buf[128];
+
+    if (data == NULL) {
+        return 0;
+    }
+
+    /* Work around 4153825. malloc crashes on Solaris when passed a
+     * negative size.
+     */
+    if (length < 0) {
+        return 0;
+    }
+
+    body = (jbyte *)malloc(length);
+
+    if (body == 0) {
+        return 0;
+    }
+
+    (*env)->GetByteArrayRegion(env, data, offset, length, body);
+
+    if ((*env)->ExceptionOccurred(env))
+        goto free_body;
+
+    if (name != NULL) {
+        int i;
+        int len = (*env)->GetStringUTFLength(env, name);
+        int unicode_len = (*env)->GetStringLength(env, name);
+        if (len >= sizeof(buf)) {
+            utfName = malloc(len + 1);
+            if (utfName == NULL) {
+                goto free_body;
+            }
+        } else {
+            utfName = buf;
+        }
+        (*env)->GetStringUTFRegion(env, name, 0, unicode_len, utfName);
+
+        // Convert '.' to '/' in the package name
+        for (i = 0; i < unicode_len; ++i) {
+            if (utfName[i] == '.') {
+                utfName[i] = '/';
+            }
+        }
+    } else {
+        utfName = NULL;
+    }
+
+    result = (*env)->DefineClass(env, utfName, loader, body, length);
+
+    if (utfName && utfName != buf)
+        free(utfName);
+
+ free_body:
+    free(body);
+    return result;
+}
+
+#ifdef __cplusplus
+}
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/native/sun/tracing/dtrace/jvm_symbols.h	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,50 @@
+/*
+ * Copyright 2008 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.
+ */
+
+#ifndef _JVM_SYMBOLS_H
+#define _JVM_SYMBOLS_H
+
+#include "jvm.h"
+
+typedef jint (JNICALL* GetVersion_t)(JNIEnv*);
+typedef jboolean (JNICALL *IsSupported_t)(JNIEnv*);
+typedef jlong (JNICALL* Activate_t)(
+    JNIEnv*, jint, jstring, jint, JVM_DTraceProvider*);
+typedef void (JNICALL *Dispose_t)(JNIEnv*, jlong);
+typedef jboolean (JNICALL *IsProbeEnabled_t)(JNIEnv*, jmethodID);
+
+typedef struct {
+    GetVersion_t     GetVersion;
+    IsSupported_t    IsSupported;
+    Activate_t       Activate;
+    Dispose_t        Dispose;
+    IsProbeEnabled_t IsProbeEnabled;
+} JvmSymbols;
+
+// Platform-dependent implementation.
+// Returns NULL if the symbols are not found
+extern JvmSymbols* lookupJvmSymbols();
+
+#endif // def _JVM_SYMBOLS_H
--- a/jdk/src/solaris/classes/sun/awt/X11/MWMConstants.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/solaris/classes/sun/awt/X11/MWMConstants.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2003 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2003-2008 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
@@ -26,7 +26,9 @@
 
 package sun.awt.X11;
 
-public interface MWMConstants {
+final public class MWMConstants {
+
+    private MWMConstants(){}
 
 /* bit definitions for MwmHints.flags */
     static final int MWM_HINTS_FUNCTIONS=       (1  << 0);
--- a/jdk/src/solaris/classes/sun/awt/X11/MotifDnDConstants.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/solaris/classes/sun/awt/X11/MotifDnDConstants.java	Thu Jun 12 13:50:55 2008 -0700
@@ -118,11 +118,11 @@
                                                             XA_MOTIF_DRAG_WINDOW,
                                                             0, 1,
                                                             false,
-                                                            XlibWrapper.AnyPropertyType);
+                                                            XConstants.AnyPropertyType);
         try {
             int status = wpg.execute(XToolkit.IgnoreBadWindowHandler);
 
-            if (status == XlibWrapper.Success &&
+            if (status == XConstants.Success &&
                 wpg.getData() != 0 &&
                 wpg.getActualType() == XAtom.XA_WINDOW &&
                 wpg.getActualFormat() == 32 &&
@@ -163,20 +163,20 @@
         XlibWrapper.XGrabServer(newDisplay);
 
         try {
-            XlibWrapper.XSetCloseDownMode(newDisplay, (int)XlibWrapper.RetainPermanent);
+            XlibWrapper.XSetCloseDownMode(newDisplay, (int)XConstants.RetainPermanent);
 
             XSetWindowAttributes xwa = new XSetWindowAttributes();
 
             try {
                 xwa.set_override_redirect(true);
-                xwa.set_event_mask(XlibWrapper.PropertyChangeMask);
+                xwa.set_event_mask(XConstants.PropertyChangeMask);
 
                 motifWindow = XlibWrapper.XCreateWindow(newDisplay, defaultRootWindow,
                                                         -10, -10, 1, 1, 0, 0,
-                                                        XlibWrapper.InputOnly,
-                                                        XlibWrapper.CopyFromParent,
-                                                        (XlibWrapper.CWOverrideRedirect |
-                                                         XlibWrapper.CWEventMask),
+                                                        XConstants.InputOnly,
+                                                        XConstants.CopyFromParent,
+                                                        (XConstants.CWOverrideRedirect |
+                                                         XConstants.CWEventMask),
                                                         xwa.pData);
 
                 if (motifWindow == 0) {
@@ -195,13 +195,13 @@
                                                 defaultRootWindow,
                                                 XA_MOTIF_DRAG_WINDOW.getAtom(),
                                                 XAtom.XA_WINDOW, 32,
-                                                XlibWrapper.PropModeReplace,
+                                                XConstants.PropModeReplace,
                                                 data, 1);
 
                     XToolkit.RESTORE_XERROR_HANDLER();
 
                     if (XToolkit.saved_error != null &&
-                        XToolkit.saved_error.get_error_code() != XlibWrapper.Success) {
+                        XToolkit.saved_error.get_error_code() != XConstants.Success) {
                         throw new XException("Cannot write motif drag window handle.");
                     }
 
@@ -282,7 +282,7 @@
         try {
             int status = wpg.execute(XToolkit.IgnoreBadWindowHandler);
 
-            if (status != XlibWrapper.Success
+            if (status != XConstants.Success
                 || wpg.getActualType() != XA_MOTIF_DRAG_TARGETS.getAtom()
                 || wpg.getData() == 0) {
 
@@ -399,13 +399,13 @@
                                         motifWindow,
                                         XA_MOTIF_DRAG_TARGETS.getAtom(),
                                         XA_MOTIF_DRAG_TARGETS.getAtom(), 8,
-                                        XlibWrapper.PropModeReplace,
+                                        XConstants.PropModeReplace,
                                         data, tableSize);
 
             XToolkit.RESTORE_XERROR_HANDLER();
 
             if (XToolkit.saved_error != null &&
-                XToolkit.saved_error.get_error_code() != XlibWrapper.Success) {
+                XToolkit.saved_error.get_error_code() != XConstants.Success) {
 
                 // Create a new motif window and retry.
                 motifWindow = createMotifWindow();
@@ -415,13 +415,13 @@
                                             motifWindow,
                                             XA_MOTIF_DRAG_TARGETS.getAtom(),
                                             XA_MOTIF_DRAG_TARGETS.getAtom(), 8,
-                                            XlibWrapper.PropModeReplace,
+                                            XConstants.PropModeReplace,
                                             data, tableSize);
 
                 XToolkit.RESTORE_XERROR_HANDLER();
 
                 if (XToolkit.saved_error != null &&
-                    XToolkit.saved_error.get_error_code() != XlibWrapper.Success) {
+                    XToolkit.saved_error.get_error_code() != XConstants.Success) {
                     throw new XException("Cannot write motif drag targets property.");
                 }
             }
@@ -538,12 +538,12 @@
             XlibWrapper.XChangeProperty(XToolkit.getDisplay(), window,
                                         XA_MOTIF_ATOM_0.getAtom(),
                                         XA_MOTIF_DRAG_INITIATOR_INFO.getAtom(),
-                                        8, XlibWrapper.PropModeReplace,
+                                        8, XConstants.PropModeReplace,
                                         structData, MOTIF_INITIATOR_INFO_SIZE);
             XToolkit.RESTORE_XERROR_HANDLER();
 
             if (XToolkit.saved_error != null &&
-                XToolkit.saved_error.get_error_code() != XlibWrapper.Success) {
+                XToolkit.saved_error.get_error_code() != XConstants.Success) {
                 throw new XException("Cannot write drag initiator info");
             }
         } finally {
@@ -571,12 +571,12 @@
             XlibWrapper.XChangeProperty(XToolkit.getDisplay(), window,
                                         XA_MOTIF_DRAG_RECEIVER_INFO.getAtom(),
                                         XA_MOTIF_DRAG_RECEIVER_INFO.getAtom(),
-                                        8, XlibWrapper.PropModeReplace,
+                                        8, XConstants.PropModeReplace,
                                         data, dataSize);
             XToolkit.RESTORE_XERROR_HANDLER();
 
             if (XToolkit.saved_error != null &&
-                XToolkit.saved_error.get_error_code() != XlibWrapper.Success) {
+                XToolkit.saved_error.get_error_code() != XConstants.Success) {
                 throw new XException("Cannot write Motif receiver info property");
             }
         } finally {
--- a/jdk/src/solaris/classes/sun/awt/X11/MotifDnDDragSourceProtocol.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/solaris/classes/sun/awt/X11/MotifDnDDragSourceProtocol.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2003-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2003-2008 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
@@ -44,7 +44,7 @@
 
     private static final Unsafe unsafe = XlibWrapper.unsafe;
 
-    private long targetEnterServerTime = XlibWrapper.CurrentTime;
+    private long targetEnterServerTime = XConstants.CurrentTime;
 
     protected MotifDnDDragSourceProtocol(XDragSourceProtocolListener listener) {
         super(listener);
@@ -86,7 +86,7 @@
 
         if (!MotifDnDConstants.MotifDnDSelection.setOwner(contents, formatMap,
                                                           formats,
-                                                          XlibWrapper.CurrentTime)) {
+                                                          XConstants.CurrentTime)) {
             cleanup();
             throw new InvalidDnDOperationException("Cannot acquire selection ownership");
         }
@@ -137,7 +137,7 @@
         long time = t;
 
         /* Discard events from the previous receiver. */
-        if (targetEnterServerTime == XlibWrapper.CurrentTime ||
+        if (targetEnterServerTime == XConstants.CurrentTime ||
             time < targetEnterServerTime) {
             return true;
         }
@@ -181,7 +181,7 @@
             new WindowPropertyGetter(window,
                                      MotifDnDConstants.XA_MOTIF_DRAG_RECEIVER_INFO,
                                      0, 0xFFFF, false,
-                                     XlibWrapper.AnyPropertyType);
+                                     XConstants.AnyPropertyType);
 
         try {
             int status = wpg.execute(XToolkit.IgnoreBadWindowHandler);
@@ -200,7 +200,7 @@
              *     CARD32       heap_offset B32;
              * } xmDragReceiverInfoStruct;
              */
-            if (status == (int)XlibWrapper.Success && wpg.getData() != 0 &&
+            if (status == (int)XConstants.Success && wpg.getData() != 0 &&
                 wpg.getActualType() != 0 && wpg.getActualFormat() == 8 &&
                 wpg.getNumberOfItems() >=
                 MotifDnDConstants.MOTIF_RECEIVER_INFO_SIZE) {
@@ -243,7 +243,7 @@
 
         XClientMessageEvent msg = new XClientMessageEvent();
         try {
-            msg.set_type(XlibWrapper.ClientMessage);
+            msg.set_type(XConstants.ClientMessage);
             msg.set_window(getTargetWindow());
             msg.set_format(8);
             msg.set_message_type(MotifDnDConstants.XA_MOTIF_DRAG_AND_DROP_MESSAGE.getAtom());
@@ -267,7 +267,7 @@
 
             XlibWrapper.XSendEvent(XToolkit.getDisplay(),
                                    getTargetProxyWindow(),
-                                   false, XlibWrapper.NoEventMask,
+                                   false, XConstants.NoEventMask,
                                    msg.pData);
         } finally {
             msg.dispose();
@@ -281,7 +281,7 @@
 
         XClientMessageEvent msg = new XClientMessageEvent();
         try {
-            msg.set_type(XlibWrapper.ClientMessage);
+            msg.set_type(XConstants.ClientMessage);
             msg.set_window(getTargetWindow());
             msg.set_format(8);
             msg.set_message_type(MotifDnDConstants.XA_MOTIF_DRAG_AND_DROP_MESSAGE.getAtom());
@@ -305,7 +305,7 @@
 
             XlibWrapper.XSendEvent(XToolkit.getDisplay(),
                                    getTargetProxyWindow(),
-                                   false, XlibWrapper.NoEventMask,
+                                   false, XConstants.NoEventMask,
                                    msg.pData);
         } finally {
             msg.dispose();
@@ -318,7 +318,7 @@
 
         XClientMessageEvent msg = new XClientMessageEvent();
         try {
-            msg.set_type(XlibWrapper.ClientMessage);
+            msg.set_type(XConstants.ClientMessage);
             msg.set_window(getTargetWindow());
             msg.set_format(8);
             msg.set_message_type(MotifDnDConstants.XA_MOTIF_DRAG_AND_DROP_MESSAGE.getAtom());
@@ -336,7 +336,7 @@
 
             XlibWrapper.XSendEvent(XToolkit.getDisplay(),
                                    getTargetProxyWindow(),
-                                   false, XlibWrapper.NoEventMask,
+                                   false, XConstants.NoEventMask,
                                    msg.pData);
         } finally {
             msg.dispose();
@@ -356,7 +356,7 @@
 
         XClientMessageEvent msg = new XClientMessageEvent();
         try {
-            msg.set_type(XlibWrapper.ClientMessage);
+            msg.set_type(XConstants.ClientMessage);
             msg.set_window(getTargetWindow());
             msg.set_format(8);
             msg.set_message_type(MotifDnDConstants.XA_MOTIF_DRAG_AND_DROP_MESSAGE.getAtom());
@@ -382,7 +382,7 @@
 
             XlibWrapper.XSendEvent(XToolkit.getDisplay(),
                                    getTargetProxyWindow(),
-                                   false, XlibWrapper.NoEventMask,
+                                   false, XConstants.NoEventMask,
                                    msg.pData);
         } finally {
             msg.dispose();
@@ -397,12 +397,12 @@
 
     public void cleanupTargetInfo() {
         super.cleanupTargetInfo();
-        targetEnterServerTime = XlibWrapper.CurrentTime;
+        targetEnterServerTime = XConstants.CurrentTime;
     }
 
     public void dispatchEvent(XEvent ev) {
         switch (ev.get_type()) {
-        case XlibWrapper.SelectionRequest:
+        case XConstants.SelectionRequest:
             XSelectionRequestEvent xsre = ev.get_xselectionrequest();
             long atom = xsre.get_selection();
 
--- a/jdk/src/solaris/classes/sun/awt/X11/MotifDnDDropTargetProtocol.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/solaris/classes/sun/awt/X11/MotifDnDDropTargetProtocol.java	Thu Jun 12 13:50:55 2008 -0700
@@ -99,7 +99,7 @@
             new WindowPropertyGetter(embedder,
                                      MotifDnDConstants.XA_MOTIF_DRAG_RECEIVER_INFO,
                                      0, 0xFFFF, false,
-                                     XlibWrapper.AnyPropertyType);
+                                     XConstants.AnyPropertyType);
 
         try {
             status = wpg.execute(XToolkit.IgnoreBadWindowHandler);
@@ -118,7 +118,7 @@
              *     CARD32       heap_offset B32;
              * } xmDragReceiverInfoStruct;
              */
-            if (status == (int)XlibWrapper.Success && wpg.getData() != 0 &&
+            if (status == (int)XConstants.Success && wpg.getData() != 0 &&
                 wpg.getActualType() != 0 && wpg.getActualFormat() == 8 &&
                 wpg.getNumberOfItems() >=
                 MotifDnDConstants.MOTIF_RECEIVER_INFO_SIZE) {
@@ -166,12 +166,12 @@
             XlibWrapper.XChangeProperty(XToolkit.getDisplay(), embedder,
                                         MotifDnDConstants.XA_MOTIF_DRAG_RECEIVER_INFO.getAtom(),
                                         MotifDnDConstants.XA_MOTIF_DRAG_RECEIVER_INFO.getAtom(),
-                                        8, XlibWrapper.PropModeReplace,
+                                        8, XConstants.PropModeReplace,
                                         data, dataSize);
             XToolkit.RESTORE_XERROR_HANDLER();
 
             if (XToolkit.saved_error != null &&
-                XToolkit.saved_error.get_error_code() != XlibWrapper.Success) {
+                XToolkit.saved_error.get_error_code() != XConstants.Success) {
                 throw new XException("Cannot write Motif receiver info property");
             }
         } finally {
@@ -201,7 +201,7 @@
                 new WindowPropertyGetter(embedder,
                                          MotifDnDConstants.XA_MOTIF_DRAG_RECEIVER_INFO,
                                          0, 0xFFFF, false,
-                                         XlibWrapper.AnyPropertyType);
+                                         XConstants.AnyPropertyType);
 
             try {
                 status = wpg.execute(XToolkit.IgnoreBadWindowHandler);
@@ -220,7 +220,7 @@
                  *     CARD32   heap_offset B32;
                  * } xmDragReceiverInfoStruct;
                  */
-                if (status == (int)XlibWrapper.Success && wpg.getData() != 0 &&
+                if (status == (int)XConstants.Success && wpg.getData() != 0 &&
                     wpg.getActualType() != 0 && wpg.getActualFormat() == 8 &&
                     wpg.getNumberOfItems() >=
                     MotifDnDConstants.MOTIF_RECEIVER_INFO_SIZE) {
@@ -240,12 +240,12 @@
                     XlibWrapper.XChangeProperty(XToolkit.getDisplay(), embedder,
                                                 MotifDnDConstants.XA_MOTIF_DRAG_RECEIVER_INFO.getAtom(),
                                                 MotifDnDConstants.XA_MOTIF_DRAG_RECEIVER_INFO.getAtom(),
-                                                8, XlibWrapper.PropModeReplace,
+                                                8, XConstants.PropModeReplace,
                                                 data, dataSize);
                     XToolkit.RESTORE_XERROR_HANDLER();
 
                     if (XToolkit.saved_error != null &&
-                        XToolkit.saved_error.get_error_code() != XlibWrapper.Success) {
+                        XToolkit.saved_error.get_error_code() != XConstants.Success) {
                         throw new XException("Cannot write Motif receiver info property");
                     }
                 }
@@ -273,7 +273,7 @@
             new WindowPropertyGetter(embedded,
                                      MotifDnDConstants.XA_MOTIF_DRAG_RECEIVER_INFO,
                                      0, 0xFFFF, false,
-                                     XlibWrapper.AnyPropertyType);
+                                     XConstants.AnyPropertyType);
 
         try {
             status = wpg.execute(XToolkit.IgnoreBadWindowHandler);
@@ -292,7 +292,7 @@
              *     CARD32       heap_offset B32;
              * } xmDragReceiverInfoStruct;
              */
-            if (status == (int)XlibWrapper.Success && wpg.getData() != 0 &&
+            if (status == (int)XConstants.Success && wpg.getData() != 0 &&
                 wpg.getActualType() != 0 && wpg.getActualFormat() == 8 &&
                 wpg.getNumberOfItems() >=
                 MotifDnDConstants.MOTIF_RECEIVER_INFO_SIZE) {
@@ -322,12 +322,12 @@
             new WindowPropertyGetter(window,
                                      MotifDnDConstants.XA_MOTIF_DRAG_RECEIVER_INFO,
                                      0, 0xFFFF, false,
-                                     XlibWrapper.AnyPropertyType);
+                                     XConstants.AnyPropertyType);
 
         try {
             int status = wpg.execute(XToolkit.IgnoreBadWindowHandler);
 
-            if (status == (int)XlibWrapper.Success && wpg.getData() != 0 &&
+            if (status == (int)XConstants.Success && wpg.getData() != 0 &&
                 wpg.getActualType() != 0 && wpg.getActualFormat() == 8 &&
                 wpg.getNumberOfItems() >=
                 MotifDnDConstants.MOTIF_RECEIVER_INFO_SIZE) {
@@ -377,7 +377,7 @@
             try {
                 int status = wpg.execute(XToolkit.IgnoreBadWindowHandler);
 
-                if (status == XlibWrapper.Success && wpg.getData() != 0 &&
+                if (status == XConstants.Success && wpg.getData() != 0 &&
                     wpg.getActualType() ==
                     MotifDnDConstants.XA_MOTIF_DRAG_INITIATOR_INFO.getAtom() &&
                     wpg.getActualFormat() == 8 &&
@@ -420,7 +420,7 @@
 
             if (status == 0 ||
                 (XToolkit.saved_error != null &&
-                 XToolkit.saved_error.get_error_code() != XlibWrapper.Success)) {
+                 XToolkit.saved_error.get_error_code() != XConstants.Success)) {
                 throw new XException("XGetWindowAttributes failed");
             }
 
@@ -432,12 +432,12 @@
         XToolkit.WITH_XERROR_HANDLER(XToolkit.IgnoreBadWindowHandler);
         XlibWrapper.XSelectInput(XToolkit.getDisplay(), source_win,
                                  source_win_mask |
-                                 XlibWrapper.StructureNotifyMask);
+                                 XConstants.StructureNotifyMask);
 
         XToolkit.RESTORE_XERROR_HANDLER();
 
         if (XToolkit.saved_error != null &&
-            XToolkit.saved_error.get_error_code() != XlibWrapper.Success) {
+            XToolkit.saved_error.get_error_code() != XConstants.Success) {
             throw new XException("XSelectInput failed");
         }
 
@@ -590,7 +590,7 @@
             XClientMessageEvent dummy = new XClientMessageEvent();
 
             try {
-                dummy.set_type(XlibWrapper.ClientMessage);
+                dummy.set_type(XConstants.ClientMessage);
                 dummy.set_window(xclient.get_window());
                 dummy.set_format(32);
                 dummy.set_message_type(0);
@@ -600,7 +600,7 @@
                 dummy.set_data(3, 0);
                 dummy.set_data(4, 0);
                 XlibWrapper.XSendEvent(XToolkit.getDisplay(),
-                                       proxy, false, XlibWrapper.NoEventMask,
+                                       proxy, false, XConstants.NoEventMask,
                                        dummy.pData);
             } finally {
                 dummy.dispose();
@@ -821,7 +821,7 @@
         XClientMessageEvent msg = new XClientMessageEvent();
 
         try {
-            msg.set_type(XlibWrapper.ClientMessage);
+            msg.set_type(XConstants.ClientMessage);
             msg.set_window(MotifDnDConstants.Swapper.getInt(data + 12, eventByteOrder));
             msg.set_format(8);
             msg.set_message_type(MotifDnDConstants.XA_MOTIF_DRAG_AND_DROP_MESSAGE.getAtom());
@@ -878,7 +878,7 @@
             try {
                 XlibWrapper.XSendEvent(XToolkit.getDisplay(),
                                        msg.get_window(),
-                                       false, XlibWrapper.NoEventMask,
+                                       false, XConstants.NoEventMask,
                                        msg.pData);
             } finally {
                 XToolkit.awtUnlock();
--- a/jdk/src/solaris/classes/sun/awt/X11/WindowPropertyGetter.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/solaris/classes/sun/awt/X11/WindowPropertyGetter.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2003-2005 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2003-2008 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
@@ -89,7 +89,7 @@
 
             if (isCachingSupported() && isCached()) {
                 readFromCache();
-                return XlibWrapper.Success;
+                return XConstants.Success;
             }
 
             // Fix for performance problem - IgnodeBadWindowHandler is
@@ -106,7 +106,7 @@
                                                         offset, length, (auto_delete?1:0), type,
                                                         actual_type, actual_format, nitems_ptr,
                                                         bytes_after, data);
-            if (isCachingSupported() &&  status == XlibWrapper.Success && getData() != 0 && isCacheableProperty(property)) {
+            if (isCachingSupported() &&  status == XConstants.Success && getData() != 0 && isCacheableProperty(property)) {
                 // Property has some data, we cache them
                 cacheProperty();
             }
--- a/jdk/src/solaris/classes/sun/awt/X11/XAWTXSettings.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/solaris/classes/sun/awt/X11/XAWTXSettings.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2003-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2003-2008 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
@@ -128,7 +128,7 @@
             try {
                 int status = getter.execute(XToolkit.IgnoreBadWindowHandler);
 
-                if (status != XlibWrapper.Success || getter.getData() == 0) {
+                if (status != XConstants.Success || getter.getData() == 0) {
                     if (log.isLoggable(Level.FINE)) log.fine("OH OH : getter failed  status = " + status );
                     settings = null;
                 }
--- a/jdk/src/solaris/classes/sun/awt/X11/XAtom.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/solaris/classes/sun/awt/X11/XAtom.java	Thu Jun 12 13:50:55 2008 -0700
@@ -370,7 +370,7 @@
                                      false, property_type);
         try {
             int status = getter.execute();
-            if (status != XlibWrapper.Success || getter.getData() == 0) {
+            if (status != XConstants.Success || getter.getData() == 0) {
                 return 0;
             }
             if (getter.getActualType() != property_type || getter.getActualFormat() != 32) {
@@ -401,7 +401,7 @@
         try {
             Native.putCard32(XlibWrapper.larg1, value);
             XlibWrapper.XChangeProperty(XToolkit.getDisplay(), window,
-                atom, XA_CARDINAL, 32, XlibWrapper.PropModeReplace,
+                atom, XA_CARDINAL, 32, XConstants.PropModeReplace,
                 XlibWrapper.larg1, 1);
         } finally {
             XToolkit.awtUnlock();
@@ -432,7 +432,7 @@
                                      false, this);
         try {
             int status = getter.execute();
-            if (status != XlibWrapper.Success || getter.getData() == 0) {
+            if (status != XConstants.Success || getter.getData() == 0) {
                 return false;
             }
             if (getter.getActualType() != atom
@@ -466,7 +466,7 @@
                                      false, type);
         try {
             int status = getter.execute();
-            if (status != XlibWrapper.Success || getter.getData() == 0) {
+            if (status != XConstants.Success || getter.getData() == 0) {
                 return false;
             }
             if (getter.getActualType() != type
@@ -497,7 +497,7 @@
         XToolkit.awtLock();
         try {
             XlibWrapper.XChangeProperty(XToolkit.getDisplay(), window,
-                atom, atom, 32, XlibWrapper.PropModeReplace,
+                atom, atom, 32, XConstants.PropModeReplace,
                 data_ptr, length);
         } finally {
             XToolkit.awtUnlock();
@@ -518,7 +518,7 @@
         XToolkit.awtLock();
         try {
             XlibWrapper.XChangeProperty(XToolkit.getDisplay(), window,
-                atom, type, 32, XlibWrapper.PropModeReplace,
+                atom, type, 32, XConstants.PropModeReplace,
                 data_ptr, length);
         } finally {
             XToolkit.awtUnlock();
@@ -539,7 +539,7 @@
         XToolkit.awtLock();
         try {
             XlibWrapper.XChangeProperty(XToolkit.getDisplay(), window,
-                atom, type, 8, XlibWrapper.PropModeReplace,
+                atom, type, 8, XConstants.PropModeReplace,
                 data_ptr, length);
         } finally {
             XToolkit.awtUnlock();
@@ -602,7 +602,7 @@
                                      false, property_type);
         try {
             int status = getter.execute();
-            if (status != XlibWrapper.Success || getter.getData() == 0) {
+            if (status != XConstants.Success || getter.getData() == 0) {
                 return null;
             }
             if (getter.getActualType() != property_type || getter.getActualFormat() != 8) {
@@ -674,7 +674,7 @@
                                      false, XA_ATOM);
         try {
             int status = getter.execute();
-            if (status != XlibWrapper.Success || getter.getData() == 0) {
+            if (status != XConstants.Success || getter.getData() == 0) {
                 return emptyList;
             }
             if (getter.getActualType() != XA_ATOM || getter.getActualFormat() != 32) {
@@ -797,7 +797,7 @@
         try {
             Native.putWindow(XlibWrapper.larg1, window_value);
             XlibWrapper.XChangeProperty(XToolkit.getDisplay(), window,
-                                    atom, XA_WINDOW, 32, XlibWrapper.PropModeReplace,
+                                    atom, XA_WINDOW, 32, XConstants.PropModeReplace,
                                     XlibWrapper.larg1, 1);
         } finally {
             XToolkit.awtUnlock();
@@ -821,7 +821,7 @@
                                      false, XA_WINDOW);
         try {
             int status = getter.execute();
-            if (status != XlibWrapper.Success || getter.getData() == 0) {
+            if (status != XConstants.Success || getter.getData() == 0) {
                 return 0;
             }
             if (getter.getActualType() != XA_WINDOW || getter.getActualFormat() != 32) {
--- a/jdk/src/solaris/classes/sun/awt/X11/XBaseMenuWindow.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/solaris/classes/sun/awt/X11/XBaseMenuWindow.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2008 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
@@ -885,14 +885,14 @@
      */
      protected boolean isEventDisabled(XEvent e) {
         switch (e.get_type()) {
-          case XlibWrapper.Expose :
-          case XlibWrapper.GraphicsExpose :
-          case XlibWrapper.ButtonPress:
-          case XlibWrapper.ButtonRelease:
-          case XlibWrapper.MotionNotify:
-          case XlibWrapper.KeyPress:
-          case XlibWrapper.KeyRelease:
-          case XlibWrapper.DestroyNotify:
+          case XConstants.Expose :
+          case XConstants.GraphicsExpose :
+          case XConstants.ButtonPress:
+          case XConstants.ButtonRelease:
+          case XConstants.MotionNotify:
+          case XConstants.KeyPress:
+          case XConstants.KeyRelease:
+          case XConstants.DestroyNotify:
               return super.isEventDisabled(e);
           default:
               return true;
--- a/jdk/src/solaris/classes/sun/awt/X11/XBaseWindow.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/solaris/classes/sun/awt/X11/XBaseWindow.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2003-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2003-2008 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
@@ -30,7 +30,7 @@
 import java.util.logging.*;
 import java.util.*;
 
-public class XBaseWindow implements XConstants, XUtilConstants {
+public class XBaseWindow {
     private static final Logger log = Logger.getLogger("sun.awt.X11.XBaseWindow");
     private static final Logger insLog = Logger.getLogger("sun.awt.X11.insets.XBaseWindow");
     private static final Logger eventLog = Logger.getLogger("sun.awt.X11.event.XBaseWindow");
@@ -148,7 +148,7 @@
         Long eventMask = (Long)params.get(EVENT_MASK);
         if (eventMask != null) {
             long mask = eventMask.longValue();
-            mask |= SubstructureNotifyMask;
+            mask |= XConstants.SubstructureNotifyMask;
             params.put(EVENT_MASK, mask);
         }
 
@@ -281,10 +281,10 @@
         }
         params.putIfNull(PARENT_WINDOW, Long.valueOf(XToolkit.getDefaultRootWindow()));
         params.putIfNull(BOUNDS, new Rectangle(DEF_LOCATION, DEF_LOCATION, MIN_SIZE, MIN_SIZE));
-        params.putIfNull(DEPTH, Integer.valueOf((int)XlibWrapper.CopyFromParent));
-        params.putIfNull(VISUAL, Long.valueOf(XlibWrapper.CopyFromParent));
-        params.putIfNull(VISUAL_CLASS, Integer.valueOf((int)XlibWrapper.InputOnly));
-        params.putIfNull(VALUE_MASK, Long.valueOf(XlibWrapper.CWEventMask));
+        params.putIfNull(DEPTH, Integer.valueOf((int)XConstants.CopyFromParent));
+        params.putIfNull(VISUAL, Long.valueOf(XConstants.CopyFromParent));
+        params.putIfNull(VISUAL_CLASS, Integer.valueOf((int)XConstants.InputOnly));
+        params.putIfNull(VALUE_MASK, Long.valueOf(XConstants.CWEventMask));
         Rectangle bounds = (Rectangle)params.get(BOUNDS);
         bounds.width = Math.max(MIN_SIZE, bounds.width);
         bounds.height = Math.max(MIN_SIZE, bounds.height);
@@ -293,7 +293,7 @@
         long eventMask = eventMaskObj != null ? eventMaskObj.longValue() : 0;
         // We use our own synthetic grab see XAwtState.getGrabWindow()
         // (see X vol. 1, 8.3.3.2)
-        eventMask |= PropertyChangeMask | OwnerGrabButtonMask;
+        eventMask |= XConstants.PropertyChangeMask | XConstants.OwnerGrabButtonMask;
         params.put(EVENT_MASK, Long.valueOf(eventMask));
     }
 
@@ -312,23 +312,23 @@
 
                 Long eventMask = (Long)params.get(EVENT_MASK);
                 xattr.set_event_mask(eventMask.longValue());
-                value_mask |= XlibWrapper.CWEventMask;
+                value_mask |= XConstants.CWEventMask;
 
                 Long border_pixel = (Long)params.get(BORDER_PIXEL);
                 if (border_pixel != null) {
                     xattr.set_border_pixel(border_pixel.longValue());
-                    value_mask |= XlibWrapper.CWBorderPixel;
+                    value_mask |= XConstants.CWBorderPixel;
                 }
 
                 Long colormap = (Long)params.get(COLORMAP);
                 if (colormap != null) {
                     xattr.set_colormap(colormap.longValue());
-                    value_mask |= XlibWrapper.CWColormap;
+                    value_mask |= XConstants.CWColormap;
                 }
                 Long background_pixmap = (Long)params.get(BACKGROUND_PIXMAP);
                 if (background_pixmap != null) {
                     xattr.set_background_pixmap(background_pixmap.longValue());
-                    value_mask |= XlibWrapper.CWBackPixmap;
+                    value_mask |= XConstants.CWBackPixmap;
                 }
 
                 Long parentWindow = (Long)params.get(PARENT_WINDOW);
@@ -339,25 +339,25 @@
                 Boolean overrideRedirect = (Boolean)params.get(OVERRIDE_REDIRECT);
                 if (overrideRedirect != null) {
                     xattr.set_override_redirect(overrideRedirect.booleanValue());
-                    value_mask |= XlibWrapper.CWOverrideRedirect;
+                    value_mask |= XConstants.CWOverrideRedirect;
                 }
 
                 Boolean saveUnder = (Boolean)params.get(SAVE_UNDER);
                 if (saveUnder != null) {
                     xattr.set_save_under(saveUnder.booleanValue());
-                    value_mask |= XlibWrapper.CWSaveUnder;
+                    value_mask |= XConstants.CWSaveUnder;
                 }
 
                 Integer backingStore = (Integer)params.get(BACKING_STORE);
                 if (backingStore != null) {
                     xattr.set_backing_store(backingStore.intValue());
-                    value_mask |= XlibWrapper.CWBackingStore;
+                    value_mask |= XConstants.CWBackingStore;
                 }
 
                 Integer bitGravity = (Integer)params.get(BIT_GRAVITY);
                 if (bitGravity != null) {
                     xattr.set_bit_gravity(bitGravity.intValue());
-                    value_mask |= XlibWrapper.CWBitGravity;
+                    value_mask |= XConstants.CWBitGravity;
                 }
 
                 if (log.isLoggable(Level.FINE)) {
@@ -487,25 +487,25 @@
             // Note: if PPosition is not set in flags this means that
             // we want to reset PPosition in hints.  This is necessary
             // for locationByPlatform functionality
-            if ((flags & XlibWrapper.PPosition) != 0) {
+            if ((flags & XUtilConstants.PPosition) != 0) {
                 hints.set_x(x);
                 hints.set_y(y);
             }
-            if ((flags & XlibWrapper.PSize) != 0) {
+            if ((flags & XUtilConstants.PSize) != 0) {
                 hints.set_width(width);
                 hints.set_height(height);
-            } else if ((hints.get_flags() & XlibWrapper.PSize) != 0) {
-                flags |= XlibWrapper.PSize;
+            } else if ((hints.get_flags() & XUtilConstants.PSize) != 0) {
+                flags |= XUtilConstants.PSize;
             }
-            if ((flags & XlibWrapper.PMinSize) != 0) {
+            if ((flags & XUtilConstants.PMinSize) != 0) {
                 hints.set_min_width(width);
                 hints.set_min_height(height);
-            } else if ((hints.get_flags() & XlibWrapper.PMinSize) != 0) {
-                flags |= XlibWrapper.PMinSize;
+            } else if ((hints.get_flags() & XUtilConstants.PMinSize) != 0) {
+                flags |= XUtilConstants.PMinSize;
                 //Fix for 4320050: Minimum size for java.awt.Frame is not being enforced.
                 //We don't need to reset minimum size if it's already set
             }
-            if ((flags & XlibWrapper.PMaxSize) != 0) {
+            if ((flags & XUtilConstants.PMaxSize) != 0) {
                 if (maxBounds != null) {
                     if (maxBounds.width != Integer.MAX_VALUE) {
                         hints.set_max_width(maxBounds.width);
@@ -521,8 +521,8 @@
                     hints.set_max_width(width);
                     hints.set_max_height(height);
                 }
-            } else if ((hints.get_flags() & XlibWrapper.PMaxSize) != 0) {
-                flags |= XlibWrapper.PMaxSize;
+            } else if ((hints.get_flags() & XUtilConstants.PMaxSize) != 0) {
+                flags |= XUtilConstants.PMaxSize;
                 if (maxBounds != null) {
                     if (maxBounds.width != Integer.MAX_VALUE) {
                         hints.set_max_width(maxBounds.width);
@@ -538,9 +538,9 @@
                     // Leave intact
                 }
             }
-            flags |= XlibWrapper.PWinGravity;
+            flags |= XUtilConstants.PWinGravity;
             hints.set_flags(flags);
-            hints.set_win_gravity((int)XlibWrapper.NorthWestGravity);
+            hints.set_win_gravity((int)XConstants.NorthWestGravity);
             if (insLog.isLoggable(Level.FINER)) insLog.finer("Setting hints, resulted flags " + XlibWrapper.hintsToString(flags) +
                                                              ", values " + hints);
             XlibWrapper.XSetWMNormalHints(XToolkit.getDisplay(), getWindow(), hints.pData);
@@ -552,7 +552,7 @@
     public boolean isMinSizeSet() {
         XSizeHints hints = getHints();
         long flags = hints.get_flags();
-        return ((flags & XlibWrapper.PMinSize) == XlibWrapper.PMinSize);
+        return ((flags & XUtilConstants.PMinSize) == XUtilConstants.PMinSize);
     }
 
     /**
@@ -837,29 +837,29 @@
             //6273031: PIT. Choice drop down does not close once it is right clicked to show a popup menu
             //remember previous window having grab and if it's not null ungrab it.
             XBaseWindow prevGrabWindow = XAwtState.getGrabWindow();
-            final int eventMask = (int) (ButtonPressMask | ButtonReleaseMask
-                | EnterWindowMask | LeaveWindowMask | PointerMotionMask
-                | ButtonMotionMask);
+            final int eventMask = (int) (XConstants.ButtonPressMask | XConstants.ButtonReleaseMask
+                | XConstants.EnterWindowMask | XConstants.LeaveWindowMask | XConstants.PointerMotionMask
+                | XConstants.ButtonMotionMask);
             final int ownerEvents = 1;
 
             int ptrGrab = XlibWrapper.XGrabPointer(XToolkit.getDisplay(),
-                getContentWindow(), ownerEvents, eventMask, GrabModeAsync,
-                GrabModeAsync, None, (XWM.isMotif() ? XToolkit.arrowCursor : None),
-                CurrentTime);
+                getContentWindow(), ownerEvents, eventMask, XConstants.GrabModeAsync,
+                XConstants.GrabModeAsync, XConstants.None, (XWM.isMotif() ? XToolkit.arrowCursor : XConstants.None),
+                XConstants.CurrentTime);
             // Check grab results to be consistent with X server grab
-            if (ptrGrab != GrabSuccess) {
-                XlibWrapper.XUngrabPointer(XToolkit.getDisplay(), CurrentTime);
+            if (ptrGrab != XConstants.GrabSuccess) {
+                XlibWrapper.XUngrabPointer(XToolkit.getDisplay(), XConstants.CurrentTime);
                 XAwtState.setGrabWindow(null);
                 grabLog.fine("    Grab Failure - mouse");
                 return false;
             }
 
             int keyGrab = XlibWrapper.XGrabKeyboard(XToolkit.getDisplay(),
-                getContentWindow(), ownerEvents, GrabModeAsync, GrabModeAsync,
-                CurrentTime);
-            if (keyGrab != GrabSuccess) {
-                XlibWrapper.XUngrabPointer(XToolkit.getDisplay(), CurrentTime);
-                XlibWrapper.XUngrabKeyboard(XToolkit.getDisplay(), CurrentTime);
+                getContentWindow(), ownerEvents, XConstants.GrabModeAsync, XConstants.GrabModeAsync,
+                XConstants.CurrentTime);
+            if (keyGrab != XConstants.GrabSuccess) {
+                XlibWrapper.XUngrabPointer(XToolkit.getDisplay(), XConstants.CurrentTime);
+                XlibWrapper.XUngrabKeyboard(XToolkit.getDisplay(), XConstants.CurrentTime);
                 XAwtState.setGrabWindow(null);
                 grabLog.fine("    Grab Failure - keyboard");
                 return false;
@@ -882,8 +882,8 @@
             grabLog.log(Level.FINE, "UnGrab input on {0}", new Object[] {grabWindow});
             if (grabWindow != null) {
                 grabWindow.ungrabInputImpl();
-                XlibWrapper.XUngrabPointer(XToolkit.getDisplay(), CurrentTime);
-                XlibWrapper.XUngrabKeyboard(XToolkit.getDisplay(), CurrentTime);
+                XlibWrapper.XUngrabPointer(XToolkit.getDisplay(), XConstants.CurrentTime);
+                XlibWrapper.XUngrabKeyboard(XToolkit.getDisplay(), XConstants.CurrentTime);
                 XAwtState.setGrabWindow(null);
                 // we need to call XFlush() here to force ungrab
                 // see 6384219 for details
@@ -979,15 +979,15 @@
      */
     public void handleButtonPressRelease(XEvent xev) {
         XButtonEvent xbe = xev.get_xbutton();
-        final int buttonState = xbe.get_state() & (Button1Mask | Button2Mask
-            | Button3Mask | Button4Mask | Button5Mask);
+        final int buttonState = xbe.get_state() & (XConstants.Button1Mask | XConstants.Button2Mask
+            | XConstants.Button3Mask | XConstants.Button4Mask | XConstants.Button5Mask);
         switch (xev.get_type()) {
-        case ButtonPress:
+        case XConstants.ButtonPress:
             if (buttonState == 0) {
                 XAwtState.setAutoGrabWindow(this);
             }
             break;
-        case ButtonRelease:
+        case XConstants.ButtonRelease:
             if (isFullRelease(buttonState, xbe.get_button())) {
                 XAwtState.setAutoGrabWindow(null);
             }
@@ -1012,30 +1012,30 @@
      */
     static boolean isFullRelease(int buttonState, int button) {
         switch (button) {
-        case Button1:
-            return buttonState == Button1Mask;
-        case Button2:
-            return buttonState == Button2Mask;
-        case Button3:
-            return buttonState == Button3Mask;
-        case Button4:
-            return buttonState == Button4Mask;
-        case Button5:
-            return buttonState == Button5Mask;
+        case XConstants.Button1:
+            return buttonState == XConstants.Button1Mask;
+        case XConstants.Button2:
+            return buttonState == XConstants.Button2Mask;
+        case XConstants.Button3:
+            return buttonState == XConstants.Button3Mask;
+        case XConstants.Button4:
+            return buttonState == XConstants.Button4Mask;
+        case XConstants.Button5:
+            return buttonState == XConstants.Button5Mask;
         }
         return buttonState == 0;
     }
 
     static boolean isGrabbedEvent(XEvent ev, XBaseWindow target) {
         switch (ev.get_type()) {
-          case ButtonPress:
-          case ButtonRelease:
-          case MotionNotify:
-          case KeyPress:
-          case KeyRelease:
+          case XConstants.ButtonPress:
+          case XConstants.ButtonRelease:
+          case XConstants.MotionNotify:
+          case XConstants.KeyPress:
+          case XConstants.KeyRelease:
               return true;
-          case LeaveNotify:
-          case EnterNotify:
+          case XConstants.LeaveNotify:
+          case XConstants.EnterNotify:
               // We shouldn't dispatch this events to the grabbed components (see 6317481)
               // But this logic is important if the grabbed component is top-level (see realSync)
               return (target instanceof XWindowPeer);
@@ -1067,53 +1067,53 @@
 
         switch (type)
         {
-          case VisibilityNotify:
+          case XConstants.VisibilityNotify:
               handleVisibilityEvent(xev);
               break;
-          case ClientMessage:
+          case XConstants.ClientMessage:
               handleClientMessage(xev);
               break;
-          case Expose :
-          case GraphicsExpose :
+          case XConstants.Expose :
+          case XConstants.GraphicsExpose :
               handleExposeEvent(xev);
               break;
-          case ButtonPress:
-          case ButtonRelease:
+          case XConstants.ButtonPress:
+          case XConstants.ButtonRelease:
               handleButtonPressRelease(xev);
               break;
 
-          case MotionNotify:
+          case XConstants.MotionNotify:
               handleMotionNotify(xev);
               break;
-          case KeyPress:
+          case XConstants.KeyPress:
               handleKeyPress(xev);
               break;
-          case KeyRelease:
+          case XConstants.KeyRelease:
               handleKeyRelease(xev);
               break;
-          case EnterNotify:
-          case LeaveNotify:
+          case XConstants.EnterNotify:
+          case XConstants.LeaveNotify:
               handleXCrossingEvent(xev);
               break;
-          case ConfigureNotify:
+          case XConstants.ConfigureNotify:
               handleConfigureNotifyEvent(xev);
               break;
-          case MapNotify:
+          case XConstants.MapNotify:
               handleMapNotifyEvent(xev);
               break;
-          case UnmapNotify:
+          case XConstants.UnmapNotify:
               handleUnmapNotifyEvent(xev);
               break;
-          case ReparentNotify:
+          case XConstants.ReparentNotify:
               handleReparentNotifyEvent(xev);
               break;
-          case PropertyNotify:
+          case XConstants.PropertyNotify:
               handlePropertyNotify(xev);
               break;
-          case DestroyNotify:
+          case XConstants.DestroyNotify:
               handleDestroyNotify(xev);
               break;
-          case CreateNotify:
+          case XConstants.CreateNotify:
               handleCreateNotify(xev);
               break;
         }
--- a/jdk/src/solaris/classes/sun/awt/X11/XClipboard.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/solaris/classes/sun/awt/X11/XClipboard.java	Thu Jun 12 13:50:55 2008 -0700
@@ -185,7 +185,7 @@
 
     private static class SelectionNotifyHandler implements XEventDispatcher {
         public void dispatchEvent(XEvent ev) {
-            if (ev.get_type() == XlibWrapper.SelectionNotify) {
+            if (ev.get_type() == XConstants.SelectionNotify) {
                 final XSelectionEvent xse = ev.get_xselection();
                 XClipboard clipboard = null;
                 synchronized (XClipboard.classLock) {
@@ -223,7 +223,7 @@
                                               XDataTransferer.TARGETS_ATOM.getAtom(),
                                               getTargetsPropertyAtom().getAtom(),
                                               XWindow.getXAWTRootWindow().getWindow(),
-                                              XlibWrapper.CurrentTime);
+                                              XConstants.CurrentTime);
                 isSelectionNotifyProcessed = false;
             }
         } finally {
@@ -260,7 +260,7 @@
 
         long[] formats = null;
 
-        if (propertyAtom == XlibWrapper.None) {
+        if (propertyAtom == XConstants.None) {
             // We treat None property atom as "empty selection".
             formats = new long[0];
         } else {
@@ -268,7 +268,7 @@
                 new WindowPropertyGetter(XWindow.getXAWTRootWindow().getWindow(),
                                          XAtom.get(propertyAtom), 0,
                                          XSelection.MAX_LENGTH, true,
-                                         XlibWrapper.AnyPropertyType);
+                                         XConstants.AnyPropertyType);
             try {
                 targetsGetter.execute();
                 formats = XSelection.getFormats(targetsGetter);
--- a/jdk/src/solaris/classes/sun/awt/X11/XComponentPeer.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/solaris/classes/sun/awt/X11/XComponentPeer.java	Thu Jun 12 13:50:55 2008 -0700
@@ -72,7 +72,7 @@
 import sun.awt.image.ToolkitImage;
 import sun.java2d.pipe.Region;
 
-public class XComponentPeer extends XWindow implements ComponentPeer, DropTargetPeer, XConstants {
+public class XComponentPeer extends XWindow implements ComponentPeer, DropTargetPeer {
     /* FIX ME: these constants copied from java.awt.KeyboardFocusManager */
     static final int SNFH_FAILURE = 0;
     static final int SNFH_SUCCESS_HANDLED = 1;
@@ -420,40 +420,36 @@
           case SNFH_SUCCESS_PROCEED:
               // Currently we just generate focus events like we deal with lightweight instead of calling
               // XSetInputFocus on native window
-              if (focusLog.isLoggable(Level.FINER)) focusLog.finer("Proceeding with request to " + lightweightChild + " in " + target);
+              if (focusLog.isLoggable(Level.FINER)) focusLog.finer("Proceeding with request to " +
+                  lightweightChild + " in " + target);
               /**
                * The problems with requests in non-focused window arise because shouldNativelyFocusHeavyweight
                * checks that native window is focused while appropriate WINDOW_GAINED_FOCUS has not yet
                * been processed - it is in EventQueue. Thus, SNFH allows native request and stores request record
-               * in requests list - and it breaks our requests sequence as first record on WGF should be the last focus
-               * owner which had focus before WLF. So, we should not add request record for such requests
+               * in requests list - and it breaks our requests sequence as first record on WGF should be the last
+               * focus owner which had focus before WLF. So, we should not add request record for such requests
                * but store this component in mostRecent - and return true as before for compatibility.
                */
               Window parentWindow = getContainingWindow(target);
-              if (parentWindow != null) {
-                  // and check that it is focused
-                  if (!parentWindow.isFocused()) {
-                      XWindowPeer wpeer = (XWindowPeer)parentWindow.getPeer();
-                      /*
-                       * Fix for 6314575.
-                       * Shouldn't restore focus on 'actualFocusedWindow'
-                       * when a component inside a Frame is requesting it.
-                       */
-                      wpeer.setActualFocusedWindow(null);
+              if (parentWindow == null) {
+                  return rejectFocusRequestHelper("WARNING: Parent window is null");
+              }
+              XWindowPeer wpeer = (XWindowPeer)parentWindow.getPeer();
+              if (wpeer == null) {
+                  return rejectFocusRequestHelper("WARNING: Parent window's peer is null");
+              }
+              /*
+               * Passing null 'actualFocusedWindow' as we don't want to restore focus on it
+               * when a component inside a Frame is requesting focus.
+               * See 6314575 for details.
+               */
+              boolean res = wpeer.requestWindowFocus(null);
 
-                      boolean res = wpeer.requestWindowFocus();
-                      if (focusLog.isLoggable(Level.FINER)) focusLog.finer("Requested window focus: " + res);
-                      // If parent window can be made focused and has been made focused(synchronously)
-                      // then we can proceed with children, otherwise we retreat.
-                      if (!(res && parentWindow.isFocused())) {
-                          focusLog.finer("Waiting for asynchronous processing of window focus request");
-                          KeyboardFocusManagerPeerImpl.removeLastFocusRequest(target);
-                          return false;
-                      }
-                  }
-              } else {
-                  if (focusLog.isLoggable(Level.FINER)) focusLog.finer("WARNING: Parent window is null");
-                  return false;
+              if (focusLog.isLoggable(Level.FINER)) focusLog.finer("Requested window focus: " + res);
+              // If parent window can be made focused and has been made focused(synchronously)
+              // then we can proceed with children, otherwise we retreat.
+              if (!(res && parentWindow.isFocused())) {
+                  return rejectFocusRequestHelper("Waiting for asynchronous processing of the request");
               }
 
               // NOTE: We simulate heavyweight behavior of Motif - component receives focus right
@@ -469,6 +465,12 @@
         return false;
     }
 
+    private boolean rejectFocusRequestHelper(String logMsg) {
+        if (focusLog.isLoggable(Level.FINER)) focusLog.finer(logMsg);
+        KeyboardFocusManagerPeerImpl.removeLastFocusRequest(target);
+        return false;
+    }
+
     void handleJavaFocusEvent(AWTEvent e) {
         if (focusLog.isLoggable(Level.FINER)) focusLog.finer(e.toString());
         if (e.getID() == FocusEvent.FOCUS_GAINED) {
@@ -718,7 +720,7 @@
          * handleJavaMouseEvent() would be more suitable place to do this
          * but we want Swing to have this functionality also.
          */
-        if (xev.get_type() == ButtonPress) {
+        if (xev.get_type() == XConstants.ButtonPress) {
             final XWindowPeer parentXWindow = getParentTopLevel();
             Window parentWindow = (Window)parentXWindow.getTarget();
             if (parentXWindow.isFocusableWindow() && parentXWindow.isSimpleWindow() &&
@@ -841,7 +843,7 @@
             XSetWindowAttributes xwa = new XSetWindowAttributes();
             xwa.set_cursor(xcursor);
 
-            long valuemask = XlibWrapper.CWCursor;
+            long valuemask = XConstants.CWCursor;
 
             XlibWrapper.XChangeWindowAttributes(XToolkit.getDisplay(),getWindow(),valuemask,xwa.pData);
             XlibWrapper.XFlush(XToolkit.getDisplay());
@@ -1342,20 +1344,20 @@
         enableLog.log(Level.FINEST, "Component is {1}, checking for disabled event {0}", new Object[] {e, (isEnabled()?"enabled":"disable")});
         if (!isEnabled()) {
             switch (e.get_type()) {
-              case ButtonPress:
-              case ButtonRelease:
-              case KeyPress:
-              case KeyRelease:
-              case EnterNotify:
-              case LeaveNotify:
-              case MotionNotify:
+              case XConstants.ButtonPress:
+              case XConstants.ButtonRelease:
+              case XConstants.KeyPress:
+              case XConstants.KeyRelease:
+              case XConstants.EnterNotify:
+              case XConstants.LeaveNotify:
+              case XConstants.MotionNotify:
                   enableLog.log(Level.FINER, "Event {0} is disable", new Object[] {e});
                   return true;
             }
         }
         switch(e.get_type()) {
-          case MapNotify:
-          case UnmapNotify:
+          case XConstants.MapNotify:
+          case XConstants.UnmapNotify:
               return true;
         }
         return super.isEventDisabled(e);
--- a/jdk/src/solaris/classes/sun/awt/X11/XConstants.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/solaris/classes/sun/awt/X11/XConstants.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2003 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2003-2008 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
@@ -25,7 +25,10 @@
 
 package sun.awt.X11;
 
-public interface XConstants {
+final public class XConstants {
+
+    private XConstants(){}
+
     public static final int X_PROTOCOL = 11 ; /* current protocol version */
     public static final int X_PROTOCOL_REVISION = 0 ; /* current minor version */
 
@@ -292,9 +295,9 @@
     public static final int RevertToParent = 2 ;
 
     /* Used in XEventsQueued */
-    int QueuedAlready = 0;
-    int QueuedAfterReading = 1;
-    int QueuedAfterFlush = 2;
+    public static final int QueuedAlready = 0;
+    public static final int QueuedAfterReading = 1;
+    public static final int QueuedAfterFlush = 2;
 
 
     /*****************************************************************
--- a/jdk/src/solaris/classes/sun/awt/X11/XContentWindow.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/solaris/classes/sun/awt/X11/XContentWindow.java	Thu Jun 12 13:50:55 2008 -0700
@@ -43,7 +43,7 @@
  * It should always be located at (- left inset, - top inset) in the associated
  * decorated window.  So coordinates in it would be the same as java coordinates.
  */
-public final class XContentWindow extends XWindow implements XConstants {
+public final class XContentWindow extends XWindow {
     private static Logger insLog = Logger.getLogger("sun.awt.X11.insets.XContentWindow");
 
     static XContentWindow createContent(XDecoratedPeer parentFrame) {
@@ -76,10 +76,10 @@
 
     void preInit(XCreateWindowParams params) {
         super.preInit(params);
-        params.putIfNull(BIT_GRAVITY, Integer.valueOf(NorthWestGravity));
+        params.putIfNull(BIT_GRAVITY, Integer.valueOf(XConstants.NorthWestGravity));
         Long eventMask = (Long)params.get(EVENT_MASK);
         if (eventMask != null) {
-            eventMask = eventMask & ~(StructureNotifyMask);
+            eventMask = eventMask & ~(XConstants.StructureNotifyMask);
             params.put(EVENT_MASK, eventMask);
         }
     }
@@ -90,15 +90,15 @@
     protected boolean isEventDisabled(XEvent e) {
         switch (e.get_type()) {
           // Override parentFrame to receive MouseEnter/Exit
-          case EnterNotify:
-          case LeaveNotify:
+          case XConstants.EnterNotify:
+          case XConstants.LeaveNotify:
               return false;
           // We handle ConfigureNotify specifically in XDecoratedPeer
-          case ConfigureNotify:
+          case XConstants.ConfigureNotify:
               return true;
           // We don't want SHOWN/HIDDEN on content window since it will duplicate XDecoratedPeer
-          case MapNotify:
-          case UnmapNotify:
+          case XConstants.MapNotify:
+          case XConstants.UnmapNotify:
               return true;
           default:
               return super.isEventDisabled(e) || parentFrame.isEventDisabled(e);
--- a/jdk/src/solaris/classes/sun/awt/X11/XCursorFontConstants.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/solaris/classes/sun/awt/X11/XCursorFontConstants.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2003 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2003-2008 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
@@ -25,7 +25,10 @@
 
 package sun.awt.X11;
 
-public interface XCursorFontConstants {
+final public class XCursorFontConstants {
+
+    private XCursorFontConstants(){}
+
     /* cursorfont defines */
     static final int XC_num_glyphs=154;
     static final int XC_X_cursor=0;
--- a/jdk/src/solaris/classes/sun/awt/X11/XCustomCursor.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/solaris/classes/sun/awt/X11/XCustomCursor.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2003-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2003-2008 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
@@ -83,7 +83,7 @@
             long colormap = XToolkit.getDefaultXColormap();
             XColor fore_color = new XColor();
 
-            fore_color.set_flags((byte) (XlibWrapper.DoRed | XlibWrapper.DoGreen | XlibWrapper.DoBlue));
+            fore_color.set_flags((byte) (XConstants.DoRed | XConstants.DoGreen | XConstants.DoBlue));
             fore_color.set_red((short)(((fcolor >> 16) & 0x000000ff) << 8));
             fore_color.set_green((short) (((fcolor >> 8) & 0x000000ff) << 8));
             fore_color.set_blue((short)(((fcolor >> 0) & 0x000000ff) << 8));
@@ -92,7 +92,7 @@
 
 
             XColor back_color = new XColor();
-            back_color.set_flags((byte) (XlibWrapper.DoRed | XlibWrapper.DoGreen | XlibWrapper.DoBlue));
+            back_color.set_flags((byte) (XConstants.DoRed | XConstants.DoGreen | XConstants.DoBlue));
 
             back_color.set_red((short) (((bcolor >> 16) & 0x000000ff) << 8));
             back_color.set_green((short) (((bcolor >> 8) & 0x000000ff) << 8));
--- a/jdk/src/solaris/classes/sun/awt/X11/XDecoratedPeer.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/solaris/classes/sun/awt/X11/XDecoratedPeer.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2002-2008 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
@@ -40,9 +40,7 @@
     private static final Logger log = Logger.getLogger("sun.awt.X11.XDecoratedPeer");
     private static final Logger insLog = Logger.getLogger("sun.awt.X11.insets.XDecoratedPeer");
     private static final Logger focusLog = Logger.getLogger("sun.awt.X11.focus.XDecoratedPeer");
-    private final static Logger iconLog = Logger.getLogger("sun.awt.X11.icon.XDecoratedPeer");
-
-    private static XAtom resize_request = new XAtom("_SUN_AWT_RESIZE_REQUEST", false);
+    private static final Logger iconLog = Logger.getLogger("sun.awt.X11.icon.XDecoratedPeer");
 
     // Set to true when we get the first ConfigureNotify after being
     // reparented - indicates that WM has adopted the top-level.
@@ -73,14 +71,11 @@
 
     void preInit(XCreateWindowParams params) {
         super.preInit(params);
-        if (!resize_request.isInterned()) {
-            resize_request.intern(false);
-        }
         winAttr.initialFocus = true;
 
-        currentInsets = new Insets(0,0,0,0); // replacemenet for wdata->top, left, bottom, right
+        currentInsets = new Insets(0,0,0,0);
+        applyGuessedInsets();
 
-        applyGuessedInsets();
         Rectangle bounds = (Rectangle)params.get(BOUNDS);
         dimensions = new WindowDimensions(bounds, getRealInsets(), false);
         params.put(BOUNDS, dimensions.getClientRect());
@@ -89,7 +84,7 @@
         // Deny default processing of these events on the shell - proxy will take care of
         // them instead
         Long eventMask = (Long)params.get(EVENT_MASK);
-        params.add(EVENT_MASK, Long.valueOf(eventMask.longValue() & ~(FocusChangeMask | KeyPressMask | KeyReleaseMask)));
+        params.add(EVENT_MASK, Long.valueOf(eventMask.longValue() & ~(XConstants.FocusChangeMask | XConstants.KeyPressMask | XConstants.KeyReleaseMask)));
     }
 
     void postInit(XCreateWindowParams params) {
@@ -98,7 +93,10 @@
         // happen after the X window is created.
         initResizability();
         updateSizeHints(dimensions);
+        XWM.requestWMExtents(getWindow());
+
         content = XContentWindow.createContent(this);
+
         if (warningWindow != null) {
             warningWindow.toFront();
         }
@@ -121,7 +119,6 @@
         updateMinSizeHints();
     }
 
-
     private void updateMinSizeHints() {
         if (isResizable()) {
             Dimension minimumSize = getTargetMinimumSize();
@@ -131,7 +128,7 @@
                 int minHeight = minimumSize.height - insets.top - insets.bottom;
                 if (minWidth < 0) minWidth = 0;
                 if (minHeight < 0) minHeight = 0;
-                setSizeHints(XlibWrapper.PMinSize | (isLocationByPlatform()?0:(XlibWrapper.PPosition | XlibWrapper.USPosition)),
+                setSizeHints(XUtilConstants.PMinSize | (isLocationByPlatform()?0:(XUtilConstants.PPosition | XUtilConstants.USPosition)),
                              getX(), getY(), minWidth, minHeight);
                 if (isVisible()) {
                     Rectangle bounds = getShellBounds();
@@ -143,7 +140,7 @@
                 }
             } else {
                 boolean isMinSizeSet = isMinSizeSet();
-                XWM.removeSizeHints(this, XlibWrapper.PMinSize);
+                XWM.removeSizeHints(this, XUtilConstants.PMinSize);
                 /* Some WMs need remap to redecorate the window */
                 if (isMinSizeSet && isShowing() && XWM.needRemap(this)) {
                     /*
@@ -238,23 +235,59 @@
         return false;
     }
 
-    Insets difference(Insets i1, Insets i2) {
+    private static Insets difference(Insets i1, Insets i2) {
         return new Insets(i1.top-i2.top, i1.left - i2.left, i1.bottom-i2.bottom, i1.right-i2.right);
     }
 
-    void add(Insets i1, Insets i2) {
-        i1.left += i2.left;
-        i1.top += i2.top;
-        i1.right += i2.right;
-        i1.bottom += i2.bottom;
-    }
-    boolean isNull(Insets i) {
+    private static boolean isNull(Insets i) {
         return (i == null) || ((i.left | i.top | i.right | i.bottom) == 0);
     }
-    Insets copy(Insets i) {
+
+    private static Insets copy(Insets i) {
         return new Insets(i.top, i.left, i.bottom, i.right);
     }
 
+    // insets which we get from WM (e.g from _NET_FRAME_EXTENTS)
+    private Insets wm_set_insets;
+
+    private Insets getWMSetInsets(XAtom changedAtom) {
+        if (isEmbedded()) {
+            return null;
+        }
+
+        if (wm_set_insets != null) {
+            return wm_set_insets;
+        }
+
+        if (changedAtom == null) {
+            wm_set_insets = XWM.getInsetsFromExtents(getWindow());
+        } else {
+            wm_set_insets = XWM.getInsetsFromProp(getWindow(), changedAtom);
+        }
+
+        insLog.log(Level.FINER, "FRAME_EXTENTS: {0}", new Object[]{wm_set_insets});
+
+        if (wm_set_insets != null) {
+            wm_set_insets = copy(wm_set_insets);
+        }
+        return wm_set_insets;
+    }
+
+    private void resetWMSetInsets() {
+        wm_set_insets = null;
+    }
+
+    public void handlePropertyNotify(XEvent xev) {
+        super.handlePropertyNotify(xev);
+
+        XPropertyEvent ev = xev.get_xproperty();
+        if (ev.get_atom() == XWM.XA_KDE_NET_WM_FRAME_STRUT.getAtom()
+            || ev.get_atom() == XWM.XA_NET_FRAME_EXTENTS.getAtom())
+        {
+            getWMSetInsets(XAtom.get(ev.get_atom()));
+        }
+    }
+
     long reparent_serial = 0;
 
     public void handleReparentNotifyEvent(XEvent xev) {
@@ -337,35 +370,30 @@
             Insets correction = difference(correctWM, currentInsets);
             insLog.log(Level.FINEST, "Corrention {0}", new Object[] {correction});
             if (!isNull(correction)) {
-                /*
-                 * Actual insets account for menubar/warning label,
-                 * so we can't assign directly but must adjust them.
-                 */
-                add(currentInsets, correction);
+                currentInsets = copy(correctWM);
                 applyGuessedInsets();
 
                 //Fix for 6318109: PIT: Min Size is not honored properly when a
                 //smaller size is specified in setSize(), XToolkit
                 //update minimum size hints
                 updateMinSizeHints();
-
-                /*
-                 * If this window has been sized by a pack() we need
-                 * to keep the interior geometry intact.  Since pack()
-                 * computed width and height with wrong insets, we
-                 * must adjust the target dimensions appropriately.
-                 */
             }
             if (insLog.isLoggable(Level.FINER)) insLog.finer("Dimensions before reparent: " + dimensions);
 
             dimensions.setInsets(getRealInsets());
             insets_corrected = true;
 
-            if (isMaximized()) {
+            if (isMaximized() || isNull(correction)) {
                 return;
             }
 
-            if ((getHints().get_flags() & (USPosition | PPosition)) != 0) {
+            /*
+             * If this window has been sized by a pack() we need
+             * to keep the interior geometry intact.  Since pack()
+             * computed width and height with wrong insets, we
+             * must adjust the target dimensions appropriately.
+             */
+            if ((getHints().get_flags() & (XUtilConstants.USPosition | XUtilConstants.PPosition)) != 0) {
                 reshape(dimensions, SET_BOUNDS, false);
             } else {
                 reshape(dimensions, SET_SIZE, false);
@@ -384,10 +412,10 @@
 
 
     protected Insets guessInsets() {
-        if (isEmbedded()) {
+        if (isEmbedded() || isTargetUndecorated()) {
             return new Insets(0, 0, 0, 0);
         } else {
-            if (currentInsets.top > 0) {
+            if (!isNull(currentInsets)) {
                 /* insets were set on wdata by System Properties */
                 return copy(currentInsets);
             } else {
@@ -403,7 +431,6 @@
     private void applyGuessedInsets() {
         Insets guessed = guessInsets();
         currentInsets = copy(guessed);
-        insets = copy(currentInsets);
     }
 
     public void revalidate() {
@@ -416,16 +443,18 @@
     }
 
     Insets getRealInsets() {
-        if (isNull(insets)) {
+        if (isNull(currentInsets)) {
             applyGuessedInsets();
         }
-        return insets;
+        return currentInsets;
     }
 
     public Insets getInsets() {
         Insets in = copy(getRealInsets());
         in.top += getMenuBarHeight() + getWarningWindowHeight();
-        if (insLog.isLoggable(Level.FINEST)) insLog.log(Level.FINEST, "Get insets returns {0}", new Object[] {in});
+        if (insLog.isLoggable(Level.FINEST)) {
+            insLog.log(Level.FINEST, "Get insets returns {0}", new Object[] {in});
+        }
         return in;
     }
 
@@ -835,30 +864,30 @@
     public void setResizable(boolean resizable) {
         int fs = winAttr.functions;
         if (!isResizable() && resizable) {
-            insets = currentInsets = new Insets(0, 0, 0, 0);
+            currentInsets = new Insets(0, 0, 0, 0);
             resetWMSetInsets();
             if (!isEmbedded()) {
                 setReparented(false);
             }
             winAttr.isResizable = resizable;
-            if ((fs & MWM_FUNC_ALL) != 0) {
-                fs &= ~(MWM_FUNC_RESIZE | MWM_FUNC_MAXIMIZE);
+            if ((fs & MWMConstants.MWM_FUNC_ALL) != 0) {
+                fs &= ~(MWMConstants.MWM_FUNC_RESIZE | MWMConstants.MWM_FUNC_MAXIMIZE);
             } else {
-                fs |= (MWM_FUNC_RESIZE | MWM_FUNC_MAXIMIZE);
+                fs |= (MWMConstants.MWM_FUNC_RESIZE | MWMConstants.MWM_FUNC_MAXIMIZE);
             }
             winAttr.functions = fs;
             XWM.setShellResizable(this);
         } else if (isResizable() && !resizable) {
-            insets = currentInsets = new Insets(0, 0, 0, 0);
+            currentInsets = new Insets(0, 0, 0, 0);
             resetWMSetInsets();
             if (!isEmbedded()) {
                 setReparented(false);
             }
             winAttr.isResizable = resizable;
-            if ((fs & MWM_FUNC_ALL) != 0) {
-                fs |= (MWM_FUNC_RESIZE | MWM_FUNC_MAXIMIZE);
+            if ((fs & MWMConstants.MWM_FUNC_ALL) != 0) {
+                fs |= (MWMConstants.MWM_FUNC_RESIZE | MWMConstants.MWM_FUNC_MAXIMIZE);
             } else {
-                fs &= ~(MWM_FUNC_RESIZE | MWM_FUNC_MAXIMIZE);
+                fs &= ~(MWMConstants.MWM_FUNC_RESIZE | MWMConstants.MWM_FUNC_MAXIMIZE);
             }
             winAttr.functions = fs;
             XWM.setShellNotResizable(this, dimensions, dimensions.getBounds(), false);
@@ -936,10 +965,10 @@
     protected boolean isEventDisabled(XEvent e) {
         switch (e.get_type()) {
             // Do not generate MOVED/RESIZED events since we generate them by ourselves
-          case ConfigureNotify:
+          case XConstants.ConfigureNotify:
               return true;
-          case EnterNotify:
-          case LeaveNotify:
+          case XConstants.EnterNotify:
+          case XConstants.LeaveNotify:
               // Disable crossing event on outer borders of Frame so
               // we receive only one set of cross notifications(first set is from content window)
               return true;
@@ -964,7 +993,7 @@
             if (winAttr.isResizable) {
                 //Fix for 4320050: Minimum size for java.awt.Frame is not being enforced.
                 //We need to update frame's minimum size, not to reset it
-                XWM.removeSizeHints(this, XlibWrapper.PMaxSize);
+                XWM.removeSizeHints(this, XUtilConstants.PMaxSize);
                 updateMinimumSize();
             }
         } else {
@@ -1004,10 +1033,6 @@
             } else if (cl.get_data(0) == wm_take_focus.getAtom()) {
                 handleWmTakeFocus(cl);
             }
-        } else if (cl.get_message_type() == resize_request.getAtom()) {
-            reshape((int)cl.get_data(0), (int)cl.get_data(1),
-                    (int)cl.get_data(2), (int)cl.get_data(3),
-                    (int)cl.get_data(4), true);
         }
     }
 
@@ -1114,53 +1139,51 @@
         focusLog.fine("Request for decorated window focus");
         // If this is Frame or Dialog we can't assure focus request success - but we still can try
         // If this is Window and its owner Frame is active we can be sure request succedded.
-        Window win = (Window)target;
         Window focusedWindow = XKeyboardFocusManagerPeer.getCurrentNativeFocusedWindow();
         Window activeWindow = XWindowPeer.getDecoratedOwner(focusedWindow);
 
         focusLog.log(Level.FINER, "Current window is: active={0}, focused={1}",
-                     new Object[]{ Boolean.valueOf(win == activeWindow),
-                                   Boolean.valueOf(win == focusedWindow)});
+                     new Object[]{ Boolean.valueOf(target == activeWindow),
+                                   Boolean.valueOf(target == focusedWindow)});
 
         XWindowPeer toFocus = this;
         while (toFocus.nextTransientFor != null) {
             toFocus = toFocus.nextTransientFor;
         }
-
-        if (this == toFocus) {
-            if (focusAllowedFor()) {
-                if (win == activeWindow && win != focusedWindow) {
-                    // Happens when focus is on window child
-                    focusLog.fine("Focus is on child window - transfering it back");
-                    handleWindowFocusInSync(-1);
-                } else {
-                    focusLog.fine("Requesting focus to this window");
-                    if (timeProvided) {
-                        requestXFocus(time);
-                    } else {
-                        requestXFocus();
-                    }
-                }
-                return true;
-            } else {
-                return false;
-            }
-        }
-        else if (toFocus.focusAllowedFor()) {
-            focusLog.fine("Requesting focus to " + toFocus);
-            if (timeProvided) {
-                toFocus.requestXFocus(time);
-            } else {
-                toFocus.requestXFocus();
-            }
-            return false;
-        }
-        else
-        {
+        if (toFocus == null || !toFocus.focusAllowedFor()) {
             // This might change when WM will have property to determine focus policy.
             // Right now, because policy is unknown we can't be sure we succedded
             return false;
         }
+        if (this == toFocus) {
+            if (isWMStateNetHidden()) {
+                focusLog.fine("The window is unmapped, so rejecting the request");
+                return false;
+            }
+            if (target == activeWindow && target != focusedWindow) {
+                // Happens when an owned window is currently focused
+                focusLog.fine("Focus is on child window - transfering it back to the owner");
+                handleWindowFocusInSync(-1);
+                return true;
+            }
+            Window realNativeFocusedWindow = XWindowPeer.getNativeFocusedWindow();
+            focusLog.finest("Real native focused window: " + realNativeFocusedWindow +
+                            "\nKFM's focused window: " + focusedWindow);
+
+            // See 6522725, 6613426.
+            if (target == realNativeFocusedWindow) {
+                focusLog.fine("The window is already natively focused.");
+                return true;
+            }
+        }
+        focusLog.fine("Requesting focus to " + (this == toFocus ? "this window" : toFocus));
+
+        if (timeProvided) {
+            toFocus.requestXFocus(time);
+        } else {
+            toFocus.requestXFocus();
+        }
+        return (this == toFocus);
     }
 
     XWindowPeer actualFocusedWindow = null;
--- a/jdk/src/solaris/classes/sun/awt/X11/XDialogPeer.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/solaris/classes/sun/awt/X11/XDialogPeer.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2002-2008 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
@@ -51,7 +51,7 @@
         } else {
             winAttr.decorations = winAttr.AWT_DECOR_NONE;
         }
-        winAttr.functions = MWM_FUNC_ALL;
+        winAttr.functions = MWMConstants.MWM_FUNC_ALL;
         winAttr.isResizable =  true; //target.isResizable();
         winAttr.initialResizability =  target.isResizable();
         winAttr.title = target.getTitle();
@@ -80,14 +80,6 @@
         super.setVisible(vis);
     }
 
-    protected Insets guessInsets() {
-        if (isTargetUndecorated()) {
-            return new Insets(0, 0, 0, 0);
-        } else {
-            return super.guessInsets();
-        }
-    }
-
     @Override
     boolean isTargetUndecorated() {
         if (undecorated != null) {
@@ -100,10 +92,10 @@
     int getDecorations() {
         int d = super.getDecorations();
         // remove minimize and maximize buttons for dialogs
-        if ((d & MWM_DECOR_ALL) != 0) {
-            d |= (MWM_DECOR_MINIMIZE | MWM_DECOR_MAXIMIZE);
+        if ((d & MWMConstants.MWM_DECOR_ALL) != 0) {
+            d |= (MWMConstants.MWM_DECOR_MINIMIZE | MWMConstants.MWM_DECOR_MAXIMIZE);
         } else {
-            d &= ~(MWM_DECOR_MINIMIZE | MWM_DECOR_MAXIMIZE);
+            d &= ~(MWMConstants.MWM_DECOR_MINIMIZE | MWMConstants.MWM_DECOR_MAXIMIZE);
         }
         return d;
     }
@@ -111,10 +103,10 @@
     int getFunctions() {
         int f = super.getFunctions();
         // remove minimize and maximize functions for dialogs
-        if ((f & MWM_FUNC_ALL) != 0) {
-            f |= (MWM_FUNC_MINIMIZE | MWM_FUNC_MAXIMIZE);
+        if ((f & MWMConstants.MWM_FUNC_ALL) != 0) {
+            f |= (MWMConstants.MWM_FUNC_MINIMIZE | MWMConstants.MWM_FUNC_MAXIMIZE);
         } else {
-            f &= ~(MWM_FUNC_MINIMIZE | MWM_FUNC_MAXIMIZE);
+            f &= ~(MWMConstants.MWM_FUNC_MINIMIZE | MWMConstants.MWM_FUNC_MAXIMIZE);
         }
         return f;
     }
--- a/jdk/src/solaris/classes/sun/awt/X11/XDnDDragSourceProtocol.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/solaris/classes/sun/awt/X11/XDnDDragSourceProtocol.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2003-2005 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2003-2008 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
@@ -103,7 +103,7 @@
             XToolkit.RESTORE_XERROR_HANDLER();
 
             if (XToolkit.saved_error != null &&
-                XToolkit.saved_error.get_error_code() != XlibWrapper.Success) {
+                XToolkit.saved_error.get_error_code() != XConstants.Success) {
                 cleanup();
                 throw new XException("Cannot write XdndActionList property");
             }
@@ -124,7 +124,7 @@
             XToolkit.RESTORE_XERROR_HANDLER();
 
             if (XToolkit.saved_error != null &&
-                XToolkit.saved_error.get_error_code() != XlibWrapper.Success) {
+                XToolkit.saved_error.get_error_code() != XConstants.Success) {
                 cleanup();
                 throw new XException("Cannot write XdndActionList property");
             }
@@ -134,7 +134,7 @@
         }
 
         if (!XDnDConstants.XDnDSelection.setOwner(contents, formatMap, formats,
-                                                  XlibWrapper.CurrentTime)) {
+                                                  XConstants.CurrentTime)) {
             cleanup();
             throw new InvalidDnDOperationException("Cannot acquire selection ownership");
         }
@@ -193,11 +193,11 @@
 
         WindowPropertyGetter wpg1 =
             new WindowPropertyGetter(window, XDnDConstants.XA_XdndAware, 0, 1,
-                                     false, XlibWrapper.AnyPropertyType);
+                                     false, XConstants.AnyPropertyType);
 
         int status = wpg1.execute(XToolkit.IgnoreBadWindowHandler);
 
-        if (status == XlibWrapper.Success &&
+        if (status == XConstants.Success &&
             wpg1.getData() != 0 && wpg1.getActualType() == XAtom.XA_ATOM) {
 
             int targetVersion = (int)Native.getLong(wpg1.getData());
@@ -217,7 +217,7 @@
                 try {
                     status = wpg2.execute(XToolkit.IgnoreBadWindowHandler);
 
-                    if (status == XlibWrapper.Success &&
+                    if (status == XConstants.Success &&
                         wpg2.getData() != 0 &&
                         wpg2.getActualType() == XAtom.XA_WINDOW) {
 
@@ -235,7 +235,7 @@
                     try {
                         status = wpg3.execute(XToolkit.IgnoreBadWindowHandler);
 
-                        if (status != XlibWrapper.Success ||
+                        if (status != XConstants.Success ||
                             wpg3.getData() == 0 ||
                             wpg3.getActualType() != XAtom.XA_WINDOW ||
                             Native.getLong(wpg3.getData()) != proxy) {
@@ -246,12 +246,12 @@
                                 new WindowPropertyGetter(proxy,
                                                          XDnDConstants.XA_XdndAware,
                                                          0, 1, false,
-                                                         XlibWrapper.AnyPropertyType);
+                                                         XConstants.AnyPropertyType);
 
                             try {
                                 status = wpg4.execute(XToolkit.IgnoreBadWindowHandler);
 
-                                if (status != XlibWrapper.Success ||
+                                if (status != XConstants.Success ||
                                     wpg4.getData() == 0 ||
                                     wpg4.getActualType() != XAtom.XA_ATOM) {
 
@@ -283,7 +283,7 @@
 
         XClientMessageEvent msg = new XClientMessageEvent();
         try {
-            msg.set_type((int)XlibWrapper.ClientMessage);
+            msg.set_type((int)XConstants.ClientMessage);
             msg.set_window(getTargetWindow());
             msg.set_format(32);
             msg.set_message_type(XDnDConstants.XA_XdndEnter.getAtom());
@@ -297,7 +297,7 @@
             msg.set_data(4, formats.length > 2 ? formats[2] : 0);
             XlibWrapper.XSendEvent(XToolkit.getDisplay(),
                                    getTargetProxyWindow(),
-                                   false, XlibWrapper.NoEventMask,
+                                   false, XConstants.NoEventMask,
                                    msg.pData);
         } finally {
             msg.dispose();
@@ -311,7 +311,7 @@
 
         XClientMessageEvent msg = new XClientMessageEvent();
         try {
-            msg.set_type((int)XlibWrapper.ClientMessage);
+            msg.set_type((int)XConstants.ClientMessage);
             msg.set_window(getTargetWindow());
             msg.set_format(32);
             msg.set_message_type(XDnDConstants.XA_XdndPosition.getAtom());
@@ -322,7 +322,7 @@
             msg.set_data(4, XDnDConstants.getXDnDActionForJavaAction(sourceAction));
             XlibWrapper.XSendEvent(XToolkit.getDisplay(),
                                    getTargetProxyWindow(),
-                                   false, XlibWrapper.NoEventMask,
+                                   false, XConstants.NoEventMask,
                                    msg.pData);
         } finally {
             msg.dispose();
@@ -335,7 +335,7 @@
 
         XClientMessageEvent msg = new XClientMessageEvent();
         try {
-            msg.set_type((int)XlibWrapper.ClientMessage);
+            msg.set_type((int)XConstants.ClientMessage);
             msg.set_window(getTargetWindow());
             msg.set_format(32);
             msg.set_message_type(XDnDConstants.XA_XdndLeave.getAtom());
@@ -346,7 +346,7 @@
             msg.set_data(4, 0);
             XlibWrapper.XSendEvent(XToolkit.getDisplay(),
                                    getTargetProxyWindow(),
-                                   false, XlibWrapper.NoEventMask,
+                                   false, XConstants.NoEventMask,
                                    msg.pData);
         } finally {
             msg.dispose();
@@ -361,7 +361,7 @@
 
         XClientMessageEvent msg = new XClientMessageEvent();
         try {
-            msg.set_type((int)XlibWrapper.ClientMessage);
+            msg.set_type((int)XConstants.ClientMessage);
             msg.set_window(getTargetWindow());
             msg.set_format(32);
             msg.set_message_type(XDnDConstants.XA_XdndDrop.getAtom());
@@ -372,7 +372,7 @@
             msg.set_data(4, 0);
             XlibWrapper.XSendEvent(XToolkit.getDisplay(),
                                    getTargetProxyWindow(),
-                                   false, XlibWrapper.NoEventMask,
+                                   false, XConstants.NoEventMask,
                                    msg.pData);
         } finally {
             msg.dispose();
@@ -406,7 +406,7 @@
             assert XToolkit.isAWTLockHeldByCurrentThread();
 
             XlibWrapper.XSendEvent(XToolkit.getDisplay(), sourceWindow,
-                                   false, XlibWrapper.NoEventMask,
+                                   false, XConstants.NoEventMask,
                                    xclient.pData);
 
             return true;
--- a/jdk/src/solaris/classes/sun/awt/X11/XDnDDropTargetProtocol.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/solaris/classes/sun/awt/X11/XDnDDropTargetProtocol.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2003-2005 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2003-2008 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
@@ -93,7 +93,7 @@
             XToolkit.RESTORE_XERROR_HANDLER();
 
             if (XToolkit.saved_error != null &&
-                XToolkit.saved_error.get_error_code() != XlibWrapper.Success) {
+                XToolkit.saved_error.get_error_code() != XConstants.Success) {
                 throw new XException("Cannot write XdndAware property");
             }
         } finally {
@@ -119,12 +119,12 @@
 
         WindowPropertyGetter wpg1 =
             new WindowPropertyGetter(embedder, XDnDConstants.XA_XdndAware, 0, 1,
-                                     false, XlibWrapper.AnyPropertyType);
+                                     false, XConstants.AnyPropertyType);
 
         try {
             status = wpg1.execute(XToolkit.IgnoreBadWindowHandler);
 
-            if (status == XlibWrapper.Success &&
+            if (status == XConstants.Success &&
                 wpg1.getData() != 0 && wpg1.getActualType() == XAtom.XA_ATOM) {
 
                 overriden = true;
@@ -143,7 +143,7 @@
             try {
                 status = wpg2.execute(XToolkit.IgnoreBadWindowHandler);
 
-                if (status == XlibWrapper.Success &&
+                if (status == XConstants.Success &&
                     wpg2.getData() != 0 &&
                     wpg2.getActualType() == XAtom.XA_WINDOW) {
 
@@ -161,7 +161,7 @@
                 try {
                     status = wpg3.execute(XToolkit.IgnoreBadWindowHandler);
 
-                    if (status != XlibWrapper.Success ||
+                    if (status != XConstants.Success ||
                         wpg3.getData() == 0 ||
                         wpg3.getActualType() != XAtom.XA_WINDOW ||
                         Native.getLong(wpg3.getData()) != proxy) {
@@ -172,12 +172,12 @@
                             new WindowPropertyGetter(proxy,
                                                      XDnDConstants.XA_XdndAware,
                                                      0, 1, false,
-                                                     XlibWrapper.AnyPropertyType);
+                                                     XConstants.AnyPropertyType);
 
                         try {
                             status = wpg4.execute(XToolkit.IgnoreBadWindowHandler);
 
-                            if (status != XlibWrapper.Success ||
+                            if (status != XConstants.Success ||
                                 wpg4.getData() == 0 ||
                                 wpg4.getActualType() != XAtom.XA_ATOM) {
 
@@ -212,7 +212,7 @@
 
             if (XToolkit.saved_error != null &&
                 XToolkit.saved_error.get_error_code() !=
-                XlibWrapper.Success) {
+                XConstants.Success) {
                 throw new XException("Cannot write XdndAware property");
             }
 
@@ -226,7 +226,7 @@
 
             if (XToolkit.saved_error != null &&
                 XToolkit.saved_error.get_error_code() !=
-                XlibWrapper.Success) {
+                XConstants.Success) {
                 throw new XException("Cannot write XdndProxy property");
             }
 
@@ -239,7 +239,7 @@
 
             if (XToolkit.saved_error != null &&
                 XToolkit.saved_error.get_error_code() !=
-                XlibWrapper.Success) {
+                XConstants.Success) {
                 throw new XException("Cannot write XdndAware property");
             }
 
@@ -252,7 +252,7 @@
 
             if (XToolkit.saved_error != null &&
                 XToolkit.saved_error.get_error_code() !=
-                XlibWrapper.Success) {
+                XConstants.Success) {
                 throw new XException("Cannot write XdndProxy property");
             }
         } finally {
@@ -285,7 +285,7 @@
 
                 if (XToolkit.saved_error != null &&
                     XToolkit.saved_error.get_error_code() !=
-                    XlibWrapper.Success) {
+                    XConstants.Success) {
                     throw new XException("Cannot write XdndAware property");
                 }
 
@@ -298,7 +298,7 @@
 
                 if (XToolkit.saved_error != null &&
                     XToolkit.saved_error.get_error_code() !=
-                    XlibWrapper.Success) {
+                    XConstants.Success) {
                     throw new XException("Cannot write XdndProxy property");
                 }
             } finally {
@@ -326,12 +326,12 @@
 
         WindowPropertyGetter wpg1 =
             new WindowPropertyGetter(embedded, XDnDConstants.XA_XdndAware, 0, 1,
-                                     false, XlibWrapper.AnyPropertyType);
+                                     false, XConstants.AnyPropertyType);
 
         try {
             status = wpg1.execute(XToolkit.IgnoreBadWindowHandler);
 
-            if (status == XlibWrapper.Success &&
+            if (status == XConstants.Success &&
                 wpg1.getData() != 0 && wpg1.getActualType() == XAtom.XA_ATOM) {
 
                 overriden = true;
@@ -350,7 +350,7 @@
             try {
                 status = wpg2.execute(XToolkit.IgnoreBadWindowHandler);
 
-                if (status == XlibWrapper.Success &&
+                if (status == XConstants.Success &&
                     wpg2.getData() != 0 &&
                     wpg2.getActualType() == XAtom.XA_WINDOW) {
 
@@ -368,7 +368,7 @@
                 try {
                     status = wpg3.execute(XToolkit.IgnoreBadWindowHandler);
 
-                    if (status != XlibWrapper.Success ||
+                    if (status != XConstants.Success ||
                         wpg3.getData() == 0 ||
                         wpg3.getActualType() != XAtom.XA_WINDOW ||
                         Native.getLong(wpg3.getData()) != proxy) {
@@ -379,12 +379,12 @@
                             new WindowPropertyGetter(proxy,
                                                      XDnDConstants.XA_XdndAware,
                                                      0, 1, false,
-                                                     XlibWrapper.AnyPropertyType);
+                                                     XConstants.AnyPropertyType);
 
                         try {
                             status = wpg4.execute(XToolkit.IgnoreBadWindowHandler);
 
-                            if (status != XlibWrapper.Success ||
+                            if (status != XConstants.Success ||
                                 wpg4.getData() == 0 ||
                                 wpg4.getActualType() != XAtom.XA_ATOM) {
 
@@ -408,12 +408,12 @@
 
         WindowPropertyGetter wpg1 =
             new WindowPropertyGetter(window, XDnDConstants.XA_XdndAware, 0, 1,
-                                     false, XlibWrapper.AnyPropertyType);
+                                     false, XConstants.AnyPropertyType);
 
         try {
             int status = wpg1.execute(XToolkit.IgnoreBadWindowHandler);
 
-            if (status == XlibWrapper.Success &&
+            if (status == XConstants.Success &&
                 wpg1.getData() != 0 && wpg1.getActualType() == XAtom.XA_ATOM) {
 
                 return true;
@@ -523,7 +523,7 @@
 
             for (int i = 0; i < 3; i++) {
                 long j;
-                if ((j = xclient.get_data(2 + i)) != XlibWrapper.None) {
+                if ((j = xclient.get_data(2 + i)) != XConstants.None) {
                     formats3[countFormats++] = j;
                 }
             }
@@ -549,7 +549,7 @@
 
             if (status == 0 ||
                 (XToolkit.saved_error != null &&
-                 XToolkit.saved_error.get_error_code() != XlibWrapper.Success)) {
+                 XToolkit.saved_error.get_error_code() != XConstants.Success)) {
                 throw new XException("XGetWindowAttributes failed");
             }
 
@@ -561,12 +561,12 @@
         XToolkit.WITH_XERROR_HANDLER(XToolkit.IgnoreBadWindowHandler);
         XlibWrapper.XSelectInput(XToolkit.getDisplay(), source_win,
                                  source_win_mask |
-                                 XlibWrapper.StructureNotifyMask);
+                                 XConstants.StructureNotifyMask);
 
         XToolkit.RESTORE_XERROR_HANDLER();
 
         if (XToolkit.saved_error != null &&
-            XToolkit.saved_error.get_error_code() != XlibWrapper.Success) {
+            XToolkit.saved_error.get_error_code() != XConstants.Success) {
             throw new XException("XSelectInput failed");
         }
 
@@ -581,7 +581,7 @@
     }
 
     private boolean processXdndPosition(XClientMessageEvent xclient) {
-        long time_stamp = (int)XlibWrapper.CurrentTime;
+        long time_stamp = (int)XConstants.CurrentTime;
         long xdnd_action = 0;
         int java_action = DnDConstants.ACTION_NONE;
         int x = 0;
@@ -748,7 +748,7 @@
                                                 long data3, long data4) {
         XClientMessageEvent enter = new XClientMessageEvent();
         try {
-            enter.set_type((int)XlibWrapper.ClientMessage);
+            enter.set_type((int)XConstants.ClientMessage);
             enter.set_window(toplevel);
             enter.set_format(32);
             enter.set_message_type(XDnDConstants.XA_XdndEnter.getAtom());
@@ -774,7 +774,7 @@
                                                   long sourceWindow) {
         XClientMessageEvent leave = new XClientMessageEvent();
         try {
-            leave.set_type((int)XlibWrapper.ClientMessage);
+            leave.set_type((int)XConstants.ClientMessage);
             leave.set_window(toplevel);
             leave.set_format(32);
             leave.set_message_type(XDnDConstants.XA_XdndLeave.getAtom());
@@ -804,7 +804,7 @@
 
         XClientMessageEvent msg = new XClientMessageEvent();
         try {
-            msg.set_type((int)XlibWrapper.ClientMessage);
+            msg.set_type((int)XConstants.ClientMessage);
             msg.set_window(xclient.get_data(0));
             msg.set_format(32);
             msg.set_message_type(XDnDConstants.XA_XdndStatus.getAtom());
@@ -826,7 +826,7 @@
             try {
                 XlibWrapper.XSendEvent(XToolkit.getDisplay(),
                                        xclient.get_data(0),
-                                       false, XlibWrapper.NoEventMask,
+                                       false, XConstants.NoEventMask,
                                        msg.pData);
             } finally {
                 XToolkit.awtUnlock();
@@ -842,7 +842,7 @@
       throws IllegalArgumentException, IOException {
         XClientMessageEvent xclient = new XClientMessageEvent(ctxt);
         long message_type = xclient.get_message_type();
-        long time_stamp = XlibWrapper.CurrentTime;
+        long time_stamp = XConstants.CurrentTime;
 
         // NOTE: we assume that the source supports at least version 1, so we
         // can use the time stamp
@@ -892,7 +892,7 @@
 
         XClientMessageEvent msg = new XClientMessageEvent();
         try {
-            msg.set_type((int)XlibWrapper.ClientMessage);
+            msg.set_type((int)XConstants.ClientMessage);
             msg.set_window(xclient.get_data(0));
             msg.set_format(32);
             msg.set_message_type(XDnDConstants.XA_XdndFinished.getAtom());
@@ -914,7 +914,7 @@
             try {
                 XlibWrapper.XSendEvent(XToolkit.getDisplay(),
                                        xclient.get_data(0),
-                                       false, XlibWrapper.NoEventMask,
+                                       false, XConstants.NoEventMask,
                                        msg.pData);
             } finally {
                 XToolkit.awtUnlock();
@@ -1119,7 +1119,7 @@
                                 XToolkit.RESTORE_XERROR_HANDLER();
 
                                 if (XToolkit.saved_error != null &&
-                                    XToolkit.saved_error.get_error_code() != XlibWrapper.Success) {
+                                    XToolkit.saved_error.get_error_code() != XConstants.Success) {
                                     if (logger.isLoggable(Level.WARNING)) {
                                         logger.warning("Cannot set XdndTypeList on the proxy window");
                                     }
--- a/jdk/src/solaris/classes/sun/awt/X11/XDragSourceContextPeer.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/solaris/classes/sun/awt/X11/XDragSourceContextPeer.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2003-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2003-2008 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
@@ -55,11 +55,11 @@
         Logger.getLogger("sun.awt.X11.xembed.xdnd.XDragSourceContextPeer");
 
     /* The events selected on the root window when the drag begins. */
-    private static final int ROOT_EVENT_MASK = (int)XlibWrapper.ButtonMotionMask |
-        (int)XlibWrapper.KeyPressMask | (int)XlibWrapper.KeyReleaseMask;
+    private static final int ROOT_EVENT_MASK = (int)XConstants.ButtonMotionMask |
+        (int)XConstants.KeyPressMask | (int)XConstants.KeyReleaseMask;
     /* The events to be delivered during grab. */
-    private static final int GRAB_EVENT_MASK = (int)XlibWrapper.ButtonPressMask |
-        (int)XlibWrapper.ButtonMotionMask | (int)XlibWrapper.ButtonReleaseMask;
+    private static final int GRAB_EVENT_MASK = (int)XConstants.ButtonPressMask |
+        (int)XConstants.ButtonMotionMask | (int)XConstants.ButtonReleaseMask;
 
     /* The event mask of the root window before the drag operation starts. */
     private long rootEventMask = 0;
@@ -196,11 +196,11 @@
 
                 status = XlibWrapper.XGrabPointer(XToolkit.getDisplay(), rootWindow,
                                                   0, GRAB_EVENT_MASK,
-                                                  XlibWrapper.GrabModeAsync,
-                                                  XlibWrapper.GrabModeAsync,
-                                                  XlibWrapper.None, xcursor, timeStamp);
+                                                  XConstants.GrabModeAsync,
+                                                  XConstants.GrabModeAsync,
+                                                  XConstants.None, xcursor, timeStamp);
 
-                if (status != XlibWrapper.GrabSuccess) {
+                if (status != XConstants.GrabSuccess) {
                     cleanup(timeStamp);
                     throwGrabFailureException("Cannot grab pointer", status);
                     return;
@@ -208,11 +208,11 @@
 
                 status = XlibWrapper.XGrabKeyboard(XToolkit.getDisplay(), rootWindow,
                                                    0,
-                                                   XlibWrapper.GrabModeAsync,
-                                                   XlibWrapper.GrabModeAsync,
+                                                   XConstants.GrabModeAsync,
+                                                   XConstants.GrabModeAsync,
                                                    timeStamp);
 
-                if (status != XlibWrapper.GrabSuccess) {
+                if (status != XConstants.GrabSuccess) {
                     cleanup(timeStamp);
                     throwGrabFailureException("Cannot grab keyboard", status);
                     return;
@@ -276,7 +276,7 @@
         XlibWrapper.XChangeActivePointerGrab(XToolkit.getDisplay(),
                                              GRAB_EVENT_MASK,
                                              xcursor,
-                                             XlibWrapper.CurrentTime);
+                                             XConstants.CurrentTime);
     }
 
     protected boolean needsBogusExitBeforeDrop() {
@@ -287,10 +287,10 @@
       throws InvalidDnDOperationException {
         String msgCause = "";
         switch (grabStatus) {
-        case XlibWrapper.GrabNotViewable:  msgCause = "not viewable";    break;
-        case XlibWrapper.AlreadyGrabbed:   msgCause = "already grabbed"; break;
-        case XlibWrapper.GrabInvalidTime:  msgCause = "invalid time";    break;
-        case XlibWrapper.GrabFrozen:       msgCause = "grab frozen";     break;
+        case XConstants.GrabNotViewable:  msgCause = "not viewable";    break;
+        case XConstants.AlreadyGrabbed:   msgCause = "already grabbed"; break;
+        case XConstants.GrabInvalidTime:  msgCause = "invalid time";    break;
+        case XConstants.GrabFrozen:       msgCause = "grab frozen";     break;
         default:                           msgCause = "unknown failure"; break;
         }
         throw new InvalidDnDOperationException(msg + ": " + msgCause);
@@ -537,7 +537,7 @@
             return false;
         }
 
-        if (ev.get_type() != (int)XlibWrapper.ClientMessage) {
+        if (ev.get_type() != (int)XConstants.ClientMessage) {
             return false;
         }
 
@@ -579,18 +579,18 @@
         }
 
         switch (ev.get_type()) {
-        case XlibWrapper.ClientMessage: {
+        case XConstants.ClientMessage: {
             XClientMessageEvent xclient = ev.get_xclient();
             return processClientMessage(xclient);
         }
-        case XlibWrapper.DestroyNotify: {
+        case XConstants.DestroyNotify: {
             XDestroyWindowEvent xde = ev.get_xdestroywindow();
 
             /* Target crashed during drop processing - cleanup. */
             if (!dragInProgress &&
                 dragProtocol != null &&
                 xde.get_window() == dragProtocol.getTargetWindow()) {
-                cleanup(XlibWrapper.CurrentTime);
+                cleanup(XConstants.CurrentTime);
                 return true;
             }
             /* Pass along */
@@ -604,14 +604,14 @@
 
         /* Process drag-only messages. */
         switch (ev.get_type()) {
-        case XlibWrapper.KeyRelease:
-        case XlibWrapper.KeyPress: {
+        case XConstants.KeyRelease:
+        case XConstants.KeyPress: {
             XKeyEvent xkey = ev.get_xkey();
             long keysym = XlibWrapper.XKeycodeToKeysym(XToolkit.getDisplay(),
                                                        xkey.get_keycode(), 0);
             switch ((int)keysym) {
             case (int)XKeySymConstants.XK_Escape: {
-                if (ev.get_type() == (int)XlibWrapper.KeyRelease) {
+                if (ev.get_type() == (int)XConstants.KeyRelease) {
                     cleanup(xkey.get_time());
                 }
                 break;
@@ -631,7 +631,7 @@
                                           XlibWrapper.larg7); // modifiers
                 XMotionEvent xmotion = new XMotionEvent();
                 try {
-                    xmotion.set_type(XlibWrapper.MotionNotify);
+                    xmotion.set_type(XConstants.MotionNotify);
                     xmotion.set_serial(xkey.get_serial());
                     xmotion.set_send_event(xkey.get_send_event());
                     xmotion.set_display(xkey.get_display());
@@ -658,12 +658,12 @@
             }
             return true;
         }
-        case XlibWrapper.ButtonPress:
+        case XConstants.ButtonPress:
             return true;
-        case XlibWrapper.MotionNotify:
+        case XConstants.MotionNotify:
             processMouseMove(ev.get_xmotion());
             return true;
-        case XlibWrapper.ButtonRelease: {
+        case XConstants.ButtonRelease: {
             XButtonEvent xbutton = ev.get_xbutton();
             /*
              * On some X servers it could happen that ButtonRelease coordinates
@@ -672,7 +672,7 @@
              */
             XMotionEvent xmotion = new XMotionEvent();
             try {
-                xmotion.set_type(XlibWrapper.MotionNotify);
+                xmotion.set_type(XConstants.MotionNotify);
                 xmotion.set_serial(xbutton.get_serial());
                 xmotion.set_send_event(xbutton.get_send_event());
                 xmotion.set_display(xbutton.get_display());
@@ -694,8 +694,8 @@
             } finally {
                 xmotion.dispose();
             }
-            if (xbutton.get_button() == XlibWrapper.Button1
-                    || xbutton.get_button() == XlibWrapper.Button2) {
+            if (xbutton.get_button() == XConstants.Button1
+                    || xbutton.get_button() == XConstants.Button2) {
                 // drag is initiated with Button1 or Button2 pressed and
                 // ended on release of either of these buttons (as the same
                 // behavior was with our old Motif DnD-based implementation)
@@ -789,6 +789,6 @@
         dragDropFinished(success, action, x, y);
 
         dndInProgress = false;
-        cleanup(XlibWrapper.CurrentTime);
+        cleanup(XConstants.CurrentTime);
     }
 }
--- a/jdk/src/solaris/classes/sun/awt/X11/XDragSourceProtocol.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/solaris/classes/sun/awt/X11/XDragSourceProtocol.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2003-2005 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2003-2008 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
@@ -189,7 +189,7 @@
 
             if (status == 0 ||
                 (XToolkit.saved_error != null &&
-                 XToolkit.saved_error.get_error_code() != XlibWrapper.Success)) {
+                 XToolkit.saved_error.get_error_code() != XConstants.Success)) {
                 throw new XException("XGetWindowAttributes failed");
             }
 
@@ -201,12 +201,12 @@
         XToolkit.WITH_XERROR_HANDLER(XToolkit.IgnoreBadWindowHandler);
         XlibWrapper.XSelectInput(XToolkit.getDisplay(), targetWindow,
                                  targetWindowMask |
-                                 XlibWrapper.StructureNotifyMask);
+                                 XConstants.StructureNotifyMask);
 
         XToolkit.RESTORE_XERROR_HANDLER();
 
         if (XToolkit.saved_error != null &&
-            XToolkit.saved_error.get_error_code() != XlibWrapper.Success) {
+            XToolkit.saved_error.get_error_code() != XConstants.Success) {
             throw new XException("XSelectInput failed");
         }
 
--- a/jdk/src/solaris/classes/sun/awt/X11/XDropTargetEventProcessor.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/solaris/classes/sun/awt/X11/XDropTargetEventProcessor.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2003-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2003-2008 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
@@ -43,7 +43,7 @@
     private XDropTargetEventProcessor() {}
 
     private boolean doProcessEvent(XEvent ev) {
-        if (ev.get_type() == (int)XlibWrapper.DestroyNotify &&
+        if (ev.get_type() == (int)XConstants.DestroyNotify &&
             protocol != null &&
             ev.get_xany().get_window() == protocol.getSourceWindow()) {
             protocol.cleanup();
@@ -51,7 +51,7 @@
             return false;
         }
 
-        if (ev.get_type() == (int)XlibWrapper.PropertyNotify) {
+        if (ev.get_type() == (int)XConstants.PropertyNotify) {
             XPropertyEvent xproperty = ev.get_xproperty();
             if (xproperty.get_atom() ==
                 MotifDnDConstants.XA_MOTIF_DRAG_RECEIVER_INFO.getAtom()) {
@@ -60,7 +60,7 @@
             }
         }
 
-        if (ev.get_type() != (int)XlibWrapper.ClientMessage) {
+        if (ev.get_type() != (int)XConstants.ClientMessage) {
             return false;
         }
 
--- a/jdk/src/solaris/classes/sun/awt/X11/XDropTargetProtocol.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/solaris/classes/sun/awt/X11/XDropTargetProtocol.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2003-2005 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2003-2008 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
@@ -149,7 +149,7 @@
         XToolkit.awtLock();
         try {
             XlibWrapper.XSendEvent(XToolkit.getDisplay(), proxy, false,
-                                   XlibWrapper.NoEventMask, xclient.pData);
+                                   XConstants.NoEventMask, xclient.pData);
         } finally {
             XToolkit.awtUnlock();
         }
@@ -317,7 +317,7 @@
 
     protected final void removeEmbedderRegistryEntry(long embedder) {
         synchronized (this) {
-            embedderRegistry.remove(new Long(embedder));
+            embedderRegistry.remove(Long.valueOf(embedder));
         }
     }
 }
--- a/jdk/src/solaris/classes/sun/awt/X11/XDropTargetRegistry.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/solaris/classes/sun/awt/X11/XDropTargetRegistry.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2003-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2003-2008 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,18 +27,14 @@
 
 import java.util.ArrayList;
 import java.util.Collections;
-import java.util.Enumeration;
 import java.util.HashMap;
 import java.util.HashSet;
-import java.util.Hashtable;
 import java.util.Iterator;
 import java.util.List;
 import java.util.logging.*;
 
 import java.awt.Point;
 
-import sun.awt.dnd.SunDropTargetContextPeer;
-import sun.awt.dnd.SunDropTargetEvent;
 
 /**
  * The class responsible for registration/deregistration of drop sites.
@@ -179,11 +175,11 @@
 
                         if (status == 0 ||
                             (XToolkit.saved_error != null &&
-                             XToolkit.saved_error.get_error_code() != XlibWrapper.Success)) {
+                             XToolkit.saved_error.get_error_code() != XConstants.Success)) {
                             continue;
                         }
 
-                        if (wattr.get_map_state() != XlibWrapper.IsUnmapped
+                        if (wattr.get_map_state() != XConstants.IsUnmapped
                             && dest_x < wattr.get_width()
                             && dest_y < wattr.get_height()) {
                             return window;
@@ -233,7 +229,7 @@
 
                 if (status == 0 ||
                     (XToolkit.saved_error != null &&
-                     XToolkit.saved_error.get_error_code() != XlibWrapper.Success)) {
+                     XToolkit.saved_error.get_error_code() != XConstants.Success)) {
                     throw new XException("XGetWindowAttributes failed");
                 }
 
@@ -243,14 +239,14 @@
                 wattr.dispose();
             }
 
-            if ((event_mask & XlibWrapper.PropertyChangeMask) == 0) {
+            if ((event_mask & XConstants.PropertyChangeMask) == 0) {
                 XToolkit.WITH_XERROR_HANDLER(XToolkit.IgnoreBadWindowHandler);
                 XlibWrapper.XSelectInput(XToolkit.getDisplay(), embedder,
-                                         event_mask | XlibWrapper.PropertyChangeMask);
+                                         event_mask | XConstants.PropertyChangeMask);
                 XToolkit.RESTORE_XERROR_HANDLER();
 
                 if (XToolkit.saved_error != null &&
-                    XToolkit.saved_error.get_error_code() != XlibWrapper.Success) {
+                    XToolkit.saved_error.get_error_code() != XConstants.Success) {
                     throw new XException("XSelectInput failed");
                 }
             }
@@ -329,7 +325,7 @@
 
         embedderProtocols = Collections.unmodifiableList(embedderProtocols);
 
-        Long lToplevel = new Long(embedder);
+        Long lToplevel = Long.valueOf(embedder);
         boolean isXEmbedServer = false;
         synchronized (this) {
             EmbeddedDropSiteEntry entry =
@@ -397,14 +393,14 @@
             long event_mask = entry.getEventMask();
 
             /* Restore the original event mask for the embedder. */
-            if ((event_mask & XlibWrapper.PropertyChangeMask) == 0) {
+            if ((event_mask & XConstants.PropertyChangeMask) == 0) {
                 XToolkit.WITH_XERROR_HANDLER(XToolkit.IgnoreBadWindowHandler);
                 XlibWrapper.XSelectInput(XToolkit.getDisplay(), embedder,
                                          event_mask);
                 XToolkit.RESTORE_XERROR_HANDLER();
 
                 if (XToolkit.saved_error != null &&
-                    XToolkit.saved_error.get_error_code() != XlibWrapper.Success) {
+                    XToolkit.saved_error.get_error_code() != XConstants.Success) {
                     throw new XException("XSelectInput failed");
                 }
             }
--- a/jdk/src/solaris/classes/sun/awt/X11/XEmbedCanvasPeer.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/solaris/classes/sun/awt/X11/XEmbedCanvasPeer.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2003-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2003-2008 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
@@ -81,10 +81,10 @@
         super.preInit(params);
 
         params.put(EVENT_MASK,
-                   KeyPressMask       | KeyReleaseMask
-                   | FocusChangeMask  | ButtonPressMask | ButtonReleaseMask
-                   | EnterWindowMask  | LeaveWindowMask | PointerMotionMask
-                   | ButtonMotionMask | ExposureMask    | StructureNotifyMask | SubstructureNotifyMask);
+                   XConstants.KeyPressMask       | XConstants.KeyReleaseMask
+                   | XConstants.FocusChangeMask  | XConstants.ButtonPressMask | XConstants.ButtonReleaseMask
+                   | XConstants.EnterWindowMask  | XConstants.LeaveWindowMask | XConstants.PointerMotionMask
+                   | XConstants.ButtonMotionMask | XConstants.ExposureMask    | XConstants.StructureNotifyMask | XConstants.SubstructureNotifyMask);
 
     }
 
@@ -134,7 +134,7 @@
         try {
             XToolkit.addEventDispatcher(xembed.handle, xembed);
             XlibWrapper.XSelectInput(XToolkit.getDisplay(), xembed.handle,
-                                     XlibWrapper.StructureNotifyMask | XlibWrapper.PropertyChangeMask);
+                                     XConstants.StructureNotifyMask | XConstants.PropertyChangeMask);
 
             XDropTargetRegistry.getRegistry().registerXEmbedClient(getWindow(), xembed.handle);
         } finally {
@@ -194,7 +194,7 @@
     public void dispatchEvent(XEvent ev) {
         super.dispatchEvent(ev);
         switch (ev.get_type()) {
-          case CreateNotify:
+          case XConstants.CreateNotify:
               XCreateWindowEvent cr = ev.get_xcreatewindow();
               if (xembedLog.isLoggable(Level.FINEST)) {
                   xembedLog.finest("Message on embedder: " + cr);
@@ -205,7 +205,7 @@
               }
               embedChild(cr.get_window());
               break;
-          case DestroyNotify:
+          case XConstants.DestroyNotify:
               XDestroyWindowEvent dn = ev.get_xdestroywindow();
               if (xembedLog.isLoggable(Level.FINEST)) {
                   xembedLog.finest("Message on embedder: " + dn);
@@ -215,7 +215,7 @@
               }
               childDestroyed();
               break;
-          case ReparentNotify:
+          case XConstants.ReparentNotify:
               XReparentEvent rep = ev.get_xreparent();
               if (xembedLog.isLoggable(Level.FINEST)) {
                   xembedLog.finest("Message on embedder: " + rep);
@@ -309,7 +309,7 @@
 
                 if (status == 0 ||
                     (XToolkit.saved_error != null &&
-                     XToolkit.saved_error.get_error_code() != XlibWrapper.Success)) {
+                     XToolkit.saved_error.get_error_code() != XConstants.Success)) {
                     return null;
                 }
 
@@ -480,7 +480,7 @@
             if (xembedLog.isLoggable(Level.FINE)) xembedLog.fine("Forwarding native key event: " + ke);
             XToolkit.awtLock();
             try {
-                XlibWrapper.XSendEvent(XToolkit.getDisplay(), xembed.handle, false, XlibWrapper.NoEventMask, data);
+                XlibWrapper.XSendEvent(XToolkit.getDisplay(), xembed.handle, false, XConstants.NoEventMask, data);
             } finally {
                 XToolkit.awtUnlock();
             }
@@ -742,7 +742,7 @@
                 version = Native.getCard32(xembed_info_data, 0);
                 flags = Native.getCard32(xembed_info_data, 1);
                 boolean new_mapped = (flags & XEMBED_MAPPED) != 0;
-                boolean currently_mapped = XlibUtil.getWindowMapState(handle) != XlibWrapper.IsUnmapped;
+                boolean currently_mapped = XlibUtil.getWindowMapState(handle) != XConstants.IsUnmapped;
                 if (new_mapped != currently_mapped) {
                     if (xembedLog.isLoggable(Level.FINER))
                         xembedLog.fine("Mapping state of the client has changed, old state: " + currently_mapped + ", new state: " + new_mapped);
@@ -803,13 +803,13 @@
         public void dispatchEvent(XEvent xev) {
             int type = xev.get_type();
             switch (type) {
-              case PropertyNotify:
+              case XConstants.PropertyNotify:
                   handlePropertyNotify(xev);
                   break;
-              case ConfigureNotify:
+              case XConstants.ConfigureNotify:
                   handleConfigureNotify(xev);
                   break;
-              case ClientMessage:
+              case XConstants.ClientMessage:
                   handleClientMessage(xev);
                   break;
             }
@@ -844,7 +844,7 @@
                 XKeyEvent ke = new XKeyEvent(data);
 
                 // We recognize only these masks
-                modifiers = ke.get_state() & (ShiftMask | ControlMask | LockMask);
+                modifiers = ke.get_state() & (XConstants.ShiftMask | XConstants.ControlMask | XConstants.LockMask);
                 if (xembedLog.isLoggable(Level.FINEST)) xembedLog.finest("Mapped " + e + " to " + this);
             } finally {
                 XlibWrapper.unsafe.freeMemory(data);
--- a/jdk/src/solaris/classes/sun/awt/X11/XEmbedChildProxyPeer.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/solaris/classes/sun/awt/X11/XEmbedChildProxyPeer.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2003-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2003-2008 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
@@ -53,7 +53,7 @@
         try {
             XToolkit.addEventDispatcher(handle, this);
             XlibWrapper.XSelectInput(XToolkit.getDisplay(), handle,
-                    XlibWrapper.StructureNotifyMask | XlibWrapper.PropertyChangeMask);
+                    XConstants.StructureNotifyMask | XConstants.PropertyChangeMask);
         }
         finally {
             XToolkit.awtUnlock();
@@ -341,10 +341,10 @@
     public void dispatchEvent(XEvent xev) {
         int type = xev.get_type();
         switch (type) {
-          case XlibWrapper.PropertyNotify:
+          case XConstants.PropertyNotify:
               handlePropertyNotify(xev);
               break;
-          case XlibWrapper.ConfigureNotify:
+          case XConstants.ConfigureNotify:
               handleConfigureNotify(xev);
               break;
         }
--- a/jdk/src/solaris/classes/sun/awt/X11/XEmbedClientHelper.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/solaris/classes/sun/awt/X11/XEmbedClientHelper.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2003-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2003-2008 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
@@ -145,10 +145,10 @@
 
     public void dispatchEvent(XEvent xev) {
         switch(xev.get_type()) {
-          case XlibWrapper.ClientMessage:
+          case XConstants.ClientMessage:
               handleClientMessage(xev);
               break;
-          case XlibWrapper.ReparentNotify:
+          case XConstants.ReparentNotify:
               handleReparentNotify(xev);
               break;
         }
--- a/jdk/src/solaris/classes/sun/awt/X11/XEmbedHelper.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/solaris/classes/sun/awt/X11/XEmbedHelper.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2003-2005 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2003-2008 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
@@ -94,7 +94,7 @@
     }
     void sendMessage(long window, int message, long detail, long data1, long data2) {
         XClientMessageEvent msg = new XClientMessageEvent();
-        msg.set_type((int)XlibWrapper.ClientMessage);
+        msg.set_type((int)XConstants.ClientMessage);
         msg.set_window(window);
         msg.set_message_type(XEmbed.getAtom());
         msg.set_format(32);
@@ -106,7 +106,7 @@
         XToolkit.awtLock();
         try {
             if (xembedLog.isLoggable(Level.FINE)) xembedLog.fine("Sending " + XEmbedMessageToString(msg));
-            XlibWrapper.XSendEvent(XToolkit.getDisplay(), window, false, XlibWrapper.NoEventMask, msg.pData);
+            XlibWrapper.XSendEvent(XToolkit.getDisplay(), window, false, XConstants.NoEventMask, msg.pData);
         }
         finally {
             XToolkit.awtUnlock();
--- a/jdk/src/solaris/classes/sun/awt/X11/XEmbedServerTester.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/solaris/classes/sun/awt/X11/XEmbedServerTester.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2003-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2003-2008 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
@@ -260,7 +260,7 @@
         mapped = 0;
         embedCompletely();
         sleep(1000);
-        if (XlibUtil.getWindowMapState(window.getWindow()) != XlibWrapper.IsUnmapped) {
+        if (XlibUtil.getWindowMapState(window.getWindow()) != IsUnmapped) {
             throw new RuntimeException("Client has been mapped");
         }
     }
@@ -383,11 +383,11 @@
         try {
             XCreateWindowParams params =
                 new XCreateWindowParams(new Object[] {
-                    XBaseWindow.PARENT_WINDOW, new Long(reparent?XToolkit.getDefaultRootWindow():parent),
+                    XBaseWindow.PARENT_WINDOW, Long.valueOf(reparent?XToolkit.getDefaultRootWindow():parent),
                     XBaseWindow.BOUNDS, initialBounds,
                     XBaseWindow.EMBEDDED, Boolean.TRUE,
                     XBaseWindow.VISIBLE, Boolean.valueOf(mapped == XEmbedHelper.XEMBED_MAPPED),
-                    XBaseWindow.EVENT_MASK, new Long(VisibilityChangeMask | StructureNotifyMask |
+                    XBaseWindow.EVENT_MASK, Long.valueOf(VisibilityChangeMask | StructureNotifyMask |
                                                      SubstructureNotifyMask | KeyPressMask)});
             window = new XBaseWindow(params);
 
@@ -613,12 +613,12 @@
         }
     }
     private void checkMapped() {
-        if (XlibUtil.getWindowMapState(window.getWindow()) == XlibWrapper.IsUnmapped) {
+        if (XlibUtil.getWindowMapState(window.getWindow()) == IsUnmapped) {
             throw new RuntimeException("Client is not mapped");
         }
     }
     private void checkNotMapped() {
-        if (XlibUtil.getWindowMapState(window.getWindow()) != XlibWrapper.IsUnmapped) {
+        if (XlibUtil.getWindowMapState(window.getWindow()) != IsUnmapped) {
             throw new RuntimeException("Client is mapped");
         }
     }
--- a/jdk/src/solaris/classes/sun/awt/X11/XEmbeddedFramePeer.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/solaris/classes/sun/awt/X11/XEmbeddedFramePeer.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2002-2008 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
@@ -114,8 +114,8 @@
     protected boolean isEventDisabled(XEvent e) {
         if (embedder != null && embedder.isActive()) {
             switch (e.get_type()) {
-              case FocusIn:
-              case FocusOut:
+              case XConstants.FocusIn:
+              case XConstants.FocusOut:
                   return true;
             }
         }
--- a/jdk/src/solaris/classes/sun/awt/X11/XEmbeddingContainer.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/solaris/classes/sun/awt/X11/XEmbeddingContainer.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2003-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2003-2008 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
@@ -121,7 +121,7 @@
     }
     public void dispatchEvent(XEvent xev) {
         switch(xev.get_type()) {
-          case XlibWrapper.ClientMessage:
+          case XConstants.ClientMessage:
               handleClientMessage(xev);
               break;
         }
@@ -149,7 +149,7 @@
         ke.set_window(child);
         XToolkit.awtLock();
         try {
-            XlibWrapper.XSendEvent(XToolkit.getDisplay(), child, false, XlibWrapper.NoEventMask, data);
+            XlibWrapper.XSendEvent(XToolkit.getDisplay(), child, false, XConstants.NoEventMask, data);
         }
         finally {
             XToolkit.awtUnlock();
--- a/jdk/src/solaris/classes/sun/awt/X11/XFileDialogPeer.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/solaris/classes/sun/awt/X11/XFileDialogPeer.java	Thu Jun 12 13:50:55 2008 -0700
@@ -908,7 +908,7 @@
      * Converts the filter into the form which is acceptable by Java's regexps
      */
     private String convert(String filter) {
-        String regex = new String("^" + filter + "$");
+        String regex = "^" + filter + "$";
         regex = regex.replaceAll("\\.", "\\\\.");
         regex = regex.replaceAll("\\?", ".");
         regex = regex.replaceAll("\\*", ".*");
--- a/jdk/src/solaris/classes/sun/awt/X11/XFocusProxyWindow.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/solaris/classes/sun/awt/X11/XFocusProxyWindow.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2003-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2003-2008 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,7 +41,7 @@
         super(new XCreateWindowParams(new Object[] {
             BOUNDS, new Rectangle(-1, -1, 1, 1),
             PARENT_WINDOW, new Long(owner.getWindow()),
-            EVENT_MASK, new Long(FocusChangeMask | KeyPressMask | KeyReleaseMask)
+            EVENT_MASK, new Long(XConstants.FocusChangeMask | XConstants.KeyPressMask | XConstants.KeyReleaseMask)
         }));
         this.owner = owner;
     }
@@ -67,8 +67,8 @@
         int type = ev.get_type();
         switch (type)
         {
-          case XlibWrapper.FocusIn:
-          case XlibWrapper.FocusOut:
+          case XConstants.FocusIn:
+          case XConstants.FocusOut:
               handleFocusEvent(ev);
               break;
         }
--- a/jdk/src/solaris/classes/sun/awt/X11/XFramePeer.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/solaris/classes/sun/awt/X11/XFramePeer.java	Thu Jun 12 13:50:55 2008 -0700
@@ -37,7 +37,7 @@
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
-class XFramePeer extends XDecoratedPeer implements FramePeer, XConstants {
+class XFramePeer extends XDecoratedPeer implements FramePeer {
     private static Logger log = Logger.getLogger("sun.awt.X11.XFramePeer");
     private static Logger stateLog = Logger.getLogger("sun.awt.X11.states");
     private static Logger insLog = Logger.getLogger("sun.awt.X11.insets.XFramePeer");
@@ -71,7 +71,7 @@
         } else {
             winAttr.decorations = winAttr.AWT_DECOR_NONE;
         }
-        winAttr.functions = MWM_FUNC_ALL;
+        winAttr.functions = MWMConstants.MWM_FUNC_ALL;
         winAttr.isResizable = true; // target.isResizable();
         winAttr.title = target.getTitle();
         winAttr.initialResizability = target.isResizable();
@@ -87,14 +87,6 @@
         setupState(true);
     }
 
-    protected Insets guessInsets() {
-        if (isTargetUndecorated()) {
-            return new Insets(0, 0, 0, 0);
-        } else {
-            return super.guessInsets();
-        }
-    }
-
     @Override
     boolean isTargetUndecorated() {
         if (undecorated != null) {
@@ -109,9 +101,9 @@
             state = winAttr.initialState;
         }
         if ((state & Frame.ICONIFIED) != 0) {
-            setInitialState(IconicState);
+            setInitialState(XUtilConstants.IconicState);
         } else {
-            setInitialState(NormalState);
+            setInitialState(XUtilConstants.NormalState);
         }
         setExtendedState(state);
     }
@@ -221,7 +213,7 @@
         XToolkit.awtLock();
         try {
             XSizeHints hints = getHints();
-            hints.set_flags(hints.get_flags() | (int)XlibWrapper.PMaxSize);
+            hints.set_flags(hints.get_flags() | (int)XUtilConstants.PMaxSize);
             if (b.width != Integer.MAX_VALUE) {
                 hints.set_max_width(b.width);
             } else {
@@ -344,7 +336,7 @@
         XToolkit.awtLock();
         try {
             XWMHints hints = getWMHints();
-            hints.set_flags((int)XlibWrapper.StateHint | hints.get_flags());
+            hints.set_flags((int)XUtilConstants.StateHint | hints.get_flags());
             hints.set_initial_state(wm_state);
             if (stateLog.isLoggable(Level.FINE)) stateLog.fine("Setting initial WM state on " + this + " to " + wm_state);
             XlibWrapper.XSetWMHints(XToolkit.getDisplay(), getWindow(), hints.pData);
--- a/jdk/src/solaris/classes/sun/awt/X11/XGlobalCursorManager.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/solaris/classes/sun/awt/X11/XGlobalCursorManager.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2003-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2003-2008 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
@@ -229,46 +229,46 @@
         int cursorType = 0;
         switch (type) {
           case Cursor.DEFAULT_CURSOR:
-              cursorType = XlibWrapper.XC_left_ptr;
+              cursorType = XCursorFontConstants.XC_left_ptr;
               break;
           case Cursor.CROSSHAIR_CURSOR:
-              cursorType = XlibWrapper.XC_crosshair;
+              cursorType = XCursorFontConstants.XC_crosshair;
               break;
           case Cursor.TEXT_CURSOR:
-              cursorType = XlibWrapper.XC_xterm;
+              cursorType = XCursorFontConstants.XC_xterm;
               break;
           case Cursor.WAIT_CURSOR:
-              cursorType = XlibWrapper.XC_watch;
+              cursorType = XCursorFontConstants.XC_watch;
               break;
           case Cursor.SW_RESIZE_CURSOR:
-              cursorType = XlibWrapper.XC_bottom_left_corner;
+              cursorType = XCursorFontConstants.XC_bottom_left_corner;
               break;
           case Cursor.NW_RESIZE_CURSOR:
-              cursorType = XlibWrapper.XC_top_left_corner;
+              cursorType = XCursorFontConstants.XC_top_left_corner;
               break;
           case Cursor.SE_RESIZE_CURSOR:
-              cursorType = XlibWrapper.XC_bottom_right_corner;
+              cursorType = XCursorFontConstants.XC_bottom_right_corner;
               break;
           case Cursor.NE_RESIZE_CURSOR:
-              cursorType = XlibWrapper.XC_top_right_corner;
+              cursorType = XCursorFontConstants.XC_top_right_corner;
               break;
           case Cursor.S_RESIZE_CURSOR:
-              cursorType = XlibWrapper.XC_bottom_side;
+              cursorType = XCursorFontConstants.XC_bottom_side;
               break;
           case Cursor.N_RESIZE_CURSOR:
-              cursorType = XlibWrapper.XC_top_side;
+              cursorType = XCursorFontConstants.XC_top_side;
               break;
           case Cursor.W_RESIZE_CURSOR:
-              cursorType = XlibWrapper.XC_left_side;
+              cursorType = XCursorFontConstants.XC_left_side;
               break;
           case Cursor.E_RESIZE_CURSOR:
-              cursorType = XlibWrapper.XC_right_side;
+              cursorType = XCursorFontConstants.XC_right_side;
               break;
           case Cursor.HAND_CURSOR:
-              cursorType = XlibWrapper.XC_hand2;
+              cursorType = XCursorFontConstants.XC_hand2;
               break;
           case Cursor.MOVE_CURSOR:
-              cursorType = XlibWrapper.XC_fleur;
+              cursorType = XCursorFontConstants.XC_fleur;
               break;
         }
 
--- a/jdk/src/solaris/classes/sun/awt/X11/XIconWindow.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/solaris/classes/sun/awt/X11/XIconWindow.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2003-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2003-2008 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
@@ -293,7 +293,7 @@
             long dst = XlibWrapper.XCreateImage(XToolkit.getDisplay(),
                                                 visInfo.get_visual(),
                                                 (int)awtImage.get_Depth(),
-                                                (int)XlibWrapper.ZPixmap,
+                                                (int)XConstants.ZPixmap,
                                                 0,
                                                 bytes,
                                                 iconWidth,
@@ -470,9 +470,9 @@
                 params.add(BACKGROUND_PIXMAP, iconPixmap);
                 params.add(COLORMAP, adata.get_awt_cmap());
                 params.add(DEPTH, awtImage.get_Depth());
-                params.add(VISUAL_CLASS, (int)XlibWrapper.InputOutput);
+                params.add(VISUAL_CLASS, (int)XConstants.InputOutput);
                 params.add(VISUAL, visInfo.get_visual());
-                params.add(VALUE_MASK, XlibWrapper.CWBorderPixel | XlibWrapper.CWColormap | XlibWrapper.CWBackPixmap);
+                params.add(VALUE_MASK, XConstants.CWBorderPixel | XConstants.CWColormap | XConstants.CWBackPixmap);
                 params.add(PARENT_WINDOW, XlibWrapper.RootWindow(XToolkit.getDisplay(), visInfo.get_screen()));
                 params.add(BOUNDS, new Rectangle(0, 0, iconWidth, iconHeight));
                 params.remove(DELAYED);
@@ -488,9 +488,9 @@
                 XlibWrapper.XClearWindow(XToolkit.getDisplay(), getWindow());
             }
             // Provide both pixmap and window, WM or Taskbar will use the one they find more appropriate
-            long newFlags = hints.get_flags() | XlibWrapper.IconPixmapHint | XlibWrapper.IconMaskHint;
+            long newFlags = hints.get_flags() | XUtilConstants.IconPixmapHint | XUtilConstants.IconMaskHint;
             if (getWindow()  != 0) {
-                newFlags |= XlibWrapper.IconWindowHint;
+                newFlags |= XUtilConstants.IconWindowHint;
             }
             hints.set_flags(newFlags);
             hints.set_icon_pixmap(iconPixmap);
--- a/jdk/src/solaris/classes/sun/awt/X11/XKeyboardFocusManagerPeer.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/solaris/classes/sun/awt/X11/XKeyboardFocusManagerPeer.java	Thu Jun 12 13:50:55 2008 -0700
@@ -96,12 +96,12 @@
             Component focusOwner = activeWindow.getFocusOwner();
             if (focusLog.isLoggable(Level.FINE)) focusLog.fine("Clearing global focus owner " + focusOwner);
             if (focusOwner != null) {
-                XComponentPeer nativePeer = XComponentPeer.getNativeContainer(focusOwner);
-                if (nativePeer != null) {
+//                XComponentPeer nativePeer = XComponentPeer.getNativeContainer(focusOwner);
+//                if (nativePeer != null) {
                     FocusEvent fl = new CausedFocusEvent(focusOwner, FocusEvent.FOCUS_LOST, false, null,
                                                          CausedFocusEvent.Cause.CLEAR_GLOBAL_FOCUS_OWNER);
                     XWindow.sendEvent(fl);
-                }
+//                }
             }
         }
    }
--- a/jdk/src/solaris/classes/sun/awt/X11/XKeysym.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/solaris/classes/sun/awt/X11/XKeysym.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,7 +1,7 @@
 // This is a generated file: do not edit! Edit keysym2ucs.h if necessary.
 
 /*
- * Copyright 2005-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2008 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
@@ -1495,6 +1495,7 @@
 
         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_Multi_key),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_COMPOSE, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_Mode_switch),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_ALT_GRAPH, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
+        keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_ISO_Level3_Shift),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_ALT_GRAPH, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
 
             /* Editing block */
         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_Redo),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_AGAIN, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
--- a/jdk/src/solaris/classes/sun/awt/X11/XListPeer.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/solaris/classes/sun/awt/X11/XListPeer.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2003-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2003-2008 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
@@ -55,14 +55,15 @@
     public final static int     DEFAULT_VISIBLE_ROWS = 4; // From java.awt.List,
     public final static int     HORIZ_SCROLL_AMT = 10;
 
-    final static int
-        PAINT_VSCROLL = 2,
-        PAINT_HSCROLL = 4,
-        PAINT_ITEMS = 8,
-        PAINT_FOCUS = 16,
-        PAINT_BACKGROUND = 32,
-        PAINT_HIDEFOCUS = 64,
-        PAINT_ALL = PAINT_VSCROLL | PAINT_HSCROLL | PAINT_ITEMS | PAINT_FOCUS | PAINT_BACKGROUND;
+    private final static int    PAINT_VSCROLL = 2;
+    private final static int    PAINT_HSCROLL = 4;
+    private final static int    PAINT_ITEMS = 8;
+    private final static int    PAINT_FOCUS = 16;
+    private final static int    PAINT_BACKGROUND = 32;
+    private final static int    PAINT_HIDEFOCUS = 64;
+    private final static int    PAINT_ALL =
+        PAINT_VSCROLL | PAINT_HSCROLL | PAINT_ITEMS | PAINT_FOCUS | PAINT_BACKGROUND;
+    private final static int    COPY_AREA = 128;
 
     XVerticalScrollbar       vsb;
     XHorizontalScrollbar     hsb;
@@ -363,35 +364,6 @@
         }
     }
 
-    Area getItemsArea(int firstItem, int lastItem) {
-        firstItem = Math.max(getFirstVisibleItem(), firstItem);
-        lastItem = Math.min(lastItem, getLastVisibleItem());
-        if (lastItem < getFirstVisibleItem()) {
-            return new Area();
-        }
-        if (firstItem <= lastItem) {
-            int startY = getItemY(firstItem);
-            int endY = getItemY(lastItem) + getItemHeight();
-            // Account for focus rectangle, instead should be called twice - before change
-            // of focusIndex and after
-            startY -= 2;
-            endY += 2;
-            // x is 0 since we need to account for focus rectangle,
-            // the same with width
-            return new Area(new Rectangle(0, startY, getItemWidth() + 3, endY-startY+1));
-        } else {
-            return new Area();
-        }
-    }
-
-    Rectangle getItemRect(int item) {
-        return new Rectangle(MARGIN, getItemY(item), getItemWidth(), getItemHeight());
-    }
-
-    Area getItemArea(int item) {
-        return new Area(getItemRect(item));
-    }
-
     public void repaintScrollbarRequest(XScrollbar scrollbar) {
         Graphics g = getGraphics();
         if (scrollbar == hsb)  {
@@ -411,14 +383,36 @@
         repaint(getFirstVisibleItem(), getLastVisibleItem(), PAINT_ALL);
     }
 
-    public void repaint(int options) {
+    private void repaint(int options) {
         repaint(getFirstVisibleItem(), getLastVisibleItem(), options);
     }
 
-    public void repaint(int firstItem, int lastItem, int options) {
+    private void repaint(int firstItem, int lastItem, int options) {
+        repaint(firstItem, lastItem, options, null, null);
+    }
+
+    /**
+     * In most cases the entire area of the component doesn't have
+     * to be repainted. The method repaints the particular areas of
+     * the component. The areas to repaint is specified by the option
+     * parameter. The possible values of the option parameter are:
+     * PAINT_VSCROLL, PAINT_HSCROLL, PAINT_ITEMS, PAINT_FOCUS,
+     * PAINT_HIDEFOCUS, PAINT_BACKGROUND, PAINT_ALL, COPY_AREA.
+     *
+     * Note that the COPY_AREA value initiates copy of a source area
+     * of the component by a distance by means of the copyArea method
+     * of the Graphics class.
+     *
+     * @param firstItem the position of the first item of the range to repaint
+     * @param lastItem the position of the last item of the range to repaint
+     * @param options specifies the particular area of the component to repaint
+     * @param source the area of the component to copy
+     * @param distance the distance to copy the source area
+     */
+    private void repaint(int firstItem, int lastItem, int options, Rectangle source, Point distance) {
         Graphics g = getGraphics();
         try {
-            painter.paint(g, firstItem, lastItem, options);
+            painter.paint(g, firstItem, lastItem, options, source, distance);
         } finally {
             g.dispose();
         }
@@ -1449,35 +1443,29 @@
         }
         vsb.setValue(vsb.getValue() + y);
 
+        Rectangle source = null;
+        Point distance = null;
+        int firstItem = 0, lastItem = 0;
+        int options = PAINT_HIDEFOCUS | PAINT_ITEMS | PAINT_VSCROLL | PAINT_FOCUS;
         if (y > 0) {
-            // Fixed 6308295: XAWTduplicate list item is displayed
-            // Window resizing leads to the buffer flushing
-            // That's why the repainting with the PAINT_HIDEFOCUS option is the repainting with PAINT_ALL option
-            // So we should do only the repainting instead of the copy area
-            if (y < itemsInWin && painter.isBuffer()) {
-                if (log.isLoggable(Level.FINEST)) {
-                    log.finest("Copying " + "" + MARGIN + "," + ( MARGIN + pixelsToScroll)
-                               + "," +  (width - SCROLLBAR_AREA) + "," +  (h * (itemsInWin - y)-1) +
-                               "," + 0 + "," + (-pixelsToScroll));
-                }
-                // Unpaint focus before copying
-                repaint(PAINT_HIDEFOCUS);
-                painter.copyArea(MARGIN, MARGIN + pixelsToScroll, width - SCROLLBAR_AREA, h * (itemsInWin - y - 1)-1, 0, -pixelsToScroll);
+            if (y < itemsInWin) {
+                source = new Rectangle(MARGIN, MARGIN + pixelsToScroll, width - SCROLLBAR_AREA, h * (itemsInWin - y - 1)-1);
+                distance = new Point(0, -pixelsToScroll);
+                options |= COPY_AREA;
             }
-            repaint(vsb.getValue() + (itemsInWin - y)-1, (vsb.getValue() + itemsInWin) - 1, PAINT_ITEMS | PAINT_VSCROLL | PAINT_FOCUS);
-        } else if (y < 0 && painter.isBuffer()) {
+            firstItem = vsb.getValue() + itemsInWin - y - 1;
+            lastItem = vsb.getValue() + itemsInWin - 1;
+
+        } else if (y < 0) {
             if (y + itemsInWindow() > 0) {
-                if (log.isLoggable(Level.FINEST)) {
-                    log.finest("Copying " + MARGIN + "," + MARGIN +"," +
-                               (width - SCROLLBAR_AREA) + "," +
-                               (h * (itemsInWin + y)) + "," + "0" +"," +(-pixelsToScroll));
-                }
-                repaint(PAINT_HIDEFOCUS);
-                painter.copyArea(MARGIN, MARGIN, width - SCROLLBAR_AREA, h * (itemsInWin + y), 0, -pixelsToScroll);
+                source = new Rectangle(MARGIN, MARGIN, width - SCROLLBAR_AREA, h * (itemsInWin + y));
+                distance = new Point(0, -pixelsToScroll);
+                options |= COPY_AREA;
             }
-            int e = Math.min(getLastVisibleItem(), vsb.getValue() + -y);
-            repaint(vsb.getValue(), e, PAINT_ITEMS | PAINT_VSCROLL | PAINT_FOCUS);
+            firstItem = vsb.getValue();
+            lastItem = Math.min(getLastVisibleItem(), vsb.getValue() + -y);
         }
+        repaint(firstItem, lastItem, options, source, distance);
     }
 
     /**
@@ -1491,12 +1479,17 @@
         int h = height - (SCROLLBAR_AREA + (2 * MARGIN));
         hsb.setValue(hsb.getValue() + x);
 
-        if (x < 0 && painter.isBuffer()) {
-            painter.copyArea(MARGIN + SPACE, MARGIN, w + x, h, -x, 0);
-        } else if (x > 0 && painter.isBuffer()) {
-            painter.copyArea(MARGIN + SPACE + x, MARGIN, w - x, h, -x, 0);
+        Rectangle source = null;
+        Point distance = null;
+        if (x < 0) {
+            source = new Rectangle(MARGIN + SPACE, MARGIN, w + x, h);
+            distance = new Point(-x, 0);
+        } else if (x > 0) {
+            source = new Rectangle(MARGIN + SPACE + x, MARGIN, w - x, h);
+            distance = new Point(-x, 0);
         }
-        repaint(vsb.getValue(), lastItemDisplayed(), PAINT_ITEMS | PAINT_HSCROLL);
+        int options = COPY_AREA | PAINT_ITEMS | PAINT_HSCROLL;
+        repaint(vsb.getValue(), lastItemDisplayed(), options, source, distance);
     }
 
     /**
@@ -1677,7 +1670,6 @@
      * Since we can't guarantee the sequence, use awtLock.
      */
     class ListPainter {
-        // TODO: use VolatileImage
         VolatileImage buffer;
         Color[] colors;
 
@@ -1746,6 +1738,11 @@
         }
 
         private void paint(Graphics listG, int firstItem, int lastItem, int options) {
+            paint(listG, firstItem, lastItem, options, null, null);
+        }
+
+        private void paint(Graphics listG, int firstItem, int lastItem, int options,
+                           Rectangle source, Point distance) {
             if (log.isLoggable(Level.FINER)) log.finer("Repaint from " + firstItem + " to " + lastItem + " options " + options);
             if (firstItem > lastItem) {
                 int t = lastItem;
@@ -1773,17 +1770,34 @@
                       invalidate();
                       options = PAINT_ALL;
                       continue;
+                  case VolatileImage.IMAGE_RESTORED:
+                      options = PAINT_ALL;
                 }
                 Graphics g = localBuffer.createGraphics();
 
+                // Note that the order of the following painting operations
+                // should not be modified
                 try {
                     g.setFont(getFont());
+
+                    // hiding the focus rectangle must be done prior to copying
+                    // area and so this is the first action to be performed
+                    if ((options & (PAINT_HIDEFOCUS)) != 0) {
+                        paintFocus(g, PAINT_HIDEFOCUS);
+                    }
+                    /*
+                     * The shift of the component contents occurs while someone
+                     * scrolls the component, the only purpose of the shift is to
+                     * increase the painting performance. The shift should be done
+                     * prior to painting any area (except hiding focus) and actually
+                     * it should never be done jointly with erase background.
+                     */
+                    if ((options & COPY_AREA) != 0) {
+                        g.copyArea(source.x, source.y, source.width, source.height,
+                            distance.x, distance.y);
+                    }
                     if ((options & PAINT_BACKGROUND) != 0) {
-                        g.setColor(SystemColor.window);
-                        g.fillRect(0, 0, width, height);
-                        g.setColor(getListBackground());
-                        g.fillRect(0, 0, listWidth, listHeight);
-                        draw3DRect(g, getSystemColors(), 0, 0, listWidth - 1, listHeight - 1, false);
+                        paintBackground(g);
                         // Since we made full erase update items
                         firstItem = getFirstVisibleItem();
                         lastItem = getLastVisibleItem();
@@ -1799,8 +1813,8 @@
                         g.setClip(getHScrollBarRec());
                         paintHorScrollbar(g, true);
                     }
-                    if ((options & (PAINT_FOCUS|PAINT_HIDEFOCUS)) != 0) {
-                        paintFocus(g, options);
+                    if ((options & (PAINT_FOCUS)) != 0) {
+                        paintFocus(g, PAINT_FOCUS);
                     }
                 } finally {
                     g.dispose();
@@ -1809,6 +1823,14 @@
             listG.drawImage(localBuffer, 0, 0, null);
         }
 
+        private void paintBackground(Graphics g) {
+            g.setColor(SystemColor.window);
+            g.fillRect(0, 0, width, height);
+            g.setColor(getListBackground());
+            g.fillRect(0, 0, listWidth, listHeight);
+            draw3DRect(g, getSystemColors(), 0, 0, listWidth - 1, listHeight - 1, false);
+        }
+
         private void paintItems(Graphics g, int firstItem, int lastItem, int options) {
             if (log.isLoggable(Level.FINER)) log.finer("Painting items from " + firstItem + " to " + lastItem + ", focused " + focusIndex + ", first " + getFirstVisibleItem() + ", last " + getLastVisibleItem());
 
@@ -1932,53 +1954,5 @@
             }
             g.setClip(clip);
         }
-
-        public void copyArea(int x, int y, int width, int height, int dx, int dy) {
-            if (log.isLoggable(Level.FINER)) log.finer("Copying area " + x + ", " + y + " " + width +
-                                                       "x" + height + ", (" + dx + "," + dy + ")");
-            VolatileImage localBuffer = null;
-            do {
-                XToolkit.awtLock();
-                try {
-                    if (createBuffer()) {
-                        // Newly created buffer should be painted over at full
-                        repaint(PAINT_ALL);
-                        return;
-                    }
-                    localBuffer = buffer;
-                } finally {
-                    XToolkit.awtUnlock();
-                }
-                switch (localBuffer.validate(getGraphicsConfiguration())) {
-                  case VolatileImage.IMAGE_INCOMPATIBLE:
-                      invalidate();
-                  case VolatileImage.IMAGE_RESTORED:
-                      // Since we've lost the content we can't just scroll - we should paint again
-                      repaint(PAINT_ALL);
-                      return;
-                }
-                Graphics g = localBuffer.createGraphics();
-                try {
-                    g.copyArea(x, y, width, height, dx, dy);
-                } finally {
-                    g.dispose();
-                }
-            } while (localBuffer.contentsLost());
-            Graphics listG = getGraphics();
-            listG.setClip(x, y, width, height);
-            listG.drawImage(localBuffer, 0, 0, null);
-            listG.dispose();
-        }
-
-        public boolean isBuffer() {
-            boolean isBuffer;
-            XToolkit.awtLock();
-            try {
-                isBuffer = (buffer != null);
-            } finally {
-                XToolkit.awtUnlock();
-            }
-            return isBuffer;
-        }
     }
 }
--- a/jdk/src/solaris/classes/sun/awt/X11/XMSelection.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/solaris/classes/sun/awt/X11/XMSelection.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2003-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2003-2008 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
@@ -98,7 +98,7 @@
         XToolkit.awtLock();
         try {
             long root = XlibWrapper.RootWindow(display,screen);
-            XlibWrapper.XSelectInput(display, root, XlibWrapper.StructureNotifyMask);
+            XlibWrapper.XSelectInput(display, root, XConstants.StructureNotifyMask);
             XToolkit.addEventDispatcher(root,
                     new XEventDispatcher() {
                         public void dispatchEvent(XEvent ev) {
@@ -130,7 +130,7 @@
             synchronized(this) {
                 setOwner(owner, screen);
                 if (log.isLoggable(Level.FINE)) log.fine("New Selection Owner for screen " + screen + " = " + owner );
-                XlibWrapper.XSelectInput(display, owner, XlibWrapper.StructureNotifyMask | eventMask);
+                XlibWrapper.XSelectInput(display, owner, XConstants.StructureNotifyMask | eventMask);
                 XToolkit.addEventDispatcher(owner,
                         new XEventDispatcher() {
                             public void dispatchEvent(XEvent ev) {
@@ -162,7 +162,7 @@
                     if (owner != 0) {
                         setOwner(owner, screen);
                         if (log.isLoggable(Level.FINE)) log.fine("Selection Owner for screen " + screen + " = " + owner );
-                        XlibWrapper.XSelectInput(display, owner, XlibWrapper.StructureNotifyMask | extra_mask);
+                        XlibWrapper.XSelectInput(display, owner, XConstants.StructureNotifyMask | extra_mask);
                         XToolkit.addEventDispatcher(owner,
                                 new XEventDispatcher() {
                                         public void dispatchEvent(XEvent ev) {
@@ -205,7 +205,7 @@
 
     static  boolean processRootEvent(XEvent xev, int screen) {
         switch (xev.get_type()) {
-            case XlibWrapper.ClientMessage: {
+            case XConstants.ClientMessage: {
                 return processClientMessage(xev, screen);
             }
         }
@@ -225,7 +225,7 @@
      */
 
     public XMSelection (String selname) {
-        this(selname, XlibWrapper.PropertyChangeMask);
+        this(selname, XConstants.PropertyChangeMask);
     }
 
 
@@ -319,11 +319,11 @@
 
     void dispatchSelectionEvent(XEvent xev, int screen) {
         if (log.isLoggable(Level.FINE)) log.fine("Event =" + xev);
-        if (xev.get_type() == XlibWrapper.DestroyNotify) {
+        if (xev.get_type() == XConstants.DestroyNotify) {
             XDestroyWindowEvent de = xev.get_xdestroywindow();
             dispatchOwnerDeath( de, screen);
         }
-        else if (xev.get_type() == XlibWrapper.PropertyNotify)  {
+        else if (xev.get_type() == XConstants.PropertyNotify)  {
             XPropertyEvent xpe = xev.get_xproperty();
             dispatchSelectionChanged( xpe, screen);
         }
--- a/jdk/src/solaris/classes/sun/awt/X11/XNETProtocol.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/solaris/classes/sun/awt/X11/XNETProtocol.java	Thu Jun 12 13:50:55 2008 -0700
@@ -99,7 +99,7 @@
                   return;
             }
             if (log.isLoggable(Level.FINE)) log.fine("Requesting state on " + window + " for " + state);
-            req.set_type((int)XlibWrapper.ClientMessage);
+            req.set_type((int)XConstants.ClientMessage);
             req.set_window(window.getWindow());
             req.set_message_type(XA_NET_WM_STATE.getAtom());
             req.set_format(32);
@@ -109,7 +109,7 @@
                 XlibWrapper.XSendEvent(XToolkit.getDisplay(),
                         XlibWrapper.RootWindow(XToolkit.getDisplay(), window.getScreenNumber()),
                         false,
-                        XlibWrapper.SubstructureRedirectMask | XlibWrapper.SubstructureNotifyMask,
+                        XConstants.SubstructureRedirectMask | XConstants.SubstructureNotifyMask,
                         req.pData);
             }
             finally {
@@ -183,7 +183,7 @@
         if (window.isShowing()) {
             XClientMessageEvent req = new XClientMessageEvent();
             try {
-                req.set_type((int)XlibWrapper.ClientMessage);
+                req.set_type((int)XConstants.ClientMessage);
                 req.set_window(window.getWindow());
                 req.set_message_type(XA_NET_WM_STATE.getAtom());
                 req.set_format(32);
@@ -195,7 +195,7 @@
                     XlibWrapper.XSendEvent(XToolkit.getDisplay(),
                                            XlibWrapper.RootWindow(XToolkit.getDisplay(), window.getScreenNumber()),
                                            false,
-                                           XlibWrapper.SubstructureRedirectMask | XlibWrapper.SubstructureNotifyMask,
+                                           XConstants.SubstructureRedirectMask | XConstants.SubstructureNotifyMask,
                                            req.pData);
                 }
                 finally {
--- a/jdk/src/solaris/classes/sun/awt/X11/XProtocol.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/solaris/classes/sun/awt/X11/XProtocol.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2003-2005 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2003-2008 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
@@ -42,7 +42,7 @@
     static XToolkit.XErrorHandler VerifyChangePropertyHandler = new XToolkit.XErrorHandler() {
             public int handleError(long display, XErrorEvent err) {
                 XToolkit.XERROR_SAVE(err);
-                if (err.get_request_code() == XlibWrapper.X_ChangeProperty) {
+                if (err.get_request_code() == XProtocolConstants.X_ChangeProperty) {
                     return 0;
                 } else {
                     return XToolkit.SAVED_ERROR_HANDLER(display, err);
--- a/jdk/src/solaris/classes/sun/awt/X11/XProtocolConstants.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/solaris/classes/sun/awt/X11/XProtocolConstants.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2003 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2003-2008 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
@@ -25,7 +25,10 @@
 
 package sun.awt.X11;
 
-public interface XProtocolConstants {
+final public class XProtocolConstants {
+
+    private XProtocolConstants(){}
+
     /* Reply codes */
     public static final int X_Reply = 1 ; /* Normal reply */
     public static final int X_Error = 0 ; /* Error */
--- a/jdk/src/solaris/classes/sun/awt/X11/XScrollbar.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/solaris/classes/sun/awt/X11/XScrollbar.java	Thu Jun 12 13:50:55 2008 -0700
@@ -458,16 +458,16 @@
              String type;
              switch (id) {
                 case MouseEvent.MOUSE_PRESSED:
-                    type = new String("press");
+                    type = "press";
                     break;
                 case MouseEvent.MOUSE_RELEASED:
-                    type = new String("release");
+                    type = "release";
                     break;
                 case MouseEvent.MOUSE_DRAGGED:
-                    type = new String("drag");
+                    type = "drag";
                     break;
                 default:
-                    type = new String("other");
+                    type = "other";
              }
              log.finer("Mouse " + type + " event in scroll bar " + this +
                                                    "x = " + x + ", y = " + y +
--- a/jdk/src/solaris/classes/sun/awt/X11/XSelection.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/solaris/classes/sun/awt/X11/XSelection.java	Thu Jun 12 13:50:55 2008 -0700
@@ -141,7 +141,7 @@
         long selection = selectionAtom.getAtom();
 
         // ICCCM prescribes that CurrentTime should not be used for SetSelectionOwner.
-        if (time == XlibWrapper.CurrentTime) {
+        if (time == XConstants.CurrentTime) {
             time = XToolkit.getCurrentServerTime();
         }
 
@@ -199,7 +199,7 @@
             WindowPropertyGetter targetsGetter =
                 new WindowPropertyGetter(XWindow.getXAWTRootWindow().getWindow(),
                                          selectionPropertyAtom, 0, MAX_LENGTH,
-                                         true, XlibWrapper.AnyPropertyType);
+                                         true, XConstants.AnyPropertyType);
 
             try {
                 XToolkit.awtLock();
@@ -274,7 +274,7 @@
                 new WindowPropertyGetter(XWindow.getXAWTRootWindow().getWindow(),
                                          selectionPropertyAtom, 0, MAX_LENGTH,
                                          false, // don't delete to handle INCR properly.
-                                         XlibWrapper.AnyPropertyType);
+                                         XConstants.AnyPropertyType);
 
             try {
                 XToolkit.awtLock();
@@ -353,7 +353,7 @@
                             new WindowPropertyGetter(XWindow.getXAWTRootWindow().getWindow(),
                                                      selectionPropertyAtom,
                                                      0, MAX_LENGTH, false,
-                                                     XlibWrapper.AnyPropertyType);
+                                                     XConstants.AnyPropertyType);
 
                         try {
                             XToolkit.awtLock();
@@ -520,7 +520,7 @@
             try {
                 XlibWrapper.XChangeProperty(XToolkit.getDisplay(), requestor, property,
                                             format, dataFormat,
-                                            XlibWrapper.PropModeReplace,
+                                            XConstants.PropModeReplace,
                                             nativeDataPtr, count);
             } finally {
                 XToolkit.awtUnlock();
@@ -543,14 +543,14 @@
         boolean conversionSucceeded = false;
 
         if (ownershipTime != 0 &&
-            (requestTime == XlibWrapper.CurrentTime || requestTime >= ownershipTime))
+            (requestTime == XConstants.CurrentTime || requestTime >= ownershipTime))
         {
             // Handle MULTIPLE requests as per ICCCM.
             if (format == XDataTransferer.MULTIPLE_ATOM.getAtom()) {
                 conversionSucceeded = handleMultipleRequest(requestor, property);
             } else {
                 // Support for obsolete clients as per ICCCM.
-                if (property == XlibWrapper.None) {
+                if (property == XConstants.None) {
                     property = format;
                 }
 
@@ -564,12 +564,12 @@
 
         if (!conversionSucceeded) {
             // None property indicates conversion failure.
-            property = XlibWrapper.None;
+            property = XConstants.None;
         }
 
         XSelectionEvent xse = new XSelectionEvent();
         try {
-            xse.set_type(XlibWrapper.SelectionNotify);
+            xse.set_type(XConstants.SelectionNotify);
             xse.set_send_event(true);
             xse.set_requestor(requestor);
             xse.set_selection(selectionAtom.getAtom());
@@ -580,7 +580,7 @@
             XToolkit.awtLock();
             try {
                 XlibWrapper.XSendEvent(XToolkit.getDisplay(), requestor, false,
-                                       XlibWrapper.NoEventMask, xse.pData);
+                                       XConstants.NoEventMask, xse.pData);
             } finally {
                 XToolkit.awtUnlock();
             }
@@ -590,7 +590,7 @@
     }
 
     private boolean handleMultipleRequest(final long requestor, long property) {
-        if (XlibWrapper.None == property) {
+        if (XConstants.None == property) {
             // The property cannot be None for a MULTIPLE request.
             return false;
         }
@@ -601,7 +601,7 @@
         WindowPropertyGetter wpg =
                 new WindowPropertyGetter(requestor, XAtom.get(property),
                                          0, MAX_LENGTH, false,
-                                         XlibWrapper.AnyPropertyType);
+                                         XConstants.AnyPropertyType);
         try {
             wpg.execute();
 
@@ -629,7 +629,7 @@
                                                     property,
                                                     wpg.getActualType(),
                                                     wpg.getActualFormat(),
-                                                    XlibWrapper.PropModeReplace,
+                                                                XConstants.PropModeReplace,
                                                     wpg.getData(),
                                                     wpg.getNumberOfItems());
                     } finally {
@@ -673,7 +673,7 @@
             try {
                 XlibWrapper.XChangeProperty(XToolkit.getDisplay(), requestor,
                                             property, XAtom.XA_ATOM, dataFormat,
-                                            XlibWrapper.PropModeReplace,
+                                            XConstants.PropModeReplace,
                                             nativeDataPtr, count);
             } finally {
                 XToolkit.awtUnlock();
@@ -712,7 +712,7 @@
     private static class SelectionEventHandler implements XEventDispatcher {
         public void dispatchEvent(XEvent ev) {
             switch (ev.get_type()) {
-            case XlibWrapper.SelectionNotify: {
+            case XConstants.SelectionNotify: {
                 XToolkit.awtLock();
                 try {
                     XSelectionEvent xse = ev.get_xselection();
@@ -733,7 +733,7 @@
                 }
                 break;
             }
-            case XlibWrapper.SelectionRequest: {
+            case XConstants.SelectionRequest: {
                 XSelectionRequestEvent xsre = ev.get_xselectionrequest();
                 long atom = xsre.get_selection();
                 XSelection selection = XSelection.getSelection(XAtom.get(atom));
@@ -743,7 +743,7 @@
                 }
                 break;
             }
-            case XlibWrapper.SelectionClear: {
+            case XConstants.SelectionClear: {
                 XSelectionClearEvent xsce = ev.get_xselectionclear();
                 long atom = xsce.get_selection();
                 XSelection selection = XSelection.getSelection(XAtom.get(atom));
@@ -793,7 +793,7 @@
                                                      wattr.pData);
                     XlibWrapper.XSelectInput(XToolkit.getDisplay(), requestor,
                                              wattr.get_your_event_mask() |
-                                             XlibWrapper.PropertyChangeMask);
+                                             XConstants.PropertyChangeMask);
                 } finally {
                     XToolkit.awtUnlock();
                 }
@@ -805,10 +805,10 @@
 
         public void dispatchEvent(XEvent ev) {
             switch (ev.get_type()) {
-            case XlibWrapper.PropertyNotify:
+            case XConstants.PropertyNotify:
                 XPropertyEvent xpe = ev.get_xproperty();
                 if (xpe.get_window() == requestor &&
-                    xpe.get_state() == XlibWrapper.PropertyDelete &&
+                    xpe.get_state() == XConstants.PropertyDelete &&
                     xpe.get_atom() == property) {
 
                     int count = data.length - offset;
@@ -834,7 +834,7 @@
                         XlibWrapper.XChangeProperty(XToolkit.getDisplay(),
                                                     requestor, property,
                                                     target, format,
-                                                    XlibWrapper.PropModeReplace,
+                                                    XConstants.PropModeReplace,
                                                     nativeDataPtr, count);
                     } finally {
                         XToolkit.awtUnlock();
@@ -853,9 +853,9 @@
     private static class IncrementalTransferHandler implements XEventDispatcher {
         public void dispatchEvent(XEvent ev) {
             switch (ev.get_type()) {
-            case XlibWrapper.PropertyNotify:
+            case XConstants.PropertyNotify:
                 XPropertyEvent xpe = ev.get_xproperty();
-                if (xpe.get_state() == XlibWrapper.PropertyNewValue &&
+                if (xpe.get_state() == XConstants.PropertyNewValue &&
                     xpe.get_atom() == selectionPropertyAtom.getAtom()) {
                     XToolkit.awtLock();
                     try {
--- a/jdk/src/solaris/classes/sun/awt/X11/XSystemTrayPeer.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/solaris/classes/sun/awt/X11/XSystemTrayPeer.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2008 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
@@ -131,7 +131,7 @@
         XClientMessageEvent xev = new XClientMessageEvent();
 
         try {
-            xev.set_type(XlibWrapper.ClientMessage);
+            xev.set_type(XConstants.ClientMessage);
             xev.set_window(win);
             xev.set_format(32);
             xev.set_message_type(_NET_SYSTEM_TRAY_OPCODE.getAtom());
@@ -144,7 +144,7 @@
             XToolkit.awtLock();
             try {
                 XlibWrapper.XSendEvent(XToolkit.getDisplay(), win, false,
-                                       XlibWrapper.NoEventMask, xev.pData);
+                                       XConstants.NoEventMask, xev.pData);
             } finally {
                 XToolkit.awtUnlock();
             }
--- a/jdk/src/solaris/classes/sun/awt/X11/XToolkit.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/solaris/classes/sun/awt/X11/XToolkit.java	Thu Jun 12 13:50:55 2008 -0700
@@ -54,8 +54,7 @@
 import sun.misc.PerformanceLogger;
 import sun.print.PrintJob2D;
 
-public final class XToolkit extends UNIXToolkit implements Runnable, XConstants
-{
+public final class XToolkit extends UNIXToolkit implements Runnable {
     private static Logger log = Logger.getLogger("sun.awt.X11.XToolkit");
     private static Logger eventLog = Logger.getLogger("sun.awt.X11.event.XToolkit");
     private static final Logger timeoutTaskLog = Logger.getLogger("sun.awt.X11.timeoutTask.XToolkit");
@@ -169,7 +168,7 @@
     static XErrorHandler IgnoreBadWindowHandler = new XErrorHandler() {
             public int handleError(long display, XErrorEvent err) {
                 XERROR_SAVE(err);
-                if (err.get_error_code() == BadWindow) {
+                if (err.get_error_code() == XConstants.BadWindow) {
                     return 0;
                 } else {
                     return SAVED_ERROR_HANDLER(display, err);
@@ -425,7 +424,7 @@
         // Only our windows guaranteely generate MotionNotify, so we
         // should track enter/leave, to catch the moment when to
         // switch to XQueryPointer
-        if (e.get_type() == MotionNotify) {
+        if (e.get_type() == XConstants.MotionNotify) {
             XMotionEvent ev = e.get_xmotion();
             awtLock();
             try {
@@ -437,7 +436,7 @@
             } finally {
                 awtUnlock();
             }
-        } else if (e.get_type() == LeaveNotify) {
+        } else if (e.get_type() == XConstants.LeaveNotify) {
             // Leave from our window
             awtLock();
             try {
@@ -445,7 +444,7 @@
             } finally {
                 awtUnlock();
             }
-        } else if (e.get_type() == EnterNotify) {
+        } else if (e.get_type() == XConstants.EnterNotify) {
             // Entrance into our window
             XCrossingEvent ev = e.get_xcrossing();
             awtLock();
@@ -492,7 +491,7 @@
         final XAnyEvent xany = ev.get_xany();
 
         if (windowToXWindow(xany.get_window()) != null &&
-             (ev.get_type() == MotionNotify || ev.get_type() == EnterNotify || ev.get_type() == LeaveNotify))
+             (ev.get_type() == XConstants.MotionNotify || ev.get_type() == XConstants.EnterNotify || ev.get_type() == XConstants.LeaveNotify))
         {
             processGlobalMotionEvent(ev);
         }
@@ -549,15 +548,15 @@
                     // If no events are queued, waitForEvents() causes calls to
                     // awtUnlock(), awtJNI_ThreadYield, poll, awtLock(),
                     // so it spends most of its time in poll, without holding the lock.
-                    while ((XlibWrapper.XEventsQueued(getDisplay(), XlibWrapper.QueuedAfterReading) == 0) &&
-                           (XlibWrapper.XEventsQueued(getDisplay(), XlibWrapper.QueuedAfterFlush) == 0)) {
+                    while ((XlibWrapper.XEventsQueued(getDisplay(), XConstants.QueuedAfterReading) == 0) &&
+                           (XlibWrapper.XEventsQueued(getDisplay(), XConstants.QueuedAfterFlush) == 0)) {
                         callTimeoutTasks();
                         waitForEvents(getNextTaskTime());
                     }
                     XlibWrapper.XNextEvent(getDisplay(),ev.pData);
                 }
 
-                if (ev.get_type() != NoExpose) {
+                if (ev.get_type() != XConstants.NoExpose) {
                     eventNumber++;
                 }
 
@@ -582,13 +581,13 @@
                         }
                     }
                 }
-                if( keyEventLog.isLoggable(Level.FINE) && (ev.get_type() == KeyPress || ev.get_type() == KeyRelease) ) {
+                if( keyEventLog.isLoggable(Level.FINE) && (ev.get_type() == XConstants.KeyPress || ev.get_type() == XConstants.KeyRelease) ) {
                     keyEventLog.fine("before XFilterEvent:"+ev);
                 }
                 if (XlibWrapper.XFilterEvent(ev.getPData(), w)) {
                     continue;
                 }
-                if( keyEventLog.isLoggable(Level.FINE) && (ev.get_type() == KeyPress || ev.get_type() == KeyRelease) ) {
+                if( keyEventLog.isLoggable(Level.FINE) && (ev.get_type() == XConstants.KeyPress || ev.get_type() == XConstants.KeyRelease) ) {
                     keyEventLog.fine("after XFilterEvent:"+ev); // IS THIS CORRECT?
                 }
 
@@ -750,7 +749,7 @@
              * _NET_WM_STRUT[_PARTIAL] hints for iconified windows
              * are not included to the screen insets.
              */
-            if (XlibUtil.getWindowMapState(window) == XlibWrapper.IsUnmapped)
+            if (XlibUtil.getWindowMapState(window) == XConstants.IsUnmapped)
             {
                 continue;
             }
@@ -1289,7 +1288,7 @@
     new XEventDispatcher() {
             public void dispatchEvent(XEvent ev) {
                 switch (ev.get_type()) {
-                  case PropertyNotify:
+                  case XConstants.PropertyNotify:
                       XPropertyEvent xpe = ev.get_xproperty();
 
                       awtLock();
@@ -1322,7 +1321,7 @@
                 XlibWrapper.XChangeProperty(XToolkit.getDisplay(),
                                             XBaseWindow.getXAWTRootWindow().getWindow(),
                                             _XA_JAVA_TIME_PROPERTY_ATOM.getAtom(), XAtom.XA_ATOM, 32,
-                                            PropModeAppend,
+                                            XConstants.PropModeAppend,
                                             0, 0);
                 XlibWrapper.XFlush(XToolkit.getDisplay());
 
@@ -1539,8 +1538,8 @@
         final int shiftLock = keysymToPrimaryKeycode(XKeySymConstants.XK_Shift_Lock);
         final int capsLock  = keysymToPrimaryKeycode(XKeySymConstants.XK_Caps_Lock);
 
-        final int modmask[] = { ShiftMask, LockMask, ControlMask, Mod1Mask,
-            Mod2Mask, Mod3Mask, Mod4Mask, Mod5Mask };
+        final int modmask[] = { XConstants.ShiftMask, XConstants.LockMask, XConstants.ControlMask, XConstants.Mod1Mask,
+            XConstants.Mod2Mask, XConstants.Mod3Mask, XConstants.Mod4Mask, XConstants.Mod5Mask };
 
         log.fine("In setupModifierMap");
         awtLock();
@@ -2047,7 +2046,7 @@
         if (oops_waiter == null) {
             oops_waiter = new XEventDispatcher() {
                     public void dispatchEvent(XEvent e) {
-                        if (e.get_type() == SelectionNotify) {
+                        if (e.get_type() == XConstants.SelectionNotify) {
                             XSelectionEvent pe = e.get_xselection();
                             if (pe.get_property() == oops.getAtom()) {
                                 oops_updated = true;
@@ -2083,7 +2082,7 @@
             eventLog.log(Level.FINER, "WM_S0 selection owner {0}", new Object[] {XlibWrapper.XGetSelectionOwner(getDisplay(), atom.getAtom())});
             XlibWrapper.XConvertSelection(getDisplay(), atom.getAtom(),
                                           XAtom.get("VERSION").getAtom(), oops.getAtom(),
-                                          win.getWindow(), XlibWrapper.CurrentTime);
+                                          win.getWindow(), XConstants.CurrentTime);
             XSync();
 
 
--- a/jdk/src/solaris/classes/sun/awt/X11/XTrayIconPeer.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/solaris/classes/sun/awt/X11/XTrayIconPeer.java	Thu Jun 12 13:50:55 2008 -0700
@@ -98,7 +98,7 @@
             parentXED = new XEventDispatcher() {
                 // It's executed under AWTLock.
                 public void dispatchEvent(XEvent ev) {
-                    if (isDisposed() || ev.get_type() != XlibWrapper.ConfigureNotify) {
+                    if (isDisposed() || ev.get_type() != XConstants.ConfigureNotify) {
                         return;
                     }
 
@@ -194,7 +194,7 @@
                 XTrayIconPeer xtiPeer = XTrayIconPeer.this;
 
                 public void dispatchEvent(XEvent ev) {
-                    if (isDisposed() || ev.get_type() != XlibWrapper.ReparentNotify) {
+                    if (isDisposed() || ev.get_type() != XConstants.ReparentNotify) {
                         return;
                     }
 
@@ -214,7 +214,7 @@
                     }
 
                     if (!isTrayIconDisplayed) {
-                        addXED(eframeParentID, parentXED, XlibWrapper.StructureNotifyMask);
+                        addXED(eframeParentID, parentXED, XConstants.StructureNotifyMask);
 
                         isTrayIconDisplayed = true;
                         XToolkit.awtLockNotifyAll();
@@ -222,7 +222,7 @@
                 }
             };
 
-        addXED(getWindow(), eframeXED, XlibWrapper.StructureNotifyMask);
+        addXED(getWindow(), eframeXED, XConstants.StructureNotifyMask);
 
         XSystemTrayPeer.getPeerInstance().addTrayIcon(this); // throws AWTException
 
@@ -833,6 +833,7 @@
                 Dimension tpSize = textPanel.getSize();
                 iconCanvas.setSize(BALLOON_ICON_WIDTH, (BALLOON_ICON_HEIGHT > tpSize.height ?
                                                         BALLOON_ICON_HEIGHT : tpSize.height));
+                iconCanvas.validate();
             }
 
             SunToolkit.executeOnEventHandlerThread(xtiPeer.target, new Runnable() {
--- a/jdk/src/solaris/classes/sun/awt/X11/XUtilConstants.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/solaris/classes/sun/awt/X11/XUtilConstants.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2003 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2003-2008 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
@@ -25,7 +25,10 @@
 
 package sun.awt.X11;
 
-public interface XUtilConstants {
+final public class XUtilConstants {
+
+    private XUtilConstants(){}
+
     /*
      * Bitmask returned by XParseGeometry().  Each bit tells if the corresponding
      * value (x, y, width, height) was found in the parsed string.
--- a/jdk/src/solaris/classes/sun/awt/X11/XWINProtocol.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/solaris/classes/sun/awt/X11/XWINProtocol.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2003-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2003-2008 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
@@ -58,7 +58,7 @@
             }
 
             XClientMessageEvent req = new XClientMessageEvent();
-            req.set_type(XlibWrapper.ClientMessage);
+            req.set_type(XConstants.ClientMessage);
             req.set_window(window.getWindow());
             req.set_message_type(XA_WIN_STATE.getAtom());
             req.set_format(32);
@@ -71,7 +71,7 @@
                         XlibWrapper.RootWindow(XToolkit.getDisplay(),
                             window.getScreenNumber()),
                         false,
-                        XlibWrapper.SubstructureRedirectMask | XlibWrapper.SubstructureNotifyMask,
+                        XConstants.SubstructureRedirectMask | XConstants.SubstructureNotifyMask,
                         req.pData);
             }
             finally {
@@ -150,7 +150,7 @@
     public void setLayer(XWindowPeer window, int layer) {
         if (window.isShowing()) {
             XClientMessageEvent req = new XClientMessageEvent();
-            req.set_type(XlibWrapper.ClientMessage);
+            req.set_type(XConstants.ClientMessage);
             req.set_window(window.getWindow());
             req.set_message_type(XA_WIN_LAYER.getAtom());
             req.set_format(32);
@@ -164,7 +164,7 @@
                         XlibWrapper.RootWindow(XToolkit.getDisplay(),
                             window.getScreenNumber()),
                         false,
-                        /*XlibWrapper.SubstructureRedirectMask | */XlibWrapper.SubstructureNotifyMask,
+                        /*XConstants.SubstructureRedirectMask | */XConstants.SubstructureNotifyMask,
                         req.pData);
             }
             finally {
--- a/jdk/src/solaris/classes/sun/awt/X11/XWM.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/solaris/classes/sun/awt/X11/XWM.java	Thu Jun 12 13:50:55 2008 -0700
@@ -46,7 +46,7 @@
  * Class incapsulating knowledge about window managers in general
  * Descendants should provide some information about specific window manager.
  */
-final class XWM implements MWMConstants, XUtilConstants
+final class XWM
 {
 
     private final static Logger log = Logger.getLogger("sun.awt.X11.XWM");
@@ -274,12 +274,12 @@
             }
 
             winmgr_running = false;
-            substruct.set_event_mask(XlibWrapper.SubstructureRedirectMask);
+            substruct.set_event_mask(XConstants.SubstructureRedirectMask);
 
             XToolkit.WITH_XERROR_HANDLER(DetectWMHandler);
             XlibWrapper.XChangeWindowAttributes(XToolkit.getDisplay(),
                                                 XToolkit.getDefaultRootWindow(),
-                                                XlibWrapper.CWEventMask,
+                                                XConstants.CWEventMask,
                                                 substruct.pData);
             XToolkit.RESTORE_XERROR_HANDLER();
 
@@ -291,7 +291,7 @@
                 substruct.set_event_mask(0);
                 XlibWrapper.XChangeWindowAttributes(XToolkit.getDisplay(),
                                                     XToolkit.getDefaultRootWindow(),
-                                                    XlibWrapper.CWEventMask,
+                                                    XConstants.CWEventMask,
                                                     substruct.pData);
                 if (insLog.isLoggable(Level.FINE)) {
                     insLog.finer("It looks like there is no WM thus NO_WM");
@@ -322,7 +322,7 @@
                                      XAtom.XA_STRING);
         try {
             int status = getter.execute(XToolkit.IgnoreBadWindowHandler);
-            if (status != XlibWrapper.Success || getter.getData() == 0) {
+            if (status != XConstants.Success || getter.getData() == 0) {
                 return 0;
             }
 
@@ -411,7 +411,7 @@
                                      false, XA_DT_SM_WINDOW_INFO);
         try {
             int status = getter.execute();
-            if (status != XlibWrapper.Success || getter.getData() == 0) {
+            if (status != XConstants.Success || getter.getData() == 0) {
                 log.finer("Getting of _DT_SM_WINDOW_INFO is not successfull");
                 return false;
             }
@@ -442,7 +442,7 @@
                 status = getter2.execute(XToolkit.IgnoreBadWindowHandler);
 
 
-                if (status != XlibWrapper.Success || getter2.getData() == 0) {
+                if (status != XConstants.Success || getter2.getData() == 0) {
                     log.finer("Getting of _DT_SM_STATE_INFO is not successfull");
                     return false;
                 }
@@ -480,18 +480,18 @@
         WindowPropertyGetter getter =
             new WindowPropertyGetter(XToolkit.getDefaultRootWindow(),
                                      XA_MOTIF_WM_INFO, 0,
-                                     PROP_MOTIF_WM_INFO_ELEMENTS,
+                                     MWMConstants.PROP_MOTIF_WM_INFO_ELEMENTS,
                                      false, XA_MOTIF_WM_INFO);
         try {
             int status = getter.execute();
 
-            if (status != XlibWrapper.Success || getter.getData() == 0) {
+            if (status != XConstants.Success || getter.getData() == 0) {
                 return false;
             }
 
             if (getter.getActualType() != XA_MOTIF_WM_INFO.getAtom()
                 || getter.getActualFormat() != 32
-                || getter.getNumberOfItems() != PROP_MOTIF_WM_INFO_ELEMENTS
+                || getter.getNumberOfItems() != MWMConstants.PROP_MOTIF_WM_INFO_ELEMENTS
                 || getter.getBytesAfter() != 0)
             {
                 return false;
@@ -516,7 +516,7 @@
                                                  0, 1, false,
                                                  XA_WM_STATE);
                     try {
-                        if (state_getter.execute() == XlibWrapper.Success &&
+                        if (state_getter.execute() == XConstants.Success &&
                             state_getter.getData() != 0 &&
                             state_getter.getActualType() == XA_WM_STATE.getAtom())
                         {
@@ -577,7 +577,7 @@
     static XToolkit.XErrorHandler VerifyChangePropertyHandler = new XToolkit.XErrorHandler() {
             public int handleError(long display, XErrorEvent err) {
                 XToolkit.XERROR_SAVE(err);
-                if (err.get_request_code() == XlibWrapper.X_ChangeProperty) {
+                if (err.get_request_code() == XProtocolConstants.X_ChangeProperty) {
                     return 0;
                 } else {
                     return XToolkit.SAVED_ERROR_HANDLER(display, err);
@@ -621,11 +621,11 @@
             XlibWrapper.XChangePropertyS(XToolkit.getDisplay(), XToolkit.getDefaultRootWindow(),
                                          XA_ICEWM_WINOPTHINT.getAtom(),
                                          XA_ICEWM_WINOPTHINT.getAtom(),
-                                         8, XlibWrapper.PropModeReplace,
+                                         8, XConstants.PropModeReplace,
                                          new String(opt));
             XToolkit.RESTORE_XERROR_HANDLER();
 
-            if (XToolkit.saved_error != null && XToolkit.saved_error.get_error_code() != XlibWrapper.Success) {
+            if (XToolkit.saved_error != null && XToolkit.saved_error.get_error_code() != XConstants.Success) {
                 log.finer("Erorr getting XA_ICEWM_WINOPTHINT property");
                 return false;
             }
@@ -654,7 +654,7 @@
                                      true, XA_ICEWM_WINOPTHINT);
         try {
             int status = getter.execute();
-            boolean res = (status == XlibWrapper.Success && getter.getActualType() != 0);
+            boolean res = (status == XConstants.Success && getter.getActualType() != 0);
             log.finer("Status getting XA_ICEWM_WINOPTHINT: " + !res);
             return !res || isNetWMName("IceWM");
         } finally {
@@ -686,8 +686,8 @@
     static XToolkit.XErrorHandler DetectWMHandler = new XToolkit.XErrorHandler() {
             public int handleError(long display, XErrorEvent err) {
                 XToolkit.XERROR_SAVE(err);
-                if (err.get_request_code() == XlibWrapper.X_ChangeWindowAttributes
-                    && err.get_error_code() == XlibWrapper.BadAccess)
+                if (err.get_request_code() == XProtocolConstants.X_ChangeWindowAttributes
+                    && err.get_error_code() == XConstants.BadAccess)
                 {
                     winmgr_running = true;
                     return 0;
@@ -804,7 +804,7 @@
      * XXX: Why do we need this in the first place???
      */
     static void removeSizeHints(XDecoratedPeer window, long mask) {
-        mask &= PMaxSize | PMinSize;
+        mask &= XUtilConstants.PMaxSize | XUtilConstants.PMinSize;
 
         XToolkit.awtLock();
         try {
@@ -830,13 +830,13 @@
      * rest of the code.
      */
     static int normalizeMotifDecor(int decorations) {
-        if ((decorations & MWM_DECOR_ALL) == 0) {
+        if ((decorations & MWMConstants.MWM_DECOR_ALL) == 0) {
             return decorations;
         }
-        int d = MWM_DECOR_BORDER | MWM_DECOR_RESIZEH
-            | MWM_DECOR_TITLE
-            | MWM_DECOR_MENU | MWM_DECOR_MINIMIZE
-            | MWM_DECOR_MAXIMIZE;
+        int d = MWMConstants.MWM_DECOR_BORDER | MWMConstants.MWM_DECOR_RESIZEH
+            | MWMConstants.MWM_DECOR_TITLE
+            | MWMConstants.MWM_DECOR_MENU | MWMConstants.MWM_DECOR_MINIMIZE
+            | MWMConstants.MWM_DECOR_MAXIMIZE;
         d &= ~decorations;
         return d;
     }
@@ -848,14 +848,14 @@
      * rest of the code.
      */
     static int normalizeMotifFunc(int functions) {
-        if ((functions & MWM_FUNC_ALL) == 0) {
+        if ((functions & MWMConstants.MWM_FUNC_ALL) == 0) {
             return functions;
         }
-        int f = MWM_FUNC_RESIZE |
-                MWM_FUNC_MOVE |
-                MWM_FUNC_MAXIMIZE |
-                MWM_FUNC_MINIMIZE |
-                MWM_FUNC_CLOSE;
+        int f = MWMConstants.MWM_FUNC_RESIZE |
+                MWMConstants.MWM_FUNC_MOVE |
+                MWMConstants.MWM_FUNC_MAXIMIZE |
+                MWMConstants.MWM_FUNC_MINIMIZE |
+                MWMConstants.MWM_FUNC_CLOSE;
         f &= ~functions;
         return f;
     }
@@ -872,15 +872,15 @@
         XAtomList decorDel = new XAtomList();
         decorations = normalizeMotifDecor(decorations);
         if (insLog.isLoggable(Level.FINER)) insLog.finer("Setting OL_DECOR to " + Integer.toBinaryString(decorations));
-        if ((decorations & MWM_DECOR_TITLE) == 0) {
+        if ((decorations & MWMConstants.MWM_DECOR_TITLE) == 0) {
             decorDel.add(XA_OL_DECOR_HEADER);
         }
-        if ((decorations & (MWM_DECOR_RESIZEH | MWM_DECOR_MAXIMIZE)) == 0) {
+        if ((decorations & (MWMConstants.MWM_DECOR_RESIZEH | MWMConstants.MWM_DECOR_MAXIMIZE)) == 0) {
             decorDel.add(XA_OL_DECOR_RESIZE);
         }
-        if ((decorations & (MWM_DECOR_MENU |
-                            MWM_DECOR_MAXIMIZE |
-                            MWM_DECOR_MINIMIZE)) == 0)
+        if ((decorations & (MWMConstants.MWM_DECOR_MENU |
+                            MWMConstants.MWM_DECOR_MAXIMIZE |
+                            MWMConstants.MWM_DECOR_MINIMIZE)) == 0)
         {
             decorDel.add(XA_OL_DECOR_CLOSE);
         }
@@ -898,19 +898,21 @@
      */
     static void setMotifDecor(XWindowPeer window, boolean resizable, int decorations, int functions) {
         /* Apparently some WMs don't implement MWM_*_ALL semantic correctly */
-        if ((decorations & MWM_DECOR_ALL) != 0
-            && (decorations != MWM_DECOR_ALL))
+        if ((decorations & MWMConstants.MWM_DECOR_ALL) != 0
+            && (decorations != MWMConstants.MWM_DECOR_ALL))
         {
             decorations = normalizeMotifDecor(decorations);
         }
-        if ((functions & MWM_FUNC_ALL) != 0
-            && (functions != MWM_FUNC_ALL))
+        if ((functions & MWMConstants.MWM_FUNC_ALL) != 0
+            && (functions != MWMConstants.MWM_FUNC_ALL))
         {
             functions = normalizeMotifFunc(functions);
         }
 
         PropMwmHints hints = window.getMWMHints();
-        hints.set_flags(hints.get_flags() | MWM_HINTS_FUNCTIONS | MWM_HINTS_DECORATIONS);
+        hints.set_flags(hints.get_flags() |
+                        MWMConstants.MWM_HINTS_FUNCTIONS |
+                        MWMConstants.MWM_HINTS_DECORATIONS);
         hints.set_functions(functions);
         hints.set_decorations(decorations);
 
@@ -950,10 +952,10 @@
         boolean resizable = window.isResizable();
 
         if (!resizable) {
-            if ((decorations & MWM_DECOR_ALL) != 0) {
-                decorations |= MWM_DECOR_RESIZEH | MWM_DECOR_MAXIMIZE;
+            if ((decorations & MWMConstants.MWM_DECOR_ALL) != 0) {
+                decorations |= MWMConstants.MWM_DECOR_RESIZEH | MWMConstants.MWM_DECOR_MAXIMIZE;
             } else {
-                decorations &= ~(MWM_DECOR_RESIZEH | MWM_DECOR_MAXIMIZE);
+                decorations &= ~(MWMConstants.MWM_DECOR_RESIZEH | MWMConstants.MWM_DECOR_MAXIMIZE);
             }
         }
         setMotifDecor(window, resizable, decorations, functions);
@@ -988,7 +990,7 @@
             /* REMINDER: will need to revisit when setExtendedStateBounds is added */
             //Fix for 4320050: Minimum size for java.awt.Frame is not being enforced.
             //We need to update frame's minimum size, not to reset it
-            removeSizeHints(window, PMaxSize);
+            removeSizeHints(window, XUtilConstants.PMaxSize);
             window.updateMinimumSize();
 
             /* Restore decorations */
@@ -1134,7 +1136,7 @@
         }
 
         int wm_state = window.getWMState();
-        if (wm_state == XlibWrapper.WithdrawnState) {
+        if (wm_state == XUtilConstants.WithdrawnState) {
             stateLog.finer("WithdrawnState");
             return false;
         } else {
@@ -1158,7 +1160,7 @@
     int getState(XDecoratedPeer window) {
         int res = 0;
         final int wm_state = window.getWMState();
-        if (wm_state == XlibWrapper.IconicState) {
+        if (wm_state == XUtilConstants.IconicState) {
             res = Frame.ICONIFIED;
         } else {
             res = Frame.NORMAL;
@@ -1397,7 +1399,7 @@
             new WindowPropertyGetter(window, atom,
                                      0, 4, false, XAtom.XA_CARDINAL);
         try {
-            if (getter.execute() != XlibWrapper.Success
+            if (getter.execute() != XConstants.Success
                 || getter.getData() == 0
                 || getter.getActualType() != XAtom.XA_CARDINAL
                 || getter.getActualFormat() != 32)
@@ -1426,7 +1428,7 @@
 
         XClientMessageEvent msg = new XClientMessageEvent();
         msg.zero();
-        msg.set_type(XlibWrapper.ClientMessage);
+        msg.set_type(XConstants.ClientMessage);
         msg.set_display(XToolkit.getDisplay());
         msg.set_window(window);
         msg.set_format(32);
@@ -1436,13 +1438,15 @@
             if (net_protocol != null && net_protocol.active()) {
                 msg.set_message_type(XA_NET_REQUEST_FRAME_EXTENTS.getAtom());
                 XlibWrapper.XSendEvent(XToolkit.getDisplay(), XToolkit.getDefaultRootWindow(),
-                                       false, XlibWrapper.SubstructureRedirectMask | XlibWrapper.SubstructureNotifyMask,
+                                       false,
+                                       XConstants.SubstructureRedirectMask | XConstants.SubstructureNotifyMask,
                                        msg.getPData());
             }
             if (getWMID() == XWM.KDE2_WM) {
                 msg.set_message_type(XA_KDE_NET_WM_FRAME_STRUT.getAtom());
                 XlibWrapper.XSendEvent(XToolkit.getDisplay(), XToolkit.getDefaultRootWindow(),
-                                       false, XlibWrapper.SubstructureRedirectMask | XlibWrapper.SubstructureNotifyMask,
+                                       false,
+                                       XConstants.SubstructureRedirectMask | XConstants.SubstructureNotifyMask,
                                        msg.getPData());
             }
             // XXX: should we wait for response? XIfEvent() would be useful here :)
--- a/jdk/src/solaris/classes/sun/awt/X11/XWindow.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/solaris/classes/sun/awt/X11/XWindow.java	Thu Jun 12 13:50:55 2008 -0700
@@ -103,12 +103,14 @@
         return defaultFont;
     }
 
-    /*
-     * Keeps all buttons which were pressed at the time of the last mouse
-     * drag until all buttons will be released, contains state as bit masks
-     * Button1Mask, Button2Mask, Button3Mask
-     */
-    private int mouseDragState = 0;
+    /* A bitmask keeps the button's numbers as Button1Mask, Button2Mask, Button3Mask
+     * which are allowed to
+     * generate the CLICK event after the RELEASE has happened.
+     * There are conditions that must be true for that sending CLICK event:
+     * 1) button was initially PRESSED
+     * 2) no movement or drag has happened until RELEASE
+    */
+    private int mouseButtonClickAllowed = 0;
 
     native int getNativeColor(Color clr, GraphicsConfiguration gc);
     native void getWMInsets(long window, long left, long top, long right, long bottom, long border);
@@ -178,10 +180,10 @@
         AwtGraphicsConfigData gData = getGraphicsConfigurationData();
         X11GraphicsConfig config = (X11GraphicsConfig) getGraphicsConfiguration();
         XVisualInfo visInfo = gData.get_awt_visInfo();
-        params.putIfNull(EVENT_MASK, KeyPressMask | KeyReleaseMask
-            | FocusChangeMask | ButtonPressMask | ButtonReleaseMask
-            | EnterWindowMask | LeaveWindowMask | PointerMotionMask
-            | ButtonMotionMask | ExposureMask | StructureNotifyMask);
+        params.putIfNull(EVENT_MASK, XConstants.KeyPressMask | XConstants.KeyReleaseMask
+            | XConstants.FocusChangeMask | XConstants.ButtonPressMask | XConstants.ButtonReleaseMask
+            | XConstants.EnterWindowMask | XConstants.LeaveWindowMask | XConstants.PointerMotionMask
+            | XConstants.ButtonMotionMask | XConstants.ExposureMask | XConstants.StructureNotifyMask);
 
         if (target != null) {
             params.putIfNull(BOUNDS, target.getBounds());
@@ -192,9 +194,9 @@
         getColorModel(); // fix 4948833: this call forces the color map to be initialized
         params.putIfNull(COLORMAP, gData.get_awt_cmap());
         params.putIfNull(DEPTH, gData.get_awt_depth());
-        params.putIfNull(VISUAL_CLASS, Integer.valueOf((int)XlibWrapper.InputOutput));
+        params.putIfNull(VISUAL_CLASS, Integer.valueOf((int)XConstants.InputOutput));
         params.putIfNull(VISUAL, visInfo.get_visual());
-        params.putIfNull(VALUE_MASK, XlibWrapper.CWBorderPixel | XlibWrapper.CWEventMask | XlibWrapper.CWColormap);
+        params.putIfNull(VALUE_MASK, XConstants.CWBorderPixel | XConstants.CWEventMask | XConstants.CWColormap);
         Long parentWindow = (Long)params.get(PARENT_WINDOW);
         if (parentWindow == null || parentWindow.longValue() == 0) {
             XToolkit.awtLock();
@@ -553,10 +555,10 @@
     static int getModifiers(int state, int button, int keyCode) {
         int modifiers = 0;
 
-        if (((state & XlibWrapper.ShiftMask) != 0) ^ (keyCode == KeyEvent.VK_SHIFT)) {
+        if (((state & XConstants.ShiftMask) != 0) ^ (keyCode == KeyEvent.VK_SHIFT)) {
             modifiers |= InputEvent.SHIFT_DOWN_MASK;
         }
-        if (((state & XlibWrapper.ControlMask) != 0) ^ (keyCode == KeyEvent.VK_CONTROL)) {
+        if (((state & XConstants.ControlMask) != 0) ^ (keyCode == KeyEvent.VK_CONTROL)) {
             modifiers |= InputEvent.CTRL_DOWN_MASK;
         }
         if (((state & XToolkit.metaMask) != 0) ^ (keyCode == KeyEvent.VK_META)) {
@@ -568,13 +570,13 @@
         if (((state & XToolkit.modeSwitchMask) != 0) ^ (keyCode == KeyEvent.VK_ALT_GRAPH)) {
             modifiers |= InputEvent.ALT_GRAPH_DOWN_MASK;
         }
-        if (((state & XlibWrapper.Button1Mask) != 0) ^ (button == MouseEvent.BUTTON1)) {
+        if (((state & XConstants.Button1Mask) != 0) ^ (button == MouseEvent.BUTTON1)) {
             modifiers |= InputEvent.BUTTON1_DOWN_MASK;
         }
-        if (((state & XlibWrapper.Button2Mask) != 0) ^ (button == MouseEvent.BUTTON2)) {
+        if (((state & XConstants.Button2Mask) != 0) ^ (button == MouseEvent.BUTTON2)) {
             modifiers |= InputEvent.BUTTON2_DOWN_MASK;
         }
-        if (((state & XlibWrapper.Button3Mask) != 0) ^ (button == MouseEvent.BUTTON3)) {
+        if (((state & XConstants.Button3Mask) != 0) ^ (button == MouseEvent.BUTTON3)) {
             modifiers |= InputEvent.BUTTON3_DOWN_MASK;
         }
         return modifiers;
@@ -584,10 +586,10 @@
         int mods = stroke.getModifiers();
         int res = 0;
         if ((mods & (InputEvent.SHIFT_DOWN_MASK | InputEvent.SHIFT_MASK)) != 0) {
-            res |= XToolkit.ShiftMask;
+            res |= XConstants.ShiftMask;
         }
         if ((mods & (InputEvent.CTRL_DOWN_MASK | InputEvent.CTRL_MASK)) != 0) {
-            res |= XToolkit.ControlMask;
+            res |= XConstants.ControlMask;
         }
         if ((mods & (InputEvent.ALT_DOWN_MASK | InputEvent.ALT_MASK)) != 0) {
             res |= XToolkit.altMask;
@@ -602,12 +604,12 @@
     }
 
     private static int getButtonMask(long mouseButton) {
-        if (mouseButton == XlibWrapper.Button1) {
-            return XlibWrapper.Button1Mask;
-        } else if (mouseButton == XlibWrapper.Button2) {
-            return XlibWrapper.Button2Mask;
-        } else if (mouseButton == XlibWrapper.Button3) {
-            return XlibWrapper.Button3Mask;
+        if (mouseButton == XConstants.Button1) {
+            return XConstants.Button1Mask;
+        } else if (mouseButton == XConstants.Button2) {
+            return XConstants.Button2Mask;
+        } else if (mouseButton == XConstants.Button3) {
+            return XConstants.Button3Mask;
         }
         return 0;
     }
@@ -659,7 +661,9 @@
             y = localXY.y;
         }
 
-        if (type == XlibWrapper.ButtonPress) {
+        if (type == XConstants.ButtonPress) {
+            //Allow this mouse button to generate CLICK event on next ButtonRelease
+            mouseButtonClickAllowed |= getButtonMask(lbutton);
             XWindow lastWindow = (lastWindowRef != null) ? ((XWindow)lastWindowRef.get()):(null);
             /*
                multiclick checking
@@ -689,16 +693,16 @@
             }
         }
 
-        if (lbutton == XlibWrapper.Button1)
+        if (lbutton == XConstants.Button1)
             button = MouseEvent.BUTTON1;
-        else if (lbutton ==  XlibWrapper.Button2 )
+        else if (lbutton ==  XConstants.Button2 )
             button = MouseEvent.BUTTON2;
-        else if (lbutton == XlibWrapper.Button3)
+        else if (lbutton == XConstants.Button3)
             button = MouseEvent.BUTTON3;
-        else if (lbutton == XlibWrapper.Button4) {
+        else if (lbutton == XConstants.Button4) {
             button = 4;
             wheel_mouse = true;
-        } else if (lbutton == XlibWrapper.Button5) {
+        } else if (lbutton == XConstants.Button5) {
             button = 5;
             wheel_mouse = true;
         }
@@ -707,7 +711,7 @@
 
         if (!wheel_mouse) {
             MouseEvent me = new MouseEvent((Component)getEventSource(),
-                                           type == XlibWrapper.ButtonPress ? MouseEvent.MOUSE_PRESSED : MouseEvent.MOUSE_RELEASED,
+                                           type == XConstants.ButtonPress ? MouseEvent.MOUSE_PRESSED : MouseEvent.MOUSE_RELEASED,
                                            jWhen,modifiers, x, y,
                                            xbe.get_x_root(),
                                            xbe.get_y_root(),
@@ -715,8 +719,8 @@
 
             postEventToEventQueue(me);
 
-            if (((mouseDragState & getButtonMask(lbutton)) == 0) && // No up-button in the drag-state
-                (type == XlibWrapper.ButtonRelease))
+            if ((type == XConstants.ButtonRelease) &&
+                ((mouseButtonClickAllowed & getButtonMask(lbutton)) != 0) ) // No up-button in the drag-state
             {
                 postEventToEventQueue(me = new MouseEvent((Component)getEventSource(),
                                                      MouseEvent.MOUSE_CLICKED,
@@ -731,7 +735,7 @@
 
         }
         else {
-            if (xev.get_type() == XlibWrapper.ButtonPress) {
+            if (xev.get_type() == XConstants.ButtonPress) {
                 MouseWheelEvent mwe = new MouseWheelEvent((Component)getEventSource(),MouseEvent.MOUSE_WHEEL, jWhen,
                                                           modifiers,
                                                           x, y,
@@ -743,7 +747,11 @@
             }
         }
 
-        mouseDragState &= ~getButtonMask(lbutton); // Exclude the up-button from the drag-state
+        /* Update the state variable AFTER the CLICKED event post. */
+        if (type == XConstants.ButtonRelease) {
+            /* Exclude this mouse button from allowed list.*/
+            mouseButtonClickAllowed &= ~getButtonMask(lbutton);
+        }
     }
 
     public void handleMotionNotify(XEvent xev) {
@@ -753,7 +761,7 @@
             return;
         }
 
-        int mouseKeyState = (xme.get_state() & (Button1Mask | Button2Mask | Button3Mask));
+        int mouseKeyState = (xme.get_state() & (XConstants.Button1Mask | XConstants.Button2Mask | XConstants.Button3Mask));
         boolean isDragging = (mouseKeyState != 0);
         int mouseEventType = 0;
 
@@ -776,7 +784,7 @@
                Math.abs(lastY - y) < AWT_MULTICLICK_SMUDGE))) {
           clickCount = 0;
           lastWindowRef = null;
-          mouseDragState = mouseKeyState;
+          mouseButtonClickAllowed = 0;
           lastTime = 0;
           lastX = 0;
           lastY = 0;
@@ -823,10 +831,10 @@
         // accordingly. This leads to impossibility to make a double click on Component (6404708)
         XWindowPeer toplevel = getToplevelXWindow();
         if (toplevel != null && !toplevel.isModalBlocked()){
-            if (xce.get_mode() != NotifyNormal) {
+            if (xce.get_mode() != XConstants.NotifyNormal) {
                 // 6404708 : need update cursor in accordance with skipping Leave/EnterNotify event
                 // whereas it doesn't need to handled further.
-                if (xce.get_type() == EnterNotify) {
+                if (xce.get_type() == XConstants.EnterNotify) {
                     XAwtState.setComponentMouseEntered(getEventSource());
                     XGlobalCursorManager.nativeUpdateCursor(getEventSource());
                 } else { // LeaveNotify:
@@ -840,7 +848,7 @@
         // From java point the event is bogus as ancestor is obscured, so if
         // the child can get java event itself, we skip it on ancestor.
         long childWnd = xce.get_subwindow();
-        if (childWnd != None) {
+        if (childWnd != XConstants.None) {
             XBaseWindow child = XToolkit.windowToXWindow(childWnd);
             if (child != null && child instanceof XWindow &&
                 !child.isEventDisabled(xev))
@@ -853,7 +861,7 @@
         final Component compWithMouse = XAwtState.getComponentMouseEntered();
         if (toplevel != null) {
             if(!toplevel.isModalBlocked()){
-                if (xce.get_type() == EnterNotify) {
+                if (xce.get_type() == XConstants.EnterNotify) {
                     // Change XAwtState's component mouse entered to the up-to-date one before requesting
                     // to update the cursor since XAwtState.getComponentMouseEntered() is used when the
                     // cursor is updated (in XGlobalCursorManager.findHeavyweightUnderCursor()).
@@ -895,7 +903,7 @@
             eventLog.finest("Clearing last window ref");
             lastWindowRef = null;
         }
-        if (xce.get_type() == EnterNotify) {
+        if (xce.get_type() == XConstants.EnterNotify) {
             MouseEvent me = new MouseEvent(getEventSource(), MouseEvent.MOUSE_ENTERED,
                 jWhen, modifiers, xce.get_x(), xce.get_y(), xce.get_x_root(), xce.get_y_root(), clickCount,
                 popupTrigger, MouseEvent.NOBUTTON);
@@ -990,7 +998,7 @@
     final void handleKeyPress(XKeyEvent ev) {
         long keysym[] = new long[2];
         char unicodeKey = 0;
-        keysym[0] = NoSymbol;
+        keysym[0] = XConstants.NoSymbol;
 
         if (keyEventLog.isLoggable(Level.FINE)) {
             logIncomingKeyEvent( ev );
@@ -1073,7 +1081,7 @@
     private void handleKeyRelease(XKeyEvent ev) {
         long keysym[] = new long[2];
         char unicodeKey = 0;
-        keysym[0] = NoSymbol;
+        keysym[0] = XConstants.NoSymbol;
 
         if (keyEventLog.isLoggable(Level.FINE)) {
             logIncomingKeyEvent( ev );
@@ -1153,10 +1161,10 @@
     }
 
     void updateSizeHints(int x, int y, int width, int height) {
-        long flags = XlibWrapper.PSize | (isLocationByPlatform() ? 0 : (XlibWrapper.PPosition | XlibWrapper.USPosition));
+        long flags = XUtilConstants.PSize | (isLocationByPlatform() ? 0 : (XUtilConstants.PPosition | XUtilConstants.USPosition));
         if (!isResizable()) {
             log.log(Level.FINER, "Window {0} is not resizable", new Object[] {this});
-            flags |= XlibWrapper.PMinSize | XlibWrapper.PMaxSize;
+            flags |= XUtilConstants.PMinSize | XUtilConstants.PMaxSize;
         } else {
             log.log(Level.FINER, "Window {0} is resizable", new Object[] {this});
         }
@@ -1164,10 +1172,10 @@
     }
 
     void updateSizeHints(int x, int y) {
-        long flags = isLocationByPlatform() ? 0 : (XlibWrapper.PPosition | XlibWrapper.USPosition);
+        long flags = isLocationByPlatform() ? 0 : (XUtilConstants.PPosition | XUtilConstants.USPosition);
         if (!isResizable()) {
             log.log(Level.FINER, "Window {0} is not resizable", new Object[] {this});
-            flags |= XlibWrapper.PMinSize | XlibWrapper.PMaxSize | XlibWrapper.PSize;
+            flags |= XUtilConstants.PMinSize | XUtilConstants.PMaxSize | XUtilConstants.PSize;
         } else {
             log.log(Level.FINER, "Window {0} is resizable", new Object[] {this});
         }
--- a/jdk/src/solaris/classes/sun/awt/X11/XWindowPeer.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/solaris/classes/sun/awt/X11/XWindowPeer.java	Thu Jun 12 13:50:55 2008 -0700
@@ -50,7 +50,7 @@
 import sun.awt.X11GraphicsEnvironment;
 
 class XWindowPeer extends XPanelPeer implements WindowPeer,
-                                                DisplayChangedListener, MWMConstants {
+                                                DisplayChangedListener {
 
     private static final Logger log = Logger.getLogger("sun.awt.X11.XWindowPeer");
     private static final Logger focusLog = Logger.getLogger("sun.awt.X11.focus.XWindowPeer");
@@ -65,7 +65,6 @@
     static XAtom wm_delete_window;
     static XAtom wm_take_focus;
 
-    Insets insets = new Insets( 0, 0, 0, 0 );
     XWindowAttributesData winAttr;
     private boolean cachedFocusableWindow;
     XWarningWindow warningWindow;
@@ -133,13 +132,12 @@
         params.put(REPARENTED,
                    Boolean.valueOf(isOverrideRedirect() || isSimpleWindow()));
         super.preInit(params);
-        params.putIfNull(BIT_GRAVITY, Integer.valueOf(NorthWestGravity));
+        params.putIfNull(BIT_GRAVITY, Integer.valueOf(XConstants.NorthWestGravity));
 
-        savedState = WithdrawnState;
+        savedState = XUtilConstants.WithdrawnState;
         XA_NET_WM_STATE = XAtom.get("_NET_WM_STATE");
 
         winAttr = new XWindowAttributesData();
-        insets = new Insets(0,0,0,0);
 
         params.put(OVERRIDE_REDIRECT, Boolean.valueOf(isOverrideRedirect()));
 
@@ -239,7 +237,7 @@
 
                     // Set group leader
                     XWMHints hints = getWMHints();
-                    hints.set_flags(hints.get_flags() | (int)XlibWrapper.WindowGroupHint);
+                    hints.set_flags(hints.get_flags() | (int)XUtilConstants.WindowGroupHint);
                     hints.set_window_group(ownerWindow);
                     XlibWrapper.XSetWMHints(XToolkit.getDisplay(), getWindow(), hints.pData);
                 }
@@ -260,7 +258,6 @@
 
         setSaveUnder(true);
 
-        XWM.requestWMExtents(getWindow());
         updateIconImages();
     }
 
@@ -503,7 +500,7 @@
             Rectangle bounds = getBounds();
 
             XSizeHints hints = getHints();
-            setSizeHints(hints.get_flags() | XlibWrapper.PPosition | XlibWrapper.PSize,
+            setSizeHints(hints.get_flags() | XUtilConstants.PPosition | XUtilConstants.PSize,
                              bounds.x, bounds.y, bounds.width, bounds.height);
             XWM.setMotifDecor(this, false, 0, 0);
 
@@ -531,7 +528,7 @@
         XToolkit.awtLock();
         try {
             XWMHints hints = getWMHints();
-            hints.set_flags(hints.get_flags() | (int)XlibWrapper.InputHint);
+            hints.set_flags(hints.get_flags() | (int)XUtilConstants.InputHint);
             hints.set_input(false/*isNativelyNonFocusableWindow() ? (0):(1)*/);
             XlibWrapper.XSetWMHints(XToolkit.getDisplay(), getWindow(), hints.pData);
         }
@@ -541,9 +538,7 @@
     }
 
     public Insets getInsets() {
-        Insets in = (Insets)(insets.clone());
-        in.top += getWarningWindowHeight();
-        return in;
+        return new Insets(getWarningWindowHeight(), 0, 0, 0);
     }
 
     // NOTE: This method may be called by privileged threads.
@@ -582,7 +577,7 @@
     }
 
     /*
-     * Converts native focused X window id into Java peer.
+     * Retrives real native focused window and converts it into Java peer.
      */
     static XWindowPeer getNativeFocusedWindowPeer() {
         XBaseWindow baseWindow = XToolkit.windowToXWindow(xGetInputFocus());
@@ -591,6 +586,14 @@
                ((XFocusProxyWindow)baseWindow).getOwner() : null;
     }
 
+    /*
+     * Retrives real native focused window and converts it into Java window.
+     */
+    static Window getNativeFocusedWindow() {
+        XWindowPeer peer = getNativeFocusedWindowPeer();
+        return peer != null ? (Window)peer.target : null;
+    }
+
     boolean isFocusableWindow() {
         if (XToolkit.isToolkitThread() || SunToolkit.isAWTLockHeldByCurrentThread())
         {
@@ -821,12 +824,12 @@
         if (isEventDisabled(xev)) {
             return;
         }
-        if (xev.get_type() == XlibWrapper.FocusIn)
+        if (xev.get_type() == XConstants.FocusIn)
         {
             // If this window is non-focusable don't post any java focus event
             if (focusAllowedFor()) {
-                if (xfe.get_mode() == XlibWrapper.NotifyNormal // Normal notify
-                    || xfe.get_mode() == XlibWrapper.NotifyWhileGrabbed) // Alt-Tab notify
+                if (xfe.get_mode() == XConstants.NotifyNormal // Normal notify
+                    || xfe.get_mode() == XConstants.NotifyWhileGrabbed) // Alt-Tab notify
                 {
                     handleWindowFocusIn(xfe.get_serial());
                 }
@@ -834,8 +837,8 @@
         }
         else
         {
-            if (xfe.get_mode() == XlibWrapper.NotifyNormal // Normal notify
-                || xfe.get_mode() == XlibWrapper.NotifyWhileGrabbed) // Alt-Tab notify
+            if (xfe.get_mode() == XConstants.NotifyNormal // Normal notify
+                || xfe.get_mode() == XConstants.NotifyWhileGrabbed) // Alt-Tab notify
             {
                 // If this window is non-focusable don't post any java focus event
                 if (!isNativelyNonFocusableWindow()) {
@@ -994,7 +997,8 @@
 
         return ret;
     }
-    private boolean isDesktopWindow( long wi ) {
+
+    private static boolean isDesktopWindow( long wi ) {
         return XWM.getWM().isDesktopWindow( wi );
     }
 
@@ -1022,7 +1026,7 @@
             try {
                 Rectangle bounds = getBounds();
                 XSizeHints hints = getHints();
-                setSizeHints(hints.get_flags() & ~(USPosition | PPosition),
+                setSizeHints(hints.get_flags() & ~(XUtilConstants.USPosition | XUtilConstants.PPosition),
                              bounds.x, bounds.y, bounds.width, bounds.height);
             } finally {
                 XToolkit.awtUnlock();
@@ -1059,10 +1063,10 @@
                 XUnmapEvent unmap = new XUnmapEvent();
                 unmap.set_window(window);
                 unmap.set_event(XToolkit.getDefaultRootWindow());
-                unmap.set_type((int)XlibWrapper.UnmapNotify);
+                unmap.set_type((int)XConstants.UnmapNotify);
                 unmap.set_from_configure(false);
                 XlibWrapper.XSendEvent(XToolkit.getDisplay(), XToolkit.getDefaultRootWindow(),
-                        false, XlibWrapper.SubstructureNotifyMask | XlibWrapper.SubstructureRedirectMask,
+                        false, XConstants.SubstructureNotifyMask | XConstants.SubstructureRedirectMask,
                         unmap.pData);
                 unmap.dispose();
             }
@@ -1168,10 +1172,6 @@
             // State has changed, invalidate saved value
             stateChanged = true;
             stateChanged(ev.get_time(), savedState, getWMState());
-        } else if (ev.get_atom() == XWM.XA_KDE_NET_WM_FRAME_STRUT.getAtom()
-                   || ev.get_atom() == XWM.XA_NET_FRAME_EXTENTS.getAtom())
-        {
-            getWMSetInsets(XAtom.get(ev.get_atom()));
         }
     }
 
@@ -1252,7 +1252,7 @@
         return res;
     }
 
-    private boolean isWMStateNetHidden() {
+    protected boolean isWMStateNetHidden() {
         XNETProtocol protocol = XWM.getWM().getNETProtocol();
         return (protocol != null && protocol.isWMStateNetHidden(this));
     }
@@ -1305,12 +1305,12 @@
                                          XWM.XA_WM_STATE);
             try {
                 int status = getter.execute();
-                if (status != XlibWrapper.Success || getter.getData() == 0) {
-                    return savedState = XlibWrapper.WithdrawnState;
+                if (status != XConstants.Success || getter.getData() == 0) {
+                    return savedState = XUtilConstants.WithdrawnState;
                 }
 
                 if (getter.getActualType() != XWM.XA_WM_STATE.getAtom() && getter.getActualFormat() != 32) {
-                    return savedState = XlibWrapper.WithdrawnState;
+                    return savedState = XUtilConstants.WithdrawnState;
                 }
                 savedState = (int)Native.getCard32(getter.getData());
             } finally {
@@ -1321,7 +1321,7 @@
     }
 
     boolean isWithdrawn() {
-        return getWMState() == XlibWrapper.WithdrawnState;
+        return getWMState() == XUtilConstants.WithdrawnState;
     }
 
     boolean hasDecorations(int decor) {
@@ -1740,6 +1740,11 @@
         return window;
     }
 
+    public boolean requestWindowFocus(XWindowPeer actualFocusedWindow) {
+        setActualFocusedWindow(actualFocusedWindow);
+        return requestWindowFocus();
+    }
+
     public boolean requestWindowFocus() {
         return requestWindowFocus(0, false);
     }
@@ -1748,25 +1753,25 @@
         focusLog.fine("Request for window focus");
         // If this is Frame or Dialog we can't assure focus request success - but we still can try
         // If this is Window and its owner Frame is active we can be sure request succedded.
-        Window win = (Window) target;
-        Window owner = XWindowPeer.getDecoratedOwner(win);
+        Window ownerWindow  = XWindowPeer.getDecoratedOwner((Window)target);
+        Window focusedWindow = XKeyboardFocusManagerPeer.getCurrentNativeFocusedWindow();
+        Window activeWindow = XWindowPeer.getDecoratedOwner(focusedWindow);
 
-        final Window activeWindow =
-                XWindowPeer.getDecoratedOwner(XKeyboardFocusManagerPeer.getCurrentNativeFocusedWindow());
-        if (activeWindow == owner) {
+        if (isWMStateNetHidden()) {
+            focusLog.fine("The window is unmapped, so rejecting the request");
+            return false;
+        }
+        if (activeWindow == ownerWindow) {
             focusLog.fine("Parent window is active - generating focus for this window");
             handleWindowFocusInSync(-1);
             return true;
-        } else {
-            focusLog.fine("Parent window is not active");
         }
-        ComponentPeer peer = ComponentAccessor.getPeer(owner);
-        if (peer instanceof XDecoratedPeer) {
-            XDecoratedPeer wpeer = (XDecoratedPeer) peer;
-            if (wpeer.requestWindowFocus(this, time, timeProvided)) {
-                focusLog.fine("Parent window accepted focus request - generating focus for this window");
-                return true;
-            }
+        focusLog.fine("Parent window is not active");
+
+        XDecoratedPeer wpeer = (XDecoratedPeer)ComponentAccessor.getPeer(ownerWindow);
+        if (wpeer != null && wpeer.requestWindowFocus(this, time, timeProvided)) {
+            focusLog.fine("Parent window accepted focus request - generating focus for this window");
+            return true;
         }
         focusLog.fine("Denied - parent window is not active and didn't accept focus request");
         return false;
@@ -1818,14 +1823,14 @@
         if( rootPropertyEventDispatcher == null ) {
             rootPropertyEventDispatcher = new XEventDispatcher() {
                 public void dispatchEvent(XEvent ev) {
-                    if( ev.get_type() == PropertyNotify ) {
+                    if( ev.get_type() == XConstants.PropertyNotify ) {
                         handleRootPropertyNotify( ev );
                     }
                 }
             };
             XlibWrapper.XSelectInput( XToolkit.getDisplay(),
                                       XToolkit.getDefaultRootWindow(),
-                                      XlibWrapper.PropertyChangeMask);
+                                      XConstants.PropertyChangeMask);
             XToolkit.addEventDispatcher(XToolkit.getDefaultRootWindow(),
                                                 rootPropertyEventDispatcher);
         }
@@ -1860,7 +1865,7 @@
     public PropMwmHints getMWMHints() {
         if (mwm_hints == null) {
             mwm_hints = new PropMwmHints();
-            if (!XWM.XA_MWM_HINTS.getAtomData(getWindow(), mwm_hints.pData, PROP_MWM_HINTS_ELEMENTS)) {
+            if (!XWM.XA_MWM_HINTS.getAtomData(getWindow(), mwm_hints.pData, MWMConstants.PROP_MWM_HINTS_ELEMENTS)) {
                 mwm_hints.zero();
             }
         }
@@ -1870,41 +1875,10 @@
     public void setMWMHints(PropMwmHints hints) {
         mwm_hints = hints;
         if (hints != null) {
-            XWM.XA_MWM_HINTS.setAtomData(getWindow(), mwm_hints.pData, PROP_MWM_HINTS_ELEMENTS);
+            XWM.XA_MWM_HINTS.setAtomData(getWindow(), mwm_hints.pData, MWMConstants.PROP_MWM_HINTS_ELEMENTS);
         }
     }
 
-    private Insets wm_set_insets;
-    public Insets getWMSetInsets(XAtom changedAtom) {
-        if (isEmbedded()) {
-            return null;
-        }
-
-        if (wm_set_insets != null) {
-            return wm_set_insets;
-        }
-
-        if (changedAtom == null) {
-            wm_set_insets = XWM.getInsetsFromExtents(getWindow());
-        } else {
-            wm_set_insets = XWM.getInsetsFromProp(getWindow(), changedAtom);
-        }
-
-        insLog.log(Level.FINER, "FRAME_EXTENTS: {0}", new Object[]{wm_set_insets});
-
-        if (wm_set_insets != null) {
-            handleWMSetInsets(wm_set_insets);
-        }
-        return wm_set_insets;
-    }
-
-    protected void handleWMSetInsets(Insets newInsets) {
-        wm_set_insets = (Insets)newInsets.clone();
-    }
-
-    public void resetWMSetInsets() {
-        wm_set_insets = null;
-    }
     protected synchronized void updateDropTarget() {
         if (dropTargetCount > 0) {
             long window = getWindow();
@@ -1960,7 +1934,7 @@
                         new Object[] {xme, isGrabbed(), containsGlobal(xme.get_x_root(), xme.get_y_root())});
         }
         if (isGrabbed()) {
-            boolean dragging = (xme.get_state() & (Button1Mask | Button2Mask | Button3Mask)) != 0;
+            boolean dragging = (xme.get_state() & (XConstants.Button1Mask | XConstants.Button2Mask | XConstants.Button3Mask)) != 0;
             // When window is grabbed, all events are dispatched to
             // it.  Retarget them to the corresponding windows (notice
             // that XBaseWindow.dispatchEvent does the opposite
@@ -1974,8 +1948,9 @@
                 // So, I do not want to implement complicated logic for better retargeting.
                 target = pressTarget.isVisible() ? pressTarget : this;
                 xme.set_window(target.getWindow());
-                xme.set_x(xme.get_x_root() - target.getX());
-                xme.set_y(xme.get_y_root() - target.getY());
+                Point localCoord = target.toLocal(xme.get_x_root(), xme.get_y_root());
+                xme.set_x(localCoord.x);
+                xme.set_y(localCoord.y);
             }
             grabLog.log(Level.FINER, "  -  Grab event target {0}", new Object[] {target});
             if (target != null) {
@@ -2013,12 +1988,12 @@
             try {
                 grabLog.log(Level.FINER, "  -  Grab event target {0} (press target {1})", new Object[] {target, pressTarget});
                 if (xbe.get_type() == XConstants.ButtonPress
-                    && xbe.get_button() == XlibWrapper.Button1)
+                    && xbe.get_button() == XConstants.Button1)
                 {
                     // need to keep it to retarget mouse release
                     pressTarget = target;
                 } else if (xbe.get_type() == XConstants.ButtonRelease
-                           && xbe.get_button() == XlibWrapper.Button1
+                           && xbe.get_button() == XConstants.Button1
                            && pressTarget != target)
                 {
                     // during grab we do receive mouse release on different component (not on the source
@@ -2026,8 +2001,9 @@
                     // see 6390326 for more information.
                     target = pressTarget.isVisible() ? pressTarget : this;
                     xbe.set_window(target.getWindow());
-                    xbe.set_x(xbe.get_x_root() - target.getX());
-                    xbe.set_y(xbe.get_y_root() - target.getY());
+                    Point localCoord = target.toLocal(xbe.get_x_root(), xbe.get_y_root());
+                    xbe.set_x(localCoord.x);
+                    xbe.set_y(localCoord.y);
                     pressTarget = this;
                 }
                 if (target != null && target != getContentXWindow() && target != this) {
--- a/jdk/src/solaris/classes/sun/awt/X11/XlibUtil.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/solaris/classes/sun/awt/X11/XlibUtil.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2006-2008 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
@@ -152,7 +152,7 @@
                 int status = xtc.execute(XToolkit.IgnoreBadWindowHandler);
                 if ((status != 0) &&
                     ((XToolkit.saved_error == null) ||
-                     (XToolkit.saved_error.get_error_code() == XlibWrapper.Success)))
+                     (XToolkit.saved_error.get_error_code() == XConstants.Success)))
                 {
                     translated = new Point(xtc.get_dest_x(), xtc.get_dest_y());
                 }
@@ -351,7 +351,7 @@
             XToolkit.RESTORE_XERROR_HANDLER();
             if ((status != 0) &&
                 ((XToolkit.saved_error == null) ||
-                 (XToolkit.saved_error.get_error_code() == XlibWrapper.Success)))
+                 (XToolkit.saved_error.get_error_code() == XConstants.Success)))
             {
                 return wattr.get_map_state();
             }
@@ -362,7 +362,7 @@
             XToolkit.awtUnlock();
         }
 
-        return XlibWrapper.IsUnmapped;
+        return XConstants.IsUnmapped;
     }
 
     /**
--- a/jdk/src/solaris/classes/sun/awt/X11/XlibWrapper.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/solaris/classes/sun/awt/X11/XlibWrapper.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2002-2008 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
@@ -29,8 +29,7 @@
 import java.security.PrivilegedAction;
 import sun.misc.*;
 
-public class XlibWrapper implements XConstants, XUtilConstants, XProtocolConstants,
-                                    XCursorFontConstants
+final public class XlibWrapper
 {
     static Unsafe unsafe = Unsafe.getUnsafe();
     // strange constants
@@ -321,7 +320,7 @@
         if (XPropertyCache.isCachingSupported() &&
             XToolkit.windowToXWindow(window) != null &&
             WindowPropertyGetter.isCacheableProperty(XAtom.get(atom)) &&
-            mode == PropModeReplace)
+            mode == XConstants.PropModeReplace)
         {
             int length = (format / 8) * nelements;
             XPropertyCache.storeCache(
@@ -585,25 +584,25 @@
 
     static String hintsToString(long flags) {
         StringBuffer buf = new StringBuffer();
-        if ((flags & PMaxSize) != 0) {
+        if ((flags & XUtilConstants.PMaxSize) != 0) {
             buf.append("PMaxSize ");
         }
-        if ((flags & PMinSize) != 0) {
+        if ((flags & XUtilConstants.PMinSize) != 0) {
             buf.append("PMinSize ");
         }
-        if ((flags & USSize) != 0) {
+        if ((flags & XUtilConstants.USSize) != 0) {
             buf.append("USSize ");
         }
-        if ((flags & USPosition) != 0) {
+        if ((flags & XUtilConstants.USPosition) != 0) {
             buf.append("USPosition ");
         }
-        if ((flags & PPosition) != 0) {
+        if ((flags & XUtilConstants.PPosition) != 0) {
             buf.append("PPosition ");
         }
-        if ((flags & PSize) != 0) {
+        if ((flags & XUtilConstants.PSize) != 0) {
             buf.append("PSize ");
         }
-        if ((flags & PWinGravity) != 0) {
+        if ((flags & XUtilConstants.PWinGravity) != 0) {
             buf.append("PWinGravity ");
         }
         return buf.toString();
--- a/jdk/src/solaris/classes/sun/awt/X11/genhash.awk	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/solaris/classes/sun/awt/X11/genhash.awk	Thu Jun 12 13:50:55 2008 -0700
@@ -1,4 +1,4 @@
-# Copyright 2005 Sun Microsystems, Inc.  All Rights Reserved.
+# Copyright 2008 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
@@ -38,8 +38,8 @@
          if( $1 != "0x0000" ) {
              ndx =  toupper($1);
              sub(/0X/, "", ndx);
-             printf("        keysym2UCSHash.put( (long)%s, (char)%s); // %s --> %s \n",
-                        $4, $1, $3, unic[ndx]);
+             printf("        keysym2UCSHash.put( (long)%s, (char)%s); // %s -->%s\n",
+                        $4, $1, $3, (unic[ndx]=="" ? "" : " " unic[ndx]));
          }
      }
 /tojava/ { sub(/tojava /, ""); sub(/tojava$/, ""); print}    
--- a/jdk/src/solaris/classes/sun/awt/X11/keysym2ucs.h	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/solaris/classes/sun/awt/X11/keysym2ucs.h	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2008 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
@@ -39,7 +39,7 @@
  */
 
 tojava /*
-tojava  * Copyright 2005-2007 Sun Microsystems, Inc.  All Rights Reserved.
+tojava  * Copyright 2005-2008 Sun Microsystems, Inc.  All Rights Reserved.
 tojava  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 tojava  *
 tojava  * This code is free software; you can redistribute it and/or modify it
@@ -2546,6 +2546,7 @@
 tojava
 tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_Multi_key),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_COMPOSE, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
 tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_Mode_switch),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_ALT_GRAPH, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
+tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_ISO_Level3_Shift),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_ALT_GRAPH, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
 tojava
 tojava             /* Editing block */
 tojava         keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_Redo),     new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_AGAIN, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
--- a/jdk/src/solaris/classes/sun/awt/X11GraphicsConfig.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/solaris/classes/sun/awt/X11GraphicsConfig.java	Thu Jun 12 13:50:55 2008 -0700
@@ -421,7 +421,7 @@
     {
         return new SunVolatileImage(target,
                                     target.getWidth(), target.getHeight(),
-                                    new Long(backBuffer));
+                                    Long.valueOf(backBuffer));
     }
 
     /**
--- a/jdk/src/solaris/classes/sun/awt/X11GraphicsDevice.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/solaris/classes/sun/awt/X11GraphicsDevice.java	Thu Jun 12 13:50:55 2008 -0700
@@ -164,7 +164,7 @@
                 if (ret[i] == null) {
                     boolean doubleBuffer =
                         (dbeSupported &&
-                         doubleBufferVisuals.contains(new Integer(visNum)));
+                         doubleBufferVisuals.contains(Integer.valueOf(visNum)));
                     ret[i] = X11GraphicsConfig.getConfig(this, visNum, depth,
                             getConfigColormap(i, screen),
                             doubleBuffer);
@@ -199,7 +199,7 @@
     public static native boolean isDBESupported();
     // Callback for adding a new double buffer visual into our set
     private void addDoubleBufferVisual(int visNum) {
-        doubleBufferVisuals.add(new Integer(visNum));
+        doubleBufferVisuals.add(Integer.valueOf(visNum));
     }
     // Enumerates all visuals that support double buffering
     private native void getDoubleBufferVisuals(int screen);
@@ -239,7 +239,7 @@
                     doubleBufferVisuals = new HashSet();
                     getDoubleBufferVisuals(screen);
                     doubleBuffer =
-                        doubleBufferVisuals.contains(new Integer(visNum));
+                        doubleBufferVisuals.contains(Integer.valueOf(visNum));
                 }
                 defaultConfig = X11GraphicsConfig.getConfig(this, visNum,
                                                             depth, getConfigColormap(0, screen),
--- a/jdk/src/solaris/classes/sun/awt/X11GraphicsEnvironment.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/solaris/classes/sun/awt/X11GraphicsEnvironment.java	Thu Jun 12 13:50:55 2008 -0700
@@ -48,6 +48,8 @@
 import sun.font.FontManager;
 import sun.font.NativeFont;
 import sun.java2d.SunGraphicsEnvironment;
+import sun.java2d.SurfaceManagerFactory;
+import sun.java2d.UnixSurfaceManagerFactory;
 
 /**
  * This is an implementation of a GraphicsEnvironment object for the
@@ -177,6 +179,10 @@
                 return null;
             }
          });
+
+        // Install the correct surface manager factory.
+        SurfaceManagerFactory.setInstance(new UnixSurfaceManagerFactory());
+
     }
 
     private static boolean glxAvailable;
--- a/jdk/src/solaris/classes/sun/java2d/SurfaceManagerFactory.java	Thu Jun 05 15:57:56 2008 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,65 +0,0 @@
-/*
- * Copyright 2003-2007 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.java2d;
-
-import java.awt.GraphicsConfiguration;
-import java.awt.image.BufferedImage;
-import sun.awt.X11GraphicsConfig;
-import sun.awt.image.SunVolatileImage;
-import sun.awt.image.SurfaceManager;
-import sun.awt.image.VolatileSurfaceManager;
-import sun.java2d.opengl.GLXGraphicsConfig;
-import sun.java2d.opengl.GLXVolatileSurfaceManager;
-import sun.java2d.x11.X11VolatileSurfaceManager;
-
-/**
- * This is a factory class with static methods for creating a
- * platform-specific instance of a particular SurfaceManager.  Each platform
- * (Windows, Unix, etc.) has its own specialized SurfaceManagerFactory.
- */
-public class SurfaceManagerFactory {
-    /**
-     * Creates a new instance of a VolatileSurfaceManager given any
-     * arbitrary SunVolatileImage.  An optional context Object can be supplied
-     * as a way for the caller to pass pipeline-specific context data to
-     * the VolatileSurfaceManager (such as a backbuffer handle, for example).
-     *
-     * For Unix platforms, this method returns either an X11- or a GLX-
-     * specific VolatileSurfaceManager based on the GraphicsConfiguration
-     * under which the SunVolatileImage was created.
-     */
-    public static VolatileSurfaceManager
-        createVolatileManager(SunVolatileImage vImg,
-                              Object context)
-    {
-        GraphicsConfiguration gc = vImg.getGraphicsConfig();
-        if (gc instanceof GLXGraphicsConfig) {
-            return new GLXVolatileSurfaceManager(vImg, context);
-        } else {
-            return new X11VolatileSurfaceManager(vImg, context);
-        }
-    }
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/solaris/classes/sun/java2d/UnixSurfaceManagerFactory.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,64 @@
+/*
+ * Copyright 2003-2008 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.java2d;
+
+import java.awt.GraphicsConfiguration;
+
+import sun.awt.image.SunVolatileImage;
+import sun.awt.image.VolatileSurfaceManager;
+import sun.java2d.opengl.GLXGraphicsConfig;
+import sun.java2d.opengl.GLXVolatileSurfaceManager;
+import sun.java2d.x11.X11VolatileSurfaceManager;
+
+/**
+ * The SurfaceManagerFactory that creates VolatileSurfaceManager
+ * implementations for the Unix volatile images.
+ */
+public class UnixSurfaceManagerFactory extends SurfaceManagerFactory {
+
+    /**
+     * Creates a new instance of a VolatileSurfaceManager given any
+     * arbitrary SunVolatileImage.  An optional context Object can be supplied
+     * as a way for the caller to pass pipeline-specific context data to
+     * the VolatileSurfaceManager (such as a backbuffer handle, for example).
+     *
+     * For Unix platforms, this method returns either an X11- or a GLX-
+     * specific VolatileSurfaceManager based on the GraphicsConfiguration
+     * under which the SunVolatileImage was created.
+     */
+    public VolatileSurfaceManager createVolatileManager(SunVolatileImage vImg,
+                                                        Object context)
+    {
+        GraphicsConfiguration gc = vImg.getGraphicsConfig();
+        if (gc instanceof GLXGraphicsConfig) {
+            return new GLXVolatileSurfaceManager(vImg, context);
+        } else {
+            return new X11VolatileSurfaceManager(vImg, context);
+        }
+    }
+
+}
--- a/jdk/src/solaris/classes/sun/print/AttributeClass.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/solaris/classes/sun/print/AttributeClass.java	Thu Jun 12 13:50:55 2008 -0700
@@ -32,6 +32,7 @@
     private int nameLen;
     private Object myValue;
 
+    public static final int TAG_UNSUPPORTED_VALUE = 0x10;
     public static final int TAG_INT = 0x21;
     public static final int TAG_BOOL = 0x22;
     public static final int TAG_ENUM = 0x23;
--- a/jdk/src/solaris/classes/sun/print/CUPSPrinter.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/solaris/classes/sun/print/CUPSPrinter.java	Thu Jun 12 13:50:55 2008 -0700
@@ -333,7 +333,7 @@
                     AttributeClass.ATTRIBUTES_NATURAL_LANGUAGE,
                     new AttributeClass("requested-attributes",
                                        AttributeClass.TAG_KEYWORD,
-                                       "printer-name")
+                                       "printer-uri-supported")
                 };
 
                 if (IPPPrintService.writeIPPRequest(os,
@@ -354,7 +354,7 @@
                     ArrayList printerNames = new ArrayList();
                     for (int i=0; i< responseMap.length; i++) {
                         AttributeClass attribClass = (AttributeClass)
-                            responseMap[i].get("printer-name");
+                            responseMap[i].get("printer-uri-supported");
 
                         if (attribClass != null) {
                             String nameStr = attribClass.getStringValue();
--- a/jdk/src/solaris/classes/sun/print/IPPPrintService.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/solaris/classes/sun/print/IPPPrintService.java	Thu Jun 12 13:50:55 2008 -0700
@@ -335,6 +335,38 @@
     }
 
 
+    IPPPrintService(String name, String uriStr, boolean isCups) {
+        if ((name == null) || (uriStr == null)){
+            throw new IllegalArgumentException("null uri or printer name");
+        }
+        printer = name;
+        supportedDocFlavors = null;
+        supportedCats = null;
+        mediaSizeNames = null;
+        customMediaSizeNames = null;
+        mediaTrays = null;
+        cps = null;
+        init = false;
+        defaultMediaIndex = -1;
+        try {
+            myURL =
+                new URL(uriStr.replaceFirst("ipp", "http"));
+        } catch (Exception e) {
+            IPPPrintService.debug_println(debugPrefix+
+                                          " IPPPrintService, myURL="+
+                                          myURL+" Exception= "+
+                                          e);
+        }
+
+        isCupsPrinter = isCups;
+        try {
+            myURI =  new URI(uriStr);
+            debug_println(debugPrefix+"IPPPrintService myURI : "+myURI);
+        } catch (java.net.URISyntaxException e) {
+            throw new IllegalArgumentException("invalid uri");
+        }
+    }
+
 
     /*
      * Initialize mediaSizeNames, mediaTrays and other attributes.
@@ -375,7 +407,7 @@
                     return;
                 } catch (Exception e) {
                     IPPPrintService.debug_println(debugPrefix+
-                                       " error creating CUPSPrinter");
+                                       " error creating CUPSPrinter e="+e);
                 }
             }
 
@@ -621,17 +653,8 @@
                 }
             }
         } else if (category == OrientationRequested.class) {
-            if (flavor == null ||
-                flavor.equals(DocFlavor.SERVICE_FORMATTED.PAGEABLE) ||
-                flavor.equals(DocFlavor.SERVICE_FORMATTED.PRINTABLE)) {
-                // Orientation is emulated in Pageable/Printable flavors
-                // so we report the 3 orientations as supported.
-                OrientationRequested []orientSup = new OrientationRequested[3];
-                orientSup[0] = OrientationRequested.PORTRAIT;
-                orientSup[1] = OrientationRequested.LANDSCAPE;
-                orientSup[2] = OrientationRequested.REVERSE_LANDSCAPE;
-                return orientSup;
-            }
+            boolean revPort = false;
+            OrientationRequested[] orientSup = null;
 
             AttributeClass attribClass = (getAttMap != null) ?
               (AttributeClass)getAttMap.get("orientation-requested-supported")
@@ -639,7 +662,7 @@
             if (attribClass != null) {
                 int[] orientArray = attribClass.getArrayOfIntValues();
                 if ((orientArray != null) && (orientArray.length > 0)) {
-                    OrientationRequested[] orientSup =
+                    orientSup =
                         new OrientationRequested[orientArray.length];
                     for (int i=0; i<orientArray.length; i++) {
                         switch (orientArray[i]) {
@@ -657,12 +680,33 @@
                         case 6:
                             orientSup[i] =
                                 OrientationRequested.REVERSE_PORTRAIT;
+                            revPort = true;
                             break;
                         }
                     }
-                    return orientSup;
                 }
             }
+            if (flavor == null ||
+                flavor.equals(DocFlavor.SERVICE_FORMATTED.PAGEABLE) ||
+                flavor.equals(DocFlavor.SERVICE_FORMATTED.PRINTABLE)) {
+
+                if (revPort && flavor == null) {
+                    OrientationRequested []orSup = new OrientationRequested[4];
+                    orSup[0] = OrientationRequested.PORTRAIT;
+                    orSup[1] = OrientationRequested.LANDSCAPE;
+                    orSup[2] = OrientationRequested.REVERSE_LANDSCAPE;
+                    orSup[3] = OrientationRequested.REVERSE_PORTRAIT;
+                    return orSup;
+                } else {
+                    OrientationRequested []orSup = new OrientationRequested[3];
+                    orSup[0] = OrientationRequested.PORTRAIT;
+                    orSup[1] = OrientationRequested.LANDSCAPE;
+                    orSup[2] = OrientationRequested.REVERSE_LANDSCAPE;
+                    return orSup;
+                }
+            } else {
+                return orientSup;
+            }
         } else if (category == PageRanges.class) {
            if (flavor == null ||
                 flavor.equals(DocFlavor.SERVICE_FORMATTED.PAGEABLE) ||
@@ -795,6 +839,18 @@
 
                             docList.addAll(Arrays.asList(flavors));
 
+                            if (isCupsPrinter) {
+                            /*
+                              Always add Pageable and Printable for CUPS
+                              since it uses Filters to convert from Postscript
+                              to device printer language.
+                             */
+                                docList.add(
+                                        DocFlavor.SERVICE_FORMATTED.PAGEABLE);
+                                docList.add(
+                                        DocFlavor.SERVICE_FORMATTED.PRINTABLE);
+                            }
+
                             if (mimeType.equals("text/plain") &&
                                 addHostEncoding) {
                                 docList.add(Arrays.asList(textPlainHost));
@@ -808,11 +864,6 @@
                             } else if (mimeType.equals("image/jpeg")) {
                                 jpgImagesAdded = true;
                             } else if (mimeType.indexOf("postscript") != -1) {
-                                docList.add(
-                                      DocFlavor.SERVICE_FORMATTED.PAGEABLE);
-                                docList.add(
-                                      DocFlavor.SERVICE_FORMATTED.PRINTABLE);
-
                                 psSupported = true;
                             }
                             break;
@@ -829,7 +880,7 @@
                 }
 
                 // check if we need to add image DocFlavors
-                if (psSupported) {
+                if (psSupported || isCupsPrinter) {
                     if (!jpgImagesAdded) {
                         docList.addAll(Arrays.asList(imageJPG));
                     }
@@ -991,6 +1042,14 @@
             getSupportedAttributeCategories();
         }
 
+        // It is safe to assume that Orientation is always supported
+        // and even if CUPS or an IPP device reports it as not,
+        // our renderer can do portrait, landscape and
+        // reverse landscape.
+        if (category == OrientationRequested.class) {
+            return true;
+        }
+
         for (int i=0;i<supportedCats.length;i++) {
             if (category == supportedCats[i]) {
                 return true;
@@ -1520,10 +1579,7 @@
             if (isCupsPrinter) {
                 try {
                     urlConnection = getIPPConnection(
-                                             new URL("http://"+
-                                                     CUPSPrinter.getServer()+":"+
-                                                     CUPSPrinter.getPort()+
-                                                     "/printers/"+printer+".ppd"));
+                                             new URL(myURL+".ppd"));
 
                    InputStream is = urlConnection.getInputStream();
                    if (is != null) {
@@ -1539,6 +1595,11 @@
                        }
                     }
                 } catch (java.io.IOException e) {
+                    debug_println(" isPostscript, e= "+e);
+                    /* if PPD is not found, this may be a raw printer
+                       and in this case it is assumed that it is a
+                       Postscript printer */
+                    // do nothing
                 }
             }
         }
@@ -1602,7 +1663,13 @@
     public static boolean writeIPPRequest(OutputStream os,
                                            String operCode,
                                            AttributeClass[] attCl) {
-        OutputStreamWriter osw = new OutputStreamWriter(os);
+        OutputStreamWriter osw;
+        try {
+            osw = new OutputStreamWriter(os, "UTF-8");
+        } catch (java.io.UnsupportedEncodingException exc) {
+            debug_println("UTF-8 not supported? Exception: "+exc);
+            return false;
+        }
         char[] opCode =  new char[2];
         opCode[0] =  (char)Byte.parseByte(operCode.substring(0,2), 16);
         opCode[1] =  (char)Byte.parseByte(operCode.substring(2,4), 16);
@@ -1690,7 +1757,7 @@
 
                     // read value tag
                     response[0] = ois.readByte();
-                    while (response[0] >= AttributeClass.TAG_INT &&
+                    while (response[0] >= AttributeClass.TAG_UNSUPPORTED_VALUE &&
                            response[0] <= AttributeClass.TAG_MEMBER_ATTRNAME) {
                         // read name length
                         len  = ois.readShort();
@@ -1710,12 +1777,16 @@
                                 respList.add(responseMap);
                                 responseMap = new HashMap();
                             }
-                            AttributeClass ac =
-                                new AttributeClass(attribStr,
-                                                   valTagByte,
-                                                   outArray);
 
-                            responseMap.put(ac.getName(), ac);
+                            // exclude those that are unknown
+                            if (valTagByte >= AttributeClass.TAG_INT) {
+                                AttributeClass ac =
+                                    new AttributeClass(attribStr,
+                                                       valTagByte,
+                                                       outArray);
+
+                                responseMap.put(ac.getName(), ac);
+                            }
 
                             outObj = new ByteArrayOutputStream();
                             counter = 0; //reset counter
--- a/jdk/src/solaris/classes/sun/print/UnixPrintJob.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/solaris/classes/sun/print/UnixPrintJob.java	Thu Jun 12 13:50:55 2008 -0700
@@ -867,39 +867,38 @@
             execCmd[n++] = "/usr/bin/lp";
             execCmd[n++] = "-c";           // make a copy of the spool file
             if ((pFlags & PRINTER) != 0) {
-                execCmd[n++] = new String("-d" + printer);
+                execCmd[n++] = "-d" + printer;
             }
             if ((pFlags & BANNER) != 0) {
                 String quoteChar = "\"";
-                execCmd[n++] = new String("-t "  + quoteChar+banner+quoteChar);
+                execCmd[n++] = "-t "  + quoteChar+banner+quoteChar;
             }
             if ((pFlags & COPIES) != 0) {
-                execCmd[n++] = new String("-n " +
-                                          new Integer(copies).toString());
+                execCmd[n++] = "-n " + copies;
             }
             if ((pFlags & NOSHEET) != 0) {
-                execCmd[n++] = new String("-o nobanner");
+                execCmd[n++] = "-o nobanner";
             }
             if ((pFlags & OPTIONS) != 0) {
-                execCmd[n++] = new String("-o " + options);
+                execCmd[n++] = "-o " + options;
             }
         } else {
             execCmd = new String[ncomps];
             execCmd[n++] = "/usr/bin/lpr";
             if ((pFlags & PRINTER) != 0) {
-                execCmd[n++] = new String("-P" + printer);
+                execCmd[n++] = "-P" + printer;
             }
             if ((pFlags & BANNER) != 0) {
-                execCmd[n++] = new String("-J "  + banner);
+                execCmd[n++] = "-J "  + banner;
             }
             if ((pFlags & COPIES) != 0) {
-                execCmd[n++] = new String("-#" + new Integer(copies).toString());
+                execCmd[n++] = "-#" + copies;
             }
             if ((pFlags & NOSHEET) != 0) {
-                execCmd[n++] = new String("-h");
+                execCmd[n++] = "-h";
             }
             if ((pFlags & OPTIONS) != 0) {
-                execCmd[n++] = new String("-o" + options);
+                execCmd[n++] = "-o" + options;
             }
         }
         execCmd[n++] = spoolFile;
--- a/jdk/src/solaris/classes/sun/print/UnixPrintServiceLookup.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/solaris/classes/sun/print/UnixPrintServiceLookup.java	Thu Jun 12 13:50:55 2008 -0700
@@ -196,11 +196,20 @@
 
     // refreshes "printServices"
     public synchronized void refreshServices() {
-        String[] printers; /* excludes the default printer */
+        /* excludes the default printer */
+        String[] printers = null; // array of printer names
+        String[] printerURIs = null; //array of printer URIs
 
         getDefaultPrintService();
         if (CUPSPrinter.isCupsRunning()) {
-            printers = CUPSPrinter.getAllPrinters();
+            printerURIs = CUPSPrinter.getAllPrinters();
+            if ((printerURIs != null) && (printerURIs.length > 0)) {
+                printers = new String[printerURIs.length];
+                for (int i=0; i<printerURIs.length; i++) {
+                    int lastIndex = printerURIs[i].lastIndexOf("/");
+                    printers[i] = printerURIs[i].substring(lastIndex+1);
+                }
+            }
         } else {
             if (isSysV()) {
                 printers = getAllPrinterNamesSysV();
@@ -236,12 +245,9 @@
 
                     if (CUPSPrinter.isCupsRunning()) {
                         try {
-                            URL serviceURL =
-                                new URL("http://"+
-                                        CUPSPrinter.getServer()+":"+
-                                        CUPSPrinter.getPort()+"/"+printers[p]);
-                            printerList.add(new IPPPrintService( printers[p],
-                                                                 serviceURL));
+                            printerList.add(new IPPPrintService(printers[p],
+                                                                printerURIs[p],
+                                                                true));
                         } catch (Exception e) {
                             IPPPrintService.debug_println(debugPrefix+
                                                           " getAllPrinters Exception "+
@@ -265,12 +271,10 @@
                     if (j == printServices.length) {      // not found?
                         if (CUPSPrinter.isCupsRunning()) {
                             try {
-                                URL serviceURL =
-                                    new URL("http://"+
-                                        CUPSPrinter.getServer()+":"+
-                                        CUPSPrinter.getPort()+"/"+printers[p]);
-                                printerList.add(new IPPPrintService( printers[p],
-                                                                 serviceURL));
+                                printerList.add(new IPPPrintService(
+                                                               printers[p],
+                                                               printerURIs[p],
+                                                               true));
                             } catch (Exception e) {
                                 IPPPrintService.debug_println(debugPrefix+
                                                               " getAllPrinters Exception "+
--- a/jdk/src/solaris/native/sun/awt/MouseInfo.c	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/solaris/native/sun/awt/MouseInfo.c	Thu Jun 12 13:50:55 2008 -0700
@@ -54,7 +54,7 @@
      int i;
      int32_t xr, yr, xw, yw;
      uint32_t keys;
-     BOOL pointerFound;
+     Bool pointerFound;
 
      AWT_LOCK();
      if (pointClass == NULL) {
@@ -102,7 +102,7 @@
     int32_t xr = 0, yr = 0, xw = 0, yw = 0;
     uint32_t keys = 0;
     uint32_t nchildren = 0;
-    BOOL pointerFound = 0;
+    Bool pointerFound = 0;
     struct FrameData *wdata = NULL;
     jobject winPeer = NULL;
 
--- a/jdk/src/solaris/native/sun/awt/awt_GraphicsEnv.c	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/solaris/native/sun/awt/awt_GraphicsEnv.c	Thu Jun 12 13:50:55 2008 -0700
@@ -650,7 +650,7 @@
         if (XineramaQueryScreens != NULL) {
             DTRACE_PRINTLN("calling XineramaQueryScreens func on Linux");
             xinInfo = (*XineramaQueryScreens)(awt_display, &locNumScr);
-            if (xinInfo != NULL) {
+            if (xinInfo != NULL && locNumScr > XScreenCount(awt_display)) {
                 int32_t idx;
                 DTRACE_PRINTLN("Enabling Xinerama support");
                 usingXinerama = True;
@@ -701,7 +701,8 @@
         if (XineramaSolarisFunc != NULL) {
             DTRACE_PRINTLN("calling XineramaGetInfo func on Solaris");
             if ((*XineramaSolarisFunc)(awt_display, 0, &fbrects[0],
-                                       &fbhints[0], &locNumScr) != 0)
+                                       &fbhints[0], &locNumScr) != 0 &&
+                locNumScr > XScreenCount(awt_display))
             {
                 DTRACE_PRINTLN("Enabling Xinerama support");
                 usingXinerama = True;
@@ -1626,6 +1627,8 @@
 
 #define BIT_DEPTH_MULTI java_awt_DisplayMode_BIT_DEPTH_MULTI
 
+typedef Status
+    (*XRRQueryVersionType) (Display *dpy, int *major_versionp, int *minor_versionp);
 typedef XRRScreenConfiguration*
     (*XRRGetScreenInfoType)(Display *dpy, Drawable root);
 typedef void
@@ -1650,6 +1653,7 @@
                                      short rate,
                                      Time timestamp);
 
+static XRRQueryVersionType               awt_XRRQueryVersion;
 static XRRGetScreenInfoType              awt_XRRGetScreenInfo;
 static XRRFreeScreenConfigInfoType       awt_XRRFreeScreenConfigInfo;
 static XRRConfigRatesType                awt_XRRConfigRates;
@@ -1672,6 +1676,8 @@
 static jboolean
 X11GD_InitXrandrFuncs(JNIEnv *env)
 {
+    int rr_maj_ver = 0, rr_min_ver = 0;
+
     void *pLibRandR = dlopen("libXrandr.so.2", RTLD_LAZY | RTLD_LOCAL);
     if (pLibRandR == NULL) {
         J2dRlsTraceLn(J2D_TRACE_ERROR,
@@ -1679,6 +1685,41 @@
         return JNI_FALSE;
     }
 
+    LOAD_XRANDR_FUNC(XRRQueryVersion);
+
+    if (!(*awt_XRRQueryVersion)(awt_display, &rr_maj_ver, &rr_min_ver)) {
+        J2dRlsTraceLn(J2D_TRACE_ERROR,
+                      "X11GD_InitXrandrFuncs: XRRQueryVersion returned an error status");
+        dlclose(pLibRandR);
+        return JNI_FALSE;
+    }
+
+    if (usingXinerama) {
+        /*
+         * We can proceed as long as this is RANDR 1.2 or above.
+         * As of Xorg server 1.3 onwards the Xinerama backend may actually be
+         * a fake one provided by RANDR itself. See Java bug 6636469 for info.
+         */
+        if (!(rr_maj_ver > 1 || (rr_maj_ver == 1 && rr_min_ver >= 2))) {
+            J2dRlsTraceLn2(J2D_TRACE_INFO, "X11GD_InitXrandrFuncs: Can't use Xrandr. "
+                           "Xinerama is active and Xrandr version is %d.%d",
+                           rr_maj_ver, rr_min_ver);
+            dlclose(pLibRandR);
+            return JNI_FALSE;
+        }
+
+        /*
+         * REMIND: Fullscreen mode doesn't work quite right with multi-monitor
+         * setups and RANDR 1.2. So for now we also require a single screen.
+         */
+        if (awt_numScreens > 1 ) {
+            J2dRlsTraceLn(J2D_TRACE_INFO, "X11GD_InitXrandrFuncs: Can't use Xrandr. "
+                          "Multiple screens in use");
+            dlclose(pLibRandR);
+            return JNI_FALSE;
+        }
+    }
+
     LOAD_XRANDR_FUNC(XRRGetScreenInfo);
     LOAD_XRANDR_FUNC(XRRFreeScreenConfigInfo);
     LOAD_XRANDR_FUNC(XRRConfigRates);
@@ -1814,15 +1855,6 @@
     int opcode = 0, firstEvent = 0, firstError = 0;
     jboolean ret;
 
-    if (usingXinerama) {
-        /*
-         * REMIND: we'll just punt if Xinerama is enabled; we can remove this
-         * restriction in the future if we find Xinerama and XRandR playing
-         * well together...
-         */
-        return JNI_FALSE;
-    }
-
     AWT_LOCK();
     ret = (jboolean)XQueryExtension(awt_display, "RANDR",
                                     &opcode, &firstEvent, &firstError);
--- a/jdk/src/solaris/native/sun/awt/gtk2_interface.c	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/solaris/native/sun/awt/gtk2_interface.c	Thu Jun 12 13:50:55 2008 -0700
@@ -333,6 +333,7 @@
 static GdkPixbuf* (*fp_gtk_widget_render_icon)(GtkWidget *widget,
         const gchar *stock_id, GtkIconSize size, const gchar *detail);
 static void (*fp_gtk_widget_set_name)(GtkWidget *widget, const gchar *name);
+static void (*fp_gtk_widget_set_parent)(GtkWidget *widget, GtkWidget *parent);
 static void (*fp_gtk_widget_set_direction)(GtkWidget *widget,
         GtkTextDirection direction);
 static void (*fp_gtk_widget_style_get)(GtkWidget *widget,
@@ -570,6 +571,8 @@
             dl_symbol("gtk_widget_render_icon");
         fp_gtk_widget_set_name =
             dl_symbol("gtk_widget_set_name");
+        fp_gtk_widget_set_parent =
+            dl_symbol("gtk_widget_set_parent");
         fp_gtk_widget_set_direction =
             dl_symbol("gtk_widget_set_direction");
         fp_gtk_widget_style_get =
@@ -1040,7 +1043,7 @@
                     (NULL == gtk2_widgets[_GTK_COMBO_BOX_ARROW_BUTTON_TYPE]))
             {
                 gtk2_widgets[_GTK_COMBO_BOX_ARROW_BUTTON_TYPE] =
-                     (*fp_gtk_button_new)();
+                     (*fp_gtk_toggle_button_new)();
             }
             result = gtk2_widgets[_GTK_COMBO_BOX_ARROW_BUTTON_TYPE];
             break;
@@ -1414,12 +1417,20 @@
                  widget_type == COMBO_BOX_TEXT_FIELD)
         {
             /*
-             * We add a regular GtkButton/GtkEntry to a GtkComboBoxEntry
-             * in order to trick engines into thinking it's a real combobox
-             * arrow button/text field.
-             */
+            * We add a regular GtkButton/GtkEntry to a GtkComboBoxEntry
+            * in order to trick engines into thinking it's a real combobox
+            * arrow button/text field.
+            */
             GtkWidget *combo = (*fp_gtk_combo_box_entry_new)();
-            (*fp_gtk_container_add)((GtkContainer *)combo, result);
+
+            if (widget_type == COMBO_BOX_TEXT_FIELD)
+                (*fp_gtk_container_add)((GtkContainer *)combo, result);
+            else
+            {
+                (*fp_gtk_widget_set_parent)(result, combo);
+                ((GtkBin*)combo)->child = result;
+            }
+
             (*fp_gtk_container_add)((GtkContainer *)gtk2_fixed, combo);
             (*fp_gtk_widget_realize)(result);
             return result;
--- a/jdk/src/solaris/native/sun/awt/splashscreen/splashscreen_sys.c	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/solaris/native/sun/awt/splashscreen/splashscreen_sys.c	Thu Jun 12 13:50:55 2008 -0700
@@ -436,6 +436,7 @@
             break;
         }
     case PseudoColor: {
+            int availableColors;
             int numColors;
             int numComponents[3];
             unsigned long colorIndex[SPLASH_COLOR_MAP_SIZE];
@@ -444,9 +445,20 @@
             int depth = XDefaultDepthOfScreen(splash->screen);
             int scale = 65535 / MAX_COLOR_VALUE;
 
-            numColors = GetNumAvailableColors(splash->display, splash->screen,
+            availableColors = GetNumAvailableColors(splash->display, splash->screen,
                     splash->visual->map_entries);
-            numColors = quantizeColors(numColors, numComponents);
+            numColors = quantizeColors(availableColors, numComponents);
+            if (numColors > availableColors) {
+                // Could not allocate the color cells. Most probably
+                // the pool got exhausted. Disable the splash screen.
+                XCloseDisplay(splash->display);
+                splash->isVisible = -1;
+                splash->display = NULL;
+                splash->screen = NULL;
+                splash->visual = NULL;
+                fprintf(stderr, "Warning: unable to initialize the splashscreen. Not enough available color cells.\n");
+                return;
+            }
             splash->cmap = AllocColors(splash->display, splash->screen,
                     numColors, colorIndex);
             for (i = 0; i < numColors; i++) {
--- a/jdk/src/solaris/native/sun/java2d/loops/vis_FourByteAbgr.c	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/solaris/native/sun/java2d/loops/vis_FourByteAbgr.c	Thu Jun 12 13:50:55 2008 -0700
@@ -1936,6 +1936,7 @@
         for (j = 0; j < height; j++) {
             mlib_u8  *src = (void*)pixels;
             mlib_s32 *dst, *dst_end;
+            mlib_u8 *dst_start;
 
             if ((mlib_s32)dstBase & 3) {
                 COPY_NA(dstBase, pbuff, width*sizeof(mlib_s32));
@@ -1943,8 +1944,14 @@
             } else {
                 dst = (void*)dstBase;
             }
+            dst_start = (void*)dst;
             dst_end = dst + width;
 
+            /* Need to reset the GSR from the values set by the
+             * convert call near the end of this loop.
+             */
+            vis_write_gsr(7 << 0);
+
             if ((mlib_s32)dst & 7) {
                 pix = *src++;
                 dd = vis_fpadd16(MUL8_VIS(srcG_f, pix), d_half);
@@ -1984,8 +1991,13 @@
                 dst++;
             }
 
+            ADD_SUFF(IntArgbPreToIntArgbConvert)(dst_start, dst_start,
+                                                 width, 1,
+                                                 pRasInfo, pRasInfo,
+                                                 pPrim, pCompInfo);
+
             if ((mlib_s32)dstBase & 3) {
-                COPY_NA(pbuff, dstBase, width*sizeof(mlib_s32));
+                COPY_NA(dst_start, dstBase, width*sizeof(mlib_s32));
             }
 
             PTR_ADD(dstBase, scan);
--- a/jdk/src/solaris/native/sun/java2d/loops/vis_FourByteAbgrPre.c	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/solaris/native/sun/java2d/loops/vis_FourByteAbgrPre.c	Thu Jun 12 13:50:55 2008 -0700
@@ -181,6 +181,7 @@
     d_half = vis_to_double_dup((1 << (16 + 6)) | (1 << 6));
 
     srcG_f = vis_to_float(argbcolor);
+    ARGB2ABGR_FL(srcG_f);
 
     for (glyphCounter = 0; glyphCounter < totalGlyphs; glyphCounter++) {
         const jubyte *pixels;
@@ -238,8 +239,33 @@
             mlib_u8  *src = (void*)pixels;
             mlib_s32 *dst, *dst_end;
             mlib_u8  *dst8;
+            mlib_u8* dst_start = dstBase;
 
-            ADD_SUFF(FourByteAbgrPreToIntArgbConvert)(dstBase, pbuff, width, 1,
+            /*
+             * Typically the inner loop here works on Argb input data, an
+             * Argb color, and produces ArgbPre output data.  To use that
+             * standard approach we would need a FourByteAbgrPre to IntArgb
+             * converter for the front end and an IntArgbPre to FourByteAbgrPre
+             * converter for the back end.  The converter exists for the
+             * front end, but it is a workaround implementation that uses a 2
+             * stage conversion and an intermediate buffer that is allocated
+             * on every call.  The converter for the back end doesn't really
+             * exist, but we could reuse the IntArgb to FourByteAbgr converter
+             * to do the same work - at the cost of swapping the components as
+             * we copy the data back.  All of this is more work than we really
+             * need so we use an alternate procedure:
+             * - Copy the data into an int-aligned temporary buffer (if needed)
+             * - Convert the data from FourByteAbgrPre to IntAbgr by using the
+             * IntArgbPre to IntArgb converter in the int-aligned buffer.
+             * - Swap the color data to Abgr so that the inner loop goes from
+             * IntAbgr data to IntAbgrPre data
+             * - Simply copy the IntAbgrPre data back into place.
+             */
+            if (((mlib_s32)dstBase) & 3) {
+                COPY_NA(dstBase, pbuff, width*sizeof(mlib_s32));
+                dst_start = pbuff;
+            }
+            ADD_SUFF(IntArgbPreToIntArgbConvert)(dst_start, pbuff, width, 1,
                                                       pRasInfo, pRasInfo,
                                                       pPrim, pCompInfo);
 
@@ -283,9 +309,7 @@
                 dst++;
             }
 
-            ADD_SUFF(IntArgbToFourByteAbgrPreConvert)(pbuff, dstBase, width, 1,
-                                                      pRasInfo, pRasInfo,
-                                                      pPrim, pCompInfo);
+            COPY_NA(pbuff, dstBase, width*sizeof(mlib_s32));
 
             src = (void*)pixels;
             dst8 = (void*)dstBase;
--- a/jdk/src/solaris/native/sun/java2d/loops/vis_IntArgb.c	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/solaris/native/sun/java2d/loops/vis_IntArgb.c	Thu Jun 12 13:50:55 2008 -0700
@@ -428,6 +428,11 @@
             dst = (void*)dstBase;
             dst_end = dst + width;
 
+            /* Clearing the Graphics Status Register is necessary otherwise
+             * left over scale settings affect the pack instructions.
+             */
+            vis_write_gsr(0 << 3);
+
             if ((mlib_s32)dst & 7) {
                 pix = *src++;
                 dd = vis_fpadd16(MUL8_VIS(srcG_f, pix), d_half);
@@ -467,6 +472,9 @@
                 dst++;
             }
 
+            ADD_SUFF(IntArgbPreToIntArgbConvert)(dstBase, dstBase, width, 1,
+                                                 pRasInfo, pRasInfo,
+                                                 pPrim, pCompInfo);
             PTR_ADD(dstBase, scan);
             pixels += rowBytes;
         }
--- a/jdk/src/solaris/native/sun/java2d/loops/vis_IntArgbPre.c	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/solaris/native/sun/java2d/loops/vis_IntArgbPre.c	Thu Jun 12 13:50:55 2008 -0700
@@ -1193,10 +1193,6 @@
                 dst++;
             }
 
-            ADD_SUFF(IntArgbToIntArgbPreConvert)(dstBase, dstBase, width, 1,
-                                                 pRasInfo, pRasInfo,
-                                                 pPrim, pCompInfo);
-
             PTR_ADD(dstBase, scan);
             pixels += rowBytes;
         }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/solaris/native/sun/tracing/dtrace/jvm_symbols_md.c	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2008 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.
+ */
+
+#include <dlfcn.h>
+#include <stdlib.h>
+
+#include <jvm.h>
+
+#include "jvm_symbols.h"
+
+JvmSymbols* lookupJvmSymbols() {
+    JvmSymbols* syms = (JvmSymbols*)malloc(sizeof(JvmSymbols));
+    if (syms != NULL) {
+        syms->GetVersion = (GetVersion_t)
+            dlsym(RTLD_DEFAULT, "JVM_DTraceGetVersion");
+        syms->IsSupported = (IsSupported_t)
+            dlsym(RTLD_DEFAULT, "JVM_DTraceIsSupported");
+        syms->Activate = (Activate_t)
+            dlsym(RTLD_DEFAULT, "JVM_DTraceActivate");
+        syms->Dispose = (Dispose_t)
+            dlsym(RTLD_DEFAULT, "JVM_DTraceDispose");
+        syms->IsProbeEnabled = (IsProbeEnabled_t)
+            dlsym(RTLD_DEFAULT, "JVM_DTraceIsProbeEnabled");
+
+        if ( syms->GetVersion == NULL || syms->Activate == NULL ||
+             syms->IsProbeEnabled == NULL || syms->Dispose == NULL ||
+             syms->IsSupported == NULL) {
+            free(syms);
+            syms = NULL;
+        }
+    }
+    return syms;
+}
--- a/jdk/src/solaris/native/sun/xawt/XWindow.c	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/solaris/native/sun/xawt/XWindow.c	Thu Jun 12 13:50:55 2008 -0700
@@ -1234,7 +1234,7 @@
    }
 }
 
-JNIEXPORT int JNICALL
+JNIEXPORT jint JNICALL
 Java_sun_awt_X11_XWindow_getKeySymForAWTKeyCode(JNIEnv* env, jclass clazz, jint keycode) {
     return awt_getX11KeySym(keycode);
 }
--- a/jdk/src/solaris/native/sun/xawt/XlibWrapper.c	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/solaris/native/sun/xawt/XlibWrapper.c	Thu Jun 12 13:50:55 2008 -0700
@@ -359,7 +359,7 @@
     XDestroyWindow( (Display *)jlong_to_ptr(display),(Window) window);
 }
 
-JNIEXPORT int JNICALL Java_sun_awt_X11_XlibWrapper_XGrabPointer
+JNIEXPORT jint JNICALL Java_sun_awt_X11_XlibWrapper_XGrabPointer
 (JNIEnv *env, jclass clazz, jlong display, jlong window,
  jint owner_events, jint event_mask, jint pointer_mode,
  jint keyboard_mode, jlong confine_to, jlong cursor, jlong time)
@@ -377,7 +377,7 @@
     XUngrabPointer( (Display *)jlong_to_ptr(display), (Time) time);
 }
 
-JNIEXPORT int JNICALL Java_sun_awt_X11_XlibWrapper_XGrabKeyboard
+JNIEXPORT jint JNICALL Java_sun_awt_X11_XlibWrapper_XGrabKeyboard
 (JNIEnv *env, jclass clazz, jlong display, jlong window,
  jint owner_events, jint pointer_mode,
  jint keyboard_mode, jlong time)
@@ -621,7 +621,7 @@
 
 }
 
-JNIEXPORT int JNICALL Java_sun_awt_X11_XlibWrapper_XTranslateCoordinates
+JNIEXPORT jint JNICALL Java_sun_awt_X11_XlibWrapper_XTranslateCoordinates
 (JNIEnv *env, jclass clazz, jlong display, jlong src_w, jlong dest_w,
  jlong src_x, jlong src_y, jlong dest_x_return, jlong dest_y_return,
  jlong child_return)
@@ -634,7 +634,7 @@
                   (Window *) jlong_to_ptr(child_return));
 }
 
-JNIEXPORT int JNICALL Java_sun_awt_X11_XlibWrapper_XEventsQueued
+JNIEXPORT jint JNICALL Java_sun_awt_X11_XlibWrapper_XEventsQueued
 (JNIEnv *env, jclass clazz, jlong display, jint mode) {
 
     AWT_CHECK_HAVE_LOCK();
--- a/jdk/src/windows/classes/sun/awt/Win32GraphicsEnvironment.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/windows/classes/sun/awt/Win32GraphicsEnvironment.java	Thu Jun 12 13:50:55 2008 -0700
@@ -42,6 +42,8 @@
 import sun.awt.windows.WToolkit;
 import sun.font.FontManager;
 import sun.java2d.SunGraphicsEnvironment;
+import sun.java2d.SurfaceManagerFactory;
+import sun.java2d.WindowsSurfaceManagerFactory;
 import sun.java2d.windows.WindowsFlags;
 
 /**
@@ -64,6 +66,9 @@
         WindowsFlags.initFlags();
         initDisplayWrapper();
         eudcFontFileName = getEUDCFontFile();
+
+        // Install correct surface manager factory.
+        SurfaceManagerFactory.setInstance(new WindowsSurfaceManagerFactory());
     }
 
     /**
@@ -260,6 +265,7 @@
         try {
             while (!found && parser.hasMoreTokens()) {
                 String newPath = parser.nextToken();
+                boolean ujr = newPath.equals(jreFontDirName);
                 File theFile = new File(newPath, fontFileName);
                 if (theFile.canRead()) {
                     found = true;
@@ -267,11 +273,11 @@
                     if (defer) {
                         FontManager.registerDeferredFont(fontFileName, path,
                                                          nativeNames,
-                                                         fontFormat, true,
+                                                         fontFormat, ujr,
                                                          fontRank);
                     } else {
                         FontManager.registerFontFile(path, nativeNames,
-                                                     fontFormat, true,
+                                                     fontFormat, ujr,
                                                      fontRank);
                     }
                     break;
@@ -296,7 +302,7 @@
     }
 
     public static void registerJREFontsForPrinting() {
-        String pathName = null;
+        final String pathName;
         synchronized (Win32GraphicsEnvironment.class) {
             GraphicsEnvironment.getLocalGraphicsEnvironment();
             if (fontsForPrinting == null) {
@@ -305,15 +311,21 @@
             pathName = fontsForPrinting;
             fontsForPrinting = null;
         }
-        File f1 = new File(pathName);
-        String[] ls = f1.list(new TTFilter());
-        if (ls == null) {
-          return;
-        }
-        for (int i=0; i <ls.length; i++ ) {
-          File fontFile = new File(f1, ls[i]);
-          registerFontWithPlatform(fontFile.getAbsolutePath());
-        }
+        java.security.AccessController.doPrivileged(
+            new java.security.PrivilegedAction() {
+                public Object run() {
+                    File f1 = new File(pathName);
+                    String[] ls = f1.list(new TTFilter());
+                    if (ls == null) {
+                        return null;
+                    }
+                    for (int i=0; i <ls.length; i++ ) {
+                        File fontFile = new File(f1, ls[i]);
+                        registerFontWithPlatform(fontFile.getAbsolutePath());
+                    }
+                    return null;
+                }
+         });
     }
 
     protected static native void registerFontWithPlatform(String fontName);
--- a/jdk/src/windows/classes/sun/awt/shell/Win32ShellFolder2.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/windows/classes/sun/awt/shell/Win32ShellFolder2.java	Thu Jun 12 13:50:55 2008 -0700
@@ -910,18 +910,20 @@
     /**
      * Gets an icon from the Windows system icon list as an <code>Image</code>
      */
-    static Image getShell32Icon(int iconID) {
+    static Image getShell32Icon(int iconID, boolean getLargeIcon) {
         boolean useVGAColors = true; // Will be ignored on XP and later
 
+        int size = getLargeIcon ? 32 : 16;
+
         Toolkit toolkit = Toolkit.getDefaultToolkit();
         String shellIconBPP = (String)toolkit.getDesktopProperty("win.icon.shellIconBPP");
         if (shellIconBPP != null) {
             useVGAColors = shellIconBPP.equals("4");
         }
 
-        long hIcon = getIconResource("shell32.dll", iconID, 16, 16, useVGAColors);
+        long hIcon = getIconResource("shell32.dll", iconID, size, size, useVGAColors);
         if (hIcon != 0) {
-            Image icon = makeIcon(hIcon, false);
+            Image icon = makeIcon(hIcon, getLargeIcon);
             disposeIcon(hIcon);
             return icon;
         }
--- a/jdk/src/windows/classes/sun/awt/shell/Win32ShellFolderManager2.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/windows/classes/sun/awt/shell/Win32ShellFolderManager2.java	Thu Jun 12 13:50:55 2008 -0700
@@ -313,13 +313,12 @@
                 return null;
             }
             return Win32ShellFolder2.getSystemIcon(iconType);
-        } else if (key.startsWith("shell32Icon ")) {
-            int i;
-            String name = key.substring(key.indexOf(" ")+1);
+        } else if (key.startsWith("shell32Icon ") || key.startsWith("shell32LargeIcon ")) {
+            String name = key.substring(key.indexOf(" ") + 1);
             try {
-                i = Integer.parseInt(name);
+                int i = Integer.parseInt(name);
                 if (i >= 0) {
-                    return Win32ShellFolder2.getShell32Icon(i);
+                    return Win32ShellFolder2.getShell32Icon(i, key.startsWith("shell32LargeIcon "));
                 }
             } catch (NumberFormatException ex) {
             }
--- a/jdk/src/windows/classes/sun/awt/windows/WDataTransferer.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/windows/classes/sun/awt/windows/WDataTransferer.java	Thu Jun 12 13:50:55 2008 -0700
@@ -568,7 +568,7 @@
         byte[] headerBytes = null, trailerBytes = null;
 
         try {
-            headerBytes = new String(header).getBytes(ENCODING);
+            headerBytes = header.toString().getBytes(ENCODING);
             trailerBytes = htmlSuffix.getBytes(ENCODING);
         } catch (UnsupportedEncodingException cannotHappen) {
         }
--- a/jdk/src/windows/classes/sun/awt/windows/WInputMethod.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/windows/classes/sun/awt/windows/WInputMethod.java	Thu Jun 12 13:50:55 2008 -0700
@@ -488,7 +488,7 @@
                 attrStr.addAttribute(Attribute.INPUT_METHOD_SEGMENT,
                                         new Annotation(null), 0, text.length());
                 attrStr.addAttribute(Attribute.READING,
-                                        new Annotation(new String("")), 0, text.length());
+                                     new Annotation(""), 0, text.length());
             }
 
             // set Hilight Information
--- a/jdk/src/windows/classes/sun/awt/windows/WPanelPeer.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/windows/classes/sun/awt/windows/WPanelPeer.java	Thu Jun 12 13:50:55 2008 -0700
@@ -30,9 +30,11 @@
 import java.util.Vector;
 
 import sun.awt.SunGraphicsCallback;
+import java.util.logging.*;
 
 class WPanelPeer extends WCanvasPeer implements PanelPeer {
 
+    private static final Logger log = Logger.getLogger("sun.awt.windows.WPanelPeer");
     // ComponentPeer overrides
 
     public void paint(Graphics g) {
@@ -131,8 +133,16 @@
         for (int i = 0; i < cont.getComponentCount(); i++) {
             Component comp = cont.getComponent(i);
             if (!comp.isLightweight()) {
-                if (comp.getPeer() != null) {
-                    peers.add(comp.getPeer());
+                ComponentPeer peer = comp.getPeer();
+                if (peer != null && (peer instanceof WComponentPeer))
+                {
+                    peers.add(peer);
+                } else {
+                    if (log.isLoggable(Level.FINE)) {
+                        log.log(Level.FINE,
+                                "peer of a {0} is null or not a WComponentPeer: {1}.",
+                                new Object[]{comp, peer});
+                    }
                 }
             }
             if (comp.isLightweight() && comp instanceof Container) {
--- a/jdk/src/windows/classes/sun/awt/windows/WPathGraphics.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/windows/classes/sun/awt/windows/WPathGraphics.java	Thu Jun 12 13:50:55 2008 -0700
@@ -943,8 +943,16 @@
         double devResY = wPrinterJob.getYRes();
         double devScaleX = devResX / DEFAULT_USER_RES;
         double devScaleY = devResY / DEFAULT_USER_RES;
-        if (scaleX > devScaleX) scaleX = devScaleX;
-        if (scaleY > devScaleY) scaleY = devScaleY;
+
+        /* check if rotated or sheared */
+        int transformType = fullTransform.getType();
+        boolean clampScale = ((transformType &
+                               (AffineTransform.TYPE_GENERAL_ROTATION |
+                                AffineTransform.TYPE_GENERAL_TRANSFORM)) != 0);
+        if (clampScale) {
+            if (scaleX > devScaleX) scaleX = devScaleX;
+            if (scaleY > devScaleY) scaleY = devScaleY;
+        }
 
         /* We do not need to draw anything if either scaling
          * factor is zero.
--- a/jdk/src/windows/classes/sun/awt/windows/WWindowPeer.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/windows/classes/sun/awt/windows/WWindowPeer.java	Thu Jun 12 13:50:55 2008 -0700
@@ -123,7 +123,7 @@
     public void setTitle(String title) {
         // allow a null title to pass as an empty string.
         if (title == null) {
-            title = new String("");
+            title = "";
         }
         _setTitle(title);
     }
--- a/jdk/src/windows/classes/sun/java2d/SurfaceManagerFactory.java	Thu Jun 05 15:57:56 2008 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,64 +0,0 @@
-/*
- * Copyright 2003-2007 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.java2d;
-
-import java.awt.GraphicsConfiguration;
-import java.awt.image.BufferedImage;
-import sun.awt.image.SunVolatileImage;
-import sun.awt.image.SurfaceManager;
-import sun.awt.image.VolatileSurfaceManager;
-import sun.java2d.opengl.WGLGraphicsConfig;
-import sun.java2d.opengl.WGLVolatileSurfaceManager;
-import sun.java2d.windows.WindowsFlags;
-import sun.java2d.windows.WinVolatileSurfaceManager;
-
-/**
- * This is a factory class with static methods for creating a
- * platform-specific instance of a particular SurfaceManager.  Each platform
- * (Windows, Unix, etc.) has its own specialized SurfaceManagerFactory.
- */
-public class SurfaceManagerFactory {
-    /**
-     * Creates a new instance of a VolatileSurfaceManager given any
-     * arbitrary SunVolatileImage.  An optional context Object can be supplied
-     * as a way for the caller to pass pipeline-specific context data to
-     * the VolatileSurfaceManager (such as a backbuffer handle, for example).
-     *
-     * For Windows platforms, this method returns a Windows-specific
-     * VolatileSurfaceManager.
-     */
-    public static VolatileSurfaceManager
-        createVolatileManager(SunVolatileImage vImg,
-                              Object context)
-    {
-        GraphicsConfiguration gc = vImg.getGraphicsConfig();
-        if (gc instanceof WGLGraphicsConfig) {
-            return new WGLVolatileSurfaceManager(vImg, context);
-        } else {
-            return new WinVolatileSurfaceManager(vImg, context);
-        }
-    }
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/windows/classes/sun/java2d/WindowsSurfaceManagerFactory.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,64 @@
+/*
+ * Copyright 2003-2008 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.java2d;
+
+import java.awt.GraphicsConfiguration;
+import java.awt.image.BufferedImage;
+import sun.awt.image.SunVolatileImage;
+import sun.awt.image.SurfaceManager;
+import sun.awt.image.VolatileSurfaceManager;
+import sun.java2d.opengl.WGLGraphicsConfig;
+import sun.java2d.opengl.WGLVolatileSurfaceManager;
+import sun.java2d.windows.WindowsFlags;
+import sun.java2d.windows.WinVolatileSurfaceManager;
+
+/**
+ * The SurfaceManagerFactory that creates VolatileSurfaceManager
+ * implementations for the Windows volatile images.
+ */
+public class WindowsSurfaceManagerFactory extends SurfaceManagerFactory {
+
+    /**
+     * Creates a new instance of a VolatileSurfaceManager given any
+     * arbitrary SunVolatileImage.  An optional context Object can be supplied
+     * as a way for the caller to pass pipeline-specific context data to
+     * the VolatileSurfaceManager (such as a backbuffer handle, for example).
+     *
+     * For Windows platforms, this method returns a Windows-specific
+     * VolatileSurfaceManager.
+     */
+    public VolatileSurfaceManager createVolatileManager(SunVolatileImage vImg,
+                                                        Object context)
+    {
+        GraphicsConfiguration gc = vImg.getGraphicsConfig();
+        if (gc instanceof WGLGraphicsConfig) {
+            return new WGLVolatileSurfaceManager(vImg, context);
+        } else {
+            return new WinVolatileSurfaceManager(vImg, context);
+        }
+    }
+
+}
--- a/jdk/src/windows/classes/sun/print/Win32PrintService.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/windows/classes/sun/print/Win32PrintService.java	Thu Jun 12 13:50:55 2008 -0700
@@ -348,7 +348,7 @@
 
         idList = new ArrayList();
         for (int i=0; i < media.length; i++) {
-          idList.add(new Integer(media[i]));
+            idList.add(Integer.valueOf(media[i]));
         }
 
         mediaSizes = getMediaSizes(idList, media);
@@ -517,7 +517,7 @@
           if ((wid <= 0) || (ht <= 0)) {
             //Remove corresponding ID from list
             if (nMedia == media.length) {
-              Integer remObj = new Integer(media[i]);
+                Integer remObj = Integer.valueOf(media[i]);
               idList.remove(idList.indexOf(remObj));
             }
             continue;
@@ -539,7 +539,7 @@
               msList.add(ms);
             } catch(IllegalArgumentException e) {
               if (nMedia == media.length) {
-                Integer remObj = new Integer(media[i]);
+                  Integer remObj = Integer.valueOf(media[i]);
                 idList.remove(idList.indexOf(remObj));
               }
             }
@@ -984,7 +984,7 @@
                      // cannot be null but to be safe, add a check
                      if ((idList != null) && (mediaSizes != null) &&
                          (idList.size() == mediaSizes.length)) {
-                         Integer defIdObj = new Integer(defPaper);
+                         Integer defIdObj = Integer.valueOf(defPaper);
                          int index = idList.indexOf(defIdObj);
                          if (index>=0 && index<mediaSizes.length) {
                              return mediaSizes[index].getMediaSizeName();
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/windows/native/sun/font/lcdglyph.c	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,481 @@
+/*
+ * Copyright 2008 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.
+ */
+
+/*
+ * The function here is used to get a GDI rasterized LCD glyph and place it
+ * into the JDK glyph cache. The benefit is rendering fidelity for the
+ * most common cases, with no impact on the 2D rendering pipelines.
+ *
+ * Requires that the font and graphics are unrotated, and the scale is
+ * a simple one, and the font is a TT font registered with windows.
+ * Those conditions are established by the calling code.
+ *
+ * This code
+ * - Receives the family name, style, and size of the font
+ * and creates a Font object.
+ * - Create a surface from which we can get a DC : must be 16 bit or more.
+ * Ideally we'd be able to specify the depth of this, but in practice we
+ * have to accept it will be the same as the default screen.
+ * - Selects the GDI font on to the device
+ * - Uses GetGlyphOutline to estimate the bounds.
+ * - Creates a DIB on to which to blit the image.
+ * - Creates a GlyphInfo structure and copies the GDI glyph and offsets
+ * into the glyph which is returned.
+ */
+
+#include <stdio.h>
+#include <malloc.h>
+#include <math.h>
+#include <windows.h>
+#include <winuser.h>
+
+#include <jni.h>
+#include <jni_util.h>
+#include <jlong_md.h>
+#include <sun_font_FileFontStrike.h>
+
+#include "fontscalerdefs.h"
+
+/* Some of these are also defined in awtmsg.h but I don't want a dependency
+ * on that here. They are needed here - and in awtmsg.h - until we
+ * move up our build to define WIN32_WINNT >= 0x501 (ie XP), since MS
+ * headers will not define them otherwise.
+ */
+#ifndef SPI_GETFONTSMOOTHINGTYPE
+#define SPI_GETFONTSMOOTHINGTYPE        0x200A
+#endif //SPI_GETFONTSMOOTHINGTYPE
+
+#ifndef SPI_GETFONTSMOOTHINGCONTRAST
+#define SPI_GETFONTSMOOTHINGCONTRAST    0x200C
+#endif //SPI_GETFONTSMOOTHINGCONTRAST
+
+#ifndef SPI_GETFONTSMOOTHINGORIENTATION
+#define SPI_GETFONTSMOOTHINGORIENTATION    0x2012
+#endif //SPI_GETFONTSMOOTHINGORIENTATION
+
+#ifndef FE_FONTSMOOTHINGORIENTATIONBGR
+#define FE_FONTSMOOTHINGORIENTATIONBGR 0x0000
+#endif //FE_FONTSMOOTHINGORIENTATIONBGR
+
+#ifndef FE_FONTSMOOTHINGORIENTATIONRGB
+#define FE_FONTSMOOTHINGORIENTATIONRGB 0x0001
+#endif //FE_FONTSMOOTHINGORIENTATIONRGB
+
+#define MIN_GAMMA 100
+#define MAX_GAMMA 220
+#define LCDLUTCOUNT (MAX_GAMMA-MIN_GAMMA+1)
+
+static unsigned char* igLUTable[LCDLUTCOUNT];
+
+static unsigned char* getIGTable(int gamma) {
+    int i, index;
+    double ig;
+    char *igTable;
+
+    if (gamma < MIN_GAMMA) {
+        gamma = MIN_GAMMA;
+    } else if (gamma > MAX_GAMMA) {
+        gamma = MAX_GAMMA;
+    }
+
+    index = gamma - MIN_GAMMA;
+
+    if (igLUTable[index] != NULL) {
+        return igLUTable[index];
+    }
+    igTable = (unsigned char*)malloc(256);
+    if (igTable == NULL) {
+      return NULL;
+    }
+    igTable[0] = 0;
+    igTable[255] = 255;
+    ig = ((double)gamma)/100.0;
+
+    for (i=1;i<255;i++) {
+        igTable[i] = (unsigned char)(pow(((double)i)/255.0, ig)*255);
+    }
+    igLUTable[index] = igTable;
+    return igTable;
+}
+
+
+JNIEXPORT jboolean JNICALL
+    Java_sun_font_FileFontStrike_initNative(JNIEnv *env, jclass unused) {
+
+    DWORD osVersion = GetVersion();
+    DWORD majorVersion = (DWORD)(LOBYTE(LOWORD(osVersion)));
+    DWORD minorVersion = (DWORD)(HIBYTE(LOWORD(osVersion)));
+
+    /* Need at least XP which is 5.1 */
+    if (majorVersion < 5 || (majorVersion == 5 && minorVersion < 1)) {
+        return JNI_FALSE;
+    }
+
+    memset(igLUTable, 0,  LCDLUTCOUNT);
+
+    return JNI_TRUE;
+}
+
+#ifndef CLEARTYPE_QUALITY
+#define CLEARTYPE_QUALITY 5
+#endif
+
+#ifndef CLEARTYPE_NATURAL_QUALITY
+#define CLEARTYPE_NATURAL_QUALITY 6
+#endif
+
+#define FREE_AND_RETURN \
+    if (hDesktopDC != 0 && hWnd != 0) { \
+       ReleaseDC(hWnd, hDesktopDC); \
+    }\
+    if (hMemoryDC != 0) { \
+        DeleteObject(hMemoryDC); \
+    } \
+    if (hBitmap != 0) { \
+        DeleteObject(hBitmap); \
+    } \
+    if (dibImage != NULL) { \
+        free(dibImage); \
+    } \
+    if (glyphInfo != NULL) { \
+        free(glyphInfo); \
+    } \
+    return (jlong)0;
+/* end define */
+
+JNIEXPORT jlong JNICALL
+Java_sun_font_FileFontStrike__1getGlyphImageFromWindows
+(JNIEnv *env, jobject unused,
+ jstring fontFamily, jint style, jint size, jint glyphCode, jboolean fm) {
+
+    GLYPHMETRICS glyphMetrics;
+    LOGFONTW lf;
+    BITMAPINFO bmi;
+    TEXTMETRIC textMetric;
+    RECT rect;
+    int bytesWidth, dibBytesWidth, extra, imageSize, dibImageSize;
+    unsigned char* dibImage = NULL, *rowPtr, *pixelPtr, *dibPixPtr, *dibRowPtr;
+    unsigned char r,g,b;
+    unsigned char* igTable;
+    GlyphInfo* glyphInfo = NULL;
+    int nameLen;
+    LPWSTR name;
+    HFONT oldFont, hFont;
+    MAT2 mat2;
+
+    unsigned short width;
+    unsigned short height;
+    short advanceX;
+    short advanceY;
+    int topLeftX;
+    int topLeftY;
+    int err;
+    int bmWidth, bmHeight;
+    int x, y;
+    HBITMAP hBitmap = NULL, hOrigBM;
+    int gamma, orient;
+
+    HWND hWnd = NULL;
+    HDC hDesktopDC = NULL;
+    HDC hMemoryDC = NULL;
+
+    hWnd = GetDesktopWindow();
+    hDesktopDC = GetWindowDC(hWnd);
+    if (hDesktopDC == NULL) {
+        return (jlong)0;
+    }
+    if (GetDeviceCaps(hDesktopDC, BITSPIXEL) < 15) {
+        FREE_AND_RETURN;
+    }
+
+    hMemoryDC = CreateCompatibleDC(hDesktopDC);
+    if (hMemoryDC == NULL || fontFamily == NULL) {
+        FREE_AND_RETURN;
+    }
+    err = SetMapMode(hMemoryDC, MM_TEXT);
+    if (err == 0) {
+        FREE_AND_RETURN;
+    }
+
+    memset(&lf, 0, sizeof(LOGFONTW));
+    lf.lfHeight = -size;
+    lf.lfWeight = (style & 1) ? FW_BOLD : FW_NORMAL;
+    lf.lfItalic = (style & 2) ? 0xff : 0;
+    lf.lfCharSet = DEFAULT_CHARSET;
+    lf.lfQuality = CLEARTYPE_QUALITY;
+    lf.lfOutPrecision = OUT_TT_PRECIS;
+    lf.lfClipPrecision = CLIP_DEFAULT_PRECIS;
+    lf.lfPitchAndFamily = DEFAULT_PITCH;
+
+    nameLen = (*env)->GetStringLength(env, fontFamily);
+    name = (LPWSTR)alloca((nameLen+1)*2);
+    if (name == NULL) {
+       FREE_AND_RETURN;
+    }
+    (*env)->GetStringRegion(env, fontFamily, 0, nameLen, name);
+    name[nameLen] = '\0';
+
+    if (nameLen < (sizeof(lf.lfFaceName) / sizeof(lf.lfFaceName[0]))) {
+        wcscpy(lf.lfFaceName, name);
+    } else {
+        FREE_AND_RETURN;
+    }
+
+    hFont = CreateFontIndirectW(&lf);
+    if (hFont == NULL) {
+        FREE_AND_RETURN;
+    }
+    oldFont = SelectObject(hMemoryDC, hFont);
+
+    memset(&textMetric, 0, sizeof(TEXTMETRIC));
+    err = GetTextMetrics(hMemoryDC, &textMetric);
+    if (err == 0) {
+        FREE_AND_RETURN;
+    }
+    memset(&glyphMetrics, 0, sizeof(GLYPHMETRICS));
+    memset(&mat2, 0, sizeof(MAT2));
+    mat2.eM11.value = 1; mat2.eM22.value = 1;
+    err = GetGlyphOutline(hMemoryDC, glyphCode,
+                          GGO_METRICS|GGO_GLYPH_INDEX,
+                          &glyphMetrics,
+                          0, NULL, &mat2);
+    if (err == GDI_ERROR) {
+        /* Probably no such glyph - ie the font wasn't the one we expected. */
+        FREE_AND_RETURN;
+    }
+
+    width  = (unsigned short)glyphMetrics.gmBlackBoxX;
+    height = (unsigned short)glyphMetrics.gmBlackBoxY;
+
+    /* Don't handle "invisible" glyphs in this code */
+    if (width <= 0 || height == 0) {
+       FREE_AND_RETURN;
+    }
+
+    advanceX = glyphMetrics.gmCellIncX;
+    advanceY = glyphMetrics.gmCellIncY;
+    topLeftX = glyphMetrics.gmptGlyphOrigin.x;
+    topLeftY = glyphMetrics.gmptGlyphOrigin.y;
+
+    /* GetGlyphOutline pre-dates cleartype and I'm not sure that it will
+     * account for all pixels touched by the rendering. Need to widen,
+     * and also adjust by one the x position at which it is rendered.
+     * The extra pixels of width are used as follows :
+     * One extra pixel at the left and the right will be needed to absorb
+     * the pixels that will be touched by filtering by GDI to compensate
+     * for colour fringing.
+     * However there seem to be some cases where GDI renders two extra
+     * pixels to the right, so we add one additional pixel to the right,
+     * and in the code that copies this to the image cache we test for
+     * the (rare) cases when this is touched, and if its not reduce the
+     * stated image width for the blitting loops.
+     * For fractional metrics :
+     * One extra pixel at each end to account for sub-pixel positioning used
+     * when fractional metrics is on in LCD mode.
+     * The pixel at the left is needed so the blitting loop can index into
+     * that a byte at a time to more accurately position the glyph.
+     * The pixel at the right is needed so that when such indexing happens,
+     * the blitting still can use the same width.
+     * Consequently the width that is specified for the glyph is one less
+     * than that of the actual image.
+     * Note that in the FM case as a consequence we need to adjust the
+     * position at which GDI renders, and the declared width of the glyph
+     * See the if (fm) {} cases in the code.
+     * For the non-FM case, we not only save 3 bytes per row, but this
+     * prevents apparent glyph overlapping which affects the rendering
+     * performance of accelerated pipelines since it adds additional
+     * read-back requirements.
+     */
+    width+=3;
+    if (fm) {
+        width+=1;
+    }
+    /* DIB scanline must end on a DWORD boundary. We specify 3 bytes per pixel,
+     * so must round up as needed to a multiple of 4 bytes.
+     */
+    dibBytesWidth = bytesWidth = width*3;
+    extra = dibBytesWidth % 4;
+    if (extra != 0) {
+        dibBytesWidth += (4-extra);
+    }
+    /* The glyph cache image must be a multiple of 3 bytes wide. */
+    extra = bytesWidth % 3;
+    if (extra != 0) {
+        bytesWidth += (3-extra);
+    }
+    bmWidth = width;
+    bmHeight = height;
+
+    /* Must use desktop DC to create a bitmap of that depth */
+    hBitmap = CreateCompatibleBitmap(hDesktopDC, bmWidth, bmHeight);
+    if (hBitmap == NULL) {
+        FREE_AND_RETURN;
+    }
+    hOrigBM = (HBITMAP)SelectObject(hMemoryDC, hBitmap);
+
+    /* Fill in black */
+    rect.left = 0;
+    rect.top = 0;
+    rect.right = bmWidth;
+    rect.bottom = bmHeight;
+    FillRect(hMemoryDC, (LPRECT)&rect, GetStockObject(BLACK_BRUSH));
+
+    /* Set text color to white, background to black. */
+    SetBkColor(hMemoryDC, RGB(0,0,0));
+    SetTextColor(hMemoryDC, RGB(255,255,255));
+
+    /* adjust rendering position */
+    x = -topLeftX+1;
+    if (fm) {
+        x += 1;
+    }
+    y = topLeftY - textMetric.tmAscent;
+    err = ExtTextOutW(hMemoryDC, x, y, ETO_GLYPH_INDEX|ETO_OPAQUE,
+                (LPRECT)&rect, (LPCWSTR)&glyphCode, 1, NULL);
+    if (err == 0) {
+        FREE_AND_RETURN;
+    }
+
+    /* Now get the image into a DIB.
+     * MS docs for GetDIBits says the compatible bitmap must not be
+     * selected into a DC, so restore the original first.
+     */
+    SelectObject(hMemoryDC, hOrigBM);
+    SelectObject(hMemoryDC, oldFont);
+    DeleteObject(hFont);
+
+    memset(&bmi, 0, sizeof(BITMAPINFO));
+    bmi.bmiHeader.biSize = sizeof(bmi.bmiHeader);
+    bmi.bmiHeader.biWidth = width;
+    bmi.bmiHeader.biHeight = -height;
+    bmi.bmiHeader.biPlanes = 1;
+    bmi.bmiHeader.biBitCount = 24;
+    bmi.bmiHeader.biCompression = BI_RGB;
+
+    dibImageSize = dibBytesWidth*height;
+    dibImage = malloc(dibImageSize);
+    if (dibImage == NULL) {
+        FREE_AND_RETURN;
+    }
+    memset(dibImage, 0, dibImageSize);
+
+    err = GetDIBits(hMemoryDC, hBitmap, 0, height, dibImage,
+                    &bmi, DIB_RGB_COLORS);
+
+    if (err == 0) {        /* GetDIBits failed. */
+        FREE_AND_RETURN;
+    }
+
+    err = SystemParametersInfo(SPI_GETFONTSMOOTHINGORIENTATION, 0, &orient, 0);
+    if (err == 0) {
+        FREE_AND_RETURN;
+    }
+    err = SystemParametersInfo(SPI_GETFONTSMOOTHINGCONTRAST, 0, &gamma, 0);
+    if (err == 0) {
+        FREE_AND_RETURN;
+    }
+    igTable = getIGTable(gamma/10);
+    if (igTable == NULL) {
+        FREE_AND_RETURN;
+    }
+
+    /* Now copy glyph image into a GlyphInfo structure and return it.
+     * NB the xadvance calculated here may be overwritten by the caller.
+     * 1 is subtracted from the bitmap width to get the glyph width, since
+     * that extra "1" was added as padding, so the sub-pixel positioning of
+     * fractional metrics could index into it.
+     */
+    imageSize = bytesWidth*height;
+    glyphInfo = (GlyphInfo*)malloc(sizeof(GlyphInfo)+imageSize);
+    if (malloc == NULL) {
+        FREE_AND_RETURN;
+    }
+    glyphInfo->cellInfo = NULL;
+    glyphInfo->rowBytes = bytesWidth;
+    glyphInfo->width = width;
+    if (fm) {
+        glyphInfo->width -= 1; // must subtract 1
+    }
+    glyphInfo->height = height;
+    glyphInfo->advanceX = advanceX;
+    glyphInfo->advanceY = advanceY;
+    glyphInfo->topLeftX = (float)(topLeftX-1);
+    if (fm) {
+        glyphInfo->topLeftX -= 1;
+    }
+    glyphInfo->topLeftY = (float)-topLeftY;
+    glyphInfo->image = (unsigned char*)glyphInfo+sizeof(GlyphInfo);
+    memset(glyphInfo->image, 0, imageSize);
+
+    /* DIB 24bpp data is always stored in BGR order, but we usually
+     * need this in RGB, so we can't just memcpy and need to swap B and R.
+     * Also need to apply inverse gamma adjustment here.
+     * We re-use the variable "extra" to see if the last pixel is touched
+     * at all. If its not we can reduce the glyph image width. This comes
+     * into play in some cases where GDI touches more pixels than accounted
+     * for by increasing width by two pixels over the B&W image. Whilst
+     * the bytes are in the cache, it doesn't affect rendering performance
+     * of the hardware pipelines.
+     */
+    extra = 0;
+    if (fm) {
+        extra = 1; // always need it.
+    }
+    dibRowPtr = dibImage;
+    rowPtr = glyphInfo->image;
+    for (y=0;y<height;y++) {
+        pixelPtr = rowPtr;
+        dibPixPtr = dibRowPtr;
+        for (x=0;x<width;x++) {
+            if (orient == FE_FONTSMOOTHINGORIENTATIONRGB) {
+                b = *dibPixPtr++;
+                g = *dibPixPtr++;
+                r = *dibPixPtr++;
+            } else {
+                r = *dibPixPtr++;
+                g = *dibPixPtr++;
+                b = *dibPixPtr++;
+            }
+            *pixelPtr++ = igTable[r];
+            *pixelPtr++ = igTable[g];
+            *pixelPtr++ = igTable[b];
+            if (!fm && (x==(width-1)) && (r|g|b)) {
+                extra = 1;
+            }
+        }
+        dibRowPtr += dibBytesWidth;
+        rowPtr  += bytesWidth;
+    }
+    if (!extra) {
+        glyphInfo->width -= 1;
+    }
+
+    free(dibImage);
+    ReleaseDC(hWnd, hDesktopDC);
+    DeleteObject(hMemoryDC);
+    DeleteObject(hBitmap);
+
+    return ptr_to_jlong(glyphInfo);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/windows/native/sun/tracing/dtrace/jvm_symbols_md.c	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,64 @@
+/*
+ * Copyright 2008 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.
+ */
+
+#include <windows.h>
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+
+#include <jvm.h>
+
+#include "jvm_symbols.h"
+
+JvmSymbols* lookupJvmSymbols() {
+    JvmSymbols* syms = (JvmSymbols*)malloc(sizeof(JvmSymbols));
+    if (syms != NULL) {
+        HINSTANCE jvm = LoadLibrary("jvm.dll");
+        if (jvm == NULL) {
+            free(syms);
+            return NULL;
+        }
+        syms->GetVersion = (GetVersion_t)
+            GetProcAddress(jvm, "JVM_DTraceGetVersion");
+        syms->IsSupported = (IsSupported_t)
+            GetProcAddress(jvm, "JVM_DTraceIsSupported");
+        syms->Activate = (Activate_t)
+            GetProcAddress(jvm, "JVM_DTraceActivate");
+        syms->Dispose = (Dispose_t)
+            GetProcAddress(jvm, "JVM_DTraceDispose");
+        syms->IsProbeEnabled = (IsProbeEnabled_t)
+            GetProcAddress(jvm, "JVM_DTraceIsProbeEnabled");
+
+        (void)FreeLibrary(jvm);
+        if ( syms->GetVersion == NULL || syms->IsSupported == NULL ||
+             syms->Activate == NULL || syms->Dispose == NULL ||
+             syms->IsProbeEnabled == NULL) {
+            free(syms);
+            syms = NULL;
+        }
+
+    }
+    return syms;
+}
--- a/jdk/src/windows/native/sun/windows/awt_Component.cpp	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/windows/native/sun/windows/awt_Component.cpp	Thu Jun 12 13:50:55 2008 -0700
@@ -234,6 +234,7 @@
 
 AwtComponent::AwtComponent()
 {
+    m_mouseButtonClickAllowed = 0;
     m_callbacksEnabled = FALSE;
     m_hwnd = NULL;
 
@@ -246,7 +247,6 @@
     m_nextControlID = 1;
     m_childList = NULL;
     m_myControlID = 0;
-    m_mouseDragState = 0;
     m_hdwp = NULL;
     m_validationNestCount = 0;
 
@@ -903,8 +903,27 @@
 
 void AwtComponent::Hide()
 {
+    JNIEnv *env = (JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2);
+    jobject peer = GetPeer(env);
+    BOOL oldValue = sm_suppressFocusAndActivation;
     m_visible = false;
+
+    // On disposal the focus owner actually loses focus at the moment of hiding.
+    // So, focus change suppression (if requested) should be made here.
+    if (GetHWnd() == sm_focusOwner &&
+        !JNU_CallMethodByName(env, NULL, peer, "isAutoFocusTransferOnDisposal", "()Z").z)
+   {
+        sm_suppressFocusAndActivation = TRUE;
+        // The native system may autotransfer focus on hiding to the parent
+        // of the component. Nevertheless this focus change won't be posted
+        // to the Java level, we're better to avoid this. Anyway, after
+        // the disposal focus should be requested to the right component.
+        ::SetFocus(NULL);
+        sm_focusOwner = NULL;
+    }
     ::ShowWindow(GetHWnd(), SW_HIDE);
+
+    sm_suppressFocusAndActivation = oldValue;
 }
 
 BOOL
@@ -2495,9 +2514,11 @@
         lastClickX = x;
         lastClickY = y;
     }
+    /*
+     *Set appropriate bit of the mask on WM_MOUSE_DOWN message.
+     */
+    m_mouseButtonClickAllowed |= GetButtonMK(button);
     lastTime = now;
-    // it's needed only if WM_LBUTTONUP doesn't come for some reason
-    m_mouseDragState &= ~GetButtonMK(button);
 
     MSG msg;
     InitMessage(&msg, lastMessage, flags, MAKELPARAM(x, y), x, y);
@@ -2535,14 +2556,17 @@
                    (GetButton(button) == java_awt_event_MouseEvent_BUTTON3 ?
                     TRUE : FALSE), GetButton(button), &msg);
     /*
-     * If no movement, then report a click following the button release
+     * If no movement, then report a click following the button release.
+     * When WM_MOUSEUP comes to a window without previous WM_MOUSEDOWN,
+     * spurous MOUSE_CLICK is about to happen. See 6430553.
      */
-    if (!(m_mouseDragState & GetButtonMK(button))) { // No up-button in the drag-state
+    if ((m_mouseButtonClickAllowed & GetButtonMK(button)) != 0) { //CLICK allowed
         SendMouseEvent(java_awt_event_MouseEvent_MOUSE_CLICKED,
                        TimeHelper::getMessageTimeUTC(), x, y, GetJavaModifiers(),
                        clickCount, JNI_FALSE, GetButton(button));
     }
-    m_mouseDragState &= ~GetButtonMK(button); // Exclude the up-button from the drag-state
+    // Exclude button from allowed to generate CLICK messages
+    m_mouseButtonClickAllowed &= ~GetButtonMK(button);
 
     if ((flags & ALL_MK_BUTTONS) == 0) {
         // only update if all buttons have been released
@@ -2586,7 +2610,8 @@
             SendMouseEvent(java_awt_event_MouseEvent_MOUSE_DRAGGED, TimeHelper::getMessageTimeUTC(), x, y,
                            GetJavaModifiers(), 0, JNI_FALSE,
                            java_awt_event_MouseEvent_NOBUTTON, &msg);
-            m_mouseDragState = flags;
+            //dragging means no more CLICKs until next WM_MOUSE_DOWN/WM_MOUSE_UP message sequence
+            m_mouseButtonClickAllowed = 0;
         } else {
             MSG msg;
             InitMessage(&msg, lastMessage, flags, MAKELPARAM(x, y), x, y);
@@ -5740,6 +5765,10 @@
                 env->DeleteGlobalRef(event);
                 delete nhes;
                 return;
+
+            } else if (id == java_awt_event_KeyEvent_KEY_PRESSED) {
+                // Fix for 6637607: reset consuming
+                keyDownConsumed = FALSE;
             }
 
             /* Consume a KEY_TYPED event if a KEY_PRESSED had been, to support
--- a/jdk/src/windows/native/sun/windows/awt_Component.h	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/windows/native/sun/windows/awt_Component.h	Thu Jun 12 13:50:55 2008 -0700
@@ -707,13 +707,6 @@
     BOOL     m_backgroundColorSet;
     BOOL     m_visible;         /* copy of Component.visible */
 
-    /*
-     * Keeps all buttons which were pressed at the time of the last mouse
-     * drag until all buttons will be released, contains state as bit masks
-     * MK_LBUTTON, MK_MBUTTON, MK_RBUTTON
-     */
-    UINT     m_mouseDragState;
-
     static BOOL sm_suppressFocusAndActivation;
     static HWND sm_realFocusOpposite;
 
@@ -725,6 +718,15 @@
     static UINT sm_95WheelSupport;
 
 private:
+    /* A bitmask keeps the button's numbers as MK_LBUTTON, MK_MBUTTON, MK_RBUTTON
+     * which are allowed to
+     * generate the CLICK event after the RELEASE has happened.
+     * There are conditions that must be true for that sending CLICK event:
+     * 1) button was initially PRESSED
+     * 2) no movement or drag has happened until RELEASE
+    */
+    UINT m_mouseButtonClickAllowed;
+
     BOOL m_bSubclassed;
 
     COLORREF m_colorForeground;
--- a/jdk/src/windows/native/sun/windows/awt_Dialog.cpp	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/windows/native/sun/windows/awt_Dialog.cpp	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 1996-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1996-2008 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
@@ -428,8 +428,12 @@
 {
     JNIEnv *env = (JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2);
 
-    jlongArray windows = (jlongArray)(env->CallStaticObjectMethod(AwtWindow::wwindowPeerCls,
-                                                                  AwtWindow::getActiveWindowsMID));
+    jclass wwindowPeerCls = env->FindClass("sun/awt/windows/WWindowPeer");
+    jmethodID getActiveWindowsMID = env->GetStaticMethodID(wwindowPeerCls,
+                                                           "getActiveWindowHandles", "()[J");
+    DASSERT(getActiveWindowsMID != NULL);
+    jlongArray windows = (jlongArray)(env->CallStaticObjectMethod(wwindowPeerCls,
+                                                                  getActiveWindowsMID));
     if (windows == NULL) {
         return;
     }
--- a/jdk/src/windows/native/sun/windows/awt_TrayIcon.cpp	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/windows/native/sun/windows/awt_TrayIcon.cpp	Thu Jun 12 13:50:55 2008 -0700
@@ -84,7 +84,7 @@
     if (sm_instCount++ == 0 && AwtTrayIcon::sm_msgWindow == NULL) {
         sm_msgWindow = AwtTrayIcon::CreateMessageWindow();
     }
-    m_mouseDragState = 0;
+    m_mouseButtonClickAllowed = 0;
 }
 
 AwtTrayIcon::~AwtTrayIcon() {
@@ -349,7 +349,7 @@
     }
     lastTime = now;
     // it's needed only if WM_LBUTTONUP doesn't come for some reason
-    m_mouseDragState &= ~AwtComponent::GetButtonMK(button);
+    m_mouseButtonClickAllowed |= AwtComponent::GetButtonMK(button);
 
     MSG msg;
     AwtComponent::InitMessage(&msg, lastMessage, flags, MAKELPARAM(x, y), x, y);
@@ -371,12 +371,12 @@
                    (AwtComponent::GetButton(button) == java_awt_event_MouseEvent_BUTTON3 ?
                     TRUE : FALSE), AwtComponent::GetButton(button), &msg);
 
-    if (!(m_mouseDragState & AwtComponent::GetButtonMK(button))) { // No up-button in the drag-state
+    if ((m_mouseButtonClickAllowed & AwtComponent::GetButtonMK(button)) != 1) { // No up-button in the drag-state
         SendMouseEvent(java_awt_event_MouseEvent_MOUSE_CLICKED,
                        TimeHelper::windowsToUTC(::GetTickCount()), x, y, AwtComponent::GetJavaModifiers(),
                        clickCount, JNI_FALSE, AwtComponent::GetButton(button));
     }
-    m_mouseDragState &= ~AwtComponent::GetButtonMK(button); // Exclude the up-button from the drag-state
+    m_mouseButtonClickAllowed &= ~AwtComponent::GetButtonMK(button); // Exclude the up-button from the drag-state
 
     return mrConsume;
 }
@@ -398,7 +398,7 @@
         lastY = y;
         AwtComponent::InitMessage(&msg, lastMessage, flags, MAKELPARAM(x, y), x, y);
         if ((flags & AwtComponent::ALL_MK_BUTTONS) != 0) {
-            m_mouseDragState = flags;
+            m_mouseButtonClickAllowed = 0;
         } else {
             SendMouseEvent(java_awt_event_MouseEvent_MOUSE_MOVED, TimeHelper::windowsToUTC(::GetTickCount()), x, y,
                            AwtComponent::GetJavaModifiers(), 0, JNI_FALSE,
--- a/jdk/src/windows/native/sun/windows/awt_TrayIcon.h	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/windows/native/sun/windows/awt_TrayIcon.h	Thu Jun 12 13:50:55 2008 -0700
@@ -176,12 +176,14 @@
 private:
     AWT_NOTIFYICONDATA m_nid;
 
-    /*
-     * Keeps all buttons which were pressed at the time of the last mouse
-     * drag until all buttons will be released, contains state as bit masks
-     * MK_LBUTTON, MK_MBUTTON, MK_RBUTTON
-     */
-    UINT     m_mouseDragState;
+    /* A bitmask keeps the button's numbers as MK_LBUTTON, MK_MBUTTON, MK_RBUTTON
+     * which are allowed to
+     * generate the CLICK event after the RELEASE has happened.
+     * There are conditions that must be true for that sending CLICK event:
+     * 1) button was initially PRESSED
+     * 2) no movement or drag has happened until RELEASE
+    */
+    UINT m_mouseButtonClickAllowed;
 
     class TrayIconListItem {
       public:
--- a/jdk/src/windows/native/sun/windows/awt_Window.cpp	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/windows/native/sun/windows/awt_Window.cpp	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 1996-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1996-2008 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
@@ -122,9 +122,6 @@
 jfieldID AwtWindow::locationByPlatformID;
 jfieldID AwtWindow::autoRequestFocusID;
 
-jclass AwtWindow::wwindowPeerCls;
-jmethodID AwtWindow::getActiveWindowsMID;
-
 jfieldID AwtWindow::sysXID;
 jfieldID AwtWindow::sysYID;
 jfieldID AwtWindow::sysWID;
@@ -2159,11 +2156,6 @@
 {
     TRY;
 
-    AwtWindow::wwindowPeerCls = cls;
-    AwtWindow::getActiveWindowsMID =
-        env->GetStaticMethodID(cls, "getActiveWindowHandles", "()[J");
-    DASSERT(AwtWindow::getActiveWindowsMID != NULL);
-
     AwtWindow::sysXID = env->GetFieldID(cls, "sysX", "I");
     AwtWindow::sysYID = env->GetFieldID(cls, "sysY", "I");
     AwtWindow::sysWID = env->GetFieldID(cls, "sysW", "I");
--- a/jdk/src/windows/native/sun/windows/awt_Window.h	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/src/windows/native/sun/windows/awt_Window.h	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 1996-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1996-2008 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
@@ -57,11 +57,6 @@
     static jfieldID screenID; /* screen number passed over from WindowPeer */
     static jfieldID autoRequestFocusID;
 
-    /* WWindowPeer class */
-    static jclass wwindowPeerCls;
-    /* long[] getActiveWindowHandles() method in WWindowPeer */
-    static jmethodID getActiveWindowsMID;
-
     // The coordinates at the peer.
     static jfieldID sysXID;
     static jfieldID sysYID;
--- a/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/DumpHeap.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/DumpHeap.java	Thu Jun 12 13:50:55 2008 -0700
@@ -29,14 +29,14 @@
  */
 
 import java.lang.management.*;
+import java.util.List;
 import javax.management.MBeanServer;
 import com.sun.management.HotSpotDiagnosticMXBean;
 
 public class DumpHeap {
     public static void main(String[] argv) throws Exception {
-         MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
-         HotSpotDiagnosticMXBean dm = sun.management.ManagementFactory.getDiagnosticMXBean();
+         List<HotSpotDiagnosticMXBean> list = ManagementFactory.getPlatformMXBeans(HotSpotDiagnosticMXBean.class);
          System.out.println("Dumping to file: " + argv[0] + " ....");
-         dm.dumpHeap(argv[0], true);
+         list.get(0).dumpHeap(argv[0], true);
     }
 }
--- a/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/GetDiagnosticOptions.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/GetDiagnosticOptions.java	Thu Jun 12 13:50:55 2008 -0700
@@ -41,8 +41,9 @@
         "com.sun.management:type=HotSpotDiagnostic";
 
     public static void main(String[] args) throws Exception {
-        HotSpotDiagnosticMXBean mbean =
-            sun.management.ManagementFactory.getDiagnosticMXBean();
+        List<HotSpotDiagnosticMXBean> list =
+            ManagementFactory.getPlatformMXBeans(HotSpotDiagnosticMXBean.class);
+        HotSpotDiagnosticMXBean mbean = list.get(0);
         checkDiagnosticOptions(mbean);
 
         MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
--- a/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/GetVMOption.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/GetVMOption.java	Thu Jun 12 13:50:55 2008 -0700
@@ -34,6 +34,7 @@
 import com.sun.management.VMOption;
 import com.sun.management.VMOption.Origin;
 import java.lang.management.ManagementFactory;
+import java.util.List;
 import javax.management.MBeanServer;
 
 public class GetVMOption {
@@ -44,8 +45,9 @@
         "com.sun.management:type=HotSpotDiagnostic";
 
     public static void main(String[] args) throws Exception {
-        HotSpotDiagnosticMXBean mbean =
-            sun.management.ManagementFactory.getDiagnosticMXBean();
+        List<HotSpotDiagnosticMXBean> list =
+            ManagementFactory.getPlatformMXBeans(HotSpotDiagnosticMXBean.class);
+        HotSpotDiagnosticMXBean mbean = list.get(0);
         checkVMOption(mbean);
 
         MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
--- a/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/SetVMOption.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/SetVMOption.java	Thu Jun 12 13:50:55 2008 -0700
@@ -31,11 +31,11 @@
  * @run main/othervm -XX:+PrintGCDetails SetVMOption
  */
 
+import java.lang.management.ManagementFactory;
 import java.util.*;
 import com.sun.management.HotSpotDiagnosticMXBean;
 import com.sun.management.VMOption;
 import com.sun.management.VMOption.Origin;
-import sun.management.ManagementFactory;
 import sun.misc.Version;
 
 public class SetVMOption {
@@ -44,10 +44,11 @@
     private static String BAD_VALUE = "yes";
     private static String NEW_VALUE = "false";
     private static String MANAGEMENT_SERVER = "ManagementServer";
-    private static HotSpotDiagnosticMXBean mbean =
-        ManagementFactory.getDiagnosticMXBean();
+    private static HotSpotDiagnosticMXBean mbean;
 
     public static void main(String[] args) throws Exception {
+        List<HotSpotDiagnosticMXBean> list =
+            ManagementFactory.getPlatformMXBeans(HotSpotDiagnosticMXBean.class);
 
         // The following test is transitional only and should be removed
         // once build 52 is promoted.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/com/sun/security/auth/login/ConfigFile/IllegalURL.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,54 @@
+/*
+ * Copyright 2008 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.
+ *
+ * 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.
+ */
+
+/*
+ * @test
+ * @bug 6689000
+ * @summary Changes in 6675606 causing regression test failures on windows-i586
+ */
+
+import com.sun.security.auth.login.*;
+import java.io.*;
+import java.net.URL;
+
+public class IllegalURL {
+    public static void main(String[] args) throws Exception {
+        FileOutputStream fos = new FileOutputStream("x.conf");
+        fos.close();
+        use("file:" + System.getProperty("user.dir") + "/x.conf");
+        use("file:x.conf");
+        System.out.println("Test passed");
+    }
+
+    static void use(String f) throws Exception {
+        System.out.println("Testing " + f  + "...");
+        System.setProperty("java.security.auth.login.config", f);
+        try {
+            new FileInputStream(new URL(f).getFile().replace('/', File.separatorChar));
+        } catch (Exception e) {
+            System.out.println("Even old implementation does not support it. Ignored.");
+            return;
+        }
+        new ConfigFile();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/com/sun/tracing/BasicFunctionality.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,146 @@
+/*
+ * Copyright 2008 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.
+ *
+ * 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.
+ */
+
+/**
+ * @test
+ * @bug 6537506
+ * @summary Basic unit test for tracing framework
+ */
+
+import com.sun.tracing.*;
+import java.lang.reflect.Method;
+
+@ProviderName("NamedProvider")
+interface BasicProvider extends Provider {
+    void plainProbe();
+    void probeWithArgs(int a, float f, String s, Long l);
+    @ProbeName("namedProbe") void probeWithName();
+    void overloadedProbe();
+    void overloadedProbe(int i);
+}
+
+interface InvalidProvider extends Provider {
+    int nonVoidProbe();
+}
+
+public class BasicFunctionality {
+
+    public static ProviderFactory factory;
+    public static BasicProvider bp;
+
+    public static void main(String[] args) throws Exception {
+
+        factory = ProviderFactory.getDefaultFactory();
+        if (factory != null) {
+            bp = factory.createProvider(BasicProvider.class);
+        }
+
+        testProviderFactory();
+        testProbe();
+        testProvider();
+    }
+
+    static void fail(String s) throws Exception {
+        throw new Exception(s);
+    }
+
+    static void testProviderFactory() throws Exception {
+        if (factory == null) {
+            fail("ProviderFactory.getDefaultFactory: Did not create factory");
+        }
+        if (bp == null) {
+            fail("ProviderFactory.createProvider: Did not create provider");
+        }
+        try {
+            factory.createProvider(null);
+            fail("ProviderFactory.createProvider: Did not throw NPE for null");
+        } catch (NullPointerException e) {}
+
+       try {
+           factory.createProvider(InvalidProvider.class);
+           fail("Factory.createProvider: Should error with non-void probes");
+       } catch (IllegalArgumentException e) {}
+    }
+
+    public static void testProvider() throws Exception {
+
+       // These just shouldn't throw any exeptions:
+       bp.plainProbe();
+       bp.probeWithArgs(42, (float)3.14, "spam", new Long(2L));
+       bp.probeWithArgs(42, (float)3.14, null, null);
+       bp.probeWithName();
+       bp.overloadedProbe();
+       bp.overloadedProbe(42);
+
+       Method m = BasicProvider.class.getMethod("plainProbe");
+       Probe p = bp.getProbe(m);
+       if (p == null) {
+           fail("Provider.getProbe: Did not return probe");
+       }
+
+       Method m2 = BasicFunctionality.class.getMethod("testProvider");
+       p = bp.getProbe(m2);
+       if (p != null) {
+           fail("Provider.getProbe: Got probe with invalid spec");
+       }
+
+       bp.dispose();
+       // These just shouldn't throw any exeptions:
+       bp.plainProbe();
+       bp.probeWithArgs(42, (float)3.14, "spam", new Long(2L));
+       bp.probeWithArgs(42, (float)3.14, null, null);
+       bp.probeWithName();
+       bp.overloadedProbe();
+       bp.overloadedProbe(42);
+
+       if (bp.getProbe(m) != null) {
+           fail("Provider.getProbe: Should return null after dispose()");
+       }
+
+       bp.dispose(); // just to make sure nothing bad happens
+    }
+
+    static void testProbe() throws Exception {
+       Method m = BasicProvider.class.getMethod("plainProbe");
+       Probe p = bp.getProbe(m);
+       p.isEnabled(); // just make sure it doesn't do anything bad
+       p.trigger();
+
+       try {
+         p.trigger(0);
+         fail("Probe.trigger: too many arguments not caught");
+       } catch (IllegalArgumentException e) {}
+
+       p = bp.getProbe(BasicProvider.class.getMethod(
+           "probeWithArgs", int.class, float.class, String.class, Long.class));
+       try {
+         p.trigger();
+         fail("Probe.trigger: too few arguments not caught");
+       } catch (IllegalArgumentException e) {}
+
+       try {
+         p.trigger((float)3.14, (float)3.14, "", new Long(0L));
+         fail("Probe.trigger: wrong type primitive arguments not caught");
+       } catch (IllegalArgumentException e) {}
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Component/isLightweightCrash/IsLightweightCrash.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,59 @@
+/*
+ * Copyright 2007 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.
+ *
+ * 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.
+ */
+
+/*
+  @test
+  @bug 6255653
+  @summary REGRESSION: Override isLightweight() causes access violation in awt.dll
+  @author Andrei Dmitriev: area=awt-component
+  @run main IsLightweightCrash
+*/
+
+/*
+ * The test may not crash for several times so iteratively continue up to some limit.
+ */
+
+import java.awt.*;
+
+public class IsLightweightCrash {
+    public static int ITERATIONS = 20;
+
+    public static void main(String []s)
+    {
+        for (int i = 0; i < ITERATIONS; i++){
+            showFrame(i);
+        }
+    }
+
+    private static void showFrame(int i){
+        System.out.println("iteration = "+i);
+        Frame f = new Frame();
+        f.add(new AHeavyweightComponent());
+        f.setVisible(true);
+        f.setVisible(false);
+    }
+}
+
+class AHeavyweightComponent extends Component {
+    public boolean isLightweight() { return false; }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Component/isLightweightCrash/StubPeerCrash.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,188 @@
+/*
+ * Copyright 2007 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.
+ *
+ * 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.
+ */
+
+/*
+  @test
+  @bug 6255653
+  @summary REGRESSION: Override isLightweight() causes access violation in awt.dll
+  @author Andrei Dmitriev: area=awt-component
+  @run main StubPeerCrash
+*/
+
+/*
+ * The test may not crash for several times so iteratively continue up to some limit.
+ */
+
+import java.awt.*;
+import java.awt.peer.*;
+import java.awt.event.PaintEvent;
+import java.awt.image.ImageProducer;
+import java.awt.image.ImageObserver;
+import java.awt.image.ColorModel;
+import java.awt.image.VolatileImage;
+import java.awt.GraphicsConfiguration;
+import sun.awt.CausedFocusEvent;
+import sun.java2d.pipe.Region;
+
+public class StubPeerCrash {
+    public static int ITERATIONS = 20;
+
+    public static void main(String []s)
+    {
+        for (int i = 0; i < ITERATIONS; i++){
+            showFrame(i);
+        }
+    }
+
+    private static void showFrame(int i){
+        System.out.println("iteration = "+i);
+        Frame f = new Frame();
+        f.add(new AHeavyweightComponent());
+        f.setVisible(true);
+        f.setVisible(false);
+    }
+}
+
+class AHeavyweightComponent extends Component {
+    private ComponentPeer peer = new StubComponentPeer();
+
+    public AHeavyweightComponent(){
+    }
+
+    public boolean isLightweight() {
+        return false;
+    }
+
+    public ComponentPeer getPeer(){
+        return peer;
+    }
+}
+
+class StubComponentPeer implements ComponentPeer {
+    public boolean isObscured(){return true;};
+    public boolean canDetermineObscurity(){return true;};
+    public void                setVisible(boolean b){};
+    public void                setEnabled(boolean b){};
+    public void                paint(Graphics g){};
+    public void                repaint(long tm, int x, int y, int width, int height){};
+    public void                print(Graphics g){};
+    public void                setBounds(int x, int y, int width, int height, int op){};
+    public void                handleEvent(AWTEvent e){};
+    public void                coalescePaintEvent(PaintEvent e){};
+    public Point               getLocationOnScreen(){return null;};
+    public Dimension           getPreferredSize(){return null;};
+    public Dimension           getMinimumSize(){return null;};
+    public ColorModel          getColorModel(){return null;};
+    public Toolkit             getToolkit(){return null;};
+    public Graphics            getGraphics(){return null;};
+    public FontMetrics         getFontMetrics(Font font){return null;};
+    public void                dispose(){};
+    public void                setForeground(Color c){};
+    public void                setBackground(Color c){};
+    public void                setFont(Font f){};
+    public void                updateCursorImmediately(){};
+    public boolean             requestFocus(Component lightweightChild,
+                                     boolean temporary,
+                                     boolean focusedWindowChangeAllowed,
+                                     long time, CausedFocusEvent.Cause cause){
+        return true;
+    };
+    public boolean             isFocusable(){return true;};
+
+    public Image               createImage(ImageProducer producer){return null;};
+    public Image               createImage(int width, int height){return null;};
+    public VolatileImage       createVolatileImage(int width, int height){return null;};
+    public boolean             prepareImage(Image img, int w, int h, ImageObserver o){return true;};
+    public int                 checkImage(Image img, int w, int h, ImageObserver o){return 0;};
+    public GraphicsConfiguration getGraphicsConfiguration(){return null;};
+    public boolean     handlesWheelScrolling(){return true;};
+    public void createBuffers(int numBuffers, BufferCapabilities caps) throws AWTException{};
+    public Image getBackBuffer(){return null;};
+    public void flip(BufferCapabilities.FlipContents flipAction){};
+    public void destroyBuffers(){};
+
+    /**
+     * Reparents this peer to the new parent referenced by <code>newContainer</code> peer
+     * Implementation depends on toolkit and container.
+     * @param newContainer peer of the new parent container
+     * @since 1.5
+     */
+    public void reparent(ContainerPeer newContainer){};
+    /**
+     * Returns whether this peer supports reparenting to another parent withour destroying the peer
+     * @return true if appropriate reparent is supported, false otherwise
+     * @since 1.5
+     */
+    public boolean isReparentSupported(){return true;};
+
+    /**
+     * Used by lightweight implementations to tell a ComponentPeer to layout
+     * its sub-elements.  For instance, a lightweight Checkbox needs to layout
+     * the box, as well as the text label.
+     */
+    public void        layout(){};
+
+
+     public    Rectangle getBounds(){return null;};
+
+    /**
+     * Applies the shape to the native component window.
+     * @since 1.7
+     */
+    public void applyShape(Region shape){};
+
+    /**
+     * DEPRECATED:  Replaced by getPreferredSize().
+     */
+    public Dimension           preferredSize(){return null;};
+
+    /**
+     * DEPRECATED:  Replaced by getMinimumSize().
+     */
+    public Dimension           minimumSize(){return null;};
+
+    /**
+     * DEPRECATED:  Replaced by setVisible(boolean).
+     */
+    public void                show(){};
+
+    /**
+     * DEPRECATED:  Replaced by setVisible(boolean).
+     */
+    public void                hide(){};
+
+    /**
+     * DEPRECATED:  Replaced by setEnabled(boolean).
+     */
+    public void                enable(){};
+
+    /**
+     * DEPRECATED:  Replaced by setEnabled(boolean).
+     */
+    public void                disable(){};
+
+    /**
+     * DEPRECATED:  Replaced by setBounds(int, int, int, int).
+     */
+    public void                reshape(int x, int y, int width, int height){};
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Dialog/CrashXCheckJni/CrashXCheckJni.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,64 @@
+/*
+ * Copyright 2008 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.
+ *
+ * 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.
+ */
+
+/*
+  @test
+  @bug 6610244
+  @library ../../regtesthelpers
+  @build Util Sysout AbstractTest
+  @summary modal dialog closes with fatal error if -Xcheck:jni is set
+  @author Andrei Dmitriev : area=awt.dialog
+  @run main/othervm -Xcheck:jni CrashXCheckJni
+*/
+
+import java.awt.*;
+import java.awt.event.*;
+import java.util.Timer;
+import java.util.TimerTask;
+import test.java.awt.regtesthelpers.Util;
+import test.java.awt.regtesthelpers.AbstractTest;
+import test.java.awt.regtesthelpers.Sysout;
+
+public class CrashXCheckJni {
+
+    public static void main(String []s)
+    {
+        final Dialog fd = new Dialog(new Frame(), true);
+        Timer t = new Timer();
+        t.schedule(new TimerTask() {
+
+            public void run() {
+                System.out.println("RUNNING TASK");
+                fd.setVisible(false);
+                fd.dispose();
+                System.out.println("FINISHING TASK");
+            }
+        }, 3000L);
+
+        fd.setVisible(true);
+        t.cancel();
+        Util.waitForIdle(null);
+
+        AbstractTest.pass();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Focus/ActualFocusedWindowTest/ActualFocusedWindowBlockingTest.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,165 @@
+/*
+ * Copyright 2008 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.
+ *
+ * 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.
+ */
+
+/*
+  @test
+  @bug       6314575
+  @summary   Tests that previosly focused owned window doesn't steal focus when an owner's component requests focus.
+  @author    Anton.Tarasov: area=awt.focus
+  @library   ../../regtesthelpers
+  @build     Util
+  @run       main ActualFocusedWindowBlockingTest
+*/
+
+import java.awt.*;
+import java.awt.event.*;
+import java.applet.Applet;
+import java.util.concurrent.atomic.AtomicBoolean;
+import java.lang.reflect.InvocationTargetException;
+import sun.awt.SunToolkit;
+import test.java.awt.regtesthelpers.Util;
+
+public class ActualFocusedWindowBlockingTest extends Applet {
+    Robot robot = Util.createRobot();
+    Frame owner = new Frame("Owner Frame");
+    Window win = new Window(owner);
+    Frame frame = new Frame("Auxiliary Frame");
+    Button fButton = new Button("frame button") {public String toString() {return "Frame_Button";}};
+    Button wButton = new Button("window button") {public String toString() {return "Window_Button";}};
+    Button aButton = new Button("auxiliary button") {public String toString() {return "Auxiliary_Button";}};
+
+    public static void main(String[] args) {
+        ActualFocusedWindowBlockingTest app = new ActualFocusedWindowBlockingTest();
+        app.init();
+        app.start();
+    }
+
+    public void init() {
+        Toolkit.getDefaultToolkit().addAWTEventListener(new AWTEventListener() {
+                public void eventDispatched(AWTEvent e) {
+                    System.out.println("--> " + e);
+                }
+            }, FocusEvent.FOCUS_EVENT_MASK | WindowEvent.WINDOW_FOCUS_EVENT_MASK);
+
+        owner.add(fButton);
+        win.add(wButton);
+        frame.add(aButton);
+
+        owner.setName("OWNER_FRAME");
+        win.setName("OWNED_WINDOW");
+        frame.setName("AUX_FRAME");
+
+        tuneAndShowWindows(new Window[] {owner, win, frame});
+    }
+
+    public void start() {
+        if ("sun.awt.motif.MToolkit".equals(Toolkit.getDefaultToolkit().getClass().getName())) {
+            System.out.println("No testing on Motif. Test passed.");
+            return;
+        }
+
+        System.out.println("\nTest started:\n");
+
+        // Test 1.
+
+        clickOnCheckFocus(wButton);
+        clickOnCheckFocus(aButton);
+
+        Util.clickOnComp(fButton, robot);
+        if (!testFocused(fButton)) {
+            throw new TestFailedException("The owner's component [" + fButton + "] couldn't be focused by click");
+        }
+
+        // Test 2.
+
+        clickOnCheckFocus(wButton);
+        clickOnCheckFocus(aButton);
+
+        fButton.requestFocus();
+        Util.waitForIdle(robot);
+        if (!testFocused(fButton)) {
+            throw new TestFailedException("The owner's component [" + fButton + "] couldn't be focused by request");
+        }
+
+        // Test 3.
+
+        clickOnCheckFocus(wButton);
+        clickOnCheckFocus(aButton);
+        clickOnCheckFocus(fButton);
+        clickOnCheckFocus(aButton);
+
+        Util.clickOnTitle(owner, robot);
+        if (!testFocused(fButton)) {
+            throw new TestFailedException("The owner's component [" + fButton + "] couldn't be focused as the most recent focus owner");
+        }
+
+        System.out.println("Test passed.");
+    }
+
+    void tuneAndShowWindows(Window[] arr) {
+        int y = 0;
+        for (Window w: arr) {
+            w.setLayout(new FlowLayout());
+            w.setBounds(100, y, 400, 150);
+            w.setBackground(Color.blue);
+            w.setVisible(true);
+            y += 200;
+            Util.waitForIdle(robot);
+        }
+    }
+
+    void clickOnCheckFocus(Component c) {
+        if (c instanceof Frame) {
+            Util.clickOnTitle((Frame)c, robot);
+        } else {
+            Util.clickOnComp(c, robot);
+        }
+        if (!testFocused(c)) {
+            throw new TestErrorException(c + "couldn't get focus by click.");
+        }
+    }
+
+    boolean testFocused(Component c) {
+        for (int i=0; i<10; i++) {
+            if (KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner() == c) {
+                return true;
+            }
+            Util.waitForIdle(robot);
+        }
+        return false;
+    }
+
+    // Thrown when the behavior being verified is found wrong.
+    class TestFailedException extends RuntimeException {
+        TestFailedException(String msg) {
+            super("Test failed: " + msg);
+        }
+    }
+
+    // Thrown when an error not related to the behavior being verified is encountered.
+    class TestErrorException extends RuntimeException {
+        TestErrorException(String msg) {
+            super("Unexpected error: " + msg);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Focus/ActualFocusedWindowTest/ActualFocusedWindowRetaining.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,211 @@
+/*
+ * Copyright 2008 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.
+ *
+ * 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.
+ */
+
+/*
+  @test
+  @bug      4823903
+  @summary  Tests actual focused window retaining.
+  @author   Anton.Tarasov: area=awt.focus
+  @library  ../../regtesthelpers
+  @build    Util
+  @run      main ActualFocusedWindowRetaining
+*/
+
+import java.awt.*;
+import java.awt.event.*;
+import java.lang.reflect.*;
+import java.applet.*;
+import test.java.awt.regtesthelpers.Util;
+
+public class ActualFocusedWindowRetaining extends Applet {
+    public static Frame frame = new Frame("Other Frame");
+    public static Frame owner = new Frame("Test Frame");
+    public static Button otherButton1 = new Button("Other Button 1");
+    public static Button otherButton2 = new Button("Other Button 2");
+    public static Button otherButton3 = new Button("Other Button 3");
+    public static Button testButton1 = new Button("Test Button 1");
+    public static Button testButton2 = new Button("Test Button 2");
+    public static Button testButton3 = new Button("Test Button 3");
+    public static Window window1 = new TestWindow(owner, otherButton2, testButton2, 800, 200);
+    public static Window window2 = new TestWindow(owner, otherButton3, testButton3, 800, 300);
+    public static int step;
+    public static Robot robot = Util.createRobot();
+
+    public static void main(String[] args) {
+        ActualFocusedWindowRetaining a = new ActualFocusedWindowRetaining();
+        a.init();
+        a.start();
+    }
+
+    public void start () {
+        Toolkit.getDefaultToolkit().addAWTEventListener(new AWTEventListener() {
+                public void eventDispatched(AWTEvent e) {
+                    Object src = e.getSource();
+                    Class cls = src.getClass();
+
+                    if (cls == TestWindow.class) {
+                        System.out.println(e.paramString() + " on <" + (src == window1 ? "Window 1" : "Window 2") + ">");
+                    } else if (cls == Frame.class) {
+                        System.out.println(e.paramString() + " on <" + ((Frame)src).getTitle() + ">");
+                    } else if (cls == Button.class) {
+                        System.out.println(e.paramString() + " on <" + ((Button)src).getLabel() + ">");
+                    } else {
+                        System.out.println(e.paramString() + " on <Non-testing component>");
+                    }
+                }
+            }, AWTEvent.WINDOW_EVENT_MASK | AWTEvent.WINDOW_FOCUS_EVENT_MASK | AWTEvent.FOCUS_EVENT_MASK);
+
+        setSize (500, 200);
+        setVisible(true);
+        validate();
+
+        frame.setSize(new Dimension(400, 100));
+        frame.setLocation(800, 400);
+        frame.setVisible(true);
+        frame.toFront();
+
+        owner.setLayout(new FlowLayout());
+        owner.add(testButton1);
+        owner.add(otherButton1);
+        owner.pack();
+        owner.setLocation(800, 100);
+        owner.setSize(new Dimension(400, 100));
+        owner.setVisible(true);
+        owner.toFront();
+        Util.waitTillShown(owner);
+
+        window1.setVisible(true);
+        window2.setVisible(true);
+        window1.toFront();
+        window2.toFront();
+        // Wait longer...
+        Util.waitTillShown(window1);
+        Util.waitTillShown(window2);
+
+        test();
+
+        frame.dispose();
+        owner.dispose();
+    }
+
+    public void test() {
+        Button[] butArr = new Button[] {testButton3, testButton2, testButton1};
+        Window[] winArr = new Window[] {window2, window1, owner};
+
+        step = 1;
+        for (int i = 0; i < 3; i++) {
+            clickInSeriesCheckFocus(null, butArr[i], frame);
+            clickOwnerCheckFocus(winArr[i], butArr[i]);
+            step++;
+        }
+
+        step = 4;
+        clickInSeriesCheckFocus(testButton3, testButton1, frame);
+        clickOwnerCheckFocus(owner, testButton1);
+
+        step = 5;
+        clickInSeriesCheckFocus(testButton3, testButton2, frame);
+        clickOwnerCheckFocus(window1, testButton2);
+
+        step = 6;
+        clickInSeriesCheckFocus(testButton1, testButton2, frame);
+        clickOwnerCheckFocus(window1, testButton2);
+
+        step = 7;
+        clickInSeriesCheckFocus(testButton1, testButton2, frame);
+        window1.setVisible(false);
+        Util.waitForIdle(robot);
+        clickOwnerCheckFocus(owner, testButton1);
+
+        step = 8;
+        window1.setVisible(true);
+        Util.waitTillShown(window1);
+        clickInSeriesCheckFocus(null, testButton2, frame);
+        clickOwnerCheckFocus(window1, testButton2);
+    }
+
+    boolean checkFocusOwner(Component comp) {
+        return (comp == KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner());
+    }
+
+    boolean checkFocusedWindow(Window win) {
+        return (win == KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusedWindow());
+    }
+
+    void clickOwnerCheckFocus(Window focusedWindow, Component focusedComp) {
+        Util.clickOnTitle(owner, robot);
+        robot.delay(500);
+
+        if (!checkFocusedWindow(focusedWindow)) {
+            stopTest("Test failed: actual focused window didn't get a focus");
+        }
+        if (!checkFocusOwner(focusedComp)) {
+            stopTest("Test failed: actual focus owner didn't get a focus");
+        }
+    }
+
+    void clickInSeriesCheckFocus(Component comp1, Component comp2, Frame frame) {
+        if (comp1 != null) {
+            clickOnCheckFocusOwner(comp1);
+        }
+        if (comp2 != null) {
+            clickOnCheckFocusOwner(comp2);
+        }
+        clickOnCheckFocusedWindow(frame);
+    }
+
+    void clickOnCheckFocusOwner(Component c) {
+        Util.clickOnComp(c, robot);
+        robot.delay(500);
+
+        if (!checkFocusOwner(c)) {
+            stopTest("Error: can't bring a focus on Component by clicking on it");
+        }
+    }
+
+    void clickOnCheckFocusedWindow(Frame f) {
+        Util.clickOnTitle(f, robot);
+        robot.delay(500);
+
+        if (!checkFocusedWindow(f)) {
+            stopTest("Error: can't bring a focus on Frame by clicking on it");
+        }
+    }
+
+    void stopTest(String msg) {
+        throw new RuntimeException(new String("Step " + step + ": " + msg));
+    }
+}
+
+class TestWindow extends Window {
+    TestWindow(Frame owner, Button otherButton, Button testButton, int x, int y) {
+        super(owner);
+
+        setLayout(new FlowLayout());
+        setLocation(x, y);
+        add(testButton);
+        add(otherButton);
+        pack();
+        setBackground(Color.green);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Focus/AppletInitialFocusTest/AppletInitialFocusTest.html	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,23 @@
+<html>
+<!--
+  @test
+  @bug 4041703 4096228 4025223 4260929
+  @summary Ensures that appletviewer sets a reasonable default focus for an Applet on start
+  @author  das area=appletviewer
+  @library ../../regtesthelpers
+  @build   Util
+  @run applet AppletInitialFocusTest.html
+  -->
+<head>
+<title> AppletInitialFocusTest </title>
+</head>
+<body>
+
+<h1>AppletInitialFocusTest<br>Bug ID: 4041703</h1>
+
+<p> See the dialog box (usually in upper left corner) for instructions</p>
+
+<APPLET CODE="AppletInitialFocusTest.class" WIDTH=200 HEIGHT=200></APPLET>
+</body>
+</html>
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Focus/AppletInitialFocusTest/AppletInitialFocusTest.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,59 @@
+/*
+ * Copyright 2008 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.
+ *
+ * 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.
+ */
+
+/*
+  test
+  @bug     4041703 4096228 4025223 4260929
+  @summary Ensures that appletviewer sets a reasonable default focus for an Applet on start
+  @author  das area=appletviewer
+  @run     applet AppletInitialFocusTest.html
+*/
+
+import java.applet.Applet;
+import java.awt.Button;
+import java.awt.Component;
+import java.awt.Robot;
+import java.awt.Window;
+import test.java.awt.regtesthelpers.Util;
+
+public class AppletInitialFocusTest extends Applet {
+    Robot robot = Util.createRobot();
+    Button button = new Button("Button");
+
+    public void init() {
+        add(button);
+    }
+
+    public void start() {
+        new Thread(new Runnable() {
+                public void run() {
+                    Util.waitTillShown(button);
+                    robot.delay(1000); // delay the thread to let EDT to start dispatching focus events
+                    Util.waitForIdle(robot);
+                    if (!button.hasFocus()) {
+                        throw new RuntimeException("Appletviewer doesn't set default focus correctly.");
+                    }
+                }
+            }).start();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Focus/AppletInitialFocusTest/AppletInitialFocusTest1.html	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,24 @@
+<html>
+<!--
+  @test
+  @bug 4411534 4517274
+  @summary ensures that user's requestFocus() during applet initialization
+           is not ignored
+  @author  prs area=appletviewer
+  @library ../../regtesthelpers
+  @build   Util
+  @run applet AppletInitialFocusTest1.html
+  -->
+<head>
+<title> AppletInitialFocusTest1 </title>
+</head>
+<body>
+
+<h1>AppletInitialFocusTest1<br>Bug ID: 4517274</h1>
+
+<p> See the dialog box (usually in upper left corner) for instructions</p>
+
+<APPLET CODE="AppletInitialFocusTest1.class" WIDTH=200 HEIGHT=200></APPLET>
+</body>
+</html>
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Focus/AppletInitialFocusTest/AppletInitialFocusTest1.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,71 @@
+/*
+  test %W% %E%
+  @bug 4411534 4517274
+  @summary ensures that user's requestFocus() during applet initialization
+           is not ignored.
+  @author  prs@sparc.spb.su area=appletviewer
+  @run shell AppletInitialFocusTest1.sh
+*/
+
+import java.applet.Applet;
+import java.awt.*;
+import java.awt.event.*;
+
+public class AppletInitialFocusTest1 extends Applet implements FocusListener {
+
+    Button button1 = new Button("Button1");
+    Button button2 = new Button("Button2");
+
+    Object lock = new Object();
+
+    public void init() {
+
+        Component parent = this;
+        while (parent != null && !(parent instanceof Window)) {
+            parent = parent.getParent();
+        }
+        /*
+         * This applet is designed to be run only with appletviewer,
+         * so there always should be a toplevel frame.
+         */
+        if (parent == null) {
+            synchronized (lock) {
+                System.err.println("appletviewer not running");
+                System.exit(3);
+            }
+        }
+        button1.addFocusListener(this);
+        button2.addFocusListener(this);
+        add(button1);
+        add(button2);
+        button2.requestFocus();
+    }
+
+    public void focusGained(FocusEvent e) {
+        if (e.getSource() == button1) {
+            synchronized (lock) {
+                System.err.println("failed: focus on the wrong button");
+                System.exit(2);
+            }
+        }
+    }
+
+    public void focusLost(FocusEvent e) {
+    }
+
+    public void start() {
+        Thread thread = new Thread(new Runnable() {
+            public void run() {
+                try {
+                    Thread.sleep(10000);
+                    synchronized (lock) {
+                        System.err.println("passed");
+                        System.exit(0);
+                    }
+                } catch(InterruptedException e) {
+                }
+            }
+        });
+        thread.start();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Focus/ConsumeNextKeyTypedOnModalShowTest/ConsumeNextKeyTypedOnModalShowTest.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,110 @@
+/*
+ * Copyright 2008 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.
+ *
+ * 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.
+ */
+
+/*
+  @test      %W% %E%
+  @bug       6637607
+  @summary   Showing a modal dlg on TAB KEY_PRESS shouldn't consume inappropriate KEY_TYPED.
+  @author    Anton Tarasov: area=awt-focus
+  @library   ../../regtesthelpers
+  @build     Util
+  @run       main ConsumeNextKeyTypedOnModalShowTest
+*/
+
+import java.awt.*;
+import java.awt.event.*;
+import java.applet.Applet;
+import java.util.concurrent.atomic.AtomicBoolean;
+import java.lang.reflect.InvocationTargetException;
+import test.java.awt.regtesthelpers.Util;
+
+public class ConsumeNextKeyTypedOnModalShowTest extends Applet {
+    Robot robot;
+    Frame frame = new Frame("Frame");
+    Dialog dialog = new Dialog(frame, "Dialog", true);
+    TextField tf0 = new TextField();
+    TextField tf1 = new TextField();
+    Button button = new Button("Button");
+
+    public static void main(String[] args) {
+        ConsumeNextKeyTypedOnModalShowTest app = new ConsumeNextKeyTypedOnModalShowTest();
+        app.init();
+        app.start();
+    }
+
+    public void init() {
+        robot = Util.createRobot();
+
+        tf0.setPreferredSize(new Dimension(50, 30));
+        tf1.setPreferredSize(new Dimension(50, 30));
+        frame.setLayout(new FlowLayout());
+        frame.add(tf0);
+        frame.add(tf1);
+        frame.pack();
+
+        dialog.add(button);
+        dialog.pack();
+
+        Toolkit.getDefaultToolkit().addAWTEventListener(new AWTEventListener() {
+            public void eventDispatched(AWTEvent e) {
+                if (e.getID() == KeyEvent.KEY_PRESSED && e.getSource() == tf0) {
+                    dialog.setVisible(true);
+                }
+            }
+        }, KeyEvent.KEY_EVENT_MASK);
+    }
+
+    public void start() {
+        frame.setVisible(true);
+        Util.waitTillShown(frame);
+
+        // Show the dialog.
+        robot.keyPress(KeyEvent.VK_TAB);
+        robot.delay(50);
+        robot.keyRelease(KeyEvent.VK_TAB);
+
+        Util.waitForIdle(robot);
+
+        // Dispose the dialog.
+        Runnable action = new Runnable() {
+            public void run() {
+                dialog.dispose();
+            }
+        };
+        if (!Util.trackFocusGained(tf1, action, 2000, false)) {
+            throw new RuntimeException("Test failed: TAB was processed incorrectly!");
+        }
+
+        // Check for type-ability.
+        robot.keyPress(KeyEvent.VK_A);
+        robot.delay(50);
+        robot.keyRelease(KeyEvent.VK_A);
+
+        Util.waitForIdle(robot);
+
+        if (tf1.getText().equals("")) {
+            throw new RuntimeException("Test failed: couldn't type a char!");
+        }
+        System.out.println("Test passed.");
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Focus/ContainerFocusAutoTransferTest/ContainerFocusAutoTransferTest.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,243 @@
+/*
+ * Copyright 2008 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.
+ *
+ * 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.
+ */
+
+/*
+  @test
+  @bug       6607170
+  @summary   Tests for focus-auto-transfer.
+  @author    Anton Tarasov: area=awt-focus
+  @library   ../../regtesthelpers
+  @build     Util
+  @run       main ContainerFocusAutoTransferTest
+*/
+
+import java.applet.Applet;
+import java.awt.AWTEvent;
+import java.awt.Component;
+import java.awt.ComponentOrientation;
+import java.awt.DefaultKeyboardFocusManager;
+import java.awt.KeyboardFocusManager;
+import java.awt.Robot;
+import java.awt.Color;
+import java.awt.FlowLayout;
+import java.awt.Toolkit;
+import java.awt.event.AWTEventListener;
+import java.awt.event.FocusEvent;
+import java.awt.event.WindowEvent;
+import javax.swing.JButton;
+import javax.swing.JFrame;
+import javax.swing.JPanel;
+import test.java.awt.regtesthelpers.Util;
+
+public class ContainerFocusAutoTransferTest extends Applet {
+    Robot robot;
+    TestFrame frame;
+    KeyboardFocusManager kfm;
+    enum TestCase {
+        REMOVAL { public String toString() { return "removal"; } },
+        HIDING { public String toString() { return "hiding"; } },
+        DISABLING { public String toString() { return "disabling"; } },
+        DEFOCUSING { public String toString() { return "defocusing"; } };
+        public abstract String toString();
+    };
+
+    public static void main(String[] args) {
+        ContainerFocusAutoTransferTest app = new ContainerFocusAutoTransferTest();
+        app.init();
+        app.start();
+    }
+
+    public void init() {
+        robot = Util.createRobot();
+        kfm = KeyboardFocusManager.getCurrentKeyboardFocusManager();
+        Toolkit.getDefaultToolkit().addAWTEventListener(new AWTEventListener() {
+            public void eventDispatched(AWTEvent event) {
+                System.out.println("--> " + event);
+            }
+        }, FocusEvent.FOCUS_EVENT_MASK | WindowEvent.WINDOW_FOCUS_EVENT_MASK);
+    }
+
+    public void start() {
+        System.out.println("*** TEST #1 ***");
+        test(TestCase.HIDING);
+
+        System.out.println("*** TEST #2 ***");
+        test(TestCase.REMOVAL);
+
+        System.out.println("*** TEST #3 ***");
+        test3(TestCase.DISABLING);
+
+        System.out.println("*** TEST #4 ***");
+        test3(TestCase.DEFOCUSING);
+
+        System.out.println("*** TEST #5 ***");
+        test4();
+
+        System.out.println("Test passed.");
+    }
+
+    void test(final TestCase t) {
+        showFrame();
+        test1(t); // Test for correct auto-transfer
+        test2(t); // Test for clearing focus
+    }
+
+    void test1(final TestCase t) {
+        Runnable action = new Runnable() {
+            public void run() {
+                KeyboardFocusManager.setCurrentKeyboardFocusManager(new TestKFM());
+                if (t == TestCase.REMOVAL) {
+                    frame.remove(frame.panel0);
+
+                } else if (t == TestCase.HIDING) {
+                    frame.panel0.setVisible(false);
+                }
+                frame.repaint();
+            }
+        };
+        if (!Util.trackFocusGained(frame.b3, action, 2000, false)) {
+            throw new TestFailedException(t + ": focus wasn't transfered as expected!");
+        }
+        KeyboardFocusManager.setCurrentKeyboardFocusManager(kfm);
+    }
+
+    void test2(TestCase t) {
+        frame.setFocusable(false); // exclude it from the focus cycle
+        if (t == TestCase.REMOVAL) {
+            frame.remove(frame.panel1);
+
+        } else if (t == TestCase.HIDING) {
+            frame.panel1.setVisible(false);
+        }
+        frame.repaint();
+        Util.waitForIdle(robot);
+        if (kfm.getFocusOwner() != null) {
+            throw new TestFailedException(t + ": focus wasn't cleared!");
+        }
+    }
+
+    void test3(final TestCase t) {
+        showFrame();
+        Runnable action = new Runnable() {
+            public void run() {
+                if (t == TestCase.DISABLING) {
+                    frame.b0.setEnabled(false);
+
+                } else if (t == TestCase.DEFOCUSING) {
+                    frame.b0.setFocusable(false);
+                }
+            }};
+        if (!Util.trackFocusGained(frame.b1, action, 2000, false)) {
+            throw new TestFailedException(t + ": focus wasn't transfered as expected!");
+        }
+    }
+
+    void test4() {
+        showFrame();
+        frame.setFocusableWindowState(false);
+        Util.waitForIdle(robot);
+        if (kfm.getFocusOwner() != null) {
+            throw new TestFailedException("defocusing the frame: focus wasn't cleared!");
+        }
+    }
+
+    void showFrame() {
+        if (frame != null) {
+            frame.dispose();
+            Util.waitForIdle(robot);
+        }
+        frame = new TestFrame();
+        frame.setVisible(true);
+        Util.waitTillShown(frame);
+
+        if (!frame.b0.hasFocus()) {
+            Util.clickOnComp(frame.b0, robot);
+            Util.waitForIdle(robot);
+            if (!frame.b0.hasFocus()) {
+                throw new TestErrorException("couldn't set focus on " + frame.b2);
+            }
+        }
+    }
+
+    class TestKFM extends DefaultKeyboardFocusManager {
+        public boolean dispatchEvent(AWTEvent e) {
+            if (e.getID() == FocusEvent.FOCUS_GAINED) {
+                System.out.println(e);
+                Component src = (Component)e.getSource();
+                if (src == frame.b1 || src == frame.b2) {
+                    throw new TestFailedException("wrong focus transfer on removal!");
+                }
+            }
+            return super.dispatchEvent(e);
+        }
+    }
+}
+
+class TestFrame extends JFrame {
+    public JPanel panel0 = new JPanel();
+    public JPanel panel1 = new JPanel();
+    public JButton b0 = new JButton("b0");
+    public JButton b1 = new JButton("b1");
+    public JButton b2 = new JButton("b2");
+    public JButton b3 = new JButton("b3");
+    public JButton b4 = new JButton("b4");
+
+    public TestFrame() {
+        super("TestFrame");
+
+        // The change of the orientation and the reverse order of
+        // adding the buttons to the panel is because in Container.removeNotify()
+        // the child components are removed in the reverse order.
+        // We want that the focus owner (b0) would be removed first and
+        // that the next traversable component would be b1.
+        panel0.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
+        panel0.add(b2);
+        panel0.add(b1);
+        panel0.add(b0);
+
+        panel1.add(b3);
+        panel1.add(b4);
+
+        setLayout(new FlowLayout());
+        add(panel0);
+        add(panel1);
+        pack();
+
+        panel0.setBackground(Color.red);
+        panel1.setBackground(Color.blue);
+    }
+}
+
+// Thrown when the behavior being verified is found wrong.
+class TestFailedException extends RuntimeException {
+    TestFailedException(String msg) {
+        super("Test failed: " + msg);
+    }
+}
+
+// Thrown when an error not related to the behavior being verified is encountered.
+class TestErrorException extends RuntimeException {
+    TestErrorException(String msg) {
+        super("Unexpected error: " + msg);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Focus/FrameJumpingToMouse/FrameJumpingToMouse.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,86 @@
+/*
+ * Copyright 2008 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.
+ *
+ * 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.
+ */
+
+/*
+    @test
+    @bug        4752312
+    @summary    Tests that after moving non-focusable window it ungrabs mouse pointer
+    @author     Denis Mikhalkin: area=awt.focus
+    @library    ../../regtesthelpers
+    @build      Util
+    @run        main FrameJumpingToMouse
+*/
+
+import java.applet.Applet;
+import java.awt.BorderLayout;
+import java.awt.Dialog;
+import java.awt.Frame;
+import java.awt.Point;
+import java.awt.Robot;
+import java.awt.TextArea;
+import java.awt.Toolkit;
+import java.awt.event.InputEvent;
+import javax.swing.JFrame;
+import test.java.awt.regtesthelpers.Util;
+
+public class FrameJumpingToMouse extends Applet
+{
+    JFrame frame = new JFrame("Test jumping frame");
+    Robot robot = Util.createRobot();
+
+    public static void main(String[] args) {
+        FrameJumpingToMouse test = new FrameJumpingToMouse();
+        test.init();
+        test.start();
+    }
+
+    public void init() {
+        frame.setFocusableWindowState(false);
+        frame.setBounds(100, 100, 100, 100);
+    }
+
+    public void start() {
+        frame.setVisible(true);
+        Util.waitTillShown(frame);
+
+        Point loc = frame.getLocationOnScreen();
+        robot.mouseMove(loc.x + frame.getWidth() / 4, loc.y + frame.getInsets().top / 2);
+        robot.delay(50);
+        robot.mousePress(InputEvent.BUTTON1_MASK);
+        robot.delay(50);
+        robot.mouseMove(loc.x + 100, loc.y + 50);
+        robot.delay(50);
+        robot.mouseRelease(InputEvent.BUTTON1_MASK);
+
+        Util.waitForIdle(robot);
+
+        loc = frame.getLocation();
+        robot.mouseMove(loc.x + frame.getWidth() / 2, loc.y + frame.getHeight() / 2);
+        Util.waitForIdle(robot);
+
+        if (!(frame.getLocation().equals(loc))) {
+            throw new RuntimeException("Test failed: frame is moving to mouse with grab!");
+        }
+        System.out.println("Test passed.");
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Focus/IconifiedFrameFocusChangeTest/IconifiedFrameFocusChangeTest.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,124 @@
+/*
+ * Copyright 2008 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.
+ *
+ * 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.
+ */
+
+/*
+  @test
+  @bug       6522725
+  @summary   Tests for proper request-focus-back on FOCUS_LOST.
+  @author    Anton Tarasov: area=awt-focus
+  @library   ../../regtesthelpers
+  @build     Util
+  @run       main IconifiedFrameFocusChangeTest
+*/
+
+import java.awt.*;
+import java.applet.Applet;
+import java.awt.event.*;
+import test.java.awt.regtesthelpers.Util;
+
+public class IconifiedFrameFocusChangeTest extends Applet {
+    Frame testFrame = new Frame("Test Frame");
+    Frame otherFrame = new Frame("Other Frame");
+    Button testButton = new Button("test button");
+    Button otherButton = new Button("other button");
+    Robot robot;
+
+    public static void main(String[] args) {
+        IconifiedFrameFocusChangeTest app = new IconifiedFrameFocusChangeTest();
+        app.init();
+        app.start();
+    }
+
+    public void init() {
+        robot = Util.createRobot();
+
+        testFrame.add(testButton);
+        testFrame.pack();
+        otherFrame.add(otherButton);
+        otherFrame.pack();
+        otherFrame.setLocation(200, 0);
+
+        testButton.addFocusListener(new FocusAdapter() {
+            public void focusLost(FocusEvent e) {
+                testButton.requestFocus();
+            }
+        });
+    }
+
+    public void start() {
+        otherFrame.setVisible(true);
+        Util.waitForIdle(robot);
+        testFrame.setVisible(true);
+        Util.waitForIdle(robot);
+
+        if (!testButton.hasFocus()) {
+            throw new TestErrorException("wrong initial focus");
+        }
+
+        /*
+         * Iconify the Frame. Test that focus switches properly.
+         */
+        Runnable action = new Runnable() {
+            public void run() {
+                testFrame.setExtendedState(Frame.ICONIFIED);
+            }
+        };
+        if (!Util.trackFocusGained(otherButton, action, 2000, true)) {
+            throw new TestFailedException("iconifying focused window didn't trigger focus change");
+        }
+
+        /*
+         * Test that key events go into the focus owner.
+         */
+        action = new Runnable() {
+            public void run() {
+                robot.keyPress(KeyEvent.VK_SPACE);
+                robot.delay(50);
+                robot.keyRelease(KeyEvent.VK_SPACE);
+            }
+        };
+        if (!Util.trackActionPerformed(otherButton, action, 2000, true)) {
+            throw new TestFailedException("Java focus owner doesn't match to the native one");
+        }
+
+        System.out.println("Test passed.");
+    }
+}
+
+/**
+ * Thrown when the behavior being verified is found wrong.
+ */
+class TestFailedException extends RuntimeException {
+    TestFailedException(String msg) {
+        super("Test failed: " + msg);
+    }
+}
+
+/**
+ * Thrown when an error not related to the behavior being verified is encountered.
+ */
+class TestErrorException extends RuntimeException {
+    TestErrorException(String msg) {
+        super("Unexpected error: " + msg);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Focus/NonFocusableWindowTest/NoEventsTest.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,420 @@
+/*
+ * Copyright 2008 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.
+ *
+ * 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.
+ */
+
+/*
+  @test
+  @bug 4452384
+  @summary Tests that non-focusable windows doesn't generate any focus events when accessed.
+  @author Denis.Mikhalkin: area=awt.focus
+  @run main NoEventsTest
+*/
+
+import java.awt.*;
+import java.awt.event.*;
+import java.util.*;
+
+public class NoEventsTest extends Frame {
+    public static final int DEF_WIDTH = 400,
+        DEF_HEIGHT = 300,
+        DEF_TOP = 1,
+        DEF_LEFT = 100,
+        DEF_ROW = 0,
+        DEF_COL = 0;
+    static boolean automatic = true;
+    static Window[] windows;
+    static Frame main_frame, jumpingFrame;
+    static Button focus_button;
+    static Robot robot;
+    static void pause(int timeout) {
+        Toolkit.getDefaultToolkit().sync();
+        robot.waitForIdle();
+        robot.delay(100);
+    }
+    static GlobalListener listener;
+    public static void main(String[] args) {
+
+        listener = new GlobalListener();
+        Toolkit.getDefaultToolkit().addAWTEventListener(listener,
+                                                        AWTEvent.FOCUS_EVENT_MASK |
+                                                        AWTEvent.WINDOW_EVENT_MASK);
+        try{
+            robot = new Robot();
+        } catch(Exception e) {}
+        // Create several pairs - focusable Frame with focusable component(button) and non-focusable:
+        // window, resizable frame, non-resizable frame, dialog, non-resiable dialog
+        main_frame = new Frame("focusable frame");
+        focus_button = new Button("button to focus");
+        main_frame.add(focus_button);
+        main_frame.pack();
+        main_frame.setVisible(true);
+        main_frame.setLocation(10, 600);
+        main_frame.addWindowListener(new WindowAdapter() {
+                public void windowClosing(WindowEvent e) {
+                    listener.report();
+                    System.exit(0);
+                }
+            });
+
+        jumpingFrame = new Frame("Jumping frame");
+        jumpingFrame.setBounds(DEF_LEFT, DEF_TOP, DEF_WIDTH, DEF_HEIGHT);
+
+        windows = new Window[7];
+        windows[0] = new TestWindow(0, 0, false, main_frame);
+        //windows[1] = new TestWindow(2, 1, true, main_frame);
+        windows[2] = new NoEventsTest(1, 0, false, true);
+        windows[3] = new NoEventsTest(2, 0, false, false);
+        //windows[4] = new Test(3, 0, true, true);
+        windows[5] = new TestDialog(0, 1, false, true, main_frame);
+        windows[6] = new TestDialog(1, 1, false, false, main_frame);
+        if (!automatic) {
+            int windowInd;
+            for (windowInd = 0; windowInd < windows.length; windowInd++) {
+                if (windows[windowInd] != null) {
+                    windows[windowInd].setVisible(true);
+                }
+            }
+        }
+        // Run the test
+        // 1. Click on all controls, check for no focus events for non-focusable, right focus events for focusable
+        // 2. Perform some action with control, check if it works
+        if (automatic) {
+            int windowInd;
+            for (windowInd = 0; windowInd < windows.length; windowInd++) {
+                if (windows[windowInd] != null) {
+                    windows[windowInd].setVisible(true);
+                    focus_button.requestFocus();
+                    pause(1000);
+
+                    // Verify that click on non-focusable window causes no focus lost on active window
+                    performFocusClick(windows[windowInd]);
+                    focus_button.requestFocus();
+                    pause(500);
+                    performActionClick(windows[windowInd]);
+
+                    // Verify that toFront, toBack doesn't cause non-focusable window to become active
+                    jumpingFrame.setVisible(true);
+                    pause(1000);
+                      jumpingFrame.toBack();
+                      pause(500);
+                      jumpingFrame.toFront();
+                      pause(500);
+                      windows[windowInd].toBack();
+                      pause(500);
+                      windows[windowInd].toFront();
+                      pause(500);
+
+                    // Verify that iconifiyng/deiconfiying and
+                    // zooming/unzooming doesn't cause non-focusable
+                    // window to become active
+                    if (windows[windowInd] instanceof Frame) {
+                        Frame toTest = (Frame)windows[windowInd];
+                        // Deiconification currently doesn't work!
+//                        toTest.setExtendedState(Frame.ICONIFIED);
+//                        pause(500);
+//                        toTest.setExtendedState(Frame.NORMAL);
+                        pause(500);
+                        toTest.setExtendedState(Frame.MAXIMIZED_BOTH);
+                        pause(500);
+                        toTest.setExtendedState(Frame.NORMAL);
+                    }
+
+                    windows[windowInd].dispose();
+                    jumpingFrame.dispose();
+                }
+            }
+            pause(1000);
+            System.err.println("Test finished.");
+            if (!listener.report()) {
+                throw new RuntimeException("Test Failed. See error stream output for details");
+            }
+        }
+    }
+    static void performFocusClick(Window parent) {
+        if (parent == null) {
+            return;
+        }
+        for (int compInd = 0; compInd < parent.getComponentCount(); compInd++) {
+            Component child = parent.getComponent(compInd);
+            if (child instanceof TestPanel) {
+                TestPanel pan = (TestPanel)child;
+                pan.performFocusClicks(robot);
+                pause(100);
+            }
+        }
+    }
+    static void performActionClick(Window parent) {
+        if (parent == null) {
+            return;
+        }
+        for (int compInd = 0; compInd < parent.getComponentCount(); compInd++) {
+            Component child = parent.getComponent(compInd);
+            if (child instanceof TestPanel) {
+                TestPanel pan = (TestPanel)child;
+                pan.performActionClicks(robot);
+                pause(100);
+            }
+        }
+    }
+    public NoEventsTest(int row, int col, boolean focusable, boolean resizable) {
+        super("Frame" + row + "" + col);
+        TestPanel panel = new TestPanel(row, col);
+        if (NoEventsTest.automatic) {
+            row = NoEventsTest.DEF_ROW;
+            col = NoEventsTest.DEF_COL;
+        }
+        setName(getTitle());
+        add("Center", panel);
+        Label l = new Label(getClass().getSuperclass().getName() + ", " + (focusable?"focusable":"non-focusable") +
+                            ", " + (resizable?"resizable":"non-resizable"));
+        l.setBackground(Color.green);
+        add("North", l);
+        setBounds(NoEventsTest.DEF_LEFT + DEF_WIDTH*col, DEF_TOP + DEF_HEIGHT*row, DEF_WIDTH, DEF_HEIGHT);
+        if (!focusable) {
+            setFocusableWindowState(false);
+        }
+        if (!resizable) {
+            setResizable(false);
+        }
+//        setVisible(true);
+    }
+}
+class TestWindow extends Window {
+    public TestWindow(int row, int col, boolean focusable, Frame owner) {
+        super(owner);
+        setName("Window" + row + "" + col);
+        TestPanel panel = new TestPanel(row, col);
+        if (NoEventsTest.automatic) {
+            row = NoEventsTest.DEF_ROW;
+            col = NoEventsTest.DEF_COL;
+        }
+
+        add("Center", panel);
+        Label l = new Label(getClass().getSuperclass().getName() + ", " + (focusable?"focusable":"non-focusable") +
+                            ", " + (false?"resizable":"non-resizable"));
+        l.setBackground(Color.green);
+        add("North", l);
+
+        setBounds(NoEventsTest.DEF_LEFT + NoEventsTest.DEF_WIDTH*col, NoEventsTest.DEF_TOP + NoEventsTest.DEF_HEIGHT*row, NoEventsTest.DEF_WIDTH, NoEventsTest.DEF_HEIGHT);
+        if (!focusable) {
+            setFocusableWindowState(false);
+        }
+//        setVisible(true);
+    }
+}
+class TestDialog extends Dialog {
+    public TestDialog(int row, int col, boolean focusable, boolean resizable, Frame owner) {
+        super(owner);
+        setName("Dialog" + row + "" + col);
+        TestPanel panel = new TestPanel(row, col);
+        if (NoEventsTest.automatic) {
+            row = NoEventsTest.DEF_ROW;
+            col = NoEventsTest.DEF_COL;
+        }
+
+        add("Center", panel);
+        Label l = new Label(getClass().getSuperclass().getName() + ", " + (focusable?"focusable":"non-focusable") +
+                            ", " + (resizable?"resizable":"non-resizable"));
+        l.setBackground(Color.green);
+        add("North", l);
+
+        setBounds(NoEventsTest.DEF_LEFT + NoEventsTest.DEF_WIDTH*col, NoEventsTest.DEF_TOP + NoEventsTest.DEF_HEIGHT*row, NoEventsTest.DEF_WIDTH, NoEventsTest.DEF_HEIGHT);
+        if (!focusable) {
+            setFocusableWindowState(false);
+        }
+        if (!resizable) {
+            setResizable(false);
+        }
+//        setVisible(true);
+    }
+}
+
+class TestPanel extends Panel {
+
+    void clickComponent(Component comp, Robot robot) {
+        if (comp instanceof Choice) {
+            return;
+        }
+        Point compLoc = comp.getLocationOnScreen();
+        Dimension size = comp.getSize();
+        robot.mouseMove(compLoc.x + size.width/2, compLoc.y + size.height/2);
+        robot.mousePress(InputEvent.BUTTON1_MASK);
+        robot.mouseRelease(InputEvent.BUTTON1_MASK);
+    }
+    void performFocusClicks(Robot robot) {
+        for (int childInd = 0; childInd < getComponentCount(); childInd++) {
+            performFocusClick(getComponent(childInd), robot);
+        }
+    }
+    void performFocusClick(Component comp, Robot robot) {
+        clickComponent(comp, robot);
+    }
+
+    void performActionClicks(Robot robot) {
+        for (int childInd = 0; childInd < getComponentCount(); childInd++) {
+            performActionClick(getComponent(childInd), robot);
+        }
+    }
+    void performActionClick(Component comp, Robot robot) {
+    }
+
+    public TestPanel(int row, int col) {
+        setLayout(new FlowLayout());
+        Button b;
+        add(b = new Button("press"+ row + "" + col));
+        b.setName(b.getLabel());
+//         b.addMouseListener(new MouseAdapter() {
+//                 public void mousePressed(MouseEvent e) {
+//                     System.err.println(e);
+//                 }
+//             });
+        TextField t;
+        add(t = new TextField("text" + row + "" + col));
+        t.setName(t.getText());
+
+        java.awt.List list = new java.awt.List();
+        add(list);
+        list.setName("list");
+        list.add("one");
+        list.add("two");
+        list.add("three");
+        list.setMultipleMode(true);
+        list.setName("list" + row + "" + col);
+
+        Checkbox check = new Checkbox("checker");
+        add(check);
+        check.setName("check" + row + "" + col);
+
+        Choice choice = new Choice();
+        choice.add("one");
+        choice.add("two");
+        choice.add("three");
+        add(choice);
+        choice.setName("choice" + row + "" + col);
+
+        Canvas can = new Canvas() {
+                public Dimension getPreferredSize() {
+                    return new Dimension(10, 10);
+                }
+            };
+        can.setBackground(Color.blue);
+        add(can);
+        can.setName("canvas" + row + "" + col);
+
+        TextArea ta = new TextArea("text\ntttt\naaaa\nwwwww\nqqqqqq\neeeeee\nrrrrrr\nyyyyyy\nuuuuu", 3, 5);
+        add(ta);
+        ta.setName("textarea" + row + "" + col);
+
+        Scrollbar bar = new Scrollbar(Scrollbar.HORIZONTAL);
+        add(bar);
+        bar.setName("scrollbar" + row + "" + col);
+
+        CheckboxGroup group = new CheckboxGroup();
+        Checkbox ch1 = new Checkbox("one", group, true);
+        Checkbox ch2 = new Checkbox("two", group, false);
+        add(ch1);
+        add(ch2);
+        ch1.setName("checkbox1 " + row + "" + col);
+        ch2.setName("checkbox2 " + row + "" + col);
+
+
+        ScrollPane pane = new ScrollPane(ScrollPane.SCROLLBARS_ALWAYS);
+        add(pane);
+        Button bigButton = new Button("abc") {
+                public Dimension getPreferredSize() {
+                    return new Dimension(100, 100);
+                }
+            };
+        pane.add(bigButton);
+        bigButton.setName("bigbutton" + row + "" + col);
+    }
+}
+
+class GlobalListener implements AWTEventListener {
+    java.util.List errors = new java.util.LinkedList();
+    public boolean report() {
+        if (errors.size() != 0) {
+            System.err.println("Test FAILED");
+        } else {
+            System.err.println("Test PASSED");
+            return true;
+        }
+        ListIterator iter = errors.listIterator();
+        while (iter.hasNext()) {
+            System.err.println(iter.next());
+        }
+        return false;
+    }
+    public GlobalListener() {
+    }
+    Window getWindowParent(Component comp) {
+        while (comp != null && !(comp instanceof Window)) {
+            comp = comp.getParent();
+        }
+        return (Window)comp;
+    }
+    void reportError(AWTEvent e, String message) {
+        String error = "ERROR: " + message + " : " + e;
+        errors.add(error);
+        System.err.println(error);
+    }
+    public void eventDispatched(AWTEvent e) {
+        Component comp = (Component)e.getSource();
+        Window parent = getWindowParent(comp);
+        if (!(e instanceof WindowEvent || e instanceof FocusEvent)) {
+            System.err.println("Strange event " + e);
+        }
+
+        // Skip WINDOW_OPENED
+        if (e.getID() == WindowEvent.WINDOW_CLOSING) {
+            System.err.println(e);
+        }
+        switch (e.getID()) {
+          case WindowEvent.WINDOW_OPENED:
+          case WindowEvent.WINDOW_CLOSING:
+          case WindowEvent.WINDOW_CLOSED:
+          case WindowEvent.WINDOW_ICONIFIED:
+          case WindowEvent.WINDOW_DEICONIFIED:
+          case WindowEvent.WINDOW_STATE_CHANGED:
+            return;
+          case WindowEvent.WINDOW_LOST_FOCUS: {
+              WindowEvent we = (WindowEvent)e;
+              if (we.getOppositeWindow() != null && !we.getOppositeWindow().getFocusableWindowState()) {
+                  reportError(e, "frame lost focus because of non-focusable window");
+              }
+              break;
+          }
+        }
+        // Check that Window owner is focusable
+        if (!parent.getFocusableWindowState()) {
+            reportError(e, "focus event for component in non-focusable window " + parent.getName());
+        }
+        if (!comp.isFocusable()) {
+            reportError(e, "focus event for non-focusable component");
+        }
+//         if (e instanceof WindowEvent || e instanceof FocusEvent) {
+// //             System.err.println(e);
+//         }
+    }
+}
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Focus/NonFocusableWindowTest/NonfocusableOwnerTest.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,159 @@
+/*
+ * Copyright 2008 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.
+ *
+ * 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.
+ */
+
+/*
+  @test
+  @bug       6182359
+  @summary   Tests that Window having non-focusable owner can't be a focus owner.
+  @author    Anton.Tarasov: area=awt.focus
+  @library   ../../regtesthelpers
+  @build     Util
+  @run       main NonfocusableOwnerTest
+*/
+
+import java.awt.*;
+import java.awt.event.*;
+import java.applet.Applet;
+import java.lang.reflect.*;
+import java.io.*;
+import test.java.awt.regtesthelpers.Util;
+
+public class NonfocusableOwnerTest extends Applet {
+    Robot robot = Util.createRobot();
+    Frame frame;
+    Dialog dialog;
+    Window window1;
+    Window window2;
+    Button button = new Button("button");
+
+    public static void main(String[] args) {
+        NonfocusableOwnerTest test = new NonfocusableOwnerTest();
+        test.start();
+    }
+
+    public void start() {
+        Toolkit.getDefaultToolkit().addAWTEventListener(new AWTEventListener() {
+                public void eventDispatched(AWTEvent e) {
+                    System.out.println(e.toString());
+                }
+            }, FocusEvent.FOCUS_EVENT_MASK | WindowEvent.WINDOW_FOCUS_EVENT_MASK | WindowEvent.WINDOW_EVENT_MASK);
+
+        frame = new Frame("Frame");
+        frame.setName("Frame-owner");
+        frame.setBounds(100, 0, 100, 100);
+        dialog = new Dialog(frame, "Dialog");
+        dialog.setName("Dialog-owner");
+        dialog.setBounds(100, 0, 100, 100);
+
+        window1 = new Window(frame);
+        window1.setName("1st child");
+        window1.setBounds(100, 300, 100, 100);
+        window2 = new Window(window1);
+        window2.setName("2nd child");
+        window2.setBounds(100, 500, 100, 100);
+
+        test1(frame, window1);
+        test2(frame, window1, window2);
+        test3(frame, window1, window2);
+
+        window1 = new Window(dialog);
+        window1.setBounds(100, 300, 100, 100);
+        window1.setName("1st child");
+        window2 = new Window(window1);
+        window2.setName("2nd child");
+        window2.setBounds(100, 500, 100, 100);
+
+        test1(dialog, window1);
+        test2(dialog, window1, window2);
+        test3(dialog, window1, window2);
+
+        System.out.println("Test passed.");
+    }
+
+    void test1(Window owner, Window child) {
+        System.out.println("* * * STAGE 1 * * *\nWindow owner: " + owner);
+
+        owner.setFocusableWindowState(false);
+        owner.setVisible(true);
+
+        child.add(button);
+        child.setVisible(true);
+
+        Util.waitTillShown(child);
+
+        Util.clickOnComp(button, robot);
+        if (button == KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner()) {
+            throw new RuntimeException("Test Failed.");
+        }
+        child.dispose();
+        owner.dispose();
+    }
+
+    void test2(Window owner, Window child1, Window child2) {
+        System.out.println("* * * STAGE 2 * * *\nWindow nowner: " + owner);
+
+        owner.setFocusableWindowState(false);
+        owner.setVisible(true);
+
+        child1.setFocusableWindowState(true);
+        child1.setVisible(true);
+
+        child2.add(button);
+        child2.setVisible(true);
+
+        Util.waitTillShown(child2);
+
+        Util.clickOnComp(button, robot);
+        if (button == KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner()) {
+            throw new RuntimeException("Test failed.");
+        }
+        child2.dispose();
+        child1.dispose();
+        owner.dispose();
+    }
+
+    void test3(Window owner, Window child1, Window child2) {
+        System.out.println("* * * STAGE 3 * * *\nWidow owner: " + owner);
+
+        owner.setFocusableWindowState(true);
+        owner.setVisible(true);
+
+        child1.setFocusableWindowState(false);
+        child1.setVisible(true);
+
+        child2.setFocusableWindowState(true);
+        child2.add(button);
+        child2.setVisible(true);
+
+        Util.waitTillShown(child2);
+
+        Util.clickOnComp(button, robot);
+        System.err.println("focus owner: " + KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner());
+        if (button != KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner()) {
+            throw new RuntimeException("Test failed.");
+        }
+        child1.dispose();
+        child2.dispose();
+        owner.dispose();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Focus/TypeAhead/TestFocusFreeze.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,139 @@
+/*
+ * Copyright 2008 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.
+ *
+ * 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.
+ */
+
+/*
+   @test
+   @bug        6183877 6216005 6225560
+   @library    ../../regtesthelpers
+   @build      Util
+   @summary    Tests that keyboard input doesn't freeze due to type-ahead problems
+   @author     Denis.Mikhalkin, Anton.Tarasov: area=awt.focus
+   @run        main TestFocusFreeze
+*/
+
+import java.awt.Component;
+import java.awt.DefaultKeyboardFocusManager;
+import java.awt.KeyboardFocusManager;
+import java.awt.Robot;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.KeyEvent;
+import java.util.concurrent.atomic.AtomicBoolean;
+import javax.swing.JButton;
+import javax.swing.JDialog;
+import javax.swing.JFrame;
+import test.java.awt.regtesthelpers.Util;
+
+public class TestFocusFreeze {
+    private static JFrame frame;
+    private static JDialog dialog;
+    private static JButton dlgButton;
+    private static JButton frameButton;
+    private static AtomicBoolean lock = new AtomicBoolean(false);
+    private static Robot robot = Util.createRobot();
+
+    public static void main(String[] args) {
+        boolean all_passed = true;
+        KeyboardFocusManager testKFM = new TestKFM(robot);
+        KeyboardFocusManager defKFM = KeyboardFocusManager.getCurrentKeyboardFocusManager();
+
+        for (int i = 0; i < 10; i++) {
+            test(testKFM, defKFM);
+            Util.waitForIdle(robot);
+            System.out.println("Iter " + i + ": " + (lock.get() ? "passed." : "failed!"));
+            if (!lock.get()) {
+                all_passed = false;
+            }
+        }
+        if (!all_passed) {
+            throw new RuntimeException("Test failed: not all iterations passed!");
+        }
+        System.out.println("Test passed.");
+    }
+
+    public static void test(final KeyboardFocusManager testKFM, final KeyboardFocusManager defKFM) {
+        frame = new JFrame("Frame");
+        dialog = new JDialog(frame, "Dialog", true);
+        dlgButton = new JButton("Dialog_Button");
+        frameButton = new JButton("Frame_Button");
+
+        lock.set(false);
+
+        dialog.add(dlgButton);
+        dialog.setLocation(200, 0);
+        dialog.pack();
+        frame.add(frameButton);
+        frame.pack();
+
+        dlgButton.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent e) {
+                dialog.dispose();
+                frame.dispose();
+                synchronized (lock) {
+                    lock.set(true);
+                    lock.notifyAll();
+                }
+            }
+        });
+
+        frameButton.addActionListener(new ActionListener() {
+                public void actionPerformed(ActionEvent e) {
+                    // Right before the dialog will be shown, there will be called
+                    // enqueuKeyEvents() method. We are to catch it.
+                    KeyboardFocusManager.setCurrentKeyboardFocusManager(testKFM);
+                    dialog.setVisible(true);
+                    KeyboardFocusManager.setCurrentKeyboardFocusManager(defKFM);
+                }
+            });
+
+        Runnable showAction = new Runnable() {
+            public void run() {
+                frame.setVisible(true);
+            }
+        };
+        if (!Util.trackFocusGained(frameButton, showAction, 2000, false)) {
+            System.out.println("Test error: wrong initial focus!");
+            return;
+        }
+
+        robot.keyPress(KeyEvent.VK_SPACE);
+        robot.delay(50);
+        robot.keyRelease(KeyEvent.VK_SPACE);
+
+        Util.waitForCondition(lock, 2000);
+        Util.waitForIdle(robot);
+    }
+}
+
+class TestKFM extends DefaultKeyboardFocusManager {
+    Robot robot;
+    public TestKFM(Robot robot) {
+        this.robot = robot;
+    }
+    protected synchronized void enqueueKeyEvents(long after, Component untilFocused) {
+        super.enqueueKeyEvents(after, untilFocused);
+        robot.keyPress(KeyEvent.VK_SPACE);
+        robot.delay(50);
+        robot.keyRelease(KeyEvent.VK_SPACE);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Focus/WrongKeyTypedConsumedTest/WrongKeyTypedConsumedTest.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,129 @@
+/*
+ * Copyright 2008 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.
+ *
+ * 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.
+ */
+
+/*
+  @test
+  @bug      4782886
+  @summary  FocusManager consumes wrong KEY_TYPED events
+  @author   Oleg.Sukhodolsky: area=awt.focus
+  @library  ../../regtesthelpers
+  @build    Util
+  @run      main WrongKeyTypedConsumedTest
+*/
+
+import java.applet.Applet;
+import java.awt.AWTException;
+import java.awt.AWTKeyStroke;
+import java.awt.BorderLayout;
+import java.awt.Dialog;
+import java.awt.Dimension;
+import java.awt.FlowLayout;
+import java.awt.Frame;
+import java.awt.KeyboardFocusManager;
+import java.awt.Point;
+import java.awt.Robot;
+import java.awt.TextArea;
+
+import java.awt.event.KeyEvent;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.swing.JCheckBox;
+import javax.swing.JFrame;
+import javax.swing.JTextArea;
+
+import test.java.awt.regtesthelpers.Util;
+
+public class WrongKeyTypedConsumedTest extends Applet
+{
+    Robot robot = Util.createRobot();
+
+    public static void main(String[] args) {
+        WrongKeyTypedConsumedTest test = new WrongKeyTypedConsumedTest();
+        test.start();
+    }
+
+    public void start ()
+    {
+        setSize (200,200);
+        setVisible(true);
+        validate();
+
+        JFrame frame = new JFrame("The Frame");
+        Set ftk = new HashSet();
+        ftk.add(AWTKeyStroke.getAWTKeyStroke(KeyEvent.VK_DOWN, 0));
+        frame.getContentPane().
+            setFocusTraversalKeys(KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS,
+                                  ftk);
+
+        JCheckBox checkbox = new JCheckBox("test");
+        frame.getContentPane().add(checkbox, BorderLayout.NORTH);
+
+        JTextArea textarea = new JTextArea(40, 10);
+        frame.getContentPane().add(textarea);
+
+        frame.pack();
+        frame.setVisible(true);
+        Util.waitForIdle(robot);
+
+        if (!frame.isActive()) {
+            throw new RuntimeException("Test Fialed: frame isn't active");
+        }
+
+        // verify if checkbox has focus
+        if (!checkbox.isFocusOwner()) {
+            checkbox.requestFocusInWindow();
+            Util.waitForIdle(robot);
+            if (!checkbox.isFocusOwner()) {
+                throw new RuntimeException("Test Failed: checkbox doesn't have focus");
+            }
+        }
+
+        // press VK_DOWN
+        robot.keyPress(KeyEvent.VK_DOWN);
+        robot.delay(50);
+        robot.keyRelease(KeyEvent.VK_DOWN);
+        robot.delay(50);
+
+        Util.waitForIdle(robot);
+
+        // verify if text area has focus
+        if (!textarea.isFocusOwner()) {
+            throw new RuntimeException("Test Failed: focus wasn't transfered to text area");
+        }
+        // press '1'
+        robot.keyPress(KeyEvent.VK_1);
+        robot.delay(50);
+        robot.keyRelease(KeyEvent.VK_1);
+        robot.delay(50);
+
+        Util.waitForIdle(robot);
+
+        // verify if KEY_TYPED arrived
+        if (!"1".equals(textarea.getText())) {
+            throw new RuntimeException("Test Failed: text area text is \"" + textarea.getText() + "\", not \"1\"");
+        }
+        System.out.println("Test Passed");
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Graphics2D/DrawString/AlphaSurfaceText.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,106 @@
+/*
+ * Copyright 2008 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.
+ *
+ * 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.
+ */
+
+/**
+ * @test
+ * @bug 6679308
+ * @summary test drawing to Alpha surfaces
+ */
+
+import java.awt.*;
+import java.awt.image.*;
+
+public class AlphaSurfaceText {
+
+    int wid=400, hgt=200;
+
+    public AlphaSurfaceText(int biType, Color c) {
+        BufferedImage opaquebi0 =
+           new BufferedImage(wid, hgt, BufferedImage.TYPE_INT_RGB);
+        drawText(opaquebi0, c);
+
+        BufferedImage alphabi = new BufferedImage(wid, hgt, biType);
+        drawText(alphabi, c);
+        BufferedImage opaquebi1 =
+           new BufferedImage(wid, hgt, BufferedImage.TYPE_INT_RGB);
+        Graphics2D g2d = opaquebi1.createGraphics();
+        g2d.drawImage(alphabi, 0, 0, null);
+        compare(opaquebi0, opaquebi1, biType, c);
+    }
+
+    private void drawText(BufferedImage bi, Color c) {
+        Graphics2D g = bi.createGraphics();
+        g.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,
+                           RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
+        g.setColor(c);
+        g.setFont(new Font("sansserif", Font.PLAIN, 70));
+        g.drawString("Hello!", 20, 100);
+        g.setFont(new Font("sansserif", Font.PLAIN, 12));
+        g.drawString("Hello!", 20, 130);
+        g.setFont(new Font("sansserif", Font.PLAIN, 10));
+        g.drawString("Hello!", 20, 150);
+    }
+
+    // Need to allow for minimal rounding error, so allow each component
+    // to differ by 1.
+    void compare(BufferedImage bi0, BufferedImage bi1, int biType, Color c) {
+        for (int x=0; x<wid; x++) {
+            for (int y=0; y<hgt; y++) {
+                int rgb0 = bi0.getRGB(x, y);
+                int rgb1 = bi1.getRGB(x, y);
+                if (rgb0 == rgb1) continue;
+                int r0 = (rgb0 & 0xff0000) >> 16;
+                int r1 = (rgb1 & 0xff0000) >> 16;
+                int rdiff = r0-r1; if (rdiff<0) rdiff = -rdiff;
+                int g0 = (rgb0 & 0x00ff00) >> 8;
+                int g1 = (rgb1 & 0x00ff00) >> 8;
+                int gdiff = g0-g1; if (gdiff<0) gdiff = -gdiff;
+                int b0 = (rgb0 & 0x0000ff);
+                int b1 = (rgb1 & 0x0000ff);
+                int bdiff = b0-b1; if (bdiff<0) bdiff = -bdiff;
+                if (rdiff > 1 || gdiff > 1 || bdiff > 1) {
+                    throw new RuntimeException(
+                      "Images differ for type "+biType + " col="+c +
+                      " at x=" + x + " y="+ y + " " +
+                      Integer.toHexString(rgb0) + " vs " +
+                      Integer.toHexString(rgb1));
+                }
+            }
+        }
+
+    }
+    public static void main(String[] args) {
+        new AlphaSurfaceText(BufferedImage.TYPE_INT_ARGB, Color.white);
+        new AlphaSurfaceText(BufferedImage.TYPE_INT_ARGB, Color.red);
+        new AlphaSurfaceText(BufferedImage.TYPE_INT_ARGB, Color.blue);
+        new AlphaSurfaceText(BufferedImage.TYPE_INT_ARGB_PRE, Color.white);
+        new AlphaSurfaceText(BufferedImage.TYPE_INT_ARGB_PRE, Color.red);
+        new AlphaSurfaceText(BufferedImage.TYPE_INT_ARGB_PRE, Color.blue);
+        new AlphaSurfaceText(BufferedImage.TYPE_4BYTE_ABGR, Color.white);
+        new AlphaSurfaceText(BufferedImage.TYPE_4BYTE_ABGR, Color.red);
+        new AlphaSurfaceText(BufferedImage.TYPE_4BYTE_ABGR, Color.blue);
+        new AlphaSurfaceText(BufferedImage.TYPE_4BYTE_ABGR_PRE, Color.white);
+        new AlphaSurfaceText(BufferedImage.TYPE_4BYTE_ABGR_PRE, Color.red);
+        new AlphaSurfaceText(BufferedImage.TYPE_4BYTE_ABGR_PRE, Color.blue);
+   }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Graphics2D/DrawString/DrawStrSuper.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,151 @@
+/*
+ * Copyright 2008 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.
+ *
+ * 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.
+ */
+
+/**
+ * @test
+ * @bug 6684056
+ * @summary Super-scripted text needs to be positioned the same with
+ *          drawString and TextLayout.
+ */
+import java.awt.*;
+import java.awt.event.*;
+import java.awt.font.*;
+import static java.awt.font.TextAttribute.*;
+import java.awt.geom.AffineTransform;
+import java.awt.image.BufferedImage;
+import java.util.HashMap;
+
+
+public class DrawStrSuper extends Component {
+
+    int angle = 0;
+    static boolean interactive = false;
+
+    int wid=400, hgt=400;
+    BufferedImage bi = null;
+
+    void paintImage() {
+
+        if (bi == null) {
+             bi = new BufferedImage(wid, hgt, BufferedImage.TYPE_INT_RGB);
+        }
+        Graphics2D g2d = bi.createGraphics();
+        g2d.setColor(Color.white);
+        g2d.fillRect(0, 0, wid, hgt);
+        g2d.translate(200, 200);
+
+        Font fnt = new Font("Arial", Font.PLAIN, 20);
+        fnt = fnt.deriveFont(60.0f);
+        HashMap attrMap = new HashMap();
+        AffineTransform aff =
+            AffineTransform.getRotateInstance(angle * Math.PI/180.0);
+        attrMap.put(SUPERSCRIPT, SUPERSCRIPT_SUPER);
+        attrMap.put(TRANSFORM, aff);
+        fnt = fnt.deriveFont(attrMap);
+
+        g2d.setFont(fnt);
+        g2d.setColor(Color.yellow);
+        TextLayout tl = new TextLayout("Text", fnt,g2d.getFontRenderContext());
+        g2d.fill(tl.getBounds());
+
+        g2d.setColor(Color.black);
+        g2d.drawLine(-3, 0, 3, 0);
+        g2d.drawLine(0, -3, 0, 3);
+
+        g2d.setColor(Color.blue);
+        g2d.drawString("Text", 0, 0);
+
+        g2d.setColor(Color.red);
+        tl.draw(g2d,0f,0f);
+
+        // Test BI: should be no blue
+        int blue = Color.blue.getRGB();
+        for (int px=0;px<wid;px++) {
+            for (int py=0;py<hgt;py++) {
+                int rgb = bi.getRGB(px, py);
+                if (rgb == blue) {
+                    throw new RuntimeException
+                        ("Unexpected color : " + Integer.toHexString(rgb) +
+                         " at x=" + px + " y="+ py);
+                }
+            }
+        }
+    }
+
+    @Override
+    public void paint(Graphics g) {
+        paintImage();
+        g.drawImage(bi, 0,0, null);
+    }
+
+
+    static class Runner extends Thread {
+
+        DrawStrSuper dss;
+
+        Runner(DrawStrSuper dss) {
+            this.dss = dss;
+        }
+
+        public void run() {
+            while (true) {
+                if (!interactive && dss.angle > 360) {
+                    return;
+                }
+                try {
+                    Thread.sleep(100);
+                } catch (InterruptedException e) {
+                    return;
+                }
+
+                dss.angle += 10;
+                dss.repaint();
+            }
+        }
+    }
+
+    @Override
+    public Dimension getPreferredSize() {
+        return new Dimension(400, 400);
+    }
+
+    public static void main(String argv[]) throws InterruptedException {
+        if (argv.length > 0) interactive = true;
+
+        Frame f = new Frame("Text bounds test");
+        f.addWindowListener(new WindowAdapter() {
+            @Override
+            public void windowClosing(WindowEvent e) {
+                System.exit(0);
+            }
+        });
+        DrawStrSuper dss = new DrawStrSuper();
+        f.add(dss, BorderLayout.CENTER);
+        f.pack();
+        f.setLocationRelativeTo(null);
+        f.setVisible(true);
+        Runner runner = new Runner(dss);
+        runner.start();
+        runner.join();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Graphics2D/DrawString/EmptyAttrString.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,58 @@
+/*
+ * Copyright 2008 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.
+ *
+ * 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.
+ */
+
+/**
+ * @test
+ * @bug 6699843
+ * @summary IllegalArgumentException when using Graphics.drawString( "", 0, 0 )
+ */
+
+import java.awt.*;
+import java.awt.font.*;
+import java.awt.image.*;
+import java.text.*;
+import java.util.*;
+
+public class EmptyAttrString {
+
+    public static void main(String[] args) {
+        BufferedImage bi =
+           new BufferedImage(100, 100, BufferedImage.TYPE_INT_RGB);
+        Graphics2D g = bi.createGraphics();
+        Font f = new Font( "Dialog", Font.PLAIN, 12 );
+        Map map = new HashMap();
+        map.put(TextAttribute.STRIKETHROUGH, TextAttribute.STRIKETHROUGH_ON);
+        f = f.deriveFont(map);
+        g.setFont(f);
+        g.drawString("", 50, 50);
+        g.drawString("", 50f, 50f);
+        char[] chs = { } ;
+        g.drawChars(chs, 0, 0, 50, 50);
+        byte[] bytes = { } ;
+        g.drawBytes(bytes, 0, 0, 50, 50);
+        AttributedString astr = new AttributedString("");
+        g.drawString(astr.getIterator(), 50, 50);
+        g.drawString(astr.getIterator(), 50f, 50f);
+        return;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Graphics2D/DrawString/RotTransText.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,108 @@
+/*
+ * Copyright 2008 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.
+ *
+ * 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.
+ */
+
+/**
+ * @test
+ * @bug 6683472 6687298
+ * @summary Transformed fonts using drawString and TextLayout should be in
+ *          the same position.
+ */
+
+import java.awt.*;
+import java.awt.font.*;
+import java.awt.geom.*;
+import java.awt.image.*;
+import java.util.HashMap;
+
+public class RotTransText  {
+
+    public static void main(String[] args) {
+
+        testIt(false);
+        testIt(true);
+
+    }
+
+    public static void testIt(boolean fmOn) {
+
+        int wid=400, hgt=400;
+        BufferedImage bi =
+            new BufferedImage(wid, hgt, BufferedImage.TYPE_INT_RGB);
+
+        Graphics2D g2d = bi.createGraphics();
+
+        if (fmOn) {
+            g2d.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS,
+                                 RenderingHints.VALUE_FRACTIONALMETRICS_ON);
+        }
+
+        int x=130, y=130;
+        String s = "Text";
+
+        int xt=90, yt=50;
+        for (int angle=0;angle<360;angle+=30) {
+
+            g2d.setColor(Color.white);
+            g2d.fillRect(0, 0, wid, hgt);
+
+            AffineTransform aff = AffineTransform.getTranslateInstance(50,90);
+            aff.rotate(angle * Math.PI/180.0);
+
+            Font fnt = new Font("SansSerif", Font.PLAIN, 60);
+            fnt = fnt.deriveFont(Font.PLAIN, aff);
+            g2d.setFont(fnt);
+            g2d.setColor(Color.blue);
+            g2d.drawString(s, x, y);
+
+            g2d.setColor(Color.red);
+            FontRenderContext frc = g2d.getFontRenderContext();
+            HashMap attrMap = new HashMap();
+            attrMap.put(TextAttribute.STRIKETHROUGH,
+                    TextAttribute.STRIKETHROUGH_ON);
+            fnt = fnt.deriveFont(attrMap);
+            TextLayout tl = new TextLayout(s, fnt, frc);
+            tl.draw(g2d, (float)x, (float)y);
+
+            // Test BI: should be minimal blue relative to red.
+            int redCount = 0;
+            int blueCount = 0;
+            int red = Color.red.getRGB();
+            int blue = Color.blue.getRGB();
+            for (int px=0;px<wid;px++) {
+                for (int py=0;py<hgt;py++) {
+                    int rgb = bi.getRGB(px, py);
+                    if (rgb == red) {
+                        redCount++;
+                    } else if (rgb == blue) {
+                        blueCount++;
+                    }
+                }
+            }
+            if (redCount == 0 || (blueCount/(double)redCount) > 0.1) {
+                throw new
+                    RuntimeException("Ratio of blue to red is too great: " +
+                                     (blueCount/(double)redCount));
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Graphics2D/DrawString/ScaledLCDTextMetrics.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,82 @@
+/*
+ * Copyright 2008 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.
+ *
+ * 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.
+ */
+
+/**
+ * @test
+ * @bug 6685312
+ * @summary Check advance of LCD text on a scaled graphics.
+ */
+
+import javax.swing.*;
+import java.awt.*;
+import static java.awt.RenderingHints.*;
+
+public class ScaledLCDTextMetrics extends Component {
+
+    public static void main(String[] args) {
+        JFrame f = new JFrame();
+        f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+        f.add("Center", new ScaledLCDTextMetrics());
+        f.pack();
+        f.setVisible(true);
+    }
+
+    public Dimension getPreferredSize() {
+      return new Dimension(200,100);
+    }
+    public void paint(Graphics g) {
+       Graphics2D g2 = (Graphics2D)g;
+
+       Font f = new Font("Tahoma", Font.PLAIN, 11);
+       g.setFont(f);
+       g.setColor(Color.white);
+       g.fillRect(0,0,400,300);
+       g.setColor(Color.black);
+       g2.setRenderingHint(KEY_TEXT_ANTIALIASING,VALUE_TEXT_ANTIALIAS_LCD_HRGB);
+       String text = "ABCDEFGHIJKLI";
+
+       FontMetrics fm1 = g2.getFontMetrics();
+       int adv1 = fm1.stringWidth(text);
+       g.drawString(text, 5, 20);
+
+       g2.scale(2,2);
+
+       FontMetrics fm2 = g2.getFontMetrics();
+       int adv2 = fm2.stringWidth(text);
+       g.drawString(text, 5, 40);
+
+       double frac = Math.abs(adv1/(double)adv2);
+
+       System.out.println("scalex1: " + adv1);
+       System.out.println("scalex2: " + adv2);
+       System.out.println("Fraction : "+ frac);
+
+       // adv1 will not be exactly the same as adv2, but should differ
+       // only by a fraction.
+
+       if (frac < 0.8 || frac > 1.2) {
+           throw new RuntimeException("Metrics differ " +
+           "Adv1="+adv1+" Adv2="+adv2+" Fraction="+frac);
+       }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Insets/WindowWithWarningTest/WindowWithWarningTest.html	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,20 @@
+<html>
+<!--
+        @test
+        @bug 6391770
+        @summary Content of the Window should be laid out in the area left after WarningWindow was added.
+        @author Yuri Nesterenko
+        @run applet WindowWithWarningTest.html
+-->
+
+  <head>
+    <title>WindowWithWarningTest</title>
+  </head>
+  <pre>
+  This test will run automatically.
+  </pre>
+  <body>
+    <applet code="WindowWithWarningTest.class" width=350 height=300></applet>
+  </body>
+</html>
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Insets/WindowWithWarningTest/WindowWithWarningTest.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,315 @@
+/*
+ * Copyright 2006-2008 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.
+ *
+ * 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.
+ */
+
+
+/*
+  test
+  @bug 6391770
+  @summary Content of the Window should be laid out in the area left after WarningWindow was added.
+  @author yuri nesterenko: area=
+  @run applet WindowWithWarningTest.html
+*/
+
+// Note there is no @ in front of test above.  This is so that the
+//  harness will not mistake this file as a test file.  It should
+//  only see the html file as a test file. (the harness runs all
+//  valid test files, so it would run this test twice if this file
+//  were valid as well as the html file.)
+// Also, note the area= after Your Name in the author tag.  Here, you
+//  should put which functional area the test falls in.  See the
+//  AWT-core home page -> test areas and/or -> AWT team  for a list of
+//  areas.
+// Note also the 'AutomaticAppletTest.html' in the run tag.  This should
+//  be changed to the name of the test.
+
+
+/**
+ * WindowWithWarningTest.java
+ *
+ * summary:
+ */
+
+import java.applet.Applet;
+import java.awt.*;
+import java.awt.event.*;
+import javax.swing.*;
+
+//Automated tests should run as applet tests if possible because they
+// get their environments cleaned up, including AWT threads, any
+// test created threads, and any system resources used by the test
+// such as file descriptors.  (This is normally not a problem as
+// main tests usually run in a separate VM, however on some platforms
+// such as the Mac, separate VMs are not possible and non-applet
+// tests will cause problems).  Also, you don't have to worry about
+// synchronisation stuff in Applet tests they way you do in main
+// tests...
+
+
+public class WindowWithWarningTest extends Applet
+{
+    //Declare things used in the test, like buttons and labels here
+    boolean buttonClicked = false;
+    public static final int MAX_COUNT = 100;
+
+    public void init()
+    {
+        //Create instructions for the user here, as well as set up
+        // the environment -- set the layout manager, add buttons,
+        // etc.
+
+        this.setLayout (new BorderLayout ());
+
+        String[] instructions =
+        {
+            "This is an AUTOMATIC test",
+            "simply wait until it is done"
+        };
+        //Sysout.createDialog( );
+        //Sysout.printInstructions( instructions );
+
+    }//End  init()
+    public void start ()
+    {
+        //Get things going.  Request focus, set size, et cetera
+        System.setSecurityManager( new SecurityManager() {
+        // deny AWTPermission("showWindowWithoutWarningBanner")
+            public boolean checkTopLevelWindow(Object window) {
+                return false;
+            }
+         });
+        JFrame frame = new JFrame("Window Test");
+        frame.setBounds(50, 50, 200, 200);
+        frame.show();
+
+        JWindow window = new JWindow( frame );
+        JButton jbutton1 = new JButton( "First" );
+        jbutton1.addMouseListener( new MouseAdapter() {
+            public void mousePressed( MouseEvent me ) {
+                buttonClicked = true;
+            }
+         });
+        JButton jbutton2 = new JButton( "Second" );
+        window.setLocation( 300, 300 );
+
+        window.add("North", jbutton1);
+        window.add("South", jbutton2);
+
+        window.pack();
+        window.show();
+        //wait for frame to show:
+        getLocation( frame );
+        window.toFront();
+
+        Dimension size0 = window.getSize();
+        Dimension size1 = null;
+        try {
+            Robot robot = new Robot();
+
+            robot.delay(500);
+            window.pack();
+            robot.delay(500);
+            window.pack();
+            // size1 must be the same as size0
+            size1 = window.getSize();
+            robot.delay(500);
+            Point pt = jbutton1.getLocationOnScreen();
+            robot.mouseMove((int) jbutton1.getLocationOnScreen().x + jbutton1.getWidth() / 2,
+                            (int) jbutton1.getLocationOnScreen().y + jbutton1.getHeight() / 2);
+            robot.delay(500);
+            robot.mousePress(MouseEvent.BUTTON1_MASK);
+            robot.delay(100);
+            robot.mouseRelease(MouseEvent.BUTTON1_MASK);
+            robot.delay(2000);
+         }catch(Exception e) {
+            throw new RuntimeException( "Exception "+e );
+         }
+         if( !size0.equals(size1) ) {
+            throw new RuntimeException( "Wrong Window size after multiple pack()s");
+         }
+         if( !buttonClicked ) {
+            throw new RuntimeException( "Button was not clicked");
+         }
+         window.dispose();
+         frame.dispose();
+
+         System.out.println("Test Passed.");
+    }// start()
+    public static Point getLocation( Component co ) throws RuntimeException {
+       Point pt = null;
+       boolean bFound = false;
+       int count = 0;
+       while( !bFound ) {
+          try {
+             pt = co.getLocationOnScreen();
+             bFound = true;
+          }catch( Exception ex ) {
+             bFound = false;
+             count++;
+          }
+          if( !bFound && count > MAX_COUNT ) {
+             throw new RuntimeException("don't see a component to get location");
+          }
+       }
+       return pt;
+    }
+
+
+}// class AutomaticAppletTest
+
+
+/****************************************************
+ Standard Test Machinery
+ DO NOT modify anything below -- it's a standard
+  chunk of code whose purpose is to make user
+  interaction uniform, and thereby make it simpler
+  to read and understand someone else's test.
+ ****************************************************/
+
+/**
+ This is part of the standard test machinery.
+ It creates a dialog (with the instructions), and is the interface
+  for sending text messages to the user.
+ To print the instructions, send an array of strings to Sysout.createDialog
+  WithInstructions method.  Put one line of instructions per array entry.
+ To display a message for the tester to see, simply call Sysout.println
+  with the string to be displayed.
+ This mimics System.out.println but works within the test harness as well
+  as standalone.
+ */
+
+class Sysout
+{
+    private static TestDialog dialog;
+
+    public static void createDialogWithInstructions( String[] instructions )
+    {
+        dialog = new TestDialog( new Frame(), "Instructions" );
+        dialog.printInstructions( instructions );
+        dialog.setVisible(true);
+        println( "Any messages for the tester will display here." );
+    }
+
+    public static void createDialog( )
+    {
+        dialog = new TestDialog( new Frame(), "Instructions" );
+        String[] defInstr = { "Instructions will appear here. ", "" } ;
+        dialog.printInstructions( defInstr );
+        dialog.setVisible(true);
+        println( "Any messages for the tester will display here." );
+    }
+
+
+    public static void printInstructions( String[] instructions )
+    {
+        dialog.printInstructions( instructions );
+    }
+
+
+    public static void println( String messageIn )
+    {
+        dialog.displayMessage( messageIn );
+    }
+
+}// Sysout  class
+
+/**
+  This is part of the standard test machinery.  It provides a place for the
+   test instructions to be displayed, and a place for interactive messages
+   to the user to be displayed.
+  To have the test instructions displayed, see Sysout.
+  To have a message to the user be displayed, see Sysout.
+  Do not call anything in this dialog directly.
+  */
+class TestDialog extends Dialog
+{
+
+    TextArea instructionsText;
+    TextArea messageText;
+    int maxStringLength = 80;
+
+    //DO NOT call this directly, go through Sysout
+    public TestDialog( Frame frame, String name )
+    {
+        super( frame, name );
+        int scrollBoth = TextArea.SCROLLBARS_BOTH;
+        instructionsText = new TextArea( "", 15, maxStringLength, scrollBoth );
+        add( "North", instructionsText );
+
+        messageText = new TextArea( "", 5, maxStringLength, scrollBoth );
+        add("Center", messageText);
+
+        pack();
+
+        show();
+    }// TestDialog()
+
+    //DO NOT call this directly, go through Sysout
+    public void printInstructions( String[] instructions )
+    {
+        //Clear out any current instructions
+        instructionsText.setText( "" );
+
+        //Go down array of instruction strings
+
+        String printStr, remainingStr;
+        for( int i=0; i < instructions.length; i++ )
+        {
+            //chop up each into pieces maxSringLength long
+            remainingStr = instructions[ i ];
+            while( remainingStr.length() > 0 )
+            {
+                //if longer than max then chop off first max chars to print
+                if( remainingStr.length() >= maxStringLength )
+                {
+                    //Try to chop on a word boundary
+                    int posOfSpace = remainingStr.
+                        lastIndexOf( ' ', maxStringLength - 1 );
+
+                    if( posOfSpace <= 0 ) posOfSpace = maxStringLength - 1;
+
+                    printStr = remainingStr.substring( 0, posOfSpace + 1 );
+                    remainingStr = remainingStr.substring( posOfSpace + 1 );
+                }
+                //else just print
+                else
+                {
+                    printStr = remainingStr;
+                    remainingStr = "";
+                }
+
+                instructionsText.append( printStr + "\n" );
+
+            }// while
+
+        }// for
+
+    }//printInstructions()
+
+    //DO NOT call this directly, go through Sysout
+    public void displayMessage( String messageIn )
+    {
+        messageText.append( messageIn + "\n" );
+        System.out.println(messageIn);
+    }
+
+}// TestDialog  class
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/List/ListFlickers/ListFlickers.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,402 @@
+/*
+ * Copyright 2008 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.
+ *
+ * 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.
+ */
+
+/*
+  @test
+  @bug 6471693
+  @summary Moving the vertical scroll bar of List leads flickering.
+  @author Dmitry Cherepanov area=awt.list
+  @run main/manual ListFlickers
+*/
+
+import java.awt.*;
+import java.awt.event.*;
+
+public class ListFlickers
+{
+
+    //*** test-writer defined static variables go here ***
+
+
+    private static void init()
+    {
+        //*** Create instructions for the user here ***
+
+        String[] instructions =
+        {
+            "drag the scrollbar of the list up and down,",
+            "if the list flickers then the test fails,",
+            "otherwise it passes."
+        };
+        Sysout.createDialog( );
+        Sysout.printInstructions( instructions );
+
+
+        Frame f = new Frame();
+        List list = new List(10, false);
+        for (int i = 0; i < 100; i++) {
+            list.add(" item "+i);
+        }
+        f.add(list);
+        f.setBounds(100,100,300,300);
+        f.setVisible(true);
+
+    }//End  init()
+
+
+
+    /*****************************************************
+     * Standard Test Machinery Section
+     * DO NOT modify anything in this section -- it's a
+     * standard chunk of code which has all of the
+     * synchronisation necessary for the test harness.
+     * By keeping it the same in all tests, it is easier
+     * to read and understand someone else's test, as
+     * well as insuring that all tests behave correctly
+     * with the test harness.
+     * There is a section following this for test-defined
+     * classes
+     ******************************************************/
+    private static boolean theTestPassed = false;
+    private static boolean testGeneratedInterrupt = false;
+    private static String failureMessage = "";
+
+    private static Thread mainThread = null;
+
+    private static int sleepTime = 300000;
+
+    public static void main( String args[] ) throws InterruptedException
+    {
+        mainThread = Thread.currentThread();
+        try
+        {
+            init();
+        }
+        catch( TestPassedException e )
+        {
+            //The test passed, so just return from main and harness will
+            // interepret this return as a pass
+            return;
+        }
+        //At this point, neither test passed nor test failed has been
+        // called -- either would have thrown an exception and ended the
+        // test, so we know we have multiple threads.
+
+        //Test involves other threads, so sleep and wait for them to
+        // called pass() or fail()
+        try
+        {
+            Thread.sleep( sleepTime );
+            //Timed out, so fail the test
+            throw new RuntimeException( "Timed out after " + sleepTime/1000 + " seconds" );
+        }
+        catch (InterruptedException e)
+        {
+            if( ! testGeneratedInterrupt ) throw e;
+
+            //reset flag in case hit this code more than once for some reason (just safety)
+            testGeneratedInterrupt = false;
+            if ( theTestPassed == false )
+            {
+                throw new RuntimeException( failureMessage );
+            }
+        }
+
+    }//main
+
+    public static synchronized void setTimeoutTo( int seconds )
+    {
+        sleepTime = seconds * 1000;
+    }
+
+    public static synchronized void pass()
+    {
+        Sysout.println( "The test passed." );
+        Sysout.println( "The test is over, hit  Ctl-C to stop Java VM" );
+        //first check if this is executing in main thread
+        if ( mainThread == Thread.currentThread() )
+        {
+            //Still in the main thread, so set the flag just for kicks,
+            // and throw a test passed exception which will be caught
+            // and end the test.
+            theTestPassed = true;
+            throw new TestPassedException();
+        }
+        //pass was called from a different thread, so set the flag and interrupt
+        // the main thead.
+        theTestPassed = true;
+        testGeneratedInterrupt = true;
+        if (mainThread != null){
+            mainThread.interrupt();
+        }
+    }//pass()
+
+    public static synchronized void fail()
+    {
+        //test writer didn't specify why test failed, so give generic
+        fail( "it just plain failed! :-)" );
+    }
+
+    public static synchronized void fail( String whyFailed )
+    {
+        Sysout.println( "The test failed: " + whyFailed );
+        Sysout.println( "The test is over, hit  Ctl-C to stop Java VM" );
+        //check if this called from main thread
+        if ( mainThread == Thread.currentThread() )
+        {
+            //If main thread, fail now 'cause not sleeping
+            throw new RuntimeException( whyFailed );
+        }
+        theTestPassed = false;
+        testGeneratedInterrupt = true;
+        failureMessage = whyFailed;
+        mainThread.interrupt();
+    }//fail()
+
+}// class ManualMainTest
+
+//This exception is used to exit from any level of call nesting
+// when it's determined that the test has passed, and immediately
+// end the test.
+class TestPassedException extends RuntimeException
+{
+}
+
+//*********** End Standard Test Machinery Section **********
+
+
+//************ Begin classes defined for the test ****************
+
+// make listeners in a class defined here, and instantiate them in init()
+
+/* Example of a class which may be written as part of a test
+class NewClass implements anInterface
+ {
+   static int newVar = 0;
+
+   public void eventDispatched(AWTEvent e)
+    {
+      //Counting events to see if we get enough
+      eventCount++;
+
+      if( eventCount == 20 )
+       {
+         //got enough events, so pass
+
+         ManualMainTest.pass();
+       }
+      else if( tries == 20 )
+       {
+         //tried too many times without getting enough events so fail
+
+         ManualMainTest.fail();
+       }
+
+    }// eventDispatched()
+
+ }// NewClass class
+
+*/
+
+
+//************** End classes defined for the test *******************
+
+
+
+
+/****************************************************
+ Standard Test Machinery
+ DO NOT modify anything below -- it's a standard
+  chunk of code whose purpose is to make user
+  interaction uniform, and thereby make it simpler
+  to read and understand someone else's test.
+ ****************************************************/
+
+/**
+ This is part of the standard test machinery.
+ It creates a dialog (with the instructions), and is the interface
+  for sending text messages to the user.
+ To print the instructions, send an array of strings to Sysout.createDialog
+  WithInstructions method.  Put one line of instructions per array entry.
+ To display a message for the tester to see, simply call Sysout.println
+  with the string to be displayed.
+ This mimics System.out.println but works within the test harness as well
+  as standalone.
+ */
+
+class Sysout
+{
+    private static TestDialog dialog;
+    private static boolean numbering = false;
+    private static int messageNumber = 0;
+
+    public static void createDialogWithInstructions( String[] instructions )
+    {
+        dialog = new TestDialog( new Frame(), "Instructions" );
+        dialog.printInstructions( instructions );
+        dialog.setVisible(true);
+        println( "Any messages for the tester will display here." );
+    }
+
+    public static void createDialog( )
+    {
+        dialog = new TestDialog( new Frame(), "Instructions" );
+        String[] defInstr = { "Instructions will appear here. ", "" } ;
+        dialog.printInstructions( defInstr );
+        dialog.setVisible(true);
+        println( "Any messages for the tester will display here." );
+    }
+
+
+    /* Enables message counting for the tester. */
+    public static void enableNumbering(boolean enable){
+        numbering = enable;
+    }
+
+    public static void printInstructions( String[] instructions )
+    {
+        dialog.printInstructions( instructions );
+    }
+
+
+    public static void println( String messageIn )
+    {
+        if (numbering) {
+            messageIn = "" + messageNumber + " " + messageIn;
+            messageNumber++;
+        }
+        dialog.displayMessage( messageIn );
+    }
+
+}// Sysout  class
+
+/**
+  This is part of the standard test machinery.  It provides a place for the
+   test instructions to be displayed, and a place for interactive messages
+   to the user to be displayed.
+  To have the test instructions displayed, see Sysout.
+  To have a message to the user be displayed, see Sysout.
+  Do not call anything in this dialog directly.
+  */
+class TestDialog extends Dialog implements ActionListener
+{
+
+    TextArea instructionsText;
+    TextArea messageText;
+    int maxStringLength = 80;
+    Panel  buttonP = new Panel();
+    Button passB = new Button( "pass" );
+    Button failB = new Button( "fail" );
+
+    //DO NOT call this directly, go through Sysout
+    public TestDialog( Frame frame, String name )
+    {
+        super( frame, name );
+        int scrollBoth = TextArea.SCROLLBARS_BOTH;
+        instructionsText = new TextArea( "", 15, maxStringLength, scrollBoth );
+        add( "North", instructionsText );
+
+        messageText = new TextArea( "", 5, maxStringLength, scrollBoth );
+        add("Center", messageText);
+
+        passB = new Button( "pass" );
+        passB.setActionCommand( "pass" );
+        passB.addActionListener( this );
+        buttonP.add( "East", passB );
+
+        failB = new Button( "fail" );
+        failB.setActionCommand( "fail" );
+        failB.addActionListener( this );
+        buttonP.add( "West", failB );
+
+        add( "South", buttonP );
+        pack();
+
+        setVisible(true);
+    }// TestDialog()
+
+    //DO NOT call this directly, go through Sysout
+    public void printInstructions( String[] instructions )
+    {
+        //Clear out any current instructions
+        instructionsText.setText( "" );
+
+        //Go down array of instruction strings
+
+        String printStr, remainingStr;
+        for( int i=0; i < instructions.length; i++ )
+        {
+            //chop up each into pieces maxSringLength long
+            remainingStr = instructions[ i ];
+            while( remainingStr.length() > 0 )
+            {
+                //if longer than max then chop off first max chars to print
+                if( remainingStr.length() >= maxStringLength )
+                {
+                    //Try to chop on a word boundary
+                    int posOfSpace = remainingStr.
+                        lastIndexOf( ' ', maxStringLength - 1 );
+
+                    if( posOfSpace <= 0 ) posOfSpace = maxStringLength - 1;
+
+                    printStr = remainingStr.substring( 0, posOfSpace + 1 );
+                    remainingStr = remainingStr.substring( posOfSpace + 1 );
+                }
+                //else just print
+                else
+                {
+                    printStr = remainingStr;
+                    remainingStr = "";
+                }
+
+                instructionsText.append( printStr + "\n" );
+
+            }// while
+
+        }// for
+
+    }//printInstructions()
+
+    //DO NOT call this directly, go through Sysout
+    public void displayMessage( String messageIn )
+    {
+        messageText.append( messageIn + "\n" );
+        System.out.println(messageIn);
+    }
+
+    //catch presses of the passed and failed buttons.
+    //simply call the standard pass() or fail() static methods of
+    //ManualMainTest
+    public void actionPerformed( ActionEvent e )
+    {
+        if( e.getActionCommand() == "pass" )
+        {
+            ListFlickers.pass();
+        }
+        else
+        {
+            ListFlickers.fail();
+        }
+    }
+
+}// TestDialog  class
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/TextField/ScrollSelectionTest/ScrollSelectionTest.html	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,20 @@
+<html>
+<!--  
+  @test
+  @bug 4118621
+  @summary tests that selected text isn't scrolled if there is enough room.
+  @author prs: area=TextField
+  @run applet/manual=yesno ScrollSelectionTest.html
+  -->
+<head>
+<title> ScrollSelectionTest </title>
+</head>
+<body>
+
+<h1>ScrollSelectionTest<br>4118621: </h1>
+
+<p> See the dialog box (usually in upper left corner) for instructions</p>
+
+<APPLET CODE="ScrollSelectionTest.class" WIDTH=300 HEIGHT=300></APPLET>
+</body>
+</html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/TextField/ScrollSelectionTest/ScrollSelectionTest.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,213 @@
+/*
+ * Copyright 1999-2008 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.
+ *
+ * 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.
+ */
+
+/*
+  test
+  @bug 4118621
+  @summary tests that selected text isn't scrolled when there is enough room.
+  @author prs: area=TextField
+  @run applet/manual=yesno ScrollSelectionTest.html
+*/
+
+/**
+ * ScrollSelectionTest.java
+ *
+ * summary: tests that selected text isn't scrolled when there is enough room.
+ */
+
+import java.applet.Applet;
+import java.awt.Dialog;
+import java.awt.Frame;
+import java.awt.TextField;
+import java.awt.TextArea;
+
+public class ScrollSelectionTest extends Applet
+ {
+
+   Frame frame = new Frame("ScrollSelectionTest frame");
+   TextField tf = new TextField(40);
+
+   public void init()
+    {
+      tf.setText("abcdefghijklmnopqrstuvwxyz");
+      frame.add(tf);
+      tf.select(0, 20);
+
+      String[] instructions =
+       {
+          "INSTRUCTIONS:",
+          "This is a test for a win32 specific problem",
+          "If you see all the letters from 'a' to 'z' and",
+          "letters from 'a' to 't' are selected then test passes"
+       };
+      Sysout.createDialogWithInstructions( instructions );
+
+    }// init()
+
+   public void start ()
+    {
+      setSize (300,300);
+      setVisible(true);
+
+      frame.setVisible(true);
+      frame.setBounds (400, 0, 300, 300);
+
+    }// start()
+
+ }// class ScrollSelectionTest
+
+/****************************************************
+ Standard Test Machinery
+ DO NOT modify anything below -- it's a standard
+  chunk of code whose purpose is to make user
+  interaction uniform, and thereby make it simpler
+  to read and understand someone else's test.
+ ****************************************************/
+
+/**
+ This is part of the standard test machinery.
+ It creates a dialog (with the instructions), and is the interface
+  for sending text messages to the user.
+ To print the instructions, send an array of strings to Sysout.createDialog
+  WithInstructions method.  Put one line of instructions per array entry.
+ To display a message for the tester to see, simply call Sysout.println
+  with the string to be displayed.
+ This mimics System.out.println but works within the test harness as well
+  as standalone.
+ */
+
+class Sysout
+ {
+   private static TestDialog dialog;
+
+   public static void createDialogWithInstructions( String[] instructions )
+    {
+      dialog = new TestDialog( new Frame(), "Instructions" );
+      dialog.printInstructions( instructions );
+      dialog.show();
+      println( "Any messages for the tester will display here." );
+    }
+
+   public static void createDialog( )
+    {
+      dialog = new TestDialog( new Frame(), "Instructions" );
+      String[] defInstr = { "Instructions will appear here. ", "" } ;
+      dialog.printInstructions( defInstr );
+      dialog.show();
+      println( "Any messages for the tester will display here." );
+    }
+
+
+   public static void printInstructions( String[] instructions )
+    {
+      dialog.printInstructions( instructions );
+    }
+
+
+   public static void println( String messageIn )
+    {
+      dialog.displayMessage( messageIn );
+    }
+
+ }// Sysout  class
+
+/**
+  This is part of the standard test machinery.  It provides a place for the
+   test instructions to be displayed, and a place for interactive messages
+   to the user to be displayed.
+  To have the test instructions displayed, see Sysout.
+  To have a message to the user be displayed, see Sysout.
+  Do not call anything in this dialog directly.
+  */
+class TestDialog extends Dialog
+ {
+
+   TextArea instructionsText;
+   TextArea messageText;
+   int maxStringLength = 80;
+
+   //DO NOT call this directly, go through Sysout
+   public TestDialog( Frame frame, String name )
+    {
+      super( frame, name );
+      int scrollBoth = TextArea.SCROLLBARS_BOTH;
+      instructionsText = new TextArea( "", 15, maxStringLength, scrollBoth );
+      add( "North", instructionsText );
+
+      messageText = new TextArea( "", 5, maxStringLength, scrollBoth );
+      add("South", messageText);
+
+      pack();
+
+      show();
+    }// TestDialog()
+
+   //DO NOT call this directly, go through Sysout
+   public void printInstructions( String[] instructions )
+    {
+      //Clear out any current instructions
+      instructionsText.setText( "" );
+
+      //Go down array of instruction strings
+
+      String printStr, remainingStr;
+      for( int i=0; i < instructions.length; i++ )
+       {
+         //chop up each into pieces maxSringLength long
+         remainingStr = instructions[ i ];
+         while( remainingStr.length() > 0 )
+          {
+            //if longer than max then chop off first max chars to print
+            if( remainingStr.length() >= maxStringLength )
+             {
+               //Try to chop on a word boundary
+               int posOfSpace = remainingStr.
+                  lastIndexOf( ' ', maxStringLength - 1 );
+
+               if( posOfSpace <= 0 ) posOfSpace = maxStringLength - 1;
+
+               printStr = remainingStr.substring( 0, posOfSpace + 1 );
+               remainingStr = remainingStr.substring( posOfSpace + 1 );
+             }
+            //else just print
+            else
+             {
+               printStr = remainingStr;
+               remainingStr = "";
+             }
+
+            instructionsText.append( printStr + "\n" );
+
+          }// while
+
+       }// for
+
+    }//printInstructions()
+
+   //DO NOT call this directly, go through Sysout
+   public void displayMessage( String messageIn )
+    {
+      messageText.append( messageIn + "\n" );
+    }
+
+ }// TestDialog  class
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/Window/PropertyChangeListenerLockSerialization/PropertyChangeListenerLockSerialization.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,402 @@
+/*
+ * Copyright 2008 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.
+ *
+ * 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.
+ */
+
+/*
+  @test
+  @bug 6681889
+  @summary Showing a deserialized frame should not throw NPE
+  @author anthony.petrov@...: area=awt.toplevel
+  @run main PropertyChangeListenerLockSerialization
+*/
+
+
+/**
+ * PropertyChangeListenerLockSerialization.java
+ *
+ * summary: Showing a deserialized frame should not throw NPE
+ */
+
+import java.awt.*;
+import java.awt.event.*;
+import java.io.*;
+import java.net.*;
+
+public class PropertyChangeListenerLockSerialization
+{
+
+    private static void init()
+    {
+        //*** Create instructions for the user here ***
+
+        String[] instructions =
+        {
+            "This is an AUTOMATIC test, simply wait until it is done.",
+            "The result (passed or failed) will be shown in the",
+            "message window below."
+        };
+        Sysout.createDialog( );
+        Sysout.printInstructions( instructions );
+
+        File file =
+            new File(System.getProperty("test.classes", "."), "frame.ser");
+
+        Frame f = new Frame("Frame");
+        f.setBounds(250, 50, 300, 300);
+        try {
+            OutputStream o = new FileOutputStream(file);
+            ObjectOutputStream oo = new ObjectOutputStream(o);
+
+            oo.writeObject(f);
+            oo.close();
+        } catch (IOException ex) {
+            ex.printStackTrace();
+            fail("Unable to serialize the frame: " + ex);
+        }
+
+        // Cleanup the frame
+        f.dispose();
+        f = null;
+
+        try {
+            ObjectInputStream i = new ObjectInputStream(new FileInputStream(file));
+
+            f = (Frame)i.readObject();
+            f.show();
+        } catch (NullPointerException ex) {
+            ex.printStackTrace();
+            fail("The NullPointerException has been thrown: " + ex);
+        } catch (Exception ex) {
+            ex.printStackTrace();
+            fail("Error while deserializing the frame: " + ex);
+        }
+
+        // Cleanup the frame
+        f.dispose();
+        f = null;
+
+        pass();
+
+    }//End  init()
+
+
+
+    /*****************************************************
+     * Standard Test Machinery Section
+     * DO NOT modify anything in this section -- it's a
+     * standard chunk of code which has all of the
+     * synchronisation necessary for the test harness.
+     * By keeping it the same in all tests, it is easier
+     * to read and understand someone else's test, as
+     * well as insuring that all tests behave correctly
+     * with the test harness.
+     * There is a section following this for test-
+     * classes
+     ******************************************************/
+    private static boolean theTestPassed = false;
+    private static boolean testGeneratedInterrupt = false;
+    private static String failureMessage = "";
+
+    private static Thread mainThread = null;
+
+    private static int sleepTime = 300000;
+
+    // Not sure about what happens if multiple of this test are
+    //  instantiated in the same VM.  Being static (and using
+    //  static vars), it aint gonna work.  Not worrying about
+    //  it for now.
+    public static void main( String args[] ) throws InterruptedException
+    {
+        mainThread = Thread.currentThread();
+        try
+        {
+            init();
+        }
+        catch( TestPassedException e )
+        {
+            //The test passed, so just return from main and harness will
+            // interepret this return as a pass
+            return;
+        }
+        //At this point, neither test pass nor test fail has been
+        // called -- either would have thrown an exception and ended the
+        // test, so we know we have multiple threads.
+
+        //Test involves other threads, so sleep and wait for them to
+        // called pass() or fail()
+        try
+        {
+            Thread.sleep( sleepTime );
+            //Timed out, so fail the test
+            throw new RuntimeException( "Timed out after " + sleepTime/1000 + " seconds" );
+        }
+        catch (InterruptedException e)
+        {
+            //The test harness may have interrupted the test.  If so, rethrow the exception
+            // so that the harness gets it and deals with it.
+            if( ! testGeneratedInterrupt ) throw e;
+
+            //reset flag in case hit this code more than once for some reason (just safety)
+            testGeneratedInterrupt = false;
+
+            if ( theTestPassed == false )
+            {
+                throw new RuntimeException( failureMessage );
+            }
+        }
+
+    }//main
+
+    public static synchronized void setTimeoutTo( int seconds )
+    {
+        sleepTime = seconds * 1000;
+    }
+
+    public static synchronized void pass()
+    {
+        Sysout.println( "The test passed." );
+        Sysout.println( "The test is over, hit  Ctl-C to stop Java VM" );
+        //first check if this is executing in main thread
+        if ( mainThread == Thread.currentThread() )
+        {
+            //Still in the main thread, so set the flag just for kicks,
+            // and throw a test passed exception which will be caught
+            // and end the test.
+            theTestPassed = true;
+            throw new TestPassedException();
+        }
+        theTestPassed = true;
+        testGeneratedInterrupt = true;
+        mainThread.interrupt();
+    }//pass()
+
+    public static synchronized void fail()
+    {
+        //test writer didn't specify why test failed, so give generic
+        fail( "it just plain failed! :-)" );
+    }
+
+    public static synchronized void fail( String whyFailed )
+    {
+        Sysout.println( "The test failed: " + whyFailed );
+        Sysout.println( "The test is over, hit  Ctl-C to stop Java VM" );
+        //check if this called from main thread
+        if ( mainThread == Thread.currentThread() )
+        {
+            //If main thread, fail now 'cause not sleeping
+            throw new RuntimeException( whyFailed );
+        }
+        theTestPassed = false;
+        testGeneratedInterrupt = true;
+        failureMessage = whyFailed;
+        mainThread.interrupt();
+    }//fail()
+
+}// class PropertyChangeListenerLockSerialization
+
+//This exception is used to exit from any level of call nesting
+// when it's determined that the test has passed, and immediately
+// end the test.
+class TestPassedException extends RuntimeException
+{
+}
+
+//*********** End Standard Test Machinery Section **********
+
+
+//************ Begin classes defined for the test ****************
+
+// if want to make listeners, here is the recommended place for them, then instantiate
+//  them in init()
+
+/* Example of a class which may be written as part of a test
+class NewClass implements anInterface
+ {
+   static int newVar = 0;
+
+   public void eventDispatched(AWTEvent e)
+    {
+      //Counting events to see if we get enough
+      eventCount++;
+
+      if( eventCount == 20 )
+       {
+         //got enough events, so pass
+
+         PropertyChangeListenerLockSerialization.pass();
+       }
+      else if( tries == 20 )
+       {
+         //tried too many times without getting enough events so fail
+
+         PropertyChangeListenerLockSerialization.fail();
+       }
+
+    }// eventDispatched()
+
+ }// NewClass class
+
+*/
+
+
+//************** End classes defined for the test *******************
+
+
+
+
+/****************************************************
+ Standard Test Machinery
+ DO NOT modify anything below -- it's a standard
+  chunk of code whose purpose is to make user
+  interaction uniform, and thereby make it simpler
+  to read and understand someone else's test.
+ ****************************************************/
+
+/**
+ This is part of the standard test machinery.
+ It creates a dialog (with the instructions), and is the interface
+  for sending text messages to the user.
+ To print the instructions, send an array of strings to Sysout.createDialog
+  WithInstructions method.  Put one line of instructions per array entry.
+ To display a message for the tester to see, simply call Sysout.println
+  with the string to be displayed.
+ This mimics System.out.println but works within the test harness as well
+  as standalone.
+ */
+
+class Sysout
+{
+    private static TestDialog dialog;
+
+    public static void createDialogWithInstructions( String[] instructions )
+    {
+        dialog = new TestDialog( new Frame(), "Instructions" );
+        dialog.printInstructions( instructions );
+        dialog.setVisible(true);
+        println( "Any messages for the tester will display here." );
+    }
+
+    public static void createDialog( )
+    {
+        dialog = new TestDialog( new Frame(), "Instructions" );
+        String[] defInstr = { "Instructions will appear here. ", "" } ;
+        dialog.printInstructions( defInstr );
+        dialog.setVisible(true);
+        println( "Any messages for the tester will display here." );
+    }
+
+
+    public static void printInstructions( String[] instructions )
+    {
+        dialog.printInstructions( instructions );
+    }
+
+
+    public static void println( String messageIn )
+    {
+        dialog.displayMessage( messageIn );
+        System.out.println(messageIn);
+    }
+
+}// Sysout  class
+
+/**
+  This is part of the standard test machinery.  It provides a place for the
+   test instructions to be displayed, and a place for interactive messages
+   to the user to be displayed.
+  To have the test instructions displayed, see Sysout.
+  To have a message to the user be displayed, see Sysout.
+  Do not call anything in this dialog directly.
+  */
+class TestDialog extends Dialog
+{
+
+    TextArea instructionsText;
+    TextArea messageText;
+    int maxStringLength = 80;
+
+    //DO NOT call this directly, go through Sysout
+    public TestDialog( Frame frame, String name )
+    {
+        super( frame, name );
+        int scrollBoth = TextArea.SCROLLBARS_BOTH;
+        instructionsText = new TextArea( "", 15, maxStringLength, scrollBoth );
+        add( "North", instructionsText );
+
+        messageText = new TextArea( "", 5, maxStringLength, scrollBoth );
+        add("Center", messageText);
+
+        pack();
+
+        setVisible(true);
+    }// TestDialog()
+
+    //DO NOT call this directly, go through Sysout
+    public void printInstructions( String[] instructions )
+    {
+        //Clear out any current instructions
+        instructionsText.setText( "" );
+
+        //Go down array of instruction strings
+
+        String printStr, remainingStr;
+        for( int i=0; i < instructions.length; i++ )
+        {
+            //chop up each into pieces maxSringLength long
+            remainingStr = instructions[ i ];
+            while( remainingStr.length() > 0 )
+            {
+                //if longer than max then chop off first max chars to print
+                if( remainingStr.length() >= maxStringLength )
+                {
+                    //Try to chop on a word boundary
+                    int posOfSpace = remainingStr.
+                        lastIndexOf( ' ', maxStringLength - 1 );
+
+                    if( posOfSpace <= 0 ) posOfSpace = maxStringLength - 1;
+
+                    printStr = remainingStr.substring( 0, posOfSpace + 1 );
+                    remainingStr = remainingStr.substring( posOfSpace + 1 );
+                }
+                //else just print
+                else
+                {
+                    printStr = remainingStr;
+                    remainingStr = "";
+                }
+
+                instructionsText.append( printStr + "\n" );
+
+            }// while
+
+        }// for
+
+    }//printInstructions()
+
+    //DO NOT call this directly, go through Sysout
+    public void displayMessage( String messageIn )
+    {
+        messageText.append( messageIn + "\n" );
+        System.out.println(messageIn);
+    }
+
+}// TestDialog  class
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/appletviewer/IOExceptionIfEncodedURLTest/IOExceptionIfEncodedURLTest.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,64 @@
+/*
+ * Copyright 2008 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.
+ *
+ * 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.
+ */
+
+/*
+  test
+  @bug 6193279
+  @summary REGRESSION: AppletViewer throws IOException when path is encoded URL
+  @author Dmitry Cherepanov: area=appletviewer
+  @run compile IOExceptionIfEncodedURLTest.java
+  @run main IOExceptionIfEncodedURLTest
+  @run shell IOExceptionIfEncodedURLTest.sh
+*/
+
+import java.applet.Applet;
+import sun.net.www.ParseUtil;
+import java.io.File;
+import java.net.MalformedURLException;
+
+public class IOExceptionIfEncodedURLTest extends Applet{
+    public void init(){
+    }
+
+    public void start(){
+        // We check that appletviewer writes this message to log file
+        System.err.println("the appletviewer started");
+    }
+
+    // We expect that sun.net.www.ParseUtil.fileToEncodedURL works like following
+    // if relative file URL, like this "file:index.html" is processed
+    static String url = "file:IOExceptionIfEncodedURLTest.java";
+    public static final void main(String args[])
+      throws MalformedURLException{
+        System.err.println("prior checking...");
+        String prefix = "file:";
+        String path = ParseUtil.fileToEncodedURL(new File(System.getProperty("user.dir"))).getPath();
+        String filename = url.substring(prefix.length());
+        System.err.println("url="+url+" -> path="+path+",filename="+filename);
+
+        if (!path.endsWith("/") && !filename.startsWith("/")) {
+            throw new RuntimeException("Incorrect '/' processing");
+        }
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/appletviewer/IOExceptionIfEncodedURLTest/IOExceptionIfEncodedURLTest.sh	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,231 @@
+#
+# Copyright 2008 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.
+#
+
+#!/bin/ksh -p
+#
+#   @test    IOExceptionIfEncodedURLTest.sh
+#   @bug     6193279 6619458
+#   @summary REGRESSION: AppletViewer throws IOException when path is encoded URL
+#   @author  Dmitry Cherepanov: area=appletviewer
+#   @run compile IOExceptionIfEncodedURLTest.java
+#   @run main IOExceptionIfEncodedURLTest
+#   @run shell IOExceptionIfEncodedURLTest.sh
+
+# Beginning of subroutines:
+status=1
+
+#Call this from anywhere to fail the test with an error message
+# usage: fail "reason why the test failed"
+fail() 
+ { echo "The test failed :-("
+   echo "$*" 1>&2
+   echo "exit status was $status"
+   exit $status
+ } #end of fail()
+
+#Call this from anywhere to pass the test with a message
+# usage: pass "reason why the test passed if applicable"
+pass() 
+ { echo "The test passed!!!"
+   echo "$*" 1>&2
+   exit 0
+ } #end of pass()
+
+#Call this to run the test with a file name
+test()
+ {
+   ${TESTJAVA}${FILESEP}bin${FILESEP}appletviewer -Xnosecurity ${URL} > err 2>&1 &
+   APPLET_ID=$!
+   sleep 15
+   kill -9 $APPLET_ID
+
+   # these exceptions will be thrown if the test fails
+   cat err | grep "I/O exception while reading"
+   exception=$?
+   if [ $exception = "0" ];
+       then fail "test failed for "${URL}", see err file and CRs #6193279,6329251,6376334"
+   fi
+
+   cat err | grep "java.lang.ClassNotFoundException"
+   exception=$?
+   if [ $exception = "0" ];
+       then fail "test failed for "${URL}", see err file and CRs #6193279,6329251,6376334"
+   fi
+
+   # the applet will log the same message
+   cat err | grep "the appletviewer started"
+   started=$?
+
+   echo $started | grep "2"
+   if [ $? = 0 ] ;
+       then fail "test failed for "${URL}": syntax errors or inaccessible files"
+   fi
+
+   if [ $started = "0" ];
+       then echo "the test passed for "${URL}
+       else fail "test failed for "${URL}": the appletviewer behaviour is unexpected: "$started", see err file"
+   fi
+ }
+
+# end of subroutines
+
+
+# The beginning of the script proper
+
+# Checking for proper OS
+OS=`uname -s`
+case "$OS" in
+   SunOS )
+      VAR="One value for Sun"
+      DEFAULT_JDK=/usr/local/java/jdk1.2.1/solaris
+      FILESEP="/"
+      ;;
+
+   Linux )
+      VAR="A different value for Linux"
+      DEFAULT_JDK=/usr/local/java/jdk1.4/linux-i386
+      FILESEP="/"
+      ;;
+
+   Windows_95 | Windows_98 | Windows_NT | Windows_ME | CYGWIN_NT-5.1)
+      VAR="A different value for Win32"
+      DEFAULT_JDK=/usr/local/java/jdk1.2.1/win32
+      FILESEP="\\"
+      ;;
+
+   # catch all other OSs
+   * )
+      echo "Unrecognized system!  $OS"
+      fail "Unrecognized system!  $OS"
+      ;;
+esac
+
+# 6438730: Only a minimal set of env variables are set for shell tests.
+# To guarantee that env variable holds correct value we need to set it ourselves.
+if [ -z "${PWD}" ] ; then
+    PWD=`pwd`
+fi
+
+# check that some executable or other file you need is available, abort if not
+#  note that the name of the executable is in the fail string as well.
+# this is how to check for presence of the compiler, etc.
+#RESOURCE=`whence SomeProgramOrFileNeeded`
+#if [ "${RESOURCE}" = "" ] ; 
+#   then fail "Need SomeProgramOrFileNeeded to perform the test" ; 
+#fi
+
+# Want this test to run standalone as well as in the harness, so do the 
+#  following to copy the test's directory into the harness's scratch directory 
+#  and set all appropriate variables:
+
+if [ -z "${TESTJAVA}" ] ; then
+   # TESTJAVA is not set, so the test is running stand-alone.
+   # TESTJAVA holds the path to the root directory of the build of the JDK
+   # to be tested.  That is, any java files run explicitly in this shell
+   # should use TESTJAVA in the path to the java interpreter.
+   # So, we'll set this to the JDK spec'd on the command line.  If none
+   # is given on the command line, tell the user that and use a cheesy
+   # default.
+   # THIS IS THE JDK BEING TESTED.
+   if [ -n "$1" ] ;
+      then TESTJAVA=$1
+      else echo "no JDK specified on command line so using default!"
+	 TESTJAVA=$DEFAULT_JDK
+   fi
+   TESTSRC=.
+   TESTCLASSES=.
+   STANDALONE=1;
+fi
+echo "JDK under test is: $TESTJAVA"
+
+#Deal with .class files:
+if [ -n "${STANDALONE}" ] ; 
+   then 
+   #if standalone, remind user to cd to dir. containing test before running it
+   echo "Just a reminder: cd to the dir containing this test when running it"
+   # then compile all .java files (if there are any) into .class files
+   if [ -a *.java ] ; 
+      then echo "Reminder, this test should be in its own directory with all"
+      echo "supporting files it needs in the directory with it."
+      ${TESTJAVA}/bin/javac ./*.java ; 
+   fi
+   # else in harness so copy all the class files from where jtreg put them
+   # over to the scratch directory this test is running in. 
+   else cp ${TESTCLASSES}/*.class . ;
+fi
+
+#if in test harness, then copy the entire directory that the test is in over 
+# to the scratch directory.  This catches any support files needed by the test.
+#if [ -z "${STANDALONE}" ] ; 
+#   then cp ${TESTSRC}/* . 
+#fi
+
+#Just before executing anything, make sure it has executable permission!
+chmod 777 ./*
+
+###############  YOUR TEST CODE HERE!!!!!!!  #############
+
+#All files required for the test should be in the same directory with
+# this file.  If converting a standalone test to run with the harness,
+# as long as all files are in the same directory and it returns 0 for
+# pass, you should be able to cut and paste it into here and it will
+# run with the test harness.
+
+# This is an example of running something -- test
+# The stuff below catches the exit status of test then passes or fails
+# this shell test as appropriate ( 0 status is considered a pass here )
+
+# The test verifies that appletviewer correctly works with the different
+# names of the files, including relative and absolute paths 
+
+# 6619458: exclude left brace from the name of the files managed by the VCS
+NAME='test.html'
+
+ENCODED='te%7Bst.html'
+UNENCODED='te{st.html'
+
+# Copy needed files into the harness's scratch directory
+# or create a copy with the required name if the test is
+# running as stand-alone
+cp ${TESTSRC}${FILESEP}${NAME} ${UNENCODED}
+
+# the encoded name, the path is absolute
+URL="file:"${PWD}${FILESEP}${ENCODED}
+test
+
+# the encoded name, the path is relative
+URL="file:"${ENCODED}
+test
+
+# the unencoded name, the path is absolute
+URL="file:"${PWD}${FILESEP}${UNENCODED}
+test
+
+# the unencoded name, the path is relative
+URL="file:"${UNENCODED}
+test
+
+# pick up our toys from the scratch directory
+rm ${UNENCODED}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/appletviewer/IOExceptionIfEncodedURLTest/test.html	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,21 @@
+<html>
+<!--  
+  test
+  @bug 6193279
+  @summary REGRESSION: AppletViewer throws IOException when path is encoded URL
+  @author Dmitry.Cherepanov@SUN.COM : area=appletviewer
+  @run compile IOExceptionIfEncodedURLTest.java
+  @run shell IOExceptionIfEncodedURLTest.sh
+  -->
+<head>
+<title>Started by shell script</title>
+</head>
+<body>
+
+<h1>IOExceptionIfEncodedURLTest<br>Bug ID: 6193279</h1>
+
+<p> See the dialog box (usually in upper left corner) for instructions</p>
+
+<APPLET CODE="IOExceptionIfEncodedURLTest.class" WIDTH=200 HEIGHT=200></APPLET>
+</body>
+</html>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/font/Rotate/Shear.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,66 @@
+/*
+ * Copyright 2008 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.
+ *
+ * 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.
+ */
+
+/*
+ * @test
+ * @bug 6692979
+ * @summary Verify no crashes with extreme shears.
+ */
+
+import javax.swing.*;
+import java.awt.*;
+import java.awt.font.*;
+import java.awt.geom.*;
+public class Shear extends Component {
+
+    public static void main(String[] args) {
+        JFrame f = new JFrame();
+        f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+        f.getContentPane().add("Center", new Shear());
+        f.pack();
+        f.setVisible(true);
+    }
+
+    public Dimension getPreferredSize() {
+      return new Dimension(400,300);
+    }
+
+    public void paint(Graphics g) {
+        Graphics2D g2 = (Graphics2D)g;
+
+        g.setColor(Color.white);
+        g.fillRect(0,0,400,300);
+        g.setColor(Color.black);
+        Font origFont = new Font(Font.DIALOG, Font.BOLD, 30);
+        for (int i=0;i<=360;i++) {
+            double sv = i*180.0/Math.PI;
+            AffineTransform tx = AffineTransform.getShearInstance(sv, sv);
+            Font font = origFont.deriveFont(tx);
+            g.setFont(font);
+            GlyphVector gv =
+                  font.createGlyphVector(g2.getFontRenderContext(), "JavaFX");
+            //System.out.println(gv.getVisualBounds());
+            g.drawString("JavaFX", 100, 100);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/font/Rotate/TranslatedOutlineTest.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,69 @@
+/*
+ * Copyright 2008 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.
+ *
+ * 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.
+ */
+
+/*
+ * @test TranslatedOutlineTest
+ * @bug 6703377
+ * @summary This test verifies that outline is translated in a correct direction
+ * @run main TranslatedOutlineTest
+ */
+
+import java.awt.Color;
+import java.awt.Graphics2D;
+import java.awt.RenderingHints;
+import java.awt.font.FontRenderContext;
+import java.awt.font.GlyphVector;
+import java.awt.image.BufferedImage;
+
+public class TranslatedOutlineTest {
+   public static void main(String a[]) {
+        /* prepare blank image */
+        BufferedImage bi = new BufferedImage(50, 50, BufferedImage.TYPE_INT_RGB);
+        Graphics2D g2 = (Graphics2D) bi.getGraphics();
+        g2.setColor(Color.WHITE);
+        g2.fillRect(0, 0, 50, 50);
+
+        /* draw outline somethere in the middle of the image */
+        FontRenderContext frc = new FontRenderContext(null, false, false);
+        g2.setColor(Color.RED);
+        g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF);
+        GlyphVector gv = g2.getFont().createGlyphVector(frc, "test");
+        g2.fill(gv.getOutline(20, 20));
+
+        /* Check if anything was drawn.
+         * If y direction is not correct then image is still blank and
+         * test will fail.
+         */
+        int bgcolor = Color.WHITE.getRGB();
+        for (int i=0; i<bi.getWidth(); i++) {
+            for(int j=0; j<bi.getHeight(); j++) {
+               if (bi.getRGB(i, j) != bgcolor) {
+                   System.out.println("Test passed.");
+                   return;
+               }
+            }
+        }
+        throw new RuntimeException("Outline was not detected");
+    }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/font/Threads/FontThread.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,89 @@
+/*
+ * Copyright 2007 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.
+ *
+ * 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.
+ */
+
+
+/* @test
+ * @summary verify thread interruption doesn't affect font file reading.
+ * @bug 6640532
+ */
+
+import java.awt.*;
+
+public class FontThread extends Thread {
+
+    String fontName = "Dialog";
+    static FontThread thread1;
+    static FontThread thread2;
+    static FontThread thread3;
+
+    public static void main(String args[]) throws Exception {
+        thread1 = new FontThread("SansSerif");
+        thread2 = new FontThread("Serif");
+        thread3 = new FontThread("Monospaced");
+        thread1.dometrics(60); // load classes first
+        thread1.start();
+        thread2.start();
+        thread3.start();
+        InterruptThread ithread = new InterruptThread();
+        ithread.setDaemon(true);
+        ithread.start();
+        thread1.join();
+        thread2.join();
+        thread3.join();
+    }
+
+    FontThread(String font) {
+        super();
+        this.fontName = font;
+    }
+
+    public void run() {
+        System.out.println("started "+fontName); System.out.flush();
+        dometrics(4000);
+        System.out.println("done "+fontName); System.out.flush();
+    }
+
+    private void dometrics(int max) {
+        Font f = new Font(fontName, Font.PLAIN, 12);
+        FontMetrics fm = Toolkit.getDefaultToolkit().getFontMetrics(f);
+        for (char i=0;i<max;i++) {
+            if (f.canDisplay(i)) fm.charWidth(i);
+        }
+    }
+
+    static class InterruptThread extends Thread {
+        public void run() {
+            while (true) {
+                try {
+                    Thread.sleep(1);
+                } catch (InterruptedException e) {
+                }
+                thread1.interrupt();
+                thread2.interrupt();
+                thread3.interrupt();
+            }
+        }
+    }
+}
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/xembed/server/JavaClient.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,126 @@
+/*
+ * Copyright 2004-2008 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.
+ *
+ * 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.
+ */
+
+import java.awt.*;
+import sun.awt.*;
+import java.awt.event.*;
+import java.lang.reflect.*;
+import java.awt.dnd.*;
+import java.awt.datatransfer.*;
+
+public class JavaClient {
+    ClientContainer cont;
+    public static void main(String[] args) {
+        if (System.getProperty("os.name").toLowerCase().startsWith("win")) {
+            return;
+        }
+
+        // Enable testing extensions in XEmbed server
+        System.setProperty("sun.awt.xembed.testing", "true");
+
+        boolean xtoolkit = "sun.awt.X11.XToolkit".equals(Toolkit.getDefaultToolkit().getClass().getName());
+        final EmbeddedFrame ef = createEmbeddedFrame(xtoolkit, Long.parseLong(args[0]));
+        ef.setBackground(new Color(100, 100, 200));
+        ef.setLayout(new BorderLayout());
+        ef.add(new ClientContainer(ef), BorderLayout.CENTER);
+        ef.pack();
+        ef.registerListeners();
+        ef.setVisible(true);
+    }
+    private static EmbeddedFrame createEmbeddedFrame(boolean xtoolkit, long window) {
+        try {
+            Class cl = (xtoolkit?Class.forName("sun.awt.X11.XEmbeddedFrame"):Class.forName("sun.awt.motif.MEmbeddedFrame"));
+            Constructor cons = cl.getConstructor(new Class[]{Long.TYPE, Boolean.TYPE});
+            return (EmbeddedFrame)cons.newInstance(new Object[] {window, true});
+        } catch (Exception e) {
+            e.printStackTrace();
+            throw new RuntimeException("Can't create embedded frame");
+        }
+    }
+}
+
+class ClientContainer extends Container {
+    Window parent;
+    int width, height;
+    public ClientContainer(Window w) {
+        parent = w;
+        width = 500;
+        height = 50;
+        final TextField tf = new TextField(30);
+
+        DragSource ds = new DragSource();
+        final DragSourceListener dsl = new DragSourceAdapter() {
+                public void dragDropEnd(DragSourceDropEvent dsde) {
+                }
+            };
+        final DragGestureListener dgl = new DragGestureListener() {
+                public void dragGestureRecognized(DragGestureEvent dge) {
+                    dge.startDrag(null, new StringSelection(tf.getText()), dsl);
+                }
+            };
+        ds.createDefaultDragGestureRecognizer(tf, DnDConstants.ACTION_COPY, dgl);
+
+        final DropTargetListener dtl = new DropTargetAdapter() {
+                public void drop(DropTargetDropEvent dtde) {
+                    dtde.acceptDrop(DnDConstants.ACTION_COPY);
+                    try {
+                        tf.setText(tf.getText() + (String)dtde.getTransferable().getTransferData(DataFlavor.stringFlavor));
+                    } catch (Exception e) {
+                    }
+                }
+            };
+        final DropTarget dt = new DropTarget(tf, dtl);
+
+        setLayout(new FlowLayout());
+        add(tf);
+        Button close = new Button("Close");
+        close.addActionListener(new ActionListener() {
+                public void actionPerformed(ActionEvent e) {
+                    parent.dispose();
+                }
+            });
+        Button inc = new Button("Increase size");
+        inc.addActionListener(new ActionListener() {
+                public void actionPerformed(ActionEvent e) {
+                    changeSize(10);
+                }
+            });
+        Button dec = new Button("Decrease size");
+        dec.addActionListener(new ActionListener() {
+                public void actionPerformed(ActionEvent e) {
+                    changeSize(-10);
+                }
+            });
+        add(close);
+        add(inc);
+        add(dec);
+    }
+    void changeSize(int step) {
+        width += step;
+        height += step;
+        parent.pack();
+    }
+    public Dimension getPreferredSize() {
+        return new Dimension(width, height);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/xembed/server/RunTestXEmbed.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,176 @@
+/*
+ * Copyright 2004-2008 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.
+ *
+ * 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.
+ */
+
+/**
+ * @test
+ * @bug 4931668
+ * @summary Tests XEmbed server/client functionality
+ * @author Denis Mikhalkin: area=awt.xembed
+ * @compile JavaClient.java TesterClient.java TestXEmbedServer.java
+ * @run main/timeout=6000 RunTestXEmbed
+ */
+
+import java.awt.Rectangle;
+import java.lang.reflect.Method;
+import java.util.logging.*;
+import java.util.*;
+import java.io.*;
+
+public class RunTestXEmbed extends TestXEmbedServer {
+    private static final Logger log = Logger.getLogger("test.xembed");
+    private Method test;
+    private boolean passed = false;
+    public RunTestXEmbed(Method test) {
+        super(false);
+        this.test = test;
+    }
+
+    public Process startClient(Rectangle bounds[], long window) {
+        try {
+            String java_home = System.getProperty("java.home");
+            StringBuilder buf = new StringBuilder();
+            for (int i = 0; i < bounds.length; i++) {
+                buf.append(" " + bounds[i].x);
+                buf.append(" " + bounds[i].y);
+                buf.append(" " + bounds[i].width);
+                buf.append(" " + bounds[i].height);
+            }
+            Map envs = System.getenv();
+            String enva[] = new String[envs.size()];
+            int ind = 0;
+            Iterator iter = envs.entrySet().iterator();
+            while (iter.hasNext()) {
+                Map.Entry entry = (Map.Entry)iter.next();
+                if (!"AWT_TOOLKIT".equals(entry.getKey())) {
+                    enva[ind++] = entry.getKey() + "=" + entry.getValue();
+                } else {
+                    enva[ind++] = "AWT_TOOLKIT=sun.awt.X11.XToolkit";
+                }
+            }
+            Process proc = Runtime.getRuntime().exec(java_home +
+                                                     "/bin/java -Dawt.toolkit=sun.awt.X11.XToolkit TesterClient "
+                                                     + test.getName() + " " + window + buf,
+                                                     enva);
+            System.err.println("Test for " + test.getName() + " has started.");
+            log.fine("Test for " + test.getName() + " has started.");
+            new InputReader(proc.getInputStream());
+            new InputReader(proc.getErrorStream());
+            try {
+                passed = (proc.waitFor() == 0);
+            } catch (InterruptedException ie) {
+            }
+            log.fine("Test for " + test.getName() + " has finished.");
+            File logFile = new File("java3.txt");
+            if (logFile.exists()) {
+                logFile.renameTo(new File(test.getName() + ".txt"));
+            }
+            return proc;
+        } catch (IOException ex1) {
+            ex1.printStackTrace();
+        }
+        return null;
+    }
+
+    public static void main(String[] args) throws Throwable {
+        if (System.getProperty("os.name").toLowerCase().startsWith("win")) {
+            return;
+        }
+
+        // Enabled XEmbed
+        System.setProperty("sun.awt.xembedserver", "true");
+
+        if (args.length == 1) {
+            Class cl = Class.forName("sun.awt.X11.XEmbedServerTester");
+            Method meth = cl.getMethod(args[0], new Class[0]);
+            System.err.println("Performing single test " + args[0]);
+            boolean res = performTest(meth);
+            if (!res) {
+                System.err.println("Test " + args[0] + " has failed");
+            } else {
+                System.err.println("Test " + args[0] + " has passed");
+            }
+        } else {
+            Class cl = Class.forName("sun.awt.X11.XEmbedServerTester");
+            Method[] meths = cl.getMethods();
+            LinkedList failed = new LinkedList();
+            for (int i = 0; i < meths.length; i++) {
+                Method meth = meths[i];
+                if (meth.getReturnType() == Void.TYPE && meth.getName().startsWith("test") && meth.getParameterTypes().length == 0) {
+                    System.err.println("Performing " + meth.getName());
+                    boolean res = performTest(meth);
+                    if (!res) {
+                        failed.add(meth);
+                    }
+                }
+            }
+            log.info("Testing finished.");
+            if (failed.size() != 0) {
+                System.err.println("Some tests have failed:");
+                Iterator iter = failed.iterator();
+                while(iter.hasNext()) {
+                    Method meth = (Method)iter.next();
+                    System.err.println(meth.getName());
+                }
+                throw new RuntimeException("TestFAILED: some of the testcases are failed");
+            } else {
+                System.err.println("All PASSED");
+            }
+        }
+    }
+
+    private static boolean performTest(Method meth) {
+        RunTestXEmbed test = new RunTestXEmbed(meth);
+        test.addClient();
+        test.dispose();
+        return test.isPassed();
+    }
+
+    public boolean isPassed() {
+        return passed;
+    }
+}
+
+class InputReader extends Thread {
+    private InputStream stream;
+    public InputReader(InputStream stream) {
+        this.stream = stream;
+        start();
+    }
+    public void run() {
+        while (!interrupted()) {
+            try {
+                int inp = stream.read();
+                if (inp != -1) {
+                    System.out.write(inp);
+                } else {
+                    try {
+                        Thread.sleep(100);
+                    } catch (Exception iie) {
+                    }
+                }
+            } catch (IOException ie) {
+                break;
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/xembed/server/TestXEmbedServer.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,228 @@
+/*
+ * Copyright 2004-2008 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.
+ *
+ * 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.
+ */
+
+import java.awt.*;
+import java.awt.event.*;
+import javax.swing.*;
+import java.io.*;
+import java.util.logging.*;
+import sun.awt.WindowIDProvider;
+import java.awt.dnd.*;
+import java.awt.datatransfer.*;
+
+public abstract class TestXEmbedServer {
+    private static final Logger log = Logger.getLogger("test.xembed");
+    Frame f;
+    Canvas client;
+    Button toFocus;
+    Button b_modal;
+    JButton b_close;
+    JDialog modal_d;
+    JFrame dummy;
+    Container clientCont;
+    boolean passed;
+
+    public boolean isPassed() {
+        return passed;
+    }
+
+    public TestXEmbedServer(boolean manual) {
+
+        // Enable testing extensions in XEmbed server
+        System.setProperty("sun.awt.xembed.testing", "true");
+
+        f = new Frame("Main frame");
+        f.addWindowListener(new WindowAdapter() {
+                public void windowClosing(WindowEvent e) {
+                    synchronized(TestXEmbedServer.this) {
+                        TestXEmbedServer.this.notifyAll();
+                    }
+                    dummy.dispose();
+                    f.dispose();
+                }
+            });
+
+        f.setLayout(new BorderLayout());
+
+        Container bcont = new Container();
+
+        toFocus = new Button("Click to focus server");
+        final TextField tf = new TextField(20);
+        tf.setName("0");
+        DragSource ds = new DragSource();
+        final DragSourceListener dsl = new DragSourceAdapter() {
+                public void dragDropEnd(DragSourceDropEvent dsde) {
+                }
+            };
+        final DragGestureListener dgl = new DragGestureListener() {
+                public void dragGestureRecognized(DragGestureEvent dge) {
+                    dge.startDrag(null, new StringSelection(tf.getText()), dsl);
+                }
+            };
+        ds.createDefaultDragGestureRecognizer(tf, DnDConstants.ACTION_COPY, dgl);
+
+        final DropTargetListener dtl = new DropTargetAdapter() {
+                public void drop(DropTargetDropEvent dtde) {
+                    dtde.acceptDrop(DnDConstants.ACTION_COPY);
+                    try {
+                        tf.setText(tf.getText() + (String)dtde.getTransferable().getTransferData(DataFlavor.stringFlavor));
+                    } catch (Exception e) {
+                    }
+                }
+            };
+        final DropTarget dt = new DropTarget(tf, dtl);
+
+        Button b_add = new Button("Add client");
+        b_add.addActionListener(new ActionListener() {
+                public void actionPerformed(ActionEvent e) {
+                    addClient();
+                }
+            });
+        Button b_remove = new Button("Remove client");
+        b_remove.addActionListener(new ActionListener() {
+                public void actionPerformed(ActionEvent e) {
+                    if (clientCont.getComponentCount() != 0) {
+                        clientCont.remove(clientCont.getComponentCount()-1);
+                    }
+                }
+            });
+        b_close = new JButton("Close modal dialog");
+        b_close.addActionListener(new ActionListener() {
+                public void actionPerformed(ActionEvent e) {
+                    modal_d.dispose();
+                }
+            });
+        b_modal = new Button("Show modal dialog");
+        b_modal.addActionListener(new ActionListener() {
+                public void actionPerformed(ActionEvent e) {
+                    modal_d = new JDialog(f, "Modal dialog", true);
+                    modal_d.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
+                    modal_d.setBounds(0, 100, 200, 50);
+                    modal_d.getContentPane().add(b_close);
+                    modal_d.validate();
+                    modal_d.show();
+                }
+            });
+
+        bcont.add(tf);
+        bcont.add(toFocus);
+        bcont.add(b_add);
+        bcont.add(b_remove);
+        bcont.add(b_modal);
+        if (manual) {
+            Button pass = new Button("Pass");
+            pass.addActionListener(new ActionListener() {
+                    public void actionPerformed(ActionEvent e) {
+                        passed = true;
+                        synchronized(TestXEmbedServer.this) {
+                            TestXEmbedServer.this.notifyAll();
+                        }
+                    }
+                });
+            bcont.add(pass);
+            Button fail = new Button("Fail");
+            fail.addActionListener(new ActionListener() {
+                    public void actionPerformed(ActionEvent e) {
+                        passed = false;
+                        synchronized(TestXEmbedServer.this) {
+                            TestXEmbedServer.this.notifyAll();
+                        }
+                    }
+                });
+            bcont.add(fail);
+        }
+        b_modal.setName("2");
+        bcont.setLayout(new FlowLayout());
+        f.add(bcont, BorderLayout.NORTH);
+
+        clientCont = Box.createVerticalBox();
+        f.add(clientCont, BorderLayout.CENTER);
+
+        dummy = new JFrame("Dummy");
+        dummy.getContentPane().add(new JButton("Button"));
+        dummy.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
+        dummy.setBounds(0, 0, 100, 100);
+        dummy.setVisible(true);
+
+        f.setBounds(300, 0, 800, 300);
+        f.setVisible(true);
+    }
+
+    public abstract Process startClient(Rectangle bounds[], long window);
+
+    public void addClient() {
+        client = new Canvas() {
+                public void paint(Graphics g) {
+                    super.paint(g);
+                }
+            };
+        client.setBackground(new Color(30, 220, 40));
+        clientCont.add(client);
+        clientCont.validate();
+        WindowIDProvider pid = (WindowIDProvider)client.getPeer();
+        log.fine("Added XEmbed server(Canvas) with X window ID " + pid.getWindow());
+        Rectangle toFocusBounds = toFocus.getBounds();
+        toFocusBounds.setLocation(toFocus.getLocationOnScreen());
+        f.validate();
+
+        // KDE doesn't accept clicks on title as activation - click below title
+        Rectangle fbounds = f.getBounds();
+        fbounds.y += f.getInsets().top;
+        fbounds.height -= f.getInsets().top;
+
+        Process proc = startClient(new Rectangle[] {fbounds, dummy.getBounds(), toFocusBounds,
+                                                    new Rectangle(b_modal.getLocationOnScreen(), b_modal.getSize()),
+                                                    new Rectangle(10, 130, 20, 20)}, pid.getWindow());
+        new ClientWatcher(client, proc, clientCont).start();
+    }
+
+    public void dispose() {
+        f.dispose();
+        f = null;
+        dummy.dispose();
+        dummy = null;
+        if (modal_d != null) {
+            modal_d.dispose();
+            modal_d = null;
+        }
+    }
+}
+
+class ClientWatcher extends Thread {
+    private Process clientProcess;
+    private Canvas client;
+    private Container parent;
+    public ClientWatcher(Canvas client, Process proc, Container parent) {
+        this.client = client;
+        this.clientProcess = proc;
+        this.parent = parent;
+    }
+
+    public void run() {
+        try {
+            clientProcess.waitFor();
+        } catch (InterruptedException ie) {
+        }
+        parent.remove(client);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/xembed/server/TestXEmbedServerJava.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,86 @@
+/*
+ * Copyright 2004-2008 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.
+ *
+ * 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.
+ */
+
+/**
+ * @test
+ * @bug 4931668
+ * @summary Tests XEmbed server/client functionality
+ * @author denis mikhalkin: area=awt.xembed
+ * @compile JavaClient.java TesterClient.java TestXEmbedServer.java
+ * @run main/manual TestXEmbedServerJava
+ */
+
+import java.awt.*;
+import java.awt.event.*;
+import javax.swing.*;
+import java.io.*;
+
+public class TestXEmbedServerJava extends TestXEmbedServer {
+    public static void main(String[] args) {
+        if (System.getProperty("os.name").toLowerCase().startsWith("win")) {
+            return;
+        }
+
+        // Enabled XEmbed
+        System.setProperty("sun.awt.xembedserver", "true");
+
+        String instruction =
+            "This is a manual test for XEmbed server functionality. \n" +
+            "You may start XEmbed client by pressing 'Add client' button.\n" +
+            "Check that focus transfer with mouse works, that focus traversal with Tab/Shift-Tab works.\n" +
+            "Check that XEmbed server client's growing and shrinking.\n" +
+            "Check that Drag&Drop works in all combinations.\n" +
+            "Check the keyboard input works in both text fields.\n";
+        Frame f = new Frame("Instructions");
+        f.setLayout(new BorderLayout());
+        f.add(new TextArea(instruction), BorderLayout.CENTER);
+        f.pack();
+        f.setLocation(0, 400);
+        f.setVisible(true);
+
+        TestXEmbedServerJava lock = new TestXEmbedServerJava();
+        try {
+            synchronized(lock) {
+                lock.wait();
+            }
+        } catch (InterruptedException e) {
+        }
+        if (!lock.isPassed()) {
+            throw new RuntimeException("Test failed");
+        }
+    }
+
+    public TestXEmbedServerJava() {
+        super(true);
+    }
+
+    public Process startClient(Rectangle[] bounds, long window) {
+        try {
+            String java_home = System.getProperty("java.home");
+            return Runtime.getRuntime().exec(java_home + "/bin/java JavaClient " + window);
+        } catch (IOException ex1) {
+            ex1.printStackTrace();
+        }
+        return null;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/xembed/server/TesterClient.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,59 @@
+/*
+ * Copyright 2004-2008 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.
+ *
+ * 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.
+ */
+
+import java.lang.reflect.*;
+import java.awt.Rectangle;
+import java.util.logging.*;
+
+public class TesterClient {
+    private static final Logger log = Logger.getLogger("test.xembed.TesterClient");
+    private static Method test;
+    private static boolean passed = false;
+    public static void main(String[] args) throws Throwable {
+        // First parameter is the name of the test, second is the window, the rest are rectangles
+        Class cl = Class.forName("sun.awt.X11.XEmbedServerTester");
+        test = cl.getMethod(args[0], new Class[0]);
+        long window = Long.parseLong(args[1]);
+        Rectangle r[] = new Rectangle[(args.length-2)/4];
+        for (int i = 0; i < r.length; i++) {
+            r[i] = new Rectangle(Integer.parseInt(args[2+i*4]), Integer.parseInt(args[2+i*4+1]),
+                                 Integer.parseInt(args[2+i*4+2]), Integer.parseInt(args[2+i*4+3]));
+        }
+        startClient(r, window);
+    }
+
+    public static void startClient(Rectangle bounds[], long window) throws Throwable {
+        Method m_getTester = Class.forName("sun.awt.X11.XEmbedServerTester").
+            getMethod("getTester", new Class[] {bounds.getClass(), Long.TYPE});
+        final Object tester = m_getTester.invoke(null, new Object[] {bounds, window});
+        try {
+            log.info("Starting test " + test.getName());
+            test.invoke(tester, (Object[])null);
+            log.info("Test " + test.getName() + " PASSED.");
+            passed = true;
+        } catch (Exception e) {
+            log.log(Level.WARNING, "Test " + test.getName() + " FAILED.", e);
+        }
+        System.exit(passed?0:1);
+    }
+}
--- a/jdk/test/java/beans/Introspector/BeanUtils.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/test/java/beans/Introspector/BeanUtils.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2003-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2003-2008 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
@@ -21,6 +21,7 @@
  * have any questions.
  */
 
+import java.beans.BeanDescriptor;
 import java.beans.EventSetDescriptor;
 import java.beans.IndexedPropertyDescriptor;
 import java.beans.IntrospectionException;
@@ -39,13 +40,26 @@
     }
 
     /**
+     * Returns a bean descriptor for specified class.
+     *
+     * @param type  the class to introspect
+     * @return a bean descriptor
+     */
+    public static BeanDescriptor getBeanDescriptor(Class type) {
+        try {
+            return Introspector.getBeanInfo(type).getBeanDescriptor();
+        } catch (IntrospectionException exception) {
+            throw new Error("unexpected exception", exception);
+        }
+    }
+
+    /**
      * Returns an array of property descriptors for specified class.
      *
      * @param type  the class to introspect
      * @return an array of property descriptors
      */
     public static PropertyDescriptor[] getPropertyDescriptors(Class type) {
-        System.out.println(type);
         try {
             return Introspector.getBeanInfo(type).getPropertyDescriptors();
         } catch (IntrospectionException exception) {
@@ -54,6 +68,38 @@
     }
 
     /**
+     * Returns an array of event set descriptors for specified class.
+     *
+     * @param type  the class to introspect
+     * @return an array of event set descriptors
+     */
+    public static EventSetDescriptor[] getEventSetDescriptors(Class type) {
+        try {
+            return Introspector.getBeanInfo(type).getEventSetDescriptors();
+        } catch (IntrospectionException exception) {
+            throw new Error("unexpected exception", exception);
+        }
+    }
+
+    /**
+     * Finds an event set descriptor for the class
+     * that matches the event set name.
+     *
+     * @param type  the class to introspect
+     * @param name  the name of the event set to search
+     * @return the {@code EventSetDescriptor} or {@code null}
+     */
+    public static EventSetDescriptor findEventSetDescriptor(Class type, String name) {
+        EventSetDescriptor[] esds = getEventSetDescriptors(type);
+        for (EventSetDescriptor esd : esds) {
+            if (esd.getName().equals(name)) {
+                return esd;
+            }
+        }
+        return null;
+    }
+
+    /**
      * Finds a property descriptor for the class
      * that matches the property name.
      *
@@ -72,6 +118,22 @@
     }
 
     /**
+     * Returns a event set descriptor for the class
+     * that matches the property name.
+     *
+     * @param type the class to introspect
+     * @param name the name of the event set to search
+     * @return the {@code EventSetDescriptor}
+     */
+    public static EventSetDescriptor getEventSetDescriptor(Class type, String name) {
+        EventSetDescriptor esd = findEventSetDescriptor(type, name);
+        if (esd != null) {
+            return esd;
+        }
+        throw new Error("could not find event set '" + name + "' in " + type);
+    }
+
+    /**
      * Returns a property descriptor for the class
      * that matches the property name.
      *
--- a/jdk/test/java/beans/Introspector/Test4896879.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/test/java/beans/Introspector/Test4896879.java	Thu Jun 12 13:50:55 2008 -0700
@@ -28,22 +28,16 @@
  * @author Mark Davidson
  */
 
-import java.beans.BeanInfo;
-import java.beans.EventSetDescriptor;
-import java.beans.IntrospectionException;
-import java.beans.Introspector;
 import java.util.EventListener;
 
 public class Test4896879 {
-    public static void main(String[] args) throws IntrospectionException {
+    public static void main(String[] args) {
         test(A.class);
         test(B.class);
     }
 
-    private static void test(Class type) throws IntrospectionException {
-        BeanInfo info = Introspector.getBeanInfo(type);
-        EventSetDescriptor[] descriptors = info.getEventSetDescriptors();
-        if (descriptors.length != 0) {
+    private static void test(Class type) {
+        if (BeanUtils.getEventSetDescriptors(type).length != 0) {
             throw new Error("Should not have any EventSetDescriptors");
         }
     }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/beans/Introspector/Test4935607.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,404 @@
+/*
+ * Copyright 2007 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.
+ *
+ * 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.
+ */
+
+/*
+ * @test %I% %G%
+ * @bug 4935607
+ * @summary Tests transient properties
+ * @author Sergey Malenkov
+ */
+
+import java.awt.Component;
+import java.awt.Dimension;
+import java.awt.Point;
+import java.awt.Rectangle;
+import java.awt.ScrollPane;
+import java.awt.geom.RectangularShape;
+import java.awt.im.InputContext;
+
+import java.beans.FeatureDescriptor;
+import java.beans.Transient;
+
+import java.util.EventListener;
+
+import javax.swing.AbstractButton;
+import javax.swing.DefaultListSelectionModel;
+import javax.swing.ImageIcon;
+import javax.swing.JComboBox;
+import javax.swing.JComponent;
+import javax.swing.JLabel;
+import javax.swing.JList;
+import javax.swing.JMenuBar;
+import javax.swing.JScrollPane;
+import javax.swing.JTabbedPane;
+import javax.swing.JViewport;
+import javax.swing.table.JTableHeader;
+import javax.swing.text.JTextComponent;
+
+public class Test4935607 {
+    public static void main(String[] args) {
+        // test all possible cases
+        test(Null.class);
+        test(True.class);
+        test(False.class);
+        test(NullNull.class);
+        test(TrueNull.class);
+        test(FalseNull.class);
+        test(NullTrue.class);
+        test(TrueTrue.class);
+        test(FalseTrue.class);
+        test(NullFalse.class);
+        test(TrueFalse.class);
+        test(FalseFalse.class);
+        // test transient properties in AWT
+        test(RectangularShape.class, "frame"); // NON-NLS: getFrame()
+        test(Rectangle.class, "bounds"); // NON-NLS: getBounds()
+        test(Dimension.class, "size"); // NON-NLS: getSize()
+        test(Point.class, "location"); // NON-NLS: getLocation()
+        test(Component.class, "foreground"); // NON-NLS: getForeground()
+        test(Component.class, "background"); // NON-NLS: getBackground()
+        test(Component.class, "font"); // NON-NLS: getFont()
+        test(Component.class, "visible"); // NON-NLS: getVisible()
+        test(ScrollPane.class, "scrollPosition"); // NON-NLS: getScrollPosition()
+        test(InputContext.class, "compositionEnabled"); // NON-NLS: getCompositionEnabled()
+        // test transient properties in Swing
+        test(JComponent.class, "minimumSize"); // NON-NLS: getMinimumSize()
+        test(JComponent.class, "preferredSize"); // NON-NLS: getPreferredSize()
+        test(JComponent.class, "maximumSize"); // NON-NLS: getMaximumSize()
+        test(ImageIcon.class, "image"); // NON-NLS: getImage()
+        test(ImageIcon.class, "imageObserver"); // NON-NLS: getImageObserver()
+        test(JMenuBar.class, "helpMenu"); // NON-NLS: getHelpMenu()
+        test(JScrollPane.class, "verticalScrollBar"); // NON-NLS: getVerticalScrollBar()
+        test(JScrollPane.class, "horizontalScrollBar"); // NON-NLS: getHorizontalScrollBar()
+        test(JScrollPane.class, "rowHeader"); // NON-NLS: getRowHeader()
+        test(JScrollPane.class, "columnHeader"); // NON-NLS: getColumnHeader()
+        test(JViewport.class, "extentSize"); // NON-NLS: getExtentSize()
+        test(JTableHeader.class, "defaultRenderer"); // NON-NLS: getDefaultRenderer()
+        test(JList.class, "cellRenderer"); // NON-NLS: getCellRenderer()
+        test(JList.class, "selectedIndices"); // NON-NLS: getSelectedIndices()
+        test(DefaultListSelectionModel.class, "leadSelectionIndex"); // NON-NLS: getLeadSelectionIndex()
+        test(DefaultListSelectionModel.class, "anchorSelectionIndex"); // NON-NLS: getAnchorSelectionIndex()
+        test(JComboBox.class, "selectedIndex"); // NON-NLS: getSelectedIndex()
+        test(JTabbedPane.class, "selectedIndex"); // NON-NLS: getSelectedIndex()
+        test(JTabbedPane.class, "selectedComponent"); // NON-NLS: getSelectedComponent()
+        test(AbstractButton.class, "disabledIcon"); // NON-NLS: getDisabledIcon()
+        test(JLabel.class, "disabledIcon"); // NON-NLS: getDisabledIcon()
+        test(JTextComponent.class, "caret"); // NON-NLS: getCaret()
+        test(JTextComponent.class, "caretPosition"); // NON-NLS: getCaretPosition()
+        test(JTextComponent.class, "selectionStart"); // NON-NLS: getSelectionStart()
+        test(JTextComponent.class, "selectionEnd"); // NON-NLS: getSelectionEnd()
+    }
+
+    private static void test(Class type) {
+        Object value = getExpectedValue(type);
+        test(value, BeanUtils.getPropertyDescriptor(type, "property")); // NON-NLS: the property to check
+        test(value, BeanUtils.getEventSetDescriptor(type, "eventSet")); // NON-NLS: the event set to check
+        System.out.println();
+    }
+
+    private static void test(Class type, String property) {
+        System.out.print(type.getName() + ": ");
+        test(Boolean.TRUE, BeanUtils.getPropertyDescriptor(type, property));
+    }
+
+    private static void test(Object expected, FeatureDescriptor fd) {
+        System.out.println(fd.getName());
+        Object actual = fd.getValue("transient"); // NON-NLS: the attribute name
+        if ((actual == null) ? (expected != null) : !actual.equals(expected))
+            throw new Error("expected " + expected + " value, but actual value is " + actual);
+    }
+
+    private static Object getExpectedValue(Class type) {
+        try {
+            return type.getField("VALUE").get(type); // NON-NLS: the field name with expected value
+        } catch (NoSuchFieldException exception) {
+            return null;
+        } catch (IllegalAccessException exception) {
+            throw new Error("unexpected error", exception);
+        }
+    }
+
+
+    public static class Null {
+        public Object getProperty() {
+            return this;
+        }
+
+        public void setProperty(Object object) {
+        }
+
+        public void addEventSetListener(EventSetListener listener) {
+        }
+
+        public void removeEventSetListener(EventSetListener listener) {
+        }
+    }
+
+    public static class True {
+        public static final Boolean VALUE = Boolean.TRUE;
+
+        @Transient
+        public Object getProperty() {
+            return this;
+        }
+
+        @Transient
+        public void setProperty(Object object) {
+        }
+
+        @Transient
+        public void addEventSetListener(EventSetListener listener) {
+        }
+
+        @Transient
+        public void removeEventSetListener(EventSetListener listener) {
+        }
+    }
+
+    public static class False {
+        public static final Boolean VALUE = Boolean.FALSE;
+
+        @Transient(false)
+        public Object getProperty() {
+            return this;
+        }
+
+        @Transient(false)
+        public void setProperty(Object object) {
+        }
+
+        @Transient(false)
+        public void addEventSetListener(EventSetListener listener) {
+        }
+
+        @Transient(false)
+        public void removeEventSetListener(EventSetListener listener) {
+        }
+    }
+
+    public static class NullNull extends Null {
+        @Override
+        public Object getProperty() {
+            return this;
+        }
+
+        @Override
+        public void setProperty(Object object) {
+        }
+
+        @Override
+        public void addEventSetListener(EventSetListener listener) {
+        }
+
+        @Override
+        public void removeEventSetListener(EventSetListener listener) {
+        }
+    }
+
+    public static class TrueNull extends Null {
+        public static final Boolean VALUE = Boolean.TRUE;
+
+        @Override
+        @Transient
+        public Object getProperty() {
+            return this;
+        }
+
+        @Override
+        @Transient
+        public void setProperty(Object object) {
+        }
+
+        @Override
+        @Transient
+        public void addEventSetListener(EventSetListener listener) {
+        }
+
+        @Override
+        @Transient
+        public void removeEventSetListener(EventSetListener listener) {
+        }
+    }
+
+    public static class FalseNull extends Null {
+        public static final Boolean VALUE = Boolean.FALSE;
+
+        @Override
+        @Transient(false)
+        public Object getProperty() {
+            return this;
+        }
+
+        @Override
+        @Transient(false)
+        public void setProperty(Object object) {
+        }
+
+        @Override
+        @Transient(false)
+        public void addEventSetListener(EventSetListener listener) {
+        }
+
+        @Override
+        @Transient(false)
+        public void removeEventSetListener(EventSetListener listener) {
+        }
+    }
+
+    public static class NullTrue extends True {
+        @Override
+        public Object getProperty() {
+            return this;
+        }
+
+        @Override
+        public void setProperty(Object object) {
+        }
+
+        @Override
+        public void addEventSetListener(EventSetListener listener) {
+        }
+
+        @Override
+        public void removeEventSetListener(EventSetListener listener) {
+        }
+    }
+
+    public static class TrueTrue extends True {
+        @Override
+        @Transient
+        public Object getProperty() {
+            return this;
+        }
+
+        @Override
+        @Transient
+        public void setProperty(Object object) {
+        }
+
+        @Override
+        @Transient
+        public void addEventSetListener(EventSetListener listener) {
+        }
+
+        @Override
+        @Transient
+        public void removeEventSetListener(EventSetListener listener) {
+        }
+    }
+
+    public static class FalseTrue extends True {
+        public static final Boolean VALUE = Boolean.FALSE;
+
+        @Override
+        @Transient(false)
+        public Object getProperty() {
+            return this;
+        }
+
+        @Override
+        @Transient(false)
+        public void setProperty(Object object) {
+        }
+
+        @Override
+        @Transient(false)
+        public void addEventSetListener(EventSetListener listener) {
+        }
+
+        @Override
+        @Transient(false)
+        public void removeEventSetListener(EventSetListener listener) {
+        }
+    }
+
+    public static class NullFalse extends False {
+        @Override
+        public Object getProperty() {
+            return this;
+        }
+
+        @Override
+        public void setProperty(Object object) {
+        }
+
+        @Override
+        public void addEventSetListener(EventSetListener listener) {
+        }
+
+        @Override
+        public void removeEventSetListener(EventSetListener listener) {
+        }
+    }
+
+    public static class TrueFalse extends False {
+        public static final Boolean VALUE = Boolean.TRUE;
+
+        @Override
+        @Transient
+        public Object getProperty() {
+            return this;
+        }
+
+        @Override
+        @Transient
+        public void setProperty(Object object) {
+        }
+
+        @Override
+        @Transient
+        public void addEventSetListener(EventSetListener listener) {
+        }
+
+        @Override
+        @Transient
+        public void removeEventSetListener(EventSetListener listener) {
+        }
+    }
+
+    public static class FalseFalse extends False {
+        @Override
+        @Transient(false)
+        public Object getProperty() {
+            return this;
+        }
+
+        @Override
+        @Transient(false)
+        public void setProperty(Object object) {
+        }
+
+        @Override
+        @Transient(false)
+        public void addEventSetListener(EventSetListener listener) {
+        }
+
+        @Override
+        @Transient(false)
+        public void removeEventSetListener(EventSetListener listener) {
+        }
+    }
+
+    public static final class EventSetListener implements EventListener {
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/beans/XMLEncoder/Test4935607.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,83 @@
+/*
+ * Copyright 2007 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.
+ *
+ * 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.
+ */
+
+/*
+ * @test %I% %G%
+ * @bug 4935607
+ * @summary Tests transient properties
+ * @author Sergey Malenkov
+ */
+
+import java.beans.Transient;
+
+public class Test4935607 extends AbstractTest<Test4935607.TransientBean> {
+    public static void main(String[] args) {
+        new Test4935607().test(true);
+    }
+
+    @Override
+    protected TransientBean getObject() {
+        TransientBean bean = new TransientBean();
+        bean.setName("some string"); // NON-NLS: some string
+        return bean;
+    }
+
+    @Override
+    protected TransientBean getAnotherObject() {
+        TransientBean bean = new TransientBean();
+        bean.setName("another string"); // NON-NLS: another string
+        bean.setComment("some comment"); // NON-NLS: some comment
+        return bean;
+    }
+
+    @Override
+    protected void validate(TransientBean before, TransientBean after) {
+        if (!before.getName().equals(after.getName()))
+            throw new Error("the name property incorrectly encoded");
+
+        if (null != after.getComment())
+            throw new Error("the comment property should be encoded");
+    }
+
+    public static class TransientBean {
+        private String name;
+        private String comment;
+
+        public String getName() {
+            return this.name;
+        }
+
+        public void setName(String name) {
+            this.name = name;
+        }
+
+        @Transient
+        public String getComment() {
+            return this.comment;
+        }
+
+        public void setComment(String comment) {
+            this.comment = comment;
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/lang/management/ManagementFactory/GetPlatformMXBeans.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,180 @@
+/*
+ * Copyright 2008 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.
+ *
+ * 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.
+ */
+
+/*
+ * @test
+ * @bug     6610094
+ * @summary Basic unit test of ManagementFactory.getPlatformMXBeans()
+ *          and also PlatformManagedObject.getObjectName()
+ * @author  Mandy Chung
+ *
+ * @run main GetPlatformMXBeans
+ */
+
+import java.lang.management.*;
+import static java.lang.management.ManagementFactory.*;
+import java.util.*;
+import javax.management.*;
+
+public class GetPlatformMXBeans {
+    private static MBeanServer platformMBeanServer =
+            getPlatformMBeanServer();
+    public static void main(String[] argv) throws Exception {
+        checkPlatformMXBean(getClassLoadingMXBean(),
+                            ClassLoadingMXBean.class,
+                            CLASS_LOADING_MXBEAN_NAME);
+        checkPlatformMXBean(getCompilationMXBean(),
+                            CompilationMXBean.class,
+                            COMPILATION_MXBEAN_NAME);
+        checkPlatformMXBean(getMemoryMXBean(),
+                            MemoryMXBean.class,
+                            MEMORY_MXBEAN_NAME);
+        checkPlatformMXBean(getOperatingSystemMXBean(),
+                            OperatingSystemMXBean.class,
+                            OPERATING_SYSTEM_MXBEAN_NAME);
+        checkPlatformMXBean(getRuntimeMXBean(),
+                            RuntimeMXBean.class,
+                            RUNTIME_MXBEAN_NAME);
+        checkPlatformMXBean(getThreadMXBean(),
+                            ThreadMXBean.class,
+                            THREAD_MXBEAN_NAME);
+        checkGarbageCollectorMXBeans(getGarbageCollectorMXBeans());
+        checkMemoryManagerMXBeans(getMemoryManagerMXBeans());
+        checkMemoryPoolMXBeans(getMemoryPoolMXBeans());
+    }
+
+    private static <T extends PlatformManagedObject>
+        void checkPlatformMXBean(T obj, Class<T> mxbeanInterface,
+                                 String mxbeanName) throws Exception
+    {
+        int numElements = (obj != null ? 1 : 0);
+        // verify local list of platform MXBeans
+        List<? extends PlatformManagedObject> mxbeans =
+            getPlatformMXBeans(mxbeanInterface);
+        if (mxbeans.size() != numElements) {
+            throw new RuntimeException("Unmatched number of platform MXBeans "
+                + mxbeans.size() + ". Expected = " + numElements);
+        }
+
+        if (obj != null) {
+            PlatformManagedObject pmo = mxbeans.get(0);
+            if (obj != pmo) {
+                throw new RuntimeException("The list returned by getPlatformMXBeans"
+                    + " not matched");
+            }
+            ObjectName on = new ObjectName(mxbeanName);
+            if (!on.equals(pmo.getObjectName())) {
+                throw new RuntimeException("Unmatched ObjectName " +
+                    pmo.getObjectName() + " Expected = " + on);
+            }
+        }
+
+        // verify platform MXBeans in the platform MBeanServer
+        mxbeans = getPlatformMXBeans(platformMBeanServer, mxbeanInterface);
+        if (mxbeans.size() != numElements) {
+            throw new RuntimeException("Unmatched number of platform MXBeans "
+                + mxbeans.size() + ". Expected = " + numElements);
+        }
+    }
+
+    private static void checkMemoryManagerMXBeans(List<MemoryManagerMXBean> objs)
+        throws Exception
+    {
+        checkPlatformMXBeans(objs, MemoryManagerMXBean.class);
+        for (MemoryManagerMXBean mxbean : objs) {
+            String domainAndType;
+            if (mxbean instanceof GarbageCollectorMXBean) {
+                domainAndType = GARBAGE_COLLECTOR_MXBEAN_DOMAIN_TYPE;
+            } else {
+                domainAndType = MEMORY_MANAGER_MXBEAN_DOMAIN_TYPE;
+            }
+            ObjectName on = new ObjectName(domainAndType +
+                                           ",name=" + mxbean.getName());
+            if (!on.equals(mxbean.getObjectName())) {
+                throw new RuntimeException("Unmatched ObjectName " +
+                    mxbean.getObjectName() + " Expected = " + on);
+            }
+        }
+    }
+    private static void checkMemoryPoolMXBeans(List<MemoryPoolMXBean> objs)
+        throws Exception
+    {
+        checkPlatformMXBeans(objs, MemoryPoolMXBean.class);
+        for (MemoryPoolMXBean mxbean : objs) {
+            ObjectName on = new ObjectName(MEMORY_POOL_MXBEAN_DOMAIN_TYPE +
+                                           ",name=" + mxbean.getName());
+            if (!on.equals(mxbean.getObjectName())) {
+                throw new RuntimeException("Unmatched ObjectName " +
+                    mxbean.getObjectName() + " Expected = " + on);
+            }
+        }
+    }
+
+    private static void checkGarbageCollectorMXBeans(List<GarbageCollectorMXBean> objs)
+        throws Exception
+    {
+        checkPlatformMXBeans(objs, GarbageCollectorMXBean.class);
+        for (GarbageCollectorMXBean mxbean : objs) {
+            ObjectName on = new ObjectName(GARBAGE_COLLECTOR_MXBEAN_DOMAIN_TYPE +
+                                           ",name=" + mxbean.getName());
+            if (!on.equals(mxbean.getObjectName())) {
+                throw new RuntimeException("Unmatched ObjectName " +
+                    mxbean.getObjectName() + " Expected = " + on);
+            }
+        }
+    }
+
+    private static <T extends PlatformManagedObject>
+        void checkPlatformMXBeans(List<T> objs, Class<T> mxbeanInterface)
+            throws Exception
+    {
+        // verify local list of platform MXBeans
+        List<? extends PlatformManagedObject> mxbeans =
+            getPlatformMXBeans(mxbeanInterface);
+        if (objs.size() != mxbeans.size()) {
+            throw new RuntimeException("Unmatched number of platform MXBeans "
+                + mxbeans.size() + ". Expected = " + objs.size());
+        }
+        List<T> list = new ArrayList<T>(objs);
+        for (PlatformManagedObject pmo : mxbeans) {
+            if (list.contains(pmo)) {
+                list.remove(pmo);
+            } else {
+                throw new RuntimeException(pmo +
+                    " not in the platform MXBean list");
+            }
+        }
+
+        if (!list.isEmpty()) {
+            throw new RuntimeException("The list returned by getPlatformMXBeans"
+                + " not matched");
+        }
+
+        // verify platform MXBeans in the platform MBeanServer
+        mxbeans = getPlatformMXBeans(platformMBeanServer, mxbeanInterface);
+        if (objs.size() != mxbeans.size()) {
+            throw new RuntimeException("Unmatched number of platform MXBeans "
+                + mxbeans.size() + ". Expected = " + objs.size());
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/lang/management/OperatingSystemMXBean/PlatformMXBeanTest.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,69 @@
+/*
+ * Copyright 2008 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.
+ *
+ * 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.
+ */
+
+/*
+ * @test
+ * @bug     6610094
+ * @summary Test the OperatingSystemMXBean instance returned by
+ *          ManagementFactory.getPlatformMXBeans()
+ * @author  Mandy Chung
+ *
+ * @run main PlatformMXBeanTest
+ */
+
+import java.lang.management.*;
+import java.util.List;
+
+public class PlatformMXBeanTest {
+    public static void main(String[] argv) throws Exception {
+        OperatingSystemMXBean osMBean = getOSPlatformMXBean(OperatingSystemMXBean.class);
+
+        // There should have only one single MXBean for the OS MXBean interfaces:
+        //   java.lang.management.OperatingSystemMXBean
+        //   com.sun.management.OperatingSystemMXBean
+        //   com.sun.management.UnixOperatingSystemMXBean
+        if (osMBean != getOSPlatformMXBean(com.sun.management.OperatingSystemMXBean.class)) {
+            throw new RuntimeException(
+                "Invalid com.sun.management.OperatingSystemMXBean instance");
+        }
+
+        if (!System.getProperty("os.name").startsWith("Windows") &&
+                osMBean != getOSPlatformMXBean(com.sun.management.UnixOperatingSystemMXBean.class)) {
+            throw new RuntimeException(
+                "Invalid com.sun.management.UnixOperatingSystemMXBean instance");
+        }
+    }
+
+    private static <T extends OperatingSystemMXBean>
+            T getOSPlatformMXBean(Class<T> c) {
+        List<T> result = ManagementFactory.getPlatformMXBeans(c);
+        if (result.isEmpty()) {
+            return null;
+        } else if (result.size() == 1) {
+            return result.get(0);
+        } else {
+            throw new RuntimeException(c.getName() + " has " +
+                result.size() + " number of instances");
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/net/CookieHandler/B6644726.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,189 @@
+/*
+ * Copyright 2008 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.
+ *
+ * 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.
+ */
+
+/*
+ * @test
+ * @bug 6644726
+ * @summary Cookie management issues
+ */
+
+import java.net.*;
+import java.util.*;
+
+public class B6644726 {
+    public static void main(String[] args) throws Exception {
+        testCookieStore();
+    }
+
+    private static void testCookieStore() throws Exception {
+        CookieManager cm = new CookieManager();
+        CookieStore cs = cm.getCookieStore();
+        URI uri = new URI("http://www.s1.sun.com/dir/foo/doc.html");
+        URI suri = new URI("https://www.s1.sun.com/dir/foo/index.html");
+        cm.setCookiePolicy(CookiePolicy.ACCEPT_ALL);
+
+        ArrayList<String> lst = new ArrayList<String>();
+        // Let's test the default path
+        lst.add("myCookie1=foo");
+        // Then some alternate expires format
+        lst.add("myCookie2=bar; path=/dir; expires=Tue, 19 Aug 2025 16:00:00 GMT");
+        lst.add("myCookie3=test; path=/dir; expires=Tue Aug 19 2025 16:00:00 GMT-0100");
+        // Then Netscape draft cookies and domains
+        lst.add("myCookie4=test; domain=.sun.com; path=/dir/foo");
+        HashMap<String, List<String>> map = new HashMap<String, List<String>>();
+        map.put("Set-Cookie", lst);
+        cm.put(uri, map);
+        map.clear();
+        lst.clear();
+        // Test for secure tag
+        lst.add("myCookie5=test; secure");
+        // Test for passing cookies between http and https
+        map.put("Set-Cookie", lst);
+        cm.put(suri, map);
+
+        List<HttpCookie> cookies = cs.getCookies();
+        // There should be 5 cookies if all dates parsed correctly
+        if (cookies.size() != 5) {
+            fail("Should have 5 cookies. Got only "+ cookies.size() + ", expires probably didn't parse correctly");
+        }
+        // Check Path for first Cookie
+        for (HttpCookie c : cookies) {
+            if (c.getName().equals("myCookie1")) {
+                if (!"/dir/foo/".equals(c.getPath())) {
+                    fail("Default path for myCookie1 is " + c.getPath());
+                }
+            }
+        }
+
+        HashMap<String, List<String>> emptyMap = new HashMap<String, List<String>>();
+        // We should get 1 Cookie: MyCookie4, because of the domain
+        Map<String, List<String>>m = cm.get(new URI("http://www.s2.sun.com/dir/foo/doc2.html"),
+                emptyMap);
+        List<String> clst = m.get("Cookie");
+        if (clst.size() != 1) {
+            fail("We should have only 1 cookie, not " + clst.size());
+        } else {
+            if (!clst.get(0).startsWith("myCookie4")) {
+                fail("The cookie should be myCookie4, not " + clst.get(0));
+            }
+        }
+        // We should get 4 cookies for non secure URI, and 5 for the secure one
+        m = cm.get(suri, emptyMap);
+        clst = m.get("Cookie");
+        if (clst.size() != 5) {
+            fail("Cookies didn't cross from http to https. Got only " + clst.size());
+        }
+
+        m = cm.get(uri, emptyMap);
+        clst = m.get("Cookie");
+        if (clst.size() != 4) {
+            fail("We should have gotten only 4 cookies over http (non secure), got " +
+                    clst.size());
+        }
+        if (isIn(clst, "myCookie5=")) {
+            // myCookie5 (the secure one) shouldn't be here
+            fail("Got the secure cookie over a non secure link");
+        }
+
+        // Let's check that empty path is treated correctly
+        uri = new URI("http://www.sun.com/");
+        lst.clear();
+        lst.add("myCookie6=foo");
+        map.clear();
+        map.put("Set-Cookie", lst);
+        cm.put(uri, map);
+        uri = new URI("http://www.sun.com");
+        m = cm.get(uri, emptyMap);
+        clst = m.get("Cookie");
+        if (clst.size() != 1) {
+            fail("Missing a cookie when using an empty path");
+        }
+
+        // And now, the other way around:
+
+        uri = new URI("http://www.sun.com");
+        lst.clear();
+        lst.add("myCookie7=foo");
+        map.clear();
+        map.put("Set-Cookie", lst);
+        cm.put(uri, map);
+        uri = new URI("http://www.sun.com/");
+        m = cm.get(uri, emptyMap);
+        clst = m.get("Cookie");
+        if (!isIn(clst, "myCookie7=")) {
+            fail("Missing a cookie when using an empty path");
+        }
+
+        // Let's make sure the 'Port' optional attributes is enforced
+
+        lst.clear();
+        lst.add("myCookie8=porttest; port");
+        lst.add("myCookie9=porttest; port=\"80,8000\"");
+        lst.add("myCookie10=porttest; port=\"8000\"");
+        map.clear();
+        map.put("Set-Cookie", lst);
+        uri = new URI("http://www.sun.com/");
+        cm.put(uri, map);
+
+        // myCookie10 should have been rejected
+        cookies = cs.getCookies();
+        for (HttpCookie c : cookies) {
+            if (c.getName().equals("myCookie10")) {
+                fail("A cookie with an invalid port list was accepted");
+            }
+        }
+
+        uri = new URI("http://www.sun.com:80/");
+        m = cm.get(uri, emptyMap);
+        clst = m.get("Cookie");
+        // We should find both myCookie8 and myCookie9 but not myCookie10
+        if (!isIn(clst, "myCookie8=") || !isIn(clst, "myCookie9=")) {
+            fail("Missing a cookie on port 80");
+        }
+        uri = new URI("http://www.sun.com:8000/");
+        m = cm.get(uri, emptyMap);
+        clst = m.get("Cookie");
+        // We should find only myCookie9
+        if (!isIn(clst, "myCookie9=")) {
+            fail("Missing a cookie on port 80");
+        }
+        if (isIn(clst, "myCookie8=")) {
+            fail("A cookie with an invalid port list was returned");
+        }
+    }
+
+    private static boolean isIn(List<String> lst, String cookie) {
+        if (lst == null || lst.isEmpty()) {
+            return false;
+        }
+        for (String s : lst) {
+            if (s.startsWith(cookie))
+                return true;
+        }
+        return false;
+    }
+
+    private static void fail(String msg) throws Exception {
+        throw new RuntimeException(msg);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/net/Inet6Address/B6558853.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,86 @@
+/*
+ * Copyright 2008 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.
+ *
+ * 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.
+ */
+
+/**
+ * @test
+ * @bug 6558853
+ * @summary  getHostAddress() on connections using IPv6 link-local addrs should have zone id
+ */
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.net.*;
+import java.util.Enumeration;
+
+public class B6558853 implements Runnable {
+    private InetAddress addr = null;
+    private int port = 0;
+
+    public static void main(String[] args) throws Exception {
+        ServerSocket ss = new ServerSocket(0);
+        int port = ss.getLocalPort();
+        Enumeration<NetworkInterface> l = NetworkInterface.getNetworkInterfaces();
+        InetAddress dest = null;
+        while (l.hasMoreElements() && dest == null) {
+            NetworkInterface nif = l.nextElement();
+            for (InterfaceAddress a : nif.getInterfaceAddresses()) {
+                if (a.getAddress() instanceof Inet6Address) {
+                    Inet6Address a6 = (Inet6Address) a.getAddress();
+                    if (a6.isLinkLocalAddress()) {
+                        dest = a6;
+                    }
+                    break;
+                }
+            }
+        }
+        if (dest != null) {
+            B6558853 test = new B6558853(dest, port);
+            Thread thread = new Thread(test);
+            thread.start();
+            Socket s = ss.accept();
+            InetAddress a = s.getInetAddress();
+            OutputStream out = s.getOutputStream();
+            out.write(1);
+            out.close();
+            if (!(a instanceof Inet6Address) || a.getHostAddress().indexOf("%") == -1) {
+                // No Scope found in the address String
+                throw new RuntimeException("Wrong address: " + a.getHostAddress());
+            }
+        }
+    }
+
+    public B6558853(InetAddress a, int port) {
+        addr = a;
+        this.port = port;
+    }
+
+    public void run() {
+        try {
+            Socket s = new Socket(addr, port);
+            InputStream in = s.getInputStream();
+            int i = in.read();
+            in.close();
+        } catch (IOException iOException) {
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/security/AccessControlContext/CheckCtor.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,70 @@
+/*
+ * Copyright 2008 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.
+ *
+ * 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.
+ */
+
+/*
+ * @test
+ * @bug 6631361
+ * @summary Test constructor when PD array is null or contains all null contexts
+ */
+
+import java.security.AccessControlContext;
+import java.security.ProtectionDomain;
+
+public class CheckCtor {
+
+    public static void main(String[] args) throws Exception {
+
+        // check that null PD array throws NPE
+        try {
+            new AccessControlContext(null);
+            throw new Exception("Expected NullPointerException not thrown");
+        } catch (Exception e) {
+            if (!(e instanceof NullPointerException)) {
+                throw new Exception("Expected NullPointerException not thrown");
+            }
+        }
+
+        // check that empty PD array equals PD array of one or more nulls
+        ProtectionDomain zero[] = {};
+        ProtectionDomain null1[] = {null};
+        ProtectionDomain null2[] = {null, null};
+
+        AccessControlContext accZero = new AccessControlContext(zero);
+        AccessControlContext accNull1 = new AccessControlContext(null1);
+        AccessControlContext accNull2 = new AccessControlContext(null2);
+
+        testEquals(accZero, accNull1);
+        testEquals(accZero, accNull2);
+        testEquals(accNull1, accNull2);
+        testEquals(accNull1, accZero);
+        testEquals(accNull2, accZero);
+        testEquals(accNull2, accNull1);
+    }
+
+    private static void testEquals(AccessControlContext acc1,
+        AccessControlContext acc2) throws Exception {
+        if (!acc1.equals(acc2)) {
+            throw new Exception("AccessControlContexts should be equal");
+        }
+    }
+}
--- a/jdk/test/java/util/Collection/MOAT.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/test/java/util/Collection/MOAT.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2008 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
@@ -25,7 +25,7 @@
  * @test
  * @bug     6207984 6272521 6192552 6269713 6197726 6260652 5073546 4137464
  *          4155650 4216399 4294891 6282555 6318622 6355327 6383475 6420753
- *          6431845 4802633 6570566 6570575 6570631 6570924
+ *          6431845 4802633 6570566 6570575 6570631 6570924 6691185 6691215
  * @summary Run many tests on many Collection and Map implementations
  * @author  Martin Buchholz
  */
@@ -155,7 +155,7 @@
         check(c.containsAll(new ArrayList<Integer>()));
     }
 
-    private static void testEmptyCollection(Collection<?> c) {
+    private static <T> void testEmptyCollection(Collection<T> c) {
         check(c.isEmpty());
         equal(c.size(), 0);
         equal(c.toString(),"[]");
@@ -165,6 +165,23 @@
         Object[] a = new Object[1]; a[0] = Boolean.TRUE;
         equal(c.toArray(a), a);
         equal(a[0], null);
+        testEmptyIterator(c.iterator());
+    }
+
+    static <T> void testEmptyIterator(final Iterator<T> it) {
+        if (rnd.nextBoolean())
+            check(! it.hasNext());
+
+        THROWS(NoSuchElementException.class,
+               new Fun(){void f(){ it.next(); }});
+
+        try { it.remove(); }
+        catch (IllegalStateException _) { pass(); }
+        catch (UnsupportedOperationException _) { pass(); }
+        catch (Throwable t) { unexpected(t); }
+
+        if (rnd.nextBoolean())
+            check(! it.hasNext());
     }
 
     private static void testEmptyList(List<?> c) {
@@ -173,10 +190,12 @@
         equal2(c, Collections.<Integer>emptyList());
     }
 
-    private static void testEmptySet(Set<?> c) {
+    private static <T> void testEmptySet(Set<T> c) {
         testEmptyCollection(c);
         equal(c.hashCode(), 0);
         equal2(c, Collections.<Integer>emptySet());
+        if (c instanceof NavigableSet<?>)
+            testEmptyIterator(((NavigableSet<T>)c).descendingIterator());
     }
 
     private static void testImmutableCollection(final Collection<Integer> c) {
@@ -221,13 +240,20 @@
         testEmptyCollection(c);
     }
 
-    private static void testEmptyMap(final Map<?,?> m) {
+    private static <K,V> void testEmptyMap(final Map<K,V> m) {
         check(m.isEmpty());
         equal(m.size(), 0);
         equal(m.toString(),"{}");
         testEmptySet(m.keySet());
         testEmptySet(m.entrySet());
         testEmptyCollection(m.values());
+
+        try { check(! m.containsValue(null)); }
+        catch (NullPointerException _) { /* OK */ }
+        try { check(! m.containsKey(null)); }
+        catch (NullPointerException _) { /* OK */ }
+        check(! m.containsValue(1));
+        check(! m.containsKey(1));
     }
 
     private static void testImmutableMap(final Map<Integer,Integer> m) {
@@ -433,8 +459,18 @@
         if (! supportsAdd(c)) return;
         //System.out.println("add() supported");
 
-        if (c instanceof NavigableSet)
-            testNavigableSet((NavigableSet<Integer>)c);
+        if (c instanceof NavigableSet) {
+            System.out.println("NavigableSet tests...");
+
+            NavigableSet<Integer> ns = (NavigableSet<Integer>)c;
+            testNavigableSet(ns);
+            testNavigableSet(ns.headSet(6, false));
+            testNavigableSet(ns.headSet(5, true));
+            testNavigableSet(ns.tailSet(0, false));
+            testNavigableSet(ns.tailSet(1, true));
+            testNavigableSet(ns.subSet(0, false, 5, true));
+            testNavigableSet(ns.subSet(1, true, 6, false));
+        }
 
         if (c instanceof Queue)
             testQueue((Queue<Integer>)c);
@@ -514,8 +550,19 @@
         if (m instanceof ConcurrentMap)
             testConcurrentMap((ConcurrentMap<Integer,Integer>) m);
 
-        if (m instanceof NavigableMap)
-            testNavigableMap((NavigableMap<Integer,Integer>) m);
+        if (m instanceof NavigableMap) {
+            System.out.println("NavigableMap tests...");
+
+            NavigableMap<Integer,Integer> nm =
+                (NavigableMap<Integer,Integer>) m;
+            testNavigableMap(nm);
+            testNavigableMap(nm.headMap(6, false));
+            testNavigableMap(nm.headMap(5, true));
+            testNavigableMap(nm.tailMap(0, false));
+            testNavigableMap(nm.tailMap(1, true));
+            testNavigableMap(nm.subMap(1, true, 6, false));
+            testNavigableMap(nm.subMap(0, false, 5, true));
+        }
 
         checkFunctionalInvariants(m);
 
@@ -697,8 +744,6 @@
 
     private static void testNavigableMap(NavigableMap<Integer,Integer> m)
     {
-        System.out.println("NavigableMap tests...");
-
         clear(m);
         checkNavigableMapKeys(m, 1, null, null, null, null);
 
@@ -717,9 +762,11 @@
         checkNavigableMapKeys(m, 5,    3,    5,    5, null);
         checkNavigableMapKeys(m, 6,    5,    5, null, null);
 
-        {
-            final Iterator<Integer> it
-                = m.descendingKeySet().iterator();
+        for (final Iterator<Integer> it :
+                 (Iterator<Integer>[])
+                 new Iterator<?>[] {
+                     m.descendingKeySet().iterator(),
+                     m.navigableKeySet().descendingIterator()}) {
             equalNext(it, 5);
             equalNext(it, 3);
             equalNext(it, 1);
@@ -742,8 +789,6 @@
 
 
     private static void testNavigableSet(NavigableSet<Integer> s) {
-        System.out.println("NavigableSet tests...");
-
         clear(s);
         checkNavigableSetKeys(s, 1, null, null, null, null);
 
@@ -762,8 +807,11 @@
         checkNavigableSetKeys(s, 5,    3,    5,    5, null);
         checkNavigableSetKeys(s, 6,    5,    5, null, null);
 
-        {
-            final Iterator<Integer> it = s.descendingIterator();
+        for (final Iterator<Integer> it :
+                 (Iterator<Integer>[])
+                 new Iterator<?>[] {
+                     s.descendingIterator(),
+                     s.descendingSet().iterator()}) {
             equalNext(it, 5);
             equalNext(it, 3);
             equalNext(it, 1);
--- a/jdk/test/java/util/NavigableMap/LockStep.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/test/java/util/NavigableMap/LockStep.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2006-2008 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
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug     6420753 6242436
+ * @bug     6420753 6242436 6691185
  * @summary Compare NavigableMap implementations for identical behavior
  * @author  Martin Buchholz
  */
@@ -159,6 +159,7 @@
         Object[] a = new Object[1]; a[0] = Boolean.TRUE;
         equal(c.toArray(a), a);
         equal(a[0], null);
+        check(! c.iterator().hasNext());
     }
 
     static void testEmptySet(Set<?> c) {
@@ -262,6 +263,16 @@
         }
     }
 
+    static void equalIterators(final Iterator<?> it1,
+                               final Iterator<?> it2) {
+        while (it1.hasNext()) {
+            if (maybe(2))
+                check(it2.hasNext());
+            equal(it1.next(), it2.next());
+        }
+        check(! it2.hasNext());
+    }
+
     static void equalNavigableSetsLeaf(final NavigableSet s1,
                                        final NavigableSet s2) {
         equal2(s1,            s2);
@@ -273,6 +284,8 @@
             equal(s1.first(), s2.first());
             equal(s1.last(),  s2.last());
         }
+        equalIterators(s1.iterator(), s2.iterator());
+        equalIterators(s1.descendingIterator(), s2.descendingIterator());
         checkNavigableSet(s1);
         checkNavigableSet(s2);
     }
@@ -493,30 +506,23 @@
 
     static MapFrobber randomAdder(NavigableMap m) {
         final Integer k = unusedKey(m);
-        MapFrobber f;
-        switch (rnd.nextInt(4)) {
-        case 0: f = new MapFrobber() {void frob(NavigableMap m) {
-            equal(m.put(k, k+1), null);
-            equal(m.get(k), k+1);
-            if (maybe(4)) {
-                equal(m.put(k, k+1), k+1);
-                equal(m.get(k), k+1);}}};
-            break;
-        case 1: f = new MapFrobber() {void frob(NavigableMap m) {
-            m.descendingMap().put(k, k+1);
-            equal(m.get(k), k+1);}};
-            break;
-        case 2: f = new MapFrobber() {void frob(NavigableMap m) {
-            m.tailMap(k,true).headMap(k,true).put(k,k+1);}};
-            break;
-        case 3: f = new MapFrobber() {void frob(NavigableMap m) {
-            m.tailMap(k,true).headMap(k,true).descendingMap().put(k,k+1);}};
-            break;
-        default: throw new Error();
-        }
-        final MapFrobber ff = f;
+        final MapFrobber[] randomAdders = {
+            new MapFrobber() {void frob(NavigableMap m) {
+                equal(m.put(k, k+1), null);
+                equal(m.get(k), k+1);
+                if (maybe(4)) {
+                    equal(m.put(k, k+1), k+1);
+                    equal(m.get(k), k+1);}}},
+            new MapFrobber() {void frob(NavigableMap m) {
+                m.descendingMap().put(k, k+1);
+                equal(m.get(k), k+1);}},
+            new MapFrobber() {void frob(NavigableMap m) {
+                m.tailMap(k,true).headMap(k,true).put(k,k+1);}},
+            new MapFrobber() {void frob(NavigableMap m) {
+                m.tailMap(k,true).headMap(k,true).descendingMap().put(k,k+1);}}
+        };
         return new MapFrobber() {void frob(NavigableMap m) {
-            ff.frob(m);
+            randomAdders[rnd.nextInt(randomAdders.length)].frob(m);
             if (maybe(2)) equal(m.get(k), k+1);
             if (maybe(4)) {
                 equal(m.put(k, k+1), k+1);
@@ -525,26 +531,19 @@
 
     static SetFrobber randomAdder(NavigableSet s) {
         final Integer e = unusedElt(s);
-        SetFrobber f;
-        switch (rnd.nextInt(4)) {
-        case 0: f = new SetFrobber() {void frob(NavigableSet s) {
-            check(s.add(e));}};
-            break;
-        case 1: f = new SetFrobber() {void frob(NavigableSet s) {
-            s.descendingSet().add(e);}};
-            break;
-        case 2: f = new SetFrobber() {void frob(NavigableSet s) {
-            s.tailSet(e,true).headSet(e,true).add(e);}};
-            break;
-        case 3: f = new SetFrobber() {void frob(NavigableSet s) {
-            s.descendingSet().tailSet(e,true).headSet(e,true).add(e);}};
-            break;
-        default: throw new Error();
-        }
-        final SetFrobber ff = f;
+        final SetFrobber[] randomAdders = {
+            new SetFrobber() {void frob(NavigableSet s) {
+                check(s.add(e));}},
+            new SetFrobber() {void frob(NavigableSet s) {
+                s.descendingSet().add(e);}},
+            new SetFrobber() {void frob(NavigableSet s) {
+                s.tailSet(e,true).headSet(e,true).add(e);}},
+            new SetFrobber() {void frob(NavigableSet s) {
+                s.descendingSet().tailSet(e,true).headSet(e,true).add(e);}}
+        };
         return new SetFrobber() {void frob(NavigableSet s) {
             if (maybe(2)) check(! s.contains(e));
-            ff.frob(s);
+            randomAdders[rnd.nextInt(randomAdders.length)].frob(s);
             if (maybe(2)) check(! s.add(e));
             if (maybe(2)) check(s.contains(e));}};
     }
@@ -605,89 +604,112 @@
 
     static MapFrobber randomRemover(NavigableMap m) {
         final Integer k = usedKey(m);
-        switch (rnd.nextInt(7)) {
-        default: throw new Error();
-        case 0: return new MapFrobber() {void frob(NavigableMap m) {
-            Map.Entry e = m.firstEntry();
-            equal(m.pollFirstEntry(), e);
-            checkUnusedKey(m, e.getKey());}};
-        case 1: return new MapFrobber() {void frob(NavigableMap m) {
-            Map.Entry e = m.lastEntry();
-            equal(m.pollLastEntry(), e);
-            checkUnusedKey(m, e.getKey());}};
-        case 2: return new MapFrobber() {void frob(NavigableMap m) {
-            check(m.remove(k) != null);
-            checkUnusedKey(m, k);}};
-        case 3: return new MapFrobber() {void frob(NavigableMap m) {
-            m.subMap(k, true, k, true).clear();
-            checkUnusedKey(m, k);}};
-        case 4: return new MapFrobber() {void frob(NavigableMap m) {
-            m.descendingMap().subMap(k, true, k, true).clear();
-            checkUnusedKey(m, k);}};
-        case 5: return new MapFrobber() {void frob(NavigableMap m) {
-            final Iterator it = m.keySet().iterator();
-            while (it.hasNext())
-                if (it.next().equals(k)) {
-                    it.remove();
-                    if (maybe(2))
-                        THROWS(IllegalStateException.class,
-                               new Fun(){void f(){ it.remove(); }});
-                }
-            checkUnusedKey(m, k);}};
-        case 6: return new MapFrobber() {void frob(NavigableMap m) {
-            final Iterator<Map.Entry> it = m.entrySet().iterator();
-            while (it.hasNext())
-                if (it.next().getKey().equals(k)) {
-                    it.remove();
-                    if (maybe(2))
-                        THROWS(IllegalStateException.class, remover(it));
-                }
-            checkUnusedKey(m, k);}};
-        }
+        final MapFrobber[] randomRemovers = {
+            new MapFrobber() {void frob(NavigableMap m) {
+                Map.Entry e = m.firstEntry();
+                equal(m.pollFirstEntry(), e);
+                checkUnusedKey(m, e.getKey());}},
+            new MapFrobber() {void frob(NavigableMap m) {
+                Map.Entry e = m.lastEntry();
+                equal(m.pollLastEntry(), e);
+                checkUnusedKey(m, e.getKey());}},
+            new MapFrobber() {void frob(NavigableMap m) {
+                check(m.remove(k) != null);
+                checkUnusedKey(m, k);}},
+            new MapFrobber() {void frob(NavigableMap m) {
+                m.subMap(k, true, k, true).clear();
+                checkUnusedKey(m, k);}},
+            new MapFrobber() {void frob(NavigableMap m) {
+                m.descendingMap().subMap(k, true, k, true).clear();
+                checkUnusedKey(m, k);}},
+            new MapFrobber() {void frob(NavigableMap m) {
+                final Iterator it = m.keySet().iterator();
+                while (it.hasNext())
+                    if (it.next().equals(k)) {
+                        it.remove();
+                        if (maybe(2))
+                            THROWS(IllegalStateException.class,
+                                   new Fun(){void f(){ it.remove(); }});
+                    }
+                checkUnusedKey(m, k);}},
+            new MapFrobber() {void frob(NavigableMap m) {
+                final Iterator it = m.navigableKeySet().descendingIterator();
+                while (it.hasNext())
+                    if (it.next().equals(k)) {
+                        it.remove();
+                        if (maybe(2))
+                            THROWS(IllegalStateException.class,
+                                   new Fun(){void f(){ it.remove(); }});
+                    }
+                checkUnusedKey(m, k);}},
+            new MapFrobber() {void frob(NavigableMap m) {
+                final Iterator<Map.Entry> it = m.entrySet().iterator();
+                while (it.hasNext())
+                    if (it.next().getKey().equals(k)) {
+                        it.remove();
+                        if (maybe(2))
+                            THROWS(IllegalStateException.class, remover(it));
+                    }
+                checkUnusedKey(m, k);}},
+        };
+
+        return randomRemovers[rnd.nextInt(randomRemovers.length)];
     }
 
     static SetFrobber randomRemover(NavigableSet s) {
         final Integer e = usedElt(s);
-        switch (rnd.nextInt(7)) {
-        default: throw new Error();
-        case 0: return new SetFrobber() {void frob(NavigableSet s) {
-            Object e = s.first();
-            equal(s.pollFirst(), e);
-            checkUnusedElt(s, e);}};
-        case 1: return new SetFrobber() {void frob(NavigableSet s) {
-            Object e = s.last();
-            equal(s.pollLast(), e);
-            checkUnusedElt(s, e);}};
-        case 2: return new SetFrobber() {void frob(NavigableSet s) {
-            check(s.remove(e));
-            checkUnusedElt(s, e);}};
-        case 3: return new SetFrobber() {void frob(NavigableSet s) {
-            s.subSet(e, true, e, true).clear();
-            checkUnusedElt(s, e);}};
-        case 4: return new SetFrobber() {void frob(NavigableSet s) {
-            s.descendingSet().subSet(e, true, e, true).clear();
-            checkUnusedElt(s, e);}};
-        case 5: return new SetFrobber() {void frob(NavigableSet s) {
-            final Iterator it = s.iterator();
-            while (it.hasNext())
-                if (it.next().equals(e)) {
-                    it.remove();
-                    if (maybe(2))
-                        THROWS(IllegalStateException.class,
-                               new Fun(){void f(){ it.remove(); }});
-                }
-            checkUnusedElt(s, e);}};
-        case 6: return new SetFrobber() {void frob(NavigableSet s) {
-            final Iterator it = s.descendingSet().iterator();
-            while (it.hasNext())
-                if (it.next().equals(e)) {
-                    it.remove();
-                    if (maybe(2))
-                        THROWS(IllegalStateException.class,
-                               new Fun(){void f(){ it.remove(); }});
-                }
-            checkUnusedElt(s, e);}};
-        }
+
+        final SetFrobber[] randomRemovers = {
+            new SetFrobber() {void frob(NavigableSet s) {
+                Object e = s.first();
+                equal(s.pollFirst(), e);
+                checkUnusedElt(s, e);}},
+            new SetFrobber() {void frob(NavigableSet s) {
+                Object e = s.last();
+                equal(s.pollLast(), e);
+                checkUnusedElt(s, e);}},
+            new SetFrobber() {void frob(NavigableSet s) {
+                check(s.remove(e));
+                checkUnusedElt(s, e);}},
+            new SetFrobber() {void frob(NavigableSet s) {
+                s.subSet(e, true, e, true).clear();
+                checkUnusedElt(s, e);}},
+            new SetFrobber() {void frob(NavigableSet s) {
+                s.descendingSet().subSet(e, true, e, true).clear();
+                checkUnusedElt(s, e);}},
+            new SetFrobber() {void frob(NavigableSet s) {
+                final Iterator it = s.iterator();
+                while (it.hasNext())
+                    if (it.next().equals(e)) {
+                        it.remove();
+                        if (maybe(2))
+                            THROWS(IllegalStateException.class,
+                                   new Fun(){void f(){ it.remove(); }});
+                    }
+                checkUnusedElt(s, e);}},
+            new SetFrobber() {void frob(NavigableSet s) {
+                final Iterator it = s.descendingSet().iterator();
+                while (it.hasNext())
+                    if (it.next().equals(e)) {
+                        it.remove();
+                        if (maybe(2))
+                            THROWS(IllegalStateException.class,
+                                   new Fun(){void f(){ it.remove(); }});
+                    }
+                checkUnusedElt(s, e);}},
+            new SetFrobber() {void frob(NavigableSet s) {
+                final Iterator it = s.descendingIterator();
+                while (it.hasNext())
+                    if (it.next().equals(e)) {
+                        it.remove();
+                        if (maybe(2))
+                            THROWS(IllegalStateException.class,
+                                   new Fun(){void f(){ it.remove(); }});
+                    }
+                checkUnusedElt(s, e);}}
+        };
+
+        return randomRemovers[rnd.nextInt(randomRemovers.length)];
     }
 
     static void lockStep(NavigableMap m1,
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/management/query/CustomQueryTest.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,116 @@
+/*
+ * Copyright 2008 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.
+ *
+ * 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.
+ */
+
+/*
+ * @test
+ * @bug 6692027
+ * @summary Check that custom subclasses of QueryEval can be serialized.
+ * @author Eamonn McManus
+ */
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.lang.management.ManagementFactory;
+import java.util.Set;
+import java.util.concurrent.atomic.AtomicInteger;
+import javax.management.MBeanServer;
+import javax.management.MalformedObjectNameException;
+import javax.management.ObjectName;
+import javax.management.QueryEval;
+import javax.management.QueryExp;
+
+public class CustomQueryTest {
+    public static interface CountMBean {
+        public int getCount();
+        public void increment();
+    }
+
+    public static class Count implements CountMBean {
+        private AtomicInteger count = new AtomicInteger();
+
+        public int getCount() {
+            return count.get();
+        }
+
+        public void increment() {
+            count.incrementAndGet();
+        }
+
+    }
+
+    public static final ObjectName countName;
+    static {
+        try {
+            countName = new ObjectName("d:type=Count");
+        } catch (MalformedObjectNameException e) {
+            throw new AssertionError(e);
+        }
+    }
+
+    /* A query that calls the increment method of the Count MBean every time
+     * it is evaluated.  If there is no ObjectName filter, the query will be
+     * evaluated for every MBean in the MBean Server, so the count will be
+     * incremented by the number of MBeans.
+     */
+    public static class IncrQuery extends QueryEval implements QueryExp {
+        public boolean apply(ObjectName name) {
+            try {
+                getMBeanServer().invoke(countName, "increment", null, null);
+                return true;
+            } catch (Throwable t) {
+                t.printStackTrace();
+                System.exit(1);
+                throw new AssertionError(); // not reached
+            }
+        }
+    }
+
+    public static void main(String[] args) throws Exception {
+        MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
+        mbs.registerMBean(new Count(), countName);
+        int mbeanCount = mbs.getMBeanCount();
+        QueryExp query = new IncrQuery();
+        Set<ObjectName> names = mbs.queryNames(null, query);
+        assertEquals(mbeanCount, names.size());
+        assertEquals(mbeanCount, mbs.getAttribute(countName, "Count"));
+        ByteArrayOutputStream bout = new ByteArrayOutputStream();
+        ObjectOutputStream oout = new ObjectOutputStream(bout);
+        oout.writeObject(query);
+        oout.close();
+        ByteArrayInputStream bin = new ByteArrayInputStream(bout.toByteArray());
+        ObjectInputStream oin = new ObjectInputStream(bin);
+        query = (QueryExp) oin.readObject();
+        names = mbs.queryNames(null, query);
+        assertEquals(mbeanCount * 2, mbs.getAttribute(countName, "Count"));
+    }
+
+    private static void assertEquals(Object expected, Object actual)
+            throws Exception {
+        if (!expected.equals(actual)) {
+            String failure = "FAILED: expected " + expected + ", got " + actual;
+            throw new Exception(failure);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/management/relation/RelationNotificationSeqNoTest.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,112 @@
+/*
+ * Copyright 2005 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.
+ *
+ * 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.
+ */
+
+/*
+ * @test
+ * @bug 6701459
+ * @summary Test sequence numbers in RelationService notifications.
+ * @author Eamonn McManus
+ */
+
+/*
+ * Bug 6701459 is for a synchronization problem that is very unlikely to occur
+ * in practice and it would be very hard to test it.  Instead we just check that
+ * the fix has not introduced any obviously-wrong behavior in the sequence
+ * numbers.
+ */
+
+import java.util.Arrays;
+import java.util.concurrent.ArrayBlockingQueue;
+import java.util.concurrent.BlockingQueue;
+import javax.management.JMX;
+import javax.management.MBeanServer;
+import javax.management.MBeanServerFactory;
+import javax.management.Notification;
+import javax.management.NotificationListener;
+import javax.management.ObjectName;
+import javax.management.relation.RelationServiceMBean;
+import javax.management.relation.Role;
+import javax.management.relation.RoleInfo;
+import javax.management.relation.RoleList;
+
+public class RelationNotificationSeqNoTest {
+    public static void main(String[] args) throws Exception {
+        MBeanServer mbs = MBeanServerFactory.newMBeanServer();
+        ObjectName relSvcName = new ObjectName("a:type=relationService");
+        RelationServiceMBean relSvc =
+                JMX.newMBeanProxy(mbs, relSvcName, RelationServiceMBean.class);
+        mbs.createMBean("javax.management.relation.RelationService",
+                        relSvcName,
+                        new Object[] {Boolean.TRUE},
+                        new String[] {"boolean"});
+
+        final BlockingQueue<Notification> q =
+                new ArrayBlockingQueue<Notification>(100);
+        NotificationListener qListener = new NotificationListener() {
+            public void handleNotification(Notification notification,
+                                           Object handback) {
+                q.add(notification);
+            }
+        };
+        mbs.addNotificationListener(relSvcName, qListener, null, null);
+
+        RoleInfo leftInfo =
+            new RoleInfo("left", "javax.management.timer.TimerMBean");
+        RoleInfo rightInfo =
+            new RoleInfo("right", "javax.management.timer.Timer");
+        relSvc.createRelationType("typeName", new RoleInfo[] {leftInfo, rightInfo});
+        ObjectName timer1 = new ObjectName("a:type=timer,number=1");
+        ObjectName timer2 = new ObjectName("a:type=timer,number=2");
+        mbs.createMBean("javax.management.timer.Timer", timer1);
+        mbs.createMBean("javax.management.timer.Timer", timer2);
+
+        Role leftRole =
+            new Role("left", Arrays.asList(new ObjectName[] {timer1}));
+        Role rightRole =
+            new Role("right", Arrays.asList(new ObjectName[] {timer2}));
+        RoleList roles =
+            new RoleList(Arrays.asList(new Role[] {leftRole, rightRole}));
+
+        final int NREPEAT = 10;
+
+        for (int i = 0; i < NREPEAT; i++) {
+            relSvc.createRelation("relationName", "typeName", roles);
+            relSvc.removeRelation("relationName");
+        }
+
+        Notification firstNotif = q.remove();
+        long seqNo = firstNotif.getSequenceNumber();
+        for (int i = 0; i < NREPEAT * 2 - 1; i++) {
+            Notification n = q.remove();
+            long nSeqNo = n.getSequenceNumber();
+            if (nSeqNo != seqNo + 1) {
+                throw new Exception(
+                        "TEST FAILED: expected seqNo " + (seqNo + 1) + "; got " +
+                        nSeqNo);
+            }
+            seqNo++;
+        }
+        System.out.println("TEST PASSED: got " + (NREPEAT * 2) + " notifications " +
+                "with contiguous sequence numbers");
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/print/PrintSE/PrintSE.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,52 @@
+/*
+ * Copyright 2008 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.
+ *
+ * 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.
+ */
+
+import java.awt.*;
+import java.awt.print.*;
+import javax.print.*;
+import javax.print.attribute.*;
+
+public class PrintSE implements Printable {
+
+    public static void main(String[] args) throws Exception {
+        GraphicsEnvironment.getLocalGraphicsEnvironment();
+
+        PrintService service = PrintServiceLookup.lookupDefaultPrintService();
+        if (service == null) {
+            System.out.println("No print service found.");
+            return;
+        }
+        SimpleDoc doc =
+             new SimpleDoc(new PrintSE(),
+                           DocFlavor.SERVICE_FORMATTED.PRINTABLE,
+                           new HashDocAttributeSet());
+        DocPrintJob job = service.createPrintJob();
+        job.print(doc, new HashPrintRequestAttributeSet());
+    }
+
+    public int print(Graphics g, PageFormat pf, int pg) {
+       if (pg > 0) return NO_SUCH_PAGE;
+       g.drawString("Test passes.", 100, 100);
+       return PAGE_EXISTS;
+   }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/print/PrintSE/PrintSE.sh	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,51 @@
+#!/bin/sh
+
+#
+# Copyright 2008 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.
+#
+# 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.
+#
+
+# @test
+# @bug 6662775
+# @summary Tests queuePrintJob is sufficient permission.
+# @run clean PrintSE
+# @run build PrintSE
+# @run compile PrintSE.java
+# @run shell/timeout=300 PrintSE.sh
+
+echo -------------------------------------------------------------
+echo Launching test for `basename $0 .sh`
+echo -------------------------------------------------------------
+
+createJavaPolicyFile()
+{
+   cat << EOF > ${TESTCLASSES}/print.policy
+grant {
+ permission java.lang.RuntimePermission "queuePrintJob";
+};
+EOF
+}
+
+createJavaPolicyFile
+
+${TESTJAVA}/bin/java -Djava.security.manager -Djava.security.policy=${TESTCLASSES}/print.policy -cp ${TESTCLASSES} PrintSE
+
+exit $?
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/security/auth/kerberos/KerberosTixDateTest.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,140 @@
+/*
+ * Copyright 2008 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.
+ *
+ * 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.
+ */
+
+/*
+ * @test
+ * @bug 6659990
+ * @summary test the immutability of the Date fields in KerberosTicket class.
+ * @ignore Must set up KDC and setup Kerberos configuration file
+ */
+
+import java.net.InetAddress;
+import java.util.Date;
+import java.io.*;
+import javax.security.auth.kerberos.KerberosKey;
+import javax.security.auth.kerberos.KerberosPrincipal;
+import javax.security.auth.kerberos.KerberosTicket;
+import sun.misc.BASE64Decoder;
+
+public class KerberosTixDateTest {
+
+    // Serialized KerberosTicket from JDK6 (encoded in BASE64)
+    // Note: the KerberosTicket object is created using the same values as
+    // the KerberosTicket 't' in main(). Deserialization should succeed
+    // and the deserialized object should equal to 't'.
+    static String serializedKerberosTix =
+"rO0ABXNyACtqYXZheC5zZWN1cml0eS5hdXRoLmtlcmJlcm9zLktlcmJlcm9zVGlja2V0ZqGBbXB3" +
+"w7sCAApbAAxhc24xRW5jb2Rpbmd0AAJbQkwACGF1dGhUaW1ldAAQTGphdmEvdXRpbC9EYXRlO0wA" +
+"BmNsaWVudHQAMExqYXZheC9zZWN1cml0eS9hdXRoL2tlcmJlcm9zL0tlcmJlcm9zUHJpbmNpcGFs" +
+"O1sAD2NsaWVudEFkZHJlc3Nlc3QAF1tMamF2YS9uZXQvSW5ldEFkZHJlc3M7TAAHZW5kVGltZXEA" +
+"fgACWwAFZmxhZ3N0AAJbWkwACXJlbmV3VGlsbHEAfgACTAAGc2VydmVycQB+AANMAApzZXNzaW9u" +
+"S2V5dAAmTGphdmF4L3NlY3VyaXR5L2F1dGgva2VyYmVyb3MvS2V5SW1wbDtMAAlzdGFydFRpbWVx" +
+"AH4AAnhwdXIAAltCrPMX+AYIVOACAAB4cAAAAARhc24xc3IADmphdmEudXRpbC5EYXRlaGqBAUtZ" +
+"dBkDAAB4cHcIAAAAAAC8YU54c3IALmphdmF4LnNlY3VyaXR5LmF1dGgua2VyYmVyb3MuS2VyYmVy" +
+"b3NQcmluY2lwYWyZp31dDx4zKQMAAHhwdXEAfgAIAAAAEzARoAMCAQGhCjAIGwZjbGllbnR1cQB+" +
+"AAgAAAAVGxNKTEFCUy5TRkJBWS5TVU4uQ09NeHBxAH4AC3VyAAJbWlePIDkUuF3iAgAAeHAAAAAg" +
+"AAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABxAH4AC3NxAH4ADHVxAH4ACAAAABMwEaAD" +
+"AgEBoQowCBsGc2VydmVydXEAfgAIAAAAFRsTSkxBQlMuU0ZCQVkuU1VOLkNPTXhzcgAkamF2YXgu" +
+"c2VjdXJpdHkuYXV0aC5rZXJiZXJvcy5LZXlJbXBskoOG6DyvS9cDAAB4cHVxAH4ACAAAABUwE6AD" +
+        "AgEBoQwECnNlc3Npb25LZXl4cQB+AAs=";
+
+    public static void main(String[] args) throws Exception {
+        byte[] asn1Bytes = "asn1".getBytes();
+        KerberosPrincipal client = new KerberosPrincipal("client");
+        KerberosPrincipal server = new KerberosPrincipal("server");
+        byte[] keyBytes = "sessionKey".getBytes();
+        long originalTime = 12345678L;
+        Date inDate = new Date(originalTime);
+        boolean[] flags = new boolean[9];
+        flags[8] = true; // renewable
+        KerberosTicket t = new KerberosTicket(asn1Bytes, client, server,
+                keyBytes, 1 /*keyType*/, flags, inDate /*authTime*/,
+                inDate /*startTime*/, inDate /*endTime*/,
+                inDate /*renewTill*/, null /*clientAddresses*/);
+        inDate.setTime(0); // for testing the constructor
+
+        testDateImmutability(t, originalTime);
+        testS11nCompatibility(t); // S11n: Serialization
+    }
+
+    private static void checkTime(KerberosTicket kt, long timeValue) {
+        if (kt.getAuthTime().getTime() != timeValue) {
+            throw new RuntimeException("authTime check fails!");
+        }
+        if (kt.getStartTime().getTime() != timeValue) {
+            throw new RuntimeException("startTime check fails!");
+        }
+        if (kt.getEndTime().getTime() != timeValue) {
+            throw new RuntimeException("endTime check fails!");
+        }
+        if (kt.getRenewTill().getTime() != timeValue) {
+            throw new RuntimeException("renewTill check fails!");
+        }
+    }
+
+    private static void testDateImmutability(KerberosTicket t, long origTime)
+        throws Exception {
+        // test the constructor
+        System.out.println("Testing constructor...");
+        checkTime(t, origTime);
+
+        // test the getAuth/Start/EndTime() & getRenewTill() methods
+        System.out.println("Testing getAuth/Start/EndTime() & getRenewTill()...");
+        t.getAuthTime().setTime(0);
+        t.getStartTime().setTime(0);
+        t.getEndTime().setTime(0);
+        t.getRenewTill().setTime(0);
+        checkTime(t, origTime);
+
+        System.out.println("DateImmutability Test Passed");
+    }
+
+    private static void checkEqualsAndHashCode(byte[] bytes, KerberosTicket t)
+        throws IOException, ClassNotFoundException {
+        ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
+        KerberosTicket deserializedTicket = (KerberosTicket)
+                (new ObjectInputStream(bais).readObject());
+        if (!deserializedTicket.equals(t)) {
+            throw new RuntimeException("equals() check fails!");
+        }
+        if (deserializedTicket.hashCode() != t.hashCode()) {
+            throw new RuntimeException("hashCode() check fails!");
+        }
+    }
+
+    private static void testS11nCompatibility(KerberosTicket t)
+        throws Exception {
+
+        System.out.println("Testing against KerberosTicket from JDK6...");
+        byte[] serializedBytes =
+            new BASE64Decoder().decodeBuffer(serializedKerberosTix);
+        checkEqualsAndHashCode(serializedBytes, t);
+
+        System.out.println("Testing against KerberosTicket from current rel...");
+        ByteArrayOutputStream baos = new ByteArrayOutputStream();
+        new ObjectOutputStream(baos).writeObject(t);
+        checkEqualsAndHashCode(baos.toByteArray(), t);
+
+        System.out.println("S11nCompatibility Test Passed");
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/security/auth/login/Configuration/ConfigFileWithBlank.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,50 @@
+/*
+ * Copyright 2008 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.
+ *
+ * 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.
+ */
+
+/*
+ * @test
+ * @bug 6675606
+ * @summary javax.security.auth.login.Configuration does not recognize path with spaces
+ */
+
+import java.io.File;
+import java.io.FileOutputStream;
+import javax.security.auth.login.*;
+
+import java.net.URI;
+import java.security.URIParameter;
+
+public class ConfigFileWithBlank {
+    public static void main(String[] args) throws Exception {
+        File f = new File("a b c");
+        FileOutputStream fos = new FileOutputStream(f);
+        fos.write("".getBytes());
+        fos.close();
+        System.err.println(f.toURI());
+        try {
+            Configuration.getInstance("JavaLoginConfig", new URIParameter(f.toURI()));
+        } finally {
+            f.delete();
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/swing/JColorChooser/Test6348456.html	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,9 @@
+<html>
+<body>
+When applet starts, you'll see that the preview is white.
+When you swap models, you'll see that the preview color is changed.
+
+<applet width="500" height="400" code="Test6348456.class">
+</applet>
+</body>
+</html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/swing/JColorChooser/Test6348456.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,63 @@
+/*
+ * Copyright 2008 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.
+ *
+ * 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.
+ */
+
+/*
+ * @test
+ * @bug 6348456
+ * @summary Tests model changing
+ * @author Sergey Malenkov
+ * @run applet/manual=yesno Test6348456.html
+ */
+
+import java.awt.BorderLayout;
+import java.awt.Color;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import javax.swing.JApplet;
+import javax.swing.JButton;
+import javax.swing.JColorChooser;
+import javax.swing.colorchooser.DefaultColorSelectionModel;
+
+public final class Test6348456 extends JApplet implements ActionListener {
+
+    private static final DefaultColorSelectionModel WHITE = new DefaultColorSelectionModel(Color.WHITE);
+    private static final DefaultColorSelectionModel BLACK = new DefaultColorSelectionModel(Color.BLACK);
+
+    private JColorChooser chooser;
+
+    @Override
+    public void init() {
+        JButton button = new JButton("Swap models");
+        button.addActionListener(this);
+
+        this.chooser = new JColorChooser(Color.RED);
+        this.chooser.setSelectionModel(WHITE);
+
+        add(BorderLayout.NORTH, button);
+        add(BorderLayout.CENTER, this.chooser);
+    }
+
+    public void actionPerformed(ActionEvent event){
+        this.chooser.setSelectionModel(this.chooser.getSelectionModel() == BLACK ? WHITE : BLACK);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/swing/JEditorPane/bug4714674.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,124 @@
+/* @test
+   @bug 4714674
+   @summary Tests that JEditorPane opens HTTP connection asynchronously
+   @author Peter Zhelezniakov
+   @run main bug4714674
+*/
+
+import javax.swing.*;
+
+import com.sun.net.httpserver.HttpExchange;
+import com.sun.net.httpserver.HttpHandler;
+import com.sun.net.httpserver.HttpServer;
+import java.io.IOException;
+import java.net.InetSocketAddress;
+import java.util.concurrent.Executors;
+
+
+public class bug4714674 {
+
+    public static void main(String[] args) throws Exception {
+        new bug4714674().test();
+    }
+
+    private void test() throws Exception {
+        final DeafServer server = new DeafServer();
+        final String baseURL = "http://localhost:" + server.getPort() + "/";
+
+        SwingUtilities.invokeLater(new Runnable() {
+            public void run() {
+                try {
+                    JEditorPane pane = new JEditorPane();
+                    ((javax.swing.text.AbstractDocument)pane.getDocument()).
+                            setAsynchronousLoadPriority(1);
+
+                    // this will block EDT unless 4714674 is fixed
+                    pane.setPage(baseURL);
+                } catch (IOException e) {
+                    // should not happen
+                    throw new Error(e);
+                }
+            }
+        });
+
+        // if 4714674 is fixed, this executes before connection times out
+        SwingUtilities.invokeLater(new Runnable() {
+            public void run() {
+                synchronized (server) {
+                    server.wakeup = true;
+                    server.notifyAll();
+                }
+                pass();
+            }
+        });
+
+        // wait, then check test status
+        try {
+            Thread.sleep(5000);
+            if (!passed()) {
+                throw new RuntimeException("Failed: EDT was blocked");
+            }
+        } finally {
+            server.destroy();
+        }
+    }
+
+    private boolean passed = false;
+
+    private synchronized boolean passed() {
+        return passed;
+    }
+
+    private synchronized void pass() {
+        passed = true;
+    }
+}
+
+/**
+ * A "deaf" HTTP server that does not respond to requests.
+ */
+class DeafServer {
+    HttpServer server;
+    boolean wakeup = false;
+
+    /**
+     * Create and start the HTTP server.
+     */
+    public DeafServer() throws IOException {
+        InetSocketAddress addr = new InetSocketAddress(0);
+        server = HttpServer.create(addr, 0);
+        HttpHandler handler = new DeafHandler();
+        server.createContext("/", handler);
+        server.setExecutor(Executors.newCachedThreadPool());
+        server.start();
+    }
+
+    /**
+     * Stop server without any delay.
+     */
+    public void destroy() {
+        server.stop(0);
+    }
+
+    /**
+     * Return actual server port number, useful for constructing request URIs.
+     */
+    public int getPort() {
+        return server.getAddress().getPort();
+    }
+
+
+    class DeafHandler implements HttpHandler {
+        public void handle(HttpExchange r) throws IOException {
+            synchronized (DeafServer.this) {
+                while (! wakeup) {
+                    try {
+                        DeafServer.this.wait();
+                    } catch (InterruptedException e) {
+                        // just wait again
+                    }
+                }
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/swing/JFileChooser/4252173/bug4252173.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,58 @@
+/*
+ * Copyright 2007 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.
+ *
+ * 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.
+ */
+
+/* @test
+   @bug 4252173
+   @summary Inability to reuse the HorizontalSliderThumbIcon
+   @author Pavel Porvatov
+   @run main bug4252173
+*/
+
+import javax.swing.*;
+import javax.swing.plaf.metal.DefaultMetalTheme;
+import javax.swing.plaf.metal.MetalLookAndFeel;
+import java.awt.*;
+import java.awt.image.BufferedImage;
+import java.lang.reflect.InvocationTargetException;
+
+public class bug4252173 {
+    public static void main(String[] args) throws InvocationTargetException, InterruptedException {
+        SwingUtilities.invokeAndWait(new Runnable() {
+            public void run() {
+                MetalLookAndFeel.setCurrentTheme(new DefaultMetalTheme());
+
+                JComponent component = new JLabel();
+
+                Icon horizontalThumbIcon = UIManager.getIcon("Slider.horizontalThumbIcon");
+
+                Icon verticalThumbIcon = UIManager.getIcon("Slider.verticalThumbIcon");
+
+                Graphics g = new BufferedImage(100, 100, BufferedImage.TYPE_4BYTE_ABGR).getGraphics();
+
+                horizontalThumbIcon.paintIcon(component, g, 0, 0);
+
+                verticalThumbIcon.paintIcon(component, g, 0, 0);
+            }
+        });
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/swing/JFileChooser/6524424/bug6524424.html	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,11 @@
+<html>
+<body>
+<applet  code="bug6524424.class" width=200 height=200></applet>
+To test fix follow the next steps:
+1. Select a slider (do the next steps for every slider)
+2. Check that the next keyboard buttons work correctly:
+    Up, Down, Left, Right, Page Up, Page Down
+3. Press left mouse button on a free space of the slider and check
+    that thumb moves correctly
+</body>
+</html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/swing/JFileChooser/6524424/bug6524424.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,99 @@
+/*
+ * Copyright 2008 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.
+ *
+ * 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.
+ */
+
+/* @test
+ * @bug 6524424
+ * @summary JSlider Clicking In Tracks Behavior Inconsistent For Different Tick Spacings
+ * @author Pavel Porvatov
+ * @run applet/manual=done bug6524424.html
+ */
+
+import java.awt.*;
+import javax.swing.*;
+
+import com.sun.java.swing.plaf.windows.WindowsLookAndFeel;
+
+public class bug6524424 extends JApplet {
+    public static void main(String[] args) {
+        try {
+            UIManager.setLookAndFeel(new WindowsLookAndFeel());
+        } catch (UnsupportedLookAndFeelException e) {
+            e.printStackTrace();
+
+            return;
+        }
+
+        TestPanel panel = new TestPanel();
+
+        JFrame frame = new JFrame();
+
+        frame.setContentPane(panel);
+        frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
+        frame.pack();
+        frame.setLocationRelativeTo(null);
+
+        frame.setVisible(true);
+    }
+
+    public void init() {
+        TestPanel panel = new TestPanel();
+
+        setContentPane(panel);
+    }
+
+    private static class TestPanel extends JPanel {
+
+        private TestPanel() {
+            super(new GridBagLayout());
+
+            JSlider slider1 = createSlider(1, 2);
+            JSlider slider2 = createSlider(2, 4);
+            JSlider slider3 = createSlider(3, 6);
+
+            addComponent(this, slider1);
+            addComponent(this, slider2);
+            addComponent(this, slider3);
+        }
+
+        private JSlider createSlider(int tickMinor, int tickMajor) {
+            JSlider result = new JSlider();
+
+            result.setPaintLabels(true);
+            result.setPaintTicks(true);
+            result.setSnapToTicks(true);
+            result.setMinimum(0);
+            result.setMaximum(12);
+            result.setMinorTickSpacing(tickMinor);
+            result.setMajorTickSpacing(tickMajor);
+
+            return result;
+        }
+    }
+
+    private static void addComponent(JPanel panel, Component component) {
+        panel.add(component, new GridBagConstraints(0,
+                panel.getComponentCount(), 1, 1,
+                1, 0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL,
+                new Insets(0, 0, 0, 0), 0, 0));
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/swing/JFileChooser/6688203/bug6688203.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,81 @@
+/*
+ * Copyright 2008 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.
+ *
+ * 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.
+ */
+
+/* @test
+   @bug 6688203
+   @summary Memory leak and performance problems in the method getFileSystemView of FileSystemView
+   @author Pavel Porvatov
+   @run main bug6688203
+*/
+
+import javax.swing.*;
+import javax.swing.filechooser.FileSystemView;
+import java.io.File;
+import java.lang.reflect.Field;
+
+public class bug6688203 {
+    public static void main(String[] args) {
+        // Create an instance of FileSystemView
+        FileSystemView.getFileSystemView();
+
+        int startCount = UIManager.getPropertyChangeListeners().length;
+
+        for (int i = 0; i < 100; i++) {
+            FileSystemView.getFileSystemView();
+        }
+
+        if (startCount != UIManager.getPropertyChangeListeners().length) {
+            throw new RuntimeException("New listeners were added into UIManager");
+        }
+
+        FileSystemView fileSystemView = FileSystemView.getFileSystemView();
+        File file = new File("Some file");
+
+        for (UIManager.LookAndFeelInfo lafInfo : UIManager.getInstalledLookAndFeels()) {
+            try {
+                UIManager.setLookAndFeel(lafInfo.getClassName());
+            } catch (Exception e) {
+                // Ignore such errors
+                System.out.println("Cannot set LAF " + lafInfo.getName());
+
+                continue;
+            }
+
+            fileSystemView.getSystemDisplayName(file);
+
+            try {
+                Field field = FileSystemView.class.getDeclaredField("useSystemExtensionHiding");
+
+                field.setAccessible(true);
+
+                Boolean value = field.getBoolean(fileSystemView);
+
+                if (value != UIManager.getDefaults().getBoolean("FileChooser.useSystemExtensionHiding")) {
+                    throw new RuntimeException("Invalid cached value of the FileSystemView.useSystemExtensionHiding field");
+                }
+            } catch (Exception e) {
+                throw new RuntimeException("Cannot read the FileSystemView.useSystemExtensionHiding field", e);
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/swing/JPopupMenu/6675802/bug6675802.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2008 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.
+ *
+ * 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.
+ */
+
+/*
+ * @test
+ * @bug 6675802
+ * @summary Checks that there is no AccessControlException when
+ * a heaviweight popup menu is shown from an applet.
+ * @author Mikhail Lapshin
+ * @run main bug6675802
+ */
+
+import javax.swing.*;
+
+public class bug6675802 {
+    public static void main(String[] args) {
+        System.setSecurityManager(new SecurityManager());
+        final JPopupMenu popupMenu = new JPopupMenu();
+        popupMenu.add(new JMenuItem("Click"));
+        popupMenu.show(null, 0, 0);
+        System.out.println("Test passed");
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/swing/JPopupMenu/6690791/bug6690791.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,44 @@
+/*
+ * Copyright 2008 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.
+ *
+ * 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.
+ */
+
+/*
+ * @test
+ * @bug 6690791
+ * @summary Checks that there is no ClassCastException
+ * in MenuSelectionManager.processMouseEvent()
+ * @author Mikhail Lapshin
+ * @run main bug6690791
+ */
+
+import javax.swing.*;
+import java.awt.event.MouseEvent;
+
+public class bug6690791 {
+    public static void main(String[] args) throws Exception {
+        MouseEvent me = new MouseEvent(new JLabel(), MouseEvent.MOUSE_CLICKED,
+                System.currentTimeMillis(), MouseEvent.ALT_MASK,
+                10, 10, 100, 100, 1, false, MouseEvent.BUTTON1);
+        me.setSource(new Object());
+        MenuSelectionManager.defaultManager().processMouseEvent(me);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/swing/JPopupMenu/6691503/bug6691503.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,113 @@
+/*
+ * Copyright 2008 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.
+ *
+ * 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.
+ */
+
+/*
+ * @test
+ * @bug 6691503
+ * @summary Checks that there is no opportunity for a malicious applet
+ * to show a popup menu which has whole screen size.
+ * a heaviweight popup menu is shown from an applet.
+ * @author Mikhail Lapshin
+ * @run main bug6691503
+ */
+
+import sun.awt.SunToolkit;
+
+import javax.swing.*;
+import java.awt.*;
+
+public class bug6691503 {
+    private JPopupMenu popupMenu;
+    private JFrame frame;
+    private boolean isAlwaysOnTop1 = false;
+    private boolean isAlwaysOnTop2 = true;
+
+    public static void main(String[] args) {
+        bug6691503 test = new bug6691503();
+        test.setupUI();
+        test.testApplication();
+        test.testApplet();
+        test.checkResult();
+        test.stopEDT();
+    }
+
+    private void setupUI() {
+        SwingUtilities.invokeLater(new Runnable() {
+            public void run() {
+                frame = new JFrame();
+                frame.setVisible(true);
+                popupMenu = new JPopupMenu();
+                JMenuItem click = new JMenuItem("Click");
+                popupMenu.add(click);
+            }
+        });
+    }
+
+    private void testApplication() {
+        SwingUtilities.invokeLater(new Runnable() {
+            public void run() {
+                popupMenu.show(frame, 0, 0);
+                Window popupWindow = (Window)
+                        (popupMenu.getParent().getParent().getParent().getParent());
+                isAlwaysOnTop1 = popupWindow.isAlwaysOnTop();
+                System.out.println(
+                        "Application: popupWindow.isAlwaysOnTop() = " + isAlwaysOnTop1);
+                popupMenu.setVisible(false);
+            }
+        });
+    }
+
+    private void testApplet() {
+        SwingUtilities.invokeLater(new Runnable() {
+            public void run() {
+                System.setSecurityManager(new SecurityManager());
+                popupMenu.show(frame, 0, 0);
+                Window popupWindow = (Window)
+                        (popupMenu.getParent().getParent().getParent().getParent());
+                isAlwaysOnTop2 = popupWindow.isAlwaysOnTop();
+                System.out.println(
+                        "Applet: popupWindow.isAlwaysOnTop() = " + isAlwaysOnTop2);
+                popupMenu.setVisible(false);
+            }
+        });
+    }
+
+    private void checkResult() {
+        ((SunToolkit)(Toolkit.getDefaultToolkit())).realSync();
+        if (!isAlwaysOnTop1 || isAlwaysOnTop2) {
+            throw new RuntimeException("Malicious applet can show always-on-top " +
+                    "popup menu which has whole screen size");
+        }
+        System.out.println("Test passed");
+    }
+
+    private void stopEDT() {
+        SwingUtilities.invokeLater(new Runnable() {
+            public void run() {
+                frame.dispose();
+            }
+        });
+    }
+}
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/swing/JScrollPane/6612531/bug6612531.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,42 @@
+/*
+ * Copyright 2008 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.
+ *
+ * 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.
+ */
+
+/*
+ * @test
+ * @bug 6612531
+ * @summary Checks that ScrollPaneLayout.preferredLayoutSize() doesn't throw NPE.
+ * @author Mikhail Lapshin
+ * @run main bug6612531
+ */
+
+import javax.swing.*;
+
+public class bug6612531 {
+    public static void main(String[] args) {
+        ScrollPaneLayout c = new ScrollPaneLayout();
+        JViewport vp = new JViewport();
+        c.addLayoutComponent("VIEWPORT", vp);
+        c.preferredLayoutSize(new JScrollPane());
+        System.out.println("Test passed");
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/swing/border/Test6625450.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,67 @@
+/*
+ * Copyright 2008 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.
+ *
+ * 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.
+ */
+
+/*
+ * @test
+ * @bug 6625450
+ * @summary Tests the baseline of the titled border
+ * @author Sergey Malenkov
+ */
+
+import java.awt.Component;
+import javax.swing.border.TitledBorder;
+
+public class Test6625450 {
+
+    public static void main(String[] args) {
+        // test height
+        test(false, 0, Integer.MAX_VALUE);
+        test(false, 0, 1);
+        test(true, 0, -1);
+        test(true, 0, Integer.MIN_VALUE);
+        // test width
+        test(false, Integer.MAX_VALUE, 0);
+        test(false, 1, 0);
+        test(true, -1, 0);
+        test(true, Integer.MIN_VALUE, 0);
+    }
+
+    private static final TitledBorder BORDER = new TitledBorder("123");
+    private static final Component COMPONENT = new Component() {
+    };
+
+    private static void test(boolean expected, int width, int height) {
+        try {
+            BORDER.getBaseline(COMPONENT, width, height);
+
+            if (expected) {
+                throw new Error("expected IllegalArgumentException");
+            }
+        }
+        catch (IllegalArgumentException exception) {
+            if (!expected) {
+                throw new Error("unexpected exception", exception);
+            }
+        }
+    }
+}
--- a/jdk/test/sun/java2d/cmm/ProfileOp/ReadProfileTest.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/test/sun/java2d/cmm/ProfileOp/ReadProfileTest.java	Thu Jun 12 13:50:55 2008 -0700
@@ -23,7 +23,7 @@
 
 /**
  * @test
- * @bug 6476665
+ * @bug 6476665 6523403
  * @summary Verifies reading profiles of the standard color spaces
  * @run main ReadProfileTest
  */
--- a/jdk/test/sun/management/HotspotClassLoadingMBean/GetClassInitializationTime.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/test/sun/management/HotspotClassLoadingMBean/GetClassInitializationTime.java	Thu Jun 12 13:50:55 2008 -0700
@@ -37,7 +37,7 @@
 public class GetClassInitializationTime {
 
     private static HotspotClassLoadingMBean mbean =
-        (HotspotClassLoadingMBean)ManagementFactory.getHotspotClassLoadingMBean();
+        (HotspotClassLoadingMBean)ManagementFactoryHelper.getHotspotClassLoadingMBean();
 
     // Careful with these values.
     private static final long MIN_TIME_FOR_PASS = 1;
--- a/jdk/test/sun/management/HotspotClassLoadingMBean/GetClassLoadingTime.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/test/sun/management/HotspotClassLoadingMBean/GetClassLoadingTime.java	Thu Jun 12 13:50:55 2008 -0700
@@ -39,7 +39,7 @@
 public class GetClassLoadingTime {
 
     private static HotspotClassLoadingMBean mbean =
-        (HotspotClassLoadingMBean)ManagementFactory.getHotspotClassLoadingMBean();
+        (HotspotClassLoadingMBean)ManagementFactoryHelper.getHotspotClassLoadingMBean();
 
     // Careful with these values.
     private static final long MIN_TIME_FOR_PASS = 1;
--- a/jdk/test/sun/management/HotspotClassLoadingMBean/GetInitializedClassCount.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/test/sun/management/HotspotClassLoadingMBean/GetInitializedClassCount.java	Thu Jun 12 13:50:55 2008 -0700
@@ -37,7 +37,7 @@
 public class GetInitializedClassCount {
 
     private static HotspotClassLoadingMBean mbean =
-        (HotspotClassLoadingMBean)ManagementFactory.getHotspotClassLoadingMBean();
+        (HotspotClassLoadingMBean)ManagementFactoryHelper.getHotspotClassLoadingMBean();
 
     // Careful with these values.
     private static final long MIN_VALUE_FOR_PASS = 1;
--- a/jdk/test/sun/management/HotspotClassLoadingMBean/GetLoadedClassSize.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/test/sun/management/HotspotClassLoadingMBean/GetLoadedClassSize.java	Thu Jun 12 13:50:55 2008 -0700
@@ -37,7 +37,7 @@
 public class GetLoadedClassSize {
 
     private static HotspotClassLoadingMBean mbean =
-        (HotspotClassLoadingMBean)ManagementFactory.getHotspotClassLoadingMBean();
+        (HotspotClassLoadingMBean)ManagementFactoryHelper.getHotspotClassLoadingMBean();
 
     // Careful with these values.
     private static final long MIN_VALUE_FOR_PASS = 1;
--- a/jdk/test/sun/management/HotspotClassLoadingMBean/GetMethodDataSize.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/test/sun/management/HotspotClassLoadingMBean/GetMethodDataSize.java	Thu Jun 12 13:50:55 2008 -0700
@@ -37,7 +37,7 @@
 public class GetMethodDataSize {
 
     private static HotspotClassLoadingMBean mbean =
-        (HotspotClassLoadingMBean)ManagementFactory.getHotspotClassLoadingMBean();
+        (HotspotClassLoadingMBean)ManagementFactoryHelper.getHotspotClassLoadingMBean();
 
     // Careful with these values.
     private static final long MIN_VALUE_FOR_PASS = 1;
--- a/jdk/test/sun/management/HotspotClassLoadingMBean/GetUnloadedClassSize.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/test/sun/management/HotspotClassLoadingMBean/GetUnloadedClassSize.java	Thu Jun 12 13:50:55 2008 -0700
@@ -37,7 +37,7 @@
 public class GetUnloadedClassSize {
 
     private static HotspotClassLoadingMBean mbean =
-        (HotspotClassLoadingMBean)ManagementFactory.getHotspotClassLoadingMBean();
+        (HotspotClassLoadingMBean)ManagementFactoryHelper.getHotspotClassLoadingMBean();
 
     // Careful with these values.
     private static final long MIN_VALUE_FOR_PASS = 0;
--- a/jdk/test/sun/management/HotspotRuntimeMBean/GetSafepointCount.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/test/sun/management/HotspotRuntimeMBean/GetSafepointCount.java	Thu Jun 12 13:50:55 2008 -0700
@@ -37,7 +37,7 @@
 public class GetSafepointCount {
 
     private static HotspotRuntimeMBean mbean =
-        (HotspotRuntimeMBean)ManagementFactory.getHotspotRuntimeMBean();
+        (HotspotRuntimeMBean)ManagementFactoryHelper.getHotspotRuntimeMBean();
 
     private static final long NUM_THREAD_DUMPS = 5;
 
--- a/jdk/test/sun/management/HotspotRuntimeMBean/GetSafepointSyncTime.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/test/sun/management/HotspotRuntimeMBean/GetSafepointSyncTime.java	Thu Jun 12 13:50:55 2008 -0700
@@ -37,7 +37,7 @@
 public class GetSafepointSyncTime {
 
     private static HotspotRuntimeMBean mbean =
-        (HotspotRuntimeMBean)ManagementFactory.getHotspotRuntimeMBean();
+        (HotspotRuntimeMBean)ManagementFactoryHelper.getHotspotRuntimeMBean();
 
     private static final long NUM_THREAD_DUMPS = 300;
 
--- a/jdk/test/sun/management/HotspotRuntimeMBean/GetTotalSafepointTime.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/test/sun/management/HotspotRuntimeMBean/GetTotalSafepointTime.java	Thu Jun 12 13:50:55 2008 -0700
@@ -37,7 +37,7 @@
 public class GetTotalSafepointTime {
 
     private static HotspotRuntimeMBean mbean =
-        (HotspotRuntimeMBean)ManagementFactory.getHotspotRuntimeMBean();
+        (HotspotRuntimeMBean)ManagementFactoryHelper.getHotspotRuntimeMBean();
 
     private static final long NUM_THREAD_DUMPS = 100;
 
--- a/jdk/test/sun/management/HotspotThreadMBean/GetInternalThreads.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/test/sun/management/HotspotThreadMBean/GetInternalThreads.java	Thu Jun 12 13:50:55 2008 -0700
@@ -32,10 +32,11 @@
 import sun.management.*;
 import java.util.*;
 import java.lang.management.ThreadMXBean;
+import java.lang.management.ManagementFactory;
 
 public class GetInternalThreads {
     private static HotspotThreadMBean mbean =
-        ManagementFactory.getHotspotThreadMBean();
+        ManagementFactoryHelper.getHotspotThreadMBean();
 
     // Minimum number of VM internal threads
     //   VM thread, watcher thread, Low memory detector, compiler thread
@@ -55,7 +56,7 @@
         System.out.println("Internal Thread Count = " + value);
 
         ThreadMXBean thread =
-            java.lang.management.ManagementFactory.getThreadMXBean();
+            ManagementFactory.getThreadMXBean();
         if (!thread.isThreadCpuTimeSupported()) {
             System.out.println("Thread Cpu Time is not supported.");
             return;
--- a/jdk/test/tools/launcher/Arrrghs.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/test/tools/launcher/Arrrghs.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1,17 +1,5 @@
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-import java.util.StringTokenizer;
-
 /*
- * Copyright 2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2007-2008 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
@@ -33,8 +21,19 @@
  * have any questions.
  */
 
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import java.util.StringTokenizer;
 
-public class Arrrghs{
+public class Arrrghs {
 
     /**
      * A group of tests to ensure that arguments are passed correctly to
@@ -113,12 +112,10 @@
         return retval;
     }
 
-
-
     private static boolean doExec0(ProcessBuilder pb, String expectedArguments) {
         boolean retval = false;
         try {
-            pb.redirectErrorStream(_debug);
+            pb.redirectErrorStream(true);
             Process p = pb.start();
             retval = detectCookie(p.getInputStream(), expectedArguments);
             p.waitFor();
@@ -167,7 +164,6 @@
             }
         }
 
-
         if (_debug) System.out.println("Starting Arrrghs tests");
         // Basic test
         if (!doExec("-a -b -c -d")) exitValue++;
--- a/jdk/test/tools/launcher/Arrrghs.sh	Thu Jun 05 15:57:56 2008 -0700
+++ b/jdk/test/tools/launcher/Arrrghs.sh	Thu Jun 12 13:50:55 2008 -0700
@@ -1,13 +1,13 @@
 #!/bin/sh
 # @test Arrrghs.sh
-# @bug 5030233 6214916 6356475 6571029
+# @bug 5030233 6214916 6356475 6571029 6684582
 # @build Arrrghs
 # @run shell Arrrghs.sh
 # @summary Argument parsing validation.
 # @author Joseph E. Kowalski
 
 #
-# Copyright 2004-2007 Sun Microsystems, Inc.  All Rights Reserved.
+# Copyright 2004-2008 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
@@ -104,6 +104,44 @@
 }
 
 #
+# Test to ensure that a missing main class is indicated in the error message
+#
+TestMissingMainClass() {
+	# First create a small jar file with no main
+        printf "public class Foo {}\n" > Foo.java
+	$TESTJAVA/bin/javac Foo.java
+	if [ $? -ne 0 ]; then
+		printf "Error: compilation of Foo.java failed\n" 
+ 		exit 1
+	fi
+	printf "Main-Class: Bar\n" > manifest
+	$TESTJAVA/bin/jar -cvfm some.jar manifest Foo.class
+	if [ ! -f some.jar ]; then
+		printf "Error: did not find some.jar\n" 
+ 		exit 1
+	fi
+
+	# test a non-existence main-class using -jar 
+	mess="`$TESTJAVA/bin/java -jar some.jar 2>&1 1>/dev/null`"
+	echo $mess | grep 'Bar' 2>&1 > /dev/null
+	if [ $? -ne 0 ]; then
+		printf "Error: did not find main class missing message\n"
+		exit 1
+	fi
+
+	# test a non-existent main-class using classpath
+	mess="`$TESTJAVA/bin/java -cp some.jar Bar 2>&1 1>/dev/null`"
+	echo $mess | grep 'Bar' 2>&1 > /dev/null
+	if [ $? -ne 0 ]; then
+		printf "Error: did not find main class missing message\n"
+		exit 1
+	fi
+
+	# cleanup
+	rm -f some.jar Foo.* manifest
+}
+
+#
 # Main processing:
 #
 
@@ -117,6 +155,7 @@
 TestCP javac -classpath
 TestXUsage
 TestHelp
+TestMissingMainClass
 
 #
 # Tests for 6214916
--- a/langtools/.hgtags	Thu Jun 05 15:57:56 2008 -0700
+++ b/langtools/.hgtags	Thu Jun 12 13:50:55 2008 -0700
@@ -1,2 +1,4 @@
 9a66ca7c79fab293c1bb0534e0d208c7e4f58b01 jdk7-b24
 58039502942e52f4144a33f36290a2bd2f3581e6 jdk7-b25
+c46d25a2350ac147d0121d9c9725af6fcb1b4dbe jdk7-b26
+a17265993253d61becd04fe7d96d1fe8b4bd6dff jdk7-b27
--- a/langtools/src/share/classes/com/sun/tools/javac/code/Type.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/Type.java	Thu Jun 12 13:50:55 2008 -0700
@@ -640,6 +640,10 @@
             return typarams_field;
         }
 
+        public boolean hasErasedSupertypes() {
+            return isRaw();
+        }
+
         public Type getEnclosingType() {
             return outer_field;
         }
@@ -711,6 +715,17 @@
         }
     }
 
+    public static class ErasedClassType extends ClassType {
+        public ErasedClassType(Type outer, TypeSymbol tsym) {
+            super(outer, List.<Type>nil(), tsym);
+        }
+
+        @Override
+        public boolean hasErasedSupertypes() {
+            return true;
+        }
+    }
+
     public static class ArrayType extends Type
             implements javax.lang.model.type.ArrayType {
 
--- a/langtools/src/share/classes/com/sun/tools/javac/code/Types.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/Types.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1499,47 +1499,68 @@
      * type parameters in t are deleted.
      */
     public Type erasure(Type t) {
+        return erasure(t, false);
+    }
+    //where
+    private Type erasure(Type t, boolean recurse) {
         if (t.tag <= lastBaseTag)
             return t; /* fast special case */
         else
-            return erasure.visit(t);
+            return erasure.visit(t, recurse);
     }
     // where
-        private UnaryVisitor<Type> erasure = new UnaryVisitor<Type>() {
-            public Type visitType(Type t, Void ignored) {
+        private SimpleVisitor<Type, Boolean> erasure = new SimpleVisitor<Type, Boolean>() {
+            public Type visitType(Type t, Boolean recurse) {
                 if (t.tag <= lastBaseTag)
                     return t; /*fast special case*/
                 else
-                    return t.map(erasureFun);
+                    return t.map(recurse ? erasureRecFun : erasureFun);
             }
 
             @Override
-            public Type visitWildcardType(WildcardType t, Void ignored) {
-                return erasure(upperBound(t));
-            }
-
-            @Override
-            public Type visitClassType(ClassType t, Void ignored) {
-                return t.tsym.erasure(Types.this);
+            public Type visitWildcardType(WildcardType t, Boolean recurse) {
+                return erasure(upperBound(t), recurse);
             }
 
             @Override
-            public Type visitTypeVar(TypeVar t, Void ignored) {
-                return erasure(t.bound);
+            public Type visitClassType(ClassType t, Boolean recurse) {
+                Type erased = t.tsym.erasure(Types.this);
+                if (recurse) {
+                    erased = new ErasedClassType(erased.getEnclosingType(),erased.tsym);
+                }
+                return erased;
             }
 
             @Override
-            public Type visitErrorType(ErrorType t, Void ignored) {
+            public Type visitTypeVar(TypeVar t, Boolean recurse) {
+                return erasure(t.bound, recurse);
+            }
+
+            @Override
+            public Type visitErrorType(ErrorType t, Boolean recurse) {
                 return t;
             }
         };
+
     private Mapping erasureFun = new Mapping ("erasure") {
             public Type apply(Type t) { return erasure(t); }
         };
 
+    private Mapping erasureRecFun = new Mapping ("erasureRecursive") {
+        public Type apply(Type t) { return erasureRecursive(t); }
+    };
+
     public List<Type> erasure(List<Type> ts) {
         return Type.map(ts, erasureFun);
     }
+
+    public Type erasureRecursive(Type t) {
+        return erasure(t, true);
+    }
+
+    public List<Type> erasureRecursive(List<Type> ts) {
+        return Type.map(ts, erasureRecFun);
+    }
     // </editor-fold>
 
     // <editor-fold defaultstate="collapsed" desc="makeCompoundType">
@@ -1626,15 +1647,14 @@
                     if (t.supertype_field == null) {
                         List<Type> actuals = classBound(t).allparams();
                         List<Type> formals = t.tsym.type.allparams();
-                        if (actuals.isEmpty()) {
-                            if (formals.isEmpty())
-                                // Should not happen.  See comments below in interfaces
-                                t.supertype_field = supertype;
-                            else
-                                t.supertype_field = erasure(supertype);
-                        } else {
+                        if (t.hasErasedSupertypes()) {
+                            t.supertype_field = erasureRecursive(supertype);
+                        } else if (formals.nonEmpty()) {
                             t.supertype_field = subst(supertype, formals, actuals);
                         }
+                        else {
+                            t.supertype_field = supertype;
+                        }
                     }
                 }
                 return t.supertype_field;
@@ -1708,18 +1728,15 @@
                         assert t != t.tsym.type : t.toString();
                         List<Type> actuals = t.allparams();
                         List<Type> formals = t.tsym.type.allparams();
-                        if (actuals.isEmpty()) {
-                            if (formals.isEmpty()) {
-                                // In this case t is not generic (nor raw).
-                                // So this should not happen.
-                                t.interfaces_field = interfaces;
-                            } else {
-                                t.interfaces_field = erasure(interfaces);
-                            }
-                        } else {
+                        if (t.hasErasedSupertypes()) {
+                            t.interfaces_field = erasureRecursive(interfaces);
+                        } else if (formals.nonEmpty()) {
                             t.interfaces_field =
                                 upperBounds(subst(interfaces, formals, actuals));
                         }
+                        else {
+                            t.interfaces_field = interfaces;
+                        }
                     }
                 }
                 return t.interfaces_field;
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Attr.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Attr.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1810,7 +1810,7 @@
             chk.earlyRefError(tree.pos(), sym.kind == VAR ? sym : thisSym(tree.pos(), env));
         }
         Env<AttrContext> env1 = env;
-        if (sym.kind != ERR && sym.owner != null && sym.owner != env1.enclClass.sym) {
+        if (sym.kind != ERR && sym.kind != TYP && sym.owner != null && sym.owner != env1.enclClass.sym) {
             // If the found symbol is inaccessible, then it is
             // accessed through an enclosing instance.  Locate this
             // enclosing instance:
@@ -1878,8 +1878,10 @@
         boolean varArgs = env.info.varArgs;
         tree.sym = sym;
 
-        if (site.tag == TYPEVAR && !isType(sym) && sym.kind != ERR)
-            site = capture(site.getUpperBound());
+        if (site.tag == TYPEVAR && !isType(sym) && sym.kind != ERR) {
+            while (site.tag == TYPEVAR) site = site.getUpperBound();
+            site = capture(site);
+        }
 
         // If that symbol is a variable, ...
         if (sym.kind == VAR) {
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Check.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Check.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1247,7 +1247,7 @@
                 for (Type t2 = sup;
                      t2.tag == CLASS;
                      t2 = types.supertype(t2)) {
-                    for (Scope.Entry e2 = t1.tsym.members().lookup(s1.name);
+                    for (Scope.Entry e2 = t2.tsym.members().lookup(s1.name);
                          e2.scope != null;
                          e2 = e2.next()) {
                         Symbol s2 = e2.sym;
@@ -1394,6 +1394,16 @@
             while (e.scope != null) {
                 if (m.overrides(e.sym, origin, types, false))
                     checkOverride(tree, m, (MethodSymbol)e.sym, origin);
+                else if (e.sym.isInheritedIn(origin, types) && !m.isConstructor()) {
+                    Type er1 = m.erasure(types);
+                    Type er2 = e.sym.erasure(types);
+                    if (types.isSameType(er1,er2)) {
+                            log.error(TreeInfo.diagnosticPositionFor(m, tree),
+                                    "name.clash.same.erasure.no.override",
+                                    m, m.location(),
+                                    e.sym, e.sym.location());
+                    }
+                }
                 e = e.next();
             }
         }
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Lower.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Lower.java	Thu Jun 12 13:50:55 2008 -0700
@@ -2863,13 +2863,15 @@
             JCExpressionStatement step = make.Exec(makeUnary(JCTree.PREINC, make.Ident(index)));
 
             Type elemtype = types.elemtype(tree.expr.type);
-            JCStatement loopvarinit = make.
-                VarDef(tree.var.sym,
-                       make.
-                       Indexed(make.Ident(arraycache), make.Ident(index)).
-                       setType(elemtype));
+            JCExpression loopvarinit = make.Indexed(make.Ident(arraycache),
+                                                    make.Ident(index)).setType(elemtype);
+            JCVariableDecl loopvardef = (JCVariableDecl)make.VarDef(tree.var.mods,
+                                                  tree.var.name,
+                                                  tree.var.vartype,
+                                                  loopvarinit).setType(tree.var.type);
+            loopvardef.sym = tree.var.sym;
             JCBlock body = make.
-                Block(0, List.of(loopvarinit, tree.body));
+                Block(0, List.of(loopvardef, tree.body));
 
             result = translate(make.
                                ForLoop(loopinit,
@@ -2944,7 +2946,11 @@
             JCExpression vardefinit = make.App(make.Select(make.Ident(itvar), next));
             if (iteratorTarget != syms.objectType)
                 vardefinit = make.TypeCast(iteratorTarget, vardefinit);
-            JCVariableDecl indexDef = make.VarDef(tree.var.sym, vardefinit);
+            JCVariableDecl indexDef = (JCVariableDecl)make.VarDef(tree.var.mods,
+                                                  tree.var.name,
+                                                  tree.var.vartype,
+                                                  vardefinit).setType(tree.var.type);
+            indexDef.sym = tree.var.sym;
             JCBlock body = make.Block(0, List.of(indexDef, tree.body));
             result = translate(make.
                 ForLoop(List.of(init),
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/TransTypes.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/TransTypes.java	Thu Jun 12 13:50:55 2008 -0700
@@ -690,13 +690,15 @@
 
     public void visitSelect(JCFieldAccess tree) {
         Type t = tree.selected.type;
-        if (t.isCompound() || (t.tag == TYPEVAR && t.getUpperBound().isCompound())) {
+        while (t.tag == TYPEVAR)
+            t = t.getUpperBound();
+        if (t.isCompound()) {
             if ((tree.sym.flags() & IPROXY) != 0) {
                 tree.sym = ((MethodSymbol)tree.sym).
                     implemented((TypeSymbol)tree.sym.owner, types);
             }
             tree.selected = cast(
-                translate(tree.selected, erasure(t)),
+                translate(tree.selected, erasure(tree.selected.type)),
                 erasure(tree.sym.owner.type));
         } else
             tree.selected = translate(tree.selected, erasure(t));
--- a/langtools/src/share/classes/com/sun/tools/javac/parser/Parser.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/parser/Parser.java	Thu Jun 12 13:50:55 2008 -0700
@@ -1006,7 +1006,10 @@
                     break loop;
                 case DOT:
                     S.nextToken();
+                    int oldmode = mode;
+                    mode &= ~NOPARAMS;
                     typeArgs = typeArgumentsOpt(EXPR);
+                    mode = oldmode;
                     if ((mode & EXPR) != 0) {
                         switch (S.token()) {
                         case CLASS:
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/foreach/T6682380.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,45 @@
+/*
+ * Copyright 2008 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.
+ *
+ * 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.
+ */
+
+/*
+ * @test
+ * @bug 6682380 6679509
+ * @summary Foreach loop with generics inside finally block crashes javac with -target 1.5
+ * @author Jan Lahoda, Maurizio Cimadamore
+ * @compile -target 1.5 T6682380.java
+ */
+
+import java.util.List;
+
+public class T6682380<X> {
+
+    public static void main(String[] args) {
+        try {
+        } finally {
+            List<T6682380<?>> l = null;
+            T6682380<?>[] a = null;
+            for (T6682380<?> e1 : l);
+            for (T6682380<?> e2 : a);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/generics/5009937/T5009937.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2008 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.
+ *
+ * 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.
+ */
+
+/*
+ * @test
+ * @bug 5009937
+ * @summary hiding versus generics versus binary compatibility
+ * @author Maurizio Cimadamore
+ *
+ * @compile/fail/ref=T5009937.out -XDstdout -XDrawDiagnostics T5009937.java
+ */
+
+public class T5009937<X> {
+    static class A {
+        static void m(T5009937<String> l) {}
+    }
+
+    static class B extends A {
+        static void m(T5009937<Integer> l) {}
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/generics/5009937/T5009937.out	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,2 @@
+T5009937.java:39:21: compiler.err.name.clash.same.erasure.no.override: m(T5009937<java.lang.Integer>), T5009937.B, m(T5009937<java.lang.String>), T5009937.A
+1 error
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/generics/6531075/T6531075.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,66 @@
+/*
+ * Copyright 2008 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.
+ *
+ * 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.
+ */
+
+/*
+ * @test
+ * @bug 6531075
+ *
+ * @summary Missing synthetic casts when accessing fields/methods of intersection types including type variables
+ * @author Maurizio Cimadamore
+ *
+ */
+
+
+public class T6531075 {
+
+    static class A {
+        void a() {}
+    }
+
+    static interface I{
+        void i();
+    }
+
+    static class E extends A implements I{
+        public void i() {}
+    }
+
+    static class C<W extends A & I, T extends W>{
+        T t;
+        W w;
+        C(W w, T t) {
+            this.w = w;
+            this.t = t;
+        }
+    }
+
+    public static void main(String... args) {
+        C<E,E> c = new C<E,E>(new E(), new E());
+        testMemberMethods(c);
+    }
+
+    static void testMemberMethods(C<?, ?> arg) {
+        arg.t.a();
+        arg.t.i();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/generics/Casting5.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,45 @@
+/*
+ * Copyright 2004 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.
+ *
+ * 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.
+ */
+
+/*
+ * @test
+ * @bug 6559182
+ * @summary Cast from a raw type with non-generic supertype to a raw type fails unexpectedly
+ * @author Maurizio Cimadamore
+ *
+ * @compile Casting5.java
+ */
+
+class Casting5 {
+    static interface Super<P> {}
+    static class Y implements Super<Integer>{}
+    static interface X extends Super<Double>{}
+    static class S<L> extends Y {}
+    static interface T<L> extends X {}
+
+    public static void main(String... args) {
+        S s = null; // same if I use S<Byte>
+        T t = null; // same if I use T<Byte>
+        t = (T) s;
+    }
+}
--- a/langtools/test/tools/javac/generics/InheritanceConflict.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/langtools/test/tools/javac/generics/InheritanceConflict.java	Thu Jun 12 13:50:55 2008 -0700
@@ -25,7 +25,7 @@
  * @test
  * @bug 4984158
  * @summary two inherited methods with same signature
- * @author gafter
+ * @author gafter, Maurizio Cimadamore
  *
  * @compile/fail -source 1.5 InheritanceConflict.java
  */
@@ -34,8 +34,11 @@
 
 class A<T> {
     void f(String s) {}
+}
+
+class B<T> extends A<T> {
     void f(T t) {}
 }
 
-class B extends A<String> {
+class C extends B<String> {
 }
--- a/langtools/test/tools/javac/generics/InheritanceConflict2.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/langtools/test/tools/javac/generics/InheritanceConflict2.java	Thu Jun 12 13:50:55 2008 -0700
@@ -25,7 +25,7 @@
  * @test
  * @bug 4984158
  * @summary two inherited methods with same signature
- * @author gafter
+ * @author gafter, Maurizio Cimadamore
  *
  * @compile -source 1.5 InheritanceConflict2.java
  */
@@ -34,9 +34,12 @@
 
 class A<T> {
     void f(String s) {}
+}
+
+class B<T> extends A<T> {
     void f(T t) {}
 }
 
-class B extends A<String> {
+class C extends B<String> {
     void f(String s) {}
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/generics/T6481655.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2008 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.
+ *
+ * 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.
+ */
+
+/*
+ * @test
+ * @bug     6481655
+ * @summary Parser confused by combination of parens and explicit type args
+ * @author Maurizio Cimadamore
+ */
+
+public class T6481655 {
+
+    public static <T> T getT(T t) {
+        return t;
+    }
+
+    public static void main(String... s) {
+        T6481655.<String>getT("");
+        (T6481655.<String>getT("")).getClass();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/generics/T6657499.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,44 @@
+/*
+ * Copyright 2008 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.
+ *
+ * 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.
+ */
+
+/*
+ * @test
+ *
+ * @bug 6657499
+ * @summary generics: javac 1.6.0 fails to compile class with inner class
+ * @author Maurizio Cimadamore
+ *
+ */
+
+public class T6657499<T> {
+    T t;
+    public T test() {
+        class Local {private T t;};
+        class Local2 {T m() {return t;}};
+        T t3 = new Local().t;
+        return new Local2().m();
+    }
+    public static void main(String[] args) {
+        String s = new T6657499<String>().test();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/generics/inference/6356673/T6365166.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2008 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.
+ *
+ * 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.
+ */
+
+/**
+ * @test
+ * @bug     6365166
+ * @summary javac (generic) unable to resolve methods
+ * @author Maurizio Cimadamore
+ *
+ * @compile T6365166.java
+ */
+
+import java.util.*;
+
+public class T6365166 {
+    static <A> void add(List<? super A> l, List<A> la) {
+        l.addAll(la); //doesn't compile - but it should
+    }
+}
+
--- a/langtools/test/tools/javac/generics/inference/6611449/T6611449.java	Thu Jun 05 15:57:56 2008 -0700
+++ b/langtools/test/tools/javac/generics/inference/6611449/T6611449.java	Thu Jun 12 13:50:55 2008 -0700
@@ -29,18 +29,18 @@
  */
 public class T6611449<S> {
 
-    T6611449() {this(1);}
-
-    <T extends S> T6611449(T t1) {this(t1, 1);}
+    <T extends S> T6611449(T t1) {}
 
     <T extends S> T6611449(T t1, T t2) {}
 
-    <T extends S> void m(T t1) {}
+    <T extends S> void m1(T t1) {}
 
-    <T extends S> void m(T t1, T t2) {}
+    <T extends S> void m2(T t1, T t2) {}
 
     void test() {
+        new T6611449<S>(1);
+        new T6611449<S>(1, 1); //internal error: lub is erroneously applied to primitive types
         m1(1);
-        m2(1, 1);
+        m2(1, 1); //internal error: lub is erroneously applied to primitive types
     }
 }
--- a/langtools/test/tools/javac/generics/inference/6611449/T6611449.out	Thu Jun 05 15:57:56 2008 -0700
+++ b/langtools/test/tools/javac/generics/inference/6611449/T6611449.out	Thu Jun 12 13:50:55 2008 -0700
@@ -1,5 +1,5 @@
-T6611449.java:32:17: compiler.err.cant.resolve.location: (- compiler.misc.kindname.constructor), T6611449, (int), , (- compiler.misc.kindname.class), T6611449<S>
-T6611449.java:34:35: compiler.err.cant.resolve.location: (- compiler.misc.kindname.constructor), T6611449, (T,int), , (- compiler.misc.kindname.class), T6611449<S>
-T6611449.java:43:9: compiler.err.cant.resolve.location: (- compiler.misc.kindname.method), m1, (int), , (- compiler.misc.kindname.class), T6611449<S>
-T6611449.java:44:9: compiler.err.cant.resolve.location: (- compiler.misc.kindname.method), m2, (int,int), , (- compiler.misc.kindname.class), T6611449<S>
+T6611449.java:41:9: compiler.err.cant.resolve.location: (- compiler.misc.kindname.constructor), T6611449, (int), , (- compiler.misc.kindname.class), T6611449<S>
+T6611449.java:42:9: compiler.err.cant.resolve.location: (- compiler.misc.kindname.constructor), T6611449, (int,int), , (- compiler.misc.kindname.class), T6611449<S>
+T6611449.java:43:9: compiler.err.cant.apply.symbol: <T>m1(T), T6611449<S>, , int, null
+T6611449.java:44:9: compiler.err.cant.apply.symbol: <T>m2(T,T), T6611449<S>, , int,int, null
 4 errors
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/generics/wildcards/T6450290.java	Thu Jun 12 13:50:55 2008 -0700
@@ -0,0 +1,44 @@
+/*
+ * Copyright 2004-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.
+ *
+ * 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.
+ */
+
+/*
+ * @test
+ * @bug 6450290
+ * @summary Capture of nested wildcards causes type error
+ * @author Maurizio Cimadamore
+ * @compile/fail T6450290.java
+ */
+
+public class T6450290 {
+    static class Box<X extends Box<?,?>, T extends X> {
+        T value;
+        Box<X, T> same;
+    }
+
+    static class A extends Box<A,A> {}
+    static class B extends Box<B,B> {}
+    public static void main(String[] args) {
+        Box<?,?> b = new Box<Box<A,A>,Box<A,A>>();
+        b.value.same = new Box<B,B>(); //javac misses this bad assignment
+    }
+}