Merge
authorlana
Mon, 24 Feb 2014 12:57:31 -0800
changeset 23093 d27bb191657e
parent 23087 a80e124f2f3a (current diff)
parent 23092 64904fcdd0ee (diff)
child 23095 4489a70abccd
Merge
--- a/jaxp/THIRD_PARTY_README	Fri Feb 21 11:40:06 2014 -0800
+++ b/jaxp/THIRD_PARTY_README	Mon Feb 24 12:57:31 2014 -0800
@@ -2,11 +2,12 @@
 -----------------------------
 
 %% This notice is provided with respect to ASM Bytecode Manipulation 
-Framework v3.1, which is included with JRE 7, JDK 7, and OpenJDK 7.
+Framework v5.0, which may be included with JRE 8, and JDK 8, and 
+OpenJDK 8.
 
 --- begin of LICENSE ---
 
-Copyright (c) 2000-2005 INRIA, France Telecom
+Copyright (c) 2000-2011 France Télécom
 All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
@@ -40,8 +41,41 @@
 
 --------------------------------------------------------------------------------
 
-%% This notice is provided with respect to CodeViewer 1.0, which is included 
-with JDK 7.
+%% This notice is provided with respect to BSDiff v4.3, which may be 
+included with JRE 8, JDK 8, and OpenJDK 8.
+
+--- begin of LICENSE ---
+
+Copyright 2003-2005 Colin Percival
+All rights reserved
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted providing that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+notice, this list of conditions and the following disclaimer in the
+documentation and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
+
+--- end of LICENSE ---
+
+-------------------------------------------------------------------------------
+
+%% This notice is provided with respect to CodeViewer 1.0, which may be
+included with JDK 8.
 
 --- begin of LICENSE ---
 
@@ -81,8 +115,8 @@
 
 -------------------------------------------------------------------------------
 
-%% This notice is provided with respect to Cryptix AES 3.2.0, which is
-included with JRE 7, JDK 7, and OpenJDK 7.
+%% This notice is provided with respect to Cryptix AES 3.2.0, which may be
+included with JRE 8, JDK 8, and OpenJDK 8.
 
 --- begin of LICENSE ---
 
@@ -121,7 +155,7 @@
 -------------------------------------------------------------------------------
 
 %% This notice is provided with respect to CUP Parser Generator for 
-Java 0.10k, which is included with JRE 7, JDK 7, and OpenJDK 7.
+Java 0.10k, which may be included with JRE 8, JDK 8, and OpenJDK 8.
 
 --- begin of LICENSE ---
 
@@ -148,7 +182,7 @@
 -------------------------------------------------------------------------------
 
 %% This notice is provided with respect to Document Object Model (DOM) Level 2
-& 3, which is included with JRE 7, JDK 7, and OpenJDK 7.
+& 3, which may be included with JRE 8, JDK 8, and OpenJDK 8.
 
 --- begin of LICENSE ---
 
@@ -212,19 +246,52 @@
 
 -------------------------------------------------------------------------------
 
+%% This notice is provided with respect to Dynalink v0.5, which may be 
+included with JRE 8, JDK 8, and OpenJDK 8.
+
+--- begin of LICENSE ---
+
+Copyright (c) 2009-2013, Attila Szegedi
+
+All rights reserved.Redistribution and use in source and binary forms, with or
+without modification, are permitted provided that the following conditions are
+met:* Redistributions of source code must retain the above copyright notice,
+this list of conditions and the following disclaimer.  * Redistributions in
+binary form must reproduce the above copyright notice,   this list of
+conditions and the following disclaimer in the documentation  and/or other
+materials provided with the distribution.  * Neither the name of Attila
+Szegedi nor the names of its contributors may be used to endorse or promote
+products derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THEPOSSIBILITY OF SUCH DAMAGE.
+
+--- end of LICENSE ---
+
+-------------------------------------------------------------------------------
+
 %% This notice is provided with respect to Elliptic Curve Cryptography, which 
-is included with JRE 7, JDK 7, and OpenJDK 7.
+may be included with JRE 8, JDK 8, and OpenJDK 8.
 
 You are receiving a copy of the Elliptic Curve Cryptography library in source
-form with the JDK 7 source distribution and object code in the JRE 7 & JDK 7
-runtime.
-
-The terms of the Oracle license do NOT apply to the Elliptic Curve
-Cryptography library program; it is licensed under the following license,
-separately from the Oracle programs you receive. If you do not wish to install
-this program, you may delete the library named libsunec.so (on Solaris and
-Linux systems) or sunec.dll (on Windows systems) from the JRE bin directory
-reserved for native libraries.
+form with the JDK 8 and OpenJDK 8 source distributions, and as object code in
+the JRE 8 & JDK 8 runtimes.
+
+In the case of the JRE 8 & JDK 8 runtimes, the terms of the Oracle license do
+NOT apply to the Elliptic Curve Cryptography library; it is licensed under the
+following license, separately from Oracle's JDK & JRE.  If you do not wish to
+install the Elliptic Curve Cryptography library, you may delete the library
+named libsunec.so (on Solaris and Linux systems) or sunec.dll (on Windows
+systems) from the JRE bin directory reserved for native libraries.
+
 
 --- begin of LICENSE ---
 
@@ -735,13 +802,138 @@
 
 -------------------------------------------------------------------------------
 
-%% This notice is provided with respect to FontConfig 2.5, which is 
-included with JRE 7, JDK 7, and OpenJDK 7 source distributions on
+%% This notice is provided with respect to  ECMAScript Language
+Specification ECMA-262 Edition 5.1 which may be included with 
+JRE 8, JDK 8, and OpenJDK 8.
+
+--- begin of LICENSE ---
+
+Copyright notice
+Copyright © 2011 Ecma International
+Ecma International
+Rue du Rhone 114
+CH-1204 Geneva
+Tel: +41 22 849 6000
+Fax: +41 22 849 6001
+Web: http://www.ecma-international.org
+
+This document and possible translations of it may be copied and furnished to
+others, and derivative works that comment on or otherwise explain it or assist
+in its implementation may be prepared, copied, published, and distributed, in
+whole or in part, without restriction of any kind, provided that the above
+copyright notice and this section are included on all such copies and derivative
+works. However, this document itself may not be modified in any way, including
+by removing the copyright notice or references to Ecma International, except as
+needed for the purpose of developing any document or deliverable produced by
+Ecma International (in which case the rules applied to copyrights must be
+followed) or as required to translate it into languages other than English. The
+limited permissions granted above are perpetual and will not be revoked by Ecma
+International or its successors or assigns. This document and the information
+contained herein is provided on an "AS IS" basis and ECMA INTERNATIONAL
+DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY
+WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY OWNERSHIP
+RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR
+PURPOSE." Software License
+
+All Software contained in this document ("Software)" is protected by copyright
+and is being made available under the "BSD License", included below. This
+Software may be subject to third party rights (rights from parties other than
+Ecma International), including patent rights, and no licenses under such third
+party rights are granted under this license even if the third party concerned is
+a member of Ecma International. SEE THE ECMA CODE OF CONDUCT IN PATENT MATTERS
+AVAILABLE AT http://www.ecma-international.org/memento/codeofconduct.htm FOR
+INFORMATION REGARDING THE LICENSING OF PATENT CLAIMS THAT ARE REQUIRED TO
+IMPLEMENT ECMA INTERNATIONAL STANDARDS*. Redistribution and use in source and
+binary forms, with or without modification, are permitted provided that the
+following conditions are met:
+
+1. Redistributions of source code must retain the above copyright notice, this
+list of conditions and the following disclaimer.
+
+2. Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions and the following disclaimer in the documentation and/or
+other materials provided with the distribution.
+
+3. Neither the name of the authors nor Ecma International may be used to endorse
+or promote products derived from this software without specific prior written
+permission.
+
+THIS SOFTWARE IS PROVIDED BY THE ECMA INTERNATIONAL "AS IS" AND ANY EXPRESS OR
+IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
+SHALL ECMA INTERNATIONAL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
+OF SUCH DAMAGE.
+--- end of LICENSE ---
+
+%% This notice is provided with respect to Dynalink library which is included
+with the Nashorn technology.
+
+--- begin of LICENSE ---
+Copyright (c) 2009-2013, Attila Szegedi
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+* Redistributions of source code must retain the above copyright
+  notice, this list of conditions and the following disclaimer.
+* Redistributions in binary form must reproduce the above copyright
+  notice, this list of conditions and the following disclaimer in the
+  documentation and/or other materials provided with the distribution.
+* Neither the name of the copyright holder nor the names of
+  contributors may be used to endorse or promote products derived from
+  this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER
+BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+--- end of LICENSE ---
+
+%% This notice is provided with respect to Joni library which is included
+with the Nashorn technology.
+
+--- begin of LICENSE ---
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+of the Software, and to permit persons to whom the Software is furnished to do
+so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
+--- end of LICENSE ---
+
+-------------------------------------------------------------------------------
+
+%% This notice is provided with respect to FontConfig 2.5, which may be 
+included with JRE 8, JDK 8, and OpenJDK 8 source distributions on
 Linux and Solaris.
 
 --- begin of LICENSE ---
 
-Copyright © 2001,2003 Keith Packard
+Copyright © 2001,2003 Keith Packard
 
 Permission to use, copy, modify, distribute, and sell this software and its
 documentation for any purpose is hereby granted without fee, provided that the
@@ -765,7 +957,7 @@
 -------------------------------------------------------------------------------
 
 %% This notice is provided with respect to IAIK PKCS#11 Wrapper, 
-which is included with JRE 7, JDK 7, and OpenJDK 7.
+which may be included with JRE 8, JDK 8, and OpenJDK 8.
 
 --- begin of LICENSE ---
 
@@ -816,7 +1008,7 @@
 -------------------------------------------------------------------------------
 
 %% This notice is provided with respect to ICU4C 4.0.1 and ICU4J 4.4, which 
-is included with JRE 7, JDK 7, and OpenJDK 7.
+may be included with JRE 8, JDK 8, and OpenJDK 8.
 
 --- begin of LICENSE ---
 
@@ -852,8 +1044,8 @@
 
 -------------------------------------------------------------------------------
 
-%% This notice is provided with respect to IJG JPEG 6b, which is 
-included with JRE 7, JDK 7, and OpenJDK 7.
+%% This notice is provided with respect to IJG JPEG 6b, which may be 
+included with JRE 8, JDK 8, and OpenJDK 8.
 
 --- begin of LICENSE ---
 
@@ -891,8 +1083,35 @@
 
 --------------------------------------------------------------------------------
 
-%% This notice is provided with respect to JOpt-Simple v3.0,  which is 
-included with JRE 7, JDK 7, and OpenJDK 7.
+%% This notice is provided with respect to Joni v1.1.9, which may be 
+included with JRE 8, JDK 8, and OpenJDK 8.
+
+--- begin of LICENSE ---
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
+--- end of LICENSE ---
+
+-------------------------------------------------------------------------------
+
+%% This notice is provided with respect to JOpt-Simple v3.0,  which may be 
+included with JRE 8, JDK 8, and OpenJDK 8.
 
 --- begin of LICENSE ---
 
@@ -921,8 +1140,39 @@
 
 --------------------------------------------------------------------------------
 
+%% This notice is provided with respect to JSON, which may be included 
+with JRE 8 & JDK 8.
+
+--- begin of LICENSE ---
+
+Copyright (c) 2002 JSON.org
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+The Software shall be used for Good, not Evil.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
+--- end of LICENSE ---
+
+-------------------------------------------------------------------------------
+
 %% This notice is provided with respect to Kerberos functionality, which 
-which is included with JRE 7, JDK 7, and OpenJDK 7.
+which may be included with JRE 8, JDK 8, and OpenJDK 8.
 
 --- begin of LICENSE ---
 
@@ -934,7 +1184,7 @@
 -------------------------------------------------------------------------------
 
 %% This notice is provided with respect to Kerberos functionality from 
-FundsXpress, INC., which is included with JRE 7, JDK 7, and OpenJDK 7.
+FundsXpress, INC., which may be included with JRE 8, JDK 8, and OpenJDK 8.
 
 --- begin of LICENSE ---
 
@@ -967,8 +1217,8 @@
 
 -------------------------------------------------------------------------------
 
-%% This notice is provided with respect to Kronos OpenGL headers, which is 
-included with JDK 7 and OpenJDK 7 source distributions.
+%% This notice is provided with respect to Kronos OpenGL headers, which may be 
+included with JDK 8 and OpenJDK 8 source distributions.
 
 --- begin of LICENSE ---
 
@@ -1000,8 +1250,8 @@
 
 -------------------------------------------------------------------------------
 
-%% This notice is provided with respect to libpng 1.2.18, which is 
-included with JRE 7, JDK 7, and OpenJDK 7.
+%% This notice is provided with respect to libpng 1.5.4, which may be 
+included with JRE 8, JDK 8, and OpenJDK 8.
 
 --- begin of LICENSE ---
 
@@ -1014,8 +1264,10 @@
 If you modify libpng you may insert additional notices immediately following
 this sentence.
 
-libpng versions 1.2.6, August 15, 2004, through 1.2.18, May 15, 2007, are
-Copyright (c) 2004, 2006-2007 Glenn Randers-Pehrson, and are
+This code is released under the libpng license.
+
+libpng versions 1.2.6, August 15, 2004, through 1.5.4, July 7, 2011, are
+Copyright (c) 2004, 2006-2011 Glenn Randers-Pehrson, and are
 distributed according to the same disclaimer and license as libpng-1.2.5
 with the following individual added to the list of Contributing Authors
 
@@ -1112,14 +1364,14 @@
 
 Glenn Randers-Pehrson
 glennrp at users.sourceforge.net
-May 15, 2007
+July 7, 2011
 
 --- end of LICENSE ---
 
 -------------------------------------------------------------------------------
 
-%% This notice is provided with respect to libungif 4.1.3, which is 
-included with JRE 7, JDK 7, and OpenJDK 7.
+%% This notice is provided with respect to libungif 4.1.3, which may be 
+included with JRE 8, JDK 8, and OpenJDK 8.
 
 --- begin of LICENSE ---
 
@@ -1147,8 +1399,8 @@
 
 -------------------------------------------------------------------------------
 
-%% This notice is provided with respect to Little CMS 2.0, which is 
-included with OpenJDK 7.
+%% This notice is provided with respect to Little CMS 2.4, which may be 
+included with JRE 8, JDK 8, and OpenJDK 8.
 
 --- begin of LICENSE ---
 
@@ -1183,7 +1435,7 @@
 -------------------------------------------------------------------------------
 
 %% This notice is provided with respect to Mesa 3D Graphics Library v4.1,
-which is included with JRE 7, JDK 7, and OpenJDK 7 source distributions.
+which may be included with JRE 8, JDK 8, and OpenJDK 8 source distributions.
 
 --- begin of LICENSE ---
 
@@ -1213,8 +1465,402 @@
 
 -------------------------------------------------------------------------------
 
+%% This notice is provided with respect to Mozilla Network Security
+Services (NSS), which is supplied with the JDK test suite in the OpenJDK
+source code repository. It is licensed under Mozilla Public License (MPL),
+version 2.0.
+
+The NSS libraries are supplied in executable form, built from unmodified
+NSS source code labeled with the "NSS_3.13.1_RTM" release tag.
+
+The NSS source code is available in the OpenJDK source code repository at:
+    jdk/test/sun/security/pkcs11/nss/src
+
+The NSS libraries are available in the OpenJDK source code repository at:
+    jdk/test/sun/security/pkcs11/nss/lib
+
+--- begin of LICENSE ---
+
+Mozilla Public License Version 2.0
+==================================
+
+1. Definitions
+--------------
+
+1.1. "Contributor"
+    means each individual or legal entity that creates, contributes to
+    the creation of, or owns Covered Software.
+
+1.2. "Contributor Version"
+    means the combination of the Contributions of others (if any) used
+    by a Contributor and that particular Contributor's Contribution.
+
+1.3. "Contribution"
+    means Covered Software of a particular Contributor.
+
+1.4. "Covered Software"
+    means Source Code Form to which the initial Contributor has attached
+    the notice in Exhibit A, the Executable Form of such Source Code
+    Form, and Modifications of such Source Code Form, in each case
+    including portions thereof.
+
+1.5. "Incompatible With Secondary Licenses"
+    means
+
+    (a) that the initial Contributor has attached the notice described
+        in Exhibit B to the Covered Software; or
+
+    (b) that the Covered Software was made available under the terms of
+        version 1.1 or earlier of the License, but not also under the
+        terms of a Secondary License.
+
+1.6. "Executable Form"
+    means any form of the work other than Source Code Form.
+
+1.7. "Larger Work"
+    means a work that combines Covered Software with other material, in 
+    a separate file or files, that is not Covered Software.
+
+1.8. "License"
+    means this document.
+
+1.9. "Licensable"
+    means having the right to grant, to the maximum extent possible,
+    whether at the time of the initial grant or subsequently, any and
+    all of the rights conveyed by this License.
+
+1.10. "Modifications"
+    means any of the following:
+
+    (a) any file in Source Code Form that results from an addition to,
+        deletion from, or modification of the contents of Covered
+        Software; or
+
+    (b) any new file in Source Code Form that contains any Covered
+        Software.
+
+1.11. "Patent Claims" of a Contributor
+    means any patent claim(s), including without limitation, method,
+    process, and apparatus claims, in any patent Licensable by such
+    Contributor that would be infringed, but for the grant of the
+    License, by the making, using, selling, offering for sale, having
+    made, import, or transfer of either its Contributions or its
+    Contributor Version.
+
+1.12. "Secondary License"
+    means either the GNU General Public License, Version 2.0, the GNU
+    Lesser General Public License, Version 2.1, the GNU Affero General
+    Public License, Version 3.0, or any later versions of those
+    licenses.
+
+1.13. "Source Code Form"
+    means the form of the work preferred for making modifications.
+
+1.14. "You" (or "Your")
+    means an individual or a legal entity exercising rights under this
+    License. For legal entities, "You" includes any entity that
+    controls, is controlled by, or is under common control with You. For
+    purposes of this definition, "control" means (a) the power, direct
+    or indirect, to cause the direction or management of such entity,
+    whether by contract or otherwise, or (b) ownership of more than
+    fifty percent (50%) of the outstanding shares or beneficial
+    ownership of such entity.
+
+2. License Grants and Conditions
+--------------------------------
+
+2.1. Grants
+
+Each Contributor hereby grants You a world-wide, royalty-free,
+non-exclusive license:
+
+(a) under intellectual property rights (other than patent or trademark)
+    Licensable by such Contributor to use, reproduce, make available,
+    modify, display, perform, distribute, and otherwise exploit its
+    Contributions, either on an unmodified basis, with Modifications, or
+    as part of a Larger Work; and
+
+(b) under Patent Claims of such Contributor to make, use, sell, offer
+    for sale, have made, import, and otherwise transfer either its
+    Contributions or its Contributor Version.
+
+2.2. Effective Date
+
+The licenses granted in Section 2.1 with respect to any Contribution
+become effective for each Contribution on the date the Contributor first
+distributes such Contribution.
+
+2.3. Limitations on Grant Scope
+
+The licenses granted in this Section 2 are the only rights granted under
+this License. No additional rights or licenses will be implied from the
+distribution or licensing of Covered Software under this License.
+Notwithstanding Section 2.1(b) above, no patent license is granted by a
+Contributor:
+
+(a) for any code that a Contributor has removed from Covered Software;
+    or
+
+(b) for infringements caused by: (i) Your and any other third party's
+    modifications of Covered Software, or (ii) the combination of its
+    Contributions with other software (except as part of its Contributor
+    Version); or
+
+(c) under Patent Claims infringed by Covered Software in the absence of
+    its Contributions.
+
+This License does not grant any rights in the trademarks, service marks,
+or logos of any Contributor (except as may be necessary to comply with
+the notice requirements in Section 3.4).
+
+2.4. Subsequent Licenses
+
+No Contributor makes additional grants as a result of Your choice to
+distribute the Covered Software under a subsequent version of this
+License (see Section 10.2) or under the terms of a Secondary License (if
+permitted under the terms of Section 3.3).
+
+2.5. Representation
+
+Each Contributor represents that the Contributor believes its
+Contributions are its original creation(s) or it has sufficient rights
+to grant the rights to its Contributions conveyed by this License.
+
+2.6. Fair Use
+
+This License is not intended to limit any rights You have under
+applicable copyright doctrines of fair use, fair dealing, or other
+equivalents.
+
+2.7. Conditions
+
+Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted
+in Section 2.1.
+
+3. Responsibilities
+-------------------
+
+3.1. Distribution of Source Form
+
+All distribution of Covered Software in Source Code Form, including any
+Modifications that You create or to which You contribute, must be under
+the terms of this License. You must inform recipients that the Source
+Code Form of the Covered Software is governed by the terms of this
+License, and how they can obtain a copy of this License. You may not
+attempt to alter or restrict the recipients' rights in the Source Code
+Form.
+
+3.2. Distribution of Executable Form
+
+If You distribute Covered Software in Executable Form then:
+
+(a) such Covered Software must also be made available in Source Code
+    Form, as described in Section 3.1, and You must inform recipients of
+    the Executable Form how they can obtain a copy of such Source Code
+    Form by reasonable means in a timely manner, at a charge no more
+    than the cost of distribution to the recipient; and
+
+(b) You may distribute such Executable Form under the terms of this
+    License, or sublicense it under different terms, provided that the
+    license for the Executable Form does not attempt to limit or alter
+    the recipients' rights in the Source Code Form under this License.
+
+3.3. Distribution of a Larger Work
+
+You may create and distribute a Larger Work under terms of Your choice,
+provided that You also comply with the requirements of this License for
+the Covered Software. If the Larger Work is a combination of Covered
+Software with a work governed by one or more Secondary Licenses, and the
+Covered Software is not Incompatible With Secondary Licenses, this
+License permits You to additionally distribute such Covered Software
+under the terms of such Secondary License(s), so that the recipient of
+the Larger Work may, at their option, further distribute the Covered
+Software under the terms of either this License or such Secondary
+License(s).
+
+3.4. Notices
+
+You may not remove or alter the substance of any license notices
+(including copyright notices, patent notices, disclaimers of warranty,
+or limitations of liability) contained within the Source Code Form of
+the Covered Software, except that You may alter any license notices to
+the extent required to remedy known factual inaccuracies.
+
+3.5. Application of Additional Terms
+
+You may choose to offer, and to charge a fee for, warranty, support,
+indemnity or liability obligations to one or more recipients of Covered
+Software. However, You may do so only on Your own behalf, and not on
+behalf of any Contributor. You must make it absolutely clear that any
+such warranty, support, indemnity, or liability obligation is offered by
+You alone, and You hereby agree to indemnify every Contributor for any
+liability incurred by such Contributor as a result of warranty, support,
+indemnity or liability terms You offer. You may include additional
+disclaimers of warranty and limitations of liability specific to any
+jurisdiction.
+
+4. Inability to Comply Due to Statute or Regulation
+---------------------------------------------------
+
+If it is impossible for You to comply with any of the terms of this
+License with respect to some or all of the Covered Software due to
+statute, judicial order, or regulation then You must: (a) comply with
+the terms of this License to the maximum extent possible; and (b)
+describe the limitations and the code they affect. Such description must
+be placed in a text file included with all distributions of the Covered
+Software under this License. Except to the extent prohibited by statute
+or regulation, such description must be sufficiently detailed for a
+recipient of ordinary skill to be able to understand it.
+
+5. Termination
+--------------
+
+5.1. The rights granted under this License will terminate automatically
+if You fail to comply with any of its terms. However, if You become
+compliant, then the rights granted under this License from a particular
+Contributor are reinstated (a) provisionally, unless and until such
+Contributor explicitly and finally terminates Your grants, and (b) on an
+ongoing basis, if such Contributor fails to notify You of the
+non-compliance by some reasonable means prior to 60 days after You have
+come back into compliance. Moreover, Your grants from a particular
+Contributor are reinstated on an ongoing basis if such Contributor
+notifies You of the non-compliance by some reasonable means, this is the
+first time You have received notice of non-compliance with this License
+from such Contributor, and You become compliant prior to 30 days after
+Your receipt of the notice.
+
+5.2. If You initiate litigation against any entity by asserting a patent
+infringement claim (excluding declaratory judgment actions,
+counter-claims, and cross-claims) alleging that a Contributor Version
+directly or indirectly infringes any patent, then the rights granted to
+You by any and all Contributors for the Covered Software under Section
+2.1 of this License shall terminate.
+
+5.3. In the event of termination under Sections 5.1 or 5.2 above, all
+end user license agreements (excluding distributors and resellers) which
+have been validly granted by You or Your distributors under this License
+prior to termination shall survive termination.
+
+************************************************************************
+*                                                                      *
+*  6. Disclaimer of Warranty                                           *
+*  -------------------------                                           *
+*                                                                      *
+*  Covered Software is provided under this License on an "as is"       *
+*  basis, without warranty of any kind, either expressed, implied, or  *
+*  statutory, including, without limitation, warranties that the       *
+*  Covered Software is free of defects, merchantable, fit for a        *
+*  particular purpose or non-infringing. The entire risk as to the     *
+*  quality and performance of the Covered Software is with You.        *
+*  Should any Covered Software prove defective in any respect, You     *
+*  (not any Contributor) assume the cost of any necessary servicing,   *
+*  repair, or correction. This disclaimer of warranty constitutes an   *
+*  essential part of this License. No use of any Covered Software is   *
+*  authorized under this License except under this disclaimer.         *
+*                                                                      *
+************************************************************************
+
+************************************************************************
+*                                                                      *
+*  7. Limitation of Liability                                          *
+*  --------------------------                                          *
+*                                                                      *
+*  Under no circumstances and under no legal theory, whether tort      *
+*  (including negligence), contract, or otherwise, shall any           *
+*  Contributor, or anyone who distributes Covered Software as          *
+*  permitted above, be liable to You for any direct, indirect,         *
+*  special, incidental, or consequential damages of any character      *
+*  including, without limitation, damages for lost profits, loss of    *
+*  goodwill, work stoppage, computer failure or malfunction, or any    *
+*  and all other commercial damages or losses, even if such party      *
+*  shall have been informed of the possibility of such damages. This   *
+*  limitation of liability shall not apply to liability for death or   *
+*  personal injury resulting from such party's negligence to the       *
+*  extent applicable law prohibits such limitation. Some               *
+*  jurisdictions do not allow the exclusion or limitation of           *
+*  incidental or consequential damages, so this exclusion and          *
+*  limitation may not apply to You.                                    *
+*                                                                      *
+************************************************************************
+
+8. Litigation
+-------------
+
+Any litigation relating to this License may be brought only in the
+courts of a jurisdiction where the defendant maintains its principal
+place of business and such litigation shall be governed by laws of that
+jurisdiction, without reference to its conflict-of-law provisions.
+Nothing in this Section shall prevent a party's ability to bring
+cross-claims or counter-claims.
+
+9. Miscellaneous
+----------------
+
+This License represents the complete agreement concerning the subject
+matter hereof. If any provision of this License is held to be
+unenforceable, such provision shall be reformed only to the extent
+necessary to make it enforceable. Any law or regulation which provides
+that the language of a contract shall be construed against the drafter
+shall not be used to construe this License against a Contributor.
+
+10. Versions of the License
+---------------------------
+
+10.1. New Versions
+
+Mozilla Foundation is the license steward. Except as provided in Section
+10.3, no one other than the license steward has the right to modify or
+publish new versions of this License. Each version will be given a
+distinguishing version number.
+
+10.2. Effect of New Versions
+
+You may distribute the Covered Software under the terms of the version
+of the License under which You originally received the Covered Software,
+or under the terms of any subsequent version published by the license
+steward.
+
+10.3. Modified Versions
+
+If you create software not governed by this License, and you want to
+create a new license for such software, you may create and use a
+modified version of this License if you rename the license and remove
+any references to the name of the license steward (except to note that
+such modified license differs from this License).
+
+10.4. Distributing Source Code Form that is Incompatible With Secondary
+Licenses
+
+If You choose to distribute Source Code Form that is Incompatible With
+Secondary Licenses under the terms of this version of the License, the
+notice described in Exhibit B of this License must be attached.
+
+Exhibit A - Source Code Form License Notice
+-------------------------------------------
+
+  This Source Code Form is subject to the terms of the Mozilla Public
+  License, v. 2.0. If a copy of the MPL was not distributed with this
+  file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+If it is not possible or desirable to put the notice in a particular
+file, then You may include the notice in a location (such as a LICENSE
+file in a relevant directory) where a recipient would be likely to look
+for such a notice.
+
+You may add additional accurate notices of copyright ownership.
+
+Exhibit B - "Incompatible With Secondary Licenses" Notice
+---------------------------------------------------------
+
+  This Source Code Form is "Incompatible With Secondary Licenses", as
+  defined by the Mozilla Public License, v. 2.0.
+
+--- end of LICENSE ---
+
+-------------------------------------------------------------------------------
+
 %% This notice is provided with respect to PC/SC Lite for Suse Linux v.1.1.1,
-which is included with JRE 7, JDK 7, and OpenJDK 7 on Linux and Solaris.
+which may be included with JRE 8, JDK 8, and OpenJDK 8 on Linux and Solaris.
 
 --- begin of LICENSE ---
 
@@ -1257,8 +1903,30 @@
 
 -------------------------------------------------------------------------------
 
+%% This notice is provided with respect to PorterStemmer v4, which may be 
+included with JRE 8, JDK 8, and OpenJDK 8.
+
+--- begin of LICENSE ---
+
+See: http://tartarus.org/~martin/PorterStemmer
+
+The software is completely free for any purpose, unless notes at the head of
+the program text indicates otherwise (which is rare). In any case, the notes
+about licensing are never more restrictive than the BSD License.
+
+In every case where the software is not written by me (Martin Porter), this
+licensing arrangement has been endorsed by the contributor, and it is
+therefore unnecessary to ask the contributor again to confirm it.
+
+I have not asked any contributors (or their employers, if they have them) for
+proofs that they have the right to distribute their software in this way.
+
+--- end of LICENSE ---
+
+-------------------------------------------------------------------------------
+
 %% This notice is provided with respect to Relax NG Object/Parser v.20050510,
-which is included with JRE 7, JDK 7, and OpenJDK 7.
+which may be included with JRE 8, JDK 8, and OpenJDK 8.
 
 --- begin of LICENSE ---
 
@@ -1285,8 +1953,8 @@
 
 -------------------------------------------------------------------------------
 
-%% This notice is provided with respect to RelaxNGCC v1.12, which is 
-included with JRE 7, JDK 7, and OpenJDK 7.
+%% This notice is provided with respect to RelaxNGCC v1.12, which may be 
+included with JRE 8, JDK 8, and OpenJDK 8.
 
 --- begin of LICENSE ---
 
@@ -1335,487 +2003,8 @@
 
 -------------------------------------------------------------------------------
 
-%% This notice is provided with respect to Mozilla Rhino v1.7R3, which 
-is included with JRE 7, JDK 7, and OpenJDK 7
-
---- begin of LICENSE ---
-
-                          MOZILLA PUBLIC LICENSE
-                                Version 1.1
-
-                              ---------------
-
-1. Definitions.
-
-     1.0.1. "Commercial Use" means distribution or otherwise making the
-     Covered Code available to a third party.
-
-     1.1. "Contributor" means each entity that creates or contributes to
-     the creation of Modifications.
-
-     1.2. "Contributor Version" means the combination of the Original
-     Code, prior Modifications used by a Contributor, and the Modifications
-     made by that particular Contributor.
-
-     1.3. "Covered Code" means the Original Code or Modifications or the
-     combination of the Original Code and Modifications, in each case
-     including portions thereof.
-
-     1.4. "Electronic Distribution Mechanism" means a mechanism generally
-     accepted in the software development community for the electronic
-     transfer of data.
-
-     1.5. "Executable" means Covered Code in any form other than Source
-     Code.
-
-     1.6. "Initial Developer" means the individual or entity identified
-     as the Initial Developer in the Source Code notice required by Exhibit
-     A.
-
-     1.7. "Larger Work" means a work which combines Covered Code or
-     portions thereof with code not governed by the terms of this License.
-
-     1.8. "License" means this document.
-
-     1.8.1. "Licensable" means having the right to grant, to the maximum
-     extent possible, whether at the time of the initial grant or
-     subsequently acquired, any and all of the rights conveyed herein.
-
-     1.9. "Modifications" means any addition to or deletion from the
-     substance or structure of either the Original Code or any previous
-     Modifications. When Covered Code is released as a series of files, a
-     Modification is:
-          A. Any addition to or deletion from the contents of a file
-          containing Original Code or previous Modifications.
-
-          B. Any new file that contains any part of the Original Code or
-          previous Modifications.
-
-     1.10. "Original Code" means Source Code of computer software code
-     which is described in the Source Code notice required by Exhibit A as
-     Original Code, and which, at the time of its release under this
-     License is not already Covered Code governed by this License.
-
-     1.10.1. "Patent Claims" means any patent claim(s), now owned or
-     hereafter acquired, including without limitation,  method, process,
-     and apparatus claims, in any patent Licensable by grantor.
-
-     1.11. "Source Code" means the preferred form of the Covered Code for
-     making modifications to it, including all modules it contains, plus
-     any associated interface definition files, scripts used to control
-     compilation and installation of an Executable, or source code
-     differential comparisons against either the Original Code or another
-     well known, available Covered Code of the Contributor's choice. The
-     Source Code can be in a compressed or archival form, provided the
-     appropriate decompression or de-archiving software is widely available
-     for no charge.
-
-     1.12. "You" (or "Your")  means an individual or a legal entity
-     exercising rights under, and complying with all of the terms of, this
-     License or a future version of this License issued under Section 6.1.
-     For legal entities, "You" includes any entity which controls, is
-     controlled by, or is under common control with You. For purposes of
-     this definition, "control" means (a) the power, direct or indirect,
-     to cause the direction or management of such entity, whether by
-     contract or otherwise, or (b) ownership of more than fifty percent
-     (50%) of the outstanding shares or beneficial ownership of such
-     entity.
-
-2. Source Code License.
-
-     2.1. The Initial Developer Grant.
-     The Initial Developer hereby grants You a world-wide, royalty-free,
-     non-exclusive license, subject to third party intellectual property
-     claims:
-          (a)  under intellectual property rights (other than patent or
-          trademark) Licensable by Initial Developer to use, reproduce,
-          modify, display, perform, sublicense and distribute the Original
-          Code (or portions thereof) with or without Modifications, and/or
-          as part of a Larger Work; and
-
-          (b) under Patents Claims infringed by the making, using or
-          selling of Original Code, to make, have made, use, practice,
-          sell, and offer for sale, and/or otherwise dispose of the
-          Original Code (or portions thereof).
-
-          (c) the licenses granted in this Section 2.1(a) and (b) are
-          effective on the date Initial Developer first distributes
-          Original Code under the terms of this License.
-
-          (d) Notwithstanding Section 2.1(b) above, no patent license is
-          granted: 1) for code that You delete from the Original Code; 2)
-          separate from the Original Code;  or 3) for infringements caused
-          by: i) the modification of the Original Code or ii) the
-          combination of the Original Code with other software or devices.
-
-     2.2. Contributor Grant.
-     Subject to third party intellectual property claims, each Contributor
-     hereby grants You a world-wide, royalty-free, non-exclusive license
-
-          (a)  under intellectual property rights (other than patent or
-          trademark) Licensable by Contributor, to use, reproduce, modify,
-          display, perform, sublicense and distribute the Modifications
-          created by such Contributor (or portions thereof) either on an
-          unmodified basis, with other Modifications, as Covered Code
-          and/or as part of a Larger Work; and
-
-          (b) under Patent Claims infringed by the making, using, or
-          selling of  Modifications made by that Contributor either alone
-          and/or in combination with its Contributor Version (or portions
-          of such combination), to make, use, sell, offer for sale, have
-          made, and/or otherwise dispose of: 1) Modifications made by that
-          Contributor (or portions thereof); and 2) the combination of
-          Modifications made by that Contributor with its Contributor
-          Version (or portions of such combination).
-
-          (c) the licenses granted in Sections 2.2(a) and 2.2(b) are
-          effective on the date Contributor first makes Commercial Use of
-          the Covered Code.
-
-          (d)    Notwithstanding Section 2.2(b) above, no patent license is
-          granted: 1) for any code that Contributor has deleted from the
-          Contributor Version; 2)  separate from the Contributor Version;
-          3)  for infringements caused by: i) third party modifications of
-          Contributor Version or ii)  the combination of Modifications made
-          by that Contributor with other software  (except as part of the
-          Contributor Version) or other devices; or 4) under Patent Claims
-          infringed by Covered Code in the absence of Modifications made by
-          that Contributor.
-
-3. Distribution Obligations.
-
-     3.1. Application of License.
-     The Modifications which You create or to which You contribute are
-     governed by the terms of this License, including without limitation
-     Section 2.2. The Source Code version of Covered Code may be
-     distributed only under the terms of this License or a future version
-     of this License released under Section 6.1, and You must include a
-     copy of this License with every copy of the Source Code You
-     distribute. You may not offer or impose any terms on any Source Code
-     version that alters or restricts the applicable version of this
-     License or the recipients' rights hereunder. However, You may include
-     an additional document offering the additional rights described in
-     Section 3.5.
-
-     3.2. Availability of Source Code.
-     Any Modification which You create or to which You contribute must be
-     made available in Source Code form under the terms of this License
-     either on the same media as an Executable version or via an accepted
-     Electronic Distribution Mechanism to anyone to whom you made an
-     Executable version available; and if made available via Electronic
-     Distribution Mechanism, must remain available for at least twelve (12)
-     months after the date it initially became available, or at least six
-     (6) months after a subsequent version of that particular Modification
-     has been made available to such recipients. You are responsible for
-     ensuring that the Source Code version remains available even if the
-     Electronic Distribution Mechanism is maintained by a third party.
-
-     3.3. Description of Modifications.
-     You must cause all Covered Code to which You contribute to contain a
-     file documenting the changes You made to create that Covered Code and
-     the date of any change. You must include a prominent statement that
-     the Modification is derived, directly or indirectly, from Original
-     Code provided by the Initial Developer and including the name of the
-     Initial Developer in (a) the Source Code, and (b) in any notice in an
-     Executable version or related documentation in which You describe the
-     origin or ownership of the Covered Code.
-
-     3.4. Intellectual Property Matters
-          (a) Third Party Claims.
-          If Contributor has knowledge that a license under a third party's
-          intellectual property rights is required to exercise the rights
-          granted by such Contributor under Sections 2.1 or 2.2,
-          Contributor must include a text file with the Source Code
-          distribution titled "LEGAL" which describes the claim and the
-          party making the claim in sufficient detail that a recipient will
-          know whom to contact. If Contributor obtains such knowledge after
-          the Modification is made available as described in Section 3.2,
-          Contributor shall promptly modify the LEGAL file in all copies
-          Contributor makes available thereafter and shall take other steps
-          (such as notifying appropriate mailing lists or newsgroups)
-          reasonably calculated to inform those who received the Covered
-          Code that new knowledge has been obtained.
-
-          (b) Contributor APIs.
-          If Contributor's Modifications include an application programming
-          interface and Contributor has knowledge of patent licenses which
-          are reasonably necessary to implement that API, Contributor must
-          also include this information in the LEGAL file.
-
-               (c)    Representations.
-          Contributor represents that, except as disclosed pursuant to
-          Section 3.4(a) above, Contributor believes that Contributor's
-          Modifications are Contributor's original creation(s) and/or
-          Contributor has sufficient rights to grant the rights conveyed by
-          this License.
-
-     3.5. Required Notices.
-     You must duplicate the notice in Exhibit A in each file of the Source
-     Code.  If it is not possible to put such notice in a particular Source
-     Code file due to its structure, then You must include such notice in a
-     location (such as a relevant directory) where a user would be likely
-     to look for such a notice.  If You created one or more Modification(s)
-     You may add your name as a Contributor to the notice described in
-     Exhibit A.  You must also duplicate this License in any documentation
-     for the Source Code where You describe recipients' rights or ownership
-     rights relating to Covered Code.  You may choose to offer, and to
-     charge a fee for, warranty, support, indemnity or liability
-     obligations to one or more recipients of Covered Code. However, You
-     may do so only on Your own behalf, and not on behalf of the Initial
-     Developer or any Contributor. You must make it absolutely clear than
-     any such warranty, support, indemnity or liability obligation is
-     offered by You alone, and You hereby agree to indemnify the Initial
-     Developer and every Contributor for any liability incurred by the
-     Initial Developer or such Contributor as a result of warranty,
-     support, indemnity or liability terms You offer.
-
-     3.6. Distribution of Executable Versions.
-     You may distribute Covered Code in Executable form only if the
-     requirements of Section 3.1-3.5 have been met for that Covered Code,
-     and if You include a notice stating that the Source Code version of
-     the Covered Code is available under the terms of this License,
-     including a description of how and where You have fulfilled the
-     obligations of Section 3.2. The notice must be conspicuously included
-     in any notice in an Executable version, related documentation or
-     collateral in which You describe recipients' rights relating to the
-     Covered Code. You may distribute the Executable version of Covered
-     Code or ownership rights under a license of Your choice, which may
-     contain terms different from this License, provided that You are in
-     compliance with the terms of this License and that the license for the
-     Executable version does not attempt to limit or alter the recipient's
-     rights in the Source Code version from the rights set forth in this
-     License. If You distribute the Executable version under a different
-     license You must make it absolutely clear that any terms which differ
-     from this License are offered by You alone, not by the Initial
-     Developer or any Contributor. You hereby agree to indemnify the
-     Initial Developer and every Contributor for any liability incurred by
-     the Initial Developer or such Contributor as a result of any such
-     terms You offer.
-
-     3.7. Larger Works.
-     You may create a Larger Work by combining Covered Code with other code
-     not governed by the terms of this License and distribute the Larger
-     Work as a single product. In such a case, You must make sure the
-     requirements of this License are fulfilled for the Covered Code.
-
-4. Inability to Comply Due to Statute or Regulation.
-
-     If it is impossible for You to comply with any of the terms of this
-     License with respect to some or all of the Covered Code due to
-     statute, judicial order, or regulation then You must: (a) comply with
-     the terms of this License to the maximum extent possible; and (b)
-     describe the limitations and the code they affect. Such description
-     must be included in the LEGAL file described in Section 3.4 and must
-     be included with all distributions of the Source Code. Except to the
-     extent prohibited by statute or regulation, such description must be
-     sufficiently detailed for a recipient of ordinary skill to be able to
-     understand it.
-
-5. Application of this License.
-
-     This License applies to code to which the Initial Developer has
-     attached the notice in Exhibit A and to related Covered Code.
-
-6. Versions of the License.
-
-     6.1. New Versions.
-     Netscape Communications Corporation ("Netscape") may publish revised
-     and/or new versions of the License from time to time. Each version
-     will be given a distinguishing version number.
-
-     6.2. Effect of New Versions.
-     Once Covered Code has been published under a particular version of the
-     License, You may always continue to use it under the terms of that
-     version. You may also choose to use such Covered Code under the terms
-     of any subsequent version of the License published by Netscape. No one
-     other than Netscape has the right to modify the terms applicable to
-     Covered Code created under this License.
-
-     6.3. Derivative Works.
-     If You create or use a modified version of this License (which you may
-     only do in order to apply it to code which is not already Covered Code
-     governed by this License), You must (a) rename Your license so that
-     the phrases "Mozilla", "MOZILLAPL", "MOZPL", "Netscape",
-     "MPL", "NPL" or any confusingly similar phrase do not appear in your
-     license (except to note that your license differs from this License)
-     and (b) otherwise make it clear that Your version of the license
-     contains terms which differ from the Mozilla Public License and
-     Netscape Public License. (Filling in the name of the Initial
-     Developer, Original Code or Contributor in the notice described in
-     Exhibit A shall not of themselves be deemed to be modifications of
-     this License.)
-
-7. DISCLAIMER OF WARRANTY.
-
-     COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS,
-     WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
-     WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF
-     DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING.
-     THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED CODE
-     IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT,
-     YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE
-     COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER
-     OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF
-     ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
-
-8. TERMINATION.
-
-     8.1.  This License and the rights granted hereunder will terminate
-     automatically if You fail to comply with terms herein and fail to cure
-     such breach within 30 days of becoming aware of the breach. All
-     sublicenses to the Covered Code which are properly granted shall
-     survive any termination of this License. Provisions which, by their
-     nature, must remain in effect beyond the termination of this License
-     shall survive.
-
-     8.2.  If You initiate litigation by asserting a patent infringement
-     claim (excluding declatory judgment actions) against Initial Developer
-     or a Contributor (the Initial Developer or Contributor against whom
-     You file such action is referred to as "Participant")  alleging that:
-
-     (a)  such Participant's Contributor Version directly or indirectly
-     infringes any patent, then any and all rights granted by such
-     Participant to You under Sections 2.1 and/or 2.2 of this License
-     shall, upon 60 days notice from Participant terminate prospectively,
-     unless if within 60 days after receipt of notice You either: (i)
-     agree in writing to pay Participant a mutually agreeable reasonable
-     royalty for Your past and future use of Modifications made by such
-     Participant, or (ii) withdraw Your litigation claim with respect to
-     the Contributor Version against such Participant.  If within 60 days
-     of notice, a reasonable royalty and payment arrangement are not
-     mutually agreed upon in writing by the parties or the litigation claim
-     is not withdrawn, the rights granted by Participant to You under
-     Sections 2.1 and/or 2.2 automatically terminate at the expiration of
-     the 60 day notice period specified above.
-
-     (b)  any software, hardware, or device, other than such Participant's
-     Contributor Version, directly or indirectly infringes any patent, then
-     any rights granted to You by such Participant under Sections 2.1(b)
-     and 2.2(b) are revoked effective as of the date You first made, used,
-     sold, distributed, or had made, Modifications made by that
-     Participant.
-
-     8.3.  If You assert a patent infringement claim against Participant
-     alleging that such Participant's Contributor Version directly or
-     indirectly infringes any patent where such claim is resolved (such as
-     by license or settlement) prior to the initiation of patent
-     infringement litigation, then the reasonable value of the licenses
-     granted by such Participant under Sections 2.1 or 2.2 shall be taken
-     into account in determining the amount or value of any payment or
-     license.
-
-     8.4.  In the event of termination under Sections 8.1 or 8.2 above,
-     all end user license agreements (excluding distributors and resellers)
-     which have been validly granted by You or any distributor hereunder
-     prior to termination shall survive termination.
-
-9. LIMITATION OF LIABILITY.
-
-     UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT
-     (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL
-     DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE,
-     OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR
-     ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY
-     CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL,
-     WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER
-     COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN
-     INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF
-     LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY
-     RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW
-     PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE
-     EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO
-     THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU.
-
-10. U.S. GOVERNMENT END USERS.
-
-     The Covered Code is a "commercial item," as that term is defined in
-     48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer
-     software" and "commercial computer software documentation," as such
-     terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48
-     C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995),
-     all U.S. Government End Users acquire Covered Code with only those
-     rights set forth herein.
-
-11. MISCELLANEOUS.
-
-     This License represents the complete agreement concerning subject
-     matter hereof. If any provision of this License is held to be
-     unenforceable, such provision shall be reformed only to the extent
-     necessary to make it enforceable. This License shall be governed by
-     California law provisions (except to the extent applicable law, if
-     any, provides otherwise), excluding its conflict-of-law provisions.
-     With respect to disputes in which at least one party is a citizen of,
-     or an entity chartered or registered to do business in the United
-     States of America, any litigation relating to this License shall be
-     subject to the jurisdiction of the Federal Courts of the Northern
-     District of California, with venue lying in Santa Clara County,
-     California, with the losing party responsible for costs, including
-     without limitation, court costs and reasonable attorneys' fees and
-     expenses. The application of the United Nations Convention on
-     Contracts for the International Sale of Goods is expressly excluded.
-     Any law or regulation which provides that the language of a contract
-     shall be construed against the drafter shall not apply to this
-     License.
-
-12. RESPONSIBILITY FOR CLAIMS.
-
-     As between Initial Developer and the Contributors, each party is
-     responsible for claims and damages arising, directly or indirectly,
-     out of its utilization of rights under this License and You agree to
-     work with Initial Developer and Contributors to distribute such
-     responsibility on an equitable basis. Nothing herein is intended or
-     shall be deemed to constitute any admission of liability.
-
-13. MULTIPLE-LICENSED CODE.
-
-     Initial Developer may designate portions of the Covered Code as
-     "Multiple-Licensed".  "Multiple-Licensed" means that the Initial
-     Developer permits you to utilize portions of the Covered Code under
-     Your choice of the NPL or the alternative licenses, if any, specified
-     by the Initial Developer in the file described in Exhibit A.
-
-EXHIBIT A - Mozilla Public License.
-
-     ``The contents of this file are subject to the Mozilla Public License
-     Version 1.1 (the "License"); you may not use this file except in
-     compliance with the License. You may obtain a copy of the License at
-     http://www.mozilla.org/MPL/
-
-     Software distributed under the License is distributed on an "AS IS"
-     basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
-     License for the specific language governing rights and limitations
-     under the License.
-
-     The Original Code is ______________________________________.
-
-     The Initial Developer of the Original Code is ________________________.
-     Portions created by ______________________ are Copyright (C) ______
-     _______________________. All Rights Reserved.
-
-     Contributor(s): ______________________________________.
-
-     Alternatively, the contents of this file may be used under the terms
-     of the _____ license (the  "[___] License"), in which case the
-     provisions of [______] License are applicable instead of those
-     above.  If you wish to allow use of your version of this file only
-     under the terms of the [____] License and not to allow others to use
-     your version of this file under the MPL, indicate your decision by
-     deleting  the provisions above and replace  them with the notice and
-     other provisions required by the [___] License.  If you do not delete
-     the provisions above, a recipient may use your version of this file
-     under either the MPL or the [___] License."
-
-     [NOTE: The text of this Exhibit A may differ slightly from the text of
-     the notices in the Source Code files of the Original Code. You should
-     use the text of this Exhibit A rather than the text found in the
-     Original Code Source Code for Your Modifications.]
-
---- end of LICENSE ---
-
--------------------------------------------------------------------------------
-
-%% This notice is provided with respect to SAX 2.0.1, which is included 
-with JRE 7, JDK 7, and OpenJDK 7.
+%% This notice is provided with respect to SAX 2.0.1, which may be included 
+with JRE 8, JDK 8, and OpenJDK 8.
 
 --- begin of LICENSE ---
 
@@ -1876,8 +2065,8 @@
 
 -------------------------------------------------------------------------------
 
-%% This notice is provided with respect to SoftFloat version 2b, which is 
-included with JRE 7, JDK 7, and OpenJDK 7 on Linux/ARM.
+%% This notice is provided with respect to SoftFloat version 2b, which may be 
+included with JRE 8, JDK 8, and OpenJDK 8 on Linux/ARM.
 
 --- begin of LICENSE ---
 
@@ -1909,12 +2098,41 @@
 
 -------------------------------------------------------------------------------
 
+%% This notice is provided with respect to Sparkle 1.5,
+which may be included with JRE 8 on Mac OS X.
+
+--- begin of LICENSE ---
+
+Copyright (c) 2012 Sparkle.org and Andy Matuschak
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
+--- end of LICENSE ---
+
+-------------------------------------------------------------------------------
+
 %% Portions licensed from Taligent, Inc.
 
 -------------------------------------------------------------------------------
 
-%% This notice is provided with respect to Thai Dictionary, which is 
-included with JRE 7, JDK 7, and OpenJDK 7.
+%% This notice is provided with respect to Thai Dictionary, which may be 
+included with JRE 8, JDK 8, and OpenJDK 8.
 
 --- begin of LICENSE ---
 
@@ -1947,8 +2165,8 @@
 
 -------------------------------------------------------------------------------
 
-%% This notice is provided with respect to Unicode 6.0.0, CLDR v1.4.1, & CLDR
-v1.9, which is included with JRE 7, JDK 7, and OpenJDK 7.
+%% This notice is provided with respect to Unicode 6.2.0 & CLDR 21.0.1
+which may be included with JRE 8, JDK 8, and OpenJDK 8.
 
 --- begin of LICENSE ---
 
@@ -1959,7 +2177,7 @@
 Trademark Usage Policy.
 
 A. Unicode Copyright.
-   1. Copyright © 1991-2011 Unicode, Inc. All rights reserved.
+   1. Copyright © 1991-2013 Unicode, Inc. All rights reserved.
 
    2. Certain documents and files on this website contain a legend indicating
       that "Modification is permitted." Any person is hereby authorized,
@@ -2094,7 +2312,7 @@
 
 COPYRIGHT AND PERMISSION NOTICE
 
-Copyright © 1991-2011 Unicode, Inc. All rights reserved. Distributed under the
+Copyright © 1991-2012 Unicode, Inc. All rights reserved. Distributed under the
 Terms of Use in http://www.unicode.org/copyright.html.
 
 Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -2134,8 +2352,8 @@
 
 -------------------------------------------------------------------------------
 
-%% This notice is provided with respect to UPX v3.01, which is included 
-with JRE 7 on Windows.
+%% This notice is provided with respect to UPX v3.01, which may be included 
+with JRE 8 on Windows.
 
 --- begin of LICENSE ---
 
@@ -2274,7 +2492,7 @@
 -------------------------------------------------------------------------------
 
 %% This notice is provided with respect to Xfree86-VidMode Extension 1.0,
-which is included with JRE 7, JDK 7, and OpenJDK 7 on Linux and Solaris.
+which may be included with JRE 8, JDK 8, and OpenJDK 8 on Linux and Solaris.
 
 --- begin of LICENSE ---
 
@@ -2326,8 +2544,8 @@
 
 -------------------------------------------------------------------------------
 
-%% This notice is provided with respect to X Window System 6.8.2, which is 
-included with JRE 7, JDK 7, and OpenJDK 7 on Linux and Solaris.
+%% This notice is provided with respect to X Window System 6.8.2, which may be 
+included with JRE 8, JDK 8, and OpenJDK 8 on Linux and Solaris.
 
 --- begin of LICENSE ---
 
@@ -3131,12 +3349,12 @@
 
 -------------------------------------------------------------------------------
 
-%% This notice is provided with respect to zlib v1.2.3, which is included 
-with JRE 7, JDK 7, and OpenJDK 7
+%% This notice is provided with respect to zlib v1.2.5, which may be included 
+with JRE 8, JDK 8, and OpenJDK 8.
 
 --- begin of LICENSE ---
 
-  version 1.2.3, July 18th, 2005
+  version 1.2.5, July 18th, 2005
 
   Copyright (C) 1995-2005 Jean-loup Gailly and Mark Adler
 
@@ -3163,16 +3381,18 @@
 
 -------------------------------------------------------------------------------
 
-%% This notice is provided with respect to the following which is 
-included with JRE 7, JDK 7, and OpenJDK 7, except where noted:
-
-  Apache Derby 10.8.1.2        [included with JDK 7 only]
+%% This notice is provided with respect to the following which may be 
+included with JRE 8, JDK 8, and OpenJDK 8, except where noted:
+
+  Apache Commons Math 2.2
+  Apache Derby 10.10.1.2        [included with JDK 8]
   Apache Jakarta BCEL 5.2 
   Apache Jakarta Regexp 1.4 
-  Apache Santuario XMLSec-Java 1.4.2
+  Apache Santuario XML Security for Java 1.5.4
   Apache Xalan-Java 2.7.1 
-  Apache Xerces2 Java 2.10.0 
+  Apache Xerces Java 2.10.0 
   Apache XML Resolver 1.1 
+  Dynalink 0.5
 
 
 --- begin of LICENSE ---
--- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/StringLengthCall.java	Fri Feb 21 11:40:06 2014 -0800
+++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/StringLengthCall.java	Mon Feb 24 12:57:31 2014 -0800
@@ -26,7 +26,7 @@
 import java.util.Vector;
 
 import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
-import com.sun.org.apache.bcel.internal.generic.INVOKEVIRTUAL;
+import com.sun.org.apache.bcel.internal.generic.INVOKESTATIC;
 import com.sun.org.apache.bcel.internal.generic.InstructionList;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
@@ -51,7 +51,8 @@
             il.append(methodGen.loadContextNode());
             Type.Node.translateTo(classGen, methodGen, Type.String);
         }
-        il.append(new INVOKEVIRTUAL(cpg.addMethodref(STRING_CLASS,
-                                                     "length", "()I")));
+        il.append(new INVOKESTATIC(cpg.addMethodref(BASIS_LIBRARY_CLASS,
+                                                     "getStringLength",
+                                                     "(Ljava/lang/String;)I")));
     }
 }
--- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/BasisLibrary.java	Fri Feb 21 11:40:06 2014 -0800
+++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/BasisLibrary.java	Mon Feb 24 12:57:31 2014 -0800
@@ -1660,5 +1660,14 @@
 
     }
 
+    /**
+     *  Utility method to calculate string-length as a number of code points,
+     *  to avoid possible errors with string that contains
+     *  complementary characters
+     */
+    public static int getStringLength(String str) {
+        return str.codePointCount(0,str.length());
+    }
+
     //-- End utility functions
 }
--- a/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/datatype/DurationImpl.java	Fri Feb 21 11:40:06 2014 -0800
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/datatype/DurationImpl.java	Mon Feb 24 12:57:31 2014 -0800
@@ -3,11 +3,12 @@
  * DO NOT REMOVE OR ALTER!
  */
 /*
- * Copyright 2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
  *      http://www.apache.org/licenses/LICENSE-2.0
  *
@@ -106,24 +107,20 @@
         extends Duration
         implements Serializable {
 
-    /**
-     * <p>Number of Fields.</p>
-     */
-    private static final int FIELD_NUM = 6;
 
     /**
      * <p>Internal array of value Fields.</p>
      */
-        private static final DatatypeConstants.Field[] FIELDS = new DatatypeConstants.Field[]{
-                        DatatypeConstants.YEARS,
-                        DatatypeConstants.MONTHS,
-                        DatatypeConstants.DAYS,
-                        DatatypeConstants.HOURS,
-                        DatatypeConstants.MINUTES,
-                        DatatypeConstants.SECONDS
-                };
+    private static final DatatypeConstants.Field[] FIELDS = new DatatypeConstants.Field[]{
+        DatatypeConstants.YEARS,
+        DatatypeConstants.MONTHS,
+        DatatypeConstants.DAYS,
+        DatatypeConstants.HOURS,
+        DatatypeConstants.MINUTES,
+        DatatypeConstants.SECONDS
+    };
 
-                /**
+    /**
                  * <p>Internal array of value Field ids.</p>
                  */
                 private static final int[] FIELD_IDS = {
@@ -141,9 +138,9 @@
     private static final TimeZone GMT = TimeZone.getTimeZone("GMT");
 
         /**
-         * <p>BigDecimal value of 0.</p>
-         */
-        private static final BigDecimal ZERO = BigDecimal.valueOf((long) 0);
+     * <p>BigDecimal value of 0.</p>
+     */
+    private static final BigDecimal ZERO = BigDecimal.valueOf(0);
 
     /**
      * <p>Indicates the sign. -1, 0 or 1 if the duration is negative,
@@ -186,17 +183,17 @@
      */
     protected BigDecimal seconds;
 
-        /**
-         * Returns the sign of this duration in -1,0, or 1.
-         *
-         * @return
-         *      -1 if this duration is negative, 0 if the duration is zero,
-         *      and 1 if the duration is postive.
-         */
-        public int getSign() {
+    /**
+     * Returns the sign of this duration in -1,0, or 1.
+     *
+     * @return
+     *      -1 if this duration is negative, 0 if the duration is zero,
+     *      and 1 if the duration is postive.
+     */
+    public int getSign() {
 
-                return signum;
-        }
+        return signum;
+    }
 
         /**
          * TODO: Javadoc
@@ -206,20 +203,20 @@
          */
     protected int calcSignum(boolean isPositive) {
         if ((years == null || years.signum() == 0)
-            && (months == null || months.signum() == 0)
-            && (days == null || days.signum() == 0)
-            && (hours == null || hours.signum() == 0)
-            && (minutes == null || minutes.signum() == 0)
-            && (seconds == null || seconds.signum() == 0)) {
+             && (months == null || months.signum() == 0)
+             && (days == null || days.signum() == 0)
+             && (hours == null || hours.signum() == 0)
+             && (minutes == null || minutes.signum() == 0)
+             && (seconds == null || seconds.signum() == 0)) {
             return 0;
-            }
+        }
 
-            if (isPositive) {
-                return 1;
-            } else {
-                return -1;
-            }
-
+        if (isPositive) {
+            return 1;
+        }
+        else {
+            return -1;
+        }
     }
 
     /**
@@ -357,7 +354,7 @@
         }
 
         // int -> BigInteger
-        return new BigInteger(String.valueOf(i));
+        return BigInteger.valueOf(i);
     }
 
     /**
@@ -373,14 +370,16 @@
 
         if (l > 0) {
             signum = 1;
-        } else if (l < 0) {
+        }
+        else if (l < 0) {
             signum = -1;
             if (l == 0x8000000000000000L) {
                 // negating 0x8000000000000000L causes an overflow
                 l++;
             }
             l *= -1;
-        } else {
+        }
+        else {
             signum = 0;
         }
 
@@ -454,21 +453,22 @@
         throws IllegalArgumentException {
         // only if I could use the JDK1.4 regular expression ....
 
+        if (lexicalRepresentation == null) {
+           throw new NullPointerException();
+        }
+
         final String s = lexicalRepresentation;
         boolean positive;
         int[] idx = new int[1];
         int length = s.length();
         boolean timeRequired = false;
 
-        if (lexicalRepresentation == null) {
-            throw new NullPointerException();
-        }
-
         idx[0] = 0;
         if (length != idx[0] && s.charAt(idx[0]) == '-') {
             idx[0]++;
             positive = false;
-        } else {
+        }
+        else {
             positive = true;
         }
 
@@ -484,8 +484,8 @@
         String[] dateParts = new String[3];
         int[] datePartsIndex = new int[3];
         while (length != idx[0]
-            && isDigit(s.charAt(idx[0]))
-            && dateLen < 3) {
+               && isDigit(s.charAt(idx[0]))
+               && dateLen < 3) {
             datePartsIndex[dateLen] = idx[0];
             dateParts[dateLen++] = parsePiece(s, idx);
         }
@@ -493,7 +493,8 @@
         if (length != idx[0]) {
             if (s.charAt(idx[0]++) == 'T') {
                 timeRequired = true;
-            } else {
+            }
+            else {
                 throw new IllegalArgumentException(s); // ,idx[0]-1);
             }
         }
@@ -502,8 +503,8 @@
         String[] timeParts = new String[3];
         int[] timePartsIndex = new int[3];
         while (length != idx[0]
-            && isDigitOrPeriod(s.charAt(idx[0]))
-            && timeLen < 3) {
+                             && isDigitOrPeriod(s.charAt(idx[0]))
+                             && timeLen < 3) {
             timePartsIndex[timeLen] = idx[0];
             timeParts[timeLen++] = parsePiece(s, idx);
         }
@@ -604,6 +605,9 @@
 
         int idx = tokens.length();
         for (int i = len - 1; i >= 0; i--) {
+            if (parts[i] == null) {
+                throw new IllegalArgumentException(whole);
+            }
             int nidx =
                 tokens.lastIndexOf(
                     parts[i].charAt(parts[i].length() - 1),
@@ -722,8 +726,7 @@
          */
     public int compare(Duration rhs) {
 
-        BigInteger maxintAsBigInteger = BigInteger.valueOf((long) Integer.MAX_VALUE);
-        BigInteger minintAsBigInteger = BigInteger.valueOf((long) Integer.MIN_VALUE);
+        BigInteger maxintAsBigInteger = BigInteger.valueOf(Integer.MAX_VALUE);
 
         // check for fields that are too large in this Duration
         if (years != null && years.compareTo(maxintAsBigInteger) == 1) {
@@ -778,7 +781,7 @@
         if (seconds != null && seconds.toBigInteger().compareTo(maxintAsBigInteger) == 1) {
                 throw new UnsupportedOperationException(
                         DatatypeMessageFormatter.formatMessage(null, "TooLarge",
-                            new Object[]{this.getClass().getName() + "#compare(Duration duration)" + DatatypeConstants.SECONDS.toString(), seconds.toString()})
+                            new Object[]{this.getClass().getName() + "#compare(Duration duration)" + DatatypeConstants.SECONDS.toString(), toString(seconds)})
 
                                         //this.getClass().getName() + "#compare(Duration duration)"
                                                 //+ " seconds too large to be supported by this implementation "
@@ -957,9 +960,9 @@
         return resultA;
     }
 
-    private int compareResults(int resultA, int resultB){
+    private int compareResults(int resultA, int resultB) {
 
-      if ( resultB == DatatypeConstants.INDETERMINATE ) {
+        if ( resultB == DatatypeConstants.INDETERMINATE ) {
             return DatatypeConstants.INDETERMINATE;
         }
         else if ( resultA!=resultB) {
@@ -1007,25 +1010,25 @@
         buf.append('P');
 
         if (years != null) {
-            buf.append(years + "Y");
+            buf.append(years).append('Y');
         }
         if (months != null) {
-            buf.append(months + "M");
+            buf.append(months).append('M');
         }
         if (days != null) {
-            buf.append(days + "D");
+            buf.append(days).append('D');
         }
 
         if (hours != null || minutes != null || seconds != null) {
             buf.append('T');
             if (hours != null) {
-                buf.append(hours + "H");
+                buf.append(hours).append('H');
             }
             if (minutes != null) {
-                buf.append(minutes + "M");
+                buf.append(minutes).append('M');
             }
             if (seconds != null) {
-                buf.append(toString(seconds) + "S");
+                buf.append(toString(seconds)).append('S');
             }
         }
 
@@ -1055,10 +1058,12 @@
         int insertionPoint = intString.length() - scale;
         if (insertionPoint == 0) { /* Point goes right before intVal */
             return "0." + intString;
-        } else if (insertionPoint > 0) { /* Point goes inside intVal */
+        }
+        else if (insertionPoint > 0) { /* Point goes inside intVal */
             buf = new StringBuffer(intString);
             buf.insert(insertionPoint, '.');
-        } else { /* We must insert zeros between point and intVal */
+        }
+        else { /* We must insert zeros between point and intVal */
             buf = new StringBuffer(3 - insertionPoint + intString.length());
             buf.append("0.");
             for (int i = 0; i < -insertionPoint; i++) {
@@ -1302,7 +1307,8 @@
         Number n = getField(field);
         if (n == null) {
             return 0;
-        } else {
+        }
+        else {
             return n.intValue();
         }
     }
@@ -1340,8 +1346,7 @@
     public long getTimeInMillis(final Calendar startInstant) {
         Calendar cal = (Calendar) startInstant.clone();
         addTo(cal);
-        return getCalendarTimeInMillis(cal)
-                    - getCalendarTimeInMillis(startInstant);
+        return getCalendarTimeInMillis(cal) - getCalendarTimeInMillis(startInstant);
     }
 
     /**
@@ -1451,13 +1456,13 @@
         int days = (int) (diff / (1000L * 60L * 60L * 24L));
 
         return new DurationImpl(
-            days >= 0,
-            null,
-            null,
-            wrap(Math.abs(days)),
-            (BigInteger) getField(DatatypeConstants.HOURS),
-            (BigInteger) getField(DatatypeConstants.MINUTES),
-            (BigDecimal) getField(DatatypeConstants.SECONDS));
+                days >= 0,
+                null,
+                null,
+                wrap(Math.abs(days)),
+                (BigInteger) getField(DatatypeConstants.HOURS),
+                (BigInteger) getField(DatatypeConstants.MINUTES),
+                (BigDecimal) getField(DatatypeConstants.SECONDS));
     }
 
     /**
@@ -1547,14 +1552,16 @@
                 } else {
                     carry = ZERO;
                 }
-            } else {
+            }
+            else {
                 carry = bd.multiply(FACTORS[i]);
             }
         }
 
         if (seconds != null) {
             buf[5] = seconds.multiply(factor).add(carry);
-        } else {
+        }
+        else {
             buf[5] = carry;
         }
 
@@ -1581,14 +1588,17 @@
         if (f == DatatypeConstants.SECONDS) {
             if (seconds != null) {
                 return seconds;
-            } else {
+            }
+            else {
                 return ZERO;
             }
-        } else {
+        }
+        else {
             BigInteger bi = (BigInteger) getField(f);
             if (bi == null) {
                 return ZERO;
-            } else {
+            }
+            else {
                 return new BigDecimal(bi);
             }
         }
@@ -1607,7 +1617,8 @@
         boolean canBeNull) {
         if (canBeNull && value.signum() == 0) {
             return null;
-        } else {
+        }
+        else {
             return value.unscaledValue();
         }
     }
@@ -1616,7 +1627,7 @@
      * 1 unit of FIELDS[i] is equivalent to <code>FACTORS[i]</code> unit of
      * FIELDS[i+1].
      */
-    private static final BigDecimal[] FACTORS = new BigDecimal[]{
+    private static final BigDecimal[] FACTORS = new BigDecimal[] {
         BigDecimal.valueOf(12),
         null/*undefined*/,
         BigDecimal.valueOf(24),
@@ -1964,10 +1975,20 @@
     }
 
     /**
+     * Returns time value in milliseconds
+     * @param cal A calendar object
+     * @return time value
+     *
+     * Diff from Xerces; Use JDK 1.5 feature.
+     */
+    private static long getCalendarTimeInMillis(Calendar cal) {
+        return cal.getTimeInMillis();
+    }
+
+    /**
      * <p>Stream Unique Identifier.</p>
      *
-     * <p>TODO: Serialization should use the XML string representation as
-     * the serialization format to ensure future compatibility.</p>
+     * <p>Serialization uses the lexical form returned by toString().</p>
      */
     private static final long serialVersionUID = 1L;
 
@@ -1996,25 +2017,10 @@
         }
 
         private Object readResolve() throws ObjectStreamException {
-            //            try {
             return new DurationImpl(lexical);
-            //            } catch( ParseException e ) {
-            //                throw new StreamCorruptedException("unable to parse "+lexical+" as duration");
-            //            }
         }
 
         private static final long serialVersionUID = 1L;
     }
 
-    /**
-     * Calls the {@link Calendar#getTimeInMillis} method.
-     * Prior to JDK1.4, this method was protected and therefore
-     * cannot be invoked directly.
-     *
-     * In future, this should be replaced by
-     * <code>cal.getTimeInMillis()</code>
-     */
-    private static long getCalendarTimeInMillis(Calendar cal) {
-        return cal.getTime().getTime();
-    }
 }
--- a/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/datatype/XMLGregorianCalendarImpl.java	Fri Feb 21 11:40:06 2014 -0800
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/datatype/XMLGregorianCalendarImpl.java	Mon Feb 24 12:57:31 2014 -0800
@@ -25,6 +25,8 @@
 
 package com.sun.org.apache.xerces.internal.jaxp.datatype;
 
+import java.io.IOException;
+import java.io.ObjectInputStream;
 import java.io.Serializable;
 import java.math.BigDecimal;
 import java.math.BigInteger;
@@ -195,6 +197,17 @@
         extends XMLGregorianCalendar
         implements Serializable, Cloneable {
 
+    /** Backup values **/
+    transient private BigInteger orig_eon;
+    transient private int orig_year = DatatypeConstants.FIELD_UNDEFINED;
+    transient private int orig_month = DatatypeConstants.FIELD_UNDEFINED;
+    transient private int orig_day = DatatypeConstants.FIELD_UNDEFINED;
+    transient private int orig_hour = DatatypeConstants.FIELD_UNDEFINED;
+    transient private int orig_minute = DatatypeConstants.FIELD_UNDEFINED;
+    transient private int orig_second = DatatypeConstants.FIELD_UNDEFINED;
+    transient private BigDecimal orig_fracSeconds;
+    transient private int orig_timezone = DatatypeConstants.FIELD_UNDEFINED;
+
     /**
      * <p>Eon of this <code>XMLGregorianCalendar</code>.</p>
      */
@@ -241,9 +254,14 @@
     private BigDecimal fractionalSecond = null;
 
     /**
-     * <p>Constant to represent a billion.</p>
+     * <p>BigInteger constant; representing a billion.</p>
      */
-    private static final BigInteger BILLION = new BigInteger("1000000000");
+    private static final BigInteger BILLION_B = new BigInteger("1000000000");
+
+    /**
+     * <p>int constant; representing a billion.</p>
+     */
+    private static final int BILLION_I = 1000000000;
 
     /**
      *   <p>Obtain a pure Gregorian Calendar by calling
@@ -441,6 +459,23 @@
                     //"\"" + lexicalRepresentation + "\" is not a valid representation of an XML Gregorian Calendar value."
             );
         }
+
+        save();
+    }
+
+    /**
+     * save original values
+     */
+    private void save() {
+        orig_eon = eon;
+        orig_year = year;
+        orig_month = month;
+        orig_day = day;
+        orig_hour = hour;
+        orig_minute = minute;
+        orig_second = second;
+        orig_fracSeconds = fractionalSecond;
+        orig_timezone = timezone;
     }
 
     /**
@@ -479,14 +514,14 @@
         BigDecimal fractionalSecond,
         int timezone) {
 
-                setYear(year);
+        setYear(year);
         setMonth(month);
         setDay(day);
         setTime(hour, minute, second, fractionalSecond);
-                setTimezone(timezone);
+        setTimezone(timezone);
 
-                // check for validity
-                if (!isValid()) {
+        // check for validity
+        if (!isValid()) {
 
             throw new IllegalArgumentException(
                 DatatypeMessageFormatter.formatMessage(null,
@@ -519,8 +554,9 @@
                 );
                 */
 
-                }
+        }
 
+        save();
     }
 
     /**
@@ -547,17 +583,21 @@
         int hour,
         int minute,
         int second,
-                int millisecond,
+        int millisecond,
         int timezone) {
 
-                setYear(year);
+        setYear(year);
         setMonth(month);
         setDay(day);
         setTime(hour, minute, second);
-                setTimezone(timezone);
-                setMillisecond(millisecond);
+        setTimezone(timezone);
+        BigDecimal realMilliseconds = null;
+        if (millisecond != DatatypeConstants.FIELD_UNDEFINED) {
+            realMilliseconds = BigDecimal.valueOf(millisecond, 3);
+        }
+        setFractionalSecond(realMilliseconds);
 
-                if (!isValid()) {
+        if (!isValid()) {
 
             throw new IllegalArgumentException(
                 DatatypeMessageFormatter.formatMessage(null,
@@ -580,7 +620,9 @@
                     );
                  */
 
-                }
+        }
+
+        save();
     }
 
         /**
@@ -661,6 +703,7 @@
         // Calendar ZONE_OFFSET and DST_OFFSET fields are in milliseconds.
         int offsetInMinutes = (cal.get(Calendar.ZONE_OFFSET) + cal.get(Calendar.DST_OFFSET)) / (60 * 1000);
         this.setTimezone(offsetInMinutes);
+        save();
     }
 
     // Factories
@@ -1164,7 +1207,7 @@
             this.eon = null;
             this.year = DatatypeConstants.FIELD_UNDEFINED;
         } else {
-            BigInteger temp = year.remainder(BILLION);
+            BigInteger temp = year.remainder(BILLION_B);
             this.year = temp.intValue();
             setEon(year.subtract(temp));
         }
@@ -1187,12 +1230,13 @@
         if (year == DatatypeConstants.FIELD_UNDEFINED) {
             this.year = DatatypeConstants.FIELD_UNDEFINED;
             this.eon = null;
-        } else if (Math.abs(year) < BILLION.intValue()) {
+        }
+        else if (Math.abs(year) < BILLION_I) {
             this.year = year;
             this.eon = null;
         } else {
             BigInteger theYear = BigInteger.valueOf((long) year);
-            BigInteger remainder = theYear.remainder(BILLION);
+            BigInteger remainder = theYear.remainder(BILLION_B);
             this.year = remainder.intValue();
             setEon(theYear.subtract(remainder));
         }
@@ -1688,6 +1732,9 @@
         if (obj == null || !(obj instanceof XMLGregorianCalendar)) {
             return false;
         }
+        if (obj == this) {
+            return true;
+        }
         return compare((XMLGregorianCalendar) obj) == DatatypeConstants.EQUAL;
     }
 
@@ -1950,51 +1997,36 @@
         // no need to check for anything except for constraints
         // between fields.
 
-        //check if days in month is valid. Can be dependent on leap year.
-        if (getMonth() == DatatypeConstants.FEBRUARY) {
-            // years could not be set
-            int maxDays = 29;
-
-            if (eon == null) {
-                if(year!=DatatypeConstants.FIELD_UNDEFINED)
-                    maxDays = maximumDayInMonthFor(year,getMonth());
-            } else {
-                BigInteger years = getEonAndYear();
-                if (years != null) {
-                    maxDays = maximumDayInMonthFor(getEonAndYear(), DatatypeConstants.FEBRUARY);
+        // check if days in month is valid. Can be dependent on leap year.
+        if (month != DatatypeConstants.FIELD_UNDEFINED && day != DatatypeConstants.FIELD_UNDEFINED) {
+            if (year != DatatypeConstants.FIELD_UNDEFINED) {
+                if (eon == null) {
+                    if (day > maximumDayInMonthFor(year, month)) {
+                        return false;
+                    }
+                }
+                else if (day > maximumDayInMonthFor(getEonAndYear(), month)) {
+                    return false;
                 }
             }
-            if (getDay() > maxDays) {
+            // Use 2000 as a default since it's a leap year.
+            else if (day > maximumDayInMonthFor(2000, month)) {
                 return false;
             }
         }
 
         // http://www.w3.org/2001/05/xmlschema-errata#e2-45
-        if (getHour() == 24) {
-            if(getMinute() != 0) {
-                return false;
-            } else if (getSecond() != 0) {
-                return false;
-            }
+        if (hour == 24 && (minute != 0 || second != 0 ||
+                (fractionalSecond != null && fractionalSecond.compareTo(DECIMAL_ZERO) != 0))) {
+            return false;
         }
 
         // XML Schema 1.0 specification defines year value of zero as
         // invalid. Allow this class to set year field to zero
         // since XML Schema 1.0 errata states that lexical zero will
         // be allowed in next version and treated as 1 B.C.E.
-        if (eon == null) {
-            // optimize check.
-            if (year == 0) {
-                return false;
-            }
-        } else {
-            BigInteger yearField = getEonAndYear();
-            if (yearField != null) {
-                int result = compareField(yearField, BigInteger.ZERO);
-                if (result == DatatypeConstants.EQUAL) {
-                    return false;
-                }
-            }
+        if (eon == null && year == 0) {
+            return false;
         }
         return true;
     }
@@ -2213,7 +2245,7 @@
             int quotient;
             if (endMonth < 0) {
                 endMonth = (13 - 1) + endMonth + 1;
-                quotient = new BigDecimal(intTemp - 1).divide(new BigDecimal(TWELVE), BigDecimal.ROUND_UP).intValue();
+                quotient = BigDecimal.valueOf(intTemp - 1).divide(new BigDecimal(TWELVE), BigDecimal.ROUND_UP).intValue();
             } else {
                 quotient = (intTemp - 1) / (13 - 1);
                 endMonth += 1;
@@ -2259,18 +2291,20 @@
     private static final BigInteger SIXTY = BigInteger.valueOf(60);
     private static final BigInteger TWENTY_FOUR = BigInteger.valueOf(24);
     private static final BigInteger TWELVE = BigInteger.valueOf(12);
-    private static final BigDecimal DECIMAL_ZERO = new BigDecimal("0");
-    private static final BigDecimal DECIMAL_ONE = new BigDecimal("1");
-    private static final BigDecimal DECIMAL_SIXTY = new BigDecimal("60");
+    private static final BigDecimal DECIMAL_ZERO = BigDecimal.valueOf(0);
+    private static final BigDecimal DECIMAL_ONE = BigDecimal.valueOf(1);
+    private static final BigDecimal DECIMAL_SIXTY = BigDecimal.valueOf(60);
 
 
-    private static int daysInMonth[] = { 0,  // XML Schema months start at 1.
-                                       31, 28, 31, 30, 31, 30,
-                                       31, 31, 30, 31, 30, 31};
+    private static class DaysInMonth {
+        private static final int [] table = { 0,  // XML Schema months start at 1.
+            31, 28, 31, 30, 31, 30,
+            31, 31, 30, 31, 30, 31};
+    }
 
     private static int maximumDayInMonthFor(BigInteger year, int month) {
         if (month != DatatypeConstants.FEBRUARY) {
-            return daysInMonth[month];
+            return DaysInMonth.table[month];
         } else {
             if (year.mod(FOUR_HUNDRED).equals(BigInteger.ZERO) ||
                     (!year.mod(HUNDRED).equals(BigInteger.ZERO) &&
@@ -2278,21 +2312,21 @@
                 // is a leap year.
                 return 29;
             } else {
-                return daysInMonth[month];
+                return DaysInMonth.table[month];
             }
         }
     }
 
     private static int maximumDayInMonthFor(int year, int month) {
         if (month != DatatypeConstants.FEBRUARY) {
-            return daysInMonth[month];
+            return DaysInMonth.table[month];
         } else {
             if (((year % 400) == 0) ||
                     (((year % 100) != 0) && ((year % 4) == 0))) {
                 // is a leap year.
                 return 29;
             } else {
-                return daysInMonth[DatatypeConstants.FEBRUARY];
+                return DaysInMonth.table[DatatypeConstants.FEBRUARY];
             }
         }
     }
@@ -2404,10 +2438,16 @@
         result.setGregorianChange(PURE_GREGORIAN_CHANGE);
 
         // if year( and eon) are undefined, leave default Calendar values
-        BigInteger year = getEonAndYear();
-        if (year != null) {
-            result.set(Calendar.ERA, year.signum() == -1 ? GregorianCalendar.BC : GregorianCalendar.AD);
-            result.set(Calendar.YEAR, year.abs().intValue());
+        if (year != DatatypeConstants.FIELD_UNDEFINED) {
+            if (eon == null) {
+                result.set(Calendar.ERA, year < 0 ? GregorianCalendar.BC : GregorianCalendar.AD);
+                result.set(Calendar.YEAR, Math.abs(year));
+            }
+            else {
+                BigInteger eonAndYear = getEonAndYear();
+                result.set(Calendar.ERA, eonAndYear.signum() == -1 ? GregorianCalendar.BC : GregorianCalendar.AD);
+                result.set(Calendar.YEAR, eonAndYear.abs().intValue());
+            }
         }
 
         // only set month if it is set
@@ -2543,16 +2583,31 @@
         result.setGregorianChange(PURE_GREGORIAN_CHANGE);
 
         // if year( and eon) are undefined, leave default Calendar values
-        BigInteger year = getEonAndYear();
-        if (year != null) {
-            result.set(Calendar.ERA, year.signum() == -1 ? GregorianCalendar.BC : GregorianCalendar.AD);
-            result.set(Calendar.YEAR, year.abs().intValue());
+        if (year != DatatypeConstants.FIELD_UNDEFINED) {
+            if (eon == null) {
+                result.set(Calendar.ERA, year < 0 ? GregorianCalendar.BC : GregorianCalendar.AD);
+                result.set(Calendar.YEAR, Math.abs(year));
+            }
+            else {
+                final BigInteger eonAndYear = getEonAndYear();
+                result.set(Calendar.ERA, eonAndYear.signum() == -1 ? GregorianCalendar.BC : GregorianCalendar.AD);
+                result.set(Calendar.YEAR, eonAndYear.abs().intValue());
+            }
         } else {
             // use default if set
-            BigInteger defaultYear = (defaults != null) ? defaults.getEonAndYear() : null;
-            if (defaultYear != null) {
-                result.set(Calendar.ERA, defaultYear.signum() == -1 ? GregorianCalendar.BC : GregorianCalendar.AD);
-                result.set(Calendar.YEAR, defaultYear.abs().intValue());
+            if (defaults != null) {
+                final int defaultYear = defaults.getYear();
+                if (defaultYear != DatatypeConstants.FIELD_UNDEFINED) {
+                    if (defaults.getEon() == null) {
+                        result.set(Calendar.ERA, defaultYear < 0 ? GregorianCalendar.BC : GregorianCalendar.AD);
+                        result.set(Calendar.YEAR, Math.abs(defaultYear));
+                    }
+                    else {
+                        final BigInteger defaultEonAndYear = defaults.getEonAndYear();
+                        result.set(Calendar.ERA, defaultEonAndYear.signum() == -1 ? GregorianCalendar.BC : GregorianCalendar.AD);
+                        result.set(Calendar.YEAR, defaultEonAndYear.abs().intValue());
+                    }
+                }
             }
         }
 
@@ -2562,7 +2617,7 @@
             result.set(Calendar.MONTH, month - 1);
         } else {
             // use default if set
-            int defaultMonth = (defaults != null) ? defaults.getMonth() : DatatypeConstants.FIELD_UNDEFINED;
+            final int defaultMonth = (defaults != null) ? defaults.getMonth() : DatatypeConstants.FIELD_UNDEFINED;
             if (defaultMonth != DatatypeConstants.FIELD_UNDEFINED) {
                 // Calendar.MONTH is zero based while XMLGregorianCalendar month field is not.
                 result.set(Calendar.MONTH, defaultMonth - 1);
@@ -2574,7 +2629,7 @@
             result.set(Calendar.DAY_OF_MONTH, day);
         } else {
             // use default if set
-            int defaultDay = (defaults != null) ? defaults.getDay() : DatatypeConstants.FIELD_UNDEFINED;
+            final int defaultDay = (defaults != null) ? defaults.getDay() : DatatypeConstants.FIELD_UNDEFINED;
             if (defaultDay != DatatypeConstants.FIELD_UNDEFINED) {
                 result.set(Calendar.DAY_OF_MONTH, defaultDay);
             }
@@ -2596,7 +2651,7 @@
             result.set(Calendar.MINUTE, minute);
         } else {
             // use default if set
-            int defaultMinute = (defaults != null) ? defaults.getMinute() : DatatypeConstants.FIELD_UNDEFINED;
+            final int defaultMinute = (defaults != null) ? defaults.getMinute() : DatatypeConstants.FIELD_UNDEFINED;
             if (defaultMinute != DatatypeConstants.FIELD_UNDEFINED) {
                 result.set(Calendar.MINUTE, defaultMinute);
             }
@@ -2607,7 +2662,7 @@
             result.set(Calendar.SECOND, second);
         } else {
             // use default if set
-            int defaultSecond = (defaults != null) ? defaults.getSecond() : DatatypeConstants.FIELD_UNDEFINED;
+            final int defaultSecond = (defaults != null) ? defaults.getSecond() : DatatypeConstants.FIELD_UNDEFINED;
             if (defaultSecond != DatatypeConstants.FIELD_UNDEFINED) {
                 result.set(Calendar.SECOND, defaultSecond);
             }
@@ -2618,7 +2673,7 @@
             result.set(Calendar.MILLISECOND, getMillisecond());
         } else {
             // use default if set
-            BigDecimal defaultFractionalSecond = (defaults != null) ? defaults.getFractionalSecond() : null;
+            final BigDecimal defaultFractionalSecond = (defaults != null) ? defaults.getFractionalSecond() : null;
             if (defaultFractionalSecond != null) {
                 result.set(Calendar.MILLISECOND, defaults.getMillisecond());
             }
@@ -2671,6 +2726,9 @@
             customTimezoneId.append(sign);
             customTimezoneId.append(hour);
             if (minutes != 0) {
+                if (minutes < 10) {
+                    customTimezoneId.append('0');
+                }
                 customTimezoneId.append(minutes);
             }
             result = TimeZone.getTimeZone(customTimezoneId.toString());
@@ -2718,7 +2776,7 @@
             if(millisecond<0 || 999<millisecond)
                 if(millisecond!=DatatypeConstants.FIELD_UNDEFINED)
                     invalidFieldValue(MILLISECOND, millisecond);
-            fractionalSecond = new BigDecimal((long) millisecond).movePointLeft(3);
+            fractionalSecond = BigDecimal.valueOf(millisecond, 3);
         }
     }
 
@@ -2770,7 +2828,7 @@
                 // seen meta character. we don't do error check against the format
                 switch (format.charAt(fidx++)) {
                     case 'Y' : // year
-                        parseAndSetYear(4);
+                        parseYear();
                         break;
 
                     case 'M' : // month
@@ -2851,7 +2909,7 @@
             int n = 0;
             char ch;
             int vstart = vidx;
-            while (isDigit(ch=peek()) && (vidx - vstart) <= maxDigits) {
+            while (isDigit(ch=peek()) && (vidx - vstart) < maxDigits) {
                 vidx++;
                 n = n*10 + ch-'0';
             }
@@ -2863,38 +2921,30 @@
             return n;
         }
 
-        private void parseAndSetYear(int minDigits)
-                throws IllegalArgumentException {
+        private void parseYear()
+            throws IllegalArgumentException {
             int vstart = vidx;
-            int n = 0;
-            boolean neg = false;
+            int sign = 0;
 
             // skip leading negative, if it exists
             if (peek() == '-') {
                 vidx++;
-                neg = true;
+                sign = 1;
             }
-            while(true) {
-                char ch = peek();
-                if(!isDigit(ch))
-                    break;
+            while (isDigit(peek())) {
                 vidx++;
-                n = n*10 + ch-'0';
             }
-
-            if ((vidx - vstart) < minDigits) {
+            final int digits = vidx - vstart - sign;
+            if (digits < 4) {
                 // we are expecting more digits
                 throw new IllegalArgumentException(value); //,vidx);
             }
-
-            if(vidx-vstart<7) {
-                // definitely int only. I don't know the exact # of digits that can be in int,
-                // but as long as we can catch (0-9999) range, that should be enough.
-                if(neg)     n = -n;
-                year = n;
-                eon = null;
-            } else {
-                setYear(new BigInteger(value.substring(vstart, vidx)));
+            final String yearString = value.substring(vstart, vidx);
+            if (digits < 10) {
+                setYear(Integer.parseInt(yearString));
+            }
+            else {
+                setYear(new BigInteger(yearString));
             }
         }
 
@@ -2922,150 +2972,123 @@
      * Prints this object according to the format specification.
      *
      * <p>
-     * I wrote a custom format method for a particular format string to
-     * see if it improves the performance, but it didn't. So this interpreting
-     * approach isn't too bad.
-     *
-     * <p>
      * StringBuffer -> StringBuilder change had a very visible impact.
-     * It almost cut the execution time to half, but unfortunately we can't use it
-     * because we need to run on JDK 1.3
+     * It almost cut the execution time to half.
+     * Diff from Xerces:
+     * Xerces use StringBuffer due to the requirement to support
+     * JDKs older than JDK 1.5
      */
     private String format( String format ) {
-        char[] buf = new char[32];
-        int bufPtr = 0;
-
+        StringBuilder buf = new StringBuilder();
         int fidx=0,flen=format.length();
 
         while(fidx<flen) {
             char fch = format.charAt(fidx++);
             if(fch!='%') {// not a meta char
-                buf[bufPtr++] = fch;
+                buf.append(fch);
                 continue;
             }
 
             switch(format.charAt(fidx++)) {
-            case 'Y':
-                if(eon==null) {
-                    // optimized path
-                    int y = getYear();
-                    if(y<0) {
-                        buf[bufPtr++] = '-';
-                        y = -y;
+                case 'Y':
+                    if (eon == null) {
+                        int absYear = year;
+                        if (absYear < 0) {
+                            buf.append('-');
+                            absYear = -year;
+                        }
+                        printNumber(buf, absYear, 4);
+                    }
+                    else {
+                        printNumber(buf, getEonAndYear(), 4);
                     }
-                    bufPtr = print4Number(buf,bufPtr,y);
-                } else {
-                    String s = getEonAndYear().toString();
-                    // reallocate the buffer now so that it has enough space
-                    char[] n = new char[buf.length+s.length()];
-                    System.arraycopy(buf,0,n,0,bufPtr);
-                    buf = n;
-                    for(int i=s.length();i<4;i++)
-                        buf[bufPtr++] = '0';
-                    s.getChars(0,s.length(),buf,bufPtr);
-                    bufPtr += s.length();
-                }
-                break;
-            case 'M':
-                bufPtr = print2Number(buf,bufPtr,getMonth());
-                break;
-            case 'D':
-                bufPtr = print2Number(buf,bufPtr,getDay());
-                break;
-            case 'h':
-                bufPtr = print2Number(buf,bufPtr,getHour());
-                break;
-            case 'm':
-                bufPtr = print2Number(buf,bufPtr,getMinute());
-                break;
-            case 's':
-                bufPtr = print2Number(buf,bufPtr,getSecond());
-                if (getFractionalSecond() != null) {
-                    // Note: toPlainString() isn't available before Java 1.5
-                    String frac = getFractionalSecond().toString();
-
-                    int pos = frac.indexOf("E-");
-                    if (pos >= 0) {
-                        String zeros = frac.substring(pos+2);
-                        frac = frac.substring(0,pos);
-                        pos = frac.indexOf(".");
-                        if (pos >= 0) {
-                            frac = frac.substring(0,pos) + frac.substring(pos+1);
+                    break;
+                case 'M':
+                    printNumber(buf,getMonth(),2);
+                    break;
+                case 'D':
+                    printNumber(buf,getDay(),2);
+                    break;
+                case 'h':
+                    printNumber(buf,getHour(),2);
+                    break;
+                case 'm':
+                    printNumber(buf,getMinute(),2);
+                    break;
+                case 's':
+                    printNumber(buf,getSecond(),2);
+                    if (getFractionalSecond() != null) {
+                        //Xerces uses a custom method toString instead of
+                        //toPlainString() since it needs to support JDKs older than 1.5
+                        String frac = getFractionalSecond().toPlainString();
+                        //skip leading zero.
+                        buf.append(frac.substring(1, frac.length()));
+                    }
+                    break;
+                case 'z':
+                    int offset = getTimezone();
+                    if (offset == 0) {
+                        buf.append('Z');
+                    }
+                    else if (offset != DatatypeConstants.FIELD_UNDEFINED) {
+                        if (offset < 0) {
+                            buf.append('-');
+                            offset *= -1;
                         }
-                        int count = Integer.parseInt(zeros);
-                        if (count < 40) {
-                            frac = "00000000000000000000000000000000000000000".substring(0,count-1) + frac;
-                        } else {
-                            // do it the hard way
-                            while (count > 1) {
-                                frac = "0" + frac;
-                                count--;
-                            }
+                        else {
+                            buf.append('+');
                         }
-                        frac = "0." + frac;
+                        printNumber(buf,offset/60,2);
+                        buf.append(':');
+                        printNumber(buf,offset%60,2);
                     }
-
-                    // reallocate the buffer now so that it has enough space
-                    char[] n = new char[buf.length+frac.length()];
-                    System.arraycopy(buf,0,n,0,bufPtr);
-                    buf = n;
-                    //skip leading zero.
-                    frac.getChars(1, frac.length(), buf, bufPtr);
-                    bufPtr += frac.length()-1;
-                }
-                break;
-            case 'z':
-                int offset = getTimezone();
-                if (offset == 0) {
-                    buf[bufPtr++] = 'Z';
-                } else
-                if (offset != DatatypeConstants.FIELD_UNDEFINED) {
-                    if (offset < 0) {
-                        buf[bufPtr++] = '-';
-                        offset *= -1;
-                    } else {
-                        buf[bufPtr++] = '+';
-                    }
-                    bufPtr = print2Number(buf, bufPtr, offset / 60);
-                    buf[bufPtr++] = ':';
-                    bufPtr = print2Number(buf, bufPtr, offset % 60);
-                }
-                break;
-            default:
-                throw new InternalError();  // impossible
+                    break;
+                default:
+                    throw new InternalError();  // impossible
             }
         }
 
-        return new String(buf,0,bufPtr);
+        return buf.toString();
     }
 
     /**
-     * Prints an int as two digits into the buffer.
+     * Prints an integer as a String.
      *
+     * @param out
+     *      The formatted string will be appended into this buffer.
      * @param number
-     *      Number to be printed. Must be positive.
+     *      The integer to be printed.
+     * @param nDigits
+     *      The field will be printed by using at least this
+     *      number of digits. For example, 5 will be printed as "0005"
+     *      if nDigits==4.
      */
-    private int print2Number( char[] out, int bufptr, int number ) {
-        out[bufptr++] = (char) ('0'+(number/10));
-        out[bufptr++] = (char) ('0'+(number%10));
-        return bufptr;
+    private void printNumber( StringBuilder out, int number, int nDigits ) {
+        String s = String.valueOf(number);
+        for (int i = s.length(); i < nDigits; i++) {
+            out.append('0');
+        }
+        out.append(s);
     }
 
     /**
-     * Prints an int as four digits into the buffer.
+     * Prints an BigInteger as a String.
      *
+     * @param out
+     *      The formatted string will be appended into this buffer.
      * @param number
-     *      Number to be printed. Must be positive.
+     *      The integer to be printed.
+     * @param nDigits
+     *      The field will be printed by using at least this
+     *      number of digits. For example, 5 will be printed as "0005"
+     *      if nDigits==4.
      */
-    private int print4Number( char[] out, int bufptr, int number ) {
-        out[bufptr+3] = (char) ('0'+(number%10));
-        number /= 10;
-        out[bufptr+2] = (char) ('0'+(number%10));
-        number /= 10;
-        out[bufptr+1] = (char) ('0'+(number%10));
-        number /= 10;
-        out[bufptr  ] = (char) ('0'+(number%10));
-        return bufptr+4;
+    private void printNumber( StringBuilder out, BigInteger number, int nDigits) {
+        String s = number.toString();
+        for (int i=s.length(); i < nDigits; i++) {
+            out.append('0');
+        }
+        out.append(s);
     }
 
     /**
@@ -3085,6 +3108,26 @@
      *  with the creation of new <code>XMLGregorianCalendar</code>s.</p>
      */
     public void reset() {
-        //PENDING : Implementation of reset method
+        eon = orig_eon;
+        year = orig_year;
+        month = orig_month;
+        day = orig_day;
+        hour = orig_hour;
+        minute = orig_minute;
+        second = orig_second;
+        fractionalSecond = orig_fracSeconds;
+        timezone = orig_timezone;
     }
+
+    /** Deserialize Calendar. */
+    private void readObject(ObjectInputStream ois)
+        throws ClassNotFoundException, IOException {
+
+        // perform default deseralization
+        ois.defaultReadObject();
+
+        // initialize orig_* fields
+        save();
+
+    } // readObject(ObjectInputStream)
 }