Merge
authortrims
Thu, 02 Apr 2009 17:01:00 -0700
changeset 2353 dfcd1f626db3
parent 2328 d52186ee770d (diff)
parent 2352 00450e8ad728 (current diff)
child 2354 48105d84bc25
Merge
--- a/.hgtags	Thu Apr 02 10:49:41 2009 -0700
+++ b/.hgtags	Thu Apr 02 17:01:00 2009 -0700
@@ -26,3 +26,4 @@
 6b84b04a80afe23262377c60913eebfc898f14c4 jdk7-b49
 5da0e6b9f4f18ef483c977337214b12ee0e1fc8f jdk7-b50
 a25c5ec5e40e07733d1ff9898a0abe36159288ff jdk7-b51
+7a90e89e36d103038f8667f6a7daae34ecfa1ad8 jdk7-b52
--- a/.hgtags-top-repo	Thu Apr 02 10:49:41 2009 -0700
+++ b/.hgtags-top-repo	Thu Apr 02 17:01:00 2009 -0700
@@ -26,3 +26,4 @@
 aee93a8992d2389121eb610c00a86196f3e2b9b0 jdk7-b49
 5111e13e44e542fe945b47ab154546daec36737d jdk7-b50
 0f0189d55ce4a1f7840da7582ac7d970b3b7ab15 jdk7-b51
+4264c2fe66493e57c411045a1b61377796641e45 jdk7-b52
--- a/corba/.hgtags	Thu Apr 02 10:49:41 2009 -0700
+++ b/corba/.hgtags	Thu Apr 02 17:01:00 2009 -0700
@@ -26,3 +26,4 @@
 d70978bc64bc7a04be7797ab0dcd9b7b1b3a6bff jdk7-b49
 0edbd0074b02b42b2b83cc47cb391d4869b7a8ec jdk7-b50
 3eb8f1047a7402a9a79937d1c39560e931e91da2 jdk7-b51
+bec82237d694f9802b820fa11bbb4f7fa9bf8e77 jdk7-b52
--- a/corba/make/com/sun/corba/se/sources/Makefile	Thu Apr 02 10:49:41 2009 -0700
+++ b/corba/make/com/sun/corba/se/sources/Makefile	Thu Apr 02 17:01:00 2009 -0700
@@ -46,8 +46,6 @@
 include $(CORBA_JMK_DIRECTORY)com_sun_corba_se_PortableActivationIDL.jmk
 include $(CORBA_JMK_DIRECTORY)com_sun_corba_se_impl_logging.jmk
 
-FILES_java += com/sun/corba/se/org/omg/CORBA/ORB.java
-
 #
 # Dirs
 #
@@ -80,11 +78,11 @@
 POA.MC          = $(SRC_DIR)/com/sun/corba/se/spi/logging/data/POA.mc
 UTIL.MC         = $(SRC_DIR)/com/sun/corba/se/spi/logging/data/Util.mc
 
-MC_GENERATE_CLASS = $(SRC_DIR)/com/sun/tools/corba/se/logutil/scripts/mc.scm -main main make-class
-MC_GENERATE_LOG_RB = $(SRC_DIR)/com/sun/tools/corba/se/logutil/scripts/mc.scm -main main make-resource 
+MC_GENERATE_CLASS = make-class
+MC_GENERATE_LOG_RB = make-resource 
 
-JSCHEME_GENERATE_CLASS = $(BOOT_JAVA_CMD) jscheme.REPL $(MC_GENERATE_CLASS) 
-JSCHEME_GENERATE_LOG_RB = $(BOOT_JAVA_CMD) jscheme.REPL $(MC_GENERATE_LOG_RB) 
+JSCHEME_GENERATE_CLASS = $(BOOT_JAVA_CMD) com.sun.tools.corba.se.logutil.MC $(MC_GENERATE_CLASS) 
+JSCHEME_GENERATE_LOG_RB = $(BOOT_JAVA_CMD) com.sun.tools.corba.se.logutil.MC $(MC_GENERATE_LOG_RB) 
 
 
 #
--- a/corba/make/sun/rmi/corbalogsources/Makefile	Thu Apr 02 10:49:41 2009 -0700
+++ b/corba/make/sun/rmi/corbalogsources/Makefile	Thu Apr 02 17:01:00 2009 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright 2003-2006 Sun Microsystems, Inc.  All Rights Reserved.
+# Copyright 2003-2009 Sun Microsystems, Inc.  All Rights Reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -75,15 +75,14 @@
 POA.MC          = $(SRC_DIR)/com/sun/corba/se/spi/logging/data/POA.mc
 UTIL.MC         = $(SRC_DIR)/com/sun/corba/se/spi/logging/data/Util.mc
 
-MC_GENERATE_CLASS = $(SRC_DIR)/com/sun/tools/corba/se/logutil/scripts/mc.scm -main main make-class
-MC_GENERATE_LOG_RB = $(SRC_DIR)/com/sun/tools/corba/se/logutil/scripts/mc.scm -main main make-resource 
+MC_GENERATE_CLASS = make-class
+MC_GENERATE_LOG_RB = make-resource 
 
-JSCHEME_LIB_DIRECTORY=$(SRC_DIR)/com/sun/tools/corba/se/logutil/lib
-JSCHEME_CLASSPATH=$(JSCHEME_LIB_DIRECTORY)/jscheme.jar$(CLASSPATH_SEPARATOR)$(JSCHEME_LIB_DIRECTORY)/jschemelogutil.jar
-JSCHEME_GENERATE_CLASS = $(BOOT_JAVA_CMD) \
-    -cp "$(JSCHEME_CLASSPATH)" jscheme.REPL $(MC_GENERATE_CLASS) 
-JSCHEME_GENERATE_LOG_RB = $(BOOT_JAVA_CMD) \
-    -cp "$(JSCHEME_CLASSPATH)" jscheme.REPL $(MC_GENERATE_LOG_RB) 
+MC_CLASSPATH=$(BUILDTOOLJARDIR)/MC.jar
+MCJ_GENERATE_CLASS = $(BOOT_JAVA_CMD) \
+    -cp "$(MC_CLASSPATH)" com.sun.tools.corba.se.logutil.MC $(MC_GENERATE_CLASS) 
+MCJ_GENERATE_LOG_RB = $(BOOT_JAVA_CMD) \
+    -cp "$(MC_CLASSPATH)" com.sun.tools.corba.se.logutil.MC $(MC_GENERATE_LOG_RB) 
 
 
 #
@@ -104,28 +103,28 @@
 	$(MKDIR) -p $(LOG_GENDIRECTORY)
 
 $(LOG_GENDIRECTORY)/ActivationSystemException.java : $(ACTIVATION.MC)
-	$(JSCHEME_GENERATE_CLASS) $(ACTIVATION.MC) $(LOG_GENDIRECTORY)
+	$(MCJ_GENERATE_CLASS) $(ACTIVATION.MC) $(LOG_GENDIRECTORY)
 
 $(LOG_GENDIRECTORY)/IORSystemException.java : $(IOR.MC)
-	$(JSCHEME_GENERATE_CLASS) $(IOR.MC) $(LOG_GENDIRECTORY)
+	$(MCJ_GENERATE_CLASS) $(IOR.MC) $(LOG_GENDIRECTORY)
 
 $(LOG_GENDIRECTORY)/InterceptorsSystemException.java : $(INTERCEPTORS.MC)
-	$(JSCHEME_GENERATE_CLASS) $(INTERCEPTORS.MC) $(LOG_GENDIRECTORY)
+	$(MCJ_GENERATE_CLASS) $(INTERCEPTORS.MC) $(LOG_GENDIRECTORY)
 
 $(LOG_GENDIRECTORY)/NamingSystemException.java : $(NAMING.MC)
-	$(JSCHEME_GENERATE_CLASS) $(NAMING.MC) $(LOG_GENDIRECTORY)
+	$(MCJ_GENERATE_CLASS) $(NAMING.MC) $(LOG_GENDIRECTORY)
 
 $(LOG_GENDIRECTORY)/OMGSystemException.java : $(OMG.MC)
-	$(JSCHEME_GENERATE_CLASS) $(OMG.MC) $(LOG_GENDIRECTORY)
+	$(MCJ_GENERATE_CLASS) $(OMG.MC) $(LOG_GENDIRECTORY)
 
 $(LOG_GENDIRECTORY)/ORBUtilSystemException.java : $(ORBUTIL.MC)
-	$(JSCHEME_GENERATE_CLASS) $(ORBUTIL.MC) $(LOG_GENDIRECTORY)
+	$(MCJ_GENERATE_CLASS) $(ORBUTIL.MC) $(LOG_GENDIRECTORY)
 
 $(LOG_GENDIRECTORY)/POASystemException.java : $(POA.MC)
-	$(JSCHEME_GENERATE_CLASS) $(POA.MC) $(LOG_GENDIRECTORY)
+	$(MCJ_GENERATE_CLASS) $(POA.MC) $(LOG_GENDIRECTORY)
 
 $(LOG_GENDIRECTORY)/UtilSystemException.java : $(UTIL.MC)
-	$(JSCHEME_GENERATE_CLASS) $(UTIL.MC) $(LOG_GENDIRECTORY)
+	$(MCJ_GENERATE_CLASS) $(UTIL.MC) $(LOG_GENDIRECTORY)
 
 logresource.generate: $(LOG_GENDIRECTORY)/LogStrings.properties
 
@@ -142,28 +141,28 @@
 	$(CAT) $(LOG_GENDIRECTORY)/*.resource > $(LOG_GENDIRECTORY)/LogStrings.properties
 
 $(LOG_GENDIRECTORY)/ActivationSystemException.resource : $(ACTIVATION.MC)
-	$(JSCHEME_GENERATE_LOG_RB) $(ACTIVATION.MC) $(LOG_GENDIRECTORY)
+	$(MCJ_GENERATE_LOG_RB) $(ACTIVATION.MC) $(LOG_GENDIRECTORY)
 
 $(LOG_GENDIRECTORY)/IORSystemException.resource : $(IOR.MC)
-	$(JSCHEME_GENERATE_LOG_RB) $(IOR.MC) $(LOG_GENDIRECTORY)
+	$(MCJ_GENERATE_LOG_RB) $(IOR.MC) $(LOG_GENDIRECTORY)
 
 $(LOG_GENDIRECTORY)/InterceptorsSystemException.resource : $(INTERCEPTORS.MC)
-	$(JSCHEME_GENERATE_LOG_RB) $(INTERCEPTORS.MC) $(LOG_GENDIRECTORY)
+	$(MCJ_GENERATE_LOG_RB) $(INTERCEPTORS.MC) $(LOG_GENDIRECTORY)
 
 $(LOG_GENDIRECTORY)/NamingSystemException.resource : $(NAMING.MC)
-	$(JSCHEME_GENERATE_LOG_RB) $(NAMING.MC) $(LOG_GENDIRECTORY)
+	$(MCJ_GENERATE_LOG_RB) $(NAMING.MC) $(LOG_GENDIRECTORY)
 
 $(LOG_GENDIRECTORY)/OMGSystemException.resource : $(OMG.MC)
-	$(JSCHEME_GENERATE_LOG_RB) $(OMG.MC) $(LOG_GENDIRECTORY)
+	$(MCJ_GENERATE_LOG_RB) $(OMG.MC) $(LOG_GENDIRECTORY)
 
 $(LOG_GENDIRECTORY)/ORBUtilSystemException.resource : $(ORBUTIL.MC)
-	$(JSCHEME_GENERATE_LOG_RB) $(ORBUTIL.MC) $(LOG_GENDIRECTORY)
+	$(MCJ_GENERATE_LOG_RB) $(ORBUTIL.MC) $(LOG_GENDIRECTORY)
 
 $(LOG_GENDIRECTORY)/POASystemException.resource : $(POA.MC)
-	$(JSCHEME_GENERATE_LOG_RB) $(POA.MC) $(LOG_GENDIRECTORY)
+	$(MCJ_GENERATE_LOG_RB) $(POA.MC) $(LOG_GENDIRECTORY)
 
 $(LOG_GENDIRECTORY)/UtilSystemException.resource : $(UTIL.MC)
-	$(JSCHEME_GENERATE_LOG_RB) $(UTIL.MC) $(LOG_GENDIRECTORY)
+	$(MCJ_GENERATE_LOG_RB) $(UTIL.MC) $(LOG_GENDIRECTORY)
 
 
 #
--- a/corba/make/tools/Makefile	Thu Apr 02 10:49:41 2009 -0700
+++ b/corba/make/tools/Makefile	Thu Apr 02 17:01:00 2009 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright 1998-2005 Sun Microsystems, Inc.  All Rights Reserved.
+# Copyright 1998-2009 Sun Microsystems, Inc.  All Rights Reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -33,6 +33,7 @@
 SUBDIRS =                   \
   strip_properties          \
   idlj                      \
+  logutil		    \
 
 all build clean clobber::
 	$(SUBDIRS-loop)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/corba/make/tools/logutil/Makefile	Thu Apr 02 17:01:00 2009 -0700
@@ -0,0 +1,43 @@
+#
+# Copyright 2008 Sun Microsystems, Inc.  All Rights Reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Sun designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Sun in the LICENSE file that accompanied this code.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+# CA 95054 USA or visit www.sun.com if you need additional information or
+# have any questions.
+#
+
+#
+# Makefile for building the idlj tool
+#
+
+BUILDDIR = ../..
+PACKAGE = com.sun.tools.corba.se.logutil
+PRODUCT = tools
+PROGRAM = MC
+include $(BUILDDIR)/common/Defs.gmk
+
+BUILDTOOL_SOURCE_ROOT = $(SHARE_SRC)/classes
+BUILDTOOL_MAIN        = $(PKGDIR)/MC.java
+
+#
+# Build tool jar rules.
+#
+include $(BUILDDIR)/common/BuildToolJar.gmk
+
--- a/corba/src/share/classes/com/sun/tools/corba/se/logutil/IndentingPrintWriter.java	Thu Apr 02 10:49:41 2009 -0700
+++ b/corba/src/share/classes/com/sun/tools/corba/se/logutil/IndentingPrintWriter.java	Thu Apr 02 17:01:00 2009 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2003 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2003-2009 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -30,7 +30,6 @@
 import java.io.OutputStream ;
 import java.io.BufferedWriter ;
 import java.io.OutputStreamWriter ;
-import jsint.Pair ;
 import java.util.StringTokenizer ;
 
 public class IndentingPrintWriter extends PrintWriter {
@@ -38,22 +37,20 @@
     private int indentWidth = 4 ;
     private String indentString = "" ;
 
-    public void printMsg( String msg, Pair data )
+    public void printMsg( String msg, Object... data )
     {
         // System.out.println( "printMsg called with msg=" + msg + " data=" + data ) ;
         StringTokenizer st = new StringTokenizer( msg, "@", true ) ;
         StringBuffer result = new StringBuffer() ;
-        Object head = data.first ;
-        Pair tail = (Pair)data.rest ;
         String token = null ;
+        int pos = 0;
 
         while (st.hasMoreTokens()) {
             token = st.nextToken() ;
             if (token.equals("@")) {
-                if (head != null) {
-                    result.append( head ) ;
-                    head = tail.first ;
-                    tail = (Pair)tail.rest ;
+                if (pos < data.length) {
+                    result.append( data[pos] );
+                    ++pos;
                 } else {
                     throw new Error( "List too short for message" ) ;
                 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/corba/src/share/classes/com/sun/tools/corba/se/logutil/Input.java	Thu Apr 02 17:01:00 2009 -0700
@@ -0,0 +1,211 @@
+/*
+ * Copyright 2008 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.tools.corba.se.logutil;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.InputStreamReader;
+import java.io.IOException;
+
+import java.util.LinkedList;
+import java.util.Queue;
+
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+public class Input {
+
+  /**
+   * The name of the package this class will inhabit.
+   */
+  private String packageName;
+
+  /**
+   * The name of the generated class.
+   */
+  private String className;
+
+  /**
+   * The name of the group of exceptions handled by the class.
+   */
+  private String groupName;
+
+  /**
+   * The group of exceptions.
+   */
+  private Queue<InputException> exceptions;
+
+  /**
+   * Represents the current state of parsing the input.
+   */
+  private enum State
+  {
+    OUTER,
+    IN_CLASS,
+    IN_EXCEPTION_LIST
+  };
+
+  /**
+   * Regular expression to match each code line.
+   */
+  private static final Pattern EXCEPTION_INFO_REGEX =
+    Pattern.compile("(\\w+)\\s*(\\d+)\\s*(\\w+)");
+
+  /**
+   * Parses the specified file to create a new {@link Input}
+   * object.
+   *
+   * @param filename the file to parse.
+   * @throws FileNotFoundException if the file can't be found.
+   * @throws IOException if an I/O error occurs.
+   */
+  public Input(final String filename)
+  throws FileNotFoundException, IOException {
+    BufferedReader r =
+      new BufferedReader(new InputStreamReader(new FileInputStream(filename)));
+    State state = State.OUTER;
+    InputException current = null;
+    exceptions = new LinkedList<InputException>();
+    String line;
+    while ((line = r.readLine()) != null) {
+      // Skip ; comments
+      if (line.startsWith(";"))
+        continue;
+
+      int index = line.indexOf("(");
+      if (index == -1)
+        continue;
+
+      switch (state) {
+      case OUTER:
+        state = State.IN_CLASS;
+        String[] classInfo = line.substring(index).split(" ");
+        packageName = classInfo[0].substring(2, classInfo[0].length() - 1);
+        className = classInfo[1].substring(1, classInfo[1].length() - 1);
+        groupName = classInfo[2];
+        break;
+      case IN_CLASS:
+        state = State.IN_EXCEPTION_LIST;
+        break;
+      case IN_EXCEPTION_LIST:
+        boolean inQuote = false;
+        boolean inCode = false;
+        boolean end = false;
+        int start = index + 1;
+        Queue<String> lines = new LinkedList<String>();
+        for (int a = start; a < line.length(); ++a) {
+          if (line.charAt(a) == '(' && !inCode && !inQuote) {
+            if (current == null)
+              current =
+                new InputException(line.substring(start, a).trim());
+            start = a + 1;
+            inCode = true;
+          }
+          if (line.charAt(a) == '"')
+            inQuote = !inQuote;
+          if (line.charAt(a) == ')' && !inQuote) {
+            if (inCode) {
+              lines.offer(line.substring(start, a));
+              inCode = false;
+            } else
+              end = true;
+          }
+          if (!end && a == line.length() - 1)
+            line += r.readLine();
+        }
+        for (String l : lines) {
+          int stringStart = l.indexOf("\"") + 1;
+          int stringEnd = l.indexOf("\"", stringStart);
+          Matcher matcher = EXCEPTION_INFO_REGEX.matcher(l.substring(0, stringStart));
+          if (matcher.find())
+            current.add(new InputCode(matcher.group(1),
+                                      Integer.parseInt(matcher.group(2)),
+                                      matcher.group(3),
+                                      l.substring(stringStart, stringEnd)));
+        }
+        exceptions.offer(current);
+        current = null;
+        break;
+      }
+    }
+  }
+
+  /**
+   * Returns the name of this group of exceptions.
+   *
+   * @return the name of this group of exceptions.
+   */
+  public String getGroupName()
+  {
+    return groupName;
+  }
+
+  /**
+   * Returns the name of the package this class will go in.
+   *
+   * @return the name of the package.
+   */
+  public String getPackageName()
+  {
+    return packageName;
+  }
+
+  /**
+   * Returns the name of the generated class.
+   *
+   * @return the name of the class.
+   */
+  public String getClassName()
+  {
+    return className;
+  }
+
+  /**
+   * Returns the exceptions contained in this class.
+   *
+   * @return the exceptions.
+   */
+  public Queue<InputException> getExceptions() {
+    return exceptions;
+  }
+
+  /**
+   * Returns a textual representation of this input.
+   *
+   * @return a textual representation.
+   */
+  public String toString() {
+    return getClass().getName() +
+      "[packageName=" + packageName +
+      ",className=" + className +
+      ",groupName=" + groupName +
+      ",exceptions=" + exceptions +
+      "]";
+  }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/corba/src/share/classes/com/sun/tools/corba/se/logutil/InputCode.java	Thu Apr 02 17:01:00 2009 -0700
@@ -0,0 +1,116 @@
+/*
+ * Copyright 2008 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.tools.corba.se.logutil;
+
+public class InputCode {
+
+  /**
+   * The name of this code.
+   */
+  private final String name;
+
+  /**
+   * The code.
+   */
+  private final int code;
+
+  /**
+   * The log level for this code.
+   */
+  private final String logLevel;
+
+  /**
+   * The error message for this code.
+   */
+  private final String message;
+
+  /**
+   * Creates a new error code with the specified name, code,
+   * log level and error message.
+   *
+   * @param name the name of the new code.
+   * @param code the code itself.
+   * @param logLevel the level of severity of this error.
+   * @param message the error message for this code.
+   */
+  public InputCode(final String name, final int code,
+                   final String logLevel, final String message) {
+    this.name = name;
+    this.code = code;
+    this.logLevel = logLevel;
+    this.message = message;
+  }
+
+  /**
+   * Returns the name of this code.
+   *
+   * @return the name of the code.
+   */
+  public String getName() {
+    return name;
+  }
+
+  /**
+   * Returns the code.
+   *
+   * @return the code.
+   */
+  public int getCode() {
+    return code;
+  }
+
+  /**
+   * Returns the severity of this code.
+   *
+   * @return the log level severity of the code.
+   */
+  public String getLogLevel() {
+    return logLevel;
+  }
+
+  /**
+   * Returns the error message for this code.
+   *
+   * @return the error message for this code.
+   */
+  public String getMessage() {
+    return message;
+  }
+
+  /**
+   * Returns a textual representation of this code.
+   *
+   * @return a textual representation.
+   */
+  public String toString() {
+    return getClass().getName() +
+      "[name=" + name +
+      ",code=" + code +
+      ",logLevel=" + logLevel +
+      ",message=" + message +
+      "]";
+  }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/corba/src/share/classes/com/sun/tools/corba/se/logutil/InputException.java	Thu Apr 02 17:01:00 2009 -0700
@@ -0,0 +1,94 @@
+/*
+ * Copyright 2008 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.tools.corba.se.logutil;
+
+import java.util.LinkedList;
+import java.util.Queue;
+
+public class InputException {
+
+  /**
+   * The name of this exception.
+   */
+  private final String name;
+
+  /**
+   * The codes associated with this exception.
+   */
+  private final Queue<InputCode> codes;
+
+  /**
+   * Constructs a new {@link InputException} with the
+   * specified name.
+   *
+   * @param name the name of the new exception;
+   */
+  public InputException(final String name) {
+    this.name = name;
+    codes = new LinkedList<InputCode>();
+  }
+
+  /**
+   * Adds a new code to this exception.
+   *
+   * @param c the code to add.
+   */
+  public void add(InputCode c)
+  {
+    codes.offer(c);
+  }
+
+  /**
+   * Returns the name of this exception.
+   *
+   * @return the exception's name.
+   */
+  public String getName() {
+    return name;
+  }
+
+  /**
+   * Returns the codes associated with this exception.
+   *
+   * @return the exception's codes.
+   */
+  public Queue<InputCode> getCodes() {
+    return codes;
+  }
+
+  /**
+   * Returns a textual representation of this exception.
+   *
+   * @return a textual representation.
+   */
+  public String toString() {
+    return getClass().getName()
+      + "[name=" + name
+      + ",codes=" + codes
+      + "]";
+  }
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/corba/src/share/classes/com/sun/tools/corba/se/logutil/MC.java	Thu Apr 02 17:01:00 2009 -0700
@@ -0,0 +1,559 @@
+/*
+ * Copyright 2008 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.tools.corba.se.logutil;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+
+import java.util.Arrays;
+import java.util.Date;
+import java.util.Formatter;
+import java.util.List;
+import java.util.Queue;
+
+public class MC {
+
+  private static final String VERSION = "1.0";
+
+  private static final List<String> SUN_EXCEPTION_GROUPS = Arrays.asList(new String[]
+    { "SUNBASE", "ORBUTIL", "ACTIVATION", "NAMING", "INTERCEPTORS", "POA", "IOR", "UTIL" });
+
+  private static final List<String> EXCEPTIONS = Arrays.asList(new String[]
+    { "UNKNOWN", "BAD_PARAM", "NO_MEMORY", "IMP_LIMIT", "COMM_FAILURE", "INV_OBJREF", "NO_PERMISSION",
+      "INTERNAL", "MARSHAL", "INITIALIZE", "NO_IMPLEMENT", "BAD_TYPECODE", "BAD_OPERATION", "NO_RESOURCES",
+      "NO_RESPONSE", "PERSIST_STORE", "BAD_INV_ORDER", "TRANSIENT", "FREE_MEM", "INV_IDENT", "INV_FLAG",
+      "INTF_REPOS", "BAD_CONTEXT", "OBJ_ADAPTER", "DATA_CONVERSION", "OBJECT_NOT_EXIST", "TRANSACTION_REQUIRED",
+      "TRANSACTION_ROLLEDBACK", "INVALID_TRANSACTION", "INV_POLICY", "CODESET_INCOMPATIBLE", "REBIND",
+      "TIMEOUT", "TRANSACTION_UNAVAILABLE", "BAD_QOS", "INVALID_ACTIVITY", "ACTIVITY_COMPLETED",
+      "ACTIVITY_REQUIRED" });
+
+  /**
+   * Read the minor codes from the input file and
+   * write out a resource file.
+   *
+   * @param inFile the file to read the codes from.
+   * @param outDir the directory to write the resource file to.
+   * @throws FileNotFoundException if the input file can not be found.
+   * @throws IOException if an I/O error occurs.
+   */
+  private void makeResource(String inFile, String outDir)
+  throws FileNotFoundException, IOException {
+    writeResource(outDir, new Input(inFile));
+  }
+
+  /**
+   * Create a new Java source file using the specified Scheme input file,
+   * and writing the result to the given output directory.
+   *
+   * @param inFile the file to read the data from.
+   * @param outDir the directory to write the Java class to.
+   * @throws FileNotFoundException if the input file can not be found.
+   * @throws IOException if an I/O error occurs.
+   */
+  private void makeClass(String inFile, String outDir)
+  throws FileNotFoundException, IOException {
+    writeClass(inFile, outDir, new Input(inFile));
+  }
+
+  /**
+   * Writes out a Java source file using the data from the given
+   * {@link Input} object.  The result is written to {@code outDir}.
+   * The name of the input file is just used in the header of the
+   * resulting source file.
+   *
+   * @param inFile the name of the file the data was read from.
+   * @param outDir the directory to write the Java class to.
+   * @param input the parsed input data.
+   * @throws FileNotFoundException if the output file can't be written.
+   */
+  private void writeClass(String inFile, String outDir, Input input)
+    throws FileNotFoundException {
+    String packageName = input.getPackageName();
+    String className = input.getClassName();
+    String groupName = input.getGroupName();
+    Queue<InputException> exceptions = input.getExceptions();
+    FileOutputStream file = new FileOutputStream(outDir + File.separator + className + ".java");
+    IndentingPrintWriter pw = new IndentingPrintWriter(file);
+
+    writeClassHeader(inFile, groupName, pw);
+    pw.printMsg("package @ ;", packageName);
+    pw.println();
+    pw.println("import java.util.logging.Logger ;");
+    pw.println("import java.util.logging.Level ;");
+    pw.println();
+    pw.println("import org.omg.CORBA.OMGVMCID ;");
+    pw.println( "import com.sun.corba.se.impl.util.SUNVMCID ;");
+    pw.println( "import org.omg.CORBA.CompletionStatus ;");
+    pw.println( "import org.omg.CORBA.SystemException ;");
+    pw.println();
+    pw.println( "import com.sun.corba.se.spi.orb.ORB ;");
+    pw.println();
+    pw.println( "import com.sun.corba.se.spi.logging.LogWrapperFactory;");
+    pw.println();
+    pw.println( "import com.sun.corba.se.spi.logging.LogWrapperBase;");
+    pw.println();
+    writeImports(exceptions, pw);
+    pw.println();
+    pw.indent();
+    pw.printMsg("public class @ extends LogWrapperBase {", className);
+    pw.println();
+    pw.printMsg("public @( Logger logger )", className);
+    pw.indent();
+    pw.println( "{");
+    pw.undent();
+    pw.println( "super( logger ) ;");
+    pw.println( "}");
+    pw.println();
+    pw.flush();
+    writeFactoryMethod(className, groupName, pw);
+    writeExceptions(groupName, exceptions, className, pw);
+    pw.undent();
+    pw.println( );
+    pw.println( "}");
+    pw.flush();
+    pw.close();
+  }
+
+  /**
+   * Writes out the header of a Java source file.
+   *
+   * @param inFile the input file the file was generated from.
+   * @param groupName the group of exceptions the Java source file is for.
+   * @param pw the print writer used to write the output.
+   */
+  private void writeClassHeader(String inFile, String groupName,
+                                IndentingPrintWriter pw) {
+    if (groupName.equals("OMG"))
+      pw.println("// Log wrapper class for standard exceptions");
+    else
+      pw.printMsg("// Log wrapper class for Sun private system exceptions in group @",
+                  groupName);
+    pw.println("//");
+    pw.printMsg("// Generated by MC.java version @, DO NOT EDIT BY HAND!", VERSION);
+    pw.printMsg("// Generated from input file @ on @", inFile, new Date());
+    pw.println();
+  }
+
+  /**
+   * Write out the import list for the exceptions.
+   *
+   * @param groups the exceptions that were parsed.
+   * @param pw the {@link IndentingPrintWriter} for writing to the file.
+   */
+  private void writeImports(Queue<InputException> exceptions,
+                            IndentingPrintWriter pw) {
+    if (exceptions == null)
+      return;
+    for (InputException e : exceptions)
+      pw.println("import org.omg.CORBA." + e.getName() + " ;");
+  }
+
+  /**
+   * Write out the factory method for this group of exceptions.
+   *
+   * @param className the name of the generated class.
+   * @param groupName the name of this group of exceptions.
+   * @param pw the {@link IndentingPrintWriter} for writing to the file.
+   */
+  private void writeFactoryMethod(String className, String groupName,
+                                  IndentingPrintWriter pw) {
+    pw.indent();
+    pw.println( "private static LogWrapperFactory factory = new LogWrapperFactory() {");
+    pw.println( "public LogWrapperBase create( Logger logger )" );
+    pw.indent();
+    pw.println( "{");
+    pw.undent();
+    pw.printMsg("return new @( logger ) ;", className);
+    pw.undent();
+    pw.println( "}" );
+    pw.println( "} ;" );
+    pw.println();
+    pw.printMsg("public static @ get( ORB orb, String logDomain )", className);
+    pw.indent();
+    pw.println( "{");
+    pw.indent();
+    pw.printMsg( "@ wrapper = ", className);
+    pw.indent();
+    pw.printMsg( "(@) orb.getLogWrapper( logDomain, ", className);
+    pw.undent();
+    pw.undent();
+    pw.printMsg( "\"@\", factory ) ;", groupName);
+    pw.undent();
+    pw.println( "return wrapper ;" );
+    pw.println( "} " );
+    pw.println();
+    pw.printMsg( "public static @ get( String logDomain )", className);
+    pw.indent();
+    pw.println( "{");
+    pw.indent();
+    pw.printMsg( "@ wrapper = ", className);
+    pw.indent();
+    pw.printMsg( "(@) ORB.staticGetLogWrapper( logDomain, ", className);
+    pw.undent();
+    pw.undent();
+    pw.printMsg( "\"@\", factory ) ;", groupName);
+    pw.undent();
+    pw.println( "return wrapper ;" );
+    pw.println( "} " );
+    pw.println();
+  }
+
+  /**
+   * Writes out the exceptions themselves.
+   *
+   * @param groupName the name of this group of exceptions.
+   * @param exceptions the exceptions to write out.
+   * @param className the name of the generated class.
+   * @param pw the {@link IndentingPrintWriter} for writing to the file.
+   */
+  private void writeExceptions(String groupName, Queue<InputException> exceptions,
+                               String className, IndentingPrintWriter pw) {
+    for (InputException e : exceptions) {
+      pw.println("///////////////////////////////////////////////////////////");
+      pw.printMsg("// @", e.getName());
+      pw.println("///////////////////////////////////////////////////////////");
+      pw.println();
+      for (InputCode c : e.getCodes())
+        writeMethods(groupName, e.getName(), c.getName(), c.getCode(),
+                     c.getLogLevel(), className, StringUtil.countArgs(c.getMessage()), pw);
+      pw.flush();
+    }
+  }
+
+  /**
+   * Writes out the methods for a particular error.
+   *
+   * @param groupName the name of this group of exceptions.
+   * @param exceptionName the name of this particular exception.
+   * @param errorName the name of this particular error.
+   * @param code the minor code for this particular error.
+   * @param ident the name of the error in mixed-case identifier form.
+   * @param level the level at which to place log messages.
+   * @param className the name of the class for this group of exceptions.
+   * @param numParams the number of parameters the detail message takes.
+   * @param pw the print writer for writing to the file.
+   */
+  private void writeMethods(String groupName, String exceptionName, String errorName,
+                            int code, String level, String className, int numParams,
+                            IndentingPrintWriter pw) {
+    String ident = StringUtil.toMixedCase(errorName);
+    pw.printMsg("public static final int @ = @ ;", errorName, getBase(groupName, code));
+    pw.println();
+    pw.flush();
+    writeMethodStatusCause(groupName, exceptionName, errorName, ident, level,
+                           numParams, className, pw);
+    pw.println();
+    pw.flush();
+    writeMethodStatus(exceptionName, ident, numParams, pw);
+    pw.println();
+    pw.flush();
+    writeMethodCause(exceptionName, ident, numParams, pw);
+    pw.println();
+    pw.flush();
+    writeMethodNoArgs(exceptionName, ident, numParams, pw);
+    pw.println();
+    pw.flush();
+  }
+
+  /**
+   * Writes out a method for an error that takes a
+   * {@link org.omg.CORBA.CompletionStatus} and a cause.
+   *
+   * @param groupName the name of this group of exceptions.
+   * @param exceptionName the name of this particular exception.
+   * @param errorName the name of this particular error.
+   * @param ident the name of the error in mixed-case identifier form.
+   * @param logLevel the level at which to place log messages.
+   * @param numParams the number of parameters the detail message takes.
+   * @param className the name of the class for this group of exceptions.
+   * @param pw the print writer for writing to the file.
+   */
+  private void writeMethodStatusCause(String groupName, String exceptionName,
+                                      String errorName, String ident,
+                                      String logLevel, int numParams,
+                                      String className, IndentingPrintWriter pw) {
+    pw.indent();
+    pw.printMsg( "public @ @( CompletionStatus cs, Throwable t@) {", exceptionName,
+                 ident, makeDeclArgs(true, numParams));
+    pw.printMsg( "@ exc = new @( @, cs ) ;", exceptionName, exceptionName, errorName);
+    pw.indent();
+    pw.println( "if (t != null)" );
+    pw.undent();
+    pw.println( "exc.initCause( t ) ;" );
+    pw.println();
+    pw.indent();
+    pw.printMsg( "if (logger.isLoggable( Level.@ )) {", logLevel);
+    if (numParams > 0) {
+      pw.printMsg( "Object[] parameters = new Object[@] ;", numParams);
+      for (int a = 0; a < numParams; ++a)
+        pw.printMsg("parameters[@] = arg@ ;", a, a);
+    } else
+      pw.println( "Object[] parameters = null ;");
+    pw.indent();
+    pw.printMsg( "doLog( Level.@, \"@.@\",", logLevel, groupName, ident);
+    pw.undent();
+    pw.undent();
+    pw.printMsg( "parameters, @.class, exc ) ;", className);
+    pw.println( "}");
+    pw.println();
+
+    pw.undent();
+    pw.println( "return exc ;");
+    pw.println( "}");
+  }
+
+  /**
+   * Writes out a method for an error that takes a
+   * {@link org.omg.CORBA.CompletionStatus}.
+   *
+   * @param exceptionName the name of this particular exception.
+   * @param ident the name of the error in mixed-case identifier form.
+   * @param numParams the number of parameters the detail message takes.
+   * @param pw the print writer for writing to the file.
+   */
+  private void writeMethodStatus(String exceptionName, String ident,
+                                 int numParams, IndentingPrintWriter pw) {
+    pw.indent();
+    pw.printMsg("public @ @( CompletionStatus cs@) {", exceptionName,
+                ident, makeDeclArgs(true, numParams));
+    pw.undent();
+    pw.printMsg("return @( cs, null@ ) ;", ident, makeCallArgs(true, numParams));
+    pw.println("}");
+  }
+
+  /**
+   * Writes out a method for an error that takes a cause.
+   *
+   * @param exceptionName the name of this particular exception.
+   * @param ident the name of the error in mixed-case identifier form.
+   * @param numParams the number of parameters the detail message takes.
+   * @param pw the print writer for writing to the file.
+   */
+  private void writeMethodCause(String exceptionName, String ident,
+                                int numParams, IndentingPrintWriter pw) {
+    pw.indent();
+    pw.printMsg("public @ @( Throwable t@) {", exceptionName, ident,
+                makeDeclArgs(true, numParams));
+    pw.undent();
+    pw.printMsg("return @( CompletionStatus.COMPLETED_NO, t@ ) ;", ident,
+                makeCallArgs(true, numParams));
+    pw.println("}");
+  }
+
+  /**
+   * Writes out a method for an error that takes no arguments.
+   *
+   * @param exceptionName the name of this particular exception.
+   * @param ident the name of the error in mixed-case identifier form.
+   * @param numParams the number of parameters the detail message takes.
+   * @param pw the print writer for writing to the file.
+   */
+  private void writeMethodNoArgs(String exceptionName, String ident,
+                                 int numParams, IndentingPrintWriter pw) {
+
+    pw.indent();
+    pw.printMsg("public @ @( @) {", exceptionName, ident,
+                makeDeclArgs(false, numParams));
+    pw.undent();
+    pw.printMsg("return @( CompletionStatus.COMPLETED_NO, null@ ) ;",
+                ident, makeCallArgs(true, numParams));
+    pw.println("}");
+  }
+
+  /**
+   * Returns a list of comma-separated arguments with type declarations.
+   *
+   * @param leadingComma true if the list should start with a comma.
+   * @param numArgs the number of arguments to generate.
+   * @return the generated string.
+   */
+  private String makeDeclArgs(boolean leadingComma, int numArgs) {
+    return makeArgString("Object arg", leadingComma, numArgs);
+  }
+
+  /**
+   * Returns a list of comma-separated arguments without type declarations.
+   *
+   * @param leadingComma true if the list should start with a comma.
+   * @param numArgs the number of arguments to generate.
+   * @return the generated string.
+   */
+  private String makeCallArgs(boolean leadingComma, int numArgs) {
+    return makeArgString("arg", leadingComma, numArgs);
+  }
+
+  /**
+   * Returns a list of comma-separated arguments.
+   *
+   * @param prefixString the string with which to prefix each argument.
+   * @param leadingComma true if the list should start with a comma.
+   * @param numArgs the number of arguments to generate.
+   * @return the generated string.
+   */
+  private String makeArgString(String prefixString, boolean leadingComma,
+                               int numArgs) {
+    if (numArgs == 0)
+      return " ";
+    if (numArgs == 1) {
+      if (leadingComma)
+        return ", " + prefixString + (numArgs - 1);
+      else
+        return " " + prefixString + (numArgs - 1);
+    }
+    return makeArgString(prefixString, leadingComma, numArgs - 1) +
+      ", " + prefixString + (numArgs - 1);
+  }
+
+  /**
+   * Returns the {@link String} containing the calculation of the
+   * error code.
+   *
+   * @param groupName the group of exception to which the code belongs.
+   * @param code the minor code number representing the exception within the group.
+   * @return the unique error code.
+   */
+  private String getBase(String groupName, int code) {
+    if (groupName.equals("OMG"))
+      return "OMGVMCID.value + " + code;
+    else
+      return "SUNVMCID.value + " + (code + getSunBaseNumber(groupName));
+  }
+
+  /**
+   * Returns the base number for Sun-specific exceptions.
+   *
+   * @return the base number.
+   */
+  private int getSunBaseNumber(String groupName) {
+    return 200 * SUN_EXCEPTION_GROUPS.indexOf(groupName);
+  }
+
+  /**
+   * Writes out a resource file using the data from the given
+   * {@link Input} object.  The result is written to {@code outDir}.
+   *
+   * @param outDir the directory to write the Java class to.
+   * @param input the parsed input data.
+   * @throws FileNotFoundException if the output file can't be written.
+   */
+  private void writeResource(String outDir, Input input)
+    throws FileNotFoundException {
+    FileOutputStream file = new FileOutputStream(outDir + File.separator +
+                                                 input.getClassName() + ".resource");
+    IndentingPrintWriter pw = new IndentingPrintWriter(file);
+    String groupName = input.getGroupName();
+    for (InputException e : input.getExceptions()) {
+      String exName = e.getName();
+      for (InputCode c : e.getCodes()) {
+        String ident = StringUtil.toMixedCase(c.getName());
+        pw.printMsg("@.@=\"@: (@) @\"", groupName, ident,
+                    getMessageID(groupName, exName, c.getCode()), exName, c.getMessage());
+      }
+      pw.flush();
+    }
+    pw.close();
+  }
+
+  /**
+   * Returns the message ID corresponding to the given group name,
+   * exception name and error code.
+   *
+   * @param groupName the name of the group of exceptions.
+   * @param exception the name of the particular exception.
+   * @param code an error code from the given exception.
+   * @return the message ID.
+   */
+  private String getMessageID(String groupName, String exceptionName, int code) {
+    if (groupName.equals("OMG"))
+      return getStandardMessageID(exceptionName, code);
+    else
+      return getSunMessageID(groupName, exceptionName, code);
+  }
+
+  /**
+   * Returns the standard (OMG) message ID corresponding to the given
+   * exception name and error code.
+   *
+   * @param exceptionName the name of the particular exception.
+   * @param code an error code from the given exception.
+   * @return the message ID.
+   */
+  private String getStandardMessageID(String exceptionName, int code) {
+    return new Formatter().format("IOP%s0%04d", getExceptionID(exceptionName),
+                                  code).toString();
+  }
+
+  /**
+   * Returns the Sun message ID corresponding to the given group name,
+   * exception name and error code.
+   *
+   * @param groupName the name of the group of exceptions.
+   * @param exceptionName the name of the particular exception.
+   * @param code an error code from the given exception.
+   * @return the message ID.
+   */
+  private String getSunMessageID(String groupName, String exceptionName, int code) {
+    return new Formatter().format("IOP%s1%04d", getExceptionID(exceptionName),
+                                  getSunBaseNumber(groupName) + code).toString();
+  }
+
+  /**
+   * Returns the exception ID corresponding to the given exception name.
+   *
+   * @param exceptionName the name of the particular exception.
+   * @return the message ID.
+   */
+  private String getExceptionID(String exceptionName) {
+    return new Formatter().format("%03d", EXCEPTIONS.indexOf(exceptionName)).toString();
+  }
+
+  /**
+   * Entry point for running the generator from the command
+   * line.  Users can specify either "make-class" or "make-resource"
+   * as the first argument to generate the specified type of file.
+   *
+   * @param args the command-line arguments.
+   * @throws FileNotFoundException if the input file can not be found.
+   * @throws IOException if an I/O error occurs.
+   */
+  public static void main(String[] args)
+    throws FileNotFoundException, IOException
+  {
+    if (args.length < 3)
+      {
+        System.err.println("(make-class|make-resource) <input file> <output dir>");
+        System.exit(-1);
+      }
+    if (args[0].equals("make-class"))
+      new MC().makeClass(args[1], args[2]);
+    else if (args[0].equals("make-resource"))
+      new MC().makeResource(args[1], args[2]);
+    else
+      System.err.println("Invalid command: " + args[0]);
+  }
+
+}
Binary file corba/src/share/classes/com/sun/tools/corba/se/logutil/lib/jscheme.jar has changed
Binary file corba/src/share/classes/com/sun/tools/corba/se/logutil/lib/jschemelogutil.jar has changed
--- a/corba/src/share/classes/com/sun/tools/corba/se/logutil/scripts/mc	Thu Apr 02 10:49:41 2009 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,2 +0,0 @@
-#! /bin/sh
-java -cp lib/jscheme.jar:lib/util.jar jscheme.REPL mc.scm -main main $@
--- a/corba/src/share/classes/com/sun/tools/corba/se/logutil/scripts/mc.scm	Thu Apr 02 10:49:41 2009 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,662 +0,0 @@
-; Scheme program to produce CORBA standard exceptions class
-; requires Jscheme Java extensions
-; Makes use of some custom Java classes also
-
-(import "com.sun.tools.corba.se.logutil.IndentingPrintWriter" ) 
-(import "com.sun.tools.corba.se.logutil.StringUtil" ) 
-(import "java.io.FileOutputStream")
-
-(define version-string "1.3")
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; Utility functions
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
-; reload this file (convenience definition)
-(define (reload) (load "mc.scm"))
-
-; Simple little function to report an error
-(define (error msg)
-    (throw (Error. msg)))
-
-; some debug support
-(define debug #f)
-
-(define (dprint msg)
-    (if debug
-	(.println System.out$ msg)))
-
-; Replace dprint with noprint to avoid seeing messages when debug is #t
-(define (noprint msg) ())
-
-; Helper function present so that a scheme method taking strings as args 
-; can be easily run from a command line.
-; arg:	    vector containing argument strings. Element 0 is the function name
-;	    to execute
-(define (main arg)
-    (let*
-	(
-	    (arg-list (vector->list arg))
-	    (function-symbol (string->symbol (car arg-list)))
-	    (args (cdr arg-list)))
-	(apply (eval function-symbol) args)))
-
-; Returns the position of key in lst, numbering from 0.  key is matched using eqv?
-(define (get-list-position key lst)
-    (letrec
-	(
-	    (helper (lambda (k l accum)
-		(cond 
-		    ((null? l) (error (string-append "Could not find " k)))
-		    ((eqv? k (car l)) accum)
-		    (else (helper k (cdr l) (+ accum 1))) ))))
-	(begin 
-	    (noprint (string-append "get-list-position called with key " key " lst " lst ))
-	    (helper key lst 0))))
-
-; Return a string representing number in decimal padded to length with leading 0s.
-(define (pad-number-string number length)
-    (let*
-	(
-	    (number-string (number->string number))
-	    (pad-length (- length (string-length number-string)))
-	)
-	(string-append (make-string pad-length #\0) number-string)))
-
-; Read an S-expression from a file that contains all of the data.
-;
-; The S-expression used for minor codes must have the structure
-;   (package-name class-name exception-group-name
-;	(exception
-;	    (name value level explanation)
-;	    ...
-;	)
-;	...
-;   )
-(define (read-file fname)
-    (read (open-input-file fname)))
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; Functions for handling major system exceptions and exception groups
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
-; Function to find the base ID given an exception group name.  Result is a function that
-; maps the minor code into the Java expression for that minor code's actual value.
-(define (get-base group-name)
-	(if (eqv? group-name 'OMG)
-	    (lambda (minor-code)
-		(string-append "OMGVMCID.value + " (number->string minor-code)))
-	    (let  ; bind base-number outside the lambda so it is only evaluated once
-		(
-		    (base-number (get-sun-base-number group-name)))
-		(lambda (minor-code)
-		    (string-append "SUNVMCID.value + " (number->string (+ base-number minor-code)))))))
-
-; Function to get a base value for the group-name
-(define (get-sun-base-number group-name)
-    (let*
-	(
-	    (lst (list 'SUNBASE 'ORBUTIL 'ACTIVATION 'NAMING 'INTERCEPTORS 'POA 'IOR 'UTIL))
-	    (subsystem-size 200))
-	(* subsystem-size (get-list-position group-name lst))))
-
-; Function to get a 3 digit number for a system exception
-(define (get-exception-id exception-name)
-    (let
-	(
-	    (lst (list 'UNKNOWN 'BAD_PARAM 'NO_MEMORY 'IMP_LIMIT 'COMM_FAILURE 'INV_OBJREF 'NO_PERMISSION 
-		'INTERNAL 'MARSHAL 'INITIALIZE 'NO_IMPLEMENT 'BAD_TYPECODE 'BAD_OPERATION 'NO_RESOURCES 
-		'NO_RESPONSE 'PERSIST_STORE 'BAD_INV_ORDER 'TRANSIENT 'FREE_MEM 'INV_IDENT 'INV_FLAG 
-		'INTF_REPOS 'BAD_CONTEXT 'OBJ_ADAPTER 'DATA_CONVERSION 'OBJECT_NOT_EXIST 'TRANSACTION_REQUIRED 
-		'TRANSACTION_ROLLEDBACK 'INVALID_TRANSACTION 'INV_POLICY 'CODESET_INCOMPATIBLE 'REBIND 
-		'TIMEOUT 'TRANSACTION_UNAVAILABLE 'BAD_QOS 'INVALID_ACTIVITY 'ACTIVITY_COMPLETED 
-		'ACTIVITY_REQUIRED )))
-	(pad-number-string (get-list-position exception-name lst) 3)))
-
-; Return the message id string for any system exception
-;
-(define (get-message-id exception-type group-name minor)
-    (if (eqv? group-name 'OMG)
-	(get-standard-message-id exception-type minor)
-	(get-sun-message-id exception-type group-name minor)))
-
-; Return the message id string for a particular standard exception
-;
-(define (get-standard-message-id exception-type minor)
-    (string-append 
-	"IOP" 
-	(get-exception-id exception-type) 
-	"0" 
-	(pad-number-string (number->string minor) 4)))
-
-; Return the sun message id for this exception-type, group-name, and minor code.
-(define (get-sun-message-id exception-type group-name minor)
-    (string-append 
-	"IOP" 
-	(get-exception-id exception-type) 
-	"1"
-	(pad-number-string (+ (get-sun-base-number group-name) minor) 4)))
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-; visitor framework for the input file format
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
-(define (visit-top obj func1)
-    (let*
-	(
-	    (package (car obj))
-	    (class (cadr obj))
-	    (group (caddr obj))
-	    (func2 (func1 package class group))
-	    (exceptions (cadddr obj)))
-	(visit-exceptions exceptions func2)))
-
-; visit the elements of an arbitrary list
-; lst:		the list to visit
-; func:		the function to apply to each element of lst
-; next-level	the function on lst element and func that visits the next level
-(define (visit-list lst func next-level)
-    (if (null? (cdr lst))
-	(next-level #t (car lst) func)
-	(begin
-	    (next-level #f (car lst) func)
-	    (visit-list (cdr lst) func next-level))))
-
-(define (visit-exceptions exceptions func2)
-    (visit-list exceptions func2 (lambda (last-flag element func) (visit-exception last-flag element func))))
-
-(define (visit-exception last-flag exception func2)
-    (let*
-	(
-	    (major (car exception))
-	    (minor-codes (cdr exception))
-	    (func3 (func2 last-flag major)))
-	(visit-minor-codes minor-codes func3)))
-
-(define (visit-minor-codes minor-codes func3)
-    (visit-list minor-codes func3 (lambda (last-flag element func) (visit-minor-code last-flag element func))))
-
-(define (visit-minor-code last-flag minor-code func3)
-    (let*   
-	(
-	    (name (car minor-code))
-	    (minor (cadr minor-code))
-	    (level (caddr minor-code))
-	    (msg (cadddr minor-code)))
-	(func3 last-flag name minor level msg)))
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; The visitors
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
-; A simple visitor that just echoes the input for test purposes
-(define (simple-visitor package class group)
-    (let* 
-	(
-	    (pw (IndentingPrintWriter. System.out$)))
-	(begin
-	    (.indent pw)
-	    (.printMsg pw "package=@ class=@ group=@" (list package class group))
-	    (.flush pw)
-	    (lambda (last-flag major)
-		(begin
-		    (.indent pw)
-		    (.printMsg pw "major=@" (list major))
-		    (.flush pw)
-		    (lambda (last-flag name minor level message)
-			(begin
-			    (if last-flag (.undent pw))
-			    (.printMsg pw "name=@ minor=@ level=@ message=@" (list name minor level message))
-			    (.flush pw))))))))
-
-; Function that returns a visitor that writes out the resource file in the form:
-;   id="MSGID: explanation"
-; outdir: Output directory 
-(define (resource-visitor outdir)
-    (lambda (package class group)
-	(let* 
-	    (
-		(file-name (string-append outdir java.io.File.separator$ class ".resource"))
-		(pw (IndentingPrintWriter. (FileOutputStream. file-name))))
-	    (begin 
-		(dprint (string-append "package= " package " class=" class " group=" group " file-name=" file-name))
-		(lambda (last-flag1 major)
-		    (begin
-			; (dprint (string-append "last-flag1=" last-flag1 " major=" major))
-			(lambda (last-flag2 name minor level message)
-			    (begin
-				; (dprint (string-append "last-flag2=" last-flag2 " name=" name 
-				    ; " minor=" minor " level=" level " message=" message))
-				(let*
-				    (
-					(msgid (get-message-id major group minor))
-					(ident (StringUtil.toMixedCase (symbol->string name))))
-				    (begin
-					; (dprint (string-append "msgid=" msgid " ident=" ident))
-					(.printMsg pw "@.@=\"@: (@) @\"" (list group ident msgid major message))
-					(.flush pw)
-					(if (and last-flag1 last-flag2) 
-					    (begin
-						; (dprint "closing file")
-						(.close pw)))))))))))))
-
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; Top-level functions for creating the products.  All have names of the form make-xxx
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
-; Read the minor codes from the infile and write out a resource file. 
-(define (make-resource infile outdir)
-    (tryCatch 
-	(visit-top (read-file infile) (resource-visitor outdir))
-	(lambda (exc) 
-	    (begin
-		(.println System.out$ (string-append "make-resource failed with exception " (.toString exc)))
-		(System.exit 1)))))
-
-; Read the minor codes from the infile and write a Java implementation to
-; handle them to outfile under outdir
-(define (make-class infile outdir)
-    (tryCatch 
-	(write-class infile outdir (read-file infile))
-	(lambda (exc) 
-	    (begin
-		(.println System.out$ (string-append "make-class failed with exception " (.toString exc)))
-		(System.exit 1)))))
-	
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; The original make-class implementation (this should be replaced by two visitors)
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
-; Write out the Java source code for the StandardExceptions class
-; outdir:  Output directory to write the generated files
-; obj:	    the data from the input file
-(define (write-class infile outdir obj)
-    (let* 
-	( 
-	    (package-name (car obj))
-	    (class-name (cadr obj))
-	    (exception-group-name (caddr obj))
-	    (exceptions (cadddr obj))
-	    (file (FileOutputStream. (string-append outdir java.io.File.separator$  class-name ".java")))  
-	    (pw   (IndentingPrintWriter. file))
-	)
-	(begin
-	    (write-class-header infile package-name class-name exception-group-name pw)
-	    (.printMsg pw "package @ ;"
-		(list package-name))
-	    (.println pw)
-	    (.println pw "import java.util.logging.Logger ;")
-	    (.println pw "import java.util.logging.Level ;")
-	    (.println pw)
-	    (.println pw "import org.omg.CORBA.OMGVMCID ;")
-	    (.println pw "import com.sun.corba.se.impl.util.SUNVMCID ;")
-	    (.println pw "import org.omg.CORBA.CompletionStatus ;")
-	    (.println pw "import org.omg.CORBA.SystemException ;")
-	    (.println pw)
-	    (.println pw "import com.sun.corba.se.spi.orb.ORB ;")
-	    (.println pw)
-	    (.println pw "import com.sun.corba.se.spi.logging.LogWrapperFactory;")
-	    (.println pw)
-	    (.println pw "import com.sun.corba.se.spi.logging.LogWrapperBase;")
-	    (.println pw)
-	    (write-imports exceptions pw)
-	    (.println pw)
-	    (.indent pw)
-	    (.printMsg pw "public class @ extends LogWrapperBase {"
-		(list class-name))
-	    (.println pw)
-	    (.printMsg pw "public @( Logger logger )"
-		(list class-name))
-	    (.indent pw)
-	    (.println pw "{")
-	    (.undent pw)
-	    (.println pw "super( logger ) ;")
-	    (.println pw "}")
-	    (.println pw)
-	    (.flush pw)
-	    (write-factory-method class-name exception-group-name pw)
-	    (write-exceptions exception-group-name exceptions (get-base exception-group-name) class-name pw)
-	    (.undent pw)
-	    (.println pw )
-	    (.println pw "}")
-	    (.flush pw)
-	    (.close pw)
-	)))
-
-; Write out the header for the resource file
-(define (write-class-header infile package class group pw)
-    (begin
-	(if (eqv? group 'OMG)
-	    (.println pw "// Log wrapper class for standard exceptions")
-	    (.printMsg pw "// Log wrapper class for Sun private system exceptions in group @" (list group)))
-	(.println pw "//")
-	(.printMsg pw "// Generated by mc.scm version @, DO NOT EDIT BY HAND!" (list version-string))
-	(.printMsg pw "// Generated from input file @ on @" (list infile (java.util.Date.)))
-	(.println pw)))
-
-(define (write-factory-method class-name exception-group-name pw)
-    (begin
-	(.indent pw)
-	(.println pw "private static LogWrapperFactory factory = new LogWrapperFactory() {")
-	(.println pw "public LogWrapperBase create( Logger logger )" )
-	(.indent pw)
-	(.println pw "{")
-	(.undent pw)
-	(.printMsg pw "return new @( logger ) ;" (list class-name))
-	(.undent pw)
-	(.println pw "}" )
-	(.println pw "} ;" )
-	(.println pw)
-	(.printMsg pw "public static @ get( ORB orb, String logDomain )" (list class-name))
-	(.indent pw)	
-	(.println pw "{")
-	(.indent pw)	
-	(.printMsg pw "@ wrapper = "
-	    (list class-name))
-	(.indent pw)
-	(.printMsg pw "(@) orb.getLogWrapper( logDomain, " 
-	    (list class-name))
-	(.undent pw)	
-	(.undent pw)	
-	(.printMsg pw "\"@\", factory ) ;" 
-	    (list exception-group-name))
-	(.undent pw)	
-	(.println pw "return wrapper ;" )
-	(.println pw "} " )
-	(.println pw)
-	(.printMsg pw "public static @ get( String logDomain )" (list class-name))
-	(.indent pw)	
-	(.println pw "{")
-	(.indent pw)	
-	(.printMsg pw "@ wrapper = "
-	    (list class-name))
-	(.indent pw)
-	(.printMsg pw "(@) ORB.staticGetLogWrapper( logDomain, " 
-	    (list class-name))
-	(.undent pw)	
-	(.undent pw)	
-	(.printMsg pw "\"@\", factory ) ;" 
-	    (list exception-group-name))
-	(.undent pw)	
-	(.println pw "return wrapper ;" )
-	(.println pw "} " )
-	(.println pw)))
-
-; Write out the import list for the exceptions listed in obj
-; obj:	    the data from the input file
-; pw:	    an IndentingPrintWriter for the output file
-(define (write-imports obj pw)
-    (if (null? obj)
-	()
-	(let 
-	    (
-		(exception (caar obj))
-	    )
-	    (begin
-		(.print pw "import org.omg.CORBA.")
-		(.print pw exception)
-		(.println pw " ;")
-		(write-imports (cdr obj) pw)
-	    ))))
-
-; Write out the list of exceptions starting with the first one
-; obj:	    the data from the input file
-; base:	    the lambda that returns the string defining the minor code value
-; pw:	    an IndentingPrintWriter for the output file
-(define (write-exceptions group-name obj base class-name pw)
-    (if (null? obj) 
-	()
-	(let* 
-	    (
-		(record (car obj))
-		(exception (car record))
-	        (minor-codes (cdr record))
-	    )
-	    (begin
-		(write-exception group-name exception minor-codes base class-name pw)
-		(write-exceptions group-name (cdr obj) base class-name pw)
-	    ))))
-
-; Write out a single exception
-; exception:	the CORBA SystemException type
-; base:		the base for the minor code value
-; minor-codes:	a list of minor code data for each minor exception type
-; pw:		an IndentingPrintWriter for the output file
-(define (write-exception group-name exception minor-codes base class-name pw)
-    (begin
-	(.println pw "///////////////////////////////////////////////////////////")
-	(.printMsg pw "// @" (list exception))
-	(.println pw "///////////////////////////////////////////////////////////")
-	(.println pw)
-	(write-methods group-name exception minor-codes base class-name pw)
-	(.flush pw)))
-
-; Write all of the methods for a single exception
-; exception:	the CORBA SystemException type
-; base:		the base for the minor code value
-; minor-codes:	a list of minor code data for each minor exception type
-; pw:		an IndentingPrintWriter for the output file
-(define (write-methods group-name exception minor-codes base class-name pw)
-    (if (null? minor-codes)
-	()
-	(begin
-	    (write-method group-name exception (car minor-codes) base class-name pw)
-	    (write-methods group-name exception (cdr minor-codes) base class-name pw)
-	)))
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; Code that writes out the Java methods for exception handling
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
-; Write the methods for a single minor code within an exception
-; exception:	the CORBA SystemException type
-; minor-code:	minor code data for one minor exception type 
-;		(name value level explanation)
-; base:		the base for the minor code value
-; pw:		an IndentingPrintWriter for the output file
-(define (write-method group-name exception minor-code base class-name pw)
-    (let* 
-	(
-	    (x (symbol->string (car minor-code)))
-	    (ident (cons x (StringUtil.toMixedCase x)))
-	    (value (cadr minor-code))
-	    (level (symbol->string (caddr minor-code)))
-	    (explanation (cadddr minor-code))
-	    (num-params (StringUtil.countArgs explanation)))
-	(begin
-	    (.printMsg pw "public static final int @ = @ ;"
-		(list x (base value)))
-	    (.println pw )
-	    (.flush pw )
-	    (write-method-status-cause group-name exception ident level num-params class-name pw)
-	    (.println pw)
-	    (.flush pw)
-	    (write-method-status exception ident level num-params pw)
-	    (.println pw)
-	    (.flush pw)
-	    (write-method-cause exception ident level num-params pw)
-	    (.println pw)
-	    (.flush pw)
-	    (write-method-no-args exception ident level num-params pw)
-	    (.println pw)
-	    (.flush pw))))
-
-; Construct a string of the form arg1, ..., argn where n is num-params
-(define (make-arg-string fixed leading-comma-flag num-args)
-    (let
-	(
-	    (helper (lambda (lcf n)
-		(let*
-		    (
-			(numstr (number->string (- n 1))))
-		    (if (or lcf (> n 1))
-			(string-append ", " fixed numstr)
-			(string-append " " fixed numstr))))))
-	(cond 
-	    ((eqv? num-args 0) " ")
-	    ((eqv? num-args 1) (helper leading-comma-flag 1))
-	    (else (string-append 
-		(make-arg-string fixed leading-comma-flag (- num-args 1)) 
-		(helper leading-comma-flag num-args ))))))
-
-(define (make-decl-args leading-comma-flag num-args)
-    (make-arg-string "Object arg" leading-comma-flag num-args))
-
-(define (make-call-args leading-comma-flag num-args)
-    (make-arg-string "arg" leading-comma-flag num-args))
-
-; make-xxx-args patterns:
-; leading-comma-flag #t
-;
-;   0   " "
-;   1   ", arg0"
-;   2   ", arg0, arg1"
-;   3   ", arg0, arg1, arg2"
-;
-;   0   " "
-;   1   ", Object arg0"
-;   2   ", Object arg0, Object arg1"
-;   3   ", Object arg0, Object arg1, Object arg2"
-;
-; leading-comma-flag #f
-;
-;   0   " "
-;   1   " arg0"
-;   2   " arg0, arg1"
-;   3   " arg0, arg1, arg2"
-;
-;   0   " "
-;   1   " Object arg0"
-;   2   " Object arg0, Object arg1"
-;   3   " Object arg0, Object arg1, Object arg2"
-
-(define (emit-assignments num pw)
-    (let 
-	(
-	    (helper 
-		(lambda (n) 
-		    (.printMsg pw "parameters[@] = arg@ ;" (list n n)))))
-	(if (= num 1)
-	    (helper (- num 1))
-	    (begin
-		(emit-assignments (- num 1) pw)
-		(helper (- num 1))))))
-
-; Write a method for an exception that takes a CompletionStatus and a cause
-; exception:	the CORBA system exception type
-; id:		the identifier for this exception in the form ( ident . mixed-case-ident )
-; level:	the logging level
-; num-params:	number of parameters in the explanation string, which determines
-;		how many argn parameters we need
-; pw:		the indenting print writer we are using
-(define (write-method-status-cause group-name exception id level num-params class-name pw)
-    (let*
-	(
-	    (ident (car id))
-	    (ident-mc (cdr id)))
-    (begin
-	(.indent pw)
-	(.printMsg pw "public @ @( CompletionStatus cs, Throwable t@) {"
-	    (list exception ident-mc (make-decl-args #t num-params)))
-	(.printMsg pw "@ exc = new @( @, cs ) ;"
-	    (list exception exception ident ))
-
-	(.indent pw)
-	(.println pw "if (t != null)" )
-	(.undent pw)
-	(.println pw "exc.initCause( t ) ;" )	
-	(.println pw)
-
-	(.indent pw)
-	(.printMsg pw "if (logger.isLoggable( Level.@ )) {"
-	    (list level))
-	
-	(if (> num-params 0)
-	    (begin
-		(.printMsg pw "Object[] parameters = new Object[@] ;"
-		    (list (number->string num-params)))
-		(emit-assignments num-params pw)
-	    )
-	    (begin
-		(.println pw "Object[] parameters = null ;"
-	    )))
-
-	(.indent pw)
-	(.printMsg pw "doLog( Level.@, \"@.@\"," (list level group-name ident-mc))
-	(.undent pw)
-	(.undent pw)
-	(.printMsg pw "parameters, @.class, exc ) ;" (list class-name))
-	(.println pw "}")
-	(.println pw)
-
-	(.undent pw)
-	(.println pw "return exc ;")
-
-	(.println pw "}"))))
-
-; Write a method for an exception that takes a CompletionStatus.  The cause is null. 
-;
-; exception:	the CORBA system exception type
-; id:		the identifier for this exception in the form ( ident . mixed-case-ident )
-; level:	the logging level
-; num-params:	number of parameters in the explanation string, which determines
-;		how many argn parameters we need
-; pw:		the indenting print writer we are using
-(define (write-method-status exception id level num-params pw)
-    (let*
-	(
-	    (ident-mc (cdr id)))
-	(begin
-	    (.indent pw)
-	    (.printMsg pw "public @ @( CompletionStatus cs@) {"
-		(list exception ident-mc (make-decl-args #t num-params)))
-	    (.undent pw)
-	    (.printMsg pw "return @( cs, null@ ) ;"
-		(list ident-mc (make-call-args #t num-params)))
-	    (.println pw "}"))))
-
-; Write a method for an exception that takes a cause.  The status is COMPLETED_NO. 
-;
-; exception:	the CORBA system exception type
-; id:		the identifier for this exception in the form ( ident . mixed-case-ident )
-; level:	the logging level
-; num-params:	number of parameters in the explanation string, which determines
-;		how many argn parameters we need
-; pw:		the indenting print writer we are using
-(define (write-method-cause exception id level num-params pw)
-    (let*
-	(
-	    (ident-mc (cdr id)))
-	(begin
-	    (.indent pw)
-	    (.printMsg pw "public @ @( Throwable t@) {"
-		(list exception ident-mc (make-decl-args #t num-params)))
-	    (.undent pw)
-	    (.printMsg pw "return @( CompletionStatus.COMPLETED_NO, t@ ) ;"
-		(list ident-mc (make-call-args #t num-params)))
-	    (.println pw "}"))))
-
-; Write a method for an exception that takes no arguments.  This is COMPLETED_NO and
-; a null cause.
-;
-; exception:	the CORBA system exception type
-; id:		the identifier for this exception in the form ( ident . mixed-case-ident )
-; level:	the logging level
-; num-params:	number of parameters in the explanation string, which determines
-;		how many argn parameters we need
-; pw:		the indenting print writer we are using
-(define (write-method-no-args exception id level num-params pw)
-    (let*
-	(
-	    (ident-mc (cdr id)))
-	(begin
-	    (.indent pw)
-	    (.printMsg pw "public @ @( @) {"
-		(list exception ident-mc (make-decl-args #f num-params)))
-	    (.undent pw)
-	    (.printMsg pw "return @( CompletionStatus.COMPLETED_NO, null@ ) ;"
-		(list ident-mc (make-call-args #t num-params)))
-	    (.println pw "}"))))
-
-;;; end of file
--- a/corba/src/share/classes/com/sun/tools/corba/se/logutil/scripts/run	Thu Apr 02 10:49:41 2009 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,2 +0,0 @@
-#! /bin/sh
-java -cp ${CLASSPATH}:lib/jscheme.jar:lib/util.jar jscheme.REPL mc.scm
--- a/hotspot/.hgtags	Thu Apr 02 10:49:41 2009 -0700
+++ b/hotspot/.hgtags	Thu Apr 02 17:01:00 2009 -0700
@@ -26,3 +26,4 @@
 8b22ccb5aba2c6c11bddf6488a7bb7ef5b4bf2be jdk7-b49
 dae503d9f04c1a11e182dbf7f770509c28dc0609 jdk7-b50
 2581d90c6c9b2012da930eb4742add94a03069a0 jdk7-b51
+1b1e8f1a4fe8cebc01c022484f78148e17b62a0d jdk7-b52
--- a/jaxp/.hgtags	Thu Apr 02 10:49:41 2009 -0700
+++ b/jaxp/.hgtags	Thu Apr 02 17:01:00 2009 -0700
@@ -26,3 +26,4 @@
 5c1f24531903573c1830775432276da567243f9c jdk7-b49
 e8514e2be76d90889ebdb90d627aca2db5c150c6 jdk7-b50
 ae890d80d5dffcd4dc77a1f17d768e192d1852c7 jdk7-b51
+69ad87dc25cbcaaaded4727199395ad0c78bc427 jdk7-b52
--- a/jaxp/make/jprt.config	Thu Apr 02 10:49:41 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/jaxws/.hgtags	Thu Apr 02 10:49:41 2009 -0700
+++ b/jaxws/.hgtags	Thu Apr 02 17:01:00 2009 -0700
@@ -26,3 +26,4 @@
 18ca864890f3d4ed942ecbffb78c936a57759921 jdk7-b49
 5be52db581f1ea91ab6e0eb34ba7f439125bfb16 jdk7-b50
 41a66a42791ba90bff489af72cbfea71be9b40a5 jdk7-b51
+e646890d18b770f625f14ed4ad5c50554d8d3d8b jdk7-b52
--- a/jaxws/make/jprt.config	Thu Apr 02 10:49:41 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/jdk/.hgtags	Thu Apr 02 10:49:41 2009 -0700
+++ b/jdk/.hgtags	Thu Apr 02 17:01:00 2009 -0700
@@ -26,3 +26,4 @@
 8311105ea7a3db7bcbcb2b696459127c7f2297a4 jdk7-b49
 58ba2cd5a25053684ec53205d95edeeaa0006f13 jdk7-b50
 fea0898259ae41c73620b1815aa48f036216155c jdk7-b51
+bcbeadb4a5d759b29e876ee2c83401e91ff22f60 jdk7-b52
--- a/jdk/THIRD_PARTY_README	Thu Apr 02 10:49:41 2009 -0700
+++ b/jdk/THIRD_PARTY_README	Thu Apr 02 17:01:00 2009 -0700
@@ -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: 
--- a/jdk/make/com/sun/jmx/Makefile	Thu Apr 02 10:49:41 2009 -0700
+++ b/jdk/make/com/sun/jmx/Makefile	Thu Apr 02 17:01:00 2009 -0700
@@ -41,7 +41,15 @@
 # Note : some targets are double colon rules and some single colon rules
 # within common included gmk files : that is why the following for loop
 # has been duplicated.
-SUBDIRS = snmp
+
+# When building the openjdk, build snmp only if importing binary plugs,
+ifdef OPENJDK
+  ifeq ($(IMPORT_BINARY_PLUGS),true)
+    SUBDIRS = snmp
+  endif
+else
+  SUBDIRS = snmp
+endif
 
 all build:
 	$(SUBDIRS-loop)
--- a/jdk/make/common/Defs.gmk	Thu Apr 02 10:49:41 2009 -0700
+++ b/jdk/make/common/Defs.gmk	Thu Apr 02 17:01:00 2009 -0700
@@ -145,6 +145,11 @@
 #     2. ALT_BINARY_PLUGS_PATH overrides all locations of classes and libraries
 #     3. ALT_BUILD_BINARY_PLUGS_PATH is used to find a ALT_BINARY_PLUGS_PATH
 #     4. ALT_CLOSED_JDK_IMPORT_PATH is used to locate classes and libraries
+#   Note: If any of the ALT_ variables are modified here, it is assumed
+#         that the build should be done with IMPORT_BINARY_PLUGS=true as
+#         well.  Otherwise the default will be IMPORT_BINARY_PLUGS=false.
+#         Lastly, setting IMPORT_BINARY_PLUGS=false on the command line
+#         will override this logic, and plugs will not be imported.
 #
 
 # Always needed, defines the name of the imported/exported jarfile
@@ -155,9 +160,11 @@
     CLOSED_JDK_IMPORT_PATH = $(ALT_CLOSED_JDK_IMPORT_PATH)
     BINARY_PLUGS_PATH = $(CLOSED_JDK_IMPORT_PATH)
     BINARY_PLUGS_JARFILE = $(CLOSED_JDK_IMPORT_PATH)/jre/lib/rt.jar
+    IMPORT_BINARY_PLUGS=true
   endif
   ifdef ALT_BUILD_BINARY_PLUGS_PATH
     BUILD_BINARY_PLUGS_PATH = $(ALT_BUILD_BINARY_PLUGS_PATH)
+    IMPORT_BINARY_PLUGS=true
   else
     BUILD_BINARY_PLUGS_PATH = $(SLASH_JAVA)/re/jdk/$(JDK_VERSION)/promoted/latest/openjdk/binaryplugs
   endif
@@ -166,9 +173,11 @@
   ifdef ALT_BINARY_PLUGS_PATH
     BINARY_PLUGS_PATH  = $(ALT_BINARY_PLUGS_PATH)
     BINARY_PLUGS_JARFILE = $(BINARY_PLUGS_PATH)/jre/lib/$(BINARY_PLUGS_JARNAME)
+    IMPORT_BINARY_PLUGS=true
   endif
   ifdef ALT_BINARY_PLUGS_JARFILE
     BINARY_PLUGS_JARFILE = $(ALT_BINARY_PLUGS_JARFILE)
+    IMPORT_BINARY_PLUGS=true
   endif
 endif # OPENJDK
 
--- a/jdk/make/common/shared/Platform.gmk	Thu Apr 02 10:49:41 2009 -0700
+++ b/jdk/make/common/shared/Platform.gmk	Thu Apr 02 17:01:00 2009 -0700
@@ -229,11 +229,19 @@
   TEMP_DISK=C:/temp
   # GNU Make or MKS overrides $(PROCESSOR_ARCHITECTURE) to always
   # return "x86". Use the first word of $(PROCESSOR_IDENTIFIER) instead.
+  PROC_ARCH:=$(word 1, $(PROCESSOR_IDENTIFIER))
+  PROC_ARCH:=$(subst x86,X86,$(PROC_ARCH))
+  PROC_ARCH:=$(subst Intel64,X64,$(PROC_ARCH))
+  PROC_ARCH:=$(subst em64t,X64,$(PROC_ARCH))
+  PROC_ARCH:=$(subst EM64T,X64,$(PROC_ARCH))
+  PROC_ARCH:=$(subst amd64,X64,$(PROC_ARCH))
+  PROC_ARCH:=$(subst AMD64,X64,$(PROC_ARCH))
+  PROC_ARCH:=$(subst ia64,IA64,$(PROC_ARCH))
   ifndef ARCH_DATA_MODEL
-    ifeq ($(word 1, $(PROCESSOR_IDENTIFIER)),ia64)
+    ifeq ($(PROC_ARCH),IA64)
       ARCH_DATA_MODEL=64
     else
-      ifeq ($(word 1, $(PROCESSOR_IDENTIFIER)),AMD64)
+      ifeq ($(PROC_ARCH),X64)
         ARCH_DATA_MODEL=64
       else
         ARCH_DATA_MODEL=32
@@ -245,10 +253,12 @@
     # If the user wants to perform a cross compile build then they must
     # - set ARCH_DATA_MODEL=64 and either
     #      + set ARCH to ia64 or amd64, or
-    ifeq ($(word 1, $(PROCESSOR_IDENTIFIER)), AMD64)
+    ifeq ($(PROC_ARCH),X64)
       ARCH=amd64
     else
-      ARCH=ia64
+      ifeq ($(PROC_ARCH),IA64)
+        ARCH=ia64
+      endif
     endif
     LIBARCH=$(ARCH)
     # Value of Java os.arch property
--- a/jdk/make/common/shared/Sanity-Settings.gmk	Thu Apr 02 10:49:41 2009 -0700
+++ b/jdk/make/common/shared/Sanity-Settings.gmk	Thu Apr 02 17:01:00 2009 -0700
@@ -245,6 +245,7 @@
   ALL_SETTINGS+=$(call addAltSetting,FREETYPE_HEADERS_PATH)
   ALL_SETTINGS+=$(call addAltSetting,FREETYPE_LIB_PATH)
   ALL_SETTINGS+=$(call addHeading,OPENJDK Import Binary Plug Settings)
+  ALL_SETTINGS+=$(call addOptionalSetting,IMPORT_BINARY_PLUGS)
   ALL_SETTINGS+=$(call addAltSetting,BINARY_PLUGS_JARFILE)
   ALL_SETTINGS+=$(call addAltSetting,BINARY_PLUGS_PATH)
   ALL_SETTINGS+=$(call addAltSetting,BUILD_BINARY_PLUGS_PATH)
--- a/jdk/make/common/shared/Sanity.gmk	Thu Apr 02 10:49:41 2009 -0700
+++ b/jdk/make/common/shared/Sanity.gmk	Thu Apr 02 17:01:00 2009 -0700
@@ -502,13 +502,15 @@
 ######################################################
 ifdef OPENJDK
 sane-binary-plugs:
+  ifeq ($(IMPORT_BINARY_PLUGS),true)
 	@if [ ! -d "$(BINARY_PLUGS_PATH)" ]; then \
-	  $(ECHO) "ERROR: Can't locate pre-built libraries. \n" \
+	  $(ECHO) "WARNING: Can't locate pre-built libraries. \n" \
 	    "      Please check your access to \n" \
 	    "          $(BINARY_PLUGS_PATH) \n" \
 	    "      and/or check your value of ALT_BINARY_PLUGS_PATH. \n" \
-	   "" >> $(ERROR_FILE); \
+	   "" >> $(WARNING_FILE); \
 	fi
+  endif
 endif
 
 ######################################################
--- a/jdk/make/docs/Makefile	Thu Apr 02 10:49:41 2009 -0700
+++ b/jdk/make/docs/Makefile	Thu Apr 02 17:01:00 2009 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright 1997-2008 Sun Microsystems, Inc.  All Rights Reserved.
+# Copyright 1997-2009 Sun Microsystems, Inc.  All Rights Reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -204,6 +204,9 @@
 JDI_HEADER      = "Java Debug Interface"
 # JDI_PKGS is located in NON_CORE_PKGS.gmk
 
+# Variables used by security components
+SECURITYAPI_JAVADOCBOTTOM = '<font size="-1"><a href="http://bugs.sun.com/services/bugreport/index.jsp">Report a bug or request a feature.</a><br>Copyright $(THIS_YEAR) Sun Microsystems, Inc. All Rights Reserved. Use is subject to license terms.</font>'
+
 #
 # Variables used by JAAS target
 #
@@ -221,6 +224,7 @@
                    -windowtitle $(JAAS_WINDOWTITLE)              \
                    -doctitle $(JAAS_DOCTITLE)                    \
                    -header $(JAAS_JAVADOCHEADER)                 \
+                   -bottom $(SECURITYAPI_JAVADOCBOTTOM)                      \
                    -linkoffline ../../../../../api $(DOCSDIR)/api/	 \
                    -overview $(TOPDIR)/src/share/classes/com/sun/security/auth/jaas-overview.html
 JAAS_WINDOWTITLE = "Java Authentication and Authorization Service "
@@ -243,6 +247,7 @@
                    -windowtitle $(JGSS_WINDOWTITLE)             \
                    -doctitle $(JGSS_DOCTITLE)                   \
                    -header $(JGSS_JAVADOCHEADER)                \
+                   -bottom $(SECURITYAPI_JAVADOCBOTTOM)                      \
                    -linkoffline ../../../../../api $(DOCSDIR)/api/ \
                    -overview $(JGSS_SOURCEPATH)/com/sun/security/jgss/jgss-overview.html
 
@@ -266,6 +271,7 @@
                    -windowtitle $(SMARTCARDIO_WINDOWTITLE)             \
                    -doctitle $(SMARTCARDIO_DOCTITLE)                   \
                    -header $(SMARTCARDIO_JAVADOCHEADER)                \
+                   -bottom $(SECURITYAPI_JAVADOCBOTTOM)                      \
                    -linkoffline ../../../../../api $(DOCSDIR)/api/
 
 SMARTCARDIO_WINDOWTITLE = "Java Smart Card I/O"
--- a/jdk/make/java/java/FILES_java.gmk	Thu Apr 02 10:49:41 2009 -0700
+++ b/jdk/make/java/java/FILES_java.gmk	Thu Apr 02 17:01:00 2009 -0700
@@ -449,7 +449,6 @@
     sun/misc/Service.java \
     sun/misc/JavaLangAccess.java \
     sun/misc/JavaIOAccess.java \
-    sun/misc/JavaIODeleteOnExitAccess.java \
     sun/misc/JavaIOFileDescriptorAccess.java \
     sun/misc/JavaNioAccess.java
 
--- a/jdk/make/java/management/Makefile	Thu Apr 02 10:49:41 2009 -0700
+++ b/jdk/make/java/management/Makefile	Thu Apr 02 17:01:00 2009 -0700
@@ -46,6 +46,8 @@
 #
 include FILES_c.gmk
 
+# We don't need snmp here.
+AUTO_JAVA_PRUNE = snmp
 AUTO_FILES_JAVA_DIRS = java/lang/management com/sun/management sun/management
 
 include Exportedfiles.gmk
--- a/jdk/make/java/nio/FILES_java.gmk	Thu Apr 02 10:49:41 2009 -0700
+++ b/jdk/make/java/nio/FILES_java.gmk	Thu Apr 02 17:01:00 2009 -0700
@@ -220,6 +220,8 @@
 	sun/nio/ch/Util.java \
 	\
 	sun/nio/cs/AbstractCharsetProvider.java \
+	sun/nio/cs/ArrayDecoder.java \
+	sun/nio/cs/ArrayEncoder.java \
 	sun/nio/cs/FastCharsetProvider.java \
 	sun/nio/cs/HistoricallyNamedCharset.java \
 	sun/nio/cs/ISO_8859_1.java \
--- a/jdk/make/java/redist/Makefile	Thu Apr 02 10:49:41 2009 -0700
+++ b/jdk/make/java/redist/Makefile	Thu Apr 02 17:01:00 2009 -0700
@@ -251,9 +251,11 @@
 #
 ifdef OPENJDK
 
-include $(BUILDDIR)/common/internal/BinaryPlugs.gmk
+  ifeq ($(IMPORT_BINARY_PLUGS),true)
+    include $(BUILDDIR)/common/internal/BinaryPlugs.gmk
 
-build: import-binary-plugs
+    build: import-binary-plugs
+  endif
 
 else # !OPENJDK
 
--- a/jdk/make/javax/management/Makefile	Thu Apr 02 10:49:41 2009 -0700
+++ b/jdk/make/javax/management/Makefile	Thu Apr 02 17:01:00 2009 -0700
@@ -35,6 +35,7 @@
 #
 # Files to compile
 #
+AUTO_JAVA_PRUNE = snmp
 AUTO_FILES_JAVA_DIRS = javax/management com/sun/jmx com/sun/management/jmx 
 
 #
--- a/jdk/make/jdk_generic_profile.sh	Thu Apr 02 10:49:41 2009 -0700
+++ b/jdk/make/jdk_generic_profile.sh	Thu Apr 02 17:01:00 2009 -0700
@@ -174,7 +174,8 @@
    
   # Check CYGWIN (should have already been done)
   #   Assumption here is that you are in a shell window via cygwin.
-  if [ "$(echo ${PROCESSOR_IDENTIFIER} | fgrep AMD64)" != "" ] ; then
+  proc_arch=`echo "$(PROCESSOR_IDENTIFIER)" | expand | cut -d' ' -f1 | sed -e 's@x86@X86@g' -e 's@Intel64@X64@g' -e 's@em64t@X64@g' -e 's@EM64T@X64@g' -e 's@amd64@X64@g' -e 's@AMD64@X64@g' -e 's@ia64@IA64@g'`
+  if [ "${proc_arch}" = "X64" ] ; then
     windows_arch=amd64
   else
     windows_arch=i586
--- a/jdk/make/jprt.config	Thu Apr 02 10:49:41 2009 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,363 +0,0 @@
-#!echo "This is not a shell script"
-#############################################################################
-#
-# Copyright 2006-2008 Sun Microsystems, Inc.  All Rights Reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.  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
-#    OPENJDK
-#    Windows Only:
-#      PATH
-#      VS71COMNTOOLS
-#      PROCESSOR_IDENTIFIER
-#      ROOTDIR
-#
-# Output variable settings:
-#    make            Full path to GNU make
-#    compiler_path   Path to compiler bin directory
-#    compiler_name   Unique name of this compiler
-#
-# Output environment variables:
-#    PATH
-#    ALT_COMPILER_PATH
-#    OPENJDK only:
-#      ALT_CLOSED_JDK_IMPORT_PATH
-#      ALT_JDK_DEVTOOLS_DIR
-#    Windows Only:
-#      ALT_MSDEVTOOLS_PATH
-#      ALT_DEVTOOLS_PATH (To avoid the C:/UTILS default)
-#      LIB
-#      INCLUDE
-#
-# 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.
-#
-# On Windows AMD64, if MSSDK is not set, assumes Platform SDK is installed at:
-#          C:/Program Files/Microsoft Platform SDK
-#
-#############################################################################
-
-#############################################################################
-# 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}"
-
-# The /java/devtools items
-jdk_devtools="${slashjava}/devtools"
-share="${jdk_devtools}/share"
-
-# Needed for langtools, maybe other parts of the build
-ANT_HOME="${share}/ant/latest"
-export ANT_HOME
-
-# The 3 bin directories in common to all platforms
-sharebin="${share}/bin"
-antbin="${ANT_HOME}/bin"
-
-# Check input
-dirMustExist "${bootdir}"         ALT_BOOTDIR
-dirMustExist "${slashjava}"       ALT_SLASH_JAVA
-dirMustExist "${jdk_import}"      ALT_JDK_IMPORT_PATH
-dirMustExist "${ANT_HOME}"        ANT_HOME
-
-# Use the JDK import for now (FIXME: use the binary plugs?)
-if [ "${OPENJDK}" = true ] ; then
-  ALT_CLOSED_JDK_IMPORT_PATH="${jdk_import}"
-  export ALT_CLOSED_JDK_IMPORT_PATH
-fi
-
-# 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
-
-    # Get the compilers into path (make sure it matches ALT setting)
-    if [ "${JPRT_SOLARIS_COMPILER_NAME}" != "" ] ; then
-        compiler_name=${JPRT_SOLARIS_COMPILER_NAME}
-    else
-	compiler_name=SS12
-    fi
-    compiler_path=${jdk_devtools}/${solaris_arch}/SUNWspro/${compiler_name}/bin
-    ALT_COMPILER_PATH="${compiler_path}"
-    export ALT_COMPILER_PATH
-    dirMustExist "${compiler_path}" ALT_COMPILER_PATH
-    path4sdk=${compiler_path}:${sharebin}:${antbin}
-
-    # Add basic solaris system paths
-    path4sdk=${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}
-
-    # Find GNU make
-    make=/usr/sfw/bin/gmake
-    if [ ! -f ${make} ] ; then
-	make=/opt/sfw/bin/gmake
-	if [ ! -f ${make} ] ; then
-	    make=${jdk_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
-
-    # Get the compilers into path (make sure it matches ALT setting)
-    compiler_path=/usr/bin
-    compiler_name=usr_bin
-    ALT_COMPILER_PATH="${compiler_path}"
-    export ALT_COMPILER_PATH
-    dirMustExist "${compiler_path}" ALT_COMPILER_PATH
-    path4sdk=${compiler_path}:${sharebin}:${antbin}
-    
-    # Add basic paths
-    path4sdk=${path4sdk}:/usr/bin:/bin:/usr/sbin:/sbin
-
-    # Get the previous JDK to be used to bootstrap the build
-    path4sdk=${bootdir}/bin:${path4sdk}
-    
-    # Find GNU make
-    make=/usr/bin/make
-    fileMustExist "${make}" make
-
-    umask 002
-   
-    # Linux platform may be old, use motif files from the devtools area
-    if [ "${OPENJDK}" = true ] ; then
-      ALT_JDK_DEVTOOLS_DIR="${jdk_devtools}"
-      export ALT_JDK_DEVTOOLS_DIR
-    fi
-
-
-else
-
-    # Windows: Differs on CYGWIN vs. MKS, and the compiler available.
-    #   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="${sharebin};${antbin};${unixcommand_path}"
-        dirMustExist "${unixcommand_path}" ALT_UNIXCOMMAND_PATH
-	devtools_path="${jdk_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="${sharebin};${antbin};${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: Compiler setup (nasty part)
-    #   NOTE: You can use vcvars32.bat to set PATH, LIB, and INCLUDE.
-    #   NOTE: CYGWIN has a link.exe too, make sure the compilers are first
-    if [ "${windows_arch}" = i586 ] ; then
-        # 32bit Windows compiler settings
-        # VisualStudio .NET 2003 VC++ 7.1 (VS71COMNTOOLS should be defined)
-        vs_root=`${dosname} "${VS71COMNTOOLS}/../.."`
-        # Fill in PATH, LIB, and INCLUDE (unset all others to make sure)
-        msdev_root="${vs_root}/Common7/Tools"
-        msdevtools_path="${msdev_root}/bin"
-        vc7_root="${vs_root}/Vc7"
-        compiler_path="${vc7_root}/bin"
-        compiler_name=VS2003
-        platform_sdk="${vc7_root}/PlatformSDK"
-        # LIB and INCLUDE must use ; as a separator
-        include4sdk="${vc7_root}/atlmfc/include"
-        include4sdk="${include4sdk};${vc7_root}/include"
-        include4sdk="${include4sdk};${platform_sdk}/include/prerelease"
-        include4sdk="${include4sdk};${platform_sdk}/include"
-        include4sdk="${include4sdk};${vs_root}/SDK/v1.1/include"
-        lib4sdk="${vc7_root}/atlmfc/lib"
-        lib4sdk="${lib4sdk};${vc7_root}/lib"
-        lib4sdk="${lib4sdk};${platform_sdk}/lib/prerelease"
-        lib4sdk="${lib4sdk};${platform_sdk}/lib"
-        lib4sdk="${lib4sdk};${vs_root}/SDK/v1.1/lib"
-        # Search path and DLL locating path
-        #   WARNING: CYGWIN has a link.exe too, make sure compilers are first
-        path4sdk="${vs_root}/Common7/Tools/bin;${path4sdk}"
-	path4sdk="${vs_root}/SDK/v1.1/bin;${path4sdk}"
-        path4sdk="${vs_root}/Common7/Tools;${path4sdk}"
-	path4sdk="${vs_root}/Common7/Tools/bin/prerelease;${path4sdk}"
-        path4sdk="${vs_root}/Common7/IDE;${path4sdk}"
-	path4sdk="${compiler_path};${path4sdk}"
-    elif [ "${windows_arch}" = amd64 ] ; then
-        # AMD64 64bit Windows compiler settings
-	if [ "${MSSDK}" != "" ] ; then
-	    platform_sdk="${MSSDK}"
-	else
-	    platform_sdk=`${dosname} "C:/Program Files/Microsoft Platform SDK/"`
-	fi
-	compiler_path="${platform_sdk}/Bin/win64/x86/AMD64"
-        compiler_name=VS2005_PSDK
-	msdevtools_path="${platform_sdk}/Bin"
-        # LIB and INCLUDE must use ; as a separator
-        include4sdk="${platform_sdk}/Include"
-	include4sdk="${include4sdk};${platform_sdk}/Include/crt/sys"
-	include4sdk="${include4sdk};${platform_sdk}/Include/mfc"
-	include4sdk="${include4sdk};${platform_sdk}/Include/atl"
-	include4sdk="${include4sdk};${platform_sdk}/Include/crt"
-        lib4sdk="${platform_sdk}/Lib/AMD64"
-        lib4sdk="${lib4sdk};${platform_sdk}/Lib/AMD64/atlmfc"
-        # Search path and DLL locating path
-        #   WARNING: CYGWIN has a link.exe too, make sure compilers are first
-        path4sdk="${platform_sdk}/bin;${path4sdk}"
-        path4sdk="${compiler_path};${path4sdk}"
-    fi
-    # Export LIB and INCLUDE
-    unset lib
-    unset Lib
-    LIB="${lib4sdk}"
-    export LIB
-    unset include
-    unset Include
-    INCLUDE="${include4sdk}"
-    export INCLUDE
-    # Set the ALT variable
-    ALT_COMPILER_PATH=`${dosname} "${compiler_path}"`
-    export ALT_COMPILER_PATH
-    dirMustExist "${compiler_path}" ALT_COMPILER_PATH
-    ALT_MSDEVTOOLS_PATH=`${dosname} "${msdevtools_path}"`
-    export ALT_MSDEVTOOLS_PATH
-    dirMustExist "${msdevtools_path}" ALT_MSDEVTOOLS_PATH
-    
-    # WINDOWS: Get the previous JDK to be used to bootstrap the build
-    path4sdk="${bootdir}/bin;${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
-
-    # Set special windows ALT variables
-    ALT_ISHIELDDIR="C:/ishield802"
-    export ALT_ISHIELDDIR
-
-    # Sponsors binaries
-    ALT_SPONSOR1DIR=C:/sponsor_binaries
-    export ALT_SPONSOR1DIR
-    ALT_SPONSOR2DIR=C:/sponsor_binaries 
-    export ALT_SPONSOR2DIR
-
-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/jdk/make/sun/management/Makefile	Thu Apr 02 10:49:41 2009 -0700
+++ b/jdk/make/sun/management/Makefile	Thu Apr 02 17:01:00 2009 -0700
@@ -35,7 +35,16 @@
 
 all build:: properties aclfile jmxremotefiles
 
-SUBDIRS = snmp jmxremote
+# When building the openjdk, build snmp only if importing binary plugs,
+ifdef OPENJDK
+  ifeq ($(IMPORT_BINARY_PLUGS),true)
+    SUBDIRS = snmp
+  endif
+else
+  SUBDIRS = snmp
+endif
+SUBDIRS += jmxremote
+ 
 all build clean clobber::
 	$(SUBDIRS-loop)
 
--- a/jdk/src/share/classes/java/io/Console.java	Thu Apr 02 10:49:41 2009 -0700
+++ b/jdk/src/share/classes/java/io/Console.java	Thu Apr 02 17:01:00 2009 -0700
@@ -503,6 +503,21 @@
 
     // Set up JavaIOAccess in SharedSecrets
     static {
+
+        // Add a shutdown hook to restore console's echo state should
+        // it be necessary.
+        sun.misc.SharedSecrets.getJavaLangAccess()
+            .registerShutdownHook(0 /* shutdown hook invocation order */,
+                new Runnable() {
+                    public void run() {
+                        try {
+                            if (echoOff) {
+                                echo(true);
+                            }
+                        } catch (IOException x) { }
+                    }
+                });
+
         sun.misc.SharedSecrets.setJavaIOAccess(new sun.misc.JavaIOAccess() {
             public Console console() {
                 if (istty()) {
@@ -513,20 +528,6 @@
                 return null;
             }
 
-            // Add a shutdown hook to restore console's echo state should
-            // it be necessary.
-            public Runnable consoleRestoreHook() {
-                return new Runnable() {
-                    public void run() {
-                        try {
-                            if (echoOff) {
-                                echo(true);
-                            }
-                        } catch (IOException x) {}
-                    }
-                };
-            }
-
             public Charset charset() {
                 // This method is called in sun.security.util.Password,
                 // cons already exists when this method is called
--- a/jdk/src/share/classes/java/io/DeleteOnExitHook.java	Thu Apr 02 10:49:41 2009 -0700
+++ b/jdk/src/share/classes/java/io/DeleteOnExitHook.java	Thu Apr 02 17:01:00 2009 -0700
@@ -34,17 +34,18 @@
  */
 
 class DeleteOnExitHook {
-    private static DeleteOnExitHook instance = null;
+    static {
+         sun.misc.SharedSecrets.getJavaLangAccess()
+             .registerShutdownHook(2 /* Shutdown hook invocation order */,
+                 new Runnable() {
+                     public void run() {
+                        runHooks();
+                     }
+                 });
+    }
 
     private static LinkedHashSet<String> files = new LinkedHashSet<String>();
 
-    static DeleteOnExitHook hook() {
-        if (instance == null)
-            instance = new DeleteOnExitHook();
-
-        return instance;
-    }
-
     private DeleteOnExitHook() {}
 
     static synchronized void add(String file) {
@@ -54,7 +55,7 @@
         files.add(file);
     }
 
-    void run() {
+    static void runHooks() {
         LinkedHashSet<String> theFiles;
 
         synchronized (DeleteOnExitHook.class) {
--- a/jdk/src/share/classes/java/io/File.java	Thu Apr 02 10:49:41 2009 -0700
+++ b/jdk/src/share/classes/java/io/File.java	Thu Apr 02 17:01:00 2009 -0700
@@ -2147,18 +2147,6 @@
     /** use serialVersionUID from JDK 1.0.2 for interoperability */
     private static final long serialVersionUID = 301077366599181567L;
 
-    // Set up JavaIODeleteOnExitAccess in SharedSecrets
-    // Added here as DeleteOnExitHook is package-private and SharedSecrets cannot easily access it.
-    static {
-        sun.misc.SharedSecrets.setJavaIODeleteOnExitAccess(
-            new sun.misc.JavaIODeleteOnExitAccess() {
-                public void run() {
-                    DeleteOnExitHook.hook().run();
-                }
-            }
-        );
-    }
-
     // -- Integration with java.nio.file --
 
     private volatile transient Path filePath;
--- a/jdk/src/share/classes/java/lang/ApplicationShutdownHooks.java	Thu Apr 02 10:49:41 2009 -0700
+++ b/jdk/src/share/classes/java/lang/ApplicationShutdownHooks.java	Thu Apr 02 17:01:00 2009 -0700
@@ -34,19 +34,19 @@
  * @see java.lang.Runtime#removeShutdownHook
  */
 
-class ApplicationShutdownHooks implements Runnable {
-    private static ApplicationShutdownHooks instance = null;
+class ApplicationShutdownHooks {
+    static {
+        Shutdown.add(1 /* shutdown hook invocation order */,
+            new Runnable() {
+                public void run() {
+                    runHooks();
+                }
+            });
+    }
 
     /* The set of registered hooks */
     private static IdentityHashMap<Thread, Thread> hooks = new IdentityHashMap<Thread, Thread>();
 
-    static synchronized ApplicationShutdownHooks hook() {
-        if (instance == null)
-            instance = new ApplicationShutdownHooks();
-
-        return instance;
-    }
-
     private ApplicationShutdownHooks() {}
 
     /* Add a new shutdown hook.  Checks the shutdown state and the hook itself,
@@ -82,7 +82,7 @@
      * to run in. Hooks are run concurrently and this method waits for
      * them to finish.
      */
-    public void run() {
+    static void runHooks() {
         Collection<Thread> threads;
         synchronized(ApplicationShutdownHooks.class) {
             threads = hooks.keySet();
--- a/jdk/src/share/classes/java/lang/Shutdown.java	Thu Apr 02 10:49:41 2009 -0700
+++ b/jdk/src/share/classes/java/lang/Shutdown.java	Thu Apr 02 17:01:00 2009 -0700
@@ -25,8 +25,6 @@
 
 package java.lang;
 
-import java.util.ArrayList;
-
 
 /**
  * Package-private utility class containing data structures and logic
@@ -47,8 +45,13 @@
     /* Should we run all finalizers upon exit? */
     private static boolean runFinalizersOnExit = false;
 
-    /* The set of registered, wrapped hooks, or null if there aren't any */
-    private static ArrayList<Runnable> hooks = new ArrayList<Runnable>();
+    // The system shutdown hooks are registered with a predefined slot.
+    // The list of shutdown hooks is as follows:
+    // (0) Console restore hook
+    // (1) Application hooks
+    // (2) DeleteOnExit hook
+    private static final int MAX_SYSTEM_HOOKS = 10;
+    private static final Runnable[] hooks = new Runnable[MAX_SYSTEM_HOOKS];
 
     /* The preceding static fields are protected by this lock */
     private static class Lock { };
@@ -68,33 +71,18 @@
     /* Add a new shutdown hook.  Checks the shutdown state and the hook itself,
      * but does not do any security checks.
      */
-    static void add(Runnable hook) {
+    static void add(int slot, Runnable hook) {
         synchronized (lock) {
             if (state > RUNNING)
                 throw new IllegalStateException("Shutdown in progress");
 
-            hooks.add(hook);
+            if (hooks[slot] != null)
+                throw new InternalError("Shutdown hook at slot " + slot + " already registered");
+
+            hooks[slot] = hook;
         }
     }
 
-
-    /* Remove a previously-registered hook.  Like the add method, this method
-     * does not do any security checks.
-     */
-    static boolean remove(Runnable hook) {
-        synchronized (lock) {
-            if (state > RUNNING)
-                throw new IllegalStateException("Shutdown in progress");
-            if (hook == null) throw new NullPointerException();
-            if (hooks == null) {
-                return false;
-            } else {
-                return hooks.remove(hook);
-            }
-        }
-    }
-
-
     /* Run all registered shutdown hooks
      */
     private static void runHooks() {
@@ -103,7 +91,7 @@
          */
         for (Runnable hook : hooks) {
             try {
-                hook.run();
+                if (hook != null) hook.run();
             } catch(Throwable t) {
                 if (t instanceof ThreadDeath) {
                     ThreadDeath td = (ThreadDeath)t;
--- a/jdk/src/share/classes/java/lang/StringCoding.java	Thu Apr 02 10:49:41 2009 -0700
+++ b/jdk/src/share/classes/java/lang/StringCoding.java	Thu Apr 02 17:01:00 2009 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000-2008 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2000-2009 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,13 +25,10 @@
 
 package java.lang;
 
-import java.io.CharConversionException;
 import java.io.UnsupportedEncodingException;
 import java.lang.ref.SoftReference;
 import java.nio.ByteBuffer;
 import java.nio.CharBuffer;
-import java.nio.BufferOverflowException;
-import java.nio.BufferUnderflowException;
 import java.nio.charset.Charset;
 import java.nio.charset.CharsetDecoder;
 import java.nio.charset.CharsetEncoder;
@@ -39,11 +36,12 @@
 import java.nio.charset.CoderResult;
 import java.nio.charset.CodingErrorAction;
 import java.nio.charset.IllegalCharsetNameException;
-import java.nio.charset.MalformedInputException;
 import java.nio.charset.UnsupportedCharsetException;
 import java.util.Arrays;
 import sun.misc.MessageUtils;
 import sun.nio.cs.HistoricallyNamedCharset;
+import sun.nio.cs.ArrayDecoder;
+import sun.nio.cs.ArrayEncoder;
 
 /**
  * Utility class for string encoding and decoding.
@@ -74,10 +72,8 @@
 
     // Trim the given byte array to the given length
     //
-    private static byte[] safeTrim(byte[] ba, int len, Charset cs) {
-        if (len == ba.length
-            && (System.getSecurityManager() == null
-                || cs.getClass().getClassLoader0() == null))
+    private static byte[] safeTrim(byte[] ba, int len, Charset cs, boolean isTrusted) {
+        if (len == ba.length && (isTrusted || System.getSecurityManager() == null))
             return ba;
         else
             return Arrays.copyOf(ba, len);
@@ -85,10 +81,9 @@
 
     // Trim the given char array to the given length
     //
-    private static char[] safeTrim(char[] ca, int len, Charset cs) {
-        if (len == ca.length
-            && (System.getSecurityManager() == null
-                || cs.getClass().getClassLoader0() == null))
+    private static char[] safeTrim(char[] ca, int len,
+                                   Charset cs, boolean isTrusted) {
+        if (len == ca.length && (isTrusted || System.getSecurityManager() == null))
             return ca;
         else
             return Arrays.copyOf(ca, len);
@@ -128,6 +123,7 @@
         private final String requestedCharsetName;
         private final Charset cs;
         private final CharsetDecoder cd;
+        private final boolean isTrusted;
 
         private StringDecoder(Charset cs, String rcn) {
             this.requestedCharsetName = rcn;
@@ -135,6 +131,7 @@
             this.cd = cs.newDecoder()
                 .onMalformedInput(CodingErrorAction.REPLACE)
                 .onUnmappableCharacter(CodingErrorAction.REPLACE);
+            this.isTrusted = (cs.getClass().getClassLoader0() == null);
         }
 
         String charsetName() {
@@ -152,24 +149,28 @@
             char[] ca = new char[en];
             if (len == 0)
                 return ca;
-            cd.reset();
-            ByteBuffer bb = ByteBuffer.wrap(ba, off, len);
-            CharBuffer cb = CharBuffer.wrap(ca);
-            try {
-                CoderResult cr = cd.decode(bb, cb, true);
-                if (!cr.isUnderflow())
-                    cr.throwException();
-                cr = cd.flush(cb);
-                if (!cr.isUnderflow())
-                    cr.throwException();
-            } catch (CharacterCodingException x) {
-                // Substitution is always enabled,
-                // so this shouldn't happen
-                throw new Error(x);
+            if (cd instanceof ArrayDecoder) {
+                int clen = ((ArrayDecoder)cd).decode(ba, off, len, ca);
+                return safeTrim(ca, clen, cs, isTrusted);
+            } else {
+                cd.reset();
+                ByteBuffer bb = ByteBuffer.wrap(ba, off, len);
+                CharBuffer cb = CharBuffer.wrap(ca);
+                try {
+                    CoderResult cr = cd.decode(bb, cb, true);
+                    if (!cr.isUnderflow())
+                        cr.throwException();
+                    cr = cd.flush(cb);
+                    if (!cr.isUnderflow())
+                        cr.throwException();
+                } catch (CharacterCodingException x) {
+                    // Substitution is always enabled,
+                    // so this shouldn't happen
+                    throw new Error(x);
+                }
+                return safeTrim(ca, cb.position(), cs, isTrusted);
             }
-            return safeTrim(ca, cb.position(), cs);
         }
-
     }
 
     static char[] decode(String charsetName, byte[] ba, int off, int len)
@@ -193,8 +194,57 @@
     }
 
     static char[] decode(Charset cs, byte[] ba, int off, int len) {
-        StringDecoder sd = new StringDecoder(cs, cs.name());
-        return sd.decode(Arrays.copyOfRange(ba, off, off + len), 0, len);
+        // (1)We never cache the "external" cs, the only benefit of creating
+        // an additional StringDe/Encoder object to wrap it is to share the
+        // de/encode() method. These SD/E objects are short-lifed, the young-gen
+        // gc should be able to take care of them well. But the best approash
+        // is still not to generate them if not really necessary.
+        // (2)The defensive copy of the input byte/char[] has a big performance
+        // impact, as well as the outgoing result byte/char[]. Need to do the
+        // optimization check of (sm==null && classLoader0==null) for both.
+        // (3)getClass().getClassLoader0() is expensive
+        // (4)There might be a timing gap in isTrusted setting. getClassLoader0()
+        // is only chcked (and then isTrusted gets set) when (SM==null). It is
+        // possible that the SM==null for now but then SM is NOT null later
+        // when safeTrim() is invoked...the "safe" way to do is to redundant
+        // check (... && (isTrusted || SM == null || getClassLoader0())) in trim
+        // but it then can be argued that the SM is null when the opertaion
+        // is started...
+        CharsetDecoder cd = cs.newDecoder();
+        int en = scale(len, cd.maxCharsPerByte());
+        char[] ca = new char[en];
+        if (len == 0)
+            return ca;
+        boolean isTrusted = false;
+        if (System.getSecurityManager() != null) {
+            if (!(isTrusted = (cs.getClass().getClassLoader0() == null))) {
+                ba =  Arrays.copyOfRange(ba, off, off + len);
+                off = 0;
+            }
+        }
+        if (cd instanceof ArrayDecoder) {
+            int clen = ((ArrayDecoder)cd).decode(ba, off, len, ca);
+            return safeTrim(ca, clen, cs, isTrusted);
+        } else {
+            cd.onMalformedInput(CodingErrorAction.REPLACE)
+              .onUnmappableCharacter(CodingErrorAction.REPLACE)
+              .reset();
+            ByteBuffer bb = ByteBuffer.wrap(ba, off, len);
+            CharBuffer cb = CharBuffer.wrap(ca);
+            try {
+                CoderResult cr = cd.decode(bb, cb, true);
+                if (!cr.isUnderflow())
+                    cr.throwException();
+                cr = cd.flush(cb);
+                if (!cr.isUnderflow())
+                    cr.throwException();
+            } catch (CharacterCodingException x) {
+                // Substitution is always enabled,
+                // so this shouldn't happen
+                throw new Error(x);
+            }
+            return safeTrim(ca, cb.position(), cs, isTrusted);
+        }
     }
 
     static char[] decode(byte[] ba, int off, int len) {
@@ -218,14 +268,12 @@
         }
     }
 
-
-
-
     // -- Encoding --
     private static class StringEncoder {
         private Charset cs;
         private CharsetEncoder ce;
         private final String requestedCharsetName;
+        private final boolean isTrusted;
 
         private StringEncoder(Charset cs, String rcn) {
             this.requestedCharsetName = rcn;
@@ -233,6 +281,7 @@
             this.ce = cs.newEncoder()
                 .onMalformedInput(CodingErrorAction.REPLACE)
                 .onUnmappableCharacter(CodingErrorAction.REPLACE);
+            this.isTrusted = (cs.getClass().getClassLoader0() == null);
         }
 
         String charsetName() {
@@ -250,23 +299,27 @@
             byte[] ba = new byte[en];
             if (len == 0)
                 return ba;
-
-            ce.reset();
-            ByteBuffer bb = ByteBuffer.wrap(ba);
-            CharBuffer cb = CharBuffer.wrap(ca, off, len);
-            try {
-                CoderResult cr = ce.encode(cb, bb, true);
-                if (!cr.isUnderflow())
-                    cr.throwException();
-                cr = ce.flush(bb);
-                if (!cr.isUnderflow())
-                    cr.throwException();
-            } catch (CharacterCodingException x) {
-                // Substitution is always enabled,
-                // so this shouldn't happen
-                throw new Error(x);
+            if (ce instanceof ArrayEncoder) {
+                int blen = ((ArrayEncoder)ce).encode(ca, off, len, ba);
+                return safeTrim(ba, blen, cs, isTrusted);
+            } else {
+                ce.reset();
+                ByteBuffer bb = ByteBuffer.wrap(ba);
+                CharBuffer cb = CharBuffer.wrap(ca, off, len);
+                try {
+                    CoderResult cr = ce.encode(cb, bb, true);
+                    if (!cr.isUnderflow())
+                        cr.throwException();
+                    cr = ce.flush(bb);
+                    if (!cr.isUnderflow())
+                        cr.throwException();
+                } catch (CharacterCodingException x) {
+                    // Substitution is always enabled,
+                    // so this shouldn't happen
+                    throw new Error(x);
+                }
+                return safeTrim(ba, bb.position(), cs, isTrusted);
             }
-            return safeTrim(ba, bb.position(), cs);
         }
     }
 
@@ -291,8 +344,39 @@
     }
 
     static byte[] encode(Charset cs, char[] ca, int off, int len) {
-        StringEncoder se = new StringEncoder(cs, cs.name());
-        return se.encode(Arrays.copyOfRange(ca, off, off + len), 0, len);
+        CharsetEncoder ce = cs.newEncoder();
+        int en = scale(len, ce.maxBytesPerChar());
+        byte[] ba = new byte[en];
+        if (len == 0)
+            return ba;
+        boolean isTrusted = false;
+        if (System.getSecurityManager() != null) {
+            if (!(isTrusted = (cs.getClass().getClassLoader0() == null))) {
+                ca =  Arrays.copyOfRange(ca, off, off + len);
+                off = 0;
+            }
+        }
+        if (ce instanceof ArrayEncoder) {
+            int blen = ((ArrayEncoder)ce).encode(ca, off, len, ba);
+            return safeTrim(ba, blen, cs, isTrusted);
+        } else {
+            ce.onMalformedInput(CodingErrorAction.REPLACE)
+              .onUnmappableCharacter(CodingErrorAction.REPLACE)
+              .reset();
+            ByteBuffer bb = ByteBuffer.wrap(ba);
+            CharBuffer cb = CharBuffer.wrap(ca, off, len);
+            try {
+                CoderResult cr = ce.encode(cb, bb, true);
+                if (!cr.isUnderflow())
+                    cr.throwException();
+                cr = ce.flush(bb);
+                if (!cr.isUnderflow())
+                    cr.throwException();
+            } catch (CharacterCodingException x) {
+                throw new Error(x);
+            }
+            return safeTrim(ba, bb.position(), cs, isTrusted);
+        }
     }
 
     static byte[] encode(char[] ca, int off, int len) {
--- a/jdk/src/share/classes/java/lang/System.java	Thu Apr 02 10:49:41 2009 -0700
+++ b/jdk/src/share/classes/java/lang/System.java	Thu Apr 02 17:01:00 2009 -0700
@@ -34,7 +34,6 @@
 import java.nio.channels.Channel;
 import java.nio.channels.spi.SelectorProvider;
 import sun.nio.ch.Interruptible;
-import sun.net.InetAddressCachePolicy;
 import sun.reflect.Reflection;
 import sun.security.util.SecurityConstants;
 import sun.reflect.annotation.AnnotationType;
@@ -310,7 +309,6 @@
         }
 
         security = s;
-        InetAddressCachePolicy.setIfNotSet(InetAddressCachePolicy.FOREVER);
     }
 
     /**
@@ -1121,14 +1119,6 @@
         // Setup Java signal handlers for HUP, TERM, and INT (where available).
         Terminator.setup();
 
-        // The order in with the hooks are added here is important as it
-        // determines the order in which they are run.
-        // (1)Console restore hook needs to be called first.
-        // (2)Application hooks must be run before calling deleteOnExitHook.
-        Shutdown.add(sun.misc.SharedSecrets.getJavaIOAccess().consoleRestoreHook());
-        Shutdown.add(ApplicationShutdownHooks.hook());
-        Shutdown.add(sun.misc.SharedSecrets.getJavaIODeleteOnExitAccess());
-
         // Initialize any miscellenous operating system settings that need to be
         // set for the class libraries. Currently this is no-op everywhere except
         // for Windows where the process-wide error mode is set before the java.io
@@ -1174,6 +1164,9 @@
             public void blockedOn(Thread t, Interruptible b) {
                 t.blockedOn(b);
             }
+            public void registerShutdownHook(int slot, Runnable r) {
+                Shutdown.add(slot, r);
+            }
         });
     }
 
--- a/jdk/src/share/classes/java/nio/file/SecureDirectoryStream.java	Thu Apr 02 10:49:41 2009 -0700
+++ b/jdk/src/share/classes/java/nio/file/SecureDirectoryStream.java	Thu Apr 02 17:01:00 2009 -0700
@@ -5,7 +5,7 @@
  * This code is free software; you can redistribute 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 "Classname" exception as provided
+ * 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
--- a/jdk/src/share/classes/java/util/regex/Pattern.java	Thu Apr 02 10:49:41 2009 -0700
+++ b/jdk/src/share/classes/java/util/regex/Pattern.java	Thu Apr 02 17:01:00 2009 -0700
@@ -2567,7 +2567,8 @@
                 break;
             case '<':   // (?<xxx)  look behind
                 ch = read();
-                if (Character.isLetter(ch)) {     // named captured group
+                if (ASCII.isLower(ch) || ASCII.isUpper(ch) || ASCII.isDigit(ch)) {
+                    // named captured group
                     String name = groupname(ch);
                     if (namedGroups().containsKey(name))
                         throw error("Named capturing group <" + name
--- a/jdk/src/share/classes/sun/management/Agent.java	Thu Apr 02 10:49:41 2009 -0700
+++ b/jdk/src/share/classes/sun/management/Agent.java	Thu Apr 02 17:01:00 2009 -0700
@@ -31,9 +31,9 @@
 import java.io.BufferedInputStream;
 import java.io.FileNotFoundException;
 import java.io.IOException;
+import java.lang.reflect.InvocationTargetException;
 import java.text.MessageFormat;
 import java.util.Properties;
-import java.util.Enumeration;
 import java.util.ResourceBundle;
 import java.util.MissingResourceException;
 import java.lang.management.ManagementFactory;
@@ -41,7 +41,6 @@
 
 import javax.management.remote.JMXConnectorServer;
 
-import sun.management.snmp.AdaptorBootstrap;
 import sun.management.jmxremote.ConnectorBootstrap;
 import static sun.management.AgentConfigurationError.*;
 import sun.misc.VMSupport;
@@ -69,6 +68,9 @@
     private static final String LOCAL_CONNECTOR_ADDRESS_PROP =
         "com.sun.management.jmxremote.localConnectorAddress";
 
+    private static final String SNMP_ADAPTOR_BOOTSTRAP_CLASS_NAME =
+            "sun.management.snmp.AdaptorBootstrap";
+
     // invoked by -javaagent or -Dcom.sun.management.agent.class
     public static void premain(String args) throws Exception {
         agentmain(args);
@@ -128,7 +130,7 @@
 
         try {
             if (snmpPort != null) {
-                AdaptorBootstrap.initialize(snmpPort, props);
+                loadSnmpAgent(snmpPort, props);
             }
 
             /*
@@ -204,6 +206,36 @@
         return mgmtProps;
     }
 
+    private static void loadSnmpAgent(String snmpPort, Properties props) {
+        try {
+            // invoke the following through reflection:
+            //     AdaptorBootstrap.initialize(snmpPort, props);
+            final Class<?> adaptorClass =
+                Class.forName(SNMP_ADAPTOR_BOOTSTRAP_CLASS_NAME,true,null);
+            final Method initializeMethod =
+                    adaptorClass.getMethod("initialize",
+                        String.class, Properties.class);
+            initializeMethod.invoke(null,snmpPort,props);
+        } catch (ClassNotFoundException x) {
+            // The SNMP packages are not present: throws an exception.
+            throw new UnsupportedOperationException("Unsupported management property: " + SNMP_PORT,x);
+        } catch (NoSuchMethodException x) {
+            // should not happen...
+            throw new UnsupportedOperationException("Unsupported management property: " + SNMP_PORT,x);
+        } catch (InvocationTargetException x) {
+            final Throwable cause = x.getCause();
+            if (cause instanceof RuntimeException)
+                throw (RuntimeException) cause;
+            else if (cause instanceof Error)
+                throw (Error) cause;
+            // should not happen...
+            throw new UnsupportedOperationException("Unsupported management property: " + SNMP_PORT,cause);
+        } catch (IllegalAccessException x) {
+            // should not happen...
+            throw new UnsupportedOperationException("Unsupported management property: " + SNMP_PORT,x);
+        }
+    }
+
     // read config file and initialize the properties
     private static void readConfiguration(String fname, Properties p) {
         if (fname == null) {
--- a/jdk/src/share/classes/sun/misc/FormattedFloatingDecimal.java	Thu Apr 02 10:49:41 2009 -0700
+++ b/jdk/src/share/classes/sun/misc/FormattedFloatingDecimal.java	Thu Apr 02 17:01:00 2009 -0700
@@ -978,15 +978,6 @@
         return new String(result);
     }
 
-    // This method should only ever be called if this object is constructed
-    // without Form.DECIMAL_FLOAT because the perThreadBuffer is not large
-    // enough to handle floating-point numbers of large precision.
-    public String toJavaFormatString() {
-        char result[] = (char[])(perThreadBuffer.get());
-        int i = getChars(result);
-        return new String(result, 0, i);
-    }
-
     // returns the exponent before rounding
     public int getExponent() {
         return decExponent - 1;
@@ -1157,265 +1148,6 @@
             }
         };
 
-    // This method should only ever be called if this object is constructed
-    // without Form.DECIMAL_FLOAT because the perThreadBuffer is not large
-    // enough to handle floating-point numbers of large precision.
-    public void appendTo(Appendable buf) {
-        char result[] = (char[])(perThreadBuffer.get());
-        int i = getChars(result);
-        if (buf instanceof StringBuilder)
-            ((StringBuilder) buf).append(result, 0, i);
-        else if (buf instanceof StringBuffer)
-            ((StringBuffer) buf).append(result, 0, i);
-        else
-            assert false;
-    }
-
-    public static FormattedFloatingDecimal
-    readJavaFormatString( String in ) throws NumberFormatException {
-        boolean isNegative = false;
-        boolean signSeen   = false;
-        int     decExp;
-        char    c;
-
-    parseNumber:
-        try{
-            in = in.trim(); // don't fool around with white space.
-                            // throws NullPointerException if null
-            int l = in.length();
-            if ( l == 0 ) throw new NumberFormatException("empty String");
-            int i = 0;
-            switch ( c = in.charAt( i ) ){
-            case '-':
-                isNegative = true;
-                //FALLTHROUGH
-            case '+':
-                i++;
-                signSeen = true;
-            }
-
-            // Check for NaN and Infinity strings
-            c = in.charAt(i);
-            if(c == 'N' || c == 'I') { // possible NaN or infinity
-                boolean potentialNaN = false;
-                char targetChars[] = null;  // char arrary of "NaN" or "Infinity"
-
-                if(c == 'N') {
-                    targetChars = notANumber;
-                    potentialNaN = true;
-                } else {
-                    targetChars = infinity;
-                }
-
-                // compare Input string to "NaN" or "Infinity"
-                int j = 0;
-                while(i < l && j < targetChars.length) {
-                    if(in.charAt(i) == targetChars[j]) {
-                        i++; j++;
-                    }
-                    else // something is amiss, throw exception
-                        break parseNumber;
-                }
-
-                // For the candidate string to be a NaN or infinity,
-                // all characters in input string and target char[]
-                // must be matched ==> j must equal targetChars.length
-                // and i must equal l
-                if( (j == targetChars.length) && (i == l) ) { // return NaN or infinity
-                    return (potentialNaN ? new FormattedFloatingDecimal(Double.NaN) // NaN has no sign
-                            : new FormattedFloatingDecimal(isNegative?
-                                                  Double.NEGATIVE_INFINITY:
-                                                  Double.POSITIVE_INFINITY)) ;
-                }
-                else { // something went wrong, throw exception
-                    break parseNumber;
-                }
-
-            } else if (c == '0')  { // check for hexadecimal floating-point number
-                if (l > i+1 ) {
-                    char ch = in.charAt(i+1);
-                    if (ch == 'x' || ch == 'X' ) // possible hex string
-                        return parseHexString(in);
-                }
-            }  // look for and process decimal floating-point string
-
-            char[] digits = new char[ l ];
-            int    nDigits= 0;
-            boolean decSeen = false;
-            int decPt = 0;
-            int nLeadZero = 0;
-            int nTrailZero= 0;
-        digitLoop:
-            while ( i < l ){
-                switch ( c = in.charAt( i ) ){
-                case '0':
-                    if ( nDigits > 0 ){
-                        nTrailZero += 1;
-                    } else {
-                        nLeadZero += 1;
-                    }
-                    break; // out of switch.
-                case '1':
-                case '2':
-                case '3':
-                case '4':
-                case '5':
-                case '6':
-                case '7':
-                case '8':
-                case '9':
-                    while ( nTrailZero > 0 ){
-                        digits[nDigits++] = '0';
-                        nTrailZero -= 1;
-                    }
-                    digits[nDigits++] = c;
-                    break; // out of switch.
-                case '.':
-                    if ( decSeen ){
-                        // already saw one ., this is the 2nd.
-                        throw new NumberFormatException("multiple points");
-                    }
-                    decPt = i;
-                    if ( signSeen ){
-                        decPt -= 1;
-                    }
-                    decSeen = true;
-                    break; // out of switch.
-                default:
-                    break digitLoop;
-                }
-                i++;
-            }
-            /*
-             * At this point, we've scanned all the digits and decimal
-             * point we're going to see. Trim off leading and trailing
-             * zeros, which will just confuse us later, and adjust
-             * our initial decimal exponent accordingly.
-             * To review:
-             * we have seen i total characters.
-             * nLeadZero of them were zeros before any other digits.
-             * nTrailZero of them were zeros after any other digits.
-             * if ( decSeen ), then a . was seen after decPt characters
-             * ( including leading zeros which have been discarded )
-             * nDigits characters were neither lead nor trailing
-             * zeros, nor point
-             */
-            /*
-             * special hack: if we saw no non-zero digits, then the
-             * answer is zero!
-             * Unfortunately, we feel honor-bound to keep parsing!
-             */
-            if ( nDigits == 0 ){
-                digits = zero;
-                nDigits = 1;
-                if ( nLeadZero == 0 ){
-                    // we saw NO DIGITS AT ALL,
-                    // not even a crummy 0!
-                    // this is not allowed.
-                    break parseNumber; // go throw exception
-                }
-
-            }
-
-            /* Our initial exponent is decPt, adjusted by the number of
-             * discarded zeros. Or, if there was no decPt,
-             * then its just nDigits adjusted by discarded trailing zeros.
-             */
-            if ( decSeen ){
-                decExp = decPt - nLeadZero;
-            } else {
-                decExp = nDigits+nTrailZero;
-            }
-
-            /*
-             * Look for 'e' or 'E' and an optionally signed integer.
-             */
-            if ( (i < l) &&  (((c = in.charAt(i) )=='e') || (c == 'E') ) ){
-                int expSign = 1;
-                int expVal  = 0;
-                int reallyBig = Integer.MAX_VALUE / 10;
-                boolean expOverflow = false;
-                switch( in.charAt(++i) ){
-                case '-':
-                    expSign = -1;
-                    //FALLTHROUGH
-                case '+':
-                    i++;
-                }
-                int expAt = i;
-            expLoop:
-                while ( i < l  ){
-                    if ( expVal >= reallyBig ){
-                        // the next character will cause integer
-                        // overflow.
-                        expOverflow = true;
-                    }
-                    switch ( c = in.charAt(i++) ){
-                    case '0':
-                    case '1':
-                    case '2':
-                    case '3':
-                    case '4':
-                    case '5':
-                    case '6':
-                    case '7':
-                    case '8':
-                    case '9':
-                        expVal = expVal*10 + ( (int)c - (int)'0' );
-                        continue;
-                    default:
-                        i--;           // back up.
-                        break expLoop; // stop parsing exponent.
-                    }
-                }
-                int expLimit = bigDecimalExponent+nDigits+nTrailZero;
-                if ( expOverflow || ( expVal > expLimit ) ){
-                    //
-                    // The intent here is to end up with
-                    // infinity or zero, as appropriate.
-                    // The reason for yielding such a small decExponent,
-                    // rather than something intuitive such as
-                    // expSign*Integer.MAX_VALUE, is that this value
-                    // is subject to further manipulation in
-                    // doubleValue() and floatValue(), and I don't want
-                    // it to be able to cause overflow there!
-                    // (The only way we can get into trouble here is for
-                    // really outrageous nDigits+nTrailZero, such as 2 billion. )
-                    //
-                    decExp = expSign*expLimit;
-                } else {
-                    // this should not overflow, since we tested
-                    // for expVal > (MAX+N), where N >= abs(decExp)
-                    decExp = decExp + expSign*expVal;
-                }
-
-                // if we saw something not a digit ( or end of string )
-                // after the [Ee][+-], without seeing any digits at all
-                // this is certainly an error. If we saw some digits,
-                // but then some trailing garbage, that might be ok.
-                // so we just fall through in that case.
-                // HUMBUG
-                if ( i == expAt )
-                    break parseNumber; // certainly bad
-            }
-            /*
-             * We parsed everything we could.
-             * If there are leftovers, then this is not good input!
-             */
-            if ( i < l &&
-                ((i != l - 1) ||
-                (in.charAt(i) != 'f' &&
-                 in.charAt(i) != 'F' &&
-                 in.charAt(i) != 'd' &&
-                 in.charAt(i) != 'D'))) {
-                break parseNumber; // go throw exception
-            }
-
-            return new FormattedFloatingDecimal( isNegative, decExp, digits, nDigits,  false, Integer.MAX_VALUE, Form.COMPATIBLE );
-        } catch ( StringIndexOutOfBoundsException e ){ }
-        throw new NumberFormatException("For input string: \"" + in + "\"");
-    }
-
     /*
      * Take a FormattedFloatingDecimal, which we presumably just scanned in,
      * and find out what its value is, as a double.
@@ -2035,548 +1767,4 @@
     private static final char infinity[] = { 'I', 'n', 'f', 'i', 'n', 'i', 't', 'y' };
     private static final char notANumber[] = { 'N', 'a', 'N' };
     private static final char zero[] = { '0', '0', '0', '0', '0', '0', '0', '0' };
-
-
-    /*
-     * Grammar is compatible with hexadecimal floating-point constants
-     * described in section 6.4.4.2 of the C99 specification.
-     */
-    private static Pattern hexFloatPattern = Pattern.compile(
-                   //1           234                   56                7                   8      9
-                    "([-+])?0[xX](((\\p{XDigit}+)\\.?)|((\\p{XDigit}*)\\.(\\p{XDigit}+)))[pP]([-+])?(\\p{Digit}+)[fFdD]?"
-                    );
-
-    /*
-     * Convert string s to a suitable floating decimal; uses the
-     * double constructor and set the roundDir variable appropriately
-     * in case the value is later converted to a float.
-     */
-   static FormattedFloatingDecimal parseHexString(String s) {
-        // Verify string is a member of the hexadecimal floating-point
-        // string language.
-        Matcher m = hexFloatPattern.matcher(s);
-        boolean validInput = m.matches();
-
-        if (!validInput) {
-            // Input does not match pattern
-            throw new NumberFormatException("For input string: \"" + s + "\"");
-        } else { // validInput
-            /*
-             * We must isolate the sign, significand, and exponent
-             * fields.  The sign value is straightforward.  Since
-             * floating-point numbers are stored with a normalized
-             * representation, the significand and exponent are
-             * interrelated.
-             *
-             * After extracting the sign, we normalized the
-             * significand as a hexadecimal value, calculating an
-             * exponent adjust for any shifts made during
-             * normalization.  If the significand is zero, the
-             * exponent doesn't need to be examined since the output
-             * will be zero.
-             *
-             * Next the exponent in the input string is extracted.
-             * Afterwards, the significand is normalized as a *binary*
-             * value and the input value's normalized exponent can be
-             * computed.  The significand bits are copied into a
-             * double significand; if the string has more logical bits
-             * than can fit in a double, the extra bits affect the
-             * round and sticky bits which are used to round the final
-             * value.
-             */
-
-            //  Extract significand sign
-            String group1 = m.group(1);
-            double sign = (( group1 == null ) || group1.equals("+"))? 1.0 : -1.0;
-
-
-            //  Extract Significand magnitude
-            /*
-             * Based on the form of the significand, calculate how the
-             * binary exponent needs to be adjusted to create a
-             * normalized *hexadecimal* floating-point number; that
-             * is, a number where there is one nonzero hex digit to
-             * the left of the (hexa)decimal point.  Since we are
-             * adjusting a binary, not hexadecimal exponent, the
-             * exponent is adjusted by a multiple of 4.
-             *
-             * There are a number of significand scenarios to consider;
-             * letters are used in indicate nonzero digits:
-             *
-             * 1. 000xxxx       =>      x.xxx   normalized
-             *    increase exponent by (number of x's - 1)*4
-             *
-             * 2. 000xxx.yyyy =>        x.xxyyyy        normalized
-             *    increase exponent by (number of x's - 1)*4
-             *
-             * 3. .000yyy  =>   y.yy    normalized
-             *    decrease exponent by (number of zeros + 1)*4
-             *
-             * 4. 000.00000yyy => y.yy normalized
-             *    decrease exponent by (number of zeros to right of point + 1)*4
-             *
-             * If the significand is exactly zero, return a properly
-             * signed zero.
-             */
-
-            String significandString =null;
-            int signifLength = 0;
-            int exponentAdjust = 0;
-            {
-                int leftDigits  = 0; // number of meaningful digits to
-                                     // left of "decimal" point
-                                     // (leading zeros stripped)
-                int rightDigits = 0; // number of digits to right of
-                                     // "decimal" point; leading zeros
-                                     // must always be accounted for
-                /*
-                 * The significand is made up of either
-                 *
-                 * 1. group 4 entirely (integer portion only)
-                 *
-                 * OR
-                 *
-                 * 2. the fractional portion from group 7 plus any
-                 * (optional) integer portions from group 6.
-                 */
-                String group4;
-                if( (group4 = m.group(4)) != null) {  // Integer-only significand
-                    // Leading zeros never matter on the integer portion
-                    significandString = stripLeadingZeros(group4);
-                    leftDigits = significandString.length();
-                }
-                else {
-                    // Group 6 is the optional integer; leading zeros
-                    // never matter on the integer portion
-                    String group6 = stripLeadingZeros(m.group(6));
-                    leftDigits = group6.length();
-
-                    // fraction
-                    String group7 = m.group(7);
-                    rightDigits = group7.length();
-
-                    // Turn "integer.fraction" into "integer"+"fraction"
-                    significandString =
-                        ((group6 == null)?"":group6) + // is the null
-                        // check necessary?
-                        group7;
-                }
-
-                significandString = stripLeadingZeros(significandString);
-                signifLength  = significandString.length();
-
-                /*
-                 * Adjust exponent as described above
-                 */
-                if (leftDigits >= 1) {  // Cases 1 and 2
-                    exponentAdjust = 4*(leftDigits - 1);
-                } else {                // Cases 3 and 4
-                    exponentAdjust = -4*( rightDigits - signifLength + 1);
-                }
-
-                // If the significand is zero, the exponent doesn't
-                // matter; return a properly signed zero.
-
-                if (signifLength == 0) { // Only zeros in input
-                    return new FormattedFloatingDecimal(sign * 0.0);
-                }
-            }
-
-            //  Extract Exponent
-            /*
-             * Use an int to read in the exponent value; this should
-             * provide more than sufficient range for non-contrived
-             * inputs.  If reading the exponent in as an int does
-             * overflow, examine the sign of the exponent and
-             * significand to determine what to do.
-             */
-            String group8 = m.group(8);
-            boolean positiveExponent = ( group8 == null ) || group8.equals("+");
-            long unsignedRawExponent;
-            try {
-                unsignedRawExponent = Integer.parseInt(m.group(9));
-            }
-            catch (NumberFormatException e) {
-                // At this point, we know the exponent is
-                // syntactically well-formed as a sequence of
-                // digits.  Therefore, if an NumberFormatException
-                // is thrown, it must be due to overflowing int's
-                // range.  Also, at this point, we have already
-                // checked for a zero significand.  Thus the signs
-                // of the exponent and significand determine the
-                // final result:
-                //
-                //                      significand
-                //                      +               -
-                // exponent     +       +infinity       -infinity
-                //              -       +0.0            -0.0
-                return new FormattedFloatingDecimal(sign * (positiveExponent ?
-                                                   Double.POSITIVE_INFINITY : 0.0));
-            }
-
-            long rawExponent =
-                (positiveExponent ? 1L : -1L) * // exponent sign
-                unsignedRawExponent;            // exponent magnitude
-
-            // Calculate partially adjusted exponent
-            long exponent = rawExponent + exponentAdjust ;
-
-            // Starting copying non-zero bits into proper position in
-            // a long; copy explicit bit too; this will be masked
-            // later for normal values.
-
-            boolean round = false;
-            boolean sticky = false;
-            int bitsCopied=0;
-            int nextShift=0;
-            long significand=0L;
-            // First iteration is different, since we only copy
-            // from the leading significand bit; one more exponent
-            // adjust will be needed...
-
-            // IMPORTANT: make leadingDigit a long to avoid
-            // surprising shift semantics!
-            long leadingDigit = getHexDigit(significandString, 0);
-
-            /*
-             * Left shift the leading digit (53 - (bit position of
-             * leading 1 in digit)); this sets the top bit of the
-             * significand to 1.  The nextShift value is adjusted
-             * to take into account the number of bit positions of
-             * the leadingDigit actually used.  Finally, the
-             * exponent is adjusted to normalize the significand
-             * as a binary value, not just a hex value.
-             */
-            if (leadingDigit == 1) {
-                significand |= leadingDigit << 52;
-                nextShift = 52 - 4;
-                /* exponent += 0 */     }
-            else if (leadingDigit <= 3) { // [2, 3]
-                significand |= leadingDigit << 51;
-                nextShift = 52 - 5;
-                exponent += 1;
-            }
-            else if (leadingDigit <= 7) { // [4, 7]
-                significand |= leadingDigit << 50;
-                nextShift = 52 - 6;
-                exponent += 2;
-            }
-            else if (leadingDigit <= 15) { // [8, f]
-                significand |= leadingDigit << 49;
-                nextShift = 52 - 7;
-                exponent += 3;
-            } else {
-                throw new AssertionError("Result from digit converstion too large!");
-            }
-            // The preceding if-else could be replaced by a single
-            // code block based on the high-order bit set in
-            // leadingDigit.  Given leadingOnePosition,
-
-            // significand |= leadingDigit << (SIGNIFICAND_WIDTH - leadingOnePosition);
-            // nextShift = 52 - (3 + leadingOnePosition);
-            // exponent += (leadingOnePosition-1);
-
-
-            /*
-             * Now the exponent variable is equal to the normalized
-             * binary exponent.  Code below will make representation
-             * adjustments if the exponent is incremented after
-             * rounding (includes overflows to infinity) or if the
-             * result is subnormal.
-             */
-
-            // Copy digit into significand until the significand can't
-            // hold another full hex digit or there are no more input
-            // hex digits.
-            int i = 0;
-            for(i = 1;
-                i < signifLength && nextShift >= 0;
-                i++) {
-                long currentDigit = getHexDigit(significandString, i);
-                significand |= (currentDigit << nextShift);
-                nextShift-=4;
-            }
-
-            // After the above loop, the bulk of the string is copied.
-            // Now, we must copy any partial hex digits into the
-            // significand AND compute the round bit and start computing
-            // sticky bit.
-
-            if ( i < signifLength ) { // at least one hex input digit exists
-                long currentDigit = getHexDigit(significandString, i);
-
-                // from nextShift, figure out how many bits need
-                // to be copied, if any
-                switch(nextShift) { // must be negative
-                case -1:
-                    // three bits need to be copied in; can
-                    // set round bit
-                    significand |= ((currentDigit & 0xEL) >> 1);
-                    round = (currentDigit & 0x1L)  != 0L;
-                    break;
-
-                case -2:
-                    // two bits need to be copied in; can
-                    // set round and start sticky
-                    significand |= ((currentDigit & 0xCL) >> 2);
-                    round = (currentDigit &0x2L)  != 0L;
-                    sticky = (currentDigit & 0x1L) != 0;
-                    break;
-
-                case -3:
-                    // one bit needs to be copied in
-                    significand |= ((currentDigit & 0x8L)>>3);
-                    // Now set round and start sticky, if possible
-                    round = (currentDigit &0x4L)  != 0L;
-                    sticky = (currentDigit & 0x3L) != 0;
-                    break;
-
-                case -4:
-                    // all bits copied into significand; set
-                    // round and start sticky
-                    round = ((currentDigit & 0x8L) != 0);  // is top bit set?
-                    // nonzeros in three low order bits?
-                    sticky = (currentDigit & 0x7L) != 0;
-                    break;
-
-                default:
-                    throw new AssertionError("Unexpected shift distance remainder.");
-                    // break;
-                }
-
-                // Round is set; sticky might be set.
-
-                // For the sticky bit, it suffices to check the
-                // current digit and test for any nonzero digits in
-                // the remaining unprocessed input.
-                i++;
-                while(i < signifLength && !sticky) {
-                    currentDigit =  getHexDigit(significandString,i);
-                    sticky = sticky || (currentDigit != 0);
-                    i++;
-                }
-
-            }
-            // else all of string was seen, round and sticky are
-            // correct as false.
-
-
-            // Check for overflow and update exponent accordingly.
-
-            if (exponent > DoubleConsts.MAX_EXPONENT) {         // Infinite result
-                // overflow to properly signed infinity
-                return new FormattedFloatingDecimal(sign * Double.POSITIVE_INFINITY);
-            } else {  // Finite return value
-                if (exponent <= DoubleConsts.MAX_EXPONENT && // (Usually) normal result
-                    exponent >= DoubleConsts.MIN_EXPONENT) {
-
-                    // The result returned in this block cannot be a
-                    // zero or subnormal; however after the
-                    // significand is adjusted from rounding, we could
-                    // still overflow in infinity.
-
-                    // AND exponent bits into significand; if the
-                    // significand is incremented and overflows from
-                    // rounding, this combination will update the
-                    // exponent correctly, even in the case of
-                    // Double.MAX_VALUE overflowing to infinity.
-
-                    significand = (( ((long)exponent +
-                                      (long)DoubleConsts.EXP_BIAS) <<
-                                     (DoubleConsts.SIGNIFICAND_WIDTH-1))
-                                   & DoubleConsts.EXP_BIT_MASK) |
-                        (DoubleConsts.SIGNIF_BIT_MASK & significand);
-
-                }  else  {  // Subnormal or zero
-                    // (exponent < DoubleConsts.MIN_EXPONENT)
-
-                    if (exponent < (DoubleConsts.MIN_SUB_EXPONENT -1 )) {
-                        // No way to round back to nonzero value
-                        // regardless of significand if the exponent is
-                        // less than -1075.
-                        return new FormattedFloatingDecimal(sign * 0.0);
-                    } else { //  -1075 <= exponent <= MIN_EXPONENT -1 = -1023
-                        /*
-                         * Find bit position to round to; recompute
-                         * round and sticky bits, and shift
-                         * significand right appropriately.
-                         */
-
-                        sticky = sticky || round;
-                        round = false;
-
-                        // Number of bits of significand to preserve is
-                        // exponent - abs_min_exp +1
-                        // check:
-                        // -1075 +1074 + 1 = 0
-                        // -1023 +1074 + 1 = 52
-
-                        int bitsDiscarded = 53 -
-                            ((int)exponent - DoubleConsts.MIN_SUB_EXPONENT + 1);
-                        assert bitsDiscarded >= 1 && bitsDiscarded <= 53;
-
-                        // What to do here:
-                        // First, isolate the new round bit
-                        round = (significand & (1L << (bitsDiscarded -1))) != 0L;
-                        if (bitsDiscarded > 1) {
-                            // create mask to update sticky bits; low
-                            // order bitsDiscarded bits should be 1
-                            long mask = ~((~0L) << (bitsDiscarded -1));
-                            sticky = sticky || ((significand & mask) != 0L ) ;
-                        }
-
-                        // Now, discard the bits
-                        significand = significand >> bitsDiscarded;
-
-                        significand = (( ((long)(DoubleConsts.MIN_EXPONENT -1) + // subnorm exp.
-                                          (long)DoubleConsts.EXP_BIAS) <<
-                                         (DoubleConsts.SIGNIFICAND_WIDTH-1))
-                                       & DoubleConsts.EXP_BIT_MASK) |
-                            (DoubleConsts.SIGNIF_BIT_MASK & significand);
-                    }
-                }
-
-                // The significand variable now contains the currently
-                // appropriate exponent bits too.
-
-                /*
-                 * Determine if significand should be incremented;
-                 * making this determination depends on the least
-                 * significant bit and the round and sticky bits.
-                 *
-                 * Round to nearest even rounding table, adapted from
-                 * table 4.7 in "Computer Arithmetic" by IsraelKoren.
-                 * The digit to the left of the "decimal" point is the
-                 * least significant bit, the digits to the right of
-                 * the point are the round and sticky bits
-                 *
-                 * Number       Round(x)
-                 * x0.00        x0.
-                 * x0.01        x0.
-                 * x0.10        x0.
-                 * x0.11        x1. = x0. +1
-                 * x1.00        x1.
-                 * x1.01        x1.
-                 * x1.10        x1. + 1
-                 * x1.11        x1. + 1
-                 */
-                boolean incremented = false;
-                boolean leastZero  = ((significand & 1L) == 0L);
-                if( (  leastZero  && round && sticky ) ||
-                    ((!leastZero) && round )) {
-                    incremented = true;
-                    significand++;
-                }
-
-                FormattedFloatingDecimal fd = new FormattedFloatingDecimal(FpUtils.rawCopySign(
-                                                                 Double.longBitsToDouble(significand),
-                                                                 sign));
-
-                /*
-                 * Set roundingDir variable field of fd properly so
-                 * that the input string can be properly rounded to a
-                 * float value.  There are two cases to consider:
-                 *
-                 * 1. rounding to double discards sticky bit
-                 * information that would change the result of a float
-                 * rounding (near halfway case between two floats)
-                 *
-                 * 2. rounding to double rounds up when rounding up
-                 * would not occur when rounding to float.
-                 *
-                 * For former case only needs to be considered when
-                 * the bits rounded away when casting to float are all
-                 * zero; otherwise, float round bit is properly set
-                 * and sticky will already be true.
-                 *
-                 * The lower exponent bound for the code below is the
-                 * minimum (normalized) subnormal exponent - 1 since a
-                 * value with that exponent can round up to the
-                 * minimum subnormal value and the sticky bit
-                 * information must be preserved (i.e. case 1).
-                 */
-                if ((exponent >= FloatConsts.MIN_SUB_EXPONENT-1) &&
-                    (exponent <= FloatConsts.MAX_EXPONENT ) ){
-                    // Outside above exponent range, the float value
-                    // will be zero or infinity.
-
-                    /*
-                     * If the low-order 28 bits of a rounded double
-                     * significand are 0, the double could be a
-                     * half-way case for a rounding to float.  If the
-                     * double value is a half-way case, the double
-                     * significand may have to be modified to round
-                     * the the right float value (see the stickyRound
-                     * method).  If the rounding to double has lost
-                     * what would be float sticky bit information, the
-                     * double significand must be incremented.  If the
-                     * double value's significand was itself
-                     * incremented, the float value may end up too
-                     * large so the increment should be undone.
-                     */
-                    if ((significand & 0xfffffffL) ==  0x0L) {
-                        // For negative values, the sign of the
-                        // roundDir is the same as for positive values
-                        // since adding 1 increasing the significand's
-                        // magnitude and subtracting 1 decreases the
-                        // significand's magnitude.  If neither round
-                        // nor sticky is true, the double value is
-                        // exact and no adjustment is required for a
-                        // proper float rounding.
-                        if( round || sticky) {
-                            if (leastZero) { // prerounding lsb is 0
-                                // If round and sticky were both true,
-                                // and the least significant
-                                // significand bit were 0, the rounded
-                                // significand would not have its
-                                // low-order bits be zero.  Therefore,
-                                // we only need to adjust the
-                                // significand if round XOR sticky is
-                                // true.
-                                if (round ^ sticky) {
-                                    fd.roundDir =  1;
-                                }
-                            }
-                            else { // prerounding lsb is 1
-                                // If the prerounding lsb is 1 and the
-                                // resulting significand has its
-                                // low-order bits zero, the significand
-                                // was incremented.  Here, we undo the
-                                // increment, which will ensure the
-                                // right guard and sticky bits for the
-                                // float rounding.
-                                if (round)
-                                    fd.roundDir =  -1;
-                            }
-                        }
-                    }
-                }
-
-                fd.fromHex = true;
-                return fd;
-            }
-        }
-    }
-
-    /**
-     * Return <code>s</code> with any leading zeros removed.
-     */
-    static String stripLeadingZeros(String s) {
-        return  s.replaceFirst("^0+", "");
-    }
-
-    /**
-     * Extract a hexadecimal digit from position <code>position</code>
-     * of string <code>s</code>.
-     */
-    static int getHexDigit(String s, int position) {
-        int value = Character.digit(s.charAt(position), 16);
-        if (value <= -1 || value >= 16) {
-            throw new AssertionError("Unxpected failure of digit converstion of " +
-                                     s.charAt(position));
-        }
-        return value;
-    }
-
-
 }
--- a/jdk/src/share/classes/sun/misc/JavaIOAccess.java	Thu Apr 02 10:49:41 2009 -0700
+++ b/jdk/src/share/classes/sun/misc/JavaIOAccess.java	Thu Apr 02 17:01:00 2009 -0700
@@ -29,6 +29,5 @@
 
 public interface JavaIOAccess {
     public Console console();
-    public Runnable consoleRestoreHook();
     public Charset charset();
 }
--- a/jdk/src/share/classes/sun/misc/JavaIODeleteOnExitAccess.java	Thu Apr 02 10:49:41 2009 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +0,0 @@
-/*
- * Copyright 2005 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package sun.misc;
-
-public interface JavaIODeleteOnExitAccess extends Runnable {
-    public void run();
-}
--- a/jdk/src/share/classes/sun/misc/JavaLangAccess.java	Thu Apr 02 10:49:41 2009 -0700
+++ b/jdk/src/share/classes/sun/misc/JavaLangAccess.java	Thu Apr 02 17:01:00 2009 -0700
@@ -54,4 +54,7 @@
 
     /** Set thread's blocker field. */
     void blockedOn(Thread t, Interruptible b);
+
+    /** register shutdown hook */
+    void registerShutdownHook(int slot, Runnable r);
 }
--- a/jdk/src/share/classes/sun/misc/SharedSecrets.java	Thu Apr 02 10:49:41 2009 -0700
+++ b/jdk/src/share/classes/sun/misc/SharedSecrets.java	Thu Apr 02 17:01:00 2009 -0700
@@ -44,7 +44,6 @@
     private static JavaUtilJarAccess javaUtilJarAccess;
     private static JavaLangAccess javaLangAccess;
     private static JavaIOAccess javaIOAccess;
-    private static JavaIODeleteOnExitAccess javaIODeleteOnExitAccess;
     private static JavaNetAccess javaNetAccess;
     private static JavaNioAccess javaNioAccess;
     private static JavaIOFileDescriptorAccess javaIOFileDescriptorAccess;
@@ -103,17 +102,6 @@
         return javaIOAccess;
     }
 
-    public static void setJavaIODeleteOnExitAccess(JavaIODeleteOnExitAccess jida) {
-        javaIODeleteOnExitAccess = jida;
-    }
-
-    public static JavaIODeleteOnExitAccess getJavaIODeleteOnExitAccess() {
-        if (javaIODeleteOnExitAccess == null) {
-            unsafe.ensureClassInitialized(File.class);
-        }
-        return javaIODeleteOnExitAccess;
-    }
-
     public static void setJavaIOFileDescriptorAccess(JavaIOFileDescriptorAccess jiofda) {
         javaIOFileDescriptorAccess = jiofda;
     }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/classes/sun/nio/cs/ArrayDecoder.java	Thu Apr 02 17:01:00 2009 -0700
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2009 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package sun.nio.cs;
+
+/*
+ * FastPath byte[]->char[] decoder, REPLACE on malformed or
+ * unmappable input.
+ */
+
+public interface ArrayDecoder {
+    int decode(byte[] src, int off, int len, char[] dst);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/classes/sun/nio/cs/ArrayEncoder.java	Thu Apr 02 17:01:00 2009 -0700
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2009 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package sun.nio.cs;
+
+/*
+ * FastPath char[]->byte[] encoder, REPLACE on malformed input or
+ * unmappable input.
+ */
+
+public interface ArrayEncoder {
+    int encode(char[] src, int off, int len, byte[] dst);
+}
--- a/jdk/src/share/classes/sun/nio/cs/ISO_8859_1.java	Thu Apr 02 10:49:41 2009 -0700
+++ b/jdk/src/share/classes/sun/nio/cs/ISO_8859_1.java	Thu Apr 02 17:01:00 2009 -0700
@@ -23,9 +23,6 @@
  * have any questions.
  */
 
-/*
- */
-
 package sun.nio.cs;
 
 import java.nio.ByteBuffer;
@@ -34,10 +31,7 @@
 import java.nio.charset.CharsetDecoder;
 import java.nio.charset.CharsetEncoder;
 import java.nio.charset.CoderResult;
-import java.nio.charset.CharacterCodingException;
-import java.nio.charset.MalformedInputException;
-import java.nio.charset.UnmappableCharacterException;
-
+import java.util.Arrays;
 
 class ISO_8859_1
     extends Charset
@@ -65,8 +59,8 @@
         return new Encoder(this);
     }
 
-    private static class Decoder extends CharsetDecoder {
-
+    private static class Decoder extends CharsetDecoder
+                                 implements ArrayDecoder {
         private Decoder(Charset cs) {
             super(cs, 1.0f, 1.0f);
         }
@@ -127,10 +121,18 @@
                 return decodeBufferLoop(src, dst);
         }
 
+        public int decode(byte[] src, int sp, int len, char[] dst) {
+            if (len > dst.length)
+                len = dst.length;
+            int dp = 0;
+            while (dp < len)
+                dst[dp++] = (char)(src[sp++] & 0xff);
+            return dp;
+        }
     }
 
-    private static class Encoder extends CharsetEncoder {
-
+    private static class Encoder extends CharsetEncoder
+                                 implements ArrayEncoder {
         private Encoder(Charset cs) {
             super(cs, 1.0f, 1.0f);
         }
@@ -139,6 +141,10 @@
             return c <= '\u00FF';
         }
 
+        public boolean isLegalReplacement(byte[] repl) {
+            return (repl.length == 1);  // we accept any byte value
+        }
+
         private final Surrogate.Parser sgp = new Surrogate.Parser();
 
         private CoderResult encodeArrayLoop(CharBuffer src,
@@ -208,5 +214,31 @@
                 return encodeBufferLoop(src, dst);
         }
 
+        private byte repl = (byte)'?';
+        protected void implReplaceWith(byte[] newReplacement) {
+            repl = newReplacement[0];
+        }
+
+        public int encode(char[] src, int sp, int len, byte[] dst) {
+            int dp = 0;
+            int sl = sp + Math.min(len, dst.length);
+            while (sp < sl) {
+                char c = src[sp++];
+                if (c <= '\u00FF') {
+                    dst[dp++] = (byte)c;
+                    continue;
+                }
+                if (Surrogate.isHigh(c) && sp < sl &&
+                    Surrogate.isLow(src[sp])) {
+                    if (len > dst.length) {
+                        sl++;
+                        len--;
+                    }
+                    sp++;
+                }
+                dst[dp++] = repl;
+            }
+            return dp;
+        }
     }
 }
--- a/jdk/src/share/classes/sun/nio/cs/SingleByte.java	Thu Apr 02 10:49:41 2009 -0700
+++ b/jdk/src/share/classes/sun/nio/cs/SingleByte.java	Thu Apr 02 17:01:00 2009 -0700
@@ -32,6 +32,7 @@
 import java.nio.charset.CharsetDecoder;
 import java.nio.charset.CharsetEncoder;
 import java.nio.charset.CoderResult;
+import java.util.Arrays;
 import static sun.nio.cs.CharsetMapping.*;
 
 public class SingleByte
@@ -45,7 +46,8 @@
         return cr;
     }
 
-    public static class Decoder extends CharsetDecoder {
+    final public static class Decoder extends CharsetDecoder
+                                      implements ArrayDecoder {
         private final char[] b2c;
 
         public Decoder(Charset cs, char[] b2c) {
@@ -108,9 +110,29 @@
         private final char decode(int b) {
             return b2c[b + 128];
         }
+
+        private char repl = '\uFFFD';
+        protected void implReplaceWith(String newReplacement) {
+            repl = newReplacement.charAt(0);
+        }
+
+        public int decode(byte[] src, int sp, int len, char[] dst) {
+            if (len > dst.length)
+                len = dst.length;
+            int dp = 0;
+            while (dp < len) {
+                dst[dp] = decode(src[sp++]);
+                if (dst[dp] == UNMAPPABLE_DECODING) {
+                    dst[dp] = repl;
+                }
+                dp++;
+            }
+            return dp;
+        }
     }
 
-    public static class Encoder extends CharsetEncoder {
+    final public static class Encoder extends CharsetEncoder
+                                      implements ArrayEncoder {
         private Surrogate.Parser sgp;
         private final char[] c2b;
         private final char[] c2bIndex;
@@ -125,6 +147,11 @@
             return encode(c) != UNMAPPABLE_ENCODING;
         }
 
+        public boolean isLegalReplacement(byte[] repl) {
+            return ((repl.length == 1 && repl[0] == (byte)'?') ||
+                    super.isLegalReplacement(repl));
+        }
+
         private CoderResult encodeArrayLoop(CharBuffer src, ByteBuffer dst) {
             char[] sa = src.array();
             int sp = src.arrayOffset() + src.position();
@@ -200,6 +227,34 @@
                 return UNMAPPABLE_ENCODING;
             return c2b[index + (ch & 0xff)];
         }
+
+        private byte repl = (byte)'?';
+        protected void implReplaceWith(byte[] newReplacement) {
+            repl = newReplacement[0];
+        }
+
+        public int encode(char[] src, int sp, int len, byte[] dst) {
+            int dp = 0;
+            int sl = sp + Math.min(len, dst.length);
+            while (sp < sl) {
+                char c = src[sp++];
+                int b = encode(c);
+                if (b != UNMAPPABLE_ENCODING) {
+                    dst[dp++] = (byte)b;
+                    continue;
+                }
+                if (Surrogate.isHigh(c) && sp < sl &&
+                    Surrogate.isLow(src[sp])) {
+                    if (len > dst.length) {
+                        sl++;
+                        len--;
+                    }
+                    sp++;
+                }
+                dst[dp++] = repl;
+            }
+            return dp;
+        }
     }
 
     // init the c2b and c2bIndex tables from b2c.
--- a/jdk/src/share/classes/sun/nio/cs/US_ASCII.java	Thu Apr 02 10:49:41 2009 -0700
+++ b/jdk/src/share/classes/sun/nio/cs/US_ASCII.java	Thu Apr 02 17:01:00 2009 -0700
@@ -31,10 +31,7 @@
 import java.nio.charset.CharsetDecoder;
 import java.nio.charset.CharsetEncoder;
 import java.nio.charset.CoderResult;
-import java.nio.charset.CharacterCodingException;
-import java.nio.charset.MalformedInputException;
-import java.nio.charset.UnmappableCharacterException;
-
+import java.util.Arrays;
 
 public class US_ASCII
     extends Charset
@@ -61,7 +58,8 @@
         return new Encoder(this);
     }
 
-    private static class Decoder extends CharsetDecoder {
+    private static class Decoder extends CharsetDecoder
+                                 implements ArrayDecoder {
 
         private Decoder(Charset cs) {
             super(cs, 1.0f, 1.0f);
@@ -131,9 +129,27 @@
                 return decodeBufferLoop(src, dst);
         }
 
+        private char repl = '\uFFFD';
+        protected void implReplaceWith(String newReplacement) {
+            repl = newReplacement.charAt(0);
+        }
+
+        public int decode(byte[] src, int sp, int len, char[] dst) {
+            int dp = 0;
+            len = Math.min(len, dst.length);
+            while (dp < len) {
+                byte b = src[sp++];
+                if (b >= 0)
+                    dst[dp++] = (char)b;
+                else
+                    dst[dp++] = repl;
+            }
+            return dp;
+        }
     }
 
-    private static class Encoder extends CharsetEncoder {
+    private static class Encoder extends CharsetEncoder
+                                 implements ArrayEncoder {
 
         private Encoder(Charset cs) {
             super(cs, 1.0f, 1.0f);
@@ -143,8 +159,11 @@
             return c < 0x80;
         }
 
+        public boolean isLegalReplacement(byte[] repl) {
+            return (repl.length == 1 && repl[0] >= 0);
+        }
+
         private final Surrogate.Parser sgp = new Surrogate.Parser();
-
         private CoderResult encodeArrayLoop(CharBuffer src,
                                             ByteBuffer dst)
         {
@@ -213,6 +232,32 @@
                 return encodeBufferLoop(src, dst);
         }
 
+        private byte repl = (byte)'?';
+        protected void implReplaceWith(byte[] newReplacement) {
+            repl = newReplacement[0];
+        }
+
+        public int encode(char[] src, int sp, int len, byte[] dst) {
+            int dp = 0;
+            int sl = sp + Math.min(len, dst.length);
+            while (sp < sl) {
+                char c = src[sp++];
+                if (c < 0x80) {
+                    dst[dp++] = (byte)c;
+                    continue;
+                }
+                if (Surrogate.isHigh(c) && sp < sl &&
+                    Surrogate.isLow(src[sp])) {
+                    if (len > dst.length) {
+                        sl++;
+                        len--;
+                    }
+                    sp++;
+                }
+                dst[dp++] = repl;
+            }
+            return dp;
+        }
     }
 
 }
--- a/jdk/src/share/classes/sun/security/jgss/spnego/NegTokenInit.java	Thu Apr 02 10:49:41 2009 -0700
+++ b/jdk/src/share/classes/sun/security/jgss/spnego/NegTokenInit.java	Thu Apr 02 17:01:00 2009 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2009 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -66,11 +66,11 @@
     private byte[] mechTypes = null;
     private Oid[] mechTypeList = null;
 
-    private byte[] reqFlags = null;
+    private BitArray reqFlags = null;
     private byte[] mechToken = null;
     private byte[] mechListMIC = null;
 
-    NegTokenInit(byte[] mechTypes, byte[] flags,
+    NegTokenInit(byte[] mechTypes, BitArray flags,
                 byte[] token, byte[] mechListMIC)
     {
         super(NEG_TOKEN_INIT_ID);
@@ -101,7 +101,7 @@
             // write context flags with CONTEXT 01
             if (reqFlags != null) {
                 DerOutputStream flags = new DerOutputStream();
-                flags.putBitString(reqFlags);
+                flags.putUnalignedBitString(reqFlags);
                 initToken.write(DerValue.createTag(DerValue.TAG_CONTEXT,
                                                 true, (byte) 0x01), flags);
             }
@@ -237,7 +237,7 @@
         return mechTypeList;
     }
 
-    byte[] getReqFlags() {
+    BitArray getReqFlags() {
         return reqFlags;
     }
 
--- a/jdk/src/share/classes/sun/security/jgss/spnego/SpNegoContext.java	Thu Apr 02 10:49:41 2009 -0700
+++ b/jdk/src/share/classes/sun/security/jgss/spnego/SpNegoContext.java	Thu Apr 02 17:01:00 2009 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005-2008 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2009 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -53,13 +53,6 @@
 
     private int state = STATE_NEW;
 
-    private static final int CHECKSUM_DELEG_FLAG    = 1;
-    private static final int CHECKSUM_MUTUAL_FLAG   = 2;
-    private static final int CHECKSUM_REPLAY_FLAG   = 4;
-    private static final int CHECKSUM_SEQUENCE_FLAG = 8;
-    private static final int CHECKSUM_CONF_FLAG     = 16;
-    private static final int CHECKSUM_INTEG_FLAG    = 32;
-
     /*
      * Optional features that the application can set and their default
      * values.
@@ -697,25 +690,17 @@
     /**
      * get the context flags
      */
-    private byte[] getContextFlags() {
-        int flags = 0;
+    private BitArray getContextFlags() {
+        BitArray out = new BitArray(7);
 
-        if (getCredDelegState())
-            flags |= CHECKSUM_DELEG_FLAG;
-        if (getMutualAuthState())
-            flags |= CHECKSUM_MUTUAL_FLAG;
-        if (getReplayDetState())
-            flags |= CHECKSUM_REPLAY_FLAG;
-        if (getSequenceDetState())
-            flags |= CHECKSUM_SEQUENCE_FLAG;
-        if (getIntegState())
-            flags |= CHECKSUM_INTEG_FLAG;
-        if (getConfState())
-            flags |= CHECKSUM_CONF_FLAG;
+        if (getCredDelegState()) out.set(0, true);
+        if (getMutualAuthState()) out.set(1, true);
+        if (getReplayDetState()) out.set(2, true);
+        if (getSequenceDetState()) out.set(3, true);
+        if (getConfState()) out.set(5, true);
+        if (getIntegState()) out.set(6, true);
 
-        byte[] temp = new byte[1];
-        temp[0] = (byte)(flags & 0xff);
-        return temp;
+        return out;
     }
 
     private void setContextFlags() {
--- a/jdk/src/share/classes/sun/security/provider/certpath/OCSPResponse.java	Thu Apr 02 10:49:41 2009 -0700
+++ b/jdk/src/share/classes/sun/security/provider/certpath/OCSPResponse.java	Thu Apr 02 17:01:00 2009 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2003-2008 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2003-2009 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,8 +28,6 @@
 import java.io.*;
 import java.math.BigInteger;
 import java.security.*;
-import java.security.cert.Certificate;
-import java.security.cert.CertificateFactory;
 import java.security.cert.CertPathValidatorException;
 import java.security.cert.CRLReason;
 import java.security.cert.X509Certificate;
@@ -335,7 +333,7 @@
 
             // Check whether the cert returned by the responder is trusted
             if (x509Certs != null && x509Certs[0] != null) {
-                X509Certificate cert = x509Certs[0];
+                X509CertImpl cert = x509Certs[0];
 
                 // First check if the cert matches the responder cert which
                 // was set locally.
@@ -344,8 +342,8 @@
 
                 // Next check if the cert was issued by the responder cert
                 // which was set locally.
-                } else if (cert.getIssuerDN().equals(
-                    responderCert.getSubjectDN())) {
+                } else if (cert.getIssuerX500Principal().equals(
+                    responderCert.getSubjectX500Principal())) {
 
                     // Check for the OCSPSigning key purpose
                     List<String> keyPurposes = cert.getExtendedKeyUsage();
@@ -360,6 +358,43 @@
                             "OCSP responses");
                     }
 
+                    // check the validity
+                    try {
+                        Date dateCheckedAgainst = params.getDate();
+                        if (dateCheckedAgainst == null) {
+                            cert.checkValidity();
+                        } else {
+                            cert.checkValidity(dateCheckedAgainst);
+                        }
+                    } catch (GeneralSecurityException e) {
+                        if (DEBUG != null) {
+                            DEBUG.println("Responder's certificate is not " +
+                                "within the validity period.");
+                        }
+                        throw new CertPathValidatorException(
+                            "Responder's certificate not within the " +
+                            "validity period");
+                    }
+
+                    // check for revocation
+                    //
+                    // A CA may specify that an OCSP client can trust a
+                    // responder for the lifetime of the responder's
+                    // certificate. The CA does so by including the
+                    // extension id-pkix-ocsp-nocheck.
+                    //
+                    Extension noCheck =
+                            cert.getExtension(PKIXExtensions.OCSPNoCheck_Id);
+                    if (noCheck != null) {
+                        if (DEBUG != null) {
+                            DEBUG.println("Responder's certificate includes " +
+                                "the extension id-pkix-ocsp-nocheck.");
+                        }
+                    } else {
+                        // we should do the revocating checking of the
+                        // authorized responder in a future update.
+                    }
+
                     // verify the signature
                     try {
                         cert.verify(responderCert.getPublicKey());
@@ -369,6 +404,14 @@
                     } catch (GeneralSecurityException e) {
                         responderCert = null;
                     }
+                } else {
+                    if (DEBUG != null) {
+                        DEBUG.println("Responder's certificate is not " +
+                            "authorized to sign OCSP responses.");
+                    }
+                    throw new CertPathValidatorException(
+                        "Responder's certificate not authorized to sign " +
+                        "OCSP responses");
                 }
             }
 
--- a/jdk/src/share/classes/sun/security/provider/certpath/PKIXMasterCertPathValidator.java	Thu Apr 02 10:49:41 2009 -0700
+++ b/jdk/src/share/classes/sun/security/provider/certpath/PKIXMasterCertPathValidator.java	Thu Apr 02 17:01:00 2009 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000-2008 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2000-2009 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -143,11 +143,15 @@
                     }
 
                 } catch (CertPathValidatorException cpve) {
-                    // Throw the saved OCSP exception
-                    // (when the CRL check has also failed)
+                    // Throw the saved OCSP exception unless the CRL
+                    // checker has determined that the cert is revoked
                     if (ocspCause != null &&
-                        currChecker instanceof CrlRevocationChecker) {
-                        throw ocspCause;
+                            currChecker instanceof CrlRevocationChecker) {
+                        if (cpve.getReason() == BasicReason.REVOKED) {
+                            throw cpve;
+                        } else {
+                            throw ocspCause;
+                        }
                     }
                     /*
                      * Handle failover from OCSP to CRLs
--- a/jdk/src/share/classes/sun/security/tools/KeyTool.java	Thu Apr 02 10:49:41 2009 -0700
+++ b/jdk/src/share/classes/sun/security/tools/KeyTool.java	Thu Apr 02 17:01:00 2009 -0700
@@ -875,6 +875,18 @@
             if (filename != null) {
                 inStream = new FileInputStream(filename);
             }
+            // Read the full stream before feeding to X509Factory,
+            // otherwise, keytool -gencert | keytool -importcert
+            // might not work properly, since -gencert is slow
+            // and there's no data in the pipe at the beginning.
+            ByteArrayOutputStream bout = new ByteArrayOutputStream();
+            byte[] b = new byte[4096];
+            while (true) {
+                int len = inStream.read(b);
+                if (len < 0) break;
+                bout.write(b, 0, len);
+            }
+            inStream = new ByteArrayInputStream(bout.toByteArray());
             try {
                 String importAlias = (alias!=null)?alias:keyAlias;
                 if (keyStore.entryInstanceOf(importAlias, KeyStore.PrivateKeyEntry.class)) {
@@ -1060,8 +1072,8 @@
 
         X509CertInfo info = new X509CertInfo();
         info.set(X509CertInfo.VALIDITY, interval);
-        info.set(X509CertInfo.SERIAL_NUMBER, new CertificateSerialNumber
-                 ((int)(firstDate.getTime()/1000)));
+        info.set(X509CertInfo.SERIAL_NUMBER, new CertificateSerialNumber(
+                    new java.util.Random().nextInt() & 0x7fffffff));
         info.set(X509CertInfo.VERSION,
                      new CertificateVersion(CertificateVersion.V3));
         info.set(X509CertInfo.ALGORITHM_ID,
@@ -2109,8 +2121,8 @@
         certInfo.set(X509CertInfo.VALIDITY, interval);
 
         // Make new serial number
-        certInfo.set(X509CertInfo.SERIAL_NUMBER, new CertificateSerialNumber
-                     ((int)(firstDate.getTime()/1000)));
+        certInfo.set(X509CertInfo.SERIAL_NUMBER, new CertificateSerialNumber(
+                    new java.util.Random().nextInt() & 0x7fffffff));
 
         // Set owner and issuer fields
         X500Name owner;
--- a/jdk/src/share/classes/sun/security/x509/CertAndKeyGen.java	Thu Apr 02 10:49:41 2009 -0700
+++ b/jdk/src/share/classes/sun/security/x509/CertAndKeyGen.java	Thu Apr 02 17:01:00 2009 -0700
@@ -265,8 +265,8 @@
             // Add all mandatory attributes
             info.set(X509CertInfo.VERSION,
                      new CertificateVersion(CertificateVersion.V3));
-            info.set(X509CertInfo.SERIAL_NUMBER,
-                 new CertificateSerialNumber((int)(firstDate.getTime()/1000)));
+            info.set(X509CertInfo.SERIAL_NUMBER, new CertificateSerialNumber(
+                    new java.util.Random().nextInt() & 0x7fffffff));
             AlgorithmId algID = issuer.getAlgorithmId();
             info.set(X509CertInfo.ALGORITHM_ID,
                      new CertificateAlgorithmId(algID));
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/classes/sun/security/x509/OCSPNoCheckExtension.java	Thu Apr 02 17:01:00 2009 -0700
@@ -0,0 +1,132 @@
+/*
+ * Copyright 2009 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package sun.security.x509;
+
+import java.io.IOException;
+import java.io.OutputStream;
+import java.util.Enumeration;
+
+import sun.security.util.*;
+
+/**
+ * Represent the OCSP NoCheck Extension from RFC2560.
+ * <p>
+ * A CA may specify that an OCSP client can trust a responder for the
+ * lifetime of the responder's certificate. The CA does so by including
+ * the extension id-pkix-ocsp-nocheck. This SHOULD be a non-critical
+ * extension. The value of the extension should be NULL. CAs issuing
+ * such a certificate should realized that a compromise of the
+ * responder's key, is as serious as the compromise of a CA key used to
+ * sign CRLs, at least for the validity period of this certificate. CA's
+ * may choose to issue this type of certificate with a very short
+ * lifetime and renew it frequently.
+ * <pre>
+ * id-pkix-ocsp-nocheck OBJECT IDENTIFIER ::= { id-pkix-ocsp 5 }
+ * </pre>
+ *
+ * @author Xuelei Fan
+ * @see Extension
+ * @see CertAttrSet
+ */
+public class OCSPNoCheckExtension extends Extension
+    implements CertAttrSet<String> {
+
+    /**
+     * Identifier for this attribute, to be used with the
+     * get, set, delete methods of Certificate, x509 type.
+     */
+    public static final String IDENT =
+                         "x509.info.extensions.OCSPNoCheck";
+    /**
+     * Attribute names.
+     */
+    public static final String NAME = "OCSPNoCheck";
+
+    /**
+     * Create a OCSPNoCheckExtension
+     */
+    public OCSPNoCheckExtension() throws IOException {
+        this.extensionId = PKIXExtensions.OCSPNoCheck_Id;
+        this.critical = false;
+        this.extensionValue = new byte[0];
+    }
+
+    /**
+     * Create the extension from the passed DER encoded value.
+     *
+     * @param critical true if the extension is to be treated as critical.
+     * @param value an array of DER encoded bytes of the actual value.
+     * @exception IOException on error.
+     */
+    public OCSPNoCheckExtension(Boolean critical, Object value)
+        throws IOException {
+
+        this.extensionId = PKIXExtensions.OCSPNoCheck_Id;
+        this.critical = critical.booleanValue();
+
+        // the value should be null, just ignore it here.
+        this.extensionValue = new byte[0];
+    }
+
+    /**
+     * Set the attribute value.
+     */
+    public void set(String name, Object obj) throws IOException {
+        throw new IOException("No attribute is allowed by " +
+                        "CertAttrSet:OCSPNoCheckExtension.");
+    }
+
+    /**
+     * Get the attribute value.
+     */
+    public Object get(String name) throws IOException {
+        throw new IOException("No attribute is allowed by " +
+                        "CertAttrSet:OCSPNoCheckExtension.");
+    }
+
+    /**
+     * Delete the attribute value.
+     */
+    public void delete(String name) throws IOException {
+        throw new IOException("No attribute is allowed by " +
+                        "CertAttrSet:OCSPNoCheckExtension.");
+    }
+
+    /**
+     * Return an enumeration of names of attributes existing within this
+     * attribute.
+     */
+    public Enumeration<String> getElements() {
+        return (new AttributeNameEnumeration()).elements();
+    }
+
+    /**
+     * Return the name of this attribute.
+     */
+    public String getName() {
+        return NAME;
+    }
+}
--- a/jdk/src/share/classes/sun/security/x509/OIDMap.java	Thu Apr 02 10:49:41 2009 -0700
+++ b/jdk/src/share/classes/sun/security/x509/OIDMap.java	Thu Apr 02 17:01:00 2009 -0700
@@ -100,6 +100,8 @@
                                         DeltaCRLIndicatorExtension.NAME;
     private static final String FRESHEST_CRL = ROOT + "." +
                                         FreshestCRLExtension.NAME;
+    private static final String OCSPNOCHECK = ROOT + "." +
+                                        OCSPNoCheckExtension.NAME;
 
     private static final int NetscapeCertType_data[] =
         { 2, 16, 840, 1, 113730, 1, 1 };
@@ -161,6 +163,8 @@
                     "sun.security.x509.DeltaCRLIndicatorExtension");
         addInternal(FRESHEST_CRL, PKIXExtensions.FreshestCRL_Id,
                     "sun.security.x509.FreshestCRLExtension");
+        addInternal(OCSPNOCHECK, PKIXExtensions.OCSPNoCheck_Id,
+                    "sun.security.x509.OCSPNoCheckExtension");
     }
 
     /**
--- a/jdk/src/share/classes/sun/security/x509/PKIXExtensions.java	Thu Apr 02 10:49:41 2009 -0700
+++ b/jdk/src/share/classes/sun/security/x509/PKIXExtensions.java	Thu Apr 02 17:01:00 2009 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 1997-2005 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-2009 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -74,6 +74,8 @@
     private static final int AuthInfoAccess_data [] = { 1, 3, 6, 1, 5, 5, 7, 1, 1};
     private static final int SubjectInfoAccess_data [] = { 1, 3, 6, 1, 5, 5, 7, 1, 11};
     private static final int FreshestCRL_data [] = { 2, 5, 29, 46 };
+    private static final int OCSPNoCheck_data [] = { 1, 3, 6, 1, 5, 5, 7,
+                                                    48, 1, 5};
 
     /**
      * Identifies the particular public key used to sign the certificate.
@@ -216,6 +218,12 @@
      */
     public static final ObjectIdentifier FreshestCRL_Id;
 
+    /**
+     * Identifies the OCSP client can trust the responder for the
+     * lifetime of the responder's certificate.
+     */
+    public static final ObjectIdentifier OCSPNoCheck_Id;
+
     static {
         AuthorityKey_Id = ObjectIdentifier.newInternal(AuthorityKey_data);
         SubjectKey_Id   = ObjectIdentifier.newInternal(SubjectKey_data);
@@ -257,5 +265,6 @@
         SubjectInfoAccess_Id =
             ObjectIdentifier.newInternal(SubjectInfoAccess_data);
         FreshestCRL_Id = ObjectIdentifier.newInternal(FreshestCRL_data);
+        OCSPNoCheck_Id = ObjectIdentifier.newInternal(OCSPNoCheck_data);
     }
 }
--- a/jdk/src/solaris/classes/sun/nio/ch/UnixAsynchronousSocketChannelImpl.java	Thu Apr 02 10:49:41 2009 -0700
+++ b/jdk/src/solaris/classes/sun/nio/ch/UnixAsynchronousSocketChannelImpl.java	Thu Apr 02 17:01:00 2009 -0700
@@ -16,7 +16,7 @@
  *
  * You should have received a copy of the GNU General Public License version
  * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA conne02110-1301 USA.
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  *
  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
  * CA 95054 USA or visit www.sun.com if you need additional information or
--- a/jdk/src/windows/classes/sun/nio/ch/WindowsAsynchronousSocketChannelImpl.java	Thu Apr 02 10:49:41 2009 -0700
+++ b/jdk/src/windows/classes/sun/nio/ch/WindowsAsynchronousSocketChannelImpl.java	Thu Apr 02 17:01:00 2009 -0700
@@ -16,7 +16,7 @@
  *
  * You should have received a copy of the GNU General Public License version
  * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA conne02110-1301 USA.
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  *
  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
  * CA 95054 USA or visit www.sun.com if you need additional information or
--- a/jdk/test/com/sun/jmx/snmp/SnmpOidHashCode.java	Thu Apr 02 10:49:41 2009 -0700
+++ b/jdk/test/com/sun/jmx/snmp/SnmpOidHashCode.java	Thu Apr 02 17:01:00 2009 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2003 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2003-2008 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,7 +28,8 @@
  * @build   SnmpOidHashCode
  * @run     main SnmpOidHashCode
  */
-import com.sun.jmx.snmp.SnmpOid;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
 
 public class SnmpOidHashCode {
     public static final String[] oids = {
@@ -57,16 +58,81 @@
         ".39."+0xFFFFFFFFL
     };
 
+    // We use an SnmpOidBuilder in order to adapt this test case to a
+    // configuration where the SNMP packages are not present in rt.jar.
+    //
+    public static final class SnmpOidBuilder {
+        public static final String SNMP_OID_CLASS_NAME =
+            "com.sun.jmx.snmp.SnmpOid";
+        private static final Class<?> SNMP_OID_CLASS;
+        private static final Constructor<?> SNMP_OID_CTOR;
+        static {
+            Class<?> snmpOidClass;
+            try {
+                snmpOidClass =
+                    Class.forName(SNMP_OID_CLASS_NAME, true, null);
+            } catch (ClassNotFoundException x) {
+                snmpOidClass = null;
+                System.err.println("WARNING: can't load "+SNMP_OID_CLASS_NAME);
+            } catch (NoClassDefFoundError x) {
+                snmpOidClass = null;
+                System.err.println("WARNING: can't load "+SNMP_OID_CLASS_NAME);
+            }
+            SNMP_OID_CLASS = snmpOidClass;
+            if (SNMP_OID_CLASS != null) {
+                try {
+                  SNMP_OID_CTOR = snmpOidClass.getConstructor(String.class);
+                } catch (Exception x) {
+                    throw new ExceptionInInitializerError(x);
+                }
+            } else {
+                SNMP_OID_CTOR = null;
+            }
+        }
+
+        public static boolean isSnmpPresent() {
+            System.out.println(SnmpOidHashCode.class.getName()+
+                    ": Testing for SNMP Packages...");
+            return SNMP_OID_CLASS != null;
+        }
+
+        public static Object newSnmpOid(String oid)
+            throws InstantiationException,
+                   IllegalAccessException,
+                   InvocationTargetException {
+            return SNMP_OID_CTOR.newInstance(oid);
+        }
+
+    }
+
+    private static Object newSnmpOid(String oid) throws Exception {
+        try {
+            return SnmpOidBuilder.newSnmpOid(oid);
+        } catch (InvocationTargetException x) {
+            final Throwable cause = x.getCause();
+            if (cause instanceof Exception) throw (Exception)cause;
+            if (cause instanceof Error) throw (Error)cause;
+            throw x;
+        }
+    }
+
     public static void main(String args[]) {
+        if (!SnmpOidBuilder.isSnmpPresent()) {
+            System.err.println("WARNING: "+
+                    SnmpOidBuilder.SNMP_OID_CLASS_NAME+" not present.");
+            System.err.println(SnmpOidHashCode.class.getName()+
+                    ": test skipped.");
+            return;
+        }
         try {
             int errCount=0;
             int collisions=0;
             for (int i=0;i<oids.length;i++) {
                 System.out.println("Testing " + oids[i]);
-                final SnmpOid o1 = new SnmpOid(oids[i]);
+                final Object o1 = newSnmpOid(oids[i]);
                 final int startCount=errCount;
                 for (int j=0;j<oids.length;j++) {
-                    final SnmpOid o2 = new SnmpOid(oids[j]);
+                    final Object o2 = newSnmpOid(oids[j]);
                     if (o1.equals(o2)) {
                         if (!(oids[i].equals(oids[j]))) {
                             System.err.println("OIDs differ but " +
--- a/jdk/test/com/sun/jmx/snmp/TimeTicksWrapping.java	Thu Apr 02 10:49:41 2009 -0700
+++ b/jdk/test/com/sun/jmx/snmp/TimeTicksWrapping.java	Thu Apr 02 17:01:00 2009 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2003 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2003-2008 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -29,33 +29,158 @@
  * @build   TimeTicksWrapping
  * @run     main TimeTicksWrapping
  */
-import com.sun.jmx.snmp.SnmpTimeticks;
-import com.sun.jmx.snmp.SnmpUnsignedInt;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
 
 public class TimeTicksWrapping {
+    // We use an SnmpTimeticksBuilder in order to adapt this test case to a
+    // configuration where the SNMP packages are not present in rt.jar.
+    //
+    public static final class SnmpTimeticksBuilder {
+        public static final long   MAX_VALUE = 0x0ffffffffL;
+        public static final String SNMP_TIME_TICKS_CLASS_NAME =
+            "com.sun.jmx.snmp.SnmpTimeticks";
+        private static final Class<?> SNMP_TIME_TICKS_CLASS;
+        private static final Constructor<?> SNMP_long_CTOR;
+        private static final Constructor<?> SNMP_LONG_CTOR;
+        private static final Method SNMP_LONG_VALUE;
+        static {
+            Class<?> snmpTimeTicksClass;
+            try {
+                snmpTimeTicksClass =
+                    Class.forName(SNMP_TIME_TICKS_CLASS_NAME, true, null);
+            } catch (ClassNotFoundException x) {
+                snmpTimeTicksClass = null;
+                System.err.println("WARNING: can't load "+
+                        SNMP_TIME_TICKS_CLASS_NAME);
+            } catch (NoClassDefFoundError x) {
+                snmpTimeTicksClass = null;
+                System.err.println("WARNING: can't load "+
+                        SNMP_TIME_TICKS_CLASS_NAME);
+            }
+            SNMP_TIME_TICKS_CLASS = snmpTimeTicksClass;
+            if (SNMP_TIME_TICKS_CLASS != null) {
+                try {
+                  SNMP_long_CTOR =
+                          SNMP_TIME_TICKS_CLASS.getConstructor(long.class);
+                } catch (Exception x) {
+                    throw new ExceptionInInitializerError(x);
+                }
+            } else {
+                SNMP_long_CTOR = null;
+            }
+            if (SNMP_TIME_TICKS_CLASS != null) {
+                try {
+                  SNMP_LONG_CTOR =
+                          SNMP_TIME_TICKS_CLASS.getConstructor(Long.class);
+                } catch (Exception x) {
+                    throw new ExceptionInInitializerError(x);
+                }
+            } else {
+                SNMP_LONG_CTOR = null;
+            }
+            if (SNMP_TIME_TICKS_CLASS != null) {
+                try {
+                  SNMP_LONG_VALUE =
+                          SNMP_TIME_TICKS_CLASS.getMethod("longValue");
+                } catch (Exception x) {
+                    throw new ExceptionInInitializerError(x);
+                }
+            } else {
+                SNMP_LONG_VALUE = null;
+            }
+
+        }
+
+        private final Object timeticks;
+
+        public SnmpTimeticksBuilder(long ticks) throws Exception {
+            timeticks = newSnmpTimeticks(ticks);
+        }
+        public SnmpTimeticksBuilder(Long ticks) throws Exception {
+            timeticks = newSnmpTimeticks(ticks);
+        }
+        public long longValue() throws Exception {
+            return longValue(timeticks);
+        }
+
+        public static boolean isSnmpPresent() {
+            System.out.println(TimeTicksWrapping.class.getName()+
+                    ": Testing for SNMP Packages...");
+            return SNMP_TIME_TICKS_CLASS != null;
+        }
+
+        private static Object newSnmpTimeticks(long time)
+                throws Exception {
+            try {
+                return SNMP_long_CTOR.newInstance(time);
+            } catch (InvocationTargetException x) {
+                final Throwable cause = x.getCause();
+                if (cause instanceof Exception) throw (Exception) cause;
+                if (cause instanceof Error) throw (Error) cause;
+                throw x;
+            }
+        }
+
+        private static Object newSnmpTimeticks(Long time)
+            throws Exception {
+            try {
+                return SNMP_LONG_CTOR.newInstance(time);
+            } catch (InvocationTargetException x) {
+                final Throwable cause = x.getCause();
+                if (cause instanceof Exception) throw (Exception) cause;
+                if (cause instanceof Error) throw (Error) cause;
+                throw x;
+            }
+        }
+
+        private static long longValue(Object o)
+                throws Exception {
+            try {
+                return ((Long)SNMP_LONG_VALUE.invoke(o)).longValue();
+            } catch (InvocationTargetException x) {
+                final Throwable cause = x.getCause();
+                if (cause instanceof Exception) throw (Exception) cause;
+                if (cause instanceof Error) throw (Error) cause;
+                throw x;
+            }
+        }
+
+    }
+
     public static final long[] oks = {
         0L, 1L, (long)Integer.MAX_VALUE, (long)Integer.MAX_VALUE*2,
         (long)Integer.MAX_VALUE*2+1L, (long)Integer.MAX_VALUE*2+2L,
         (long)Integer.MAX_VALUE*3,
-        SnmpUnsignedInt.MAX_VALUE, SnmpUnsignedInt.MAX_VALUE+1L,
-        SnmpUnsignedInt.MAX_VALUE*3-1L, Long.MAX_VALUE
+        SnmpTimeticksBuilder.MAX_VALUE, SnmpTimeticksBuilder.MAX_VALUE+1L,
+        SnmpTimeticksBuilder.MAX_VALUE*3-1L, Long.MAX_VALUE
     };
 
     public static final long[] kos = {
         -1L, (long)Integer.MIN_VALUE, (long)Integer.MIN_VALUE*2,
         (long)Integer.MIN_VALUE*2-1L, (long)Integer.MIN_VALUE*3,
-        -SnmpUnsignedInt.MAX_VALUE, -(SnmpUnsignedInt.MAX_VALUE+1L),
-        -(SnmpUnsignedInt.MAX_VALUE*3-1L), Long.MIN_VALUE
+        -SnmpTimeticksBuilder.MAX_VALUE, -(SnmpTimeticksBuilder.MAX_VALUE+1L),
+        -(SnmpTimeticksBuilder.MAX_VALUE*3-1L), Long.MIN_VALUE
     };
 
+
     public static void main(String args[]) {
+        if (!SnmpTimeticksBuilder.isSnmpPresent()) {
+            System.err.println("WARNING: "+
+                    SnmpTimeticksBuilder.SNMP_TIME_TICKS_CLASS_NAME+
+                    " not present.");
+            System.err.println(TimeTicksWrapping.class.getName()+
+                    ": test skipped.");
+            return;
+        }
         try {
-            SnmpTimeticks t;
+            SnmpTimeticksBuilder t = null;
 
             for (int i=0;i<oks.length;i++) {
                 final long t1,t2,t3;
-                t1 = (new SnmpTimeticks(oks[i])).longValue();
-                t2 = (new SnmpTimeticks(new Long(oks[i]))).longValue();
+                t1 = (new SnmpTimeticksBuilder(oks[i])).longValue();
+                t2 = (new SnmpTimeticksBuilder(new Long(oks[i]))).longValue();
                 t3 = oks[i]%0x0100000000L;
                 if (t1 != t3)
                     throw new Exception("Value should have wrapped: " +
@@ -64,16 +189,16 @@
                     throw new Exception("Value should have wrapped: " +
                                         "Long("+oks[i]+") expected: " + t3);
 
-                if (t1 > SnmpUnsignedInt.MAX_VALUE)
+                if (t1 > SnmpTimeticksBuilder.MAX_VALUE)
                     throw new Exception("Value should have wrapped " +
                                         "for " + oks[i] + ": " +
                                         t1 + " exceeds max: " +
-                                        SnmpUnsignedInt.MAX_VALUE);
-                if (t2 > SnmpUnsignedInt.MAX_VALUE)
+                                        SnmpTimeticksBuilder.MAX_VALUE);
+                if (t2 > SnmpTimeticksBuilder.MAX_VALUE)
                     throw new Exception("Value should have wrapped " +
                                         "for " + oks[i] + ": " +
                                         t2 + " exceeds max: " +
-                                        SnmpUnsignedInt.MAX_VALUE);
+                                        SnmpTimeticksBuilder.MAX_VALUE);
 
                 if (t1 < 0)
                     throw new Exception("Value should have wrapped: " +
@@ -90,14 +215,14 @@
 
             for (int i=0;i<kos.length;i++) {
                 try {
-                    t = new SnmpTimeticks(kos[i]);
+                    t = new SnmpTimeticksBuilder(kos[i]);
                     throw new Exception("Value should have been rejected: " +
                                         kos[i]);
                 } catch (IllegalArgumentException x) {
                     // OK!
                 }
                 try {
-                    t = new SnmpTimeticks(new Long(kos[i]));
+                    t = new SnmpTimeticksBuilder(new Long(kos[i]));
                     throw new Exception("Value should have been rejected: " +
                                         "Long("+kos[i]+")");
                 } catch (IllegalArgumentException x) {
--- a/jdk/test/java/awt/Frame/FrameSize/TestFrameSize.java	Thu Apr 02 10:49:41 2009 -0700
+++ b/jdk/test/java/awt/Frame/FrameSize/TestFrameSize.java	Thu Apr 02 17:01:00 2009 -0700
@@ -15,6 +15,10 @@
  * You should have received a copy of the GNU General Public License version
  * 2 along with this work; if not, write to the Free Software Foundation,
  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
  */
 
 /*
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/security/cert/CertPathValidator/OCSP/FailoverToCRL.java	Thu Apr 02 17:01:00 2009 -0700
@@ -0,0 +1,265 @@
+/*
+ * Copyright 2009 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+/**
+ * @test
+ * @bug 6383095
+ * @summary CRL revoked certificate failures masked by OCSP failures
+ *
+ * Note that the certificate validity is from Mar 16 14:55:35 2009 GMT to
+ * Dec 1 14:55:35 2028 GMT, please update it with newer certificate if
+ * expires.
+ *
+ * @author Xuelei Fan
+ */
+
+/*
+ * Certificates used in the test.
+ *
+ * end entity certificate:
+ * Data:
+ *     Version: 3 (0x2)
+ *     Serial Number: 25 (0x19)
+ *     Signature Algorithm: md5WithRSAEncryption
+ *     Issuer: C=US, ST=Some-State, L=Some-City, O=Some-Org
+ *     Validity
+ *         Not Before: Mar 16 14:55:35 2009 GMT
+ *         Not After : Dec  1 14:55:35 2028 GMT
+ *     Subject: C=US, ST=Some-State, L=Some-City, O=Some-Org, OU=SSL-Client,
+ *              CN=localhost
+ *     Subject Public Key Info:
+ *         Public Key Algorithm: rsaEncryption
+ *         RSA Public Key: (1024 bit)
+ *             Modulus (1024 bit):
+ *                 00:bb:f0:40:36:ac:26:54:4e:f4:a3:5a:00:2f:69:
+ *                 21:6f:b9:7a:3a:93:ec:a2:f6:e1:8e:c7:63:d8:2f:
+ *                 12:30:99:2e:b0:f2:8f:f8:27:2d:24:78:28:84:f7:
+ *                 01:bf:8d:44:79:dd:3b:d2:55:f3:ce:3c:b2:5b:21:
+ *                 7d:ef:fd:33:4a:b1:a3:ff:c6:c8:9b:b9:0f:7c:41:
+ *                 35:97:f9:db:3a:05:60:05:15:af:59:17:92:a3:10:
+ *                 ad:16:1c:e4:07:53:af:a8:76:a2:56:2a:92:d3:f9:
+ *                 28:e0:78:cf:5e:1f:48:ab:5c:19:dd:e1:67:43:ba:
+ *                 75:8d:f5:82:ac:43:92:44:1b
+ *             Exponent: 65537 (0x10001)
+ *     X509v3 extensions:
+ *         X509v3 Basic Constraints:
+ *             CA:FALSE
+ *         X509v3 Key Usage:
+ *             Digital Signature, Non Repudiation, Key Encipherment
+ *         X509v3 Subject Key Identifier:
+ *             CD:BB:C8:85:AA:91:BD:FD:1D:BE:CD:67:7C:FF:B3:E9:4C:A8:22:E6
+ *         X509v3 Authority Key Identifier:
+ *             keyid:FA:B9:51:BF:4C:E7:D9:86:98:33:F9:E7:CB:1E:F1:33:49:F7:A8:14
+ * Signature Algorithm: md5WithRSAEncryption
+ *
+ *
+ * trusted certificate authority:
+ * Data:
+ *     Version: 3 (0x2)
+ *     Serial Number: 0 (0x0)
+ *     Signature Algorithm: md5WithRSAEncryption
+ *     Issuer: C=US, ST=Some-State, L=Some-City, O=Some-Org
+ *     Validity
+ *         Not Before: Dec  8 02:43:36 2008 GMT
+ *         Not After : Aug 25 02:43:36 2028 GMT
+ *     Subject: C=US, ST=Some-State, L=Some-City, O=Some-Org
+ *     Subject Public Key Info:
+ *         Public Key Algorithm: rsaEncryption
+ *         RSA Public Key: (1024 bit)
+ *             Modulus (1024 bit):
+ *                 00:cb:c4:38:20:07:be:88:a7:93:b0:a1:43:51:2d:
+ *                 d7:8e:85:af:54:dd:ad:a2:7b:23:5b:cf:99:13:53:
+ *                 99:45:7d:ee:6d:ba:2d:bf:e3:ad:6e:3d:9f:1a:f9:
+ *                 03:97:e0:17:55:ae:11:26:57:de:01:29:8e:05:3f:
+ *                 21:f7:e7:36:e8:2e:37:d7:48:ac:53:d6:60:0e:c7:
+ *                 50:6d:f6:c5:85:f7:8b:a6:c5:91:35:72:3c:94:ee:
+ *                 f1:17:f0:71:e3:ec:1b:ce:ca:4e:40:42:b0:6d:ee:
+ *                 6a:0e:d6:e5:ad:3c:0f:c9:ba:82:4f:78:f8:89:97:
+ *                 89:2a:95:12:4c:d8:09:2a:e9
+ *             Exponent: 65537 (0x10001)
+ *     X509v3 extensions:
+ *         X509v3 Subject Key Identifier:
+ *             FA:B9:51:BF:4C:E7:D9:86:98:33:F9:E7:CB:1E:F1:33:49:F7:A8:14
+ *         X509v3 Authority Key Identifier:
+ *             keyid:FA:B9:51:BF:4C:E7:D9:86:98:33:F9:E7:CB:1E:F1:33:49:F7:A8:14
+ *             DirName:/C=US/ST=Some-State/L=Some-City/O=Some-Org
+ *         X509v3 Basic Constraints:
+ *             CA:TRUE
+ * Signature Algorithm: md5WithRSAEncryption
+ *
+ * CRL:
+ * Certificate Revocation List (CRL):
+ *    Version 2 (0x1)
+ *    Signature Algorithm: md5WithRSAEncryption
+ *    Issuer: /C=US/ST=Some-State/L=Some-City/O=Some-Org
+ *    Last Update: Mar 16 16:27:14 2009 GMT
+ *    Next Update: May 15 16:27:14 2028 GMT
+ *    CRL extensions:
+ *       X509v3 CRL Number:
+ *              2
+ * Revoked Certificates:
+ *    Serial Number: 19
+ *        Revocation Date: Mar 16 16:22:08 2009 GMT
+ *        CRL entry extensions:
+ *            X509v3 CRL Reason Code:
+ *                Superseded
+ *    Signature Algorithm: md5WithRSAEncryption
+ */
+
+import java.io.*;
+import java.net.SocketException;
+import java.util.*;
+import java.security.Security;
+import java.security.cert.*;
+import java.security.InvalidAlgorithmParameterException;
+import java.security.cert.CertPathValidatorException.BasicReason;
+
+public class FailoverToCRL {
+
+    static String trusedCertStr =
+        "-----BEGIN CERTIFICATE-----\n" +
+        "MIICrDCCAhWgAwIBAgIBADANBgkqhkiG9w0BAQQFADBJMQswCQYDVQQGEwJVUzET\n" +
+        "MBEGA1UECBMKU29tZS1TdGF0ZTESMBAGA1UEBxMJU29tZS1DaXR5MREwDwYDVQQK\n" +
+        "EwhTb21lLU9yZzAeFw0wODEyMDgwMjQzMzZaFw0yODA4MjUwMjQzMzZaMEkxCzAJ\n" +
+        "BgNVBAYTAlVTMRMwEQYDVQQIEwpTb21lLVN0YXRlMRIwEAYDVQQHEwlTb21lLUNp\n" +
+        "dHkxETAPBgNVBAoTCFNvbWUtT3JnMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKB\n" +
+        "gQDLxDggB76Ip5OwoUNRLdeOha9U3a2ieyNbz5kTU5lFfe5tui2/461uPZ8a+QOX\n" +
+        "4BdVrhEmV94BKY4FPyH35zboLjfXSKxT1mAOx1Bt9sWF94umxZE1cjyU7vEX8HHj\n" +
+        "7BvOyk5AQrBt7moO1uWtPA/JuoJPePiJl4kqlRJM2Akq6QIDAQABo4GjMIGgMB0G\n" +
+        "A1UdDgQWBBT6uVG/TOfZhpgz+efLHvEzSfeoFDBxBgNVHSMEajBogBT6uVG/TOfZ\n" +
+        "hpgz+efLHvEzSfeoFKFNpEswSTELMAkGA1UEBhMCVVMxEzARBgNVBAgTClNvbWUt\n" +
+        "U3RhdGUxEjAQBgNVBAcTCVNvbWUtQ2l0eTERMA8GA1UEChMIU29tZS1PcmeCAQAw\n" +
+        "DAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQQFAAOBgQBcIm534U123Hz+rtyYO5uA\n" +
+        "ofd81G6FnTfEAV8Kw9fGyyEbQZclBv34A9JsFKeMvU4OFIaixD7nLZ/NZ+IWbhmZ\n" +
+        "LovmJXyCkOufea73pNiZ+f/4/ScZaIlM/PRycQSqbFNd4j9Wott+08qxHPLpsf3P\n" +
+        "6Mvf0r1PNTY2hwTJLJmKtg==\n" +
+        "-----END CERTIFICATE-----";
+
+    static String targetCertStr =
+        "-----BEGIN CERTIFICATE-----\n" +
+        "MIICizCCAfSgAwIBAgIBGTANBgkqhkiG9w0BAQQFADBJMQswCQYDVQQGEwJVUzET\n" +
+        "MBEGA1UECBMKU29tZS1TdGF0ZTESMBAGA1UEBxMJU29tZS1DaXR5MREwDwYDVQQK\n" +
+        "EwhTb21lLU9yZzAeFw0wOTAzMTYxNDU1MzVaFw0yODEyMDExNDU1MzVaMHIxCzAJ\n" +
+        "BgNVBAYTAlVTMRMwEQYDVQQIEwpTb21lLVN0YXRlMRIwEAYDVQQHEwlTb21lLUNp\n" +
+        "dHkxETAPBgNVBAoTCFNvbWUtT3JnMRMwEQYDVQQLEwpTU0wtQ2xpZW50MRIwEAYD\n" +
+        "VQQDEwlsb2NhbGhvc3QwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBALvwQDas\n" +
+        "JlRO9KNaAC9pIW+5ejqT7KL24Y7HY9gvEjCZLrDyj/gnLSR4KIT3Ab+NRHndO9JV\n" +
+        "8848slshfe/9M0qxo//GyJu5D3xBNZf52zoFYAUVr1kXkqMQrRYc5AdTr6h2olYq\n" +
+        "ktP5KOB4z14fSKtcGd3hZ0O6dY31gqxDkkQbAgMBAAGjWjBYMAkGA1UdEwQCMAAw\n" +
+        "CwYDVR0PBAQDAgXgMB0GA1UdDgQWBBTNu8iFqpG9/R2+zWd8/7PpTKgi5jAfBgNV\n" +
+        "HSMEGDAWgBT6uVG/TOfZhpgz+efLHvEzSfeoFDANBgkqhkiG9w0BAQQFAAOBgQBv\n" +
+        "p7JjCDOrMBNun46xs4Gz7Y4ygM5VHaFP0oO7369twvRSu0pCuIdZd5OIMPFeRqQw\n" +
+        "PA68ZdhYVR0pG5W7isV+jB+Dfge/IOgOA85sZ/6FlP3PBRW+YMQKKdRr5So3ook9\n" +
+        "PimQ7rbxRAofPECv20IUKFBbOUkU+gFcn+WbTKYxBw==\n" +
+        "-----END CERTIFICATE-----";
+
+    static String crlStr =
+        "-----BEGIN X509 CRL-----\n" +
+        "MIIBRTCBrwIBATANBgkqhkiG9w0BAQQFADBJMQswCQYDVQQGEwJVUzETMBEGA1UE\n" +
+        "CBMKU29tZS1TdGF0ZTESMBAGA1UEBxMJU29tZS1DaXR5MREwDwYDVQQKEwhTb21l\n" +
+        "LU9yZxcNMDkwMzE2MTYyNzE0WhcNMjgwNTE1MTYyNzE0WjAiMCACARkXDTA5MDMx\n" +
+        "NjE2MjIwOFowDDAKBgNVHRUEAwoBBKAOMAwwCgYDVR0UBAMCAQIwDQYJKoZIhvcN\n" +
+        "AQEEBQADgYEAMixJI9vBwYpOGosn46+T/MTEtlm2S5pIVT/xPDrHkCPfw8l4Zrgp\n" +
+        "dGPuUkglWdrGdxY9MNRUj2YFNfdZi6zZ7JF6XbkDHYOAKYgPDJRjS/0VcBntn5RJ\n" +
+        "sQfZsBqc9fFSP8gknRRn3LT41kr9xNRxTT1t3YYjv7J3zkMYyInqeUA=\n" +
+        "-----END X509 CRL-----";
+
+
+    private static CertPath generateCertificatePath()
+            throws CertificateException {
+        // generate certificate from cert strings
+        CertificateFactory cf = CertificateFactory.getInstance("X.509");
+
+        ByteArrayInputStream is =
+                new ByteArrayInputStream(targetCertStr.getBytes());
+        Certificate targetCert = cf.generateCertificate(is);
+
+        // generate certification path
+        List<Certificate> list = Arrays.asList(new Certificate[] {targetCert});
+
+        return cf.generateCertPath(list);
+    }
+
+    private static Set<TrustAnchor> generateTrustAnchors()
+            throws CertificateException {
+        // generate certificate from cert string
+        CertificateFactory cf = CertificateFactory.getInstance("X.509");
+
+        ByteArrayInputStream is =
+                    new ByteArrayInputStream(trusedCertStr.getBytes());
+        Certificate trusedCert = cf.generateCertificate(is);
+
+        // generate a trust anchor
+        TrustAnchor anchor = new TrustAnchor((X509Certificate)trusedCert, null);
+
+        return Collections.singleton(anchor);
+    }
+
+    private static CertStore generateCertificateStore() throws Exception {
+        // generate CRL from CRL string
+        CertificateFactory cf = CertificateFactory.getInstance("X.509");
+
+        ByteArrayInputStream is =
+                    new ByteArrayInputStream(crlStr.getBytes());
+
+        // generate a cert store
+        Collection<? extends CRL> crls = cf.generateCRLs(is);
+        return CertStore.getInstance("Collection",
+                            new CollectionCertStoreParameters(crls));
+    }
+
+    public static void main(String args[]) throws Exception {
+        CertPath path = generateCertificatePath();
+        Set<TrustAnchor> anchors = generateTrustAnchors();
+        CertStore crls = generateCertificateStore();
+
+        PKIXParameters params = new PKIXParameters(anchors);
+
+        // add the CRL store
+        params.addCertStore(crls);
+
+        // Activate certificate revocation checking
+        params.setRevocationEnabled(true);
+
+        // Activate OCSP
+        Security.setProperty("ocsp.enable", "true");
+        System.setProperty("com.sun.security.enableCRLDP", "true");
+
+        // Ensure that the ocsp.responderURL property is not set.
+        if (Security.getProperty("ocsp.responderURL") != null) {
+            throw new
+                Exception("The ocsp.responderURL property must not be set");
+        }
+
+        CertPathValidator validator = CertPathValidator.getInstance("PKIX");
+
+        try {
+            validator.validate(path, params);
+        } catch (CertPathValidatorException cpve) {
+            if (cpve.getReason() != BasicReason.REVOKED) {
+                throw new Exception(
+                    "unexpect exception, should be a REVOKED CPVE", cpve);
+            }
+        }
+    }
+}
--- a/jdk/test/java/util/regex/RegExTest.java	Thu Apr 02 10:49:41 2009 -0700
+++ b/jdk/test/java/util/regex/RegExTest.java	Thu Apr 02 17:01:00 2009 -0700
@@ -3389,6 +3389,11 @@
               "gname",
               "yyy");
 
+        check(Pattern.compile("x+(?<8gname>y+)z+"),
+              "xxxyyyzzz",
+              "8gname",
+              "yyy");
+
         //backref
         Pattern pattern = Pattern.compile("(a*)bc\\1");
         check(pattern, "zzzaabcazzz", true);  // found "abca"
--- a/jdk/test/javax/script/Test3.java	Thu Apr 02 10:49:41 2009 -0700
+++ b/jdk/test/javax/script/Test3.java	Thu Apr 02 17:01:00 2009 -0700
@@ -4,7 +4,6 @@
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
-
  * published by the Free Software Foundation.
  *
  * This code is distributed in the hope that it will be useful, but WITHOUT
--- a/jdk/test/sun/nio/cs/FindEncoderBugs.java	Thu Apr 02 10:49:41 2009 -0700
+++ b/jdk/test/sun/nio/cs/FindEncoderBugs.java	Thu Apr 02 17:01:00 2009 -0700
@@ -526,4 +526,3 @@
         System.out.printf("%nPassed = %d, failed = %d%n%n", passed, failed);
         if (failed > 0) throw new AssertionError("Some tests failed");}
 }
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/sun/nio/cs/StrCodingBenchmark.java	Thu Apr 02 17:01:00 2009 -0700
@@ -0,0 +1,200 @@
+/*
+ * Copyright (c) 2009 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+import java.util.*;
+import java.nio.*;
+import java.nio.charset.*;
+import java.util.concurrent.*;
+import java.util.regex.Pattern;
+
+/**
+ * Usage: java StringCodingBenchmark
+ * [-Diterations=N] [-Dsize=N] [-Dsubsize=N] [-Dmaxchar=N]
+ * [-Dfilter=REGEXP] [-DSecurityManager=true]
+ */
+public class StrCodingBenchmark {
+    abstract static class Job {
+        private final String name;
+        public Job(String name) { this.name = name; }
+        public String name() { return name; }
+        public abstract void work() throws Throwable;
+    }
+
+    private static void collectAllGarbage() {
+        final java.util.concurrent.CountDownLatch drained
+            = new java.util.concurrent.CountDownLatch(1);
+        try {
+            System.gc();        // enqueue finalizable objects
+            new Object() { protected void finalize() {
+                drained.countDown(); }};
+            System.gc();        // enqueue detector
+            drained.await();    // wait for finalizer queue to drain
+            System.gc();        // cleanup finalized objects
+        } catch (InterruptedException e) { throw new Error(e); }
+    }
+
+    /**
+     * Runs each job for long enough that all the runtime compilers
+     * have had plenty of time to warm up, i.e. get around to
+     * compiling everything worth compiling.
+     * Returns array of average times per job per run.
+     */
+    public static long[] time0(Job ... jobs) throws Throwable {
+        //final long warmupNanos = 10L * 1000L * 1000L * 1000L;
+        final long warmupNanos = 100L * 100L;
+        long[] nanoss = new long[jobs.length];
+        for (int i = 0; i < jobs.length; i++) {
+            collectAllGarbage();
+            long t0 = System.nanoTime();
+            long t;
+            int j = 0;
+            do { jobs[i].work(); j++; }
+            while ((t = System.nanoTime() - t0) < warmupNanos);
+            nanoss[i] = t/j;
+        }
+        return nanoss;
+    }
+
+    public static void time(Job ... jobs) throws Throwable {
+
+        long[] warmup = time0(jobs); // Warm up run
+        long[] nanoss = time0(jobs); // Real timing run
+        long[] milliss = new long[jobs.length];
+        double[] ratios = new double[jobs.length];
+
+        final String nameHeader   = "Method";
+        final String millisHeader = "Millis";
+        final String ratioHeader  = "Ratio";
+
+        int nameWidth   = nameHeader.length();
+        int millisWidth = millisHeader.length();
+        int ratioWidth  = ratioHeader.length();
+
+        for (int i = 0; i < jobs.length; i++) {
+            nameWidth = Math.max(nameWidth, jobs[i].name().length());
+
+            milliss[i] = nanoss[i]/(1000L * 1000L);
+            millisWidth = Math.max(millisWidth,
+                                   String.format("%d", milliss[i]).length());
+
+            ratios[i] = (double) nanoss[i] / (double) nanoss[0];
+            ratioWidth = Math.max(ratioWidth,
+                                  String.format("%.3f", ratios[i]).length());
+        }
+        String format = String.format("%%-%ds %%%dd %n",
+                                      nameWidth, millisWidth);
+        String headerFormat = String.format("%%-%ds %%%ds%n",
+                                            nameWidth, millisWidth);
+        System.out.printf(headerFormat, "Method", "Millis");
+
+        // Print out absolute and relative times, calibrated against first job
+        for (int i = 0; i < jobs.length; i++)
+            System.out.printf(format, jobs[i].name(), milliss[i], ratios[i]);
+    }
+
+    public static Job[] filter(Pattern filter, Job[] jobs) {
+        if (filter == null) return jobs;
+        Job[] newJobs = new Job[jobs.length];
+        int n = 0;
+        for (Job job : jobs)
+            if (filter.matcher(job.name()).find())
+                newJobs[n++] = job;
+        // Arrays.copyOf not available in JDK 5
+        Job[] ret = new Job[n];
+        System.arraycopy(newJobs, 0, ret, 0, n);
+        return ret;
+    }
+
+    static class PermissiveSecurityManger extends SecurityManager {
+        @Override public void checkPermission(java.security.Permission p) {
+        }
+    }
+
+    public static void main(String[] args) throws Throwable {
+        final int itrs = Integer.getInteger("iterations", 100000);
+        final int size       = Integer.getInteger("size", 2048);
+        final int subsize    = Integer.getInteger("subsize", 128);
+        final int maxchar    = Integer.getInteger("maxchar", 128);
+        final String regex = System.getProperty("filter");
+        final Pattern filter = (regex == null) ? null : Pattern.compile(regex);
+        final boolean useSecurityManager = Boolean.getBoolean("SecurityManager");
+        if (useSecurityManager)
+            System.setSecurityManager(new PermissiveSecurityManger());
+        final Random rnd = new Random();
+
+        for (Charset charset:  Charset.availableCharsets().values()) {
+            if (!("ISO-8859-1".equals(charset.name()) ||
+                  "US-ASCII".equals(charset.name()) ||
+                  charset.newDecoder() instanceof sun.nio.cs.SingleByte.Decoder))
+                continue;
+            final String csn = charset.name();
+            final Charset cs = charset;
+            final StringBuilder sb = new StringBuilder();
+            {
+                final CharsetEncoder enc = cs.newEncoder();
+                for (int i = 0; i < size; ) {
+                    char c = (char) rnd.nextInt(maxchar);
+                    if (enc.canEncode(c)) {
+                        sb.append(c);
+                        i++;
+                    }
+                }
+            }
+            final String string = sb.toString();
+            final byte[] bytes  = string.getBytes(cs);
+
+            System.out.printf("%n--------%s---------%n", csn);
+            for (int sz = 4; sz <= 2048; sz *= 2) {
+                System.out.printf("   [len=%d]%n", sz);
+                final byte[] bs  = Arrays.copyOf(bytes, sz);
+                final String str = new String(bs, csn);
+                Job[] jobs = {
+                    new Job("String decode: csn") {
+                    public void work() throws Throwable {
+                        for (int i = 0; i < itrs; i++)
+                            new String(bs, csn);
+                    }},
+
+                    new Job("String decode: cs") {
+                    public void work() throws Throwable {
+                        for (int i = 0; i < itrs; i++)
+                            new String(bs, cs);
+                    }},
+
+                    new Job("String encode: csn") {
+                    public void work() throws Throwable {
+                        for (int i = 0; i < itrs; i++)
+                                str.getBytes(csn);
+                    }},
+
+                    new Job("String encode: cs") {
+                    public void work() throws Throwable {
+                         for (int i = 0; i < itrs; i++)
+                          str.getBytes(cs);
+                    }},
+                };
+                time(filter(filter, jobs));
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/sun/nio/cs/TestStringCoding.java	Thu Apr 02 17:01:00 2009 -0700
@@ -0,0 +1,151 @@
+/*
+ * Copyright 2000-2009 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * 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.
+ */
+
+/* @test
+   @bug 6636323 6636319
+   @summary Test if StringCoding and NIO result have the same de/encoding result
+ * @run main/timeout=2000 TestStringCoding
+ */
+
+import java.util.*;
+import java.nio.*;
+import java.nio.charset.*;
+
+public class TestStringCoding {
+    public static void main(String[] args) throws Throwable {
+
+        for (Boolean hasSM: new boolean[] { false, true }) {
+            if (hasSM)
+                System.setSecurityManager(new PermissiveSecurityManger());
+            for (Charset cs:  Charset.availableCharsets().values()) {
+                if ("ISO-2022-CN".equals(cs.name()) ||
+                    "x-COMPOUND_TEXT".equals(cs.name()) ||
+                    "x-JISAutoDetect".equals(cs.name()))
+                    continue;
+                System.out.printf("Testing(sm=%b) " + cs.name() + "....", hasSM);
+                // full bmp first
+                char[] bmpCA = new char[0x10000];
+                for (int i = 0; i < 0x10000; i++) {
+                     bmpCA[i] = (char)i;
+                }
+                byte[] sbBA = new byte[0x100];
+                for (int i = 0; i < 0x100; i++) {
+                    sbBA[i] = (byte)i;
+                }
+                test(cs, bmpCA, sbBA);
+                // "randomed" sizes
+                Random rnd = new Random();
+                for (int i = 0; i < 10; i++) {
+                    int clen = rnd.nextInt(0x10000);
+                    int blen = rnd.nextInt(0x100);
+                    //System.out.printf("    blen=%d, clen=%d%n", blen, clen);
+                    test(cs, Arrays.copyOf(bmpCA, clen), Arrays.copyOf(sbBA, blen));
+                    //add a pair of surrogates
+                    int pos = clen / 2;
+                    if ((pos + 1) < blen) {
+                        bmpCA[pos] = '\uD800';
+                        bmpCA[pos+1] = '\uDC00';
+                    }
+                    test(cs, Arrays.copyOf(bmpCA, clen), Arrays.copyOf(sbBA, blen));
+                }
+                System.out.println("done!");
+            }
+        }
+    }
+
+    static void test(Charset cs, char[] bmpCA, byte[] sbBA) throws Throwable {
+        String bmpStr = new String(bmpCA);
+        CharsetDecoder dec = cs.newDecoder()
+            .onMalformedInput(CodingErrorAction.REPLACE)
+            .onUnmappableCharacter(CodingErrorAction.REPLACE);
+        CharsetEncoder enc = cs.newEncoder()
+            .onMalformedInput(CodingErrorAction.REPLACE)
+            .onUnmappableCharacter(CodingErrorAction.REPLACE);
+
+        //getBytes(csn);
+        byte[] baSC = bmpStr.getBytes(cs.name());
+        ByteBuffer bf = enc.reset().encode(CharBuffer.wrap(bmpCA));
+        byte[] baNIO = new byte[bf.limit()];
+        bf.get(baNIO, 0, baNIO.length);
+        if (!Arrays.equals(baSC, baNIO))
+            throw new RuntimeException("getBytes(csn) failed  -> " + cs.name());
+
+        //getBytes(cs);
+        baSC = bmpStr.getBytes(cs);
+        if (!Arrays.equals(baSC, baNIO))
+            throw new RuntimeException("getBytes(cs) failed  -> " + cs.name());
+
+        //new String(csn);
+        String strSC = new String(sbBA, cs.name());
+        String strNIO = dec.reset().decode(ByteBuffer.wrap(sbBA)).toString();
+        if(!strNIO.equals(strSC))
+            throw new RuntimeException("new String(csn) failed  -> " + cs.name());
+
+        //new String(cs);
+        strSC = new String(sbBA, cs);
+        if (!strNIO.equals(strSC))
+            throw new RuntimeException("new String(cs) failed  -> " + cs.name());
+
+        //encode unmappable surrogates
+        if (enc instanceof sun.nio.cs.ArrayEncoder &&
+            cs.contains(Charset.forName("ASCII"))) {
+            enc.replaceWith(new byte[] { (byte)'A'});
+            sun.nio.cs.ArrayEncoder cae = (sun.nio.cs.ArrayEncoder)enc;
+
+            String str = "ab\uD800\uDC00\uD800\uDC00cd";
+            byte[] ba = new byte[str.length() - 2];
+            int n = cae.encode(str.toCharArray(), 0, str.length(), ba);
+            if (n != 6 || !"abAAcd".equals(new String(ba, cs.name())))
+                throw new RuntimeException("encode1(surrogates) failed  -> "
+                                           + cs.name());
+
+            ba = new byte[str.length()];
+            n = cae.encode(str.toCharArray(), 0, str.length(), ba);
+            if (n != 6 || !"abAAcd".equals(new String(ba, 0, n,
+                                                     cs.name())))
+                throw new RuntimeException("encode2(surrogates) failed  -> "
+                                           + cs.name());
+            str = "ab\uD800B\uDC00Bcd";
+            ba = new byte[str.length()];
+            n = cae.encode(str.toCharArray(), 0, str.length(), ba);
+            if (n != 8 || !"abABABcd".equals(new String(ba, 0, n,
+                                                       cs.name())))
+                throw new RuntimeException("encode3(surrogates) failed  -> "
+                                           + cs.name());
+
+            ba = new byte[str.length() - 1];
+            n = cae.encode(str.toCharArray(), 0, str.length(), ba);
+            if (n != 7 || !"abABABc".equals(new String(ba, 0, n,
+                                                      cs.name())))
+                throw new RuntimeException("encode4(surrogates) failed  -> "
+                                           + cs.name());
+        }
+
+    }
+
+    static class PermissiveSecurityManger extends SecurityManager {
+        @Override public void checkPermission(java.security.Permission p) {}
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/sun/security/krb5/auto/SpnegoReqFlags.java	Thu Apr 02 17:01:00 2009 -0700
@@ -0,0 +1,92 @@
+/*
+ * Copyright 2009 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+/*
+ * @test
+ * @bug 6815182
+ * @summary GSSAPI/SPNEGO does not work with server using MIT Kerberos library
+ */
+
+import sun.security.jgss.GSSUtil;
+import sun.security.util.BitArray;
+import sun.security.util.DerInputStream;
+import sun.security.util.DerValue;
+
+public class SpnegoReqFlags {
+
+    public static void main(String[] args)
+            throws Exception {
+
+        // Create and start the KDC
+        new OneKDC(null).writeJAASConf();
+        new SpnegoReqFlags().go();
+    }
+
+    void go() throws Exception {
+        Context c = Context.fromJAAS("client");
+        c.startAsClient(OneKDC.SERVER, GSSUtil.GSS_SPNEGO_MECH_OID);
+
+        byte[] token = c.doAs(new Action() {
+            @Override
+            public byte[] run(Context me, byte[] input) throws Exception {
+                me.x().requestCredDeleg(true);
+                me.x().requestReplayDet(false);
+                me.x().requestSequenceDet(false);
+                return me.x().initSecContext(new byte[0], 0, 0);
+            }
+        }, null);
+
+        DerValue d = new DerValue(token);   // GSSToken
+        DerInputStream ins = d.data;        // OID + mech token
+        d.data.getDerValue();               // skip OID
+        d = d.data.getDerValue();           // NegTokenInit
+        d = d.data.getDerValue();           // The SEQUENCE inside
+
+        boolean found = false;
+
+        // Go through all fields inside NegTokenInit. The reqFlags field
+        // is optional. It's even not recommended in RFC 4178.
+        while (d.data.available() > 0) {
+            DerValue d2 = d.data.getDerValue();
+            if (d2.isContextSpecific((byte)1)) {
+                found = true;
+                System.out.println("regFlags field located.");
+                BitArray ba = d2.data.getUnalignedBitString();
+                if (ba.length() != 7) {
+                    throw new Exception("reqFlags should contain 7 bits");
+                }
+                if (!ba.get(0)) {
+                    throw new Exception("delegFlag should be true");
+                }
+                if (ba.get(2) || ba.get(3)) {
+                    throw new Exception("replay/sequenceFlag should be false");
+                }
+            }
+        }
+
+        if (!found) {
+            System.out.println("Warning: regFlags field not found, too new?");
+        }
+        c.dispose();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/sun/security/tools/keytool/importreadall.sh	Thu Apr 02 17:01:00 2009 -0700
@@ -0,0 +1,62 @@
+#
+# Copyright 2009 Sun Microsystems, Inc.  All Rights Reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+# CA 95054 USA or visit www.sun.com if you need additional information or
+# have any questions.
+#
+
+# @test
+# @bug 6819272
+# @summary keytool -importcert should read the whole input
+#
+# @run shell importreadall.sh
+
+# set a few environment variables so that the shell-script can run stand-alone
+# in the source directory
+if [ "${TESTSRC}" = "" ] ; then
+   TESTSRC="."
+fi
+
+if [ "${TESTJAVA}" = "" ] ; then
+  JAVA_CMD=`which java`
+  TESTJAVA=`dirname $JAVA_CMD`/..
+fi
+
+# set platform-dependent variables
+OS=`uname -s`
+case "$OS" in
+  Windows_* )
+    FS="\\"
+    ;;
+  * )
+    FS="/"
+    ;;
+esac
+
+KEYTOOL="${TESTJAVA}${FS}bin${FS}keytool -keystore importreadall.jks -storepass changeit -keypass changeit"
+
+# In case the test is run twice in the same directory
+
+$KEYTOOL -delete -alias a
+$KEYTOOL -delete -alias ca
+$KEYTOOL -genkeypair -alias a -dname CN=a || exit 1
+$KEYTOOL -genkeypair -alias ca -dname CN=ca || exit 2
+$KEYTOOL -certreq -alias a | $KEYTOOL -gencert -alias ca | $KEYTOOL -importcert -alias a
+
+exit $?
--- a/langtools/.hgtags	Thu Apr 02 10:49:41 2009 -0700
+++ b/langtools/.hgtags	Thu Apr 02 17:01:00 2009 -0700
@@ -26,3 +26,4 @@
 d17d927ad9bdfafae32451645d182acb7bed7be6 jdk7-b49
 46f2f6ed96f13fc49fec3d1b6aa616686128cb57 jdk7-b50
 8c55d5b0ed71ed3a749eb97e4eab79b4831649b8 jdk7-b51
+29329051d483d39f66073752ba4afbf29d893cfe jdk7-b52
--- a/langtools/make/jprt.config	Thu Apr 02 10:49:41 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/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractMemberWriter.java	Thu Apr 02 10:49:41 2009 -0700
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractMemberWriter.java	Thu Apr 02 17:01:00 2009 -0700
@@ -60,7 +60,11 @@
 
     /*** abstracts ***/
 
-    public abstract void printSummaryLabel(ClassDoc cd);
+    public abstract void printSummaryLabel();
+
+    public abstract void printTableSummary();
+
+    public abstract void printSummaryTableHeader(ProgramElementDoc member);
 
     public abstract void printInheritedSummaryLabel(ClassDoc cd);
 
@@ -342,12 +346,13 @@
      * format for listing the API. Call methods from the sub-class to complete
      * the generation.
      */
-    protected void printDeprecatedAPI(List<Doc> deprmembers, String headingKey) {
+    protected void printDeprecatedAPI(List<Doc> deprmembers, String headingKey, String tableSummary, String[] tableHeader) {
         if (deprmembers.size() > 0) {
-            writer.tableIndexSummary();
-            writer.tableHeaderStart("#CCCCFF");
-            writer.strongText(headingKey);
-            writer.tableHeaderEnd();
+            writer.tableIndexSummary(tableSummary);
+            writer.tableCaptionStart();
+            writer.printText(headingKey);
+            writer.tableCaptionEnd();
+            writer.summaryTableHeader(tableHeader, "col");
             for (int i = 0; i < deprmembers.size(); i++) {
                 ProgramElementDoc member =(ProgramElementDoc)deprmembers.get(i);
                 writer.trBgcolorStyle("white", "TableRowColor");
@@ -370,19 +375,26 @@
     /**
      * Print use info.
      */
-    protected void printUseInfo(List<? extends ProgramElementDoc> mems, String heading) {
+    protected void printUseInfo(List<? extends ProgramElementDoc> mems, String heading, String tableSummary) {
         if (mems == null) {
             return;
         }
         List<? extends ProgramElementDoc> members = mems;
+        boolean printedUseTableHeader = false;
         if (members.size() > 0) {
-            writer.tableIndexSummary();
-            writer.tableUseInfoHeaderStart("#CCCCFF");
+            writer.tableIndexSummary(tableSummary);
+            writer.tableSubCaptionStart();
             writer.print(heading);
-            writer.tableHeaderEnd();
+            writer.tableCaptionEnd();
             for (Iterator<? extends ProgramElementDoc> it = members.iterator(); it.hasNext(); ) {
                 ProgramElementDoc pgmdoc = it.next();
                 ClassDoc cd = pgmdoc.containingClass();
+                if (!printedUseTableHeader) {
+                    // Passing ProgramElementDoc helps decides printing
+                    // interface or class header in case of nested classes.
+                    this.printSummaryTableHeader(pgmdoc);
+                    printedUseTableHeader = true;
+                }
 
                 writer.printSummaryLinkType(this, pgmdoc);
                 if (cd != null && !(pgmdoc instanceof ConstructorDoc)
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractPackageIndexWriter.java	Thu Apr 02 10:49:41 2009 -0700
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractPackageIndexWriter.java	Thu Apr 02 17:01:00 2009 -0700
@@ -35,6 +35,7 @@
  * generate overview-frame.html as well as overview-summary.html.
  *
  * @author Atul M Dambalkar
+ * @author Bhavesh Patel (Modified)
  */
 public abstract class AbstractPackageIndexWriter extends HtmlDocletWriter {
 
@@ -61,7 +62,7 @@
 
     protected abstract void printOverviewHeader();
 
-    protected abstract void printIndexHeader(String text);
+    protected abstract void printIndexHeader(String text, String tableSummary);
 
     protected abstract void printIndexRow(PackageDoc pkg);
 
@@ -101,7 +102,10 @@
      * Generate the frame or non-frame package index.
      */
     protected void generateIndex() {
-        printIndexContents(packages, "doclet.Package_Summary");
+        printIndexContents(packages, "doclet.Package_Summary",
+                configuration.getText("doclet.Member_Table_Summary",
+                configuration.getText("doclet.Package_Summary"),
+                configuration.getText("doclet.packages")));
     }
 
     /**
@@ -111,10 +115,10 @@
      * @param packages Array of packages to be documented.
      * @param text     String which will be used as the heading.
      */
-    protected void printIndexContents(PackageDoc[] packages, String text) {
+    protected void printIndexContents(PackageDoc[] packages, String text, String tableSummary) {
         if (packages.length > 0) {
             Arrays.sort(packages);
-            printIndexHeader(text);
+            printIndexHeader(text, tableSummary);
             printAllClassesPackagesLink();
             for(int i = 0; i < packages.length; i++) {
                 if (packages[i] != null) {
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeOptionalMemberWriterImpl.java	Thu Apr 02 10:49:41 2009 -0700
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeOptionalMemberWriterImpl.java	Thu Apr 02 17:01:00 2009 -0700
@@ -34,6 +34,7 @@
  * Writes annotation type optional member documentation in HTML format.
  *
  * @author Jamie Ho
+ * @author Bhavesh Patel (Modified)
  */
 public class AnnotationTypeOptionalMemberWriterImpl extends
         AnnotationTypeRequiredMemberWriterImpl
@@ -89,8 +90,27 @@
     /**
      * {@inheritDoc}
      */
-    public void printSummaryLabel(ClassDoc cd) {
-        writer.strongText("doclet.Annotation_Type_Optional_Member_Summary");
+    public void printSummaryLabel() {
+        writer.printText("doclet.Annotation_Type_Optional_Member_Summary");
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public void printTableSummary() {
+        writer.tableIndexSummary(configuration().getText("doclet.Member_Table_Summary",
+                configuration().getText("doclet.Annotation_Type_Optional_Member_Summary"),
+                configuration().getText("doclet.annotation_type_optional_members")));
+    }
+
+    public void printSummaryTableHeader(ProgramElementDoc member) {
+        String[] header = new String[] {
+            writer.getModifierTypeHeader(),
+            configuration().getText("doclet.0_and_1",
+                    configuration().getText("doclet.Annotation_Type_Optional_Member"),
+                    configuration().getText("doclet.Description"))
+        };
+        writer.summaryTableHeader(header, "col");
     }
 
     /**
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeRequiredMemberWriterImpl.java	Thu Apr 02 10:49:41 2009 -0700
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeRequiredMemberWriterImpl.java	Thu Apr 02 17:01:00 2009 -0700
@@ -34,6 +34,7 @@
  * Writes annotation type required member documentation in HTML format.
  *
  * @author Jamie Ho
+ * @author Bhavesh Patel (Modified)
  */
 public class AnnotationTypeRequiredMemberWriterImpl extends AbstractMemberWriter
     implements AnnotationTypeRequiredMemberWriter, MemberSummaryWriter {
@@ -178,8 +179,27 @@
     /**
      * {@inheritDoc}
      */
-    public void printSummaryLabel(ClassDoc cd) {
-        writer.strongText("doclet.Annotation_Type_Required_Member_Summary");
+    public void printSummaryLabel() {
+        writer.printText("doclet.Annotation_Type_Required_Member_Summary");
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public void printTableSummary() {
+        writer.tableIndexSummary(configuration().getText("doclet.Member_Table_Summary",
+                configuration().getText("doclet.Annotation_Type_Required_Member_Summary"),
+                configuration().getText("doclet.annotation_type_required_members")));
+    }
+
+    public void printSummaryTableHeader(ProgramElementDoc member) {
+        String[] header = new String[] {
+            writer.getModifierTypeHeader(),
+            configuration().getText("doclet.0_and_1",
+                    configuration().getText("doclet.Annotation_Type_Required_Member"),
+                    configuration().getText("doclet.Description"))
+        };
+        writer.summaryTableHeader(header, "col");
     }
 
     /**
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ClassUseWriter.java	Thu Apr 02 10:49:41 2009 -0700
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ClassUseWriter.java	Thu Apr 02 17:01:00 2009 -0700
@@ -34,6 +34,7 @@
  * Generate class usage information.
  *
  * @author Robert G. Field
+ * @author Bhavesh Patel (Modified)
  */
 public class ClassUseWriter extends SubWriterHolderWriter {
 
@@ -65,6 +66,13 @@
     final ConstructorWriterImpl constrSubWriter;
     final FieldWriterImpl fieldSubWriter;
     final NestedClassWriterImpl classSubWriter;
+    // Summary for various use tables.
+    final String classUseTableSummary;
+    final String subclassUseTableSummary;
+    final String subinterfaceUseTableSummary;
+    final String fieldUseTableSummary;
+    final String methodUseTableSummary;
+    final String constructorUseTableSummary;
 
 
     /**
@@ -116,6 +124,18 @@
         constrSubWriter = new ConstructorWriterImpl(this);
         fieldSubWriter = new FieldWriterImpl(this);
         classSubWriter = new NestedClassWriterImpl(this);
+        classUseTableSummary = configuration.getText("doclet.Use_Table_Summary",
+                configuration.getText("doclet.classes"));
+        subclassUseTableSummary = configuration.getText("doclet.Use_Table_Summary",
+                configuration.getText("doclet.subclasses"));
+        subinterfaceUseTableSummary = configuration.getText("doclet.Use_Table_Summary",
+                configuration.getText("doclet.subinterfaces"));
+        fieldUseTableSummary = configuration.getText("doclet.Use_Table_Summary",
+                configuration.getText("doclet.fields"));
+        methodUseTableSummary = configuration.getText("doclet.Use_Table_Summary",
+                configuration.getText("doclet.methods"));
+        constructorUseTableSummary = configuration.getText("doclet.Use_Table_Summary",
+                configuration.getText("doclet.constructors"));
     }
 
     /**
@@ -213,12 +233,13 @@
     }
 
     protected void generatePackageList() throws IOException {
-        tableIndexSummary();
-        tableHeaderStart("#CCCCFF");
+        tableIndexSummary(useTableSummary);
+        tableCaptionStart();
         printText("doclet.ClassUse_Packages.that.use.0",
             getLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_CLASS_USE_HEADER, classdoc,
                 false)));
-        tableHeaderEnd();
+        tableCaptionEnd();
+        summaryTableHeader(packageTableHeader, "col");
 
         for (Iterator<PackageDoc> it = pkgSet.iterator(); it.hasNext();) {
             PackageDoc pkg = it.next();
@@ -234,12 +255,13 @@
                pkgToPackageAnnotations == null ||
                pkgToPackageAnnotations.size() == 0)
             return;
-        tableIndexSummary();
-        tableHeaderStart("#CCCCFF");
+        tableIndexSummary(useTableSummary);
+        tableCaptionStart();
         printText("doclet.ClassUse_PackageAnnotation",
             getLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_CLASS_USE_HEADER, classdoc,
                 false)));
-        tableHeaderEnd();
+        tableCaptionEnd();
+        summaryTableHeader(packageTableHeader, "col");
         for (Iterator<PackageDoc> it = pkgToPackageAnnotations.iterator(); it.hasNext();) {
             PackageDoc pkg = it.next();
             trBgcolorStyle("white", "TableRowColor");
@@ -300,83 +322,68 @@
             LinkInfoImpl.CONTEXT_CLASS_USE_HEADER, classdoc, false));
         String pkgLink = getPackageLink(pkg, Util.getPackageName(pkg), false);
         classSubWriter.printUseInfo(pkgToClassAnnotations.get(pkg.name()),
-            configuration.getText("doclet.ClassUse_Annotation", classLink,
-            pkgLink));
-
+                configuration.getText("doclet.ClassUse_Annotation", classLink,
+                pkgLink), classUseTableSummary);
         classSubWriter.printUseInfo(pkgToClassTypeParameter.get(pkg.name()),
-            configuration.getText("doclet.ClassUse_TypeParameter", classLink,
-            pkgLink));
+                configuration.getText("doclet.ClassUse_TypeParameter", classLink,
+                pkgLink), classUseTableSummary);
         classSubWriter.printUseInfo(pkgToSubclass.get(pkg.name()),
-            configuration.getText("doclet.ClassUse_Subclass", classLink,
-            pkgLink));
+                configuration.getText("doclet.ClassUse_Subclass", classLink,
+                pkgLink), subclassUseTableSummary);
         classSubWriter.printUseInfo(pkgToSubinterface.get(pkg.name()),
-                                    configuration.getText("doclet.ClassUse_Subinterface",
-                                            classLink,
-                                            pkgLink));
+                configuration.getText("doclet.ClassUse_Subinterface", classLink,
+                pkgLink), subinterfaceUseTableSummary);
         classSubWriter.printUseInfo(pkgToImplementingClass.get(pkg.name()),
-                                    configuration.getText("doclet.ClassUse_ImplementingClass",
-                                            classLink,
-                                            pkgLink));
+                configuration.getText("doclet.ClassUse_ImplementingClass", classLink,
+                pkgLink), classUseTableSummary);
         fieldSubWriter.printUseInfo(pkgToField.get(pkg.name()),
-                                    configuration.getText("doclet.ClassUse_Field",
-                                            classLink,
-                                            pkgLink));
+                configuration.getText("doclet.ClassUse_Field", classLink,
+                pkgLink), fieldUseTableSummary);
         fieldSubWriter.printUseInfo(pkgToFieldAnnotations.get(pkg.name()),
-            configuration.getText("doclet.ClassUse_FieldAnnotations",
-            classLink,
-            pkgLink));
+                configuration.getText("doclet.ClassUse_FieldAnnotations", classLink,
+                pkgLink), fieldUseTableSummary);
         fieldSubWriter.printUseInfo(pkgToFieldTypeParameter.get(pkg.name()),
-            configuration.getText("doclet.ClassUse_FieldTypeParameter",
-            classLink,
-            pkgLink));
+                configuration.getText("doclet.ClassUse_FieldTypeParameter", classLink,
+                pkgLink), fieldUseTableSummary);
         methodSubWriter.printUseInfo(pkgToMethodAnnotations.get(pkg.name()),
-            configuration.getText("doclet.ClassUse_MethodAnnotations", classLink,
-            pkgLink));
+                configuration.getText("doclet.ClassUse_MethodAnnotations", classLink,
+                pkgLink), methodUseTableSummary);
         methodSubWriter.printUseInfo(pkgToMethodParameterAnnotations.get(pkg.name()),
-            configuration.getText("doclet.ClassUse_MethodParameterAnnotations", classLink,
-            pkgLink));
+                configuration.getText("doclet.ClassUse_MethodParameterAnnotations", classLink,
+                pkgLink), methodUseTableSummary);
         methodSubWriter.printUseInfo(pkgToMethodTypeParameter.get(pkg.name()),
-            configuration.getText("doclet.ClassUse_MethodTypeParameter", classLink,
-            pkgLink));
+                configuration.getText("doclet.ClassUse_MethodTypeParameter", classLink,
+                pkgLink), methodUseTableSummary);
         methodSubWriter.printUseInfo(pkgToMethodReturn.get(pkg.name()),
-                                     configuration.getText("doclet.ClassUse_MethodReturn",
-                                             classLink,
-                                             pkgLink));
+                configuration.getText("doclet.ClassUse_MethodReturn", classLink,
+                pkgLink), methodUseTableSummary);
         methodSubWriter.printUseInfo(pkgToMethodReturnTypeParameter.get(pkg.name()),
-            configuration.getText("doclet.ClassUse_MethodReturnTypeParameter", classLink,
-            pkgLink));
+                configuration.getText("doclet.ClassUse_MethodReturnTypeParameter", classLink,
+                pkgLink), methodUseTableSummary);
         methodSubWriter.printUseInfo(pkgToMethodArgs.get(pkg.name()),
-                                     configuration.getText("doclet.ClassUse_MethodArgs",
-                                             classLink,
-                                             pkgLink));
+                configuration.getText("doclet.ClassUse_MethodArgs", classLink,
+                pkgLink), methodUseTableSummary);
         methodSubWriter.printUseInfo(pkgToMethodArgTypeParameter.get(pkg.name()),
-            configuration.getText("doclet.ClassUse_MethodArgsTypeParameters",
-            classLink,
-            pkgLink));
+                configuration.getText("doclet.ClassUse_MethodArgsTypeParameters", classLink,
+                pkgLink), methodUseTableSummary);
         methodSubWriter.printUseInfo(pkgToMethodThrows.get(pkg.name()),
-                                     configuration.getText("doclet.ClassUse_MethodThrows",
-                                             classLink,
-                                             pkgLink));
+                configuration.getText("doclet.ClassUse_MethodThrows", classLink,
+                pkgLink), methodUseTableSummary);
         constrSubWriter.printUseInfo(pkgToConstructorAnnotations.get(pkg.name()),
-            configuration.getText("doclet.ClassUse_ConstructorAnnotations",
-                classLink,
-                pkgLink));
+                configuration.getText("doclet.ClassUse_ConstructorAnnotations", classLink,
+                pkgLink), constructorUseTableSummary);
         constrSubWriter.printUseInfo(pkgToConstructorParameterAnnotations.get(pkg.name()),
-            configuration.getText("doclet.ClassUse_ConstructorParameterAnnotations",
-                classLink,
-                pkgLink));
+                configuration.getText("doclet.ClassUse_ConstructorParameterAnnotations", classLink,
+                pkgLink), constructorUseTableSummary);
         constrSubWriter.printUseInfo(pkgToConstructorArgs.get(pkg.name()),
-                                     configuration.getText("doclet.ClassUse_ConstructorArgs",
-                                             classLink,
-                                             pkgLink));
+                configuration.getText("doclet.ClassUse_ConstructorArgs", classLink,
+                pkgLink), constructorUseTableSummary);
         constrSubWriter.printUseInfo(pkgToConstructorArgTypeParameter.get(pkg.name()),
-            configuration.getText("doclet.ClassUse_ConstructorArgsTypeParameters",
-            classLink,
-            pkgLink));
+                configuration.getText("doclet.ClassUse_ConstructorArgsTypeParameters", classLink,
+                pkgLink), constructorUseTableSummary);
         constrSubWriter.printUseInfo(pkgToConstructorThrows.get(pkg.name()),
-                                     configuration.getText("doclet.ClassUse_ConstructorThrows",
-                                             classLink,
-                                             pkgLink));
+                configuration.getText("doclet.ClassUse_ConstructorThrows", classLink,
+                pkgLink), constructorUseTableSummary);
     }
 
     /**
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ConstantsSummaryWriterImpl.java	Thu Apr 02 10:49:41 2009 -0700
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ConstantsSummaryWriterImpl.java	Thu Apr 02 17:01:00 2009 -0700
@@ -35,6 +35,7 @@
  * Write the Constants Summary Page in HTML format.
  *
  * @author Jamie Ho
+ * @author Bhavesh Patel (Modified)
  * @since 1.4
  */
 public class ConstantsSummaryWriterImpl extends HtmlDocletWriter
@@ -50,6 +51,10 @@
      */
     private ClassDoc currentClassDoc;
 
+    private final String constantsTableSummary;
+
+    private final String[] constantsTableHeader;
+
     /**
      * Construct a ConstantsSummaryWriter.
      * @param configuration the configuration used in this run
@@ -59,6 +64,13 @@
             throws IOException {
         super(configuration, ConfigurationImpl.CONSTANTS_FILE_NAME);
         this.configuration = configuration;
+        constantsTableSummary = configuration.getText("doclet.Constants_Table_Summary",
+                configuration.getText("doclet.Constants_Summary"));
+        constantsTableHeader = new String[] {
+            getModifierTypeHeader(),
+            configuration.getText("doclet.ConstantField"),
+            configuration.getText("doclet.Value")
+        };
     }
 
     /**
@@ -151,12 +163,11 @@
      * @param classStr the heading to print.
      */
     protected void writeClassName(String classStr) {
-        table(1, 3, 0);
-        trBgcolorStyle("#EEEEFF", "TableSubHeadingColor");
-        thAlignColspan("left", 3);
+        table(1, 3, 0, constantsTableSummary);
+        tableSubCaptionStart();
         write(classStr);
-        thEnd();
-        trEnd();
+        tableCaptionEnd();
+        summaryTableHeader(constantsTableHeader, "col");
     }
 
     private void tableFooter(boolean isHeader) {
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ConstructorWriterImpl.java	Thu Apr 02 10:49:41 2009 -0700
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ConstructorWriterImpl.java	Thu Apr 02 17:01:00 2009 -0700
@@ -37,6 +37,7 @@
  *
  * @author Robert Field
  * @author Atul M Dambalkar
+ * @author Bhavesh Patel (Modified)
  */
 public class ConstructorWriterImpl extends AbstractExecutableMemberWriter
     implements ConstructorWriter, MemberSummaryWriter {
@@ -211,8 +212,34 @@
         this.foundNonPubConstructor = foundNonPubConstructor;
     }
 
-    public void printSummaryLabel(ClassDoc cd) {
-        writer.strongText("doclet.Constructor_Summary");
+    public void printSummaryLabel() {
+        writer.printText("doclet.Constructor_Summary");
+    }
+
+    public void printTableSummary() {
+        writer.tableIndexSummary(configuration().getText("doclet.Member_Table_Summary",
+                configuration().getText("doclet.Constructor_Summary"),
+                configuration().getText("doclet.constructors")));
+    }
+
+    public void printSummaryTableHeader(ProgramElementDoc member) {
+        String[] header;
+        if (foundNonPubConstructor) {
+            header = new String[] {
+                configuration().getText("doclet.Modifier"),
+                configuration().getText("doclet.0_and_1",
+                        configuration().getText("doclet.Constructor"),
+                        configuration().getText("doclet.Description"))
+            };
+        }
+        else {
+            header = new String[] {
+                configuration().getText("doclet.0_and_1",
+                        configuration().getText("doclet.Constructor"),
+                        configuration().getText("doclet.Description"))
+            };
+        }
+        writer.summaryTableHeader(header, "col");
     }
 
     public void printSummaryAnchor(ClassDoc cd) {
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/DeprecatedListWriter.java	Thu Apr 02 10:49:41 2009 -0700
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/DeprecatedListWriter.java	Thu Apr 02 17:01:00 2009 -0700
@@ -35,6 +35,7 @@
  *
  * @see java.util.List
  * @author Atul M Dambalkar
+ * @author Bhavesh Patel (Modified)
  */
 public class DeprecatedListWriter extends SubWriterHolderWriter {
 
@@ -55,6 +56,28 @@
         "doclet.Deprecated_Annotation_Type_Members"
     };
 
+    private static final String[] SUMMARY_KEYS = new String[] {
+        "doclet.deprecated_interfaces", "doclet.deprecated_classes",
+        "doclet.deprecated_enums", "doclet.deprecated_exceptions",
+        "doclet.deprecated_errors",
+        "doclet.deprecated_annotation_types",
+        "doclet.deprecated_fields",
+        "doclet.deprecated_methods", "doclet.deprecated_constructors",
+        "doclet.deprecated_enum_constants",
+        "doclet.deprecated_annotation_type_members"
+    };
+
+    private static final String[] HEADER_KEYS = new String[] {
+        "doclet.Interface", "doclet.Class",
+        "doclet.Enum", "doclet.Exceptions",
+        "doclet.Errors",
+        "doclet.AnnotationType",
+        "doclet.Field",
+        "doclet.Method", "doclet.Constructor",
+        "doclet.Enum_Constant",
+        "doclet.Annotation_Type_Member"
+    };
+
     private AbstractMemberWriter[] writers;
 
     private ConfigurationImpl configuration;
@@ -119,11 +142,20 @@
         ulEnd();
         println();
 
+        String memberTableSummary;
+        String[] memberTableHeader = new String[1];
         for (int i = 0; i < DeprecatedAPIListBuilder.NUM_TYPES; i++) {
             if (deprapi.hasDocumentation(i)) {
                 writeAnchor(deprapi, i);
+                memberTableSummary =
+                        configuration.getText("doclet.Member_Table_Summary",
+                        configuration.getText(HEADING_KEYS[i]),
+                        configuration.getText(SUMMARY_KEYS[i]));
+                memberTableHeader[0] = configuration.getText("doclet.0_and_1",
+                        configuration.getText(HEADER_KEYS[i]),
+                        configuration.getText("doclet.Description"));
                 writers[i].printDeprecatedAPI(deprapi.getList(i),
-                    HEADING_KEYS[i]);
+                    HEADING_KEYS[i], memberTableSummary, memberTableHeader);
             }
         }
         printDeprecatedFooter();
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/EnumConstantWriterImpl.java	Thu Apr 02 10:49:41 2009 -0700
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/EnumConstantWriterImpl.java	Thu Apr 02 17:01:00 2009 -0700
@@ -35,6 +35,7 @@
  * Writes enum constant documentation in HTML format.
  *
  * @author Jamie Ho
+ * @author Bhavesh Patel (Modified)
  */
 public class EnumConstantWriterImpl extends AbstractMemberWriter
     implements EnumConstantWriter, MemberSummaryWriter {
@@ -194,8 +195,23 @@
         return VisibleMemberMap.ENUM_CONSTANTS;
     }
 
-    public void printSummaryLabel(ClassDoc cd) {
-        writer.strongText("doclet.Enum_Constant_Summary");
+    public void printSummaryLabel() {
+        writer.printText("doclet.Enum_Constant_Summary");
+    }
+
+    public void printTableSummary() {
+        writer.tableIndexSummary(configuration().getText("doclet.Member_Table_Summary",
+                configuration().getText("doclet.Enum_Constant_Summary"),
+                configuration().getText("doclet.enum_constants")));
+    }
+
+    public void printSummaryTableHeader(ProgramElementDoc member) {
+        String[] header = new String[] {
+            configuration().getText("doclet.0_and_1",
+                    configuration().getText("doclet.Enum_Constant"),
+                    configuration().getText("doclet.Description"))
+        };
+        writer.summaryTableHeader(header, "col");
     }
 
     public void printSummaryAnchor(ClassDoc cd) {
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/FieldWriterImpl.java	Thu Apr 02 10:49:41 2009 -0700
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/FieldWriterImpl.java	Thu Apr 02 17:01:00 2009 -0700
@@ -37,6 +37,7 @@
  * @author Robert Field
  * @author Atul M Dambalkar
  * @author Jamie Ho (rewrite)
+ * @author Bhavesh Patel (Modified)
  */
 public class FieldWriterImpl extends AbstractMemberWriter
     implements FieldWriter, MemberSummaryWriter {
@@ -236,8 +237,24 @@
         return VisibleMemberMap.FIELDS;
     }
 
-    public void printSummaryLabel(ClassDoc cd) {
-        writer.strongText("doclet.Field_Summary");
+    public void printSummaryLabel() {
+        writer.printText("doclet.Field_Summary");
+    }
+
+    public void printTableSummary() {
+        writer.tableIndexSummary(configuration().getText("doclet.Member_Table_Summary",
+                configuration().getText("doclet.Field_Summary"),
+                configuration().getText("doclet.fields")));
+    }
+
+    public void printSummaryTableHeader(ProgramElementDoc member) {
+        String[] header = new String[] {
+            writer.getModifierTypeHeader(),
+            configuration().getText("doclet.0_and_1",
+                    configuration().getText("doclet.Field"),
+                    configuration().getText("doclet.Description"))
+        };
+        writer.summaryTableHeader(header, "col");
     }
 
     public void printSummaryAnchor(ClassDoc cd) {
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java	Thu Apr 02 10:49:41 2009 -0700
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java	Thu Apr 02 17:01:00 2009 -0700
@@ -236,17 +236,19 @@
             configuration.tagletManager.getCustomTags(doc),
                 getTagletWriterInstance(false), output);
         String outputString = output.toString().trim();
-        // For RootDoc and ClassDoc, this section is not the definition description
-        // but the start of definition list.
+        // For RootDoc, ClassDoc and PackageDoc, this section is not the
+        // definition description but the start of definition list.
         if (!outputString.isEmpty()) {
-            if (!(doc instanceof RootDoc || doc instanceof ClassDoc)) {
+            if (!(doc instanceof RootDoc || doc instanceof ClassDoc ||
+                    doc instanceof PackageDoc)) {
                 printMemberDetailsListStartTag();
                 dd();
             }
             printTagsInfoHeader();
             print(outputString);
             printTagsInfoFooter();
-            if (!(doc instanceof RootDoc || doc instanceof ClassDoc))
+            if (!(doc instanceof RootDoc || doc instanceof ClassDoc ||
+                    doc instanceof PackageDoc))
                 ddEnd();
         }
     }
@@ -785,6 +787,15 @@
     }
 
     /**
+     * Print the Html table tag for the index summary tables.
+     *
+     * @param summary the summary for the table tag summary attribute.
+     */
+    public void tableIndexSummary(String summary) {
+        table(1, "100%", 3, 0, summary);
+    }
+
+    /**
      * Same as {@link #tableIndexSummary()}.
      */
     public void tableIndexDetail() {
@@ -800,6 +811,40 @@
     }
 
     /**
+     * Print table caption.
+     */
+    public void tableCaptionStart() {
+        captionStyle("TableCaption");
+    }
+
+    /**
+     * Print table sub-caption.
+     */
+    public void tableSubCaptionStart() {
+        captionStyle("TableSubCaption");
+    }
+
+    /**
+     * Print table caption end tags.
+     */
+    public void tableCaptionEnd() {
+        captionEnd();
+    }
+
+    /**
+     * Print summary table header.
+     */
+    public void summaryTableHeader(String[] header, String scope) {
+        tr();
+        for ( int i=0; i < header.length; i++ ) {
+            thScopeNoWrap("TableHeader", scope);
+            print(header[i]);
+            thEnd();
+        }
+        trEnd();
+    }
+
+    /**
      * Prine table header information about color, column span and the font.
      *
      * @param color Background color.
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/MethodWriterImpl.java	Thu Apr 02 10:49:41 2009 -0700
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/MethodWriterImpl.java	Thu Apr 02 17:01:00 2009 -0700
@@ -38,6 +38,7 @@
  * @author Robert Field
  * @author Atul M Dambalkar
  * @author Jamie Ho (rewrite)
+ * @author Bhavesh Patel (Modified)
  */
 public class MethodWriterImpl extends AbstractExecutableMemberWriter
         implements MethodWriter, MemberSummaryWriter {
@@ -255,8 +256,24 @@
         return VisibleMemberMap.METHODS;
     }
 
-    public void printSummaryLabel(ClassDoc cd) {
-        writer.strongText("doclet.Method_Summary");
+    public void printSummaryLabel() {
+        writer.printText("doclet.Method_Summary");
+    }
+
+    public void printTableSummary() {
+        writer.tableIndexSummary(configuration().getText("doclet.Member_Table_Summary",
+                configuration().getText("doclet.Method_Summary"),
+                configuration().getText("doclet.methods")));
+    }
+
+    public void printSummaryTableHeader(ProgramElementDoc member) {
+        String[] header = new String[] {
+            writer.getModifierTypeHeader(),
+            configuration().getText("doclet.0_and_1",
+                    configuration().getText("doclet.Method"),
+                    configuration().getText("doclet.Description"))
+        };
+        writer.summaryTableHeader(header, "col");
     }
 
     public void printSummaryAnchor(ClassDoc cd) {
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/NestedClassWriterImpl.java	Thu Apr 02 10:49:41 2009 -0700
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/NestedClassWriterImpl.java	Thu Apr 02 17:01:00 2009 -0700
@@ -37,6 +37,7 @@
  * @author Robert Field
  * @author Atul M Dambalkar
  * @author Jamie Ho (rewrite)
+ * @author Bhavesh Patel (Modified)
  */
 public class NestedClassWriterImpl extends AbstractMemberWriter
     implements MemberSummaryWriter {
@@ -147,8 +148,35 @@
         return VisibleMemberMap.INNERCLASSES;
     }
 
-    public void printSummaryLabel(ClassDoc cd) {
-        writer.strongText("doclet.Nested_Class_Summary");
+    public void printSummaryLabel() {
+        writer.printText("doclet.Nested_Class_Summary");
+    }
+
+    public void printTableSummary() {
+        writer.tableIndexSummary(configuration().getText("doclet.Member_Table_Summary",
+                configuration().getText("doclet.Nested_Class_Summary"),
+                configuration().getText("doclet.nested_classes")));
+    }
+
+    public void printSummaryTableHeader(ProgramElementDoc member) {
+        String[] header;
+        if (member.isInterface()) {
+            header = new String[] {
+                writer.getModifierTypeHeader(),
+                configuration().getText("doclet.0_and_1",
+                        configuration().getText("doclet.Interface"),
+                        configuration().getText("doclet.Description"))
+            };
+        }
+        else {
+            header = new String[] {
+                writer.getModifierTypeHeader(),
+                configuration().getText("doclet.0_and_1",
+                        configuration().getText("doclet.Class"),
+                        configuration().getText("doclet.Description"))
+            };
+        }
+        writer.summaryTableHeader(header, "col");
     }
 
     public void printSummaryAnchor(ClassDoc cd) {
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageIndexFrameWriter.java	Thu Apr 02 10:49:41 2009 -0700
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageIndexFrameWriter.java	Thu Apr 02 17:01:00 2009 -0700
@@ -114,7 +114,7 @@
      *
      * @param text Text string will not be used in this method.
      */
-    protected void printIndexHeader(String text) {
+    protected void printIndexHeader(String text, String tableSummary) {
         printTableHeader(false);
     }
 
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageIndexWriter.java	Thu Apr 02 10:49:41 2009 -0700
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageIndexWriter.java	Thu Apr 02 17:01:00 2009 -0700
@@ -36,6 +36,7 @@
  * with the "pacakge-summary.html" file for the clicked package.
  *
  * @author Atul M Dambalkar
+ * @author Bhavesh Patel (Modified)
  */
 public class PackageIndexWriter extends AbstractPackageIndexWriter {
 
@@ -123,7 +124,10 @@
         List<PackageDoc> list = groupPackageMap.get(groupname);
             if (list != null && list.size() > 0) {
                 printIndexContents(list.toArray(new PackageDoc[list.size()]),
-                                    groupname);
+                        groupname,
+                        configuration.getText("doclet.Member_Table_Summary",
+                        groupname,
+                        configuration.getText("doclet.packages")));
             }
         }
     }
@@ -149,11 +153,12 @@
     /**
      * Print Html tags for the table for this package index.
      */
-    protected void printIndexHeader(String text) {
-        tableIndexSummary();
-        tableHeaderStart("#CCCCFF");
-        strong(text);
-        tableHeaderEnd();
+    protected void printIndexHeader(String text, String tableSummary) {
+        tableIndexSummary(tableSummary);
+        tableCaptionStart();
+        print(text);
+        tableCaptionEnd();
+        summaryTableHeader(packageTableHeader, "col");
     }
 
     /**
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageUseWriter.java	Thu Apr 02 10:49:41 2009 -0700
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageUseWriter.java	Thu Apr 02 17:01:00 2009 -0700
@@ -34,6 +34,7 @@
  * Generate package usage information.
  *
  * @author Robert G. Field
+ * @author Bhavesh Patel (Modified)
  */
 public class PackageUseWriter extends SubWriterHolderWriter {
 
@@ -131,11 +132,12 @@
     }
 
     protected void generatePackageList() throws IOException {
-        tableIndexSummary();
-        tableHeaderStart("#CCCCFF");
+        tableIndexSummary(useTableSummary);
+        tableCaptionStart();
         printText("doclet.ClassUse_Packages.that.use.0",
             getPackageLink(pkgdoc, Util.getPackageName(pkgdoc), false));
-        tableHeaderEnd();
+        tableCaptionEnd();
+        summaryTableHeader(packageTableHeader, "col");
         Iterator<String> it = usingPackageToUsedClasses.keySet().iterator();
         while (it.hasNext()) {
             PackageDoc pkg = configuration.root.packageNamed(it.next());
@@ -147,6 +149,11 @@
     }
 
     protected void generateClassList() throws IOException {
+        String[] classTableHeader = new String[] {
+            configuration.getText("doclet.0_and_1",
+                    configuration.getText("doclet.Class"),
+                    configuration.getText("doclet.Description"))
+        };
         Iterator<String> itp = usingPackageToUsedClasses.keySet().iterator();
         while (itp.hasNext()) {
             String packageName = itp.next();
@@ -154,12 +161,14 @@
             if (usingPackage != null) {
                 anchor(usingPackage.name());
             }
-            tableIndexSummary();
-            tableHeaderStart("#CCCCFF");
+            tableIndexSummary(configuration.getText("doclet.Use_Table_Summary",
+                    configuration.getText("doclet.classes")));
+            tableCaptionStart();
             printText("doclet.ClassUse_Classes.in.0.used.by.1",
                 getPackageLink(pkgdoc, Util.getPackageName(pkgdoc), false),
                 getPackageLink(usingPackage,Util.getPackageName(usingPackage), false));
-            tableHeaderEnd();
+            tableCaptionEnd();
+            summaryTableHeader(classTableHeader, "col");
             Iterator<ClassDoc> itc =
                     usingPackageToUsedClasses.get(packageName).iterator();
             while (itc.hasNext()) {
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageWriterImpl.java	Thu Apr 02 10:49:41 2009 -0700
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageWriterImpl.java	Thu Apr 02 17:01:00 2009 -0700
@@ -38,6 +38,7 @@
  * class-kind will update the frame with the clicked class-kind page.
  *
  * @author Atul M Dambalkar
+ * @author Bhavesh Patel (Modified)
  */
 public class PackageWriterImpl extends HtmlDocletWriter
     implements PackageSummaryWriter {
@@ -107,14 +108,15 @@
     /**
      * {@inheritDoc}
      */
-    public void writeClassesSummary(ClassDoc[] classes, String label) {
+    public void writeClassesSummary(ClassDoc[] classes, String label, String tableSummary, String[] tableHeader) {
         if(classes.length > 0) {
             Arrays.sort(classes);
-            tableIndexSummary();
+            tableIndexSummary(tableSummary);
             boolean printedHeading = false;
             for (int i = 0; i < classes.length; i++) {
                 if (!printedHeading) {
-                    printFirstRow(label);
+                    printTableCaption(label);
+                    printFirstRow(tableHeader);
                     printedHeading = true;
                 }
                 if (!Util.isCoreClass(classes[i]) ||
@@ -149,14 +151,23 @@
     }
 
     /**
+     * Print the table caption for the class-listing.
+     *
+     * @param label label for the Class kind listing.
+     */
+    protected void printTableCaption(String label) {
+        tableCaptionStart();
+        print(label);
+        tableCaptionEnd();
+    }
+
+    /**
      * Print the table heading for the class-listing.
      *
-     * @param label Label for the Class kind listing.
+     * @param tableHeader table header string for the Class listing.
      */
-    protected void printFirstRow(String label) {
-        tableHeaderStart("#CCCCFF");
-        strong(label);
-        tableHeaderEnd();
+    protected void printFirstRow(String[] tableHeader) {
+        summaryTableHeader(tableHeader, "col");
     }
 
     /**
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/StylesheetWriter.java	Thu Apr 02 10:49:41 2009 -0700
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/StylesheetWriter.java	Thu Apr 02 17:01:00 2009 -0700
@@ -33,6 +33,7 @@
  * Writes the style sheet for the doclet output.
  *
  * @author Atul M Dambalkar
+ * @author Bhavesh Patel (Modified)
  */
 public class StylesheetWriter extends HtmlDocletWriter {
 
@@ -115,6 +116,13 @@
         println("background-color:#FFFFFF; color:#000000}");
         print(".NavBarCell3    { font-family: Arial, Helvetica, sans-serif; ");
         println("background-color:#FFFFFF; color:#000000}");
+
+        print("/* "); printText("doclet.Style_line_12"); println(" */");
+        print(".TableCaption     { background: #CCCCFF; color:#000000; text-align: left; font-size: 150%; font-weight: bold; border-left: 2px ridge; border-right: 2px ridge; border-top: 2px ridge; padding-left: 5px; }");
+        print(" /* "); printText("doclet.Style_line_5"); println(" */");
+        print(".TableSubCaption  { background: #EEEEFF; color:#000000; text-align: left; font-weight: bold; border-left: 2px ridge; border-right: 2px ridge; border-top: 2px ridge; padding-left: 5px; }");
+        print(" /* "); printText("doclet.Style_line_6"); println(" */");
+        print(".TableHeader     { text-align: center; font-size: 80%; font-weight: bold; }");
         println("");
 
     }
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/SubWriterHolderWriter.java	Thu Apr 02 10:49:41 2009 -0700
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/SubWriterHolderWriter.java	Thu Apr 02 17:01:00 2009 -0700
@@ -43,6 +43,7 @@
  *
  * @author Robert Field
  * @author Atul M Dambalkar
+ * @author Bhavesh Patel (Modified)
  */
 public abstract class SubWriterHolderWriter extends HtmlDocletWriter {
 
@@ -72,10 +73,11 @@
 
     public void printSummaryHeader(AbstractMemberWriter mw, ClassDoc cd) {
         mw.printSummaryAnchor(cd);
-        tableIndexSummary();
-        tableHeaderStart("#CCCCFF");
-        mw.printSummaryLabel(cd);
-        tableHeaderEnd();
+        mw.printTableSummary();
+        tableCaptionStart();
+        mw.printSummaryLabel();
+        tableCaptionEnd();
+        mw.printSummaryTableHeader(cd);
     }
 
     public void printTableHeadingBackground(String str) {
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlWriter.java	Thu Apr 02 10:49:41 2009 -0700
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlWriter.java	Thu Apr 02 17:01:00 2009 -0700
@@ -37,6 +37,7 @@
  *
  * @since 1.2
  * @author Atul M Dambalkar
+ * @author Bhavesh Patel (Modified)
  */
 public class HtmlWriter extends PrintWriter {
 
@@ -67,6 +68,21 @@
     protected boolean memberDetailsListPrinted;
 
     /**
+     * Header for tables displaying packages and description..
+     */
+    protected final String[] packageTableHeader;
+
+    /**
+     * Summary for use tables displaying class and package use.
+     */
+    protected final String useTableSummary;
+
+    /**
+     * Column header for class docs displaying Modifier and Type header.
+     */
+    protected final String modifierTypeHeader;
+
+    /**
      * Constructor.
      *
      * @param path The directory path to be created for this file
@@ -86,6 +102,15 @@
         this.configuration = configuration;
         htmlFilename = filename;
         this.memberDetailsListPrinted = false;
+        packageTableHeader = new String[] {
+            configuration.getText("doclet.Package"),
+            configuration.getText("doclet.Description")
+        };
+        useTableSummary = configuration.getText("doclet.Use_Table_Summary",
+                configuration.getText("doclet.packages"));
+        modifierTypeHeader = configuration.getText("doclet.0_and_1",
+                configuration.getText("doclet.Modifier"),
+                configuration.getText("doclet.Type"));
     }
 
     /**
@@ -803,6 +828,26 @@
     }
 
     /**
+     * Print HTML &lt;TABLE BORDER="border" WIDTH="width"
+     * CELLPADDING="cellpadding" CELLSPACING="cellspacing" SUMMARY="summary"&gt; tag.
+     *
+     * @param border       Border size.
+     * @param width        Width of the table.
+     * @param cellpadding  Cellpadding for the table cells.
+     * @param cellspacing  Cellspacing for the table cells.
+     * @param summary      Table summary.
+     */
+    public void table(int border, String width, int cellpadding,
+                      int cellspacing, String summary) {
+        println(DocletConstants.NL +
+                "<TABLE BORDER=\"" + border +
+                "\" WIDTH=\"" + width +
+                "\" CELLPADDING=\"" + cellpadding +
+                "\" CELLSPACING=\"" + cellspacing +
+                "\" SUMMARY=\"" + summary + "\">");
+    }
+
+    /**
      * Print HTML &lt;TABLE BORDER="border" CELLPADDING="cellpadding"
      * CELLSPACING="cellspacing"&gt; tag.
      *
@@ -819,6 +864,23 @@
     }
 
     /**
+     * Print HTML &lt;TABLE BORDER="border" CELLPADDING="cellpadding"
+     * CELLSPACING="cellspacing" SUMMARY="summary"&gt; tag.
+     *
+     * @param border       Border size.
+     * @param cellpadding  Cellpadding for the table cells.
+     * @param cellspacing  Cellspacing for the table cells.
+     * @param summary      Table summary.
+     */
+    public void table(int border, int cellpadding, int cellspacing, String summary) {
+        println(DocletConstants.NL +
+                "<TABLE BORDER=\"" + border +
+                "\" CELLPADDING=\"" + cellpadding +
+                "\" CELLSPACING=\"" + cellspacing +
+                "\" SUMMARY=\"" + summary + "\">");
+    }
+
+    /**
      * Print HTML &lt;TABLE BORDER="border" WIDTH="width"&gt;
      *
      * @param border       Border size.
@@ -913,6 +975,23 @@
     }
 
     /**
+     * Print &lt;CAPTION CLASS="stylename"&gt; tag. Adds a newline character
+     * at the end.
+     *
+     * @param stylename style to be applied.
+     */
+    public void captionStyle(String stylename) {
+        println("<CAPTION CLASS=\"" + stylename + "\">");
+    }
+
+    /**
+     * Print &lt;/CAPTION&gt; tag. Add a newline character at the end.
+     */
+    public void captionEnd() {
+        println("</CAPTION>");
+    }
+
+    /**
      * Print &lt;TR BGCOLOR="color" CLASS="stylename"&gt; tag. Adds a newline character
      * at the end.
      *
@@ -953,6 +1032,23 @@
     }
 
     /**
+     * Print &lt;TH CLASS="stylename" SCOPE="scope" NOWRAP&gt; tag.
+     *
+     * @param stylename style to be applied.
+     * @param scope the scope attribute.
+     */
+    public void thScopeNoWrap(String stylename, String scope) {
+        print("<TH CLASS=\"" + stylename + "\" SCOPE=\"" + scope + "\" NOWRAP>");
+    }
+
+    /*
+     * Returns a header for Modifier and Type column of a table.
+     */
+    public String getModifierTypeHeader() {
+        return modifierTypeHeader;
+    }
+
+    /**
      * Print &lt;TH align="align" COLSPAN=i&gt; tag.
      *
      * @param align the align attribute.
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/resources/standard.properties	Thu Apr 02 10:49:41 2009 -0700
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/resources/standard.properties	Thu Apr 02 17:01:00 2009 -0700
@@ -83,6 +83,17 @@
 doclet.Deprecated_Methods=Deprecated Methods
 doclet.Deprecated_Enum_Constants=Deprecated Enum Constants
 doclet.Deprecated_Annotation_Type_Members=Deprecated Annotation Type Elements
+doclet.deprecated_classes=deprecated classes
+doclet.deprecated_enums=deprecated enums
+doclet.deprecated_interfaces=deprecated interfaces
+doclet.deprecated_exceptions=deprecated exceptions
+doclet.deprecated_annotation_types=deprecated annotation types
+doclet.deprecated_errors=deprecated errors
+doclet.deprecated_fields=deprecated fields
+doclet.deprecated_constructors=deprecated constructors
+doclet.deprecated_methods=deprecated methods
+doclet.deprecated_enum_constants=deprecated enum constants
+doclet.deprecated_annotation_type_members=deprecated annotation type elements
 doclet.Frame_Output=Frame Output
 doclet.Docs_generated_by_Javadoc=Documentation generated by Javadoc.
 doclet.Generated_Docs_Untitled=Generated Documentation (Untitled)
@@ -171,6 +182,7 @@
 doclet.Style_line_9=Example of smaller, sans-serif font in frames
 doclet.Style_line_10=Navigation bar fonts and colors
 doclet.Style_line_11=Dark Blue
+doclet.Style_line_12=Table caption style
 doclet.ClassUse_Packages.that.use.0=Packages that use {0}
 doclet.ClassUse_Uses.of.0.in.1=Uses of {0} in {1}
 doclet.ClassUse_Classes.in.0.used.by.1=Classes in {0} used by {1}
--- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/PackageSummaryWriter.java	Thu Apr 02 10:49:41 2009 -0700
+++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/PackageSummaryWriter.java	Thu Apr 02 17:01:00 2009 -0700
@@ -64,7 +64,7 @@
      * @param classes the array of classes to document.
      * @param label the label for this table.
      */
-    public abstract void writeClassesSummary(ClassDoc[] classes, String label);
+    public abstract void writeClassesSummary(ClassDoc[] classes, String label, String tableSummary, String[] tableHeader);
 
     /**
      * Write the header for the summary.
--- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/PackageSummaryBuilder.java	Thu Apr 02 10:49:41 2009 -0700
+++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/PackageSummaryBuilder.java	Thu Apr 02 17:01:00 2009 -0700
@@ -40,6 +40,7 @@
  * Do not use it as an API
  *
  * @author Jamie Ho
+ * @author Bhavesh Patel (Modified)
  * @since 1.5
  */
 public class PackageSummaryBuilder extends AbstractBuilder {
@@ -184,7 +185,15 @@
          * Build the summary for the classes in this package.
          */
         public void buildClassSummary() {
-                ClassDoc[] classes =
+            String classTableSummary =
+                    configuration.getText("doclet.Member_Table_Summary",
+                    configuration.getText("doclet.Class_Summary"),
+                    configuration.getText("doclet.classes"));
+            String[] classTableHeader = new String[] {
+                configuration.getText("doclet.Class"),
+                configuration.getText("doclet.Description")
+            };
+            ClassDoc[] classes =
                         packageDoc.isIncluded()
                                 ? packageDoc.ordinaryClasses()
                                 : configuration.classDocCatalog.ordinaryClasses(
@@ -192,7 +201,8 @@
                 if (classes.length > 0) {
                         packageWriter.writeClassesSummary(
                                 classes,
-                                configuration.getText("doclet.Class_Summary"));
+                                configuration.getText("doclet.Class_Summary"),
+                                classTableSummary, classTableHeader);
                 }
         }
 
@@ -200,7 +210,15 @@
          * Build the summary for the interfaces in this package.
          */
         public void buildInterfaceSummary() {
-                ClassDoc[] interfaces =
+            String interfaceTableSummary =
+                    configuration.getText("doclet.Member_Table_Summary",
+                    configuration.getText("doclet.Interface_Summary"),
+                    configuration.getText("doclet.interfaces"));
+            String[] interfaceTableHeader = new String[] {
+                configuration.getText("doclet.Interface"),
+                configuration.getText("doclet.Description")
+            };
+            ClassDoc[] interfaces =
                         packageDoc.isIncluded()
                                 ? packageDoc.interfaces()
                                 : configuration.classDocCatalog.interfaces(
@@ -208,7 +226,8 @@
                 if (interfaces.length > 0) {
                         packageWriter.writeClassesSummary(
                                 interfaces,
-                                configuration.getText("doclet.Interface_Summary"));
+                                configuration.getText("doclet.Interface_Summary"),
+                                interfaceTableSummary, interfaceTableHeader);
                 }
         }
 
@@ -216,7 +235,15 @@
          * Build the summary for the enums in this package.
          */
         public void buildAnnotationTypeSummary() {
-                ClassDoc[] annotationTypes =
+            String annotationtypeTableSummary =
+                    configuration.getText("doclet.Member_Table_Summary",
+                    configuration.getText("doclet.Annotation_Types_Summary"),
+                    configuration.getText("doclet.annotationtypes"));
+            String[] annotationtypeTableHeader = new String[] {
+                configuration.getText("doclet.AnnotationType"),
+                configuration.getText("doclet.Description")
+            };
+            ClassDoc[] annotationTypes =
                         packageDoc.isIncluded()
                                 ? packageDoc.annotationTypes()
                                 : configuration.classDocCatalog.annotationTypes(
@@ -224,7 +251,8 @@
                 if (annotationTypes.length > 0) {
                         packageWriter.writeClassesSummary(
                                 annotationTypes,
-                                configuration.getText("doclet.Annotation_Types_Summary"));
+                                configuration.getText("doclet.Annotation_Types_Summary"),
+                                annotationtypeTableSummary, annotationtypeTableHeader);
                 }
         }
 
@@ -232,7 +260,15 @@
          * Build the summary for the enums in this package.
          */
         public void buildEnumSummary() {
-                ClassDoc[] enums =
+            String enumTableSummary =
+                    configuration.getText("doclet.Member_Table_Summary",
+                    configuration.getText("doclet.Enum_Summary"),
+                    configuration.getText("doclet.enums"));
+            String[] enumTableHeader = new String[] {
+                configuration.getText("doclet.Enum"),
+                configuration.getText("doclet.Description")
+            };
+            ClassDoc[] enums =
                         packageDoc.isIncluded()
                                 ? packageDoc.enums()
                                 : configuration.classDocCatalog.enums(
@@ -240,7 +276,8 @@
                 if (enums.length > 0) {
                         packageWriter.writeClassesSummary(
                                 enums,
-                                configuration.getText("doclet.Enum_Summary"));
+                                configuration.getText("doclet.Enum_Summary"),
+                                enumTableSummary, enumTableHeader);
                 }
         }
 
@@ -248,7 +285,15 @@
          * Build the summary for the exceptions in this package.
          */
         public void buildExceptionSummary() {
-                ClassDoc[] exceptions =
+            String exceptionTableSummary =
+                    configuration.getText("doclet.Member_Table_Summary",
+                    configuration.getText("doclet.Exception_Summary"),
+                    configuration.getText("doclet.exceptions"));
+            String[] exceptionTableHeader = new String[] {
+                configuration.getText("doclet.Exception"),
+                configuration.getText("doclet.Description")
+            };
+            ClassDoc[] exceptions =
                         packageDoc.isIncluded()
                                 ? packageDoc.exceptions()
                                 : configuration.classDocCatalog.exceptions(
@@ -256,7 +301,8 @@
                 if (exceptions.length > 0) {
                         packageWriter.writeClassesSummary(
                                 exceptions,
-                                configuration.getText("doclet.Exception_Summary"));
+                                configuration.getText("doclet.Exception_Summary"),
+                                exceptionTableSummary, exceptionTableHeader);
                 }
         }
 
@@ -264,7 +310,15 @@
          * Build the summary for the errors in this package.
          */
         public void buildErrorSummary() {
-                ClassDoc[] errors =
+            String errorTableSummary =
+                    configuration.getText("doclet.Member_Table_Summary",
+                    configuration.getText("doclet.Error_Summary"),
+                    configuration.getText("doclet.errors"));
+            String[] errorTableHeader = new String[] {
+                configuration.getText("doclet.Error"),
+                configuration.getText("doclet.Description")
+            };
+            ClassDoc[] errors =
                         packageDoc.isIncluded()
                                 ? packageDoc.errors()
                                 : configuration.classDocCatalog.errors(
@@ -272,7 +326,8 @@
                 if (errors.length > 0) {
                         packageWriter.writeClassesSummary(
                                 errors,
-                                configuration.getText("doclet.Error_Summary"));
+                                configuration.getText("doclet.Error_Summary"),
+                                errorTableSummary, errorTableHeader);
                 }
         }
 
--- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/doclets.properties	Thu Apr 02 10:49:41 2009 -0700
+++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/doclets.properties	Thu Apr 02 17:01:00 2009 -0700
@@ -82,6 +82,7 @@
 doclet.Errors=Errors
 doclet.Classes=Classes
 doclet.Packages=Packages
+doclet.packages=packages
 doclet.All_Classes=All Classes
 doclet.All_Superinterfaces=All Superinterfaces:
 doclet.All_Implemented_Interfaces=All Implemented Interfaces:
@@ -92,14 +93,20 @@
 doclet.Class=Class
 doclet.AnnotationType=Annotation Type
 doclet.annotationtype=annotation type
+doclet.annotationtypes=annotation types
 doclet.Enum=Enum
 doclet.enum=enum
+doclet.enums=enums
 doclet.interface=interface
+doclet.interfaces=interfaces
 doclet.class=class
+doclet.classes=classes
 doclet.Error=Error
 doclet.error=error
+doclet.errors=errors
 doclet.Exception=Exception
 doclet.exception=exception
+doclet.exceptions=exceptions
 doclet.extended_by=extended by
 doclet.extends=extends
 doclet.Package_private=(package private)
@@ -125,6 +132,32 @@
 doclet.value_tag_invalid_constant=@value tag (which references {0}) can only be used in constants.
 doclet.dest_dir_create=Creating destination directory: "{0}"
 doclet.in={0} in {1}
+doclet.Use_Table_Summary=Use table, listing {0}, and an explanation
+doclet.Constants_Table_Summary={0} table, listing constant fields, and values
+doclet.Member_Table_Summary={0} table, listing {1}, and an explanation
+doclet.fields=fields
+doclet.constructors=constructors
+doclet.methods=methods
+doclet.annotation_type_optional_members=optional elements
+doclet.annotation_type_required_members=required elements
+doclet.enum_constants=enum constants
+doclet.nested_classes=nested classes
+doclet.subclasses=subclasses
+doclet.subinterfaces=subinterfaces
+doclet.Modifier=Modifier
+doclet.Type=Type
+doclet.Field=Field
+doclet.Constructor=Constructor
+doclet.Method=Method
+doclet.Annotation_Type_Optional_Member=Optional Element
+doclet.Annotation_Type_Required_Member=Required Element
+doclet.Annotation_Type_Member=Annotation Type Element
+doclet.Enum_Constant=Enum Constant
+doclet.Class=Class
+doclet.Description=Description
+doclet.ConstantField=Constant Field
+doclet.Value=Value
+doclet.0_and_1={0} and {1}
 
 #Documentation for Enums
 doclet.enum_values_doc=\n\
--- a/langtools/test/com/sun/javadoc/testHeadings/TestHeadings.java	Thu Apr 02 10:49:41 2009 -0700
+++ b/langtools/test/com/sun/javadoc/testHeadings/TestHeadings.java	Thu Apr 02 17:01:00 2009 -0700
@@ -47,14 +47,16 @@
     private static final String[][] TEST = {
         //Package summary
         {BUG_ID + FS + "pkg1" + FS + "package-summary.html",
-            "<TH ALIGN=\"left\" COLSPAN=\"2\"><FONT SIZE=\"+2\">" + NL +
-            "<STRONG>Class Summary</STRONG></FONT></TH>"
+            "<TH CLASS=\"TableHeader\" SCOPE=\"col\" NOWRAP>" +
+            "Class</TH>" + NL + "<TH CLASS=\"TableHeader\" SCOPE=\"col\"" +
+            " NOWRAP>Description</TH>"
         },
 
         // Class documentation
         {BUG_ID + FS + "pkg1" + FS + "C1.html",
-            "<TH ALIGN=\"left\" COLSPAN=\"2\"><FONT SIZE=\"+2\">" + NL +
-            "<STRONG>Field Summary</STRONG></FONT></TH>"
+            "<TH CLASS=\"TableHeader\" SCOPE=\"col\" NOWRAP>" +
+            "Modifier and Type</TH>" + NL + "<TH CLASS=\"TableHeader\"" +
+            " SCOPE=\"col\" NOWRAP>Field and Description</TH>"
         },
         {BUG_ID + FS + "pkg1" + FS + "C1.html",
             "<TH ALIGN=\"left\"><STRONG>Methods inherited from class " +            "java.lang.Object</STRONG></TH>"
@@ -62,29 +64,32 @@
 
         // Class use documentation
         {BUG_ID + FS + "pkg1" + FS + "class-use" + FS + "C1.html",
-            "<TH ALIGN=\"left\" COLSPAN=\"2\"><FONT SIZE=\"+2\">" + NL +
-            "Packages that use <A HREF=\"../../pkg1/C1.html\" " +            "title=\"class in pkg1\">C1</A></FONT></TH>"
+            "<TH CLASS=\"TableHeader\" SCOPE=\"col\" NOWRAP>" +
+            "Package</TH>" + NL + "<TH CLASS=\"TableHeader\"" +
+            " SCOPE=\"col\" NOWRAP>Description</TH>"
         },
         {BUG_ID + FS + "pkg1" + FS + "class-use" + FS + "C1.html",
             "<TH ALIGN=\"left\" COLSPAN=\"2\"><FONT SIZE=\"+2\">" + NL +
             "Uses of <A HREF=\"../../pkg1/C1.html\" " +            "title=\"class in pkg1\">C1</A> in " +            "<A HREF=\"../../pkg2/package-summary.html\">pkg2</A></FONT></TH>"
         },
         {BUG_ID + FS + "pkg1" + FS + "class-use" + FS + "C1.html",
-            "<TH ALIGN=\"left\" COLSPAN=\"2\">Fields in " +            "<A HREF=\"../../pkg2/package-summary.html\">pkg2</A> " +            "declared as <A HREF=\"../../pkg1/C1.html\" " +            "title=\"class in pkg1\">C1</A></FONT></TH>"
+            "<TH CLASS=\"TableHeader\" SCOPE=\"col\" NOWRAP>" +
+            "Modifier and Type</TH>" + NL + "<TH CLASS=\"TableHeader\"" +
+            " SCOPE=\"col\" NOWRAP>Field and Description</TH>"
         },
 
         // Deprecated
         {BUG_ID + FS + "deprecated-list.html",
-            "<TH ALIGN=\"left\" COLSPAN=\"2\"><FONT SIZE=\"+2\">" + NL +
-            "<STRONG>Deprecated Methods</STRONG></FONT></TH>"
+            "<TH CLASS=\"TableHeader\" SCOPE=\"col\" NOWRAP>" +
+            "Method and Description</TH>"
         },
 
         // Constant values
         {BUG_ID + FS + "constant-values.html",
-            "<TH ALIGN=\"left\" COLSPAN=\"3\">pkg1.<A HREF=\"pkg1/C1.html\" " +            "title=\"class in pkg1\">C1</A></TH>"
-        },
-        {BUG_ID + FS + "constant-values.html",
-            "<TH ALIGN=\"left\" COLSPAN=\"3\">pkg1.<A HREF=\"pkg1/C1.html\" " +            "title=\"class in pkg1\">C1</A></TH>"
+            "<TH CLASS=\"TableHeader\" SCOPE=\"col\" NOWRAP>" +
+            "Modifier and Type</TH>" + NL + "<TH CLASS=\"TableHeader\"" +
+            " SCOPE=\"col\" NOWRAP>Constant Field</TH>" + NL +
+            "<TH CLASS=\"TableHeader\" SCOPE=\"col\" NOWRAP>Value</TH>"
         },
 
         // Serialized Form
--- a/langtools/test/com/sun/javadoc/testHtmlDefinitionListTag/TestHtmlDefinitionListTag.java	Thu Apr 02 10:49:41 2009 -0700
+++ b/langtools/test/com/sun/javadoc/testHtmlDefinitionListTag/TestHtmlDefinitionListTag.java	Thu Apr 02 17:01:00 2009 -0700
@@ -25,7 +25,7 @@
 
 /*
  * @test
- * @bug 6786690
+ * @bug 6786690 6820360
  * @summary This test verifies the nesting of definition list tags.
  * @author Bhavesh Patel
  * @library ../lib/
@@ -36,7 +36,7 @@
 
 public class TestHtmlDefinitionListTag extends JavadocTester {
 
-    private static final String BUG_ID = "6786690";
+    private static final String BUG_ID = "6786690-6820360";
 
     // Test common to all runs of javadoc. The class signature should print
     // properly enclosed definition list tags and the Annotation Type
@@ -55,6 +55,9 @@
     // serialized form should have properly nested definition list tags
     // enclosing comments, tags and deprecated information.
     private static final String[][] TEST_CMNT_DEPR = {
+        {BUG_ID + FS + "pkg1" + FS + "package-summary.html", "<DL>" + NL +
+                 "<DT><STRONG>Since:</STRONG></DT>" + NL +
+                 "  <DD>JDK1.0</DD></DL>"},
         {BUG_ID + FS + "pkg1" + FS + "C1.html", "<DL>" + NL +
                  "<DT><STRONG>Since:</STRONG></DT>" + NL +
                  "  <DD>JDK1.0</DD>" + NL + "<DT><STRONG>See Also:</STRONG></DT><DD>" +
@@ -193,6 +196,9 @@
     // should display properly nested definition list tags for comments, tags
     // and deprecated information.
     private static final String[][] TEST_NODEPR = {
+        {BUG_ID + FS + "pkg1" + FS + "package-summary.html", "<DL>" + NL +
+                 "<DT><STRONG>Since:</STRONG></DT>" + NL +
+                 "  <DD>JDK1.0</DD></DL>"},
         {BUG_ID + FS + "pkg1" + FS + "C1.html", "<DL>" + NL +
                  "<DT><STRONG>Since:</STRONG></DT>" + NL +
                  "  <DD>JDK1.0</DD>" + NL + "<DT><STRONG>See Also:</STRONG></DT><DD>" +
@@ -302,6 +308,8 @@
     // Test for valid HTML generation which should not comprise of empty
     // definition list tags.
     private static final String[][] NEGATED_TEST = {
+        {BUG_ID + FS + "pkg1" + FS + "package-summary.html", "<DL></DL>"},
+        {BUG_ID + FS + "pkg1" + FS + "package-summary.html", "<DL>" + NL + "</DL>"},
         {BUG_ID + FS + "pkg1" + FS + "C1.html", "<DL></DL>"},
         {BUG_ID + FS + "pkg1" + FS + "C1.html", "<DL>" + NL + "</DL>"},
         {BUG_ID + FS + "pkg1" + FS + "C1.ModalExclusionType.html", "<DL></DL>"},
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/com/sun/javadoc/testHtmlDefinitionListTag/pkg1/package-info.java	Thu Apr 02 17:01:00 2009 -0700
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2009 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+/**
+ * Test package 1.
+ *
+ * @since JDK1.0
+ */
+package pkg1;
--- a/langtools/test/com/sun/javadoc/testHtmlStrongTag/TestHtmlStrongTag.java	Thu Apr 02 10:49:41 2009 -0700
+++ b/langtools/test/com/sun/javadoc/testHtmlStrongTag/TestHtmlStrongTag.java	Thu Apr 02 17:01:00 2009 -0700
@@ -38,14 +38,15 @@
 
     private static final String BUG_ID = "6786028";
     private static final String[][] TEST1 = {
-        {BUG_ID + FS + "pkg1" + FS + "C1.html", "<STRONG>Method Summary</STRONG>"},
-        {BUG_ID + FS + "pkg1" + FS + "C1.html", "<STRONG>See Also:</STRONG>"},
-        {BUG_ID + FS + "pkg1" + FS + "package-summary.html", "<STRONG>Class Summary</STRONG>"}};
+        {BUG_ID + FS + "pkg1" + FS + "C1.html", "<STRONG>See Also:</STRONG>"}};
     private static final String[][] NEGATED_TEST1 = {
-        {BUG_ID + FS + "pkg1" + FS + "C1.html", "<B>"}};
+        {BUG_ID + FS + "pkg1" + FS + "C1.html", "<STRONG>Method Summary</STRONG>"},
+        {BUG_ID + FS + "pkg1" + FS + "C1.html", "<B>"},
+        {BUG_ID + FS + "pkg1" + FS + "package-summary.html", "<STRONG>Class Summary</STRONG>"}};
     private static final String[][] TEST2 = {
+        {BUG_ID + FS + "pkg2" + FS + "C2.html", "<B>Comments:</B>"}};
+    private static final String[][] NEGATED_TEST2 = {
         {BUG_ID + FS + "pkg2" + FS + "C2.html", "<STRONG>Method Summary</STRONG>"},
-        {BUG_ID + FS + "pkg2" + FS + "C2.html", "<B>Comments:</B>"},
         {BUG_ID + FS + "pkg1" + FS + "package-summary.html", "<STRONG>Class Summary</STRONG>"}};
 
     private static final String[] ARGS1 =
@@ -62,7 +63,7 @@
     public static void main(String[] args) {
         TestHtmlStrongTag tester = new TestHtmlStrongTag();
         run(tester, ARGS1, TEST1, NEGATED_TEST1);
-        run(tester, ARGS2, TEST2, NO_TEST);
+        run(tester, ARGS2, TEST2, NEGATED_TEST2);
         tester.printSummary();
     }
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/com/sun/javadoc/testHtmlTableTags/TestHtmlTableTags.java	Thu Apr 02 17:01:00 2009 -0700
@@ -0,0 +1,478 @@
+/*
+ * Copyright 2009 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+/*
+ * @test
+ * @bug      6786688
+ * @summary  HTML tables should have table summary, caption and table headers.
+ * @author   Bhavesh Patel
+ * @library  ../lib/
+ * @build    JavadocTester
+ * @build    TestHtmlTableTags
+ * @run main TestHtmlTableTags
+ */
+
+public class TestHtmlTableTags extends JavadocTester {
+
+    //Test information.
+    private static final String BUG_ID = "6786688";
+
+    //Javadoc arguments.
+    private static final String[] ARGS = new String[] {
+        "-d", BUG_ID, "-sourcepath", SRC_DIR, "-use", "pkg1", "pkg2"
+    };
+
+    //Input for string tests for HTML table tags.
+    private static final String[][] TABLE_TAGS_TEST = {
+        /*
+         * Test for validating summary for HTML tables
+         */
+
+        //Package summary
+        {BUG_ID + FS + "pkg1" + FS + "package-summary.html",
+            "<TABLE BORDER=\"1\" WIDTH=\"100%\" CELLPADDING=\"3\" " +
+            "CELLSPACING=\"0\" SUMMARY=\"Class Summary table, " +
+            "listing classes, and an explanation\">"
+        },
+        {BUG_ID + FS + "pkg1" + FS + "package-summary.html",
+            "<TABLE BORDER=\"1\" WIDTH=\"100%\" CELLPADDING=\"3\" " +
+            "CELLSPACING=\"0\" SUMMARY=\"Interface Summary table, " +
+            "listing interfaces, and an explanation\">"
+        },
+        {BUG_ID + FS + "pkg2" + FS + "package-summary.html",
+            "<TABLE BORDER=\"1\" WIDTH=\"100%\" CELLPADDING=\"3\" " +
+            "CELLSPACING=\"0\" SUMMARY=\"Enum Summary table, " +
+            "listing enums, and an explanation\">"
+        },
+        {BUG_ID + FS + "pkg2" + FS + "package-summary.html",
+            "<TABLE BORDER=\"1\" WIDTH=\"100%\" CELLPADDING=\"3\" " +
+            "CELLSPACING=\"0\" SUMMARY=\"Annotation Types Summary table, " +
+            "listing annotation types, and an explanation\">"
+        },
+        // Class documentation
+        {BUG_ID + FS + "pkg1" + FS + "C1.html",
+            "<TABLE BORDER=\"1\" WIDTH=\"100%\" CELLPADDING=\"3\" " +
+            "CELLSPACING=\"0\" SUMMARY=\"Field Summary table, " +
+            "listing fields, and an explanation\">"
+        },
+        {BUG_ID + FS + "pkg1" + FS + "C1.html",
+            "<TABLE BORDER=\"1\" WIDTH=\"100%\" CELLPADDING=\"3\" " +
+            "CELLSPACING=\"0\" SUMMARY=\"Method Summary table, " +
+            "listing methods, and an explanation\">"
+        },
+        {BUG_ID + FS + "pkg2" + FS + "C2.html",
+            "<TABLE BORDER=\"1\" WIDTH=\"100%\" CELLPADDING=\"3\" " +
+            "CELLSPACING=\"0\" SUMMARY=\"Nested Class Summary table, " +
+            "listing nested classes, and an explanation\">"
+        },
+        {BUG_ID + FS + "pkg2" + FS + "C2.html",
+            "<TABLE BORDER=\"1\" WIDTH=\"100%\" CELLPADDING=\"3\" " +
+            "CELLSPACING=\"0\" SUMMARY=\"Constructor Summary table, " +
+            "listing constructors, and an explanation\">"
+        },
+        {BUG_ID + FS + "pkg2" + FS + "C2.ModalExclusionType.html",
+            "<TABLE BORDER=\"1\" WIDTH=\"100%\" CELLPADDING=\"3\" " +
+            "CELLSPACING=\"0\" SUMMARY=\"Enum Constant Summary table, " +
+            "listing enum constants, and an explanation\">"
+        },
+        {BUG_ID + FS + "pkg2" + FS + "C3.html",
+            "<TABLE BORDER=\"1\" WIDTH=\"100%\" CELLPADDING=\"3\" " +
+            "CELLSPACING=\"0\" SUMMARY=\"Required Element Summary table, " +
+            "listing required elements, and an explanation\">"
+        },
+        {BUG_ID + FS + "pkg2" + FS + "C4.html",
+            "<TABLE BORDER=\"1\" WIDTH=\"100%\" CELLPADDING=\"3\" " +
+            "CELLSPACING=\"0\" SUMMARY=\"Optional Element Summary table, " +
+            "listing optional elements, and an explanation\">"
+        },
+        // Class use documentation
+        {BUG_ID + FS + "pkg1" + FS + "class-use" + FS + "I1.html",
+            "<TABLE BORDER=\"1\" WIDTH=\"100%\" CELLPADDING=\"3\" " +
+            "CELLSPACING=\"0\" SUMMARY=\"Use table, " +
+            "listing packages, and an explanation\">"
+        },
+        {BUG_ID + FS + "pkg1" + FS + "class-use" + FS + "C1.html",
+            "<TABLE BORDER=\"1\" WIDTH=\"100%\" CELLPADDING=\"3\" " +
+            "CELLSPACING=\"0\" SUMMARY=\"Use table, " +
+            "listing fields, and an explanation\">"
+        },
+        {BUG_ID + FS + "pkg1" + FS + "class-use" + FS + "C1.html",
+            "<TABLE BORDER=\"1\" WIDTH=\"100%\" CELLPADDING=\"3\" " +
+            "CELLSPACING=\"0\" SUMMARY=\"Use table, " +
+            "listing methods, and an explanation\">"
+        },
+        {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "C2.html",
+            "<TABLE BORDER=\"1\" WIDTH=\"100%\" CELLPADDING=\"3\" " +
+            "CELLSPACING=\"0\" SUMMARY=\"Use table, " +
+            "listing fields, and an explanation\">"
+        },
+        {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "C2.html",
+            "<TABLE BORDER=\"1\" WIDTH=\"100%\" CELLPADDING=\"3\" " +
+            "CELLSPACING=\"0\" SUMMARY=\"Use table, " +
+            "listing methods, and an explanation\">"
+        },
+        {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "C2.ModalExclusionType.html",
+            "<TABLE BORDER=\"1\" WIDTH=\"100%\" CELLPADDING=\"3\" " +
+            "CELLSPACING=\"0\" SUMMARY=\"Use table, " +
+            "listing packages, and an explanation\">"
+        },
+        {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "C2.ModalExclusionType.html",
+            "<TABLE BORDER=\"1\" WIDTH=\"100%\" CELLPADDING=\"3\" " +
+            "CELLSPACING=\"0\" SUMMARY=\"Use table, " +
+            "listing methods, and an explanation\">"
+        },
+        // Package use documentation
+        {BUG_ID + FS + "pkg1" + FS + "package-use.html",
+            "<TABLE BORDER=\"1\" WIDTH=\"100%\" CELLPADDING=\"3\" " +
+            "CELLSPACING=\"0\" SUMMARY=\"Use table, " +
+            "listing packages, and an explanation\">"
+        },
+        {BUG_ID + FS + "pkg1" + FS + "package-use.html",
+            "<TABLE BORDER=\"1\" WIDTH=\"100%\" CELLPADDING=\"3\" " +
+            "CELLSPACING=\"0\" SUMMARY=\"Use table, " +
+            "listing classes, and an explanation\">"
+        },
+        {BUG_ID + FS + "pkg2" + FS + "package-use.html",
+            "<TABLE BORDER=\"1\" WIDTH=\"100%\" CELLPADDING=\"3\" " +
+            "CELLSPACING=\"0\" SUMMARY=\"Use table, " +
+            "listing packages, and an explanation\">"
+        },
+        {BUG_ID + FS + "pkg2" + FS + "package-use.html",
+            "<TABLE BORDER=\"1\" WIDTH=\"100%\" CELLPADDING=\"3\" " +
+            "CELLSPACING=\"0\" SUMMARY=\"Use table, " +
+            "listing classes, and an explanation\">"
+        },
+        // Deprecated
+        {BUG_ID + FS + "deprecated-list.html",
+            "<TABLE BORDER=\"1\" WIDTH=\"100%\" CELLPADDING=\"3\" " +
+            "CELLSPACING=\"0\" SUMMARY=\"Deprecated Fields table, " +
+            "listing deprecated fields, and an explanation\">"
+        },
+        {BUG_ID + FS + "deprecated-list.html",
+            "<TABLE BORDER=\"1\" WIDTH=\"100%\" CELLPADDING=\"3\" " +
+            "CELLSPACING=\"0\" SUMMARY=\"Deprecated Methods table, " +
+            "listing deprecated methods, and an explanation\">"
+        },
+        // Constant values
+        {BUG_ID + FS + "constant-values.html",
+            "<TABLE BORDER=\"1\" CELLPADDING=\"3\" CELLSPACING=\"0\" " +
+            "SUMMARY=\"Constant Field Values table, listing " +
+            "constant fields, and values\">"
+        },
+        // Overview Summary
+        {BUG_ID + FS + "overview-summary.html",
+            "<TABLE BORDER=\"1\" WIDTH=\"100%\" CELLPADDING=\"3\" " +
+            "CELLSPACING=\"0\" SUMMARY=\"Packages table, " +
+            "listing packages, and an explanation\">"
+        },
+
+        /*
+         * Test for validating caption for HTML tables
+         */
+
+        //Package summary
+        {BUG_ID + FS + "pkg1" + FS + "package-summary.html",
+            "<CAPTION CLASS=\"TableCaption\">" + NL +
+            "Class Summary</CAPTION>"
+        },
+        {BUG_ID + FS + "pkg1" + FS + "package-summary.html",
+            "<CAPTION CLASS=\"TableCaption\">" + NL +
+            "Interface Summary</CAPTION>"
+        },
+        {BUG_ID + FS + "pkg2" + FS + "package-summary.html",
+            "<CAPTION CLASS=\"TableCaption\">" + NL +
+            "Enum Summary</CAPTION>"
+        },
+        {BUG_ID + FS + "pkg2" + FS + "package-summary.html",
+            "<CAPTION CLASS=\"TableCaption\">" + NL +
+            "Annotation Types Summary</CAPTION>"
+        },
+        // Class documentation
+        {BUG_ID + FS + "pkg1" + FS + "C1.html",
+            "<CAPTION CLASS=\"TableCaption\">" + NL +
+            "Field Summary</CAPTION>"
+        },
+        {BUG_ID + FS + "pkg1" + FS + "C1.html",
+            "<CAPTION CLASS=\"TableCaption\">" + NL +
+            "Method Summary</CAPTION>"
+        },
+        {BUG_ID + FS + "pkg2" + FS + "C2.html",
+            "<CAPTION CLASS=\"TableCaption\">" + NL +
+            "Nested Class Summary</CAPTION>"
+        },
+        {BUG_ID + FS + "pkg2" + FS + "C2.html",
+            "<CAPTION CLASS=\"TableCaption\">" + NL +
+            "Constructor Summary</CAPTION>"
+        },
+        {BUG_ID + FS + "pkg2" + FS + "C2.ModalExclusionType.html",
+            "<CAPTION CLASS=\"TableCaption\">" + NL +
+            "Enum Constant Summary</CAPTION>"
+        },
+        {BUG_ID + FS + "pkg2" + FS + "C3.html",
+            "<CAPTION CLASS=\"TableCaption\">" + NL +
+            "Required Element Summary</CAPTION>"
+        },
+        {BUG_ID + FS + "pkg2" + FS + "C4.html",
+            "<CAPTION CLASS=\"TableCaption\">" + NL +
+            "Optional Element Summary</CAPTION>"
+        },
+        // Class use documentation
+        {BUG_ID + FS + "pkg1" + FS + "class-use" + FS + "I1.html",
+            "<CAPTION CLASS=\"TableCaption\">" + NL +
+            "Packages that use <A HREF=\"../../pkg1/I1.html\" " +
+            "title=\"interface in pkg1\">I1</A></CAPTION>"
+        },
+        {BUG_ID + FS + "pkg1" + FS + "class-use" + FS + "C1.html",
+            "<CAPTION CLASS=\"TableSubCaption\">" + NL +
+            "Fields in <A HREF=\"../../pkg2/package-summary.html\">pkg2</A> " +
+            "declared as <A HREF=\"../../pkg1/C1.html\" title=\"class in pkg1\">" +
+            "C1</A></CAPTION>"
+        },
+        {BUG_ID + FS + "pkg1" + FS + "class-use" + FS + "C1.html",
+            "<CAPTION CLASS=\"TableSubCaption\">" + NL +
+            "Methods in <A HREF=\"../../pkg2/package-summary.html\">pkg2</A> " +
+            "with parameters of type <A HREF=\"../../pkg1/C1.html\" " +
+            "title=\"class in pkg1\">C1</A></CAPTION>"
+        },
+        {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "C2.html",
+            "<CAPTION CLASS=\"TableSubCaption\">" + NL +
+            "Fields in <A HREF=\"../../pkg1/package-summary.html\">pkg1</A> " +
+            "declared as <A HREF=\"../../pkg2/C2.html\" title=\"class in pkg2\">" +
+            "C2</A></CAPTION>"
+        },
+        {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "C2.html",
+            "<CAPTION CLASS=\"TableSubCaption\">" + NL +
+            "Methods in <A HREF=\"../../pkg1/package-summary.html\">pkg1</A> " +
+            "with parameters of type <A HREF=\"../../pkg2/C2.html\" " +
+            "title=\"class in pkg2\">C2</A></CAPTION>"
+        },
+        {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "C2.ModalExclusionType.html",
+            "<CAPTION CLASS=\"TableSubCaption\">" + NL +
+            "Methods in <A HREF=\"../../pkg2/package-summary.html\">pkg2</A> " +
+            "that return <A HREF=\"../../pkg2/C2.ModalExclusionType.html\" " +
+            "title=\"enum in pkg2\">C2.ModalExclusionType</A></CAPTION>"
+        },
+        // Package use documentation
+        {BUG_ID + FS + "pkg1" + FS + "package-use.html",
+            "<CAPTION CLASS=\"TableCaption\">" + NL +
+            "Packages that use <A HREF=\"../pkg1/package-summary.html\">" +
+            "pkg1</A></CAPTION>"
+        },
+        {BUG_ID + FS + "pkg1" + FS + "package-use.html",
+            "<CAPTION CLASS=\"TableCaption\">" + NL +
+            "Classes in <A HREF=\"../pkg1/package-summary.html\">pkg1</A> " +
+            "used by <A HREF=\"../pkg1/package-summary.html\">pkg1</A></CAPTION>"
+        },
+        {BUG_ID + FS + "pkg2" + FS + "package-use.html",
+            "<CAPTION CLASS=\"TableCaption\">" + NL +
+            "Packages that use <A HREF=\"../pkg2/package-summary.html\">" +
+            "pkg2</A></CAPTION>"
+        },
+        {BUG_ID + FS + "pkg2" + FS + "package-use.html",
+            "<CAPTION CLASS=\"TableCaption\">" + NL +
+            "Classes in <A HREF=\"../pkg2/package-summary.html\">pkg2</A> " +
+            "used by <A HREF=\"../pkg1/package-summary.html\">pkg1</A></CAPTION>"
+        },
+        // Deprecated
+        {BUG_ID + FS + "deprecated-list.html",
+            "<CAPTION CLASS=\"TableCaption\">" + NL +
+            "Deprecated Fields</CAPTION>"
+        },
+        {BUG_ID + FS + "deprecated-list.html",
+            "<CAPTION CLASS=\"TableCaption\">" + NL +
+            "Deprecated Methods</CAPTION>"
+        },
+        // Constant values
+        {BUG_ID + FS + "constant-values.html",
+            "<CAPTION CLASS=\"TableSubCaption\">" + NL +
+            "pkg1.<A HREF=\"pkg1/C1.html\" title=\"class in pkg1\">C1</A></CAPTION>"
+        },
+        // Overview Summary
+        {BUG_ID + FS + "overview-summary.html",
+            "<CAPTION CLASS=\"TableCaption\">" + NL +
+            "Packages</CAPTION>"
+        },
+
+        /*
+         * Test for validating headers for HTML tables
+         */
+
+        //Package summary
+        {BUG_ID + FS + "pkg1" + FS + "package-summary.html",
+            "<TH CLASS=\"TableHeader\" SCOPE=\"col\" NOWRAP>" +
+            "Class</TH>" + NL + "<TH CLASS=\"TableHeader\" SCOPE=\"col\"" +
+            " NOWRAP>Description</TH>"
+        },
+        {BUG_ID + FS + "pkg1" + FS + "package-summary.html",
+            "<TH CLASS=\"TableHeader\" SCOPE=\"col\" NOWRAP>" +
+            "Interface</TH>" + NL + "<TH CLASS=\"TableHeader\" SCOPE=\"col\"" +
+            " NOWRAP>Description</TH>"
+        },
+        {BUG_ID + FS + "pkg2" + FS + "package-summary.html",
+            "<TH CLASS=\"TableHeader\" SCOPE=\"col\" NOWRAP>" +
+            "Enum</TH>" + NL + "<TH CLASS=\"TableHeader\" SCOPE=\"col\"" +
+            " NOWRAP>Description</TH>"
+        },
+        {BUG_ID + FS + "pkg2" + FS + "package-summary.html",
+            "<TH CLASS=\"TableHeader\" SCOPE=\"col\" NOWRAP>" +
+            "Annotation Type</TH>" + NL + "<TH CLASS=\"TableHeader\"" +
+            " SCOPE=\"col\" NOWRAP>Description</TH>"
+        },
+        // Class documentation
+        {BUG_ID + FS + "pkg1" + FS + "C1.html",
+            "<TH CLASS=\"TableHeader\" SCOPE=\"col\" NOWRAP>" +
+            "Modifier and Type</TH>" + NL + "<TH CLASS=\"TableHeader\"" +
+            " SCOPE=\"col\" NOWRAP>Field and Description</TH>"
+        },
+        {BUG_ID + FS + "pkg1" + FS + "C1.html",
+            "<TH CLASS=\"TableHeader\" SCOPE=\"col\" NOWRAP>" +
+            "Modifier and Type</TH>" + NL + "<TH CLASS=\"TableHeader\"" +
+            " SCOPE=\"col\" NOWRAP>Method and Description</TH>"
+        },
+        {BUG_ID + FS + "pkg2" + FS + "C2.html",
+            "<TH CLASS=\"TableHeader\" SCOPE=\"col\" NOWRAP>" +
+            "Modifier and Type</TH>" + NL + "<TH CLASS=\"TableHeader\"" +
+            " SCOPE=\"col\" NOWRAP>Class and Description</TH>"
+        },
+        {BUG_ID + FS + "pkg2" + FS + "C2.html",
+            "<TH CLASS=\"TableHeader\" SCOPE=\"col\" NOWRAP>" +
+            "Constructor and Description</TH>"
+        },
+        {BUG_ID + FS + "pkg2" + FS + "C2.ModalExclusionType.html",
+            "<TH CLASS=\"TableHeader\" SCOPE=\"col\" NOWRAP>" +
+            "Enum Constant and Description</TH>"
+        },
+        {BUG_ID + FS + "pkg2" + FS + "C3.html",
+            "<TH CLASS=\"TableHeader\" SCOPE=\"col\" NOWRAP>" +
+            "Modifier and Type</TH>" + NL + "<TH CLASS=\"TableHeader\"" +
+            " SCOPE=\"col\" NOWRAP>Required Element and Description</TH>"
+        },
+        {BUG_ID + FS + "pkg2" + FS + "C4.html",
+            "<TH CLASS=\"TableHeader\" SCOPE=\"col\" NOWRAP>" +
+            "Modifier and Type</TH>" + NL + "<TH CLASS=\"TableHeader\"" +
+            " SCOPE=\"col\" NOWRAP>Optional Element and Description</TH>"
+        },
+        // Class use documentation
+        {BUG_ID + FS + "pkg1" + FS + "class-use" + FS + "I1.html",
+            "<TH CLASS=\"TableHeader\" SCOPE=\"col\" NOWRAP>" +
+            "Package</TH>" + NL + "<TH CLASS=\"TableHeader\" SCOPE=\"col\"" +
+            " NOWRAP>Description</TH>"
+        },
+        {BUG_ID + FS + "pkg1" + FS + "class-use" + FS + "C1.html",
+            "<TH CLASS=\"TableHeader\" SCOPE=\"col\" NOWRAP>" +
+            "Modifier and Type</TH>" + NL + "<TH CLASS=\"TableHeader\"" +
+            " SCOPE=\"col\" NOWRAP>Field and Description</TH>"
+        },
+        {BUG_ID + FS + "pkg1" + FS + "class-use" + FS + "C1.html",
+            "<TH CLASS=\"TableHeader\" SCOPE=\"col\" NOWRAP>" +
+            "Modifier and Type</TH>" + NL + "<TH CLASS=\"TableHeader\"" +
+            " SCOPE=\"col\" NOWRAP>Method and Description</TH>"
+        },
+        {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "C2.html",
+            "<TH CLASS=\"TableHeader\" SCOPE=\"col\" NOWRAP>" +
+            "Modifier and Type</TH>" + NL + "<TH CLASS=\"TableHeader\"" +
+            " SCOPE=\"col\" NOWRAP>Field and Description</TH>"
+        },
+        {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "C2.html",
+            "<TH CLASS=\"TableHeader\" SCOPE=\"col\" NOWRAP>" +
+            "Modifier and Type</TH>" + NL + "<TH CLASS=\"TableHeader\"" +
+            " SCOPE=\"col\" NOWRAP>Method and Description</TH>"
+        },
+        {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "C2.ModalExclusionType.html",
+            "<TH CLASS=\"TableHeader\" SCOPE=\"col\" NOWRAP>" +
+            "Package</TH>" + NL + "<TH CLASS=\"TableHeader\" SCOPE=\"col\"" +
+            " NOWRAP>Description</TH>"
+        },
+        {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "C2.ModalExclusionType.html",
+            "<TH CLASS=\"TableHeader\" SCOPE=\"col\" NOWRAP>" +
+            "Modifier and Type</TH>" + NL + "<TH CLASS=\"TableHeader\"" +
+            " SCOPE=\"col\" NOWRAP>Method and Description</TH>"
+        },
+        // Package use documentation
+        {BUG_ID + FS + "pkg1" + FS + "package-use.html",
+            "<TH CLASS=\"TableHeader\" SCOPE=\"col\" NOWRAP>" +
+            "Package</TH>" + NL + "<TH CLASS=\"TableHeader\" SCOPE=\"col\"" +
+            " NOWRAP>Description</TH>"
+        },
+        {BUG_ID + FS + "pkg1" + FS + "package-use.html",
+            "<TH CLASS=\"TableHeader\" SCOPE=\"col\" NOWRAP>" +
+            "Class and Description</TH>"
+        },
+        {BUG_ID + FS + "pkg2" + FS + "package-use.html",
+            "<TH CLASS=\"TableHeader\" SCOPE=\"col\" NOWRAP>" +
+            "Package</TH>" + NL + "<TH CLASS=\"TableHeader\" SCOPE=\"col\"" +
+            " NOWRAP>Description</TH>"
+        },
+        {BUG_ID + FS + "pkg2" + FS + "package-use.html",
+            "<TH CLASS=\"TableHeader\" SCOPE=\"col\" NOWRAP>" +
+            "Class and Description</TH>"
+        },
+        // Deprecated
+        {BUG_ID + FS + "deprecated-list.html",
+            "<TH CLASS=\"TableHeader\" SCOPE=\"col\" NOWRAP>" +
+            "Field and Description</TH>"
+        },
+        {BUG_ID + FS + "deprecated-list.html",
+            "<TH CLASS=\"TableHeader\" SCOPE=\"col\" NOWRAP>" +
+            "Method and Description</TH>"
+        },
+        // Constant values
+        {BUG_ID + FS + "constant-values.html",
+            "<TH CLASS=\"TableHeader\" SCOPE=\"col\" NOWRAP>" +
+            "Modifier and Type</TH>" + NL + "<TH CLASS=\"TableHeader\"" +
+            " SCOPE=\"col\" NOWRAP>Constant Field</TH>" + NL +
+            "<TH CLASS=\"TableHeader\" SCOPE=\"col\" NOWRAP>Value</TH>"
+        },
+        // Overview Summary
+        {BUG_ID + FS + "overview-summary.html",
+            "<TH CLASS=\"TableHeader\" SCOPE=\"col\" NOWRAP>" +
+            "Package</TH>" + NL + "<TH CLASS=\"TableHeader\" SCOPE=\"col\"" +
+            " NOWRAP>Description</TH>"
+        }
+    };
+    private static final String[][] NEGATED_TEST = NO_TEST;
+
+    /**
+     * The entry point of the test.
+     * @param args the array of command line arguments.
+     */
+    public static void main(String[] args) {
+        TestHtmlTableTags tester = new TestHtmlTableTags();
+        run(tester, ARGS, TABLE_TAGS_TEST, NEGATED_TEST);
+        tester.printSummary();
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public String getBugId() {
+        return BUG_ID;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public String getBugName() {
+        return getClass().getName();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/com/sun/javadoc/testHtmlTableTags/pkg1/C1.java	Thu Apr 02 17:01:00 2009 -0700
@@ -0,0 +1,81 @@
+/*
+ * Copyright 2009 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package pkg1;
+
+import pkg2.*;
+
+/**
+ * A test class.
+ *
+ * @author Bhavesh Patel
+ */
+public class C1 implements I1 {
+
+    /**
+     * Test field for class.
+     */
+    public C2 field;
+
+    /**
+     * Constant value.
+     */
+    public static final String CONSTANT1 = "C1";
+
+    /**
+     * A test constructor.
+     */
+    C1() {
+    }
+
+    /**
+     * Method thats does some processing.
+     *
+     * @param param some parameter that is passed.
+     * @return a sample object.
+     */
+    public C2 method(C2 param) {
+        return param;
+    }
+
+    /**
+     * Method that is implemented.
+     *
+     * @param a some random value.
+     * @param b some random value.
+     */
+    public void method1(int a, int b) {
+    }
+
+    /**
+     * Another inherited method.
+     * @param c some value.
+     */
+    public void method2(int c) {
+    }
+
+    /**
+     * @deprecated don't use this anymore.
+     */
+    public void deprecatedMethod() {}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/com/sun/javadoc/testHtmlTableTags/pkg1/I1.java	Thu Apr 02 17:01:00 2009 -0700
@@ -0,0 +1,48 @@
+/*
+ * Copyright 2009 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package pkg1;
+
+/**
+ * A sample interface used to test table tags.
+ *
+ * @author Bhavesh Patel
+ */
+public interface I1 {
+
+    /**
+     * A test method.
+     *
+     * @param a blah.
+     * @param b blah.
+     */
+    void method1(int a, int b);
+
+    /**
+     * Another test method.
+     *
+     * @param c blah.
+     */
+    void method2(int c);
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/com/sun/javadoc/testHtmlTableTags/pkg1/package-info.java	Thu Apr 02 17:01:00 2009 -0700
@@ -0,0 +1,27 @@
+/*
+ * Copyright 2009 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+/**
+ * Test package 1 used to test table tags.
+ */
+package pkg1;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/com/sun/javadoc/testHtmlTableTags/pkg2/C2.java	Thu Apr 02 17:01:00 2009 -0700
@@ -0,0 +1,73 @@
+/*
+ * Copyright 2009 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package pkg2;
+
+import pkg1.*;
+
+/**
+ * Another test class.
+ *
+ * @author Bhavesh Patel
+ */
+public class C2 {
+
+    /**
+     * A test field.
+     */
+    public C1 field;
+
+    /**
+     * @deprecated don't use this field anymore.
+     */
+    public C1 dep_field;
+
+    /**
+     * A sample enum.
+     */
+    public static enum ModalExclusionType {
+        /**
+         * Test comment.
+         */
+        NO_EXCLUDE,
+        /**
+         * Another comment.
+         */
+        APPLICATION_EXCLUDE
+    };
+
+    /**
+     * A string constant.
+     */
+    public static final String CONSTANT1 = "C2";
+
+    /**
+     * A sample method.
+     *
+     * @param param some parameter.
+     * @return a test object.
+     */
+    public C1 method(C1 param) {
+        return param;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/com/sun/javadoc/testHtmlTableTags/pkg2/C3.java	Thu Apr 02 17:01:00 2009 -0700
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2009 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package pkg2;
+
+import java.lang.annotation.*;
+
+/**
+ * Test Annotation class.
+ *
+ * @author Bhavesh Patel
+ */
+public @interface C3 {
+    /**
+     * Comment.
+     */
+    String[] value();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/com/sun/javadoc/testHtmlTableTags/pkg2/C4.java	Thu Apr 02 17:01:00 2009 -0700
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2009 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package pkg2;
+
+import java.lang.annotation.*;
+
+/*
+ * A sample interface.
+ */
+public @interface C4 {
+    boolean value() default true;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/com/sun/javadoc/testHtmlTableTags/pkg2/package-info.java	Thu Apr 02 17:01:00 2009 -0700
@@ -0,0 +1,27 @@
+/*
+ * Copyright 2009 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+/**
+ * Test package 2 used to test table tags.
+ */
+package pkg2;
--- a/langtools/test/com/sun/javadoc/testNewLanguageFeatures/TestNewLanguageFeatures.java	Thu Apr 02 10:49:41 2009 -0700
+++ b/langtools/test/com/sun/javadoc/testNewLanguageFeatures/TestNewLanguageFeatures.java	Thu Apr 02 17:01:00 2009 -0700
@@ -58,7 +58,8 @@
                 "<A HREF=\"../pkg/Coin.html\" title=\"enum in pkg\">Coin</A>&gt;"
             },
             //Check for enum constant section
-            {BUG_ID + FS + "pkg" + FS + "Coin.html", "<STRONG>Enum Constant Summary</STRONG>"},
+            {BUG_ID + FS + "pkg" + FS + "Coin.html", "<CAPTION CLASS=\"TableCaption\">" + NL +
+                     "Enum Constant Summary</CAPTION>"},
             //Detail for enum constant
             {BUG_ID + FS + "pkg" + FS + "Coin.html",
                 "<STRONG><A HREF=\"../pkg/Coin.html#Dime\">Dime</A></STRONG>"},
@@ -158,9 +159,11 @@
                 "public @interface <STRONG>AnnotationType</STRONG>"},
             //Make sure member summary headings are correct.
             {BUG_ID + FS + "pkg" + FS + "AnnotationType.html",
-                "<STRONG>Required Element Summary</STRONG>"},
+                "<CAPTION CLASS=\"TableCaption\">" + NL +
+                "Required Element Summary</CAPTION>"},
             {BUG_ID + FS + "pkg" + FS + "AnnotationType.html",
-                "<STRONG>Optional Element Summary</STRONG>"},
+                "<CAPTION CLASS=\"TableCaption\">" + NL +
+                "Optional Element Summary</CAPTION>"},
             //Make sure element detail heading is correct
             {BUG_ID + FS + "pkg" + FS + "AnnotationType.html",
                 "Element Detail"},
@@ -286,39 +289,57 @@
 
             //ClassUseTest1: <T extends Foo & Foo2>
             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo.html",
-                 "<TH ALIGN=\"left\" COLSPAN=\"2\">Classes in <A HREF=\"../../pkg2/package-summary.html\">pkg2</A> with type parameters of type <A HREF=\"../../pkg2/Foo.html\" title=\"class in pkg2\">Foo</A></FONT></TH>"
+                     "<CAPTION CLASS=\"TableSubCaption\">" + NL +
+                     "Classes in <A HREF=\"../../pkg2/package-summary.html\">pkg2" +
+                     "</A> with type parameters of type <A HREF=\"../../pkg2/Foo.html\" " +
+                     "title=\"class in pkg2\">Foo</A></CAPTION>"
             },
             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo.html",
                 "<TD><CODE><STRONG><A HREF=\"../../pkg2/ClassUseTest1.html\" title=\"class in pkg2\">ClassUseTest1&lt;T extends Foo & Foo2&gt;</A></STRONG></CODE>"
             },
             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo.html",
-                "<TH ALIGN=\"left\" COLSPAN=\"2\">Methods in <A HREF=\"../../pkg2/package-summary.html\">pkg2</A> with type parameters of type <A HREF=\"../../pkg2/Foo.html\" title=\"class in pkg2\">Foo</A></FONT></TH>"
+                     "<CAPTION CLASS=\"TableSubCaption\">" + NL +
+                     "Methods in <A HREF=\"../../pkg2/package-summary.html\">pkg2" +
+                     "</A> with type parameters of type <A HREF=\"../../pkg2/Foo.html\" " +
+                     "title=\"class in pkg2\">Foo</A></CAPTION>"
             },
             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo.html",
                 "<TD><CODE><STRONG>ClassUseTest1.</STRONG><STRONG><A HREF=\"../../pkg2/ClassUseTest1.html#method(T)\">method</A></STRONG>(T&nbsp;t)</CODE>"
             },
             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo.html",
-                "<TH ALIGN=\"left\" COLSPAN=\"2\">Fields in <A HREF=\"../../pkg2/package-summary.html\">pkg2</A> with type parameters of type <A HREF=\"../../pkg2/Foo.html\" title=\"class in pkg2\">Foo</A></FONT></TH>"
+                     "<CAPTION CLASS=\"TableSubCaption\">" + NL +
+                     "Fields in <A HREF=\"../../pkg2/package-summary.html\">pkg2" +
+                     "</A> with type parameters of type <A HREF=\"../../pkg2/Foo.html\" " +
+                     "title=\"class in pkg2\">Foo</A></CAPTION>"
             },
             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo.html",
                 "<A HREF=\"../../pkg2/ParamTest.html\" title=\"class in pkg2\">ParamTest</A>&lt;<A HREF=\"../../pkg2/Foo.html\" title=\"class in pkg2\">Foo</A>&gt;</CODE></FONT></TD>"
             },
 
             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest.html",
-                "<TH ALIGN=\"left\" COLSPAN=\"2\">Fields in <A HREF=\"../../pkg2/package-summary.html\">pkg2</A> declared as <A HREF=\"../../pkg2/ParamTest.html\" title=\"class in pkg2\">ParamTest</A></FONT></TH>"
+                     "<CAPTION CLASS=\"TableSubCaption\">" + NL +
+                     "Fields in <A HREF=\"../../pkg2/package-summary.html\">pkg2" +
+                     "</A> declared as <A HREF=\"../../pkg2/ParamTest.html\" " +
+                     "title=\"class in pkg2\">ParamTest</A></CAPTION>"
             },
             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest.html",
                 "<A HREF=\"../../pkg2/ParamTest.html\" title=\"class in pkg2\">ParamTest</A>&lt;<A HREF=\"../../pkg2/Foo.html\" title=\"class in pkg2\">Foo</A>&gt;</CODE></FONT></TD>"
             },
 
            {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo2.html",
-            "<TH ALIGN=\"left\" COLSPAN=\"2\">Classes in <A HREF=\"../../pkg2/package-summary.html\">pkg2</A> with type parameters of type <A HREF=\"../../pkg2/Foo2.html\" title=\"interface in pkg2\">Foo2</A></FONT></TH>"
+                    "<CAPTION CLASS=\"TableSubCaption\">" + NL +
+                    "Classes in <A HREF=\"../../pkg2/package-summary.html\">pkg2" +
+                    "</A> with type parameters of type <A HREF=\"../../pkg2/Foo2.html\" " +
+                    "title=\"interface in pkg2\">Foo2</A></CAPTION>"
            },
            {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo2.html",
             "<TD><CODE><STRONG><A HREF=\"../../pkg2/ClassUseTest1.html\" title=\"class in pkg2\">ClassUseTest1&lt;T extends Foo & Foo2&gt;</A></STRONG></CODE>"
            },
            {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo2.html",
-               "<TH ALIGN=\"left\" COLSPAN=\"2\">Methods in <A HREF=\"../../pkg2/package-summary.html\">pkg2</A> with type parameters of type <A HREF=\"../../pkg2/Foo2.html\" title=\"interface in pkg2\">Foo2</A></FONT></TH>"
+                    "<CAPTION CLASS=\"TableSubCaption\">" + NL +
+                    "Methods in <A HREF=\"../../pkg2/package-summary.html\">pkg2" +
+                    "</A> with type parameters of type <A HREF=\"../../pkg2/Foo2.html\" " +
+                    "title=\"interface in pkg2\">Foo2</A></CAPTION>"
             },
             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo2.html",
                "<TD><CODE><STRONG>ClassUseTest1.</STRONG><STRONG><A HREF=\"../../pkg2/ClassUseTest1.html#method(T)\">method</A></STRONG>(T&nbsp;t)</CODE>"
@@ -326,44 +347,66 @@
 
             //ClassUseTest2: <T extends ParamTest<Foo3>>
             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest.html",
-              "<TH ALIGN=\"left\" COLSPAN=\"2\">Classes in <A HREF=\"../../pkg2/package-summary.html\">pkg2</A> with type parameters of type <A HREF=\"../../pkg2/ParamTest.html\" title=\"class in pkg2\">ParamTest</A></FONT></TH>"
+                     "<CAPTION CLASS=\"TableSubCaption\">" + NL +
+                     "Classes in <A HREF=\"../../pkg2/package-summary.html\">pkg2" +
+                     "</A> with type parameters of type <A HREF=\"../../pkg2/ParamTest.html\" " +
+                     "title=\"class in pkg2\">ParamTest</A></CAPTION>"
             },
             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest.html",
               "<TD><CODE><STRONG><A HREF=\"../../pkg2/ClassUseTest2.html\" title=\"class in pkg2\">ClassUseTest2&lt;T extends ParamTest&lt;<A HREF=\"../../pkg2/Foo3.html\" title=\"class in pkg2\">Foo3</A>&gt;&gt;</A></STRONG></CODE>"
             },
             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest.html",
-              "<TH ALIGN=\"left\" COLSPAN=\"2\">Methods in <A HREF=\"../../pkg2/package-summary.html\">pkg2</A> with type parameters of type <A HREF=\"../../pkg2/ParamTest.html\" title=\"class in pkg2\">ParamTest</A></FONT></TH>"
+                     "<CAPTION CLASS=\"TableSubCaption\">" + NL +
+                     "Methods in <A HREF=\"../../pkg2/package-summary.html\">pkg2" +
+                     "</A> with type parameters of type <A HREF=\"../../pkg2/ParamTest.html\" " +
+                     "title=\"class in pkg2\">ParamTest</A></CAPTION>"
             },
             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest.html",
               "<TD><CODE><STRONG>ClassUseTest2.</STRONG><STRONG><A HREF=\"../../pkg2/ClassUseTest2.html#method(T)\">method</A></STRONG>(T&nbsp;t)</CODE>"
             },
             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest.html",
-              "<TH ALIGN=\"left\" COLSPAN=\"2\">Fields in <A HREF=\"../../pkg2/package-summary.html\">pkg2</A> declared as <A HREF=\"../../pkg2/ParamTest.html\" title=\"class in pkg2\">ParamTest</A></FONT></TH>"
+                     "<CAPTION CLASS=\"TableSubCaption\">" + NL +
+                     "Fields in <A HREF=\"../../pkg2/package-summary.html\">pkg2" +
+                     "</A> declared as <A HREF=\"../../pkg2/ParamTest.html\" " +
+                     "title=\"class in pkg2\">ParamTest</A></CAPTION>"
             },
             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest.html",
               "<A HREF=\"../../pkg2/ParamTest.html\" title=\"class in pkg2\">ParamTest</A>&lt;<A HREF=\"../../pkg2/Foo.html\" title=\"class in pkg2\">Foo</A>&gt;</CODE></FONT></TD>"
             },
             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest.html",
-              "<TH ALIGN=\"left\" COLSPAN=\"2\">Methods in <A HREF=\"../../pkg2/package-summary.html\">pkg2</A> with type parameters of type <A HREF=\"../../pkg2/ParamTest.html\" title=\"class in pkg2\">ParamTest</A></FONT></TH>"
+                     "<CAPTION CLASS=\"TableSubCaption\">" + NL +
+                     "Methods in <A HREF=\"../../pkg2/package-summary.html\">pkg2" +
+                     "</A> with type parameters of type <A HREF=\"../../pkg2/ParamTest.html\" " +
+                     "title=\"class in pkg2\">ParamTest</A></CAPTION>"
             },
             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest.html",
               "&lt;T extends <A HREF=\"../../pkg2/ParamTest.html\" title=\"class in pkg2\">ParamTest</A>&lt;<A HREF=\"../../pkg2/Foo3.html\" title=\"class in pkg2\">Foo3</A>&gt;&gt;"
             },
 
             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo3.html",
-                "<TH ALIGN=\"left\" COLSPAN=\"2\">Classes in <A HREF=\"../../pkg2/package-summary.html\">pkg2</A> with type parameters of type <A HREF=\"../../pkg2/Foo3.html\" title=\"class in pkg2\">Foo3</A></FONT></TH>"
+                     "<CAPTION CLASS=\"TableSubCaption\">" + NL +
+                     "Classes in <A HREF=\"../../pkg2/package-summary.html\">pkg2" +
+                     "</A> with type parameters of type <A HREF=\"../../pkg2/Foo3.html\" " +
+                     "title=\"class in pkg2\">Foo3</A></CAPTION>"
             },
             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo3.html",
                 "<TD><CODE><STRONG><A HREF=\"../../pkg2/ClassUseTest2.html\" title=\"class in pkg2\">ClassUseTest2&lt;T extends ParamTest&lt;<A HREF=\"../../pkg2/Foo3.html\" title=\"class in pkg2\">Foo3</A>&gt;&gt;</A></STRONG></CODE>"
             },
             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo3.html",
-                "<TH ALIGN=\"left\" COLSPAN=\"2\">Methods in <A HREF=\"../../pkg2/package-summary.html\">pkg2</A> with type parameters of type <A HREF=\"../../pkg2/Foo3.html\" title=\"class in pkg2\">Foo3</A></FONT></TH>"
+                     "<CAPTION CLASS=\"TableSubCaption\">" + NL +
+                     "Methods in <A HREF=\"../../pkg2/package-summary.html\">pkg2" +
+                     "</A> with type parameters of type <A HREF=\"../../pkg2/Foo3.html\" " +
+                     "title=\"class in pkg2\">Foo3</A></CAPTION>"
             },
             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo3.html",
                 "<TD><CODE><STRONG>ClassUseTest2.</STRONG><STRONG><A HREF=\"../../pkg2/ClassUseTest2.html#method(T)\">method</A></STRONG>(T&nbsp;t)</CODE>"
             },
             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo3.html",
-                "<TH ALIGN=\"left\" COLSPAN=\"2\">Methods in <A HREF=\"../../pkg2/package-summary.html\">pkg2</A> that return types with arguments of type <A HREF=\"../../pkg2/Foo3.html\" title=\"class in pkg2\">Foo3</A></FONT></TH>"
+                     "<CAPTION CLASS=\"TableSubCaption\">" + NL +
+                     "Methods in <A HREF=\"../../pkg2/package-summary.html\">pkg2" +
+                     "</A> that return types with arguments of type " +
+                     "<A HREF=\"../../pkg2/Foo3.html\" title=\"class in pkg2\">" +
+                     "Foo3</A></CAPTION>"
             },
             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo3.html",
                 "&lt;T extends <A HREF=\"../../pkg2/ParamTest.html\" title=\"class in pkg2\">ParamTest</A>&lt;<A HREF=\"../../pkg2/Foo3.html\" title=\"class in pkg2\">Foo3</A>&gt;&gt;"
@@ -371,38 +414,61 @@
 
             //ClassUseTest3: <T extends ParamTest2<List<? extends Foo4>>>
             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest2.html",
-                "<TH ALIGN=\"left\" COLSPAN=\"2\">Classes in <A HREF=\"../../pkg2/package-summary.html\">pkg2</A> with type parameters of type <A HREF=\"../../pkg2/ParamTest2.html\" title=\"class in pkg2\">ParamTest2</A></FONT></TH>"
+                     "<CAPTION CLASS=\"TableSubCaption\">" + NL +
+                     "Classes in <A HREF=\"../../pkg2/package-summary.html\">pkg2" +
+                     "</A> with type parameters of type " +
+                     "<A HREF=\"../../pkg2/ParamTest2.html\" title=\"class in pkg2\">" +
+                     "ParamTest2</A></CAPTION>"
             },
             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest2.html",
                 "<TD><CODE><STRONG><A HREF=\"../../pkg2/ClassUseTest3.html\" title=\"class in pkg2\">ClassUseTest3&lt;T extends ParamTest2&lt;java.util.List&lt;? extends Foo4&gt;&gt;&gt;</A></STRONG></CODE>"
             },
             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest2.html",
-                "<TH ALIGN=\"left\" COLSPAN=\"2\">Methods in <A HREF=\"../../pkg2/package-summary.html\">pkg2</A> with type parameters of type <A HREF=\"../../pkg2/ParamTest2.html\" title=\"class in pkg2\">ParamTest2</A></FONT></TH>"
+                     "<CAPTION CLASS=\"TableSubCaption\">" + NL +
+                     "Methods in <A HREF=\"../../pkg2/package-summary.html\">pkg2" +
+                     "</A> with type parameters of type " +
+                     "<A HREF=\"../../pkg2/ParamTest2.html\" title=\"class in pkg2\">" +
+                     "ParamTest2</A></CAPTION>"
             },
             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest2.html",
                 "<TD><CODE><STRONG>ClassUseTest3.</STRONG><STRONG><A HREF=\"../../pkg2/ClassUseTest3.html#method(T)\">method</A></STRONG>(T&nbsp;t)</CODE>"
             },
             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest2.html",
-                "<TH ALIGN=\"left\" COLSPAN=\"2\">Methods in <A HREF=\"../../pkg2/package-summary.html\">pkg2</A> with type parameters of type <A HREF=\"../../pkg2/ParamTest2.html\" title=\"class in pkg2\">ParamTest2</A></FONT></TH>"
+                     "<CAPTION CLASS=\"TableSubCaption\">" + NL +
+                     "Methods in <A HREF=\"../../pkg2/package-summary.html\">pkg2" +
+                     "</A> with type parameters of type " +
+                     "<A HREF=\"../../pkg2/ParamTest2.html\" title=\"class in pkg2\">" +
+                     "ParamTest2</A></CAPTION>"
             },
             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest2.html",
                 "&lt;T extends <A HREF=\"../../pkg2/ParamTest2.html\" title=\"class in pkg2\">ParamTest2</A>&lt;java.util.List&lt;? extends <A HREF=\"../../pkg2/Foo4.html\" title=\"class in pkg2\">Foo4</A>&gt;&gt;&gt;"
             },
 
             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo4.html",
-                "<TH ALIGN=\"left\" COLSPAN=\"2\">Classes in <A HREF=\"../../pkg2/package-summary.html\">pkg2</A> with type parameters of type <A HREF=\"../../pkg2/Foo4.html\" title=\"class in pkg2\">Foo4</A></FONT></TH>"
+                     "<CAPTION CLASS=\"TableSubCaption\">" + NL +
+                     "Classes in <A HREF=\"../../pkg2/package-summary.html\">pkg2" +
+                     "</A> with type parameters of type " +
+                     "<A HREF=\"../../pkg2/Foo4.html\" title=\"class in pkg2\">" +
+                     "Foo4</A></CAPTION>"
             },
             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo4.html",
                 "<TD><CODE><STRONG><A HREF=\"../../pkg2/ClassUseTest3.html\" title=\"class in pkg2\">ClassUseTest3&lt;T extends ParamTest2&lt;java.util.List&lt;? extends Foo4&gt;&gt;&gt;</A></STRONG></CODE>"
             },
             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo4.html",
-                "<TH ALIGN=\"left\" COLSPAN=\"2\">Methods in <A HREF=\"../../pkg2/package-summary.html\">pkg2</A> with type parameters of type <A HREF=\"../../pkg2/Foo4.html\" title=\"class in pkg2\">Foo4</A></FONT></TH>"
+                     "<CAPTION CLASS=\"TableSubCaption\">" + NL +
+                     "Methods in <A HREF=\"../../pkg2/package-summary.html\">pkg2" +
+                     "</A> with type parameters of type <A HREF=\"../../pkg2/Foo4.html\" " +
+                     "title=\"class in pkg2\">Foo4</A></CAPTION>"
             },
             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo4.html",
                 "<TD><CODE><STRONG>ClassUseTest3.</STRONG><STRONG><A HREF=\"../../pkg2/ClassUseTest3.html#method(T)\">method</A></STRONG>(T&nbsp;t)</CODE>"
             },
             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo4.html",
-                "<TH ALIGN=\"left\" COLSPAN=\"2\">Methods in <A HREF=\"../../pkg2/package-summary.html\">pkg2</A> that return types with arguments of type <A HREF=\"../../pkg2/Foo4.html\" title=\"class in pkg2\">Foo4</A></FONT></TH>"
+                     "<CAPTION CLASS=\"TableSubCaption\">" + NL +
+                     "Methods in <A HREF=\"../../pkg2/package-summary.html\">pkg2" +
+                     "</A> that return types with arguments of type " +
+                     "<A HREF=\"../../pkg2/Foo4.html\" title=\"class in pkg2\">" +
+                     "Foo4</A></CAPTION>"
             },
             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo4.html",
                 "&lt;T extends <A HREF=\"../../pkg2/ParamTest2.html\" title=\"class in pkg2\">ParamTest2</A>&lt;java.util.List&lt;? extends <A HREF=\"../../pkg2/Foo4.html\" title=\"class in pkg2\">Foo4</A>&gt;&gt;&gt;"
@@ -410,81 +476,147 @@
 
             //Type parameters in constructor and method args
             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo4.html",
-                "<TH ALIGN=\"left\" COLSPAN=\"2\">Method parameters in <A HREF=\"../../pkg2/package-summary.html\">pkg2</A> with type arguments of type <A HREF=\"../../pkg2/Foo4.html\" title=\"class in pkg2\">Foo4</A></FONT></TH>" + NL +
-                "</TR>" + NL +
-                "<TR BGCOLOR=\"white\" CLASS=\"TableRowColor\">" + NL +
-                "<TD ALIGN=\"right\" VALIGN=\"top\" WIDTH=\"1%\"><FONT SIZE=\"-1\">" + NL +
-                "<CODE>&nbsp;void</CODE></FONT></TD>" + NL +
-                "<TD><CODE><STRONG>ClassUseTest3.</STRONG><STRONG><A HREF=\"../../pkg2/ClassUseTest3.html#method(java.util.Set)\">method</A></STRONG>(java.util.Set&lt;<A HREF=\"../../pkg2/Foo4.html\" title=\"class in pkg2\">Foo4</A>&gt;&nbsp;p)</CODE>"
+                     "<CAPTION CLASS=\"TableSubCaption\">" + NL +
+                     "Method parameters in <A HREF=\"../../pkg2/package-summary.html\">pkg2" +
+                     "</A> with type arguments of type <A HREF=\"../../pkg2/Foo4.html\" " +
+                     "title=\"class in pkg2\">Foo4</A></CAPTION>" + NL +
+                     "<TR>" + NL + "<TH CLASS=\"TableHeader\" SCOPE=\"col\"" +
+                     " NOWRAP>Modifier and Type" +
+                     "</TH>" + NL + "<TH CLASS=\"TableHeader\" SCOPE=\"col\"" +
+                     " NOWRAP>Method and Description</TH>" + NL +
+                     "</TR>" + NL +
+                     "<TR BGCOLOR=\"white\" CLASS=\"TableRowColor\">" + NL +
+                     "<TD ALIGN=\"right\" VALIGN=\"top\" WIDTH=\"1%\"><FONT SIZE=\"-1\">" + NL +
+                     "<CODE>&nbsp;void</CODE></FONT></TD>" + NL +
+                     "<TD><CODE><STRONG>ClassUseTest3.</STRONG><STRONG>" +
+                     "<A HREF=\"../../pkg2/ClassUseTest3.html#method(java.util.Set)\">" +
+                     "method</A></STRONG>(java.util.Set&lt;<A HREF=\"../../pkg2/Foo4.html\" " +
+                     "title=\"class in pkg2\">Foo4</A>&gt;&nbsp;p)</CODE>"
             },
             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo4.html",
-                "<TH ALIGN=\"left\" COLSPAN=\"2\">Constructor parameters in <A HREF=\"../../pkg2/package-summary.html\">pkg2</A> with type arguments of type <A HREF=\"../../pkg2/Foo4.html\" title=\"class in pkg2\">Foo4</A></FONT></TH>" + NL +
-                "</TR>" + NL +
-                "<TR BGCOLOR=\"white\" CLASS=\"TableRowColor\">" + NL +
-                "<TD><CODE><STRONG><A HREF=\"../../pkg2/ClassUseTest3.html#ClassUseTest3(java.util.Set)\">ClassUseTest3</A></STRONG>(java.util.Set&lt;<A HREF=\"../../pkg2/Foo4.html\" title=\"class in pkg2\">Foo4</A>&gt;&nbsp;p)</CODE>"
+                     "<CAPTION CLASS=\"TableSubCaption\">" + NL +
+                     "Constructor parameters in <A HREF=\"../../pkg2/package-summary.html\">" +
+                     "pkg2</A> with type arguments of type <A HREF=\"../../pkg2/Foo4.html\" " +
+                     "title=\"class in pkg2\">Foo4</A></CAPTION>" + NL +
+                     "<TR>" + NL + "<TH CLASS=\"TableHeader\" SCOPE=\"col\"" +
+                     " NOWRAP>Constructor and Description" +
+                     "</TH>" + NL + "</TR>" + NL +
+                     "<TR BGCOLOR=\"white\" CLASS=\"TableRowColor\">" + NL +
+                     "<TD><CODE><STRONG><A HREF=\"../../pkg2/ClassUseTest3.html#ClassUseTest3" +
+                     "(java.util.Set)\">ClassUseTest3</A></STRONG>(java.util.Set&lt;" +
+                     "<A HREF=\"../../pkg2/Foo4.html\" title=\"class in pkg2\">" +
+                     "Foo4</A>&gt;&nbsp;p)</CODE>"
             },
 
             //=================================
             // Annotatation Type Usage
             //=================================
             {BUG_ID + FS + "pkg" + FS + "class-use" + FS + "AnnotationType.html",
-                "<FONT SIZE=\"+2\">" + NL +
-                "Packages with annotations of type <A HREF=\"../../pkg/AnnotationType.html\" title=\"annotation in pkg\">AnnotationType</A></FONT></TH>" + NL +
-                "</TR>" + NL +
-                "<TR BGCOLOR=\"white\" CLASS=\"TableRowColor\">" + NL +
-                "<TD><A HREF=\"../../pkg/package-summary.html\"><STRONG>pkg</STRONG></A></TD>"
+                     "Packages with annotations of type " +
+                     "<A HREF=\"../../pkg/AnnotationType.html\" " +
+                     "title=\"annotation in pkg\">AnnotationType</A></CAPTION>" + NL +
+                     "<TR>" + NL + "<TH CLASS=\"TableHeader\" SCOPE=\"col\"" +
+                     " NOWRAP>Package" +
+                     "</TH>" + NL + "<TH CLASS=\"TableHeader\" SCOPE=\"col\"" +
+                     " NOWRAP>Description</TH>" + NL + "</TR>" + NL +
+                     "<TR BGCOLOR=\"white\" CLASS=\"TableRowColor\">" + NL +
+                     "<TD><A HREF=\"../../pkg/package-summary.html\"><STRONG>pkg" +
+                     "</STRONG></A></TD>"
             },
 
             {BUG_ID + FS + "pkg" + FS + "class-use" + FS + "AnnotationType.html",
-                "Classes in <A HREF=\"../../pkg/package-summary.html\">pkg</A> with annotations of type <A HREF=\"../../pkg/AnnotationType.html\" title=\"annotation in pkg\">AnnotationType</A></FONT></TH>" + NL +
-                "</TR>" + NL +
-                "<TR BGCOLOR=\"white\" CLASS=\"TableRowColor\">" + NL +
-                "<TD ALIGN=\"right\" VALIGN=\"top\" WIDTH=\"1%\"><FONT SIZE=\"-1\">" + NL +
-                "<CODE>&nbsp;class</CODE></FONT></TD>" + NL +
-                "<TD><CODE><STRONG><A HREF=\"../../pkg/AnnotationTypeUsage.html\" title=\"class in pkg\">AnnotationTypeUsage</A></STRONG></CODE>"
+                     "Classes in <A HREF=\"../../pkg/package-summary.html\">pkg" +
+                     "</A> with annotations of type <A HREF=\"../../pkg/AnnotationType.html\" " +
+                     "title=\"annotation in pkg\">AnnotationType</A></CAPTION>" + NL +
+                     "<TR>" + NL + "<TH CLASS=\"TableHeader\" SCOPE=\"col\"" +
+                     " NOWRAP>Modifier and Type" +
+                     "</TH>" + NL + "<TH CLASS=\"TableHeader\" SCOPE=\"col\"" +
+                     " NOWRAP>Class and Description</TH>" + NL +
+                     "</TR>" + NL +
+                     "<TR BGCOLOR=\"white\" CLASS=\"TableRowColor\">" + NL +
+                     "<TD ALIGN=\"right\" VALIGN=\"top\" WIDTH=\"1%\"><FONT SIZE=\"-1\">" + NL +
+                     "<CODE>&nbsp;class</CODE></FONT></TD>" + NL +
+                     "<TD><CODE><STRONG><A HREF=\"../../pkg/AnnotationTypeUsage.html\" " +
+                     "title=\"class in pkg\">AnnotationTypeUsage</A></STRONG></CODE>"
             },
 
             {BUG_ID + FS + "pkg" + FS + "class-use" + FS + "AnnotationType.html",
-                "Fields in <A HREF=\"../../pkg/package-summary.html\">pkg</A> with annotations of type <A HREF=\"../../pkg/AnnotationType.html\" title=\"annotation in pkg\">AnnotationType</A></FONT></TH>" + NL +
-                "</TR>" + NL +
-                "<TR BGCOLOR=\"white\" CLASS=\"TableRowColor\">" + NL +
-                "<TD ALIGN=\"right\" VALIGN=\"top\" WIDTH=\"1%\"><FONT SIZE=\"-1\">" + NL +
-                "<CODE>&nbsp;int</CODE></FONT></TD>" + NL +
-                "<TD><CODE><STRONG>AnnotationTypeUsage.</STRONG><STRONG><A HREF=\"../../pkg/AnnotationTypeUsage.html#field\">field</A></STRONG></CODE>"
+                     "Fields in <A HREF=\"../../pkg/package-summary.html\">pkg" +
+                     "</A> with annotations of type <A HREF=\"../../pkg/AnnotationType.html\" " +
+                     "title=\"annotation in pkg\">AnnotationType</A></CAPTION>" + NL +
+                     "<TR>" + NL + "<TH CLASS=\"TableHeader\" SCOPE=\"col\"" +
+                     " NOWRAP>Modifier and Type" +
+                     "</TH>" + NL + "<TH CLASS=\"TableHeader\" SCOPE=\"col\"" +
+                     " NOWRAP>Field and Description</TH>" + NL +
+                     "</TR>" + NL +
+                     "<TR BGCOLOR=\"white\" CLASS=\"TableRowColor\">" + NL +
+                     "<TD ALIGN=\"right\" VALIGN=\"top\" WIDTH=\"1%\"><FONT SIZE=\"-1\">" + NL +
+                     "<CODE>&nbsp;int</CODE></FONT></TD>" + NL +
+                     "<TD><CODE><STRONG>AnnotationTypeUsage.</STRONG><STRONG>" +
+                     "<A HREF=\"../../pkg/AnnotationTypeUsage.html#field\">field" +
+                     "</A></STRONG></CODE>"
             },
 
             {BUG_ID + FS + "pkg" + FS + "class-use" + FS + "AnnotationType.html",
-                "Methods in <A HREF=\"../../pkg/package-summary.html\">pkg</A> with annotations of type <A HREF=\"../../pkg/AnnotationType.html\" title=\"annotation in pkg\">AnnotationType</A></FONT></TH>" + NL +
-                "</TR>" + NL +
-                "<TR BGCOLOR=\"white\" CLASS=\"TableRowColor\">" + NL +
-                "<TD ALIGN=\"right\" VALIGN=\"top\" WIDTH=\"1%\"><FONT SIZE=\"-1\">" + NL +
-                "<CODE>&nbsp;void</CODE></FONT></TD>" + NL +
-                "<TD><CODE><STRONG>AnnotationTypeUsage.</STRONG><STRONG><A HREF=\"../../pkg/AnnotationTypeUsage.html#method()\">method</A></STRONG>()</CODE>"
+                     "Methods in <A HREF=\"../../pkg/package-summary.html\">pkg" +
+                     "</A> with annotations of type <A HREF=\"../../pkg/AnnotationType.html\" " +
+                     "title=\"annotation in pkg\">AnnotationType</A></CAPTION>" + NL +
+                     "<TR>" + NL + "<TH CLASS=\"TableHeader\" SCOPE=\"col\"" +
+                     " NOWRAP>Modifier and Type" +
+                     "</TH>" + NL + "<TH CLASS=\"TableHeader\" SCOPE=\"col\"" +
+                     " NOWRAP>Method and Description</TH>" + NL +
+                     "</TR>" + NL +
+                     "<TR BGCOLOR=\"white\" CLASS=\"TableRowColor\">" + NL +
+                     "<TD ALIGN=\"right\" VALIGN=\"top\" WIDTH=\"1%\"><FONT SIZE=\"-1\">" + NL +
+                     "<CODE>&nbsp;void</CODE></FONT></TD>" + NL +
+                     "<TD><CODE><STRONG>AnnotationTypeUsage.</STRONG><STRONG>" +
+                     "<A HREF=\"../../pkg/AnnotationTypeUsage.html#method()\">" +
+                     "method</A></STRONG>()</CODE>"
             },
 
             {BUG_ID + FS + "pkg" + FS + "class-use" + FS + "AnnotationType.html",
-                "Method parameters in <A HREF=\"../../pkg/package-summary.html\">pkg</A> with annotations of type <A HREF=\"../../pkg/AnnotationType.html\" title=\"annotation in pkg\">AnnotationType</A></FONT></TH>" + NL +
-                "</TR>" + NL +
-                "<TR BGCOLOR=\"white\" CLASS=\"TableRowColor\">" + NL +
-                "<TD ALIGN=\"right\" VALIGN=\"top\" WIDTH=\"1%\"><FONT SIZE=\"-1\">" + NL +
-                "<CODE>&nbsp;void</CODE></FONT></TD>" + NL +
-                "<TD><CODE><STRONG>AnnotationTypeUsage.</STRONG><STRONG><A HREF=\"../../pkg/AnnotationTypeUsage.html#methodWithParams(int, int)\">methodWithParams</A></STRONG>(int&nbsp;documented," + NL +
-                "                 int&nbsp;undocmented)</CODE>"
+                     "Method parameters in <A HREF=\"../../pkg/package-summary.html\">pkg" +
+                     "</A> with annotations of type <A HREF=\"../../pkg/AnnotationType.html\" " +
+                     "title=\"annotation in pkg\">AnnotationType</A></CAPTION>" + NL +
+                     "<TR>" + NL + "<TH CLASS=\"TableHeader\" SCOPE=\"col\"" +
+                     " NOWRAP>Modifier and Type" +
+                     "</TH>" + NL + "<TH CLASS=\"TableHeader\" SCOPE=\"col\"" +
+                     " NOWRAP>Method and Description</TH>" + NL +
+                     "</TR>" + NL +
+                     "<TR BGCOLOR=\"white\" CLASS=\"TableRowColor\">" + NL +
+                     "<TD ALIGN=\"right\" VALIGN=\"top\" WIDTH=\"1%\"><FONT SIZE=\"-1\">" + NL +
+                     "<CODE>&nbsp;void</CODE></FONT></TD>" + NL +
+                     "<TD><CODE><STRONG>AnnotationTypeUsage.</STRONG><STRONG>" +
+                     "<A HREF=\"../../pkg/AnnotationTypeUsage.html#methodWithParams" +
+                     "(int, int)\">methodWithParams</A></STRONG>(int&nbsp;documented," + NL +
+                     "                 int&nbsp;undocmented)</CODE>"
             },
 
             {BUG_ID + FS + "pkg" + FS + "class-use" + FS + "AnnotationType.html",
-                "Constructors in <A HREF=\"../../pkg/package-summary.html\">pkg</A> with annotations of type <A HREF=\"../../pkg/AnnotationType.html\" title=\"annotation in pkg\">AnnotationType</A></FONT></TH>" + NL +
-                "</TR>" + NL +
-                "<TR BGCOLOR=\"white\" CLASS=\"TableRowColor\">" + NL +
-                "<TD><CODE><STRONG><A HREF=\"../../pkg/AnnotationTypeUsage.html#AnnotationTypeUsage()\">AnnotationTypeUsage</A></STRONG>()</CODE>"
+                     "Constructors in <A HREF=\"../../pkg/package-summary.html\">pkg" +
+                     "</A> with annotations of type <A HREF=\"../../pkg/AnnotationType.html\" " +
+                     "title=\"annotation in pkg\">AnnotationType</A></CAPTION>" + NL +
+                     "<TR>" + NL + "<TH CLASS=\"TableHeader\" SCOPE=\"col\"" +
+                     " NOWRAP>Constructor and Description" +
+                     "</TH>" + NL + "</TR>" + NL +
+                     "<TR BGCOLOR=\"white\" CLASS=\"TableRowColor\">" + NL +
+                     "<TD><CODE><STRONG><A HREF=\"../../pkg/" +
+                     "AnnotationTypeUsage.html#AnnotationTypeUsage()\">" +
+                     "AnnotationTypeUsage</A></STRONG>()</CODE>"
             },
 
             {BUG_ID + FS + "pkg" + FS + "class-use" + FS + "AnnotationType.html",
-                "Constructor parameters in <A HREF=\"../../pkg/package-summary.html\">pkg</A> with annotations of type <A HREF=\"../../pkg/AnnotationType.html\" title=\"annotation in pkg\">AnnotationType</A></FONT></TH>" + NL +
-                "</TR>" + NL +
-                "<TR BGCOLOR=\"white\" CLASS=\"TableRowColor\">" + NL +
-                "<TD><CODE><STRONG><A HREF=\"../../pkg/AnnotationTypeUsage.html#AnnotationTypeUsage(int, int)\">AnnotationTypeUsage</A></STRONG>(int&nbsp;documented," + NL +
-                "                    int&nbsp;undocmented)</CODE>"
+                     "Constructor parameters in <A HREF=\"../../pkg/package-summary.html\">pkg" +
+                     "</A> with annotations of type <A HREF=\"../../pkg/AnnotationType.html\" " +
+                     "title=\"annotation in pkg\">AnnotationType</A></CAPTION>" + NL +
+                     "<TR>" + NL + "<TH CLASS=\"TableHeader\" SCOPE=\"col\"" +
+                     " NOWRAP>Constructor and Description" +
+                     "</TH>" + NL + "</TR>" + NL +
+                     "<TR BGCOLOR=\"white\" CLASS=\"TableRowColor\">" + NL +
+                     "<TD><CODE><STRONG><A HREF=\"../../pkg/" +
+                     "AnnotationTypeUsage.html#AnnotationTypeUsage(int, int)\">" +
+                     "AnnotationTypeUsage</A></STRONG>(int&nbsp;documented," + NL +
+                     "                    int&nbsp;undocmented)</CODE>"
             },
 
             //=================================
--- a/langtools/test/com/sun/javadoc/testSummaryHeading/TestSummaryHeading.java	Thu Apr 02 10:49:41 2009 -0700
+++ b/langtools/test/com/sun/javadoc/testSummaryHeading/TestSummaryHeading.java	Thu Apr 02 17:01:00 2009 -0700
@@ -46,7 +46,8 @@
 
     //Input for string search tests.
     private static final String[][] TEST = {
-        {BUG_ID + FS + "C.html",  "<STRONG>Method Summary</STRONG>"}
+        {BUG_ID + FS + "C.html",  "<CAPTION CLASS=\"TableCaption\">" + NL +
+                 "Method Summary</CAPTION>"}
     };
     private static final String[][] NEGATED_TEST = NO_TEST;
 
--- a/langtools/test/tools/javap/T4884240.java	Thu Apr 02 10:49:41 2009 -0700
+++ b/langtools/test/tools/javap/T4884240.java	Thu Apr 02 17:01:00 2009 -0700
@@ -16,7 +16,7 @@
  *
  * You should have received a copy of the GNU General Public License version
  * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-15301 USA.
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  *
  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
  * CA 95054 USA or visit www.sun.com if you need additional information or