changeset 59:628b344f6b62

Merge jdk7-b58 from main OpenJDK repository.
author kurt
date Fri, 15 May 2009 12:37:09 -0400
parents f00d4df4d182 13bf67d8c634
children 614a1a643d6f
files make/jprt.config src/share/classes/com/sun/org/apache/xalan/internal/client/XSLTProcessorApplet.java src/share/classes/com/sun/org/apache/xalan/internal/client/package.html
diffstat 28 files changed, 223 insertions(+), 1149 deletions(-) [+]
line wrap: on
line diff
--- a/.hgignore	Thu Mar 12 12:58:59 2009 -0700
+++ b/.hgignore	Fri May 15 12:37:09 2009 -0400
@@ -1,3 +1,4 @@
 ^build/
 ^dist/
+^webrev/
 ^nbproject/private/
--- a/.hgtags	Thu Mar 12 12:58:59 2009 -0700
+++ b/.hgtags	Fri May 15 12:37:09 2009 -0400
@@ -25,3 +25,10 @@
 39de90eb4822cafaacc69edd67ab5547e55ae920 jdk7-b48
 5c1f24531903573c1830775432276da567243f9c jdk7-b49
 e8514e2be76d90889ebdb90d627aca2db5c150c6 jdk7-b50
+ae890d80d5dffcd4dc77a1f17d768e192d1852c7 jdk7-b51
+69ad87dc25cbcaaaded4727199395ad0c78bc427 jdk7-b52
+e8837366d3fd72f7c7a47ebfdbd5106c16156f12 jdk7-b53
+946a9f0c493261fa6a010dc33e61b9b535ba80c1 jdk7-b54
+039945fba683ee6773a721e2bd4e449f6133769a jdk7-b55
+c197c6801271c60f9c9f5d18fcc95b59e76dcd54 jdk7-b56
+e4851e9f7be26fc52a628be06ffa8aaea0919bd7 jdk7-b57
--- a/THIRD_PARTY_README	Thu Mar 12 12:58:59 2009 -0700
+++ b/THIRD_PARTY_README	Fri May 15 12:37:09 2009 -0400
@@ -61,6 +61,28 @@
 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.
+
+%% This notice is provided with respect to littlecms, which may be included with this software:  
+
+Little cms
+Copyright (C) 1998-2004 Marti Maria
+
+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.
 %% This notice is provided with respect to zlib 1.1.3, which may be included with this software:   
 
 Acknowledgments:
@@ -115,16 +137,6 @@
 The name and trademarks of copyright holders may NOT be used in advertising or publicity pertaining to the software without specific, written prior permission. Title to copyright in this software and any associated documentation will at all times remain with copyright holders.
 ____________________________________
 This formulation of W3C's notice and license became active on August 14 1998 so as to improve compatibility with GPL. This version ensures that W3C software licensing terms are no more restrictive than GPL and consequently W3C software may be distributed in GPL packages. See the older formulation for the policy prior to this date. Please see our Copyright FAQ for common questions about using materials from our site, including specific terms and conditions for packages like libwww, Amaya, and Jigsaw. Other questions about this notice can be directed to site-policy@w3.org.
-
-%% This notice is provided with respect to jscheme.jar, which may be included with this software: 
-Software License Agreement
-Copyright  1998-2002 by Peter Norvig. 
-Permission is granted to anyone to use this software, in source or object code form, on any computer system, and to modify, compile, decompile, run, and redistribute it to anyone else, subject to the following restrictions: 
-1.The author makes no warranty of any kind, either expressed or implied, about the suitability of this software for any purpose.
-2.The author accepts no liability of any kind for damages or other consequences of the use of this software, even if they arise from defects in the software.
-3.The origin of this software must not be misrepresented, either by explicit claim or by omission.
-4.Altered versions must be plainly marked as such, and must not be misrepresented as being the original software. Altered versions may be distributed in packages under other licenses (such as the GNU license). 
-If you find this software useful, it would be nice if you let me (peter@norvig.com) know about it, and nicer still if you send me modifications that you are willing to share. However, you are not required to do so.
 
 
 %% This notice is provided with respect to PC/SC Lite for Suse Linux v. 1.1.1, which may be included with this software: 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/TRADEMARK	Fri May 15 12:37:09 2009 -0400
@@ -0,0 +1,41 @@
+OpenJDK Trademark Notice
+Version 1.1, 2008/3/10
+
+OpenJDK (the "Name") is a trademark of Sun Microsystems, Inc. (the "Owner").
+Owner permits any person obtaining a copy of this software (the "Software")
+which is based on original software retrieved from one of the following
+websites: http://download.java.net/openjdk, http://hg.openjdk.java.net/jdk6,
+or http://openjdk.java.net (each a "Website", with the original software made
+available by the Owner on a Website being known as the "Website Software") to
+use the Name in package names and version strings of the Software subject to
+the following conditions:
+
+  - The Software is a substantially complete implementation of the OpenJDK
+    development kit or runtime environment code made available by Owner on a
+    Website, and the vast majority of the Software code is identical to the
+    upstream Website Software;
+
+  - No permission is hereby granted to use the Name in any other manner,
+    unless such use constitutes "fair use."
+
+  - The Owner makes no warranties of any kind respecting the Name and all
+    representations and warranties, including any implied warranty of
+    merchantability, fitness for a particular purpose or non-infringement
+    are hereby disclaimed; and
+
+  - This notice and the following legend are included in all copies of the
+    Software or portions of it:
+
+        OpenJDK is a trademark or registered trademark of Sun Microsystems,
+        Inc. in the United States and other countries.
+
+The Name may also be used in connection with descriptions of the Software that
+constitute "fair use," such as "derived from the OpenJDK code base" or "based
+on the OpenJDK source code."
+
+Owner intends to revise this Notice as necessary in order to meet the needs of
+the OpenJDK Community.  Please send questions or comments about this Notice to
+Sun Microsystems at openjdk-tm@sun.com.  Revisions to this Notice will be
+announced on the public mailing list announce@openjdk.java.net, to which you
+may subscribe by visiting http://mail.openjdk.java.net.  The latest version of
+this Notice may be found at http://openjdk.java.net/legal.
--- a/make/jprt.config	Thu Mar 12 12:58:59 2009 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,241 +0,0 @@
-#!echo "This is not a shell script"
-#############################################################################
-#
-# Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.  Sun designates this
-# particular file as subject to the "Classpath" exception as provided
-# by Sun in the LICENSE file that accompanied this code.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
-# CA 95054 USA or visit www.sun.com if you need additional information or
-# have any questions.
-#
-#############################################################################
-#
-# JPRT shell configuration for building.
-#
-# Input environment variables:
-#    ALT_BOOTDIR
-#    ALT_SLASH_JAVA
-#    ALT_JDK_IMPORT_PATH
-#    Windows Only:
-#      PATH
-#      PROCESSOR_IDENTIFIER
-#      ROOTDIR
-#
-# Output variable settings:
-#    make    Full path to GNU make
-#
-# Output environment variables:
-#    PATH
-#    Windows Only:
-#      ALT_DEVTOOLS_PATH (To avoid the C:/UTILS default)
-#
-# After JDK6, most settings will be found via ALT_SLASH_JAVA or
-#   by way of other system environment variables. If this was JDK5
-#   or an older JDK, you might need to export more ALT_* variables.
-#
-#############################################################################
-
-#############################################################################
-# Error
-error() # message
-{
-  echo "ERROR: $1"
-  exit 6
-}
-# Directory must exist
-dirMustExist() # dir name
-{
-  if [ ! -d "$1" ] ; then
-    error "Directory for $2 does not exist: $1"
-  fi
-}
-# File must exist
-fileMustExist() # dir name
-{
-  if [ ! -f "$1" ] ; then
-    error "File for $2 does not exist: $1"
-  fi
-}
-#############################################################################
-
-# Should be set by JPRT as the 3 basic inputs
-bootdir="${ALT_BOOTDIR}"
-slashjava="${ALT_SLASH_JAVA}"
-jdk_import="${ALT_JDK_IMPORT_PATH}"
-
-# Check input
-dirMustExist "${bootdir}"    ALT_BOOTDIR
-dirMustExist "${slashjava}"  ALT_SLASH_JAVA
-dirMustExist "${jdk_import}" ALT_JDK_IMPORT_PATH
-
-# Uses 'uname -s', but only expect SunOS or Linux, assume Windows otherwise.
-osname=`uname -s`
-if [ "${osname}" = SunOS ] ; then
-   
-    # SOLARIS: Sparc or X86
-    osarch=`uname -p`
-    if [ "${osarch}" = sparc ] ; then
-	solaris_arch=sparc
-    else
-	solaris_arch=i386
-    fi
-
-    # Add basic solaris system paths
-    path4sdk=/usr/ccs/bin:/usr/ccs/lib:/usr/bin:/bin:/usr/sfw/bin
-
-    # Get the previous JDK to be used to bootstrap the build
-    path4sdk=${bootdir}/bin:${path4sdk}
-
-    # Ant
-    ANT_HOME=${slashjava}/devtools/share/ant/1.7.0
-    export ANT_HOME
-    antbindir=${ANT_HOME}/bin
-    fileMustExist "${antbindir}/ant" ant
-    path4sdk=${antbindir}:${path4sdk}
-
-    # Find GNU make
-    make=/usr/sfw/bin/gmake
-    if [ ! -f ${make} ] ; then
-	make=/opt/sfw/bin/gmake
-	if [ ! -f ${make} ] ; then
-	    make=${slashjava}/devtools/${solaris_arch}/bin/gnumake
-        fi 
-    fi
-    fileMustExist "${make}" make
-
-    # File creation mask
-    umask 002
-
-elif [ "${osname}" = Linux ] ; then
-   
-    # LINUX: X86, AMD64
-    osarch=`uname -m`
-    if [ "${osarch}" = i686 ] ; then
-	linux_arch=i586
-    elif [ "${osarch}" = x86_64 ] ; then
-	linux_arch=amd64
-    fi
-
-    # Add basic paths
-    path4sdk=/usr/bin:/bin:/usr/sbin:/sbin
-
-    # Get the previous JDK to be used to bootstrap the build
-    path4sdk=${bootdir}/bin:${path4sdk}
-
-    # Ant
-    ANT_HOME=${slashjava}/devtools/share/ant/1.7.0
-    export ANT_HOME
-    antbindir=${ANT_HOME}/bin
-    fileMustExist "${antbindir}/ant" ant
-    path4sdk=${antbindir}:${path4sdk}
-    
-    # Find GNU make
-    make=/usr/bin/make
-    fileMustExist "${make}" make
-
-    umask 002
-
-else
-
-    # Windows: Differs on CYGWIN vs. MKS.
-    #   Also, blanks in pathnames gives GNU make headaches, so anything placed
-    #   in any ALT_* variable should be the short windows dosname.
-   
-    # WINDOWS: Install and use MKS or CYGWIN (should have already been done)
-    #   Assumption here is that you are in a shell window via MKS or cygwin.
-    #   MKS install should have defined the environment variable ROOTDIR.
-    #   We also need to figure out which one we have: X86, AMD64
-    if [ "`echo ${PROCESSOR_IDENTIFIER} | fgrep AMD64`" != "" ] ; then
-	windows_arch=amd64
-    else
-	windows_arch=i586
-    fi
-    
-    # We need to determine if we are running a CYGWIN shell or an MKS shell
-    #    (if uname isn't available, then it will be unix_toolset=unknown)
-    unix_toolset=unknown
-    if [ "`uname -a | fgrep Cygwin`" = "" -a -d "${ROOTDIR}" ] ; then
-        # We kind of assume ROOTDIR is where MKS is and it's ok
-        unix_toolset=MKS
-        mkshome=`dosname -s "${ROOTDIR}"`
-	# Utility to convert to short pathnames without spaces
-	dosname="${mkshome}/mksnt/dosname -s"
-        # Most unix utilities are in the mksnt directory of ROOTDIR
-        unixcommand_path="${mkshome}/mksnt"
-        path4sdk="${unixcommand_path}"
-        dirMustExist "${unixcommand_path}" ALT_UNIXCOMMAND_PATH
-	devtools_path="${slashjava}/devtools/win32/bin"
-	path4sdk="${devtools_path};${path4sdk}"
-	# Normally this need not be set, but on Windows it's default is C:/UTILS
-        ALT_DEVTOOLS_PATH="${devtools_path}"
-	export ALT_DEVTOOLS_PATH
-        dirMustExist "${devtools_path}" ALT_DEVTOOLS_PATH
-        # Find GNU make
-        make="${devtools_path}/gnumake.exe"
-        fileMustExist "${make}" make
-    elif [ "`uname -a | fgrep Cygwin`" != "" -a -f /bin/cygpath ] ; then
-        # For CYGWIN, uname will have "Cygwin" in it, and /bin/cygpath should exist
-        unix_toolset=CYGWIN
-	# Utility to convert to short pathnames without spaces
-	dosname="/usr/bin/cygpath -a -m -s"
-        # Most unix utilities are in the /usr/bin
-        unixcommand_path="/usr/bin"
-        path4sdk="${unixcommand_path}"
-        dirMustExist "${unixcommand_path}" ALT_UNIXCOMMAND_PATH
-        # Find GNU make
-        make="${unixcommand_path}/make.exe"
-        fileMustExist "${make}" make
-    else
-      echo "WARNING: Cannot figure out if this is MKS or CYGWIN"
-    fi
-
-    # WINDOWS: Get the previous JDK to be used to bootstrap the build
-    path4sdk="${bootdir}/bin;${path4sdk}"
-
-    # Ant
-    ANT_HOME=${slashjava}/devtools/share/ant/1.7.0
-    export ANT_HOME
-    antbindir=${ANT_HOME}/bin
-    fileMustExist "${antbindir}/ant" ant
-    path4sdk="${antbindir};${path4sdk}"
-
-    # Turn all \\ into /, remove duplicates and trailing /
-    slash_path="`echo ${path4sdk} | sed -e 's@\\\\@/@g' -e 's@//@/@g' -e 's@/$@@' -e 's@/;@;@g'`"
-    
-    # For windows, it's hard to know where the system is, so we just add this
-    #    to PATH.
-    path4sdk="${slash_path};${PATH}"
-    
-    # Convert path4sdk to cygwin style
-    if [ "${unix_toolset}" = CYGWIN ] ; then
-	path4sdk="`/usr/bin/cygpath -p ${path4sdk}`"
-    fi
-
-fi
-
-# Export PATH setting
-PATH="${path4sdk}"
-export PATH
-
-# Things we need to unset
-unset LD_LIBRARY_PATH
-unset LD_LIBRARY_PATH_32
-unset LD_LIBRARY_PATH_64
-unset JAVA_HOME
-
--- a/make/jprt.properties	Thu Mar 12 12:58:59 2009 -0700
+++ b/make/jprt.properties	Fri May 15 12:37:09 2009 -0400
@@ -32,13 +32,13 @@
 solaris_sparcv9_5.10,\
 solaris_i586_5.10,\
 solaris_x64_5.10,\
-linux_i586,\
-linux_x64,\
+linux_i586_2.6,\
+linux_x64_2.6,\
 windows_i586,\
 windows_x64
 
 # The different build flavors we want
-jprt.build.flavors=product
+jprt.build.flavors=product,fastdebug
 
 # Explicitly designate what the 32bit match is for the 64bit build
 jprt.solaris_sparcv9.build.platform.match32=solaris_sparc_5.10
--- a/src/share/classes/com/sun/org/apache/xalan/internal/client/XSLTProcessorApplet.java	Thu Mar 12 12:58:59 2009 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,792 +0,0 @@
-/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
- */
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*
- * $Id: XSLTProcessorApplet.java,v 1.2.4.1 2005/09/15 02:20:05 jeffsuttor Exp $
- */
-package com.sun.org.apache.xalan.internal.client;
-
-import java.applet.Applet;
-import java.awt.Graphics;
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.io.StringReader;
-import java.io.StringWriter;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.Hashtable;
-import java.util.Enumeration;
-
-import javax.xml.transform.Templates;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerConfigurationException;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.stream.StreamResult;
-import javax.xml.transform.stream.StreamSource;
-
-import com.sun.org.apache.xalan.internal.res.XSLMessages;
-import com.sun.org.apache.xalan.internal.res.XSLTErrorResources;
-
-/**
- * Provides applet host for the XSLT processor. To perform transformations on an HTML client:
- * <ol>
- * <li>Use an &lt;applet&gt; tag to embed this applet in the HTML client.</li>
- * <li>Use the DocumentURL and StyleURL PARAM tags or the {@link #setDocumentURL} and
- * {@link #setStyleURL} methods to specify the XML source document and XSL stylesheet.</li>
- * <li>Call the {@link #getHtmlText} method (or one of the transformToHtml() methods)
- * to perform the transformation and return the result as a String.</li>
- * </ol>
- *
- * This class extends Applet which ultimately causes this class to implement Serializable.
- * This is a serious restriction on this class. All fields that are not transient and not
- * static are written-out/read-in during serialization. So even private fields essentially
- * become part of the API. Developers need to take care when modifying fields.
- * @xsl.usage general
- */
-public class XSLTProcessorApplet extends Applet
-{
-
-  /**
-   * The stylesheet processor.
-   * This field is now transient because a
-   * javax.xml.transform.TransformerFactory from JAXP
-   * makes no claims to be serializable.
-   */
-  transient TransformerFactory m_tfactory = null;
-
-  /**
-   * @serial
-   */
-  private String m_styleURL;
-
-  /**
-   * @serial
-   */
-  private String m_documentURL;
-
-  // Parameter names.  To change a name of a parameter, you need only make
-  // a single change.  Simply modify the value of the parameter string below.
-  //--------------------------------------------------------------------------
-
-  /**
-   * @serial
-   */
-  private final String PARAM_styleURL = "styleURL";
-
-  /**
-   * @serial
-   */
-  private final String PARAM_documentURL = "documentURL";
-
-
-  // We'll keep the DOM trees around, so tell which trees
-  // are cached.
-
-  /**
-   * @serial
-   */
-  private String m_styleURLOfCached = null;
-
-  /**
-   * @serial
-   */
-  private String m_documentURLOfCached = null;
-
-  /**
-   * Save this for use on the worker thread; may not be necessary.
-   * @serial
-   */
-  private URL m_codeBase = null;
-
-  /**
-   * @serial
-   */
-  private String m_treeURL = null;
-
-  /**
-   * DocumentBase URL
-   * @serial
-   */
-  private URL m_documentBase = null;
-
-  /**
-   * Thread stuff for the trusted worker thread.
-   */
-  transient private Thread m_callThread = null;
-
-  /**
-   */
-  transient private TrustedAgent m_trustedAgent = null;
-
-  /**
-   * Thread for running TrustedAgent.
-   */
-  transient private Thread m_trustedWorker = null;
-
-  /**
-   * Where the worker thread puts the HTML text.
-   */
-  transient private String m_htmlText = null;
-
-  /**
-   * Where the worker thread puts the document/stylesheet text.
-   */
-  transient private String m_sourceText = null;
-
-  /**
-   * Stylesheet attribute name and value that the caller can set.
-   */
-  transient private String m_nameOfIDAttrOfElemToModify = null;
-
-  /**
-   */
-  transient private String m_elemIdToModify = null;
-
-  /**
-   */
-  transient private String m_attrNameToSet = null;
-
-  /**
-   */
-  transient private String m_attrValueToSet = null;
-
-  /**
-   * The XSLTProcessorApplet constructor takes no arguments.
-   */
-  public XSLTProcessorApplet(){}
-
-  /**
-   * Get basic information about the applet
-   * @return A String with the applet name and author.
-   */
-  public String getAppletInfo()
-  {
-    return "Name: XSLTProcessorApplet\r\n" + "Author: Scott Boag";
-  }
-
-  /**
-   * Get descriptions of the applet parameters.
-   * @return A two-dimensional array of Strings with Name, Type, and Description
-   * for each parameter.
-   */
-  public String[][] getParameterInfo()
-  {
-
-    String[][] info =
-    {
-      { PARAM_styleURL, "String", "URL to an XSL stylesheet" },
-      { PARAM_documentURL, "String", "URL to an XML document" },
-    };
-
-    return info;
-  }
-
-  /**
-   * Standard applet initialization.
-   */
-  public void init()
-  {
-
-    // PARAMETER SUPPORT
-    //          The following code retrieves the value of each parameter
-    // specified with the <PARAM> tag and stores it in a member
-    // variable.
-    //----------------------------------------------------------------------
-    String param;
-
-    // styleURL: Parameter description
-    //----------------------------------------------------------------------
-    param = getParameter(PARAM_styleURL);
-
-    // stylesheet parameters
-    m_parameters = new Hashtable();
-
-    if (param != null)
-      setStyleURL(param);
-
-    // documentURL: Parameter description
-    //----------------------------------------------------------------------
-    param = getParameter(PARAM_documentURL);
-
-    if (param != null)
-      setDocumentURL(param);
-
-    m_codeBase = this.getCodeBase();
-    m_documentBase = this.getDocumentBase();
-
-    // If you use a ResourceWizard-generated "control creator" class to
-    // arrange controls in your applet, you may want to call its
-    // CreateControls() method from within this method. Remove the following
-    // call to resize() before adding the call to CreateControls();
-    // CreateControls() does its own resizing.
-    //----------------------------------------------------------------------
-    resize(320, 240);
-  }
-
-    /**
-   *  Automatically called when the HTML client containing the applet loads.
-   *  This method starts execution of the applet thread.
-   */
-  public void start()
-  {
-      //check if user code's on the stack before invoking the worker thread
-     boolean passed = false;
-     try {
-       java.security.AccessController.checkPermission(new java.security.AllPermission());
-     } catch (SecurityException se) {
-         //expected
-         passed = true;
-     }
-     if (!passed) {
-         throw new SecurityException("The XSLTProcessorApplet class must be extended and its method start() overridden.");
-     }
-
-    m_trustedAgent = new TrustedAgent();
-    Thread currentThread = Thread.currentThread();
-    m_trustedWorker = new Thread(currentThread.getThreadGroup(),
-                                 m_trustedAgent);
-    m_trustedWorker.start();
-    try
-    {
-      m_tfactory = TransformerFactory.newInstance();
-      this.showStatus("Causing Transformer and Parser to Load and JIT...");
-
-      // Prime the pump so that subsequent transforms are faster.
-      StringReader xmlbuf = new StringReader("<?xml version='1.0'?><foo/>");
-      StringReader xslbuf = new StringReader(
-        "<?xml version='1.0'?><xsl:stylesheet xmlns:xsl='http://www.w3.org/1999/XSL/Transform' version='1.0'><xsl:template match='foo'><out/></xsl:template></xsl:stylesheet>");
-      PrintWriter pw = new PrintWriter(new StringWriter());
-
-      synchronized (m_tfactory)
-      {
-        Templates templates = m_tfactory.newTemplates(new StreamSource(xslbuf));
-        Transformer transformer = templates.newTransformer();
-        transformer.transform(new StreamSource(xmlbuf), new StreamResult(pw));
-      }
-      System.out.println("Primed the pump!");
-      this.showStatus("Ready to go!");
-    }
-    catch (Exception e)
-    {
-      this.showStatus("Could not prime the pump!");
-      System.out.println("Could not prime the pump!");
-      e.printStackTrace();
-    }
-  }
-
-  /**
-   * Do not call; this applet contains no UI or visual components.
-   *
-   */
-  public void paint(Graphics g){}
-
-  /**
-   * Automatically called when the HTML page containing the applet is no longer
-   * on the screen. Stops execution of the applet thread.
-   */
-  public void stop()
-  {
-    if (null != m_trustedWorker)
-    {
-      m_trustedWorker.stop();
-
-      // m_trustedWorker.destroy();
-      m_trustedWorker = null;
-    }
-
-    m_styleURLOfCached = null;
-    m_documentURLOfCached = null;
-  }
-
-  /**
-   * Cleanup; called when applet is terminated and unloaded.
-   */
-  public void destroy()
-  {
-    if (null != m_trustedWorker)
-    {
-      m_trustedWorker.stop();
-
-      // m_trustedWorker.destroy();
-      m_trustedWorker = null;
-    }
-    m_styleURLOfCached = null;
-    m_documentURLOfCached = null;
-  }
-
-  /**
-   * Set the URL to the XSL stylesheet that will be used
-   * to transform the input XML.  No processing is done yet.
-   * @param urlString valid URL string for XSL stylesheet.
-   */
-  public void setStyleURL(String urlString)
-  {
-    m_styleURL = urlString;
-  }
-
-  /**
-   * Set the URL to the XML document that will be transformed
-   * with the XSL stylesheet.  No processing is done yet.
-   * @param urlString valid URL string for XML document.
-   */
-  public void setDocumentURL(String urlString)
-  {
-    m_documentURL = urlString;
-  }
-
-  /**
-   * The processor keeps a cache of the source and
-   * style trees, so call this method if they have changed
-   * or you want to do garbage collection.
-   */
-  public void freeCache()
-  {
-    m_styleURLOfCached = null;
-    m_documentURLOfCached = null;
-  }
-
-  /**
-   * Set an attribute in the stylesheet, which gives the ability
-   * to have some dynamic selection control.
-   * @param nameOfIDAttrOfElemToModify The name of an attribute to search for a unique id.
-   * @param elemId The unique ID to look for.
-   * @param attrName Once the element is found, the name of the attribute to set.
-   * @param value The value to set the attribute to.
-   */
-  public void setStyleSheetAttribute(String nameOfIDAttrOfElemToModify,
-                                     String elemId, String attrName,
-                                     String value)
-  {
-    m_nameOfIDAttrOfElemToModify = nameOfIDAttrOfElemToModify;
-    m_elemIdToModify = elemId;
-    m_attrNameToSet = attrName;
-    m_attrValueToSet = value;
-  }
-
-
-  /**
-   * Stylesheet parameter key/value pair stored in a hashtable
-   */
-  transient Hashtable m_parameters;
-
-  /**
-   * Submit a stylesheet parameter.
-   *
-   * @param key stylesheet parameter key
-   * @param expr the parameter expression to be submitted.
-   * @see javax.xml.transform.Transformer#setParameter(String,Object)
-   */
-  public void setStylesheetParam(String key, String expr)
-  {
-    m_parameters.put(key, expr);
-  }
-
-  /**
-   * Given a String containing markup, escape the markup so it
-   * can be displayed in the browser.
-   *
-   * @param s String to escape
-   *
-   * The escaped string.
-   */
-  public String escapeString(String s)
-  {
-    StringBuffer sb = new StringBuffer();
-    int length = s.length();
-
-    for (int i = 0; i < length; i++)
-    {
-      char ch = s.charAt(i);
-
-      if ('<' == ch)
-      {
-        sb.append("&lt;");
-      }
-      else if ('>' == ch)
-      {
-        sb.append("&gt;");
-      }
-      else if ('&' == ch)
-      {
-        sb.append("&amp;");
-      }
-      else if (0xd800 <= ch && ch < 0xdc00)
-      {
-        // UTF-16 surrogate
-        int next;
-
-        if (i + 1 >= length)
-        {
-          throw new RuntimeException(
-            XSLMessages.createMessage(
-              XSLTErrorResources.ER_INVALID_UTF16_SURROGATE,
-              new Object[]{ Integer.toHexString(ch) }));  //"Invalid UTF-16 surrogate detected: "
-
-          //+Integer.toHexString(ch)+ " ?");
-        }
-        else
-        {
-          next = s.charAt(++i);
-
-          if (!(0xdc00 <= next && next < 0xe000))
-            throw new RuntimeException(
-              XSLMessages.createMessage(
-                XSLTErrorResources.ER_INVALID_UTF16_SURROGATE,
-                new Object[]{
-                  Integer.toHexString(ch) + " "
-                  + Integer.toHexString(next) }));  //"Invalid UTF-16 surrogate detected: "
-
-          //+Integer.toHexString(ch)+" "+Integer.toHexString(next));
-          next = ((ch - 0xd800) << 10) + next - 0xdc00 + 0x00010000;
-        }
-        sb.append("&#x");
-        sb.append(Integer.toHexString(next));
-        sb.append(";");
-      }
-      else
-      {
-        sb.append(ch);
-      }
-    }
-    return sb.toString();
-  }
-
-  /**
-   * Assuming the stylesheet URL and the input XML URL have been set,
-   * perform the transformation and return the result as a String.
-   *
-   * @return A string that contains the contents pointed to by the URL.
-   *
-   */
-  public String getHtmlText()
-  {
-    m_trustedAgent.m_getData = true;
-    m_callThread = Thread.currentThread();
-    try
-    {
-      synchronized (m_callThread)
-      {
-        m_callThread.wait();
-      }
-    }
-    catch (InterruptedException ie)
-    {
-      System.out.println(ie.getMessage());
-    }
-    return m_htmlText;
-  }
-
-  /**
-   * Get an XML document (or stylesheet)
-   *
-   * @param treeURL valid URL string for the document.
-   *
-   * @return document
-   *
-   * @throws IOException
-   */
-  public String getTreeAsText(String treeURL) throws IOException
-  {
-    m_treeURL = treeURL;
-    m_trustedAgent.m_getData = true;
-    m_trustedAgent.m_getSource = true;
-    m_callThread = Thread.currentThread();
-    try
-    {
-      synchronized (m_callThread)
-      {
-        m_callThread.wait();
-      }
-    }
-    catch (InterruptedException ie)
-    {
-      System.out.println(ie.getMessage());
-    }
-    return m_sourceText;
-  }
-
-  /**
-   * Use a Transformer to copy the source document
-   * to a StreamResult.
-   *
-   * @return the document as a string
-   */
-  private String getSource() throws TransformerException
-  {
-    StringWriter osw = new StringWriter();
-    PrintWriter pw = new PrintWriter(osw, false);
-    String text = "";
-    try
-    {
-      URL docURL = new URL(m_documentBase, m_treeURL);
-      synchronized (m_tfactory)
-      {
-        Transformer transformer = m_tfactory.newTransformer();
-        StreamSource source = new StreamSource(docURL.toString());
-        StreamResult result = new StreamResult(pw);
-        transformer.transform(source, result);
-        text = osw.toString();
-      }
-    }
-    catch (MalformedURLException e)
-    {
-      e.printStackTrace();
-      throw new RuntimeException(e.getMessage());
-    }
-    catch (Exception any_error)
-    {
-      any_error.printStackTrace();
-    }
-    return text;
-  }
-
-  /**
-   * Get the XML source Tree as a text string suitable
-   * for display in a browser.  Note that this is for display of the
-   * XML itself, not for rendering of HTML by the browser.
-   *
-   * @return XML source document as a string.
-   * @throws Exception thrown if tree can not be converted.
-   */
-  public String getSourceTreeAsText() throws Exception
-  {
-    return getTreeAsText(m_documentURL);
-  }
-
-  /**
-   * Get the XSL style Tree as a text string suitable
-   * for display in a browser.  Note that this is for display of the
-   * XML itself, not for rendering of HTML by the browser.
-   *
-   * @return The XSL stylesheet as a string.
-   * @throws Exception thrown if tree can not be converted.
-   */
-  public String getStyleTreeAsText() throws Exception
-  {
-    return getTreeAsText(m_styleURL);
-  }
-
-  /**
-   * Get the HTML result Tree as a text string suitable
-   * for display in a browser.  Note that this is for display of the
-   * XML itself, not for rendering of HTML by the browser.
-   *
-   * @return Transformation result as unmarked text.
-   * @throws Exception thrown if tree can not be converted.
-   */
-  public String getResultTreeAsText() throws Exception
-  {
-    return escapeString(getHtmlText());
-  }
-
-  /**
-   * Process a document and a stylesheet and return
-   * the transformation result.  If one of these is null, the
-   * existing value (of a previous transformation) is not affected.
-   *
-   * @param doc URL string to XML document
-   * @param style URL string to XSL stylesheet
-   *
-   * @return HTML transformation result
-   */
-  public String transformToHtml(String doc, String style)
-  {
-
-    if (null != doc)
-    {
-      m_documentURL = doc;
-    }
-
-    if (null != style)
-    {
-      m_styleURL = style;
-    }
-
-    return getHtmlText();
-  }
-
-  /**
-   * Process a document and a stylesheet and return
-   * the transformation result. Use the xsl:stylesheet PI to find the
-   * document, if one exists.
-   *
-   * @param doc  URL string to XML document containing an xsl:stylesheet PI.
-   *
-   * @return HTML transformation result
-   */
-  public String transformToHtml(String doc)
-  {
-
-    if (null != doc)
-    {
-      m_documentURL = doc;
-    }
-
-    m_styleURL = null;
-
-    return getHtmlText();
-  }
-
-
-  /**
-   * Process the transformation.
-   *
-   * @return The transformation result as a string.
-   *
-   * @throws TransformerException
-   */
-  private String processTransformation() throws TransformerException
-  {
-    String htmlData = null;
-    this.showStatus("Waiting for Transformer and Parser to finish loading and JITing...");
-
-    synchronized (m_tfactory)
-    {
-     URL documentURL = null;
-      URL styleURL = null;
-      StringWriter osw = new StringWriter();
-      PrintWriter pw = new PrintWriter(osw, false);
-      StreamResult result = new StreamResult(pw);
-
-      this.showStatus("Begin Transformation...");
-      try
-      {
-        documentURL = new URL(m_codeBase, m_documentURL);
-        StreamSource xmlSource = new StreamSource(documentURL.toString());
-
-        styleURL = new URL(m_codeBase, m_styleURL);
-        StreamSource xslSource = new StreamSource(styleURL.toString());
-
-        Transformer transformer = m_tfactory.newTransformer(xslSource);
-
-
-        Enumeration m_keys = m_parameters.keys();
-        while (m_keys.hasMoreElements()){
-          Object key = m_keys.nextElement();
-          Object expression = m_parameters.get(key);
-          transformer.setParameter((String) key, expression);
-        }
-        transformer.transform(xmlSource, result);
-      }
-      catch (TransformerConfigurationException tfe)
-      {
-        tfe.printStackTrace();
-        throw new RuntimeException(tfe.getMessage());
-      }
-      catch (MalformedURLException e)
-      {
-        e.printStackTrace();
-        throw new RuntimeException(e.getMessage());
-      }
-
-      this.showStatus("Transformation Done!");
-      htmlData = osw.toString();
-    }
-    return htmlData;
-  }
-
-  /**
-   * This class maintains a worker thread that that is
-   * trusted and can do things like access data.  You need
-   * this because the thread that is called by the browser
-   * is not trusted and can't access data from the URLs.
-   */
-  class TrustedAgent implements Runnable
-  {
-
-    /**
-     * Specifies whether the worker thread should perform a transformation.
-     */
-    public boolean m_getData = false;
-
-    /**
-     * Specifies whether the worker thread should get an XML document or XSL stylesheet.
-     */
-    public boolean m_getSource = false;
-
-    /**
-     * The real work is done from here.
-     *
-     */
-    public void run()
-    {
-      while (true)
-      {
-        m_trustedWorker.yield();
-
-        if (m_getData)  // Perform a transformation or get a document.
-        {
-          try
-          {
-            m_getData = false;
-            m_htmlText = null;
-            m_sourceText = null;
-            if (m_getSource)  // Get a document.
-            {
-              m_getSource = false;
-              m_sourceText = getSource();
-            }
-            else              // Perform a transformation.
-              m_htmlText = processTransformation();
-          }
-          catch (Exception e)
-          {
-            e.printStackTrace();
-          }
-          finally
-          {
-            synchronized (m_callThread)
-            {
-              m_callThread.notify();
-            }
-          }
-        }
-        else
-        {
-          try
-          {
-            m_trustedWorker.sleep(50);
-          }
-          catch (InterruptedException ie)
-          {
-            ie.printStackTrace();
-          }
-        }
-      }
-    }
-  }
-
-  // For compatiblity with old serialized objects
-  // We will change non-serialized fields and change methods
-  // and not have this break us.
-  private static final long serialVersionUID=4618876841979251422L;
-
-  // For compatibility when de-serializing old objects
-  private void readObject(java.io.ObjectInputStream inStream) throws IOException, ClassNotFoundException
-  {
-      inStream.defaultReadObject();
-
-      // Needed assignment of non-serialized fields
-
-      // A TransformerFactory is not guaranteed to be serializable,
-      // so we create one here
-      m_tfactory = TransformerFactory.newInstance();
-  }
-}
--- a/src/share/classes/com/sun/org/apache/xalan/internal/client/package.html	Thu Mar 12 12:58:59 2009 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,28 +0,0 @@
-<!--
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
--->
-<!--
- * Copyright 2000-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
--->
-<!-- $Id: package.html,v 1.1.2.1 2005/08/01 02:11:22 jeffsuttor Exp $ -->
-<html>
-  <title>Xalan Client Package.</title>
-  <body>
-    <p>Implementation of Xalan applet.<p>
- </body>
-</html>
-
-
--- a/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/Import.java	Thu Mar 12 12:58:59 2009 -0700
+++ b/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/Import.java	Fri May 15 12:37:09 2009 -0400
@@ -18,7 +18,7 @@
  * limitations under the License.
  */
 /*
- * $Id: Import.java,v 1.2.4.1 2005/09/12 10:32:33 pvedula Exp $
+ * $Id: Import.java,v 1.8 2007/04/09 21:30:40 joehw Exp $
  */
 
 package com.sun.org.apache.xalan.internal.xsltc.compiler;
--- a/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/Include.java	Thu Mar 12 12:58:59 2009 -0700
+++ b/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/Include.java	Fri May 15 12:37:09 2009 -0400
@@ -18,7 +18,7 @@
  * limitations under the License.
  */
 /*
- * $Id: Include.java,v 1.2.4.1 2005/09/01 15:44:18 pvedula Exp $
+ * $Id: Include.java,v 1.8 2007/04/09 21:30:41 joehw Exp $
  */
 
 package com.sun.org.apache.xalan.internal.xsltc.compiler;
--- a/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/util/Type.java	Thu Mar 12 12:58:59 2009 -0700
+++ b/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/util/Type.java	Fri May 15 12:37:09 2009 -0400
@@ -18,7 +18,7 @@
  * limitations under the License.
  */
 /*
- * $Id: Type.java,v 1.2.4.2 2005/09/15 18:34:13 jeffsuttor Exp $
+ * $Id: Type.java,v 1.8 2007/03/28 16:51:19 joehw Exp $
  */
 
 package com.sun.org.apache.xalan.internal.xsltc.compiler.util;
--- a/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/SAX2DOM.java	Thu Mar 12 12:58:59 2009 -0700
+++ b/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/SAX2DOM.java	Fri May 15 12:37:09 2009 -0400
@@ -18,7 +18,7 @@
  * limitations under the License.
  */
 /*
- * $Id: SAX2DOM.java,v 1.7 2006/01/26 07:01:40 jeffsuttor Exp $
+ * $Id: SAX2DOM.java,v 1.8.2.1 2006/12/04 18:45:41 spericas Exp $
  */
 
 
@@ -68,7 +68,7 @@
     static final DocumentBuilderFactory _factory =
             DocumentBuilderFactory.newInstance();
 
-    public SAX2DOM() throws ParserConfigurationException {
+   public SAX2DOM() throws ParserConfigurationException {
         synchronized (SAX2DOM.class) {
           _document = _factory.newDocumentBuilder().newDocument();
         }
--- a/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/TemplatesImpl.java	Thu Mar 12 12:58:59 2009 -0700
+++ b/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/TemplatesImpl.java	Fri May 15 12:37:09 2009 -0400
@@ -18,7 +18,7 @@
  * limitations under the License.
  */
 /*
- * $Id: TemplatesImpl.java,v 1.2.4.1 2005/09/06 12:19:26 pvedula Exp $
+ * $Id: TemplatesImpl.java,v 1.8 2007/03/26 20:12:27 spericas Exp $
  */
 
 package com.sun.org.apache.xalan.internal.xsltc.trax;
--- a/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerFactoryImpl.java	Thu Mar 12 12:58:59 2009 -0700
+++ b/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerFactoryImpl.java	Fri May 15 12:37:09 2009 -0400
@@ -18,7 +18,7 @@
  * limitations under the License.
  */
 /*
- * $Id: TransformerFactoryImpl.java,v 1.2.4.1 2005/09/15 06:15:38 pvedula Exp $
+ * $Id: TransformerFactoryImpl.java,v 1.8 2007/04/09 21:30:41 joehw Exp $
  */
 
 package com.sun.org.apache.xalan.internal.xsltc.trax;
--- a/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerImpl.java	Thu Mar 12 12:58:59 2009 -0700
+++ b/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerImpl.java	Fri May 15 12:37:09 2009 -0400
@@ -18,7 +18,7 @@
  * limitations under the License.
  */
 /*
- * $Id: TransformerImpl.java,v 1.5 2005/09/28 13:48:46 pvedula Exp $
+ * $Id: TransformerImpl.java,v 1.10 2007/06/13 01:57:09 joehw Exp $
  */
 
 package com.sun.org.apache.xalan.internal.xsltc.trax;
--- a/src/share/classes/com/sun/org/apache/xerces/internal/dom/EntityImpl.java	Thu Mar 12 12:58:59 2009 -0700
+++ b/src/share/classes/com/sun/org/apache/xerces/internal/dom/EntityImpl.java	Fri May 15 12:37:09 2009 -0400
@@ -148,7 +148,6 @@
      * @exception DOMException
      *   <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
      */
-
     public void setPrefix(String prefix)
         throws DOMException
     {
--- a/src/share/classes/com/sun/org/apache/xerces/internal/impl/PropertyManager.java	Thu Mar 12 12:58:59 2009 -0700
+++ b/src/share/classes/com/sun/org/apache/xerces/internal/impl/PropertyManager.java	Fri May 15 12:37:09 2009 -0400
@@ -45,8 +45,8 @@
 public class PropertyManager {
 
 
-    protected static final String STAX_NOTATIONS = "javax.xml.stream.notations";
-    protected static final String STAX_ENTITIES = "javax.xml.stream.entities";
+    public static final String STAX_NOTATIONS = "javax.xml.stream.notations";
+    public static final String STAX_ENTITIES = "javax.xml.stream.entities";
 
     private static final String STRING_INTERNING = "http://xml.org/sax/features/string-interning";
 
--- a/src/share/classes/com/sun/org/apache/xerces/internal/impl/XMLDocumentFragmentScannerImpl.java	Thu Mar 12 12:58:59 2009 -0700
+++ b/src/share/classes/com/sun/org/apache/xerces/internal/impl/XMLDocumentFragmentScannerImpl.java	Fri May 15 12:37:09 2009 -0400
@@ -289,6 +289,8 @@
     protected boolean fReportCdataEvent = false ;
     protected boolean fIsCoalesce = false ;
     protected String fDeclaredEncoding =  null;
+    /** Disallow doctype declaration. */
+    protected boolean fDisallowDoctype = false;
 
     // drivers
 
@@ -1852,6 +1854,11 @@
         }
         // start general entity
         if (!fEntityStore.isDeclaredEntity(name)) {
+            //SUPPORT_DTD=false && ReplaceEntityReferences should throw exception
+            if (fDisallowDoctype && fReplaceEntityReferences) {
+                reportFatalError("EntityNotDeclared", new Object[]{name});
+                return;
+            }
             //REVISIT: one more case needs to be included: external PE and standalone is no
             if ( fHasExternalDTD && !fStandalone) {
                 if (fValidation)
--- a/src/share/classes/com/sun/org/apache/xerces/internal/impl/XMLDocumentScannerImpl.java	Thu Mar 12 12:58:59 2009 -0700
+++ b/src/share/classes/com/sun/org/apache/xerces/internal/impl/XMLDocumentScannerImpl.java	Fri May 15 12:37:09 2009 -0400
@@ -62,6 +62,10 @@
  * @author Arnaud  Le Hors, IBM
  * @author Eric Ye, IBM
  * @author Sunitha Reddy, Sun Microsystems
+ *
+ * Refer to the table in unit-test javax.xml.stream.XMLStreamReaderTest.SupportDTD for changes
+ * related to property SupportDTD.
+ * @author Joe Wang, Sun Microsystems
  */
 public class XMLDocumentScannerImpl
         extends XMLDocumentFragmentScannerImpl{
@@ -185,9 +189,6 @@
     /** Load external DTD. */
     protected boolean fLoadExternalDTD = true;
 
-    /** Disallow doctype declaration. */
-    protected boolean fDisallowDoctype = false;
-
     // state
 
     /** Seen doctype declaration. */
@@ -227,8 +228,8 @@
     /** String. */
     private XMLString fString = new XMLString();
 
-    public static final char [] DOCTYPE = {'D','O','C','T','Y','P','E'};
-    public static final char [] COMMENTSTRING = {'-','-'};
+    private static final char [] DOCTYPE = {'D','O','C','T','Y','P','E'};
+    private static final char [] COMMENTSTRING = {'-','-'};
 
     //
     // Constructors
@@ -708,6 +709,12 @@
     //
     // Private methods
     //
+    /** Set the scanner state after scanning DTD */
+    protected void setEndDTDScanState() {
+        setScannerState(SCANNER_STATE_PROLOG);
+        setDriver(fPrologDriver);
+        fEntityManager.setEntityHandler(XMLDocumentScannerImpl.this);
+    }
 
     /** Returns the scanner state name. */
     protected String getScannerStateName(int state) {
@@ -930,19 +937,20 @@
                             reportFatalError("AlreadySeenDoctype", null);
                         }
                         fSeenDoctypeDecl = true;
-                        if(fDTDDriver == null){
-                            fDTDDriver = new DTDDriver();
-                        }
-
                         // scanDoctypeDecl() sends XNI doctypeDecl event that
                         // in SAX is converted to startDTD() event.
                         if (scanDoctypeDecl(fDisallowDoctype)) {
+                            //allow parsing of entity decls to continue in order to stay well-formed
                             setScannerState(SCANNER_STATE_DTD_INTERNAL_DECLS);
                             fSeenInternalSubset = true;
+                            if(fDTDDriver == null){
+                                fDTDDriver = new DTDDriver();
+                            }
                             setDriver(fContentDriver);
-                            int dtdEvent = fDTDDriver.next();
+                            //always return DTD event, the event however, will not contain any entities
+                            return fDTDDriver.next();
                             // If no DTD support, ignore and continue parsing
-                            return fDisallowDoctype ? next() : dtdEvent;
+                            //return fDisallowDoctype ? next() : dtdEvent;
                         }
 
                         /** xxx:check this part again
@@ -955,17 +963,17 @@
                         }
                          */
 
-                        if (fDisallowDoctype) {
-                            setScannerState(SCANNER_STATE_PROLOG);
-                            return next();
-                        }
-
                         // handle external subset
                         if (fDoctypeSystemId != null) {
                             if (((fValidation || fLoadExternalDTD)
                                 && (fValidationManager == null || !fValidationManager.isCachedDTD()))) {
-                                setScannerState(SCANNER_STATE_DTD_EXTERNAL);
+                                if (!fDisallowDoctype)
+                                    setScannerState(SCANNER_STATE_DTD_EXTERNAL);
+                                else
+                                    setScannerState(SCANNER_STATE_PROLOG);
                                 setDriver(fContentDriver);
+                                if(fDTDDriver == null)
+                                    fDTDDriver = new DTDDriver();
                                 return fDTDDriver.next();
 
                             }
@@ -976,8 +984,13 @@
                                 // This handles the case of a DOCTYPE that had neither an internal subset or an external subset.
                                 fDTDScanner.setInputSource(fExternalSubsetSource);
                                 fExternalSubsetSource = null;
-                                setScannerState(SCANNER_STATE_DTD_EXTERNAL_DECLS);
+                                if (!fDisallowDoctype)
+                                    setScannerState(SCANNER_STATE_DTD_EXTERNAL_DECLS);
+                                else
+                                    setScannerState(SCANNER_STATE_PROLOG);
                                 setDriver(fContentDriver);
+                                if(fDTDDriver == null)
+                                    fDTDDriver = new DTDDriver();
                                 return fDTDDriver.next();
                             }
                         }
@@ -1117,19 +1130,21 @@
                                 }
                                 fMarkupDepth--;
 
-                                // scan external subset next
-                                if (!XMLDocumentScannerImpl.this.fDisallowDoctype &&
-                                        fDoctypeSystemId != null && (fValidation || fLoadExternalDTD)) {
-                                    setScannerState(SCANNER_STATE_DTD_EXTERNAL);
+                                if (fDisallowDoctype) {
+                                    //simply reset the entity store without having to mess around
+                                    //with the DTD Scanner code
+                                    fEntityStore = fEntityManager.getEntityStore();
+                                    fEntityStore.reset();
+                                } else {
+                                    // scan external subset next unless we are ignoring DTDs
+                                    if (fDoctypeSystemId != null && (fValidation || fLoadExternalDTD)) {
+                                        setScannerState(SCANNER_STATE_DTD_EXTERNAL);
+                                        break;
+                                    }
                                 }
 
-                                // break out of here
-                                else {
-                                    setScannerState(SCANNER_STATE_PROLOG);
-                                    setDriver(fPrologDriver);
-                                    fEntityManager.setEntityHandler(XMLDocumentScannerImpl.this);
-                                    return true;
-                                }
+                                setEndDTDScanState();
+                                return true;
                             }
                             break;
                         }
@@ -1160,13 +1175,16 @@
                             boolean completeDTD = true;
                             boolean moreToScan = fDTDScanner.scanDTDExternalSubset(completeDTD);
                             if (!moreToScan) {
-                                setScannerState(SCANNER_STATE_PROLOG);
-                                setDriver(fPrologDriver);
-                                fEntityManager.setEntityHandler(XMLDocumentScannerImpl.this);
+                                setEndDTDScanState();
                                 return true;
                             }
                             break;
                         }
+                        case SCANNER_STATE_PROLOG : {
+                            // skip entity decls
+                            setEndDTDScanState();
+                            return true;
+                        }
                         default: {
                             throw new XNIException("DTDDriver#dispatch: scanner state="+fScannerState+" ("+getScannerStateName(fScannerState)+')');
                         }
--- a/src/share/classes/com/sun/org/apache/xerces/internal/impl/XMLStreamFilterImpl.java	Thu Mar 12 12:58:59 2009 -0700
+++ b/src/share/classes/com/sun/org/apache/xerces/internal/impl/XMLStreamFilterImpl.java	Fri May 15 12:37:09 2009 -0400
@@ -56,7 +56,6 @@
      * hasNext() to advance the underlining stream in order to find the next acceptable event
      */
     private boolean fStreamAdvancedByHasNext = false;
-
     /** Creates a new instance of XMLStreamFilterImpl */
 
     public XMLStreamFilterImpl(XMLStreamReader reader,StreamFilter filter){
@@ -436,7 +435,6 @@
      */
     public String getVersion() {
         return fStreamReader.getVersion();
-
     }
 
     /**
@@ -532,5 +530,4 @@
     public String getAttributeLocalName(int index){
         return fStreamReader.getAttributeLocalName(index);
     }
-
 }
--- a/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages.properties	Thu Mar 12 12:58:59 2009 -0700
+++ b/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages.properties	Fri May 15 12:37:09 2009 -0400
@@ -34,4 +34,3 @@
 # Messages from erroneous set-up
 IncompatibleNamespaceContext = The type of the NamespaceContext is incompatible with using XInclude; it must be an instance of XIncludeNamespaceSupport
 ExpandedSystemId = Could not expand system id of included resource
-null
--- a/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSAttributeChecker.java	Thu Mar 12 12:58:59 2009 -0700
+++ b/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSAttributeChecker.java	Fri May 15 12:37:09 2009 -0400
@@ -1214,19 +1214,29 @@
             int max = ((XInt)attrValues[ATTIDX_MAXOCCURS]).intValue();
             if (max != SchemaSymbols.OCCURRENCE_UNBOUNDED) {
 
+                // maxOccurLimit is only check in secure mode
+                if (fSchemaHandler.fSecureProcessing != null) {
+                    String localName = element.getLocalName();
+
                 // The maxOccurs restriction no longer applies to elements
-                // and wildcards. These are now validated using a constant
-                // space algorithm. The restriction still applies to model
-                // groups such as xs:sequence.
+                    // and wildcards in a sequence in which they are the only
+                    // particle. These are now validated using a constant
+                    // space algorithm. The restriction still applies to all
+                    // other cases.
 
-                String localName = element.getLocalName();
-                if (fSchemaHandler.fSecureProcessing != null &&
-                        !localName.equals("element") && !localName.equals("any")) {
+                    // Determine if constant-space algorithm can be applied
+                    final boolean optimize =
+                            (localName.equals("element") || localName.equals("any")) &&
+                            (element.getNextSibling() == null) &&
+                            (element.getPreviousSibling() == null) &&
+                            (element.getParentNode().getLocalName().equals("sequence"));
+
+                    if (!optimize) {
                     //Revisit :: IMO this is not right place to check
                     // maxOccurNodeLimit.
                     int maxOccurNodeLimit = fSchemaHandler.fSecureProcessing.getMaxOccurNodeLimit();
                     if (max > maxOccurNodeLimit) {
-                        reportSchemaError("maxOccurLimit", new Object[] {new Integer(maxOccurNodeLimit)}, element);
+                        reportSchemaFatalError("maxOccurLimit", new Object[] {new Integer(maxOccurNodeLimit)}, element);
 
                         // reset max values in case processing continues on error
                         attrValues[ATTIDX_MAXOCCURS] = fXIntPool.getXInt(maxOccurNodeLimit);
@@ -1234,6 +1244,7 @@
                         max = maxOccurNodeLimit;
                     }
                 }
+                }
 
                 if (min > max) {
                     reportSchemaError ("p-props-correct.2.1",
@@ -1607,6 +1618,10 @@
         return retValue;
     }
 
+    void reportSchemaFatalError (String key, Object[] args, Element ele) {
+        fSchemaHandler.reportSchemaFatalError(key, args, ele);
+    }
+
     void reportSchemaError (String key, Object[] args, Element ele) {
         fSchemaHandler.reportSchemaError(key, args, ele);
     }
--- a/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDHandler.java	Thu Mar 12 12:58:59 2009 -0700
+++ b/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDHandler.java	Fri May 15 12:37:09 2009 -0400
@@ -2523,25 +2523,26 @@
         return false;
     }
 
+    void reportSchemaFatalError(String key, Object[] args, Element ele) {
+        reportSchemaErr(key, args, ele, XMLErrorReporter.SEVERITY_FATAL_ERROR);
+    }
+
     void reportSchemaError(String key, Object[] args, Element ele) {
+        reportSchemaErr(key, args, ele, XMLErrorReporter.SEVERITY_ERROR);
+    }
+
+    void reportSchemaWarning(String key, Object[] args, Element ele) {
+        reportSchemaErr(key, args, ele, XMLErrorReporter.SEVERITY_WARNING);
+    }
+
+    void reportSchemaErr(String key, Object[] args, Element ele, short type) {
         if (element2Locator(ele, xl)) {
             fErrorReporter.reportError(xl, XSMessageFormatter.SCHEMA_DOMAIN,
-                    key, args, XMLErrorReporter.SEVERITY_ERROR);
+                    key, args, type);
         }
         else {
             fErrorReporter.reportError(XSMessageFormatter.SCHEMA_DOMAIN,
-                    key, args, XMLErrorReporter.SEVERITY_ERROR);
-        }
-    }
-
-    void reportSchemaWarning(String key, Object[] args, Element ele) {
-        if (element2Locator(ele, xl)) {
-            fErrorReporter.reportError(xl, XSMessageFormatter.SCHEMA_DOMAIN,
-                    key, args, XMLErrorReporter.SEVERITY_WARNING);
-        }
-        else {
-            fErrorReporter.reportError(XSMessageFormatter.SCHEMA_DOMAIN,
-                    key, args, XMLErrorReporter.SEVERITY_WARNING);
+                    key, args, type);
         }
     }
 
--- a/src/share/classes/com/sun/org/apache/xerces/internal/jaxp/validation/XMLSchemaFactory.java	Thu Mar 12 12:58:59 2009 -0700
+++ b/src/share/classes/com/sun/org/apache/xerces/internal/jaxp/validation/XMLSchemaFactory.java	Fri May 15 12:37:09 2009 -0400
@@ -111,6 +111,10 @@
         fXMLSchemaLoader.setProperty(XMLGRAMMAR_POOL, fXMLGrammarPoolWrapper);
         fXMLSchemaLoader.setEntityResolver(fDOMEntityResolverWrapper);
         fXMLSchemaLoader.setErrorHandler(fErrorHandlerWrapper);
+
+        // Enable secure processing feature by default
+        fSecurityManager = new SecurityManager();
+        fXMLSchemaLoader.setProperty(SECURITY_MANAGER, fSecurityManager);
     }
 
     /**
--- a/src/share/classes/com/sun/org/apache/xerces/internal/xinclude/XIncludeHandler.java	Thu Mar 12 12:58:59 2009 -0700
+++ b/src/share/classes/com/sun/org/apache/xerces/internal/xinclude/XIncludeHandler.java	Fri May 15 12:37:09 2009 -0400
@@ -943,8 +943,7 @@
                 setState(STATE_IGNORE);
             }
             else {
-                reportFatalError("NoFallback",
-                    new Object[] { attributes.getValue(null, "href") });
+                reportFatalError("NoFallback");
             }
         }
         else if (isFallbackElement(element)) {
@@ -1002,8 +1001,7 @@
             // we check to see if the children of this include element contained a fallback
             if (getState() == STATE_EXPECT_FALLBACK
                 && !getSawFallback(fDepth + 1)) {
-                reportFatalError("NoFallback",
-                    new Object[] { "unknown" });
+                reportFatalError("NoFallback");
             }
         }
         if (isFallbackElement(element)) {
--- a/src/share/classes/com/sun/org/apache/xml/internal/utils/ThreadControllerWrapper.java	Thu Mar 12 12:58:59 2009 -0700
+++ b/src/share/classes/com/sun/org/apache/xml/internal/utils/ThreadControllerWrapper.java	Fri May 15 12:37:09 2009 -0400
@@ -53,7 +53,35 @@
   {
 
     /**
-     * Will get a thread from the pool, execute the task
+      * This class was introduced as a fix for CR 6607339.
+      */
+     final class SafeThread extends Thread {
+          private volatile boolean ran = false;
+
+          public SafeThread(Runnable target) {
+              super(target);
+          }
+
+          public final void run() {
+              if (Thread.currentThread() != this) {
+                  throw new IllegalStateException("The run() method in a"
+                      + " SafeThread cannot be called from another thread.");
+              }
+              synchronized (this) {
+                 if (!ran) {
+                     ran = true;
+                 }
+                 else {
+                  throw new IllegalStateException("The run() method in a"
+                      + " SafeThread cannot be called more than once.");
+                 }
+              }
+              super.run();
+          }
+     }
+
+     /**
+     *  Will get a thread from the pool, execute the task
      *  and return the thread to the pool.
      *
      *  The return value is used only to wait for completion
@@ -68,7 +96,7 @@
     public Thread run(Runnable task, int priority)
     {
 
-      Thread t = new Thread(task);
+      Thread t = new SafeThread(task);
 
       t.start();
 
--- a/src/share/classes/com/sun/org/apache/xpath/internal/axes/NodeSequence.java	Thu Mar 12 12:58:59 2009 -0700
+++ b/src/share/classes/com/sun/org/apache/xpath/internal/axes/NodeSequence.java	Fri May 15 12:37:09 2009 -0400
@@ -18,7 +18,7 @@
  * limitations under the License.
  */
 /*
- * $Id: NodeSequence.java,v 1.2.4.2 2005/09/14 19:45:19 jeffsuttor Exp $
+ * $Id: NodeSequence.java,v 1.6 2007/01/12 19:26:42 spericas Exp $
  */
 package com.sun.org.apache.xpath.internal.axes;
 
--- a/src/share/classes/com/sun/xml/internal/stream/events/XMLEventAllocatorImpl.java	Thu Mar 12 12:58:59 2009 -0700
+++ b/src/share/classes/com/sun/xml/internal/stream/events/XMLEventAllocatorImpl.java	Fri May 15 12:37:09 2009 -0400
@@ -25,6 +25,8 @@
 
 package com.sun.xml.internal.stream.events;
 
+import com.sun.org.apache.xerces.internal.impl.PropertyManager;
+import java.util.List;
 import javax.xml.stream.util.XMLEventAllocator;
 import javax.xml.stream.*;
 import javax.xml.stream.events.*;
@@ -144,7 +146,13 @@
                 break;
             }
             case XMLEvent.DTD:{
-                event = new DTDEvent(streamReader.getText());
+                DTDEvent dtdEvent = new DTDEvent(streamReader.getText());
+                dtdEvent.setLocation(streamReader.getLocation());
+                List entities = (List)streamReader.getProperty(PropertyManager.STAX_ENTITIES);
+                if (entities != null && entities.size() != 0) dtdEvent.setEntities(entities);
+                List notations = (List)streamReader.getProperty(PropertyManager.STAX_NOTATIONS);
+                if (notations != null && notations.size() != 0) dtdEvent.setNotations(notations);
+                event = dtdEvent;
                 break;
             }
             case XMLEvent.CDATA:{