Merge
authorlana
Mon, 20 Dec 2010 21:10:57 -0800
changeset 7644 00e80d00deea
parent 7613 b2cad9e81440 (current diff)
parent 7643 a067a0cda531 (diff)
child 7645 1cdc1b4b6855
Merge
langtools/src/share/classes/com/sun/tools/apt/main/JavaCompiler.java
langtools/src/share/classes/com/sun/tools/doclets/formats/html/StylesheetWriter.java
langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/SourceToHTMLConverter.java
langtools/test/tools/javac/diags/examples/VarargsFilename.java
langtools/test/tools/javac/diags/examples/VarargsFilenameAdditional.java
langtools/test/tools/javac/diags/examples/VarargsPlural/VarargsFilename.java
langtools/test/tools/javac/diags/examples/VarargsPlural/VarargsPlural.java
langtools/test/tools/javac/diags/examples/VarargsPluralAdditional/VarargsFilename.java
langtools/test/tools/javac/diags/examples/VarargsPluralAdditional/VarargsPlural.java
langtools/test/tools/javac/diags/examples/VarargsPluralAdditional/VarargsPluralAdditional.java
--- a/langtools/src/share/classes/com/sun/source/util/Trees.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/src/share/classes/com/sun/source/util/Trees.java	Mon Dec 20 21:10:57 2010 -0800
@@ -52,6 +52,7 @@
 public abstract class Trees {
     /**
      * Gets a Trees object for a given CompilationTask.
+     * @param task the compilation task for which to get the Trees object
      * @throws IllegalArgumentException if the task does not support the Trees API.
      */
     public static Trees instance(CompilationTask task) {
@@ -61,7 +62,8 @@
     }
 
     /**
-     * Gets a Trees object for a given CompilationTask.
+     * Gets a Trees object for a given ProcessingEnvironment.
+     * @param env the processing environment for which to get the Trees object
      * @throws IllegalArgumentException if the env does not support the Trees API.
      */
     public static Trees instance(ProcessingEnvironment env) {
@@ -163,6 +165,12 @@
     public abstract Scope getScope(TreePath path);
 
     /**
+     * Gets the doc comment, if any, for the Tree node identified by a given TreePath.
+     * Returns null if no doc comment was found.
+     */
+    public abstract String getDocComment(TreePath path);
+
+    /**
      * Checks whether a given type is accessible in a given scope.
      * @param scope the scope to be checked
      * @param type the type to be checked
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/src/share/classes/com/sun/tools/apt/main/AptJavaCompiler.java	Mon Dec 20 21:10:57 2010 -0800
@@ -0,0 +1,292 @@
+/*
+ * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.tools.apt.main;
+
+import java.io.*;
+import java.util.Map;
+
+import javax.tools.JavaFileManager;
+import javax.tools.JavaFileObject;
+
+import com.sun.tools.javac.file.JavacFileManager;
+import com.sun.tools.javac.util.*;
+import com.sun.tools.javac.code.*;
+import com.sun.tools.javac.jvm.*;
+
+import com.sun.tools.javac.code.Symbol.*;
+import com.sun.tools.javac.tree.JCTree.*;
+
+import com.sun.tools.apt.comp.*;
+import com.sun.tools.apt.util.Bark;
+import com.sun.mirror.apt.AnnotationProcessorFactory;
+import com.sun.tools.javac.parser.DocCommentScanner;
+
+/**
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own
+ *  risk.  This code and its internal interfaces are subject to change
+ *  or deletion without notice.</b>
+ */
+@SuppressWarnings("deprecation")
+public class AptJavaCompiler extends com.sun.tools.javac.main.JavaCompiler {
+    /** The context key for the compiler. */
+    protected static final Context.Key<AptJavaCompiler> compilerKey =
+        new Context.Key<AptJavaCompiler>();
+
+    /** Get the JavaCompiler instance for this context. */
+    public static AptJavaCompiler instance(Context context) {
+        AptJavaCompiler instance = context.get(compilerKey);
+        if (instance == null)
+            instance = new AptJavaCompiler(context);
+        return instance;
+    }
+
+
+    java.util.Set<String> genSourceFileNames;
+    java.util.Set<String> genClassFileNames;
+
+    public java.util.Set<String> getSourceFileNames() {
+        return genSourceFileNames;
+    }
+
+    /** List of names of generated class files.
+     */
+    public java.util.Set<String> getClassFileNames() {
+        return genClassFileNames;
+    }
+
+    java.util.Set<java.io.File> aggregateGenFiles = java.util.Collections.emptySet();
+
+    public java.util.Set<java.io.File> getAggregateGenFiles() {
+        return aggregateGenFiles;
+    }
+
+    /** The bark to be used for error reporting.
+     */
+    Bark bark;
+
+    /** The log to be used for error reporting.
+     */
+    Log log;
+
+    /** The annotation framework
+     */
+    Apt apt;
+
+    private static Context preRegister(Context context) {
+        Bark.preRegister(context);
+
+        if (context.get(JavaFileManager.class) == null)
+            JavacFileManager.preRegister(context);
+
+        return context;
+    }
+
+    /** Construct a new compiler from a shared context.
+     */
+    public AptJavaCompiler(Context context) {
+        super(preRegister(context));
+
+        context.put(compilerKey, this);
+        apt = Apt.instance(context);
+
+        ClassReader classReader = ClassReader.instance(context);
+        classReader.preferSource = true;
+
+        // TEMPORARY NOTE: bark==log, but while refactoring, we maintain their
+        // original identities, to remember the original intent.
+        log = Log.instance(context);
+        bark = Bark.instance(context);
+
+        Options options = Options.instance(context);
+        classOutput   = options.get("-retrofit")      == null;
+        nocompile     = options.get("-nocompile")     != null;
+        print         = options.get("-print")         != null;
+        classesAsDecls= options.get("-XclassesAsDecls") != null;
+
+        genSourceFileNames = new java.util.LinkedHashSet<String>();
+        genClassFileNames  = new java.util.LinkedHashSet<String>();
+
+        // this forces a copy of the line map to be kept in the tree,
+        // for use by com.sun.mirror.util.SourcePosition.
+        lineDebugInfo = true;
+    }
+
+    /* Switches:
+     */
+
+    /** Emit class files. This switch is always set, except for the first
+     *  phase of retrofitting, where signatures are parsed.
+     */
+    public boolean classOutput;
+
+    /** The internal printing annotation processor should be used.
+     */
+    public boolean print;
+
+    /** Compilation should not be done after annotation processing.
+     */
+    public boolean nocompile;
+
+    /** Are class files being treated as declarations
+     */
+    public boolean classesAsDecls;
+
+    /** Try to open input stream with given name.
+     *  Report an error if this fails.
+     *  @param filename   The file name of the input stream to be opened.
+     */
+    // PROVIDED FOR EXTREME BACKWARDS COMPATIBILITY
+    // There are some very obscure errors that can arise while translating
+    // the contents of a file from bytes to characters. In Tiger, these
+    // diagnostics were ignored. This method provides compatibility with
+    // that behavior. It would be better to honor those diagnostics, in which
+    // case, this method can be deleted.
+    @Override
+    public CharSequence readSource(JavaFileObject filename) {
+        try {
+            inputFiles.add(filename);
+            boolean prev = bark.setDiagnosticsIgnored(true);
+            try {
+                return filename.getCharContent(false);
+            }
+            finally {
+                bark.setDiagnosticsIgnored(prev);
+            }
+        } catch (IOException e) {
+            bark.error(Position.NOPOS, "cant.read.file", filename);
+            return null;
+        }
+    }
+
+    /** Parse contents of input stream.
+     *  @param filename     The name of the file from which input stream comes.
+     *  @param input        The input stream to be parsed.
+     */
+    // PROVIDED FOR BACKWARDS COMPATIBILITY
+    // In Tiger, diagnostics from the scanner and parser were ignored.
+    // This method provides compatibility with that behavior.
+    // It would be better to honor those diagnostics, in which
+    // case, this method can be deleted.
+    @Override
+    protected JCCompilationUnit parse(JavaFileObject filename, CharSequence content) {
+        boolean prev = bark.setDiagnosticsIgnored(true);
+        try {
+            return super.parse(filename, content);
+        }
+        finally {
+            bark.setDiagnosticsIgnored(prev);
+        }
+    }
+
+    @Override
+    protected boolean keepComments() {
+        return true;  // make doc comments available to mirror API impl.
+    }
+
+    /** Track when the JavaCompiler has been used to compile something. */
+    private boolean hasBeenUsed = false;
+
+    /** Main method: compile a list of files, return all compiled classes
+     *  @param filenames     The names of all files to be compiled.
+     */
+    public List<ClassSymbol> compile(List<String> filenames,
+                                     Map<String, String> origOptions,
+                                     ClassLoader aptCL,
+                                     AnnotationProcessorFactory providedFactory,
+                                     java.util.Set<Class<? extends AnnotationProcessorFactory> > productiveFactories,
+                                     java.util.Set<java.io.File> aggregateGenFiles)
+        throws Throwable {
+        // as a JavaCompiler can only be used once, throw an exception if
+        // it has been used before.
+        assert !hasBeenUsed : "attempt to reuse JavaCompiler";
+        hasBeenUsed = true;
+
+        this.aggregateGenFiles = aggregateGenFiles;
+
+        long msec = System.currentTimeMillis();
+
+        ListBuffer<ClassSymbol> classes = new ListBuffer<ClassSymbol>();
+        try {
+            JavacFileManager fm = (JavacFileManager)fileManager;
+            //parse all files
+            ListBuffer<JCCompilationUnit> trees = new ListBuffer<JCCompilationUnit>();
+            for (List<String> l = filenames; l.nonEmpty(); l = l.tail) {
+                if (classesAsDecls) {
+                    if (! l.head.endsWith(".java") ) { // process as class file
+                        ClassSymbol cs = reader.enterClass(names.fromString(l.head));
+                        try {
+                            cs.complete();
+                        } catch(Symbol.CompletionFailure cf) {
+                            bark.aptError("CantFindClass", l);
+                            continue;
+                        }
+
+                        classes.append(cs); // add to list of classes
+                        continue;
+                    }
+                }
+                JavaFileObject fo = fm.getJavaFileObjectsFromStrings(List.of(l.head)).iterator().next();
+                trees.append(parse(fo));
+            }
+
+            //enter symbols for all files
+            List<JCCompilationUnit> roots = trees.toList();
+
+            if (errorCount() == 0) {
+                boolean prev = bark.setDiagnosticsIgnored(true);
+                try {
+                    enter.main(roots);
+                }
+                finally {
+                    bark.setDiagnosticsIgnored(prev);
+                }
+            }
+
+            if (errorCount() == 0) {
+                apt.main(roots,
+                         classes,
+                         origOptions, aptCL,
+                         providedFactory,
+                         productiveFactories);
+                genSourceFileNames.addAll(apt.getSourceFileNames());
+                genClassFileNames.addAll(apt.getClassFileNames());
+            }
+
+        } catch (Abort ex) {
+        }
+
+        if (verbose)
+            printVerbose("total", Long.toString(System.currentTimeMillis() - msec));
+
+        chk.reportDeferredDiagnostics();
+
+        printCount("error", errorCount());
+        printCount("warn", warningCount());
+
+        return classes.toList();
+    }
+}
--- a/langtools/src/share/classes/com/sun/tools/apt/main/JavaCompiler.java	Thu Dec 16 19:57:01 2010 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,292 +0,0 @@
-/*
- * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.tools.apt.main;
-
-import java.io.*;
-import java.util.Map;
-
-import javax.tools.JavaFileManager;
-import javax.tools.JavaFileObject;
-
-import com.sun.tools.javac.file.JavacFileManager;
-import com.sun.tools.javac.util.*;
-import com.sun.tools.javac.code.*;
-import com.sun.tools.javac.jvm.*;
-
-import com.sun.tools.javac.code.Symbol.*;
-import com.sun.tools.javac.tree.JCTree.*;
-
-import com.sun.tools.apt.comp.*;
-import com.sun.tools.apt.util.Bark;
-import com.sun.mirror.apt.AnnotationProcessorFactory;
-import com.sun.tools.javac.parser.DocCommentScanner;
-
-/**
- *  <p><b>This is NOT part of any supported API.
- *  If you write code that depends on this, you do so at your own
- *  risk.  This code and its internal interfaces are subject to change
- *  or deletion without notice.</b>
- */
-@SuppressWarnings("deprecation")
-public class JavaCompiler extends com.sun.tools.javac.main.JavaCompiler {
-    /** The context key for the compiler. */
-    protected static final Context.Key<JavaCompiler> compilerKey =
-        new Context.Key<JavaCompiler>();
-
-    /** Get the JavaCompiler instance for this context. */
-    public static JavaCompiler instance(Context context) {
-        JavaCompiler instance = context.get(compilerKey);
-        if (instance == null)
-            instance = new JavaCompiler(context);
-        return instance;
-    }
-
-
-    java.util.Set<String> genSourceFileNames;
-    java.util.Set<String> genClassFileNames;
-
-    public java.util.Set<String> getSourceFileNames() {
-        return genSourceFileNames;
-    }
-
-    /** List of names of generated class files.
-     */
-    public java.util.Set<String> getClassFileNames() {
-        return genClassFileNames;
-    }
-
-    java.util.Set<java.io.File> aggregateGenFiles = java.util.Collections.emptySet();
-
-    public java.util.Set<java.io.File> getAggregateGenFiles() {
-        return aggregateGenFiles;
-    }
-
-    /** The bark to be used for error reporting.
-     */
-    Bark bark;
-
-    /** The log to be used for error reporting.
-     */
-    Log log;
-
-    /** The annotation framework
-     */
-    Apt apt;
-
-    private static Context preRegister(Context context) {
-        Bark.preRegister(context);
-
-        if (context.get(JavaFileManager.class) == null)
-            JavacFileManager.preRegister(context);
-
-        return context;
-    }
-
-    /** Construct a new compiler from a shared context.
-     */
-    public JavaCompiler(Context context) {
-        super(preRegister(context));
-
-        context.put(compilerKey, this);
-        apt = Apt.instance(context);
-
-        ClassReader classReader = ClassReader.instance(context);
-        classReader.preferSource = true;
-
-        // TEMPORARY NOTE: bark==log, but while refactoring, we maintain their
-        // original identities, to remember the original intent.
-        log = Log.instance(context);
-        bark = Bark.instance(context);
-
-        Options options = Options.instance(context);
-        classOutput   = options.get("-retrofit")      == null;
-        nocompile     = options.get("-nocompile")     != null;
-        print         = options.get("-print")         != null;
-        classesAsDecls= options.get("-XclassesAsDecls") != null;
-
-        genSourceFileNames = new java.util.LinkedHashSet<String>();
-        genClassFileNames  = new java.util.LinkedHashSet<String>();
-
-        // this forces a copy of the line map to be kept in the tree,
-        // for use by com.sun.mirror.util.SourcePosition.
-        lineDebugInfo = true;
-    }
-
-    /* Switches:
-     */
-
-    /** Emit class files. This switch is always set, except for the first
-     *  phase of retrofitting, where signatures are parsed.
-     */
-    public boolean classOutput;
-
-    /** The internal printing annotation processor should be used.
-     */
-    public boolean print;
-
-    /** Compilation should not be done after annotation processing.
-     */
-    public boolean nocompile;
-
-    /** Are class files being treated as declarations
-     */
-    public boolean classesAsDecls;
-
-    /** Try to open input stream with given name.
-     *  Report an error if this fails.
-     *  @param filename   The file name of the input stream to be opened.
-     */
-    // PROVIDED FOR EXTREME BACKWARDS COMPATIBILITY
-    // There are some very obscure errors that can arise while translating
-    // the contents of a file from bytes to characters. In Tiger, these
-    // diagnostics were ignored. This method provides compatibility with
-    // that behavior. It would be better to honor those diagnostics, in which
-    // case, this method can be deleted.
-    @Override
-    public CharSequence readSource(JavaFileObject filename) {
-        try {
-            inputFiles.add(filename);
-            boolean prev = bark.setDiagnosticsIgnored(true);
-            try {
-                return filename.getCharContent(false);
-            }
-            finally {
-                bark.setDiagnosticsIgnored(prev);
-            }
-        } catch (IOException e) {
-            bark.error(Position.NOPOS, "cant.read.file", filename);
-            return null;
-        }
-    }
-
-    /** Parse contents of input stream.
-     *  @param filename     The name of the file from which input stream comes.
-     *  @param input        The input stream to be parsed.
-     */
-    // PROVIDED FOR BACKWARDS COMPATIBILITY
-    // In Tiger, diagnostics from the scanner and parser were ignored.
-    // This method provides compatibility with that behavior.
-    // It would be better to honor those diagnostics, in which
-    // case, this method can be deleted.
-    @Override
-    protected JCCompilationUnit parse(JavaFileObject filename, CharSequence content) {
-        boolean prev = bark.setDiagnosticsIgnored(true);
-        try {
-            return super.parse(filename, content);
-        }
-        finally {
-            bark.setDiagnosticsIgnored(prev);
-        }
-    }
-
-    @Override
-    protected boolean keepComments() {
-        return true;  // make doc comments available to mirror API impl.
-    }
-
-    /** Track when the JavaCompiler has been used to compile something. */
-    private boolean hasBeenUsed = false;
-
-    /** Main method: compile a list of files, return all compiled classes
-     *  @param filenames     The names of all files to be compiled.
-     */
-    public List<ClassSymbol> compile(List<String> filenames,
-                                     Map<String, String> origOptions,
-                                     ClassLoader aptCL,
-                                     AnnotationProcessorFactory providedFactory,
-                                     java.util.Set<Class<? extends AnnotationProcessorFactory> > productiveFactories,
-                                     java.util.Set<java.io.File> aggregateGenFiles)
-        throws Throwable {
-        // as a JavaCompiler can only be used once, throw an exception if
-        // it has been used before.
-        assert !hasBeenUsed : "attempt to reuse JavaCompiler";
-        hasBeenUsed = true;
-
-        this.aggregateGenFiles = aggregateGenFiles;
-
-        long msec = System.currentTimeMillis();
-
-        ListBuffer<ClassSymbol> classes = new ListBuffer<ClassSymbol>();
-        try {
-            JavacFileManager fm = (JavacFileManager)fileManager;
-            //parse all files
-            ListBuffer<JCCompilationUnit> trees = new ListBuffer<JCCompilationUnit>();
-            for (List<String> l = filenames; l.nonEmpty(); l = l.tail) {
-                if (classesAsDecls) {
-                    if (! l.head.endsWith(".java") ) { // process as class file
-                        ClassSymbol cs = reader.enterClass(names.fromString(l.head));
-                        try {
-                            cs.complete();
-                        } catch(Symbol.CompletionFailure cf) {
-                            bark.aptError("CantFindClass", l);
-                            continue;
-                        }
-
-                        classes.append(cs); // add to list of classes
-                        continue;
-                    }
-                }
-                JavaFileObject fo = fm.getJavaFileObjectsFromStrings(List.of(l.head)).iterator().next();
-                trees.append(parse(fo));
-            }
-
-            //enter symbols for all files
-            List<JCCompilationUnit> roots = trees.toList();
-
-            if (errorCount() == 0) {
-                boolean prev = bark.setDiagnosticsIgnored(true);
-                try {
-                    enter.main(roots);
-                }
-                finally {
-                    bark.setDiagnosticsIgnored(prev);
-                }
-            }
-
-            if (errorCount() == 0) {
-                apt.main(roots,
-                         classes,
-                         origOptions, aptCL,
-                         providedFactory,
-                         productiveFactories);
-                genSourceFileNames.addAll(apt.getSourceFileNames());
-                genClassFileNames.addAll(apt.getClassFileNames());
-            }
-
-        } catch (Abort ex) {
-        }
-
-        if (verbose)
-            printVerbose("total", Long.toString(System.currentTimeMillis() - msec));
-
-        chk.reportDeferredDiagnostics();
-
-        printCount("error", errorCount());
-        printCount("warn", warningCount());
-
-        return classes.toList();
-    }
-}
--- a/langtools/src/share/classes/com/sun/tools/apt/main/Main.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/apt/main/Main.java	Mon Dec 20 21:10:57 2010 -0800
@@ -421,7 +421,7 @@
         },
         new AptOption("-version",               "opt.version") {
             boolean process(String option) {
-                Bark.printLines(out, ownName + " " + JavaCompiler.version());
+                Bark.printLines(out, ownName + " " + AptJavaCompiler.version());
                 return super.process(option);
             }
         },
@@ -1111,11 +1111,11 @@
         }
         int exitCode = EXIT_OK;
 
-        JavaCompiler comp = null;
+        AptJavaCompiler comp = null;
         try {
             context.put(Bark.outKey, out);
 
-            comp = JavaCompiler.instance(context);
+            comp = AptJavaCompiler.instance(context);
             if (comp == null)
                 return EXIT_SYSERR;
 
@@ -1184,7 +1184,7 @@
      */
     void bugMessage(Throwable ex) {
         Bark.printLines(out, getLocalizedString("msg.bug",
-                                               JavaCompiler.version()));
+                                               AptJavaCompiler.version()));
         ex.printStackTrace(out);
     }
 
--- a/langtools/src/share/classes/com/sun/tools/apt/mirror/apt/FilerImpl.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/apt/mirror/apt/FilerImpl.java	Mon Dec 20 21:10:57 2010 -0800
@@ -120,7 +120,7 @@
 
     private final Options opts;
     private final DeclarationMaker declMaker;
-    private final com.sun.tools.apt.main.JavaCompiler comp;
+    private final com.sun.tools.apt.main.AptJavaCompiler comp;
 
     // Platform's default encoding
     private final static String DEFAULT_ENCODING =
@@ -177,7 +177,7 @@
         opts = Options.instance(context);
         declMaker = DeclarationMaker.instance(context);
         bark = Bark.instance(context);
-        comp = com.sun.tools.apt.main.JavaCompiler.instance(context);
+        comp = com.sun.tools.apt.main.AptJavaCompiler.instance(context);
         roundOver = false;
         this.filesCreated = comp.getAggregateGenFiles();
 
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractExecutableMemberWriter.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractExecutableMemberWriter.java	Mon Dec 20 21:10:57 2010 -0800
@@ -26,12 +26,16 @@
 package com.sun.tools.doclets.formats.html;
 
 import com.sun.javadoc.*;
+import com.sun.tools.doclets.formats.html.markup.*;
+import com.sun.tools.doclets.internal.toolkit.*;
+import com.sun.tools.doclets.internal.toolkit.util.*;
 
 /**
  * Print method and constructor info.
  *
  * @author Robert Field
  * @author Atul M Dambalkar
+ * @author Bhavesh Patel (Modified)
  */
 public abstract class AbstractExecutableMemberWriter extends AbstractMemberWriter {
 
@@ -45,82 +49,111 @@
     }
 
     /**
-     * Write the type parameters for the executable member.
+     * Add the type parameters for the executable member.
      *
      * @param member the member to write type parameters for.
+     * @param htmltree the content tree to which the parameters will be added.
      * @return the display length required to write this information.
      */
-    protected int writeTypeParameters(ExecutableMemberDoc member) {
+    protected int addTypeParameters(ExecutableMemberDoc member, Content htmltree) {
         LinkInfoImpl linkInfo = new LinkInfoImpl(
             LinkInfoImpl.CONTEXT_MEMBER_TYPE_PARAMS, member, false);
         String typeParameters = writer.getTypeParameterLinks(linkInfo);
         if (linkInfo.displayLength > 0) {
-            writer.print(typeParameters + " ");
+            Content linkContent = new RawHtml(typeParameters);
+            htmltree.addContent(linkContent);
+            htmltree.addContent(writer.getSpace());
             writer.displayLength += linkInfo.displayLength + 1;
         }
         return linkInfo.displayLength;
     }
 
-    protected void writeSignature(ExecutableMemberDoc member) {
-        writer.displayLength = 0;
-        writer.pre();
-        writer.writeAnnotationInfo(member);
-        printModifiers(member);
-        writeTypeParameters(member);
-        if (configuration().linksource &&
-            member.position().line() != classdoc.position().line()) {
-            writer.printSrcLink(member, member.name());
-        } else {
-            strong(member.name());
-        }
-        writeParameters(member);
-        writeExceptions(member);
-        writer.preEnd();
+    /**
+     * {@inheritDoc}
+     */
+    protected Content getDeprecatedLink(ProgramElementDoc member) {
+        ExecutableMemberDoc emd = (ExecutableMemberDoc)member;
+        return writer.getDocLink(LinkInfoImpl.CONTEXT_MEMBER, (MemberDoc) emd,
+                emd.qualifiedName() + emd.flatSignature());
     }
 
-    protected void writeDeprecatedLink(ProgramElementDoc member) {
+    /**
+     * Add the summary link for the member.
+     *
+     * @param context the id of the context where the link will be printed
+     * @param classDoc the classDoc that we should link to
+     * @param member the member being linked to
+     * @param tdSummary the content tree to which the link will be added
+     */
+    protected void addSummaryLink(int context, ClassDoc cd, ProgramElementDoc member,
+            Content tdSummary) {
         ExecutableMemberDoc emd = (ExecutableMemberDoc)member;
-        writer.printDocLink(LinkInfoImpl.CONTEXT_MEMBER, (MemberDoc) emd,
-            emd.qualifiedName() + emd.flatSignature(), false);
+        String name = emd.name();
+        Content strong = HtmlTree.STRONG(new RawHtml(
+                writer.getDocLink(context, cd, (MemberDoc) emd,
+                name, false)));
+        Content code = HtmlTree.CODE(strong);
+        writer.displayLength = name.length();
+        addParameters(emd, false, code);
+        tdSummary.addContent(code);
     }
 
-    protected void writeSummaryLink(int context, ClassDoc cd, ProgramElementDoc member) {
-        ExecutableMemberDoc emd = (ExecutableMemberDoc)member;
-        String name = emd.name();
-        writer.strong();
-        writer.printDocLink(context, cd, (MemberDoc) emd,
-            name, false);
-        writer.strongEnd();
-        writer.displayLength = name.length();
-        writeParameters(emd, false);
+    /**
+     * Add the inherited summary link for the member.
+     *
+     * @param classDoc the classDoc that we should link to
+     * @param member the member being linked to
+     * @param linksTree the content tree to which the link will be added
+     */
+    protected void addInheritedSummaryLink(ClassDoc cd,
+            ProgramElementDoc member, Content linksTree) {
+        linksTree.addContent(new RawHtml(
+                writer.getDocLink(LinkInfoImpl.CONTEXT_MEMBER, cd, (MemberDoc) member,
+                member.name(), false)));
     }
 
-    protected void writeInheritedSummaryLink(ClassDoc cd,
-            ProgramElementDoc member) {
-        writer.printDocLink(LinkInfoImpl.CONTEXT_MEMBER, cd, (MemberDoc) member,
-            member.name(), false);
-    }
-
-    protected void writeParam(ExecutableMemberDoc member, Parameter param,
-        boolean isVarArg) {
+    /**
+     * Add the parameter for the executable member.
+     *
+     * @param member the member to write parameter for.
+     * @param param the parameter that needs to be written.
+     * @param isVarArg true if this is a link to var arg.
+     * @param tree the content tree to which the parameter information will be added.
+     */
+    protected void addParam(ExecutableMemberDoc member, Parameter param,
+        boolean isVarArg, Content tree) {
         if (param.type() != null) {
-            writer.printLink(new LinkInfoImpl(
-                LinkInfoImpl.CONTEXT_EXECUTABLE_MEMBER_PARAM, param.type(),
-                isVarArg));
+            Content link = new RawHtml(writer.getLink(new LinkInfoImpl(
+                    LinkInfoImpl.CONTEXT_EXECUTABLE_MEMBER_PARAM, param.type(),
+                    isVarArg)));
+            tree.addContent(link);
         }
         if(param.name().length() > 0) {
-            writer.space();
-            writer.print(param.name());
+            tree.addContent(writer.getSpace());
+            tree.addContent(param.name());
         }
     }
 
-    protected void writeParameters(ExecutableMemberDoc member) {
-        writeParameters(member, true);
+    /**
+     * Add all the parameters for the executable member.
+     *
+     * @param member the member to write parameters for.
+     * @param tree the content tree to which the parameters information will be added.
+     */
+    protected void addParameters(ExecutableMemberDoc member, Content htmltree) {
+        addParameters(member, true, htmltree);
     }
 
-    protected void writeParameters(ExecutableMemberDoc member,
-            boolean includeAnnotations) {
-        print('(');
+    /**
+     * Add all the parameters for the executable member.
+     *
+     * @param member the member to write parameters for.
+     * @param includeAnnotations true if annotation information needs to be added.
+     * @param tree the content tree to which the parameters information will be added.
+     */
+    protected void addParameters(ExecutableMemberDoc member,
+            boolean includeAnnotations, Content htmltree) {
+        htmltree.addContent("(");
         Parameter[] params = member.parameters();
         String indent = makeSpace(writer.displayLength);
         if (configuration().linksource) {
@@ -132,58 +165,70 @@
             Parameter param = params[paramstart];
             if (!param.name().startsWith("this$")) {
                 if (includeAnnotations) {
-                        boolean foundAnnotations =
-                                writer.writeAnnotationInfo(indent.length(), member, param);
-                        if (foundAnnotations) {
-                                writer.println();
-                                writer.print(indent);
+                    boolean foundAnnotations =
+                            writer.addAnnotationInfo(indent.length(),
+                            member, param, htmltree);
+                    if (foundAnnotations) {
+                        htmltree.addContent(DocletConstants.NL);
+                        htmltree.addContent(indent);
                     }
                 }
-                writeParam(member, param,
-                    (paramstart == params.length - 1) && member.isVarArgs());
+                addParam(member, param,
+                    (paramstart == params.length - 1) && member.isVarArgs(), htmltree);
                 break;
             }
         }
 
         for (int i = paramstart + 1; i < params.length; i++) {
-            writer.print(',');
-            writer.println();
-            writer.print(indent);
+            htmltree.addContent(",");
+            htmltree.addContent(DocletConstants.NL);
+            htmltree.addContent(indent);
             if (includeAnnotations) {
                 boolean foundAnnotations =
-                    writer.writeAnnotationInfo(indent.length(), member, params[i]);
+                        writer.addAnnotationInfo(indent.length(), member, params[i],
+                        htmltree);
                 if (foundAnnotations) {
-                    writer.println();
-                    writer.print(indent);
+                    htmltree.addContent(DocletConstants.NL);
+                    htmltree.addContent(indent);
                 }
             }
-            writeParam(member, params[i], (i == params.length - 1) && member.isVarArgs());
+            addParam(member, params[i], (i == params.length - 1) && member.isVarArgs(),
+                    htmltree);
         }
-        writer.print(')');
+        htmltree.addContent(")");
     }
 
-    protected void writeExceptions(ExecutableMemberDoc member) {
+    /**
+     * Add exceptions for the executable member.
+     *
+     * @param member the member to write exceptions for.
+     * @param htmltree the content tree to which the exceptions information will be added.
+     */
+    protected void addExceptions(ExecutableMemberDoc member, Content htmltree) {
         Type[] exceptions = member.thrownExceptionTypes();
         if(exceptions.length > 0) {
             LinkInfoImpl memberTypeParam = new LinkInfoImpl(
-                LinkInfoImpl.CONTEXT_MEMBER, member, false);
+                    LinkInfoImpl.CONTEXT_MEMBER, member, false);
             int retlen = getReturnTypeLength(member);
             writer.getTypeParameterLinks(memberTypeParam);
             retlen += memberTypeParam.displayLength == 0 ?
                 0 : memberTypeParam.displayLength + 1;
             String indent = makeSpace(modifierString(member).length() +
-                member.name().length() + retlen - 4);
-            writer.println();
-            writer.print(indent);
-            writer.print("throws ");
+                    member.name().length() + retlen - 4);
+            htmltree.addContent(DocletConstants.NL);
+            htmltree.addContent(indent);
+            htmltree.addContent("throws ");
             indent += "       ";
-            writer.printLink(new LinkInfoImpl(
-                LinkInfoImpl.CONTEXT_MEMBER, exceptions[0]));
+            Content link = new RawHtml(writer.getLink(new LinkInfoImpl(
+                    LinkInfoImpl.CONTEXT_MEMBER, exceptions[0])));
+            htmltree.addContent(link);
             for(int i = 1; i < exceptions.length; i++) {
-                writer.println(",");
-                writer.print(indent);
-                writer.printLink(new LinkInfoImpl(
-                    LinkInfoImpl.CONTEXT_MEMBER, exceptions[i]));
+                htmltree.addContent(",");
+                htmltree.addContent(DocletConstants.NL);
+                htmltree.addContent(indent);
+                Content exceptionLink = new RawHtml(writer.getLink(new LinkInfoImpl(
+                        LinkInfoImpl.CONTEXT_MEMBER, exceptions[i])));
+                htmltree.addContent(exceptionLink);
             }
         }
     }
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractIndexWriter.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractIndexWriter.java	Mon Dec 20 21:10:57 2010 -0800
@@ -30,6 +30,8 @@
 
 import com.sun.javadoc.*;
 import com.sun.tools.doclets.internal.toolkit.util.*;
+import com.sun.tools.doclets.formats.html.markup.*;
+import com.sun.tools.doclets.internal.toolkit.*;
 
 /**
  * Generate Index for all the Member Names with Indexing in
@@ -39,6 +41,7 @@
  *
  * @see    IndexBuilder
  * @author Atul M Dambalkar
+ * @author Bhavesh Patel (Modified)
  */
 public class AbstractIndexWriter extends HtmlDocletWriter {
 
@@ -78,175 +81,187 @@
     }
 
     /**
-     * Print the text "Index" in strong format in the navigation bar.
+     * Get the index label for navigation bar.
+     *
+     * @return a content tree for the tree label
      */
-    protected void navLinkIndex() {
-        navCellRevStart();
-        fontStyle("NavBarFont1Rev");
-        strongText("doclet.Index");
-        fontEnd();
-        navCellEnd();
+    protected Content getNavLinkIndex() {
+        Content li = HtmlTree.LI(HtmlStyle.navBarCell1Rev, indexLabel);
+        return li;
     }
 
     /**
-     * Generate the member information for the unicode character along with the
+     * Add the member information for the unicode character along with the
      * list of the members.
      *
-     * @param unicode Unicode for which member list information to be generated.
-     * @param memberlist List of members for the unicode character.
+     * @param unicode Unicode for which member list information to be generated
+     * @param memberlist List of members for the unicode character
+     * @param contentTree the content tree to which the information will be added
      */
-    protected void generateContents(Character unicode, List<? extends Doc> memberlist) {
-        anchor("_" + unicode + "_");
-        h2();
-        strong(unicode.toString());
-        h2End();
+    protected void addContents(Character unicode, List<? extends Doc> memberlist,
+            Content contentTree) {
+        contentTree.addContent(getMarkerAnchor("_" + unicode + "_"));
+        Content headContent = new StringContent(unicode.toString());
+        Content heading = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, false,
+                HtmlStyle.title, headContent);
+        contentTree.addContent(heading);
         int memberListSize = memberlist.size();
         // Display the list only if there are elements to be displayed.
         if (memberListSize > 0) {
-            dl();
+            Content dl = new HtmlTree(HtmlTag.DL);
             for (int i = 0; i < memberListSize; i++) {
                 Doc element = memberlist.get(i);
                 if (element instanceof MemberDoc) {
-                    printDescription((MemberDoc)element);
+                    addDescription((MemberDoc)element, dl);
                 } else if (element instanceof ClassDoc) {
-                    printDescription((ClassDoc)element);
+                    addDescription((ClassDoc)element, dl);
                 } else if (element instanceof PackageDoc) {
-                    printDescription((PackageDoc)element);
+                    addDescription((PackageDoc)element, dl);
                 }
             }
-            dlEnd();
+            contentTree.addContent(dl);
         }
-        hr();
     }
 
-
     /**
-     * Print one line summary comment for the package.
+     * Add one line summary comment for the package.
      *
-     * @param pkg PackageDoc passed.
+     * @param pkg the package to be documented
+     * @param dlTree the content tree to which the description will be added
      */
-    protected void printDescription(PackageDoc pkg) {
-        dt();
-        printPackageLink(pkg, Util.getPackageName(pkg), true);
-        print(" - ");
-        print(configuration.getText("doclet.package") + " " + pkg.name());
-        dtEnd();
-        dd();
-        printSummaryComment(pkg);
-        ddEnd();
+    protected void addDescription(PackageDoc pkg, Content dlTree) {
+        Content link = getPackageLink(pkg, new StringContent(Util.getPackageName(pkg)));
+        Content dt = HtmlTree.DT(link);
+        dt.addContent(" - ");
+        dt.addContent(getResource("doclet.package"));
+        dt.addContent(" " + pkg.name());
+        dlTree.addContent(dt);
+        Content dd = new HtmlTree(HtmlTag.DD);
+        addSummaryComment(pkg, dd);
+        dlTree.addContent(dd);
     }
 
     /**
-     * Print one line summary comment for the class.
+     * Add one line summary comment for the class.
      *
-     * @param cd ClassDoc passed.
+     * @param cd the class being documented
+     * @param dlTree the content tree to which the description will be added
      */
-    protected void printDescription(ClassDoc cd) {
-        dt();
-        printLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_INDEX, cd, true));
-        print(" - ");
-        printClassInfo(cd);
-        dtEnd();
-        dd();
-        printComment(cd);
-        ddEnd();
+    protected void addDescription(ClassDoc cd, Content dlTree) {
+        Content link = new RawHtml(
+                getLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_INDEX, cd, true)));
+        Content dt = HtmlTree.DT(link);
+        dt.addContent(" - ");
+        addClassInfo(cd, dt);
+        dlTree.addContent(dt);
+        Content dd = new HtmlTree(HtmlTag.DD);
+        addComment(cd, dd);
+        dlTree.addContent(dd);
     }
 
     /**
-     * Print the classkind(class, interface, exception, error of the class
+     * Add the classkind(class, interface, exception, error of the class
      * passed.
      *
-     * @param cd ClassDoc.
+     * @param cd the class being documented
+     * @param contentTree the content tree to which the class info will be added
      */
-    protected void printClassInfo(ClassDoc cd) {
-        print(configuration.getText("doclet.in",
-            Util.getTypeName(configuration, cd, false),
-            getPackageLink(cd.containingPackage(),
+    protected void addClassInfo(ClassDoc cd, Content contentTree) {
+        contentTree.addContent(getResource("doclet.in",
+                Util.getTypeName(configuration, cd, false),
+                getPackageLinkString(cd.containingPackage(),
                 Util.getPackageName(cd.containingPackage()), false)));
     }
 
-
     /**
-     * Generate Description for Class, Field, Method or Constructor.
-     * for Java.* Packages Class Members.
+     * Add description for Class, Field, Method or Constructor.
      *
-     * @param member MemberDoc for the member of the Class Kind.
-     * @see com.sun.javadoc.MemberDoc
+     * @param member MemberDoc for the member of the Class Kind
+     * @param dlTree the content tree to which the description will be added
      */
-    protected void printDescription(MemberDoc member) {
+    protected void addDescription(MemberDoc member, Content dlTree) {
         String name = (member instanceof ExecutableMemberDoc)?
             member.name() + ((ExecutableMemberDoc)member).flatSignature() :
             member.name();
         if (name.indexOf("<") != -1 || name.indexOf(">") != -1) {
                 name = Util.escapeHtmlChars(name);
         }
-        ClassDoc containing = member.containingClass();
-        dt();
-        printDocLink(LinkInfoImpl.CONTEXT_INDEX, member, name, true);
-        println(" - ");
-        printMemberDesc(member);
-        println();
-        dtEnd();
-        dd();
-        printComment(member);
-        ddEnd();
-        println();
+        Content span = HtmlTree.SPAN(HtmlStyle.strong,
+                getDocLink(LinkInfoImpl.CONTEXT_INDEX, member, name));
+        Content dt = HtmlTree.DT(span);
+        dt.addContent(" - ");
+        addMemberDesc(member, dt);
+        dlTree.addContent(dt);
+        Content dd = new HtmlTree(HtmlTag.DD);
+        addComment(member, dd);
+        dlTree.addContent(dd);
     }
 
-
     /**
-     * Print comment for each element in the index. If the element is deprecated
+     * Add comment for each element in the index. If the element is deprecated
      * and it has a @deprecated tag, use that comment. Else if the containing
      * class for this element is deprecated, then add the word "Deprecated." at
      * the start and then print the normal comment.
      *
-     * @param element Index element.
+     * @param element Index element
+     * @param contentTree the content tree to which the comment will be added
      */
-    protected void printComment(ProgramElementDoc element) {
+    protected void addComment(ProgramElementDoc element, Content contentTree) {
         Tag[] tags;
+        Content span = HtmlTree.SPAN(HtmlStyle.strong, deprecatedPhrase);
+        HtmlTree div = new HtmlTree(HtmlTag.DIV);
+        div.addStyle(HtmlStyle.block);
         if (Util.isDeprecated(element)) {
-            strongText("doclet.Deprecated"); space();
+            div.addContent(span);
             if ((tags = element.tags("deprecated")).length > 0)
-                printInlineDeprecatedComment(element, tags[0]);
+                addInlineDeprecatedComment(element, tags[0], div);
+            contentTree.addContent(div);
         } else {
             ClassDoc cont = element.containingClass();
             while (cont != null) {
                 if (Util.isDeprecated(cont)) {
-                    strongText("doclet.Deprecated"); space();
+                    div.addContent(span);
+                    contentTree.addContent(div);
                     break;
                 }
                 cont = cont.containingClass();
             }
-            printSummaryComment(element);
+            addSummaryComment(element, contentTree);
         }
     }
 
     /**
-     * Print description about the Static Varible/Method/Constructor for a
+     * Add description about the Static Varible/Method/Constructor for a
      * member.
      *
-     * @param member MemberDoc for the member within the Class Kind.
-     * @see com.sun.javadoc.MemberDoc
+     * @param member MemberDoc for the member within the Class Kind
+     * @param contentTree the content tree to which the member description will be added
      */
-    protected void printMemberDesc(MemberDoc member) {
+    protected void addMemberDesc(MemberDoc member, Content contentTree) {
         ClassDoc containing = member.containingClass();
-        String classdesc = Util.getTypeName(configuration, containing, true) + " " +
-            getPreQualifiedClassLink(LinkInfoImpl.CONTEXT_INDEX, containing,
-                false);
+        String classdesc = Util.getTypeName(
+                configuration, containing, true) + " ";
         if (member.isField()) {
             if (member.isStatic()) {
-                printText("doclet.Static_variable_in", classdesc);
+                contentTree.addContent(
+                        getResource("doclet.Static_variable_in", classdesc));
             } else {
-                printText("doclet.Variable_in", classdesc);
+                contentTree.addContent(
+                        getResource("doclet.Variable_in", classdesc));
             }
         } else if (member.isConstructor()) {
-            printText("doclet.Constructor_for", classdesc);
+            contentTree.addContent(
+                    getResource("doclet.Constructor_for", classdesc));
         } else if (member.isMethod()) {
             if (member.isStatic()) {
-                printText("doclet.Static_method_in", classdesc);
+                contentTree.addContent(
+                        getResource("doclet.Static_method_in", classdesc));
             } else {
-                printText("doclet.Method_in", classdesc);
+                contentTree.addContent(
+                        getResource("doclet.Method_in", classdesc));
             }
         }
+        addPreQualifiedClassLink(LinkInfoImpl.CONTEXT_INDEX, containing,
+                false, contentTree);
     }
 }
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractMemberWriter.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractMemberWriter.java	Mon Dec 20 21:10:57 2010 -0800
@@ -25,10 +25,11 @@
 
 package com.sun.tools.doclets.formats.html;
 
+import java.util.*;
 import java.lang.reflect.Modifier;
-import java.util.*;
-
 import com.sun.javadoc.*;
+import com.sun.tools.doclets.formats.html.markup.*;
+import com.sun.tools.doclets.internal.toolkit.*;
 import com.sun.tools.doclets.internal.toolkit.util.*;
 import com.sun.tools.doclets.internal.toolkit.taglets.*;
 
@@ -60,36 +61,125 @@
 
     /*** abstracts ***/
 
-    public abstract void printSummaryLabel();
+    /**
+     * Add the summary label for the member.
+     *
+     * @param memberTree the content tree to which the label will be added
+     */
+    public abstract void addSummaryLabel(Content memberTree);
 
-    public abstract void printTableSummary();
+    /**
+     * Get the summary for the member summary table.
+     *
+     * @return a string for the table summary
+     */
+    public abstract String getTableSummary();
 
-    public abstract void printSummaryTableHeader(ProgramElementDoc member);
+    /**
+     * Get the caption for the member summary table.
+     *
+     * @return a string for the table caption
+     */
+    public abstract String getCaption();
 
-    public abstract void printInheritedSummaryLabel(ClassDoc cd);
+    /**
+     * Get the summary table header for the member.
+     *
+     * @param member the member to be documented
+     * @return the summary table header
+     */
+    public abstract String[] getSummaryTableHeader(ProgramElementDoc member);
 
-    public abstract void printSummaryAnchor(ClassDoc cd);
+    /**
+     * Add inherited summary lable for the member.
+     *
+     * @param cd the class doc to which to link to
+     * @param inheritedTree the content tree to which the inherited summary label will be added
+     */
+    public abstract void addInheritedSummaryLabel(ClassDoc cd, Content inheritedTree);
 
-    public abstract void printInheritedSummaryAnchor(ClassDoc cd);
+    /**
+     * Add the anchor for the summary section of the member.
+     *
+     * @param cd the class doc to be documented
+     * @param memberTree the content tree to which the summary anchor will be added
+     */
+    public abstract void addSummaryAnchor(ClassDoc cd, Content memberTree);
 
-    protected abstract void printSummaryType(ProgramElementDoc member);
+    /**
+     * Add the anchor for the inherited summary section of the member.
+     *
+     * @param cd the class doc to be documented
+     * @param inheritedTree the content tree to which the inherited summary anchor will be added
+     */
+    public abstract void addInheritedSummaryAnchor(ClassDoc cd, Content inheritedTree);
 
-    protected void writeSummaryLink(ClassDoc cd, ProgramElementDoc member) {
-        writeSummaryLink(LinkInfoImpl.CONTEXT_MEMBER, cd, member);
+    /**
+     * Add the summary type for the member.
+     *
+     * @param member the member to be documented
+     * @param tdSummaryType the content tree to which the type will be added
+     */
+    protected abstract void addSummaryType(ProgramElementDoc member,
+            Content tdSummaryType);
+
+    /**
+     * Add the summary link for the member.
+     *
+     * @param cd the class doc to be documented
+     * @param member the member to be documented
+     * @param tdSummary the content tree to which the link will be added
+     */
+    protected void addSummaryLink(ClassDoc cd, ProgramElementDoc member,
+            Content tdSummary) {
+        addSummaryLink(LinkInfoImpl.CONTEXT_MEMBER, cd, member, tdSummary);
     }
 
-    protected abstract void writeSummaryLink(int context,
-                                             ClassDoc cd,
-                                             ProgramElementDoc member);
+    /**
+     * Add the summary link for the member.
+     *
+     * @param context the id of the context where the link will be printed
+     * @param cd the class doc to be documented
+     * @param member the member to be documented
+     * @param tdSummary the content tree to which the summary link will be added
+     */
+    protected abstract void addSummaryLink(int context,
+            ClassDoc cd, ProgramElementDoc member, Content tdSummary);
+
+    /**
+     * Add the inherited summary link for the member.
+     *
+     * @param cd the class doc to be documented
+     * @param member the member to be documented
+     * @param linksTree the content tree to which the inherited summary link will be added
+     */
+    protected abstract void addInheritedSummaryLink(ClassDoc cd,
+            ProgramElementDoc member, Content linksTree);
 
-    protected abstract void writeInheritedSummaryLink(ClassDoc cd,
-                                                     ProgramElementDoc member);
+    /**
+     * Get the deprecated link.
+     *
+     * @param member the member being linked to
+     * @return a content tree representing the link
+     */
+    protected abstract Content getDeprecatedLink(ProgramElementDoc member);
 
-    protected abstract void writeDeprecatedLink(ProgramElementDoc member);
+    /**
+     * Get the navigation summary link.
+     *
+     * @param cd the class doc to be documented
+     * @param link true if its a link else the label to be printed
+     * @return a content tree for the navigation summary link.
+     */
+    protected abstract Content getNavSummaryLink(ClassDoc cd, boolean link);
 
-    protected abstract void printNavSummaryLink(ClassDoc cd, boolean link);
-
-    protected abstract void printNavDetailLink(boolean link);
+    /**
+     * Add the navigation detail link.
+     *
+     * @param link true if its a link else the label to be printed
+     * @param liNav the content tree to which the navigation detail link will be added
+     */
+    protected abstract void addNavDetailLink(boolean link, Content liNav);
 
     /***  ***/
 
@@ -109,6 +199,17 @@
     }
 
     /**
+     * Add the member name to the content tree and modifies the display length.
+     *
+     * @param name the member name to be added to the content tree.
+     * @param htmltree the content tree to which the name will be added.
+     */
+    protected void addName(String name, Content htmltree) {
+        htmltree.addContent(name);
+        writer.displayLength += name.length();
+    }
+
+    /**
      * Return a string describing the access modifier flags.
      * Don't include native or synchronized.
      *
@@ -131,18 +232,24 @@
         return type;
     }
 
-    protected void printModifiers(MemberDoc member) {
+    /**
+     * Add the modifier for the member.
+     *
+     * @param member the member for which teh modifier will be added.
+     * @param htmltree the content tree to which the modifier information will be added.
+     */
+    protected void addModifiers(MemberDoc member, Content htmltree) {
         String mod = modifierString(member);
         // According to JLS, we should not be showing public modifier for
         // interface methods.
         if ((member.isField() || member.isMethod()) &&
             writer instanceof ClassWriterImpl &&
-             ((ClassWriterImpl) writer).getClassDoc().isInterface()) {
+            ((ClassWriterImpl) writer).getClassDoc().isInterface()) {
             mod = Util.replaceText(mod, "public", "").trim();
         }
         if(mod.length() > 0) {
-            print(mod);
-            print(' ');
+            htmltree.addContent(mod);
+            htmltree.addContent(writer.getSpace());
         }
     }
 
@@ -158,66 +265,43 @@
     }
 
     /**
-     * Print 'static' if static and type link.
+     * Add the modifier and type for the member in the member summary.
+     *
+     * @param member the member to add the type for
+     * @param type the type to add
+     * @param tdSummaryType the content tree to which the modified and type will be added
      */
-    protected void printStaticAndType(boolean isStatic, Type type) {
-        writer.printTypeSummaryHeader();
-        if (isStatic) {
-            print("static");
-        }
-        writer.space();
-        if (type != null) {
-            writer.printLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_MEMBER,
-                type));
-        }
-        writer.printTypeSummaryFooter();
-    }
-
-    /**
-     * Print the modifier and type for the member in the member summary.
-     *
-     * @param member the member to print the type for.
-     * @param type   the type to print.
-     */
-    protected void printModifierAndType(ProgramElementDoc member, Type type) {
-        writer.printTypeSummaryHeader();
-        printModifier(member);
+    protected void addModifierAndType(ProgramElementDoc member, Type type,
+            Content tdSummaryType) {
+        HtmlTree code = new HtmlTree(HtmlTag.CODE);
+        addModifier(member, code);
         if (type == null) {
-            writer.space();
             if (member.isClass()) {
-                print("class");
+                code.addContent("class");
             } else {
-                print("interface");
+                code.addContent("interface");
             }
+            code.addContent(writer.getSpace());
         } else {
             if (member instanceof ExecutableMemberDoc &&
                     ((ExecutableMemberDoc) member).typeParameters().length > 0) {
                 //Code to avoid ugly wrapping in member summary table.
-                writer.table(0,0,0);
-                writer.trAlignVAlign("right", "");
-                writer.tdNowrap();
-                writer.font("-1");
-                writer.code();
-                int displayLength = ((AbstractExecutableMemberWriter) this).
-                writeTypeParameters((ExecutableMemberDoc) member);
+                int displayLength = ((AbstractExecutableMemberWriter) this).addTypeParameters(
+                        (ExecutableMemberDoc) member, code);
                 if (displayLength > 10) {
-                    writer.br();
+                    code.addContent(new HtmlTree(HtmlTag.BR));
                 }
-                writer.printLink(new LinkInfoImpl(
-                    LinkInfoImpl.CONTEXT_SUMMARY_RETURN_TYPE, type));
-                writer.codeEnd();
-                writer.fontEnd();
-                writer.tdEnd();
-                writer.trEnd();
-                writer.tableEnd();
+                code.addContent(new RawHtml(
+                        writer.getLink(new LinkInfoImpl(
+                        LinkInfoImpl.CONTEXT_SUMMARY_RETURN_TYPE, type))));
             } else {
-                writer.space();
-                writer.printLink(new LinkInfoImpl(
-                    LinkInfoImpl.CONTEXT_SUMMARY_RETURN_TYPE, type));
+                code.addContent(new RawHtml(
+                        writer.getLink(new LinkInfoImpl(
+                        LinkInfoImpl.CONTEXT_SUMMARY_RETURN_TYPE, type))));
             }
 
         }
-        writer.printTypeSummaryFooter();
+        tdSummaryType.addContent(code);
     }
 
     private void printModifier(ProgramElementDoc member) {
@@ -238,25 +322,53 @@
     }
 
     /**
-     * Print the deprecated output for the given member.
+     * Add the modifier for the member.
+     *
+     * @param member the member to add the type for
+     * @param code the content tree to which the modified will be added
+     */
+    private void addModifier(ProgramElementDoc member, Content code) {
+        if (member.isProtected()) {
+            code.addContent("protected ");
+        } else if (member.isPrivate()) {
+            code.addContent("private ");
+        } else if (!member.isPublic()) { // Package private
+            code.addContent(configuration().getText("doclet.Package_private"));
+            code.addContent(" ");
+        }
+        if (member.isMethod() && ((MethodDoc)member).isAbstract()) {
+            code.addContent("abstract ");
+        }
+        if (member.isStatic()) {
+            code.addContent("static ");
+        }
+    }
+
+    /**
+     * Add the deprecated information for the given member.
      *
      * @param member the member being documented.
+     * @param contentTree the content tree to which the deprecated information will be added.
      */
-    protected void printDeprecated(ProgramElementDoc member) {
+    protected void addDeprecatedInfo(ProgramElementDoc member, Content contentTree) {
         String output = (new DeprecatedTaglet()).getTagletOutput(member,
             writer.getTagletWriterInstance(false)).toString().trim();
         if (!output.isEmpty()) {
-            writer.printMemberDetailsListStartTag();
-            writer.print(output);
+            Content deprecatedContent = new RawHtml(output);
+            Content div = HtmlTree.DIV(HtmlStyle.block, deprecatedContent);
+            contentTree.addContent(div);
         }
     }
 
-    protected void printComment(ProgramElementDoc member) {
+    /**
+     * Add the comment for the given member.
+     *
+     * @param member the member being documented.
+     * @param contentTree the content tree to which the comment will be added.
+     */
+    protected void addComment(ProgramElementDoc member, Content htmltree) {
         if (member.inlineTags().length > 0) {
-            writer.printMemberDetailsListStartTag();
-            writer.dd();
-            writer.printInlineComment(member);
-            writer.ddEnd();
+            writer.addInlineComment(member, htmltree);
         }
     }
 
@@ -264,67 +376,19 @@
         return member.name();
     }
 
-    protected void printHead(MemberDoc member) {
-        writer.h3();
-        writer.print(member.name());
-        writer.h3End();
-    }
-
-    protected void printFullComment(ProgramElementDoc member) {
-        if(configuration().nocomment){
-            return;
-        }
-        writer.dl();
-        print(((TagletOutputImpl)
-            (new DeprecatedTaglet()).getTagletOutput(member,
-            writer.getTagletWriterInstance(false))).toString());
-        printCommentAndTags(member);
-        writer.dlEnd();
-    }
-
-    protected void printCommentAndTags(ProgramElementDoc member) {
-        printComment(member);
-        writer.printTags(member);
+    /**
+     * Get the header for the section.
+     *
+     * @param member the member being documented.
+     * @return a header content for the section.
+     */
+    protected Content getHead(MemberDoc member) {
+        Content memberContent = new RawHtml(member.name());
+        Content heading = HtmlTree.HEADING(HtmlConstants.MEMBER_HEADING, memberContent);
+        return heading;
     }
 
     /**
-     * Write the member footer.
-     */
-    protected void printMemberFooter() {
-        writer.printMemberDetailsListEndTag();
-        assert !writer.getMemberDetailsListPrinted();
-    }
-
-    /**
-     * Forward to containing writer
-     */
-    public void printSummaryHeader(ClassDoc cd) {
-        printedSummaryHeader = true;
-        writer.printSummaryHeader(this, cd);
-    }
-
-    /**
-     * Forward to containing writer
-     */
-    public void printInheritedSummaryHeader(ClassDoc cd) {
-        writer.printInheritedSummaryHeader(this, cd);
-    }
-
-    /**
-     * Forward to containing writer
-     */
-    public void printInheritedSummaryFooter(ClassDoc cd) {
-        writer.printInheritedSummaryFooter(this, cd);
-    }
-
-    /**
-     * Forward to containing writer
-     */
-    public void printSummaryFooter(ClassDoc cd) {
-        writer.printSummaryFooter(this, cd);
-    }
-
-   /**
     * Return true if the given <code>ProgramElement</code> is inherited
     * by the class that is being documented.
     *
@@ -340,102 +404,134 @@
         return true;
     }
 
-
     /**
-     * Generate the code for listing the deprecated APIs. Create the table
-     * format for listing the API. Call methods from the sub-class to complete
-     * the generation.
+     * Add deprecated information to the documentation tree
+     *
+     * @param deprmembers list of deprecated members
+     * @param headingKey the caption for the deprecated members table
+     * @param tableSummary the summary for the deprecated members table
+     * @param tableHeader table headers for the deprecated members table
+     * @param contentTree the content tree to which the deprecated members table will be added
      */
-    protected void printDeprecatedAPI(List<Doc> deprmembers, String headingKey, String tableSummary, String[] tableHeader) {
+    protected void addDeprecatedAPI(List<Doc> deprmembers, String headingKey,
+            String tableSummary, String[] tableHeader, Content contentTree) {
         if (deprmembers.size() > 0) {
-            writer.tableIndexSummary(tableSummary);
-            writer.tableCaptionStart();
-            writer.printText(headingKey);
-            writer.tableCaptionEnd();
-            writer.summaryTableHeader(tableHeader, "col");
+            Content table = HtmlTree.TABLE(0, 3, 0, tableSummary,
+                writer.getTableCaption(configuration().getText(headingKey)));
+            table.addContent(writer.getSummaryTableHeader(tableHeader, "col"));
+            Content tbody = new HtmlTree(HtmlTag.TBODY);
             for (int i = 0; i < deprmembers.size(); i++) {
                 ProgramElementDoc member =(ProgramElementDoc)deprmembers.get(i);
-                writer.trBgcolorStyle("white", "TableRowColor");
-                writer.summaryRow(0);
-                writeDeprecatedLink(member);
-                writer.br();
-                writer.printNbsps();
+                HtmlTree td = HtmlTree.TD(HtmlStyle.colOne, getDeprecatedLink(member));
                 if (member.tags("deprecated").length > 0)
-                    writer.printInlineDeprecatedComment(member, member.tags("deprecated")[0]);
-                writer.space();
-                writer.summaryRowEnd();
-                writer.trEnd();
+                    writer.addInlineDeprecatedComment(member,
+                            member.tags("deprecated")[0], td);
+                HtmlTree tr = HtmlTree.TR(td);
+                if (i%2 == 0)
+                    tr.addStyle(HtmlStyle.altColor);
+                else
+                    tr.addStyle(HtmlStyle.rowColor);
+                tbody.addContent(tr);
             }
-            writer.tableEnd();
-            writer.space();
-            writer.p();
+            table.addContent(tbody);
+            Content li = HtmlTree.LI(HtmlStyle.blockList, table);
+            Content ul = HtmlTree.UL(HtmlStyle.blockList, li);
+            contentTree.addContent(ul);
         }
     }
 
     /**
-     * Print use info.
+     * Add use information to the documentation tree.
+     *
+     * @param mems list of program elements for which the use information will be added
+     * @param heading the section heading
+     * @param tableSummary the summary for the use table
+     * @param contentTree the content tree to which the use information will be added
      */
-    protected void printUseInfo(List<? extends ProgramElementDoc> mems, String heading, String tableSummary) {
+    protected void addUseInfo(List<? extends ProgramElementDoc> mems,
+            String heading, String tableSummary, Content contentTree) {
         if (mems == null) {
             return;
         }
         List<? extends ProgramElementDoc> members = mems;
         boolean printedUseTableHeader = false;
         if (members.size() > 0) {
-            writer.tableIndexSummary(tableSummary);
-            writer.tableSubCaptionStart();
-            writer.print(heading);
-            writer.tableCaptionEnd();
-            for (Iterator<? extends ProgramElementDoc> it = members.iterator(); it.hasNext(); ) {
+            Content table = HtmlTree.TABLE(0, 3, 0, tableSummary,
+                    writer.getTableCaption(heading));
+            Content tbody = new HtmlTree(HtmlTag.TBODY);
+            Iterator<? extends ProgramElementDoc> it = members.iterator();
+            for (int i = 0; it.hasNext(); i++) {
                 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);
+                    table.addContent(writer.getSummaryTableHeader(
+                            this.getSummaryTableHeader(pgmdoc), "col"));
                     printedUseTableHeader = true;
                 }
-
-                writer.printSummaryLinkType(this, pgmdoc);
-                if (cd != null && !(pgmdoc instanceof ConstructorDoc)
-                               && !(pgmdoc instanceof ClassDoc)) {
-                    // Add class context
-                    writer.strong(cd.name() + ".");
+                HtmlTree tr = new HtmlTree(HtmlTag.TR);
+                if (i % 2 == 0) {
+                    tr.addStyle(HtmlStyle.altColor);
+                } else {
+                    tr.addStyle(HtmlStyle.rowColor);
                 }
-                writeSummaryLink(
-                    pgmdoc instanceof ClassDoc ?
-                        LinkInfoImpl.CONTEXT_CLASS_USE : LinkInfoImpl.CONTEXT_MEMBER,
-                    cd, pgmdoc);
-                writer.printSummaryLinkComment(this, pgmdoc);
+                HtmlTree tdFirst = new HtmlTree(HtmlTag.TD);
+                tdFirst.addStyle(HtmlStyle.colFirst);
+                writer.addSummaryType(this, pgmdoc, tdFirst);
+                tr.addContent(tdFirst);
+                HtmlTree tdLast = new HtmlTree(HtmlTag.TD);
+                tdLast.addStyle(HtmlStyle.colLast);
+                if (cd != null && !(pgmdoc instanceof ConstructorDoc)
+                        && !(pgmdoc instanceof ClassDoc)) {
+                    HtmlTree name = new HtmlTree(HtmlTag.SPAN);
+                    name.addStyle(HtmlStyle.strong);
+                    name.addContent(cd.name() + ".");
+                    tdLast.addContent(name);
+                }
+                addSummaryLink(pgmdoc instanceof ClassDoc ?
+                    LinkInfoImpl.CONTEXT_CLASS_USE : LinkInfoImpl.CONTEXT_MEMBER,
+                    cd, pgmdoc, tdLast);
+                writer.addSummaryLinkComment(this, pgmdoc, tdLast);
+                tr.addContent(tdLast);
+                tbody.addContent(tr);
             }
-            writer.tableEnd();
-            writer.space();
-            writer.p();
+            table.addContent(tbody);
+            contentTree.addContent(table);
         }
     }
 
-    protected void navDetailLink(List<?> members) {
-            printNavDetailLink(members.size() > 0? true: false);
+    /**
+     * Add the navigation detail link.
+     *
+     * @param members the members to be linked
+     * @param liNav the content tree to which the navigation detail link will be added
+     */
+    protected void addNavDetailLink(List<?> members, Content liNav) {
+        addNavDetailLink(members.size() > 0 ? true : false, liNav);
     }
 
-
-    protected void navSummaryLink(List<?> members,
-            VisibleMemberMap visibleMemberMap) {
+    /**
+     * Add the navigation summary link.
+     *
+     * @param members members to be linked
+     * @param visibleMemberMap the visible inherited members map
+     * @param liNav the content tree to which the navigation summary link will be added
+     */
+    protected void addNavSummaryLink(List<?> members,
+            VisibleMemberMap visibleMemberMap, Content liNav) {
         if (members.size() > 0) {
-            printNavSummaryLink(null, true);
+            liNav.addContent(getNavSummaryLink(null, true));
             return;
-        } else {
-            ClassDoc icd = classdoc.superclass();
-            while (icd != null) {
-                List<?> inhmembers = visibleMemberMap.getMembersFor(icd);
-                if (inhmembers.size() > 0) {
-                    printNavSummaryLink(icd, true);
-                    return;
-                }
-                icd = icd.superclass();
+        }
+        ClassDoc icd = classdoc.superclass();
+        while (icd != null) {
+            List<?> inhmembers = visibleMemberMap.getMembersFor(icd);
+            if (inhmembers.size() > 0) {
+                liNav.addContent(getNavSummaryLink(icd, true));
+                return;
             }
+            icd = icd.superclass();
         }
-        printNavSummaryLink(null, false);
+        liNav.addContent(getNavSummaryLink(null, false));
     }
 
     protected void serialWarning(SourcePosition pos, String key, String a1, String a2) {
@@ -453,12 +549,109 @@
     }
 
     /**
-     * {@inheritDoc}
+     * Add the member summary for the given class.
+     *
+     * @param classDoc the class that is being documented
+     * @param member the member being documented
+     * @param firstSentenceTags the first sentence tags to be added to the summary
+     * @param tableTree the content tree to which the documentation will be added
+     * @param counter the counter for determing style for the table row
+     */
+    public void addMemberSummary(ClassDoc classDoc, ProgramElementDoc member,
+            Tag[] firstSentenceTags, Content tableTree, int counter) {
+        HtmlTree tdSummaryType = new HtmlTree(HtmlTag.TD);
+        tdSummaryType.addStyle(HtmlStyle.colFirst);
+        writer.addSummaryType(this, member, tdSummaryType);
+        HtmlTree tdSummary = new HtmlTree(HtmlTag.TD);
+        setSummaryColumnStyle(tdSummary);
+        addSummaryLink(classDoc, member, tdSummary);
+        writer.addSummaryLinkComment(this, member, firstSentenceTags, tdSummary);
+        HtmlTree tr = HtmlTree.TR(tdSummaryType);
+        tr.addContent(tdSummary);
+        if (counter%2 == 0)
+            tr.addStyle(HtmlStyle.altColor);
+        else
+            tr.addStyle(HtmlStyle.rowColor);
+        tableTree.addContent(tr);
+    }
+
+    /**
+     * Set the style for the summary column.
+     *
+     * @param tdTree the column for which the style will be set
+     */
+    public void setSummaryColumnStyle(HtmlTree tdTree) {
+        tdTree.addStyle(HtmlStyle.colLast);
+    }
+
+    /**
+     * Add inherited member summary for the given class and member.
+     *
+     * @param classDoc the class the inherited member belongs to
+     * @param nestedClass the inherited member that is summarized
+     * @param isFirst true if this is the first member in the list
+     * @param isLast true if this is the last member in the list
+     * @param linksTree the content tree to which the summary will be added
      */
-    public void writeMemberSummary(ClassDoc classDoc, ProgramElementDoc member,
-        Tag[] firstSentenceTags, boolean isFirst, boolean isLast) {
-        writer.printSummaryLinkType(this, member);
-        writeSummaryLink(classDoc, member);
-        writer.printSummaryLinkComment(this, member, firstSentenceTags);
+    public void addInheritedMemberSummary(ClassDoc classDoc,
+            ProgramElementDoc nestedClass, boolean isFirst, boolean isLast,
+            Content linksTree) {
+        writer.addInheritedMemberSummary(this, classDoc, nestedClass, isFirst,
+                linksTree);
+    }
+
+    /**
+     * Get the inherited summary header for the given class.
+     *
+     * @param classDoc the class the inherited member belongs to
+     * @return a content tree for the inherited summary header
+     */
+    public Content getInheritedSummaryHeader(ClassDoc classDoc) {
+        Content inheritedTree = writer.getMemberTreeHeader();
+        writer.addInheritedSummaryHeader(this, classDoc, inheritedTree);
+        return inheritedTree;
+    }
+
+    /**
+     * Get the inherited summary links tree.
+     *
+     * @return a content tree for the inherited summary links
+     */
+    public Content getInheritedSummaryLinksTree() {
+        return new HtmlTree(HtmlTag.CODE);
+    }
+
+    /**
+     * Get the summary table tree for the given class.
+     *
+     * @param classDoc the class for which the summary table is generated
+     * @return a content tree for the summary table
+     */
+    public Content getSummaryTableTree(ClassDoc classDoc) {
+        return writer.getSummaryTableTree(this, classDoc);
+    }
+
+    /**
+     * Get the member tree to be documented.
+     *
+     * @param memberTree the content tree of member to be documented
+     * @return a content tree that will be added to the class documentation
+     */
+    public Content getMemberTree(Content memberTree) {
+        return writer.getMemberTree(memberTree);
+    }
+
+    /**
+     * Get the member tree to be documented.
+     *
+     * @param memberTree the content tree of member to be documented
+     * @param isLastContent true if the content to be added is the last content
+     * @return a content tree that will be added to the class documentation
+     */
+    public Content getMemberTree(Content memberTree, boolean isLastContent) {
+        if (isLastContent)
+            return HtmlTree.UL(HtmlStyle.blockListLast, memberTree);
+        else
+            return HtmlTree.UL(HtmlStyle.blockList, memberTree);
     }
 }
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractPackageIndexWriter.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractPackageIndexWriter.java	Mon Dec 20 21:10:57 2010 -0800
@@ -25,9 +25,11 @@
 
 package com.sun.tools.doclets.formats.html;
 
-import com.sun.javadoc.*;
 import java.io.*;
 import java.util.*;
+import com.sun.javadoc.*;
+import com.sun.tools.doclets.formats.html.markup.*;
+import com.sun.tools.doclets.internal.toolkit.*;
 
 /**
  * Abstract class to generate the overview files in
@@ -56,105 +58,127 @@
         packages = configuration.packages;
     }
 
-    protected abstract void printNavigationBarHeader();
-
-    protected abstract void printNavigationBarFooter();
-
-    protected abstract void printOverviewHeader();
+    /**
+     * Adds the navigation bar header to the documentation tree.
+     *
+     * @param body the document tree to which the navigation bar header will be added
+     */
+    protected abstract void addNavigationBarHeader(Content body);
 
-    protected abstract void printIndexHeader(String text, String tableSummary);
-
-    protected abstract void printIndexRow(PackageDoc pkg);
-
-    protected abstract void printIndexFooter();
+    /**
+     * Adds the navigation bar footer to the documentation tree.
+     *
+     * @param body the document tree to which the navigation bar footer will be added
+     */
+    protected abstract void addNavigationBarFooter(Content body);
 
     /**
-     * Generate the contants in the package index file. Call appropriate
+     * Adds the overview header to the documentation tree.
+     *
+     * @param body the document tree to which the overview header will be added
+     */
+    protected abstract void addOverviewHeader(Content body);
+
+    /**
+     * Adds the packages list to the documentation tree.
+     *
+     * @param packages an array of packagedoc objects
+     * @param text caption for the table
+     * @param tableSummary summary for the table
+     * @param body the document tree to which the packages list will be added
+     */
+    protected abstract void addPackagesList(PackageDoc[] packages, String text,
+            String tableSummary, Content body);
+
+    /**
+     * Generate and prints the contents in the package index file. Call appropriate
      * methods from the sub-class in order to generate Frame or Non
      * Frame format.
+     *
      * @param title the title of the window.
      * @param includeScript boolean set true if windowtitle script is to be included
      */
-    protected void generatePackageIndexFile(String title, boolean includeScript) throws IOException {
+    protected void buildPackageIndexFile(String title, boolean includeScript) throws IOException {
         String windowOverview = configuration.getText(title);
-        printHtmlHeader(windowOverview,
-            configuration.metakeywords.getOverviewMetaKeywords(title,
-                configuration.doctitle),
-            includeScript);
-        printNavigationBarHeader();
-        printOverviewHeader();
-
-        generateIndex();
-
-        printOverview();
-
-        printNavigationBarFooter();
-        printBodyHtmlEnd();
+        Content body = getBody(includeScript, getWindowTitle(windowOverview));
+        addNavigationBarHeader(body);
+        addOverviewHeader(body);
+        addIndex(body);
+        addOverview(body);
+        addNavigationBarFooter(body);
+        printHtmlDocument(configuration.metakeywords.getOverviewMetaKeywords(title,
+                configuration.doctitle), includeScript, body);
     }
 
     /**
-     * Default to no overview, overwrite to add overview.
+     * Default to no overview, override to add overview.
+     *
+     * @param body the document tree to which the overview will be added
      */
-    protected void printOverview() throws IOException {
+    protected void addOverview(Content body) throws IOException {
     }
 
     /**
-     * Generate the frame or non-frame package index.
+     * Adds the frame or non-frame package index to the documentation tree.
+     *
+     * @param body the document tree to which the index will be added
      */
-    protected void generateIndex() {
-        printIndexContents(packages, "doclet.Package_Summary",
+    protected void addIndex(Content body) {
+        addIndexContents(packages, "doclet.Package_Summary",
                 configuration.getText("doclet.Member_Table_Summary",
                 configuration.getText("doclet.Package_Summary"),
-                configuration.getText("doclet.packages")));
+                configuration.getText("doclet.packages")), body);
     }
 
     /**
-     * Generate code for package index contents. Call appropriate methods from
-     * the sub-classes.
+     * Adds package index contents. Call appropriate methods from
+     * the sub-classes. Adds it to the body HtmlTree
      *
-     * @param packages Array of packages to be documented.
-     * @param text     String which will be used as the heading.
+     * @param packages array of packages to be documented
+     * @param text string which will be used as the heading
+     * @param tableSummary summary for the table
+     * @param body the document tree to which the index contents will be added
      */
-    protected void printIndexContents(PackageDoc[] packages, String text, String tableSummary) {
+    protected void addIndexContents(PackageDoc[] packages, String text,
+            String tableSummary, Content body) {
         if (packages.length > 0) {
             Arrays.sort(packages);
-            printIndexHeader(text, tableSummary);
-            printAllClassesPackagesLink();
-            for(int i = 0; i < packages.length; i++) {
-                if (packages[i] != null) {
-                    printIndexRow(packages[i]);
-                }
-            }
-            printIndexFooter();
+            addAllClassesLink(body);
+            addPackagesList(packages, text, tableSummary, body);
         }
     }
 
     /**
-     * Print the doctitle, if it is specified on the command line.
+     * Adds the doctitle to the documentation tree, if it is specified on the command line.
+     *
+     * @param body the document tree to which the title will be added
      */
-    protected void printConfigurationTitle() {
+    protected void addConfigurationTitle(Content body) {
         if (configuration.doctitle.length() > 0) {
-            center();
-            h1(configuration.doctitle);
-            centerEnd();
+            Content title = new RawHtml(configuration.doctitle);
+            Content heading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING,
+                    HtmlStyle.title, title);
+            Content div = HtmlTree.DIV(HtmlStyle.header, heading);
+            body.addContent(div);
         }
     }
 
     /**
-     * Highlight "Overview" in the strong format, in the navigation bar as this
-     * is the overview page.
+     * Returns highlighted "Overview", in the navigation bar as this is the
+     * overview page.
+     *
+     * @return a Content object to be added to the documentation tree
      */
-    protected void navLinkContents() {
-        navCellRevStart();
-        fontStyle("NavBarFont1Rev");
-        strongText("doclet.Overview");
-        fontEnd();
-        navCellEnd();
+    protected Content getNavLinkContents() {
+        Content li = HtmlTree.LI(HtmlStyle.navBarCell1Rev, overviewLabel);
+        return li;
     }
 
     /**
      * Do nothing. This will be overridden in PackageIndexFrameWriter.
+     *
+     * @param body the document tree to which the all classes link will be added
      */
-    protected void printAllClassesPackagesLink() {
+    protected void addAllClassesLink(Content body) {
     }
 }
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractTreeWriter.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractTreeWriter.java	Mon Dec 20 21:10:57 2010 -0800
@@ -25,11 +25,12 @@
 
 package com.sun.tools.doclets.formats.html;
 
-import com.sun.tools.doclets.internal.toolkit.util.*;
-
-import com.sun.javadoc.*;
 import java.io.*;
 import java.util.*;
+import com.sun.tools.doclets.internal.toolkit.util.*;
+import com.sun.tools.doclets.internal.toolkit.*;
+import com.sun.tools.doclets.formats.html.markup.*;
+import com.sun.javadoc.*;
 
 /**
  * Abstract class to print the class hierarchy page for all the Classes. This
@@ -46,6 +47,8 @@
      */
     protected final ClassTree classtree;
 
+    private static final String LI_CIRCLE  = "circle";
+
     /**
      * Constructor initilises classtree variable. This constructor will be used
      * while generating global tree file "overview-tree.html".
@@ -87,55 +90,64 @@
     }
 
     /**
-     * Generate each level of the class tree. For each sub-class or
+     * Add each level of the class tree. For each sub-class or
      * sub-interface indents the next level information.
-     * Recurses itself to generate subclasses info.
-     * To iterate is human, to recurse is divine - L. Peter Deutsch.
+     * Recurses itself to add subclasses info.
      *
-     * @param parent the superclass or superinterface of the list.
-     * @param list list of the sub-classes at this level.
-     * @param isEnum true if we are generating a tree for enums.
+     * @param parent the superclass or superinterface of the list
+     * @param list list of the sub-classes at this level
+     * @param isEnum true if we are generating a tree for enums
+     * @param contentTree the content tree to which the level information will be added
      */
-    protected void generateLevelInfo(ClassDoc parent, List<ClassDoc> list,
-            boolean isEnum) {
-        if (list.size() > 0) {
-            ul();
-            for (int i = 0; i < list.size(); i++) {
+    protected void addLevelInfo(ClassDoc parent, List<ClassDoc> list,
+            boolean isEnum, Content contentTree) {
+        int size = list.size();
+        if (size > 0) {
+            Content ul = new HtmlTree(HtmlTag.UL);
+            for (int i = 0; i < size; i++) {
                 ClassDoc local = list.get(i);
-                printPartialInfo(local);
-                printExtendsImplements(parent, local);
-                generateLevelInfo(local, classtree.subs(local, isEnum),
-                    isEnum);   // Recurse
+                HtmlTree li = new HtmlTree(HtmlTag.LI);
+                li.addAttr(HtmlAttr.TYPE, LI_CIRCLE);
+                addPartialInfo(local, li);
+                addExtendsImplements(parent, local, li);
+                addLevelInfo(local, classtree.subs(local, isEnum),
+                        isEnum, li);   // Recurse
+                ul.addContent(li);
             }
-            ulEnd();
+            contentTree.addContent(ul);
         }
     }
 
     /**
-     * Generate the heading for the tree depending upon tree type if it's a
-     * Class Tree or Interface tree and also print the tree.
+     * Add the heading for the tree depending upon tree type if it's a
+     * Class Tree or Interface tree.
      *
      * @param list List of classes which are at the most base level, all the
-     * other classes in this run will derive from these classes.
-     * @param heading Heading for the tree.
+     * other classes in this run will derive from these classes
+     * @param heading heading for the tree
+     * @param div the content tree to which the tree will be added
      */
-    protected void generateTree(List<ClassDoc> list, String heading) {
+    protected void addTree(List<ClassDoc> list, String heading, Content div) {
         if (list.size() > 0) {
             ClassDoc firstClassDoc = list.get(0);
-            printTreeHeading(heading);
-            generateLevelInfo(!firstClassDoc.isInterface()? firstClassDoc : null,
-                list,
-                list == classtree.baseEnums());
+            Content headingContent = getResource(heading);
+            div.addContent(HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, true,
+                    headingContent));
+            addLevelInfo(!firstClassDoc.isInterface()? firstClassDoc : null,
+                    list, list == classtree.baseEnums(), div);
         }
     }
 
     /**
-     * Print the information regarding the classes which this class extends or
+     * Add information regarding the classes which this class extends or
      * implements.
      *
-     * @param cd The classdoc under consideration.
+     * @param parent the parent class of the class being documented
+     * @param cd the classdoc under consideration
+     * @param contentTree the content tree to which the information will be added
      */
-    protected void printExtendsImplements(ClassDoc parent, ClassDoc cd) {
+    protected void addExtendsImplements(ClassDoc parent, ClassDoc cd,
+            Content contentTree) {
         ClassDoc[] interfaces = cd.interfaces();
         if (interfaces.length > (cd.isInterface()? 1 : 0)) {
             Arrays.sort(interfaces);
@@ -148,53 +160,43 @@
                     }
                     if (counter == 0) {
                         if (cd.isInterface()) {
-                            print(" (" + configuration.getText("doclet.also") + " extends ");
+                            contentTree.addContent(" (");
+                            contentTree.addContent(getResource("doclet.also"));
+                            contentTree.addContent(" extends ");
                         } else {
-                            print(" (implements ");
+                            contentTree.addContent(" (implements ");
                         }
                     } else {
-                        print(", ");
+                        contentTree.addContent(", ");
                     }
-                    printPreQualifiedClassLink(LinkInfoImpl.CONTEXT_TREE,
-                        interfaces[i]);
+                    addPreQualifiedClassLink(LinkInfoImpl.CONTEXT_TREE,
+                            interfaces[i], contentTree);
                     counter++;
                 }
             }
             if (counter > 0) {
-                println(")");
+                contentTree.addContent(")");
             }
         }
     }
 
     /**
-     * Print information about the class kind, if it's a "class" or "interface".
+     * Add information about the class kind, if it's a "class" or "interface".
      *
-     * @param cd classdoc.
+     * @param cd the class being documented
+     * @param contentTree the content tree to which the information will be added
      */
-    protected void printPartialInfo(ClassDoc cd) {
-        li("circle");
-        printPreQualifiedStrongClassLink(LinkInfoImpl.CONTEXT_TREE, cd);
+    protected void addPartialInfo(ClassDoc cd, Content contentTree) {
+        addPreQualifiedStrongClassLink(LinkInfoImpl.CONTEXT_TREE, cd, contentTree);
     }
 
     /**
-     * Print the heading for the tree.
+     * Get the tree label for the navigation bar.
      *
-     * @param heading Heading for the tree.
+     * @return a content tree for the tree label
      */
-    protected void printTreeHeading(String heading) {
-        h2();
-        println(configuration.getText(heading));
-        h2End();
-    }
-
-    /**
-     * Highlight "Tree" word in the navigation bar, since this is the tree page.
-     */
-    protected void navLinkTree() {
-        navCellRevStart();
-        fontStyle("NavBarFont1Rev");
-        strongText("doclet.Tree");
-        fontEnd();
-        navCellEnd();
+    protected Content getNavLinkTree() {
+        Content li = HtmlTree.LI(HtmlStyle.navBarCell1Rev, treeLabel);
+        return li;
     }
 }
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AllClassesFrameWriter.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AllClassesFrameWriter.java	Mon Dec 20 21:10:57 2010 -0800
@@ -25,11 +25,14 @@
 
 package com.sun.tools.doclets.formats.html;
 
-import com.sun.tools.doclets.internal.toolkit.util.*;
-import com.sun.javadoc.*;
 import java.io.*;
 import java.util.*;
 
+import com.sun.javadoc.*;
+import com.sun.tools.doclets.internal.toolkit.*;
+import com.sun.tools.doclets.internal.toolkit.util.*;
+import com.sun.tools.doclets.formats.html.markup.*;
+
 /**
  * Generate the file with list of all the classes in this run. This page will be
  * used in the left-hand bottom frame, when "All Classes" link is clicked in
@@ -38,6 +41,7 @@
  *
  * @author Atul M Dambalkar
  * @author Doug Kramer
+ * @author Bhavesh Patel (Modified)
  */
 public class AllClassesFrameWriter extends HtmlDocletWriter {
 
@@ -57,6 +61,11 @@
     protected IndexBuilder indexbuilder;
 
     /**
+     * BR tag to be used within a document tree.
+     */
+    final HtmlTree BR = new HtmlTree(HtmlTag.BR);
+
+    /**
      * Construct AllClassesFrameWriter object. Also initilises the indexbuilder
      * variable in this class.
      * @throws IOException
@@ -84,12 +93,12 @@
         try {
             allclassgen = new AllClassesFrameWriter(configuration,
                                                     filename, indexbuilder);
-            allclassgen.generateAllClassesFile(true);
+            allclassgen.buildAllClassesFile(true);
             allclassgen.close();
             filename = OUTPUT_FILE_NAME_NOFRAMES;
             allclassgen = new AllClassesFrameWriter(configuration,
                                                     filename, indexbuilder);
-            allclassgen.generateAllClassesFile(false);
+            allclassgen.buildAllClassesFile(false);
             allclassgen.close();
         } catch (IOException exc) {
             configuration.standardmessage.
@@ -100,30 +109,34 @@
     }
 
     /**
-     * Print all the classes in table format in the file.
+     * Print all the classes in the file.
      * @param wantFrames True if we want frames.
      */
-    protected void generateAllClassesFile(boolean wantFrames) throws IOException {
+    protected void buildAllClassesFile(boolean wantFrames) throws IOException {
         String label = configuration.getText("doclet.All_Classes");
-
-        printHtmlHeader(label, null, false);
-
-        printAllClassesTableHeader();
-        printAllClasses(wantFrames);
-        printAllClassesTableFooter();
-
-        printBodyHtmlEnd();
+        Content body = getBody(false, getWindowTitle(label));
+        Content heading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING,
+                HtmlStyle.bar, allclassesLabel);
+        body.addContent(heading);
+        Content ul = new HtmlTree(HtmlTag.UL);
+        // Generate the class links and add it to the tdFont tree.
+        addAllClasses(ul, wantFrames);
+        Content div = HtmlTree.DIV(HtmlStyle.indexContainer, ul);
+        body.addContent(div);
+        printHtmlDocument(null, false, body);
     }
 
     /**
-     * Use the sorted index of all the classes and print all the classes.
+     * Use the sorted index of all the classes and add all the classes to the
+     * content list.
      *
+     * @param content HtmlTree content to which all classes information will be added
      * @param wantFrames True if we want frames.
      */
-    protected void printAllClasses(boolean wantFrames) {
+    protected void addAllClasses(Content content, boolean wantFrames) {
         for (int i = 0; i < indexbuilder.elements().length; i++) {
             Character unicode = (Character)((indexbuilder.elements())[i]);
-            generateContents(indexbuilder.getMemberList(unicode), wantFrames);
+            addContents(indexbuilder.getMemberList(unicode), wantFrames, content);
         }
     }
 
@@ -136,46 +149,25 @@
      *
      * @param classlist Sorted list of classes.
      * @param wantFrames True if we want frames.
+     * @param content HtmlTree content to which the links will be added
      */
-    protected void generateContents(List<Doc> classlist, boolean wantFrames) {
+    protected void addContents(List<Doc> classlist, boolean wantFrames,
+            Content content) {
         for (int i = 0; i < classlist.size(); i++) {
             ClassDoc cd = (ClassDoc)classlist.get(i);
             if (!Util.isCoreClass(cd)) {
                 continue;
             }
             String label = italicsClassName(cd, false);
+            Content linkContent;
             if(wantFrames){
-                printLink(new LinkInfoImpl(LinkInfoImpl.ALL_CLASSES_FRAME, cd,
-                    label, "classFrame")
-                );
+                linkContent = new RawHtml(getLink(new LinkInfoImpl(
+                        LinkInfoImpl.ALL_CLASSES_FRAME, cd, label, "classFrame")));
             } else {
-                printLink(new LinkInfoImpl(cd, label));
+                linkContent = new RawHtml(getLink(new LinkInfoImpl(cd, label)));
             }
-            br();
+            Content li = HtmlTree.LI(linkContent);
+            content.addContent(li);
         }
     }
-
-    /**
-     * Print the heading "All Classes" and also print Html table tag.
-     */
-    protected void printAllClassesTableHeader() {
-        fontSizeStyle("+1", "FrameHeadingFont");
-        strongText("doclet.All_Classes");
-        fontEnd();
-        br();
-        table();
-        tr();
-        tdNowrap();
-        fontStyle("FrameItemFont");
-    }
-
-    /**
-     * Print Html closing table tag.
-     */
-    protected void printAllClassesTableFooter() {
-        fontEnd();
-        tdEnd();
-        trEnd();
-        tableEnd();
-    }
 }
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeOptionalMemberWriterImpl.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeOptionalMemberWriterImpl.java	Mon Dec 20 21:10:57 2010 -0800
@@ -28,6 +28,7 @@
 import java.io.*;
 
 import com.sun.javadoc.*;
+import com.sun.tools.doclets.formats.html.markup.*;
 import com.sun.tools.doclets.internal.toolkit.*;
 
 /**
@@ -54,29 +55,26 @@
     /**
      * {@inheritDoc}
      */
-    public void writeMemberSummaryHeader(ClassDoc classDoc) {
-        writer.println("<!-- =========== ANNOTATION TYPE OPTIONAL MEMBER SUMMARY =========== -->");
-        writer.println();
-        writer.printSummaryHeader(this, classDoc);
+    public Content getMemberSummaryHeader(ClassDoc classDoc,
+            Content memberSummaryTree) {
+        memberSummaryTree.addContent(
+                HtmlConstants.START_OF_ANNOTATION_TYPE_OPTIONAL_MEMBER_SUMMARY);
+        Content memberTree = writer.getMemberTreeHeader();
+        writer.addSummaryHeader(this, classDoc, memberTree);
+        return memberTree;
     }
 
     /**
      * {@inheritDoc}
      */
-    public void writeDefaultValueInfo(MemberDoc member) {
+    public void addDefaultValueInfo(MemberDoc member, Content annotationDocTree) {
         if (((AnnotationTypeElementDoc) member).defaultValue() != null) {
-            writer.printMemberDetailsListStartTag();
-            writer.dd();
-            writer.dl();
-            writer.dt();
-            writer.strong(ConfigurationImpl.getInstance().
-                getText("doclet.Default"));
-            writer.dtEnd();
-            writer.dd();
-            writer.print(((AnnotationTypeElementDoc) member).defaultValue());
-            writer.ddEnd();
-            writer.dlEnd();
-            writer.ddEnd();
+            Content dt = HtmlTree.DT(writer.getResource("doclet.Default"));
+            Content dl = HtmlTree.DL(dt);
+            Content dd = HtmlTree.DD(new StringContent(
+                    ((AnnotationTypeElementDoc) member).defaultValue().toString()));
+            dl.addContent(dd);
+            annotationDocTree.addContent(dl);
         }
     }
 
@@ -90,45 +88,58 @@
     /**
      * {@inheritDoc}
      */
-    public void printSummaryLabel() {
-        writer.printText("doclet.Annotation_Type_Optional_Member_Summary");
+    public void addSummaryLabel(Content memberTree) {
+        Content label = HtmlTree.HEADING(HtmlConstants.SUMMARY_HEADING,
+                writer.getResource("doclet.Annotation_Type_Optional_Member_Summary"));
+        memberTree.addContent(label);
     }
 
     /**
      * {@inheritDoc}
      */
-    public void printTableSummary() {
-        writer.tableIndexSummary(configuration().getText("doclet.Member_Table_Summary",
+    public String getTableSummary() {
+        return configuration().getText("doclet.Member_Table_Summary",
                 configuration().getText("doclet.Annotation_Type_Optional_Member_Summary"),
-                configuration().getText("doclet.annotation_type_optional_members")));
+                configuration().getText("doclet.annotation_type_optional_members"));
     }
 
-    public void printSummaryTableHeader(ProgramElementDoc member) {
+    /**
+     * {@inheritDoc}
+     */
+    public String getCaption() {
+        return configuration().getText("doclet.Annotation_Type_Optional_Members");
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public String[] getSummaryTableHeader(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");
+        return header;
     }
 
     /**
      * {@inheritDoc}
      */
-    public void printSummaryAnchor(ClassDoc cd) {
-        writer.anchor("annotation_type_optional_element_summary");
+    public void addSummaryAnchor(ClassDoc cd, Content memberTree) {
+        memberTree.addContent(writer.getMarkerAnchor(
+                "annotation_type_optional_element_summary"));
     }
 
     /**
      * {@inheritDoc}
      */
-    protected void printNavSummaryLink(ClassDoc cd, boolean link) {
+    protected Content getNavSummaryLink(ClassDoc cd, boolean link) {
         if (link) {
-            writer.printHyperLink("", "annotation_type_optional_element_summary",
-                    configuration().getText("doclet.navAnnotationTypeOptionalMember"));
+            return writer.getHyperLink("", "annotation_type_optional_element_summary",
+                    writer.getResource("doclet.navAnnotationTypeOptionalMember"));
         } else {
-            writer.printText("doclet.navAnnotationTypeOptionalMember");
+            return writer.getResource("doclet.navAnnotationTypeOptionalMember");
         }
     }
 }
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeRequiredMemberWriterImpl.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeRequiredMemberWriterImpl.java	Mon Dec 20 21:10:57 2010 -0800
@@ -28,6 +28,7 @@
 import java.io.*;
 
 import com.sun.javadoc.*;
+import com.sun.tools.doclets.formats.html.markup.*;
 import com.sun.tools.doclets.internal.toolkit.*;
 
 /**
@@ -51,122 +52,102 @@
     }
 
     /**
-     * Write the annotation type member summary header for the given class.
-     *
-     * @param classDoc the class the summary belongs to.
+     * {@inheritDoc}
      */
-    public void writeMemberSummaryHeader(ClassDoc classDoc) {
-        writer.println("<!-- =========== ANNOTATION TYPE REQUIRED MEMBER SUMMARY =========== -->");
-        writer.println();
-        writer.printSummaryHeader(this, classDoc);
-    }
-
-    /**
-     * Write the annotation type member summary footer for the given class.
-     *
-     * @param classDoc the class the summary belongs to.
-     */
-    public void writeMemberSummaryFooter(ClassDoc classDoc) {
-        writer.printSummaryFooter(this, classDoc);
+    public Content getMemberSummaryHeader(ClassDoc classDoc,
+            Content memberSummaryTree) {
+        memberSummaryTree.addContent(
+                HtmlConstants.START_OF_ANNOTATION_TYPE_REQUIRED_MEMBER_SUMMARY);
+        Content memberTree = writer.getMemberTreeHeader();
+        writer.addSummaryHeader(this, classDoc, memberTree);
+        return memberTree;
     }
 
     /**
      * {@inheritDoc}
      */
-    public void writeInheritedMemberSummaryHeader(ClassDoc classDoc) {
-        //Not appliable.
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public void writeInheritedMemberSummary(ClassDoc classDoc,
-        ProgramElementDoc member, boolean isFirst, boolean isLast) {
-        //Not appliable.
+    public void addAnnotationDetailsTreeHeader(ClassDoc classDoc,
+            Content memberDetailsTree) {
+        if (!writer.printedAnnotationHeading) {
+            memberDetailsTree.addContent(writer.getMarkerAnchor(
+                    "annotation_type_element_detail"));
+            Content heading = HtmlTree.HEADING(HtmlConstants.DETAILS_HEADING,
+                    writer.annotationTypeDetailsLabel);
+            memberDetailsTree.addContent(heading);
+            writer.printedAnnotationHeading = true;
+        }
     }
 
     /**
      * {@inheritDoc}
      */
-    public void writeInheritedMemberSummaryFooter(ClassDoc classDoc) {
-        //Not appliable.
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public void writeHeader(ClassDoc classDoc, String header) {
-        writer.println();
-        writer.println("<!-- ============ ANNOTATION TYPE MEMBER DETAIL =========== -->");
-        writer.println();
-        writer.anchor("annotation_type_element_detail");
-        writer.printTableHeadingBackground(header);
-        writer.println();
+    public Content getAnnotationDocTreeHeader(MemberDoc member,
+            Content annotationDetailsTree) {
+        annotationDetailsTree.addContent(
+                writer.getMarkerAnchor(member.name() +
+                ((ExecutableMemberDoc) member).signature()));
+        Content annotationDocTree = writer.getMemberTreeHeader();
+        Content heading = new HtmlTree(HtmlConstants.MEMBER_HEADING);
+        heading.addContent(member.name());
+        annotationDocTree.addContent(heading);
+        return annotationDocTree;
     }
 
     /**
      * {@inheritDoc}
      */
-    public void writeMemberHeader(MemberDoc member, boolean isFirst) {
-        if (! isFirst) {
-            writer.printMemberHeader();
-            writer.println("");
+    public Content getSignature(MemberDoc member) {
+        Content pre = new HtmlTree(HtmlTag.PRE);
+        writer.addAnnotationInfo(member, pre);
+        addModifiers(member, pre);
+        Content link = new RawHtml(
+                writer.getLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_MEMBER,
+                getType(member))));
+        pre.addContent(link);
+        pre.addContent(writer.getSpace());
+        if (configuration().linksource) {
+            Content memberName = new StringContent(member.name());
+            writer.addSrcLink(member, memberName, pre);
+        } else {
+            addName(member.name(), pre);
         }
-        writer.anchor(member.name() + ((ExecutableMemberDoc) member).signature());
-        writer.h3();
-        writer.print(member.name());
-        writer.h3End();
+        return pre;
     }
 
     /**
      * {@inheritDoc}
      */
-    public void writeSignature(MemberDoc member) {
-        writer.pre();
-        writer.writeAnnotationInfo(member);
-        printModifiers(member);
-        writer.printLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_MEMBER,
-            getType(member)));
-        print(' ');
-        if (configuration().linksource) {
-            writer.printSrcLink(member, member.name());
-        } else {
-            strong(member.name());
-        }
-        writer.preEnd();
-        assert !writer.getMemberDetailsListPrinted();
+    public void addDeprecated(MemberDoc member, Content annotationDocTree) {
+        addDeprecatedInfo(member, annotationDocTree);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public void addComments(MemberDoc member, Content annotationDocTree) {
+        addComment(member, annotationDocTree);
     }
 
     /**
      * {@inheritDoc}
      */
-    public void writeComments(MemberDoc member) {
-        printComment(member);
-    }
-
-    /**
-     * Write the tag output for the given member.
-     *
-     * @param member the member being documented.
-     */
-    public void writeTags(MemberDoc member) {
-        writer.printTags(member);
+    public void addTags(MemberDoc member, Content annotationDocTree) {
+        writer.addTagsInfo(member, annotationDocTree);
     }
 
     /**
-     * Write the annotation type member footer.
+     * {@inheritDoc}
      */
-    public void writeMemberFooter() {
-        printMemberFooter();
+    public Content getAnnotationDetails(Content annotationDetailsTree) {
+        return getMemberTree(annotationDetailsTree);
     }
 
     /**
-     * Write the footer for the annotation type member documentation.
-     *
-     * @param classDoc the class that the annotation type member belong to.
+     * {@inheritDoc}
      */
-    public void writeFooter(ClassDoc classDoc) {
-        //No footer to write for annotation type member documentation
+    public Content getAnnotationDoc(Content annotationDocTree,
+            boolean isLastContent) {
+        return getMemberTree(annotationDocTree, isLastContent);
     }
 
     /**
@@ -179,113 +160,120 @@
     /**
      * {@inheritDoc}
      */
-    public void printSummaryLabel() {
-        writer.printText("doclet.Annotation_Type_Required_Member_Summary");
+    public void addSummaryLabel(Content memberTree) {
+        Content label = HtmlTree.HEADING(HtmlConstants.SUMMARY_HEADING,
+                writer.getResource("doclet.Annotation_Type_Required_Member_Summary"));
+        memberTree.addContent(label);
     }
 
     /**
      * {@inheritDoc}
      */
-    public void printTableSummary() {
-        writer.tableIndexSummary(configuration().getText("doclet.Member_Table_Summary",
+    public String getTableSummary() {
+        return configuration().getText("doclet.Member_Table_Summary",
                 configuration().getText("doclet.Annotation_Type_Required_Member_Summary"),
-                configuration().getText("doclet.annotation_type_required_members")));
+                configuration().getText("doclet.annotation_type_required_members"));
     }
 
-    public void printSummaryTableHeader(ProgramElementDoc member) {
+    /**
+     * {@inheritDoc}
+     */
+    public String getCaption() {
+        return configuration().getText("doclet.Annotation_Type_Required_Members");
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public String[] getSummaryTableHeader(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");
+        return header;
     }
 
     /**
      * {@inheritDoc}
      */
-    public void printSummaryAnchor(ClassDoc cd) {
-        writer.anchor("annotation_type_required_element_summary");
+    public void addSummaryAnchor(ClassDoc cd, Content memberTree) {
+        memberTree.addContent(writer.getMarkerAnchor(
+                "annotation_type_required_element_summary"));
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public void addInheritedSummaryAnchor(ClassDoc cd, Content inheritedTree) {
     }
 
     /**
      * {@inheritDoc}
      */
-    public void printInheritedSummaryAnchor(ClassDoc cd) {
-    }   // no such
-
-    /**
-     * {@inheritDoc}
-     */
-    public void printInheritedSummaryLabel(ClassDoc cd) {
-        // no such
+    public void addInheritedSummaryLabel(ClassDoc cd, Content inheritedTree) {
     }
 
     /**
      * {@inheritDoc}
      */
-    protected void writeSummaryLink(int context, ClassDoc cd, ProgramElementDoc member) {
-        writer.strong();
-        writer.printDocLink(context, (MemberDoc) member, member.name(), false);
-        writer.strongEnd();
+    protected void addSummaryLink(int context, ClassDoc cd, ProgramElementDoc member,
+            Content tdSummary) {
+        Content strong = HtmlTree.STRONG(new RawHtml(
+                writer.getDocLink(context, (MemberDoc) member, member.name(), false)));
+        Content code = HtmlTree.CODE(strong);
+        tdSummary.addContent(code);
     }
 
     /**
      * {@inheritDoc}
      */
-    protected void writeInheritedSummaryLink(ClassDoc cd,
-            ProgramElementDoc member) {
+    protected void addInheritedSummaryLink(ClassDoc cd,
+            ProgramElementDoc member, Content linksTree) {
         //Not applicable.
     }
 
     /**
      * {@inheritDoc}
      */
-    protected void printSummaryType(ProgramElementDoc member) {
+    protected void addSummaryType(ProgramElementDoc member, Content tdSummaryType) {
         MemberDoc m = (MemberDoc)member;
-        printModifierAndType(m, getType(m));
+        addModifierAndType(m, getType(m), tdSummaryType);
     }
 
     /**
      * {@inheritDoc}
      */
-    protected void writeDeprecatedLink(ProgramElementDoc member) {
-        writer.printDocLink(LinkInfoImpl.CONTEXT_MEMBER,
-            (MemberDoc) member, ((MemberDoc)member).qualifiedName(), false);
+    protected Content getDeprecatedLink(ProgramElementDoc member) {
+        return writer.getDocLink(LinkInfoImpl.CONTEXT_MEMBER,
+                (MemberDoc) member, ((MemberDoc)member).qualifiedName());
     }
 
     /**
      * {@inheritDoc}
      */
-    protected void printNavSummaryLink(ClassDoc cd, boolean link) {
+    protected Content getNavSummaryLink(ClassDoc cd, boolean link) {
         if (link) {
-            writer.printHyperLink("", "annotation_type_required_element_summary",
-                    configuration().getText("doclet.navAnnotationTypeRequiredMember"));
+            return writer.getHyperLink("", "annotation_type_required_element_summary",
+                    writer.getResource("doclet.navAnnotationTypeRequiredMember"));
         } else {
-            writer.printText("doclet.navAnnotationTypeRequiredMember");
+            return writer.getResource("doclet.navAnnotationTypeRequiredMember");
         }
     }
 
     /**
      * {@inheritDoc}
      */
-    protected void printNavDetailLink(boolean link) {
+    protected void addNavDetailLink(boolean link, Content liNav) {
         if (link) {
-            writer.printHyperLink("", "annotation_type_element_detail",
-                configuration().getText("doclet.navAnnotationTypeMember"));
+            liNav.addContent(writer.getHyperLink("", "annotation_type_element_detail",
+                    writer.getResource("doclet.navAnnotationTypeMember")));
         } else {
-            writer.printText("doclet.navAnnotationTypeMember");
+            liNav.addContent(writer.getResource("doclet.navAnnotationTypeMember"));
         }
     }
 
-    /**
-     * {@inheritDoc}
-     */
-    public void writeDeprecated(MemberDoc member) {
-        printDeprecated(member);
-    }
-
     private Type getType(MemberDoc member) {
         if (member instanceof FieldDoc) {
             return ((FieldDoc) member).type();
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeWriterImpl.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeWriterImpl.java	Mon Dec 20 21:10:57 2010 -0800
@@ -29,6 +29,7 @@
 import com.sun.tools.doclets.internal.toolkit.*;
 import com.sun.tools.doclets.internal.toolkit.util.*;
 import com.sun.tools.doclets.internal.toolkit.builders.*;
+import com.sun.tools.doclets.formats.html.markup.*;
 
 /**
  * Generate the Class Information Page.
@@ -40,6 +41,7 @@
  *
  * @author Atul M Dambalkar
  * @author Robert Field
+ * @author Bhavesh Patel (Modified)
  */
 public class AnnotationTypeWriterImpl extends SubWriterHolderWriter
         implements AnnotationTypeWriter {
@@ -69,126 +71,168 @@
     }
 
     /**
-     * Print this package link
+     * Get this package link.
+     *
+     * @return a content tree for the package link
      */
-    protected void navLinkPackage() {
-        navCellStart();
-        printHyperLink("package-summary.html", "",
-            configuration.getText("doclet.Package"), true, "NavBarFont1");
-        navCellEnd();
+    protected Content getNavLinkPackage() {
+        Content linkContent = getHyperLink("package-summary.html", "",
+                packageLabel);
+        Content li = HtmlTree.LI(linkContent);
+        return li;
     }
 
     /**
-     * Print class page indicator
+     * Get the class link.
+     *
+     * @return a content tree for the class link
      */
-    protected void navLinkClass() {
-        navCellRevStart();
-        fontStyle("NavBarFont1Rev");
-        strongText("doclet.Class");
-        fontEnd();
-        navCellEnd();
+    protected Content getNavLinkClass() {
+        Content li = HtmlTree.LI(HtmlStyle.navBarCell1Rev, classLabel);
+        return li;
+    }
+
+    /**
+     * Get the class use link.
+     *
+     * @return a content tree for the class use link
+     */
+    protected Content getNavLinkClassUse() {
+        Content linkContent = getHyperLink("class-use/" + filename, "", useLabel);
+        Content li = HtmlTree.LI(linkContent);
+        return li;
     }
 
     /**
-     * Print class use link
+     * Get link to previous class.
+     *
+     * @return a content tree for the previous class link
      */
-    protected void navLinkClassUse() {
-        navCellStart();
-        printHyperLink("class-use/" + filename, "",
-                       configuration.getText("doclet.navClassUse"), true, "NavBarFont1");
-        navCellEnd();
+    public Content getNavLinkPrevious() {
+        Content li;
+        if (prev != null) {
+            Content prevLink = new RawHtml(getLink(new LinkInfoImpl(
+                    LinkInfoImpl.CONTEXT_CLASS, prev.asClassDoc(), "",
+                    configuration.getText("doclet.Prev_Class"), true)));
+            li = HtmlTree.LI(prevLink);
+        }
+        else
+            li = HtmlTree.LI(prevclassLabel);
+        return li;
     }
 
     /**
-     * Print previous package link
+     * Get link to next class.
+     *
+     * @return a content tree for the next class link
      */
-    protected void navLinkPrevious() {
-        if (prev == null) {
-            printText("doclet.Prev_Class");
-        } else {
-            printLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_CLASS,
-                prev.asClassDoc(), "",
-                configuration.getText("doclet.Prev_Class"), true));
+    public Content getNavLinkNext() {
+        Content li;
+        if (next != null) {
+            Content nextLink = new RawHtml(getLink(new LinkInfoImpl(
+                    LinkInfoImpl.CONTEXT_CLASS, next.asClassDoc(), "",
+                    configuration.getText("doclet.Next_Class"), true)));
+            li = HtmlTree.LI(nextLink);
         }
-    }
-
-    /**
-     * Print next package link
-     */
-    protected void navLinkNext() {
-        if (next == null) {
-            printText("doclet.Next_Class");
-        } else {
-            printLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_CLASS,
-                next.asClassDoc(), "",
-                configuration.getText("doclet.Next_Class"), true));
-        }
+        else
+            li = HtmlTree.LI(nextclassLabel);
+        return li;
     }
 
     /**
      * {@inheritDoc}
      */
-    public void writeHeader(String header) {
-
+    public Content getHeader(String header) {
         String pkgname = (annotationType.containingPackage() != null)?
             annotationType.containingPackage().name(): "";
         String clname = annotationType.name();
+        Content bodyTree = getBody(true, getWindowTitle(clname));
+        addTop(bodyTree);
+        addNavLinks(true, bodyTree);
+        bodyTree.addContent(HtmlConstants.START_OF_CLASS_DATA);
+        HtmlTree div = new HtmlTree(HtmlTag.DIV);
+        div.addStyle(HtmlStyle.header);
+        if (pkgname.length() > 0) {
+            Content pkgNameContent = new StringContent(pkgname);
+            Content pkgNamePara = HtmlTree.P(HtmlStyle.subTitle, pkgNameContent);
+            div.addContent(pkgNamePara);
+        }
+        LinkInfoImpl linkInfo = new LinkInfoImpl(
+                LinkInfoImpl.CONTEXT_CLASS_HEADER, annotationType, false);
+        Content headerContent = new StringContent(header);
+        Content heading = HtmlTree.HEADING(HtmlConstants.CLASS_PAGE_HEADING, true,
+                HtmlStyle.title, headerContent);
+        heading.addContent(new RawHtml(getTypeParameterLinks(linkInfo)));
+        div.addContent(heading);
+        bodyTree.addContent(div);
+        return bodyTree;
+    }
 
-        printHtmlHeader(clname,
-            configuration.metakeywords.getMetaKeywords(annotationType), true);
-        printTop();
-        navLinks(true);
-        hr();
-        println("<!-- ======== START OF CLASS DATA ======== -->");
-        h2();
-        if (pkgname.length() > 0) {
-            font("-1"); print(pkgname); fontEnd(); br();
-        }
-        print(header + getTypeParameterLinks(new LinkInfoImpl(
-            LinkInfoImpl.CONTEXT_CLASS_HEADER,
-            annotationType, false)));
-        h2End();
+    /**
+     * {@inheritDoc}
+     */
+    public Content getAnnotationContentHeader() {
+        return getContentHeader();
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public void addFooter(Content contentTree) {
+        contentTree.addContent(HtmlConstants.END_OF_CLASS_DATA);
+        addNavLinks(false, contentTree);
+        addBottom(contentTree);
     }
 
     /**
      * {@inheritDoc}
      */
-    public void writeFooter() {
-        println("<!-- ========= END OF CLASS DATA ========= -->");
-        hr();
-        navLinks(false);
-        printBottom();
-        printBodyHtmlEnd();
+    public void printDocument(Content contentTree) {
+        printHtmlDocument(configuration.metakeywords.getMetaKeywords(annotationType),
+                true, contentTree);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public Content getAnnotationInfoTreeHeader() {
+        return getMemberTreeHeader();
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public Content getAnnotationInfo(Content annotationInfoTree) {
+        return getMemberTree(HtmlStyle.description, annotationInfoTree);
     }
 
     /**
      * {@inheritDoc}
      */
-    public void writeAnnotationTypeSignature(String modifiers) {
-        preNoNewLine();
-        writeAnnotationInfo(annotationType);
-        print(modifiers);
-        String name = annotationType.name() +
-            getTypeParameterLinks(new LinkInfoImpl(
-                LinkInfoImpl.CONTEXT_CLASS_SIGNATURE, annotationType, false));
+    public void addAnnotationTypeSignature(String modifiers, Content annotationInfoTree) {
+        annotationInfoTree.addContent(new HtmlTree(HtmlTag.BR));
+        Content pre = new HtmlTree(HtmlTag.PRE);
+        addAnnotationInfo(annotationType, pre);
+        pre.addContent(modifiers);
+        LinkInfoImpl linkInfo = new LinkInfoImpl(
+                LinkInfoImpl.CONTEXT_CLASS_SIGNATURE, annotationType, false);
+        Content name = new RawHtml (annotationType.name() +
+                getTypeParameterLinks(linkInfo));
         if (configuration().linksource) {
-            printSrcLink(annotationType, name);
+            addSrcLink(annotationType, name, pre);
         } else {
-            strong(name);
+            pre.addContent(HtmlTree.STRONG(name));
         }
-        preEnd();
-        p();
+        annotationInfoTree.addContent(pre);
     }
 
     /**
      * {@inheritDoc}
      */
-    public void writeAnnotationTypeDescription() {
+    public void addAnnotationTypeDescription(Content annotationInfoTree) {
         if(!configuration.nocomment) {
-            // generate documentation for the class.
             if (annotationType.inlineTags().length > 0) {
-                printInlineComment(annotationType);
-                p();
+                addInlineComment(annotationType, annotationInfoTree);
             }
         }
     }
@@ -196,148 +240,152 @@
     /**
      * {@inheritDoc}
      */
-    public void writeAnnotationTypeTagInfo() {
-        boolean needHr = annotationType.elements().length > 0;
+    public void addAnnotationTypeTagInfo(Content annotationInfoTree) {
         if(!configuration.nocomment) {
-            // Print Information about all the tags here
-            printTags(annotationType);
-            if (needHr) {
-                hr();
-            }
-            p();
-        } else if (needHr) {
-            hr();
+            addTagsInfo(annotationType, annotationInfoTree);
         }
     }
 
     /**
      * {@inheritDoc}
      */
-    public void writeAnnotationTypeDeprecationInfo() {
-        hr();
+    public void addAnnotationTypeDeprecationInfo(Content annotationInfoTree) {
+        Content hr = new HtmlTree(HtmlTag.HR);
+        annotationInfoTree.addContent(hr);
         Tag[] deprs = annotationType.tags("deprecated");
         if (Util.isDeprecated(annotationType)) {
-            strongText("doclet.Deprecated");
+            Content strong = HtmlTree.STRONG(deprecatedPhrase);
+            Content div = HtmlTree.DIV(HtmlStyle.block, strong);
             if (deprs.length > 0) {
                 Tag[] commentTags = deprs[0].inlineTags();
                 if (commentTags.length > 0) {
-
-                    space();
-                    printInlineDeprecatedComment(annotationType, deprs[0]);
+                    div.addContent(getSpace());
+                    addInlineDeprecatedComment(annotationType, deprs[0], div);
                 }
             }
-            p();
+            annotationInfoTree.addContent(div);
         }
     }
 
-    protected void navLinkTree() {
-        navCellStart();
-        printHyperLink("package-tree.html", "",
-            configuration.getText("doclet.Tree"), true, "NavBarFont1");
-        navCellEnd();
+    /**
+     * {@inheritDoc}
+     */
+    public void addAnnotationDetailsMarker(Content memberDetails) {
+        memberDetails.addContent(HtmlConstants.START_OF_ANNOTATION_TYPE_DETAILS);
     }
 
-    protected void printSummaryDetailLinks() {
+    /**
+     * {@inheritDoc}
+     */
+    protected Content getNavLinkTree() {
+        Content treeLinkContent = getHyperLink("package-tree.html",
+                "", treeLabel, "", "");
+        Content li = HtmlTree.LI(treeLinkContent);
+        return li;
+    }
+
+    /**
+     * Add summary details to the navigation bar.
+     *
+     * @param subDiv the content tree to which the summary detail links will be added
+     */
+    protected void addSummaryDetailLinks(Content subDiv) {
         try {
-            tr();
-            tdVAlignClass("top", "NavBarCell3");
-            font("-2");
-            print("  ");
-            navSummaryLinks();
-            fontEnd();
-            tdEnd();
-
-            tdVAlignClass("top", "NavBarCell3");
-            font("-2");
-            navDetailLinks();
-            fontEnd();
-            tdEnd();
-            trEnd();
+            Content div = HtmlTree.DIV(getNavSummaryLinks());
+            div.addContent(getNavDetailLinks());
+            subDiv.addContent(div);
         } catch (Exception e) {
             e.printStackTrace();
             throw new DocletAbortException();
         }
     }
 
-    protected void navSummaryLinks() throws Exception {
-        printText("doclet.Summary");
-        space();
+    /**
+     * Get summary links for navigation bar.
+     *
+     * @return the content tree for the navigation summary links
+     */
+    protected Content getNavSummaryLinks() throws Exception {
+        Content li = HtmlTree.LI(summaryLabel);
+        li.addContent(getSpace());
+        Content ulNav = HtmlTree.UL(HtmlStyle.subNavList, li);
         MemberSummaryBuilder memberSummaryBuilder = (MemberSummaryBuilder)
-            configuration.getBuilderFactory().getMemberSummaryBuilder(this);
-        writeNavSummaryLink(memberSummaryBuilder,
-            "doclet.navAnnotationTypeRequiredMember",
-            VisibleMemberMap.ANNOTATION_TYPE_MEMBER_REQUIRED);
-        navGap();
-        writeNavSummaryLink(memberSummaryBuilder,
-            "doclet.navAnnotationTypeOptionalMember",
-            VisibleMemberMap.ANNOTATION_TYPE_MEMBER_OPTIONAL);
+                configuration.getBuilderFactory().getMemberSummaryBuilder(this);
+        Content liNavReq = new HtmlTree(HtmlTag.LI);
+        addNavSummaryLink(memberSummaryBuilder,
+                "doclet.navAnnotationTypeRequiredMember",
+                VisibleMemberMap.ANNOTATION_TYPE_MEMBER_REQUIRED, liNavReq);
+        addNavGap(liNavReq);
+        ulNav.addContent(liNavReq);
+        Content liNavOpt = new HtmlTree(HtmlTag.LI);
+        addNavSummaryLink(memberSummaryBuilder,
+                "doclet.navAnnotationTypeOptionalMember",
+                VisibleMemberMap.ANNOTATION_TYPE_MEMBER_OPTIONAL, liNavOpt);
+        ulNav.addContent(liNavOpt);
+        return ulNav;
     }
 
-    private void writeNavSummaryLink(MemberSummaryBuilder builder,
-            String label, int type) {
+    /**
+     * Add the navigation summary link.
+     *
+     * @param builder builder for the member to be documented
+     * @param label the label for the navigation
+     * @param type type to be documented
+     * @param liNav the content tree to which the navigation summary link will be added
+     */
+    protected void addNavSummaryLink(MemberSummaryBuilder builder,
+            String label, int type, Content liNav) {
         AbstractMemberWriter writer = ((AbstractMemberWriter) builder.
-            getMemberSummaryWriter(type));
+                getMemberSummaryWriter(type));
         if (writer == null) {
-              printText(label);
+            liNav.addContent(getResource(label));
         } else {
-            writer.printNavSummaryLink(null,
-                ! builder.getVisibleMemberMap(type).noVisibleMembers());
+            liNav.addContent(writer.getNavSummaryLink(null,
+                    ! builder.getVisibleMemberMap(type).noVisibleMembers()));
         }
     }
 
     /**
-     * Method navDetailLinks
+     * Get detail links for the navigation bar.
      *
-     * @throws   Exception
-     *
+     * @return the content tree for the detail links
      */
-    protected void navDetailLinks() throws Exception {
-        printText("doclet.Detail");
-        space();
+    protected Content getNavDetailLinks() throws Exception {
+        Content li = HtmlTree.LI(detailLabel);
+        li.addContent(getSpace());
+        Content ulNav = HtmlTree.UL(HtmlStyle.subNavList, li);
         MemberSummaryBuilder memberSummaryBuilder = (MemberSummaryBuilder)
-            configuration.getBuilderFactory().getMemberSummaryBuilder(this);
+                configuration.getBuilderFactory().getMemberSummaryBuilder(this);
         AbstractMemberWriter writerOptional =
-            ((AbstractMemberWriter) memberSummaryBuilder.
+                ((AbstractMemberWriter) memberSummaryBuilder.
                 getMemberSummaryWriter(VisibleMemberMap.ANNOTATION_TYPE_MEMBER_OPTIONAL));
         AbstractMemberWriter writerRequired =
-            ((AbstractMemberWriter) memberSummaryBuilder.
+                ((AbstractMemberWriter) memberSummaryBuilder.
                 getMemberSummaryWriter(VisibleMemberMap.ANNOTATION_TYPE_MEMBER_REQUIRED));
         if (writerOptional != null){
-            writerOptional.printNavDetailLink(annotationType.elements().length > 0);
+            Content liNavOpt = new HtmlTree(HtmlTag.LI);
+            writerOptional.addNavDetailLink(annotationType.elements().length > 0, liNavOpt);
+            ulNav.addContent(liNavOpt);
         } else if (writerRequired != null){
-            writerRequired.printNavDetailLink(annotationType.elements().length > 0);
+            Content liNavReq = new HtmlTree(HtmlTag.LI);
+            writerRequired.addNavDetailLink(annotationType.elements().length > 0, liNavReq);
+            ulNav.addContent(liNavReq);
         } else {
-            printText("doclet.navAnnotationTypeMember");
+            Content liNav = HtmlTree.LI(getResource("doclet.navAnnotationTypeMember"));
+            ulNav.addContent(liNav);
         }
-    }
-
-    protected void navGap() {
-        space();
-        print('|');
-        space();
+        return ulNav;
     }
 
     /**
-     * If this is an inner class or interface, write the enclosing class or
-     * interface.
+     * Add gap between navigation bar elements.
+     *
+     * @param liNav the content tree to which the gap will be added
      */
-    public void writeNestedClassInfo() {
-        ClassDoc outerClass = annotationType.containingClass();
-        if (outerClass != null) {
-            dl();
-            dt();
-            if (annotationType.isInterface()) {
-                strongText("doclet.Enclosing_Interface");
-            } else {
-                strongText("doclet.Enclosing_Class");
-            }
-            dtEnd();
-            dd();
-            printLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_CLASS, outerClass,
-                false));
-            ddEnd();
-            dlEnd();
-        }
+    protected void addNavGap(Content liNav) {
+        liNav.addContent(getSpace());
+        liNav.addContent("|");
+        liNav.addContent(getSpace());
     }
 
     /**
@@ -346,11 +394,4 @@
     public AnnotationTypeDoc getAnnotationTypeDoc() {
         return annotationType;
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public void completeMemberSummaryBuild() {
-        p();
-    }
 }
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ClassUseWriter.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ClassUseWriter.java	Mon Dec 20 21:10:57 2010 -0800
@@ -25,10 +25,12 @@
 
 package com.sun.tools.doclets.formats.html;
 
-import com.sun.tools.doclets.internal.toolkit.util.*;
-import com.sun.javadoc.*;
 import java.io.*;
 import java.util.*;
+import com.sun.javadoc.*;
+import com.sun.tools.doclets.internal.toolkit.util.*;
+import com.sun.tools.doclets.formats.html.markup.*;
+import com.sun.tools.doclets.internal.toolkit.*;
 
 /**
  * Generate class usage information.
@@ -207,257 +209,301 @@
     }
 
     /**
-     * Print the class use list.
+     * Generate the class use list.
      */
     protected void generateClassUseFile() throws IOException {
-
-        printClassUseHeader();
-
+        Content body = getClassUseHeader();
+        HtmlTree div = new HtmlTree(HtmlTag.DIV);
+        div.addStyle(HtmlStyle.classUseContainer);
         if (pkgSet.size() > 0) {
-            generateClassUse();
+            addClassUse(div);
         } else {
-            printText("doclet.ClassUse_No.usage.of.0",
-                      classdoc.qualifiedName());
-            p();
-        }
-
-        printClassUseFooter();
-    }
-
-    protected void generateClassUse() throws IOException {
-        if (configuration.packages.length > 1) {
-            generatePackageList();
-            generatePackageAnnotationList();
+            div.addContent(getResource("doclet.ClassUse_No.usage.of.0",
+                    classdoc.qualifiedName()));
         }
-        generateClassList();
-    }
-
-    protected void generatePackageList() throws IOException {
-        tableIndexSummary(useTableSummary);
-        tableCaptionStart();
-        printText("doclet.ClassUse_Packages.that.use.0",
-            getLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_CLASS_USE_HEADER, classdoc,
-                false)));
-        tableCaptionEnd();
-        summaryTableHeader(packageTableHeader, "col");
-
-        for (Iterator<PackageDoc> it = pkgSet.iterator(); it.hasNext();) {
-            PackageDoc pkg = it.next();
-            generatePackageUse(pkg);
-        }
-        tableEnd();
-        space();
-        p();
+        body.addContent(div);
+        addNavLinks(false, body);
+        addBottom(body);
+        printHtmlDocument(null, true, body);
     }
 
-    protected void generatePackageAnnotationList() throws IOException {
-        if ((! classdoc.isAnnotationType()) ||
-               pkgToPackageAnnotations == null ||
-               pkgToPackageAnnotations.size() == 0)
-            return;
-        tableIndexSummary(useTableSummary);
-        tableCaptionStart();
-        printText("doclet.ClassUse_PackageAnnotation",
-            getLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_CLASS_USE_HEADER, classdoc,
-                false)));
-        tableCaptionEnd();
-        summaryTableHeader(packageTableHeader, "col");
-        for (Iterator<PackageDoc> it = pkgToPackageAnnotations.iterator(); it.hasNext();) {
-            PackageDoc pkg = it.next();
-            trBgcolorStyle("white", "TableRowColor");
-            summaryRow(0);
-            //Just want an anchor here.
-            printPackageLink(pkg, pkg.name(), true);
-            summaryRowEnd();
-            summaryRow(0);
-            printSummaryComment(pkg);
-            space();
-            summaryRowEnd();
-            trEnd();
+    /**
+     * Add the class use documentation.
+     *
+     * @param contentTree the content tree to which the class use information will be added
+     */
+    protected void addClassUse(Content contentTree) throws IOException {
+        HtmlTree ul = new HtmlTree(HtmlTag.UL);
+        ul.addStyle(HtmlStyle.blockList);
+        if (configuration.packages.length > 1) {
+            addPackageList(ul);
+            addPackageAnnotationList(ul);
         }
-        tableEnd();
-        space();
-        p();
+        addClassList(ul);
+        contentTree.addContent(ul);
     }
 
-    protected void generateClassList() throws IOException {
-        for (Iterator<PackageDoc> it = pkgSet.iterator(); it.hasNext();) {
+    /**
+     * Add the packages list that use the given class.
+     *
+     * @param contentTree the content tree to which the packages list will be added
+     */
+    protected void addPackageList(Content contentTree) throws IOException {
+        Content table = HtmlTree.TABLE(0, 3, 0, useTableSummary,
+                getTableCaption(configuration().getText(
+                "doclet.ClassUse_Packages.that.use.0",
+                getLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_CLASS_USE_HEADER, classdoc,
+                false)))));
+        table.addContent(getSummaryTableHeader(packageTableHeader, "col"));
+        Content tbody = new HtmlTree(HtmlTag.TBODY);
+        Iterator<PackageDoc> it = pkgSet.iterator();
+        for (int i = 0; it.hasNext(); i++) {
             PackageDoc pkg = it.next();
-            anchor(pkg.name());
-            tableIndexSummary();
-            tableHeaderStart("#CCCCFF");
-            printText("doclet.ClassUse_Uses.of.0.in.1",
-                getLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_CLASS_USE_HEADER,
-                    classdoc, false)),
-                getPackageLink(pkg, Util.getPackageName(pkg), false));
-            tableHeaderEnd();
-            tableEnd();
-            space();
-            p();
-            generateClassUse(pkg);
+            HtmlTree tr = new HtmlTree(HtmlTag.TR);
+            if (i % 2 == 0) {
+                tr.addStyle(HtmlStyle.altColor);
+            } else {
+                tr.addStyle(HtmlStyle.rowColor);
+            }
+            addPackageUse(pkg, tr);
+            tbody.addContent(tr);
         }
+        table.addContent(tbody);
+        Content li = HtmlTree.LI(HtmlStyle.blockList, table);
+        contentTree.addContent(li);
     }
 
     /**
-     * Print the package use list.
+     * Add the package annotation list.
+     *
+     * @param contentTree the content tree to which the package annotation list will be added
      */
-    protected void generatePackageUse(PackageDoc pkg) throws IOException {
-        trBgcolorStyle("white", "TableRowColor");
-        summaryRow(0);
-        //Just want an anchor here.
-        printHyperLink("", pkg.name(), Util.getPackageName(pkg), true);
-        summaryRowEnd();
-        summaryRow(0);
-        printSummaryComment(pkg);
-        space();
-        summaryRowEnd();
-        trEnd();
+    protected void addPackageAnnotationList(Content contentTree) throws IOException {
+        if ((!classdoc.isAnnotationType()) ||
+                pkgToPackageAnnotations == null ||
+                pkgToPackageAnnotations.size() == 0) {
+            return;
+        }
+        Content table = HtmlTree.TABLE(0, 3, 0, useTableSummary,
+                getTableCaption(configuration().getText(
+                "doclet.ClassUse_PackageAnnotation",
+                getLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_CLASS_USE_HEADER, classdoc,
+                false)))));
+        table.addContent(getSummaryTableHeader(packageTableHeader, "col"));
+        Content tbody = new HtmlTree(HtmlTag.TBODY);
+        Iterator<PackageDoc> it = pkgToPackageAnnotations.iterator();
+        for (int i = 0; it.hasNext(); i++) {
+            PackageDoc pkg = it.next();
+            HtmlTree tr = new HtmlTree(HtmlTag.TR);
+            if (i % 2 == 0) {
+                tr.addStyle(HtmlStyle.altColor);
+            } else {
+                tr.addStyle(HtmlStyle.rowColor);
+            }
+            Content tdFirst = HtmlTree.TD(HtmlStyle.colFirst,
+                    getPackageLink(pkg, new StringContent(pkg.name())));
+            tr.addContent(tdFirst);
+            HtmlTree tdLast = new HtmlTree(HtmlTag.TD);
+            tdLast.addStyle(HtmlStyle.colLast);
+            if (pkg != null) {
+                addSummaryComment(pkg, tdLast);
+            } else {
+                tdLast.addContent(getSpace());
+            }
+            tr.addContent(tdLast);
+            tbody.addContent(tr);
+        }
+        table.addContent(tbody);
+        Content li = HtmlTree.LI(HtmlStyle.blockList, table);
+        contentTree.addContent(li);
+    }
+
+    /**
+     * Add the class list that use the given class.
+     *
+     * @param contentTree the content tree to which the class list will be added
+     */
+    protected void addClassList(Content contentTree) throws IOException {
+        HtmlTree ul = new HtmlTree(HtmlTag.UL);
+        ul.addStyle(HtmlStyle.blockList);
+        for (Iterator<PackageDoc> it = pkgSet.iterator(); it.hasNext();) {
+            PackageDoc pkg = it.next();
+            Content li = HtmlTree.LI(HtmlStyle.blockList, getMarkerAnchor(pkg.name()));
+            Content link = new RawHtml(
+                    configuration.getText("doclet.ClassUse_Uses.of.0.in.1",
+                    getLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_CLASS_USE_HEADER,
+                    classdoc, false)),
+                    getPackageLinkString(pkg, Util.getPackageName(pkg), false)));
+            Content heading = HtmlTree.HEADING(HtmlConstants.SUMMARY_HEADING, link);
+            li.addContent(heading);
+            addClassUse(pkg, li);
+            ul.addContent(li);
+        }
+        Content li = HtmlTree.LI(HtmlStyle.blockList, ul);
+        contentTree.addContent(li);
     }
 
     /**
-     * Print the class use list.
+     * Add the package use information.
+     *
+     * @param pkg the package that uses the given class
+     * @param contentTree the content tree to which the package use information will be added
      */
-    protected void generateClassUse(PackageDoc pkg) throws IOException {
-        String classLink = getLink(new LinkInfoImpl(
-            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), classUseTableSummary);
-        classSubWriter.printUseInfo(pkgToClassTypeParameter.get(pkg.name()),
-                configuration.getText("doclet.ClassUse_TypeParameter", classLink,
-                pkgLink), classUseTableSummary);
-        classSubWriter.printUseInfo(pkgToSubclass.get(pkg.name()),
-                configuration.getText("doclet.ClassUse_Subclass", classLink,
-                pkgLink), subclassUseTableSummary);
-        classSubWriter.printUseInfo(pkgToSubinterface.get(pkg.name()),
-                configuration.getText("doclet.ClassUse_Subinterface", classLink,
-                pkgLink), subinterfaceUseTableSummary);
-        classSubWriter.printUseInfo(pkgToImplementingClass.get(pkg.name()),
-                configuration.getText("doclet.ClassUse_ImplementingClass", classLink,
-                pkgLink), classUseTableSummary);
-        fieldSubWriter.printUseInfo(pkgToField.get(pkg.name()),
-                configuration.getText("doclet.ClassUse_Field", classLink,
-                pkgLink), fieldUseTableSummary);
-        fieldSubWriter.printUseInfo(pkgToFieldAnnotations.get(pkg.name()),
-                configuration.getText("doclet.ClassUse_FieldAnnotations", classLink,
-                pkgLink), fieldUseTableSummary);
-        fieldSubWriter.printUseInfo(pkgToFieldTypeParameter.get(pkg.name()),
-                configuration.getText("doclet.ClassUse_FieldTypeParameter", classLink,
-                pkgLink), fieldUseTableSummary);
-        methodSubWriter.printUseInfo(pkgToMethodAnnotations.get(pkg.name()),
-                configuration.getText("doclet.ClassUse_MethodAnnotations", classLink,
-                pkgLink), methodUseTableSummary);
-        methodSubWriter.printUseInfo(pkgToMethodParameterAnnotations.get(pkg.name()),
-                configuration.getText("doclet.ClassUse_MethodParameterAnnotations", classLink,
-                pkgLink), methodUseTableSummary);
-        methodSubWriter.printUseInfo(pkgToMethodTypeParameter.get(pkg.name()),
-                configuration.getText("doclet.ClassUse_MethodTypeParameter", classLink,
-                pkgLink), methodUseTableSummary);
-        methodSubWriter.printUseInfo(pkgToMethodReturn.get(pkg.name()),
-                configuration.getText("doclet.ClassUse_MethodReturn", classLink,
-                pkgLink), methodUseTableSummary);
-        methodSubWriter.printUseInfo(pkgToMethodReturnTypeParameter.get(pkg.name()),
-                configuration.getText("doclet.ClassUse_MethodReturnTypeParameter", classLink,
-                pkgLink), methodUseTableSummary);
-        methodSubWriter.printUseInfo(pkgToMethodArgs.get(pkg.name()),
-                configuration.getText("doclet.ClassUse_MethodArgs", classLink,
-                pkgLink), methodUseTableSummary);
-        methodSubWriter.printUseInfo(pkgToMethodArgTypeParameter.get(pkg.name()),
-                configuration.getText("doclet.ClassUse_MethodArgsTypeParameters", classLink,
-                pkgLink), methodUseTableSummary);
-        methodSubWriter.printUseInfo(pkgToMethodThrows.get(pkg.name()),
-                configuration.getText("doclet.ClassUse_MethodThrows", classLink,
-                pkgLink), methodUseTableSummary);
-        constrSubWriter.printUseInfo(pkgToConstructorAnnotations.get(pkg.name()),
-                configuration.getText("doclet.ClassUse_ConstructorAnnotations", classLink,
-                pkgLink), constructorUseTableSummary);
-        constrSubWriter.printUseInfo(pkgToConstructorParameterAnnotations.get(pkg.name()),
-                configuration.getText("doclet.ClassUse_ConstructorParameterAnnotations", classLink,
-                pkgLink), constructorUseTableSummary);
-        constrSubWriter.printUseInfo(pkgToConstructorArgs.get(pkg.name()),
-                configuration.getText("doclet.ClassUse_ConstructorArgs", classLink,
-                pkgLink), constructorUseTableSummary);
-        constrSubWriter.printUseInfo(pkgToConstructorArgTypeParameter.get(pkg.name()),
-                configuration.getText("doclet.ClassUse_ConstructorArgsTypeParameters", classLink,
-                pkgLink), constructorUseTableSummary);
-        constrSubWriter.printUseInfo(pkgToConstructorThrows.get(pkg.name()),
-                configuration.getText("doclet.ClassUse_ConstructorThrows", classLink,
-                pkgLink), constructorUseTableSummary);
+    protected void addPackageUse(PackageDoc pkg, Content contentTree) throws IOException {
+        Content tdFirst = HtmlTree.TD(HtmlStyle.colFirst,
+                getHyperLink("", pkg.name(), new StringContent(Util.getPackageName(pkg))));
+        contentTree.addContent(tdFirst);
+        HtmlTree tdLast = new HtmlTree(HtmlTag.TD);
+        tdLast.addStyle(HtmlStyle.colLast);
+        if (pkg != null)
+            addSummaryComment(pkg, tdLast);
+        else
+            tdLast.addContent(getSpace());
+        contentTree.addContent(tdLast);
     }
 
     /**
-     * Print the header for the class use Listing.
+     * Add the class use information.
+     *
+     * @param pkg the package that uses the given class
+     * @param contentTree the content tree to which the class use information will be added
      */
-    protected void printClassUseHeader() {
-        String cltype = configuration.getText(classdoc.isInterface()?
-                                    "doclet.Interface":
-                                    "doclet.Class");
-        String clname = classdoc.qualifiedName();
-        printHtmlHeader(configuration.getText("doclet.Window_ClassUse_Header",
-                            cltype, clname), null, true);
-        printTop();
-        navLinks(true);
-        hr();
-        center();
-        h2();
-        strongText("doclet.ClassUse_Title", cltype, clname);
-        h2End();
-        centerEnd();
+    protected void addClassUse(PackageDoc pkg, Content contentTree) throws IOException {
+        String classLink = getLink(new LinkInfoImpl(
+            LinkInfoImpl.CONTEXT_CLASS_USE_HEADER, classdoc, false));
+        String pkgLink = getPackageLinkString(pkg, Util.getPackageName(pkg), false);
+        classSubWriter.addUseInfo(pkgToClassAnnotations.get(pkg.name()),
+                configuration.getText("doclet.ClassUse_Annotation", classLink,
+                pkgLink), classUseTableSummary, contentTree);
+        classSubWriter.addUseInfo(pkgToClassTypeParameter.get(pkg.name()),
+                configuration.getText("doclet.ClassUse_TypeParameter", classLink,
+                pkgLink), classUseTableSummary, contentTree);
+        classSubWriter.addUseInfo(pkgToSubclass.get(pkg.name()),
+                configuration.getText("doclet.ClassUse_Subclass", classLink,
+                pkgLink), subclassUseTableSummary, contentTree);
+        classSubWriter.addUseInfo(pkgToSubinterface.get(pkg.name()),
+                configuration.getText("doclet.ClassUse_Subinterface", classLink,
+                pkgLink), subinterfaceUseTableSummary, contentTree);
+        classSubWriter.addUseInfo(pkgToImplementingClass.get(pkg.name()),
+                configuration.getText("doclet.ClassUse_ImplementingClass", classLink,
+                pkgLink), classUseTableSummary, contentTree);
+        fieldSubWriter.addUseInfo(pkgToField.get(pkg.name()),
+                configuration.getText("doclet.ClassUse_Field", classLink,
+                pkgLink), fieldUseTableSummary, contentTree);
+        fieldSubWriter.addUseInfo(pkgToFieldAnnotations.get(pkg.name()),
+                configuration.getText("doclet.ClassUse_FieldAnnotations", classLink,
+                pkgLink), fieldUseTableSummary, contentTree);
+        fieldSubWriter.addUseInfo(pkgToFieldTypeParameter.get(pkg.name()),
+                configuration.getText("doclet.ClassUse_FieldTypeParameter", classLink,
+                pkgLink), fieldUseTableSummary, contentTree);
+        methodSubWriter.addUseInfo(pkgToMethodAnnotations.get(pkg.name()),
+                configuration.getText("doclet.ClassUse_MethodAnnotations", classLink,
+                pkgLink), methodUseTableSummary, contentTree);
+        methodSubWriter.addUseInfo(pkgToMethodParameterAnnotations.get(pkg.name()),
+                configuration.getText("doclet.ClassUse_MethodParameterAnnotations", classLink,
+                pkgLink), methodUseTableSummary, contentTree);
+        methodSubWriter.addUseInfo(pkgToMethodTypeParameter.get(pkg.name()),
+                configuration.getText("doclet.ClassUse_MethodTypeParameter", classLink,
+                pkgLink), methodUseTableSummary, contentTree);
+        methodSubWriter.addUseInfo(pkgToMethodReturn.get(pkg.name()),
+                configuration.getText("doclet.ClassUse_MethodReturn", classLink,
+                pkgLink), methodUseTableSummary, contentTree);
+        methodSubWriter.addUseInfo(pkgToMethodReturnTypeParameter.get(pkg.name()),
+                configuration.getText("doclet.ClassUse_MethodReturnTypeParameter", classLink,
+                pkgLink), methodUseTableSummary, contentTree);
+        methodSubWriter.addUseInfo(pkgToMethodArgs.get(pkg.name()),
+                configuration.getText("doclet.ClassUse_MethodArgs", classLink,
+                pkgLink), methodUseTableSummary, contentTree);
+        methodSubWriter.addUseInfo(pkgToMethodArgTypeParameter.get(pkg.name()),
+                configuration.getText("doclet.ClassUse_MethodArgsTypeParameters", classLink,
+                pkgLink), methodUseTableSummary, contentTree);
+        methodSubWriter.addUseInfo(pkgToMethodThrows.get(pkg.name()),
+                configuration.getText("doclet.ClassUse_MethodThrows", classLink,
+                pkgLink), methodUseTableSummary, contentTree);
+        constrSubWriter.addUseInfo(pkgToConstructorAnnotations.get(pkg.name()),
+                configuration.getText("doclet.ClassUse_ConstructorAnnotations", classLink,
+                pkgLink), constructorUseTableSummary, contentTree);
+        constrSubWriter.addUseInfo(pkgToConstructorParameterAnnotations.get(pkg.name()),
+                configuration.getText("doclet.ClassUse_ConstructorParameterAnnotations", classLink,
+                pkgLink), constructorUseTableSummary, contentTree);
+        constrSubWriter.addUseInfo(pkgToConstructorArgs.get(pkg.name()),
+                configuration.getText("doclet.ClassUse_ConstructorArgs", classLink,
+                pkgLink), constructorUseTableSummary, contentTree);
+        constrSubWriter.addUseInfo(pkgToConstructorArgTypeParameter.get(pkg.name()),
+                configuration.getText("doclet.ClassUse_ConstructorArgsTypeParameters", classLink,
+                pkgLink), constructorUseTableSummary, contentTree);
+        constrSubWriter.addUseInfo(pkgToConstructorThrows.get(pkg.name()),
+                configuration.getText("doclet.ClassUse_ConstructorThrows", classLink,
+                pkgLink), constructorUseTableSummary, contentTree);
     }
 
     /**
-     * Print the footer for the class use Listing.
+     * Get the header for the class use Listing.
+     *
+     * @return a content tree representing the class use header
      */
-    protected void printClassUseFooter() {
-        hr();
-        navLinks(false);
-        printBottom();
-        printBodyHtmlEnd();
+    protected Content getClassUseHeader() {
+        String cltype = configuration.getText(classdoc.isInterface()?
+            "doclet.Interface":"doclet.Class");
+        String clname = classdoc.qualifiedName();
+        String title = configuration.getText("doclet.Window_ClassUse_Header",
+                cltype, clname);
+        Content bodyTree = getBody(true, getWindowTitle(title));
+        addTop(bodyTree);
+        addNavLinks(true, bodyTree);
+        Content headContent = getResource("doclet.ClassUse_Title", cltype, clname);
+        Content heading = HtmlTree.HEADING(HtmlConstants.CLASS_PAGE_HEADING,
+                true, HtmlStyle.title, headContent);
+        Content div = HtmlTree.DIV(HtmlStyle.header, heading);
+        bodyTree.addContent(div);
+        return bodyTree;
     }
 
-
     /**
-     * Print this package link
+     * Get this package link.
+     *
+     * @return a content tree for the package link
      */
-    protected void navLinkPackage() {
-        navCellStart();
-        printHyperLink("../package-summary.html", "",
-                       configuration.getText("doclet.Package"), true, "NavBarFont1");
-        navCellEnd();
+    protected Content getNavLinkPackage() {
+        Content linkContent = getHyperLink("../package-summary.html", "",
+                packageLabel);
+        Content li = HtmlTree.LI(linkContent);
+        return li;
     }
 
     /**
-     * Print class page indicator
+     * Get class page link.
+     *
+     * @return a content tree for the class page link
      */
-    protected void navLinkClass() {
-        navCellStart();
-        printLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_CLASS_USE_HEADER, classdoc, "",
-            configuration.getText("doclet.Class"), true, "NavBarFont1"));
-        navCellEnd();
+    protected Content getNavLinkClass() {
+        Content linkContent = new RawHtml(getLink(new LinkInfoImpl(
+                LinkInfoImpl.CONTEXT_CLASS_USE_HEADER, classdoc, "",
+                configuration.getText("doclet.Class"), false)));
+        Content li = HtmlTree.LI(linkContent);
+        return li;
     }
 
     /**
-     * Print class use link
+     * Get the use link.
+     *
+     * @return a content tree for the use link
      */
-    protected void navLinkClassUse() {
-        navCellRevStart();
-        fontStyle("NavBarFont1Rev");
-        strongText("doclet.navClassUse");
-        fontEnd();
-        navCellEnd();
+    protected Content getNavLinkClassUse() {
+        Content li = HtmlTree.LI(HtmlStyle.navBarCell1Rev, useLabel);
+        return li;
     }
 
-    protected void navLinkTree() {
-        navCellStart();
-        if (classdoc.containingPackage().isIncluded()) {
-            printHyperLink("../package-tree.html", "",
-                configuration.getText("doclet.Tree"), true, "NavBarFont1");
-        } else {
-            printHyperLink(relativePath + "overview-tree.html", "",
-                configuration.getText("doclet.Tree"), true, "NavBarFont1");
-        }
-        navCellEnd();
+    /**
+     * Get the tree link.
+     *
+     * @return a content tree for the tree link
+     */
+    protected Content getNavLinkTree() {
+        Content linkContent = classdoc.containingPackage().isIncluded() ?
+            getHyperLink("../package-tree.html", "", treeLabel) :
+            getHyperLink(relativePath + "overview-tree.html", "", treeLabel);
+        Content li = HtmlTree.LI(linkContent);
+        return li;
     }
-
 }
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ClassWriterImpl.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ClassWriterImpl.java	Mon Dec 20 21:10:57 2010 -0800
@@ -32,6 +32,7 @@
 import com.sun.tools.doclets.internal.toolkit.util.*;
 import com.sun.tools.doclets.internal.toolkit.builders.*;
 import com.sun.tools.doclets.internal.toolkit.taglets.*;
+import com.sun.tools.doclets.formats.html.markup.*;
 
 /**
  * Generate the Class Information Page.
@@ -43,6 +44,7 @@
  *
  * @author Atul M Dambalkar
  * @author Robert Field
+ * @author Bhavesh Patel (Modified)
  */
 public class ClassWriterImpl extends SubWriterHolderWriter
         implements ClassWriter {
@@ -76,124 +78,173 @@
     }
 
     /**
-     * Print this package link
+     * Get this package link.
+     *
+     * @return a content tree for the package link
      */
-    protected void navLinkPackage() {
-        navCellStart();
-        printHyperLink("package-summary.html", "",
-            configuration.getText("doclet.Package"), true, "NavBarFont1");
-        navCellEnd();
+    protected Content getNavLinkPackage() {
+        Content linkContent = getHyperLink("package-summary.html", "",
+                packageLabel);
+        Content li = HtmlTree.LI(linkContent);
+        return li;
     }
 
     /**
-     * Print class page indicator
+     * Get the class link.
+     *
+     * @return a content tree for the class link
      */
-    protected void navLinkClass() {
-        navCellRevStart();
-        fontStyle("NavBarFont1Rev");
-        strongText("doclet.Class");
-        fontEnd();
-        navCellEnd();
+    protected Content getNavLinkClass() {
+        Content li = HtmlTree.LI(HtmlStyle.navBarCell1Rev, classLabel);
+        return li;
+    }
+
+    /**
+     * Get the class use link.
+     *
+     * @return a content tree for the class use link
+     */
+    protected Content getNavLinkClassUse() {
+        Content linkContent = getHyperLink("class-use/" + filename, "", useLabel);
+        Content li = HtmlTree.LI(linkContent);
+        return li;
     }
 
     /**
-     * Print class use link
+     * Get link to previous class.
+     *
+     * @return a content tree for the previous class link
      */
-    protected void navLinkClassUse() {
-        navCellStart();
-        printHyperLink("class-use/" + filename, "",
-                       configuration.getText("doclet.navClassUse"), true, "NavBarFont1");
-        navCellEnd();
+    public Content getNavLinkPrevious() {
+        Content li;
+        if (prev != null) {
+            Content prevLink = new RawHtml(getLink(new LinkInfoImpl(
+                    LinkInfoImpl.CONTEXT_CLASS, prev, "",
+                    configuration.getText("doclet.Prev_Class"), true)));
+            li = HtmlTree.LI(prevLink);
+        }
+        else
+            li = HtmlTree.LI(prevclassLabel);
+        return li;
     }
 
     /**
-     * Print previous package link
+     * Get link to next class.
+     *
+     * @return a content tree for the next class link
      */
-    protected void navLinkPrevious() {
-        if (prev == null) {
-            printText("doclet.Prev_Class");
-        } else {
-            printLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_CLASS, prev, "",
-                configuration.getText("doclet.Prev_Class"), true));
+    public Content getNavLinkNext() {
+        Content li;
+        if (next != null) {
+            Content nextLink = new RawHtml(getLink(new LinkInfoImpl(
+                    LinkInfoImpl.CONTEXT_CLASS, next, "",
+                    configuration.getText("doclet.Next_Class"), true)));
+            li = HtmlTree.LI(nextLink);
         }
-    }
-
-    /**
-     * Print next package link
-     */
-    protected void navLinkNext() {
-        if (next == null) {
-            printText("doclet.Next_Class");
-        } else {
-            printLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_CLASS, next, "",
-                configuration.getText("doclet.Next_Class"), true));
-        }
+        else
+            li = HtmlTree.LI(nextclassLabel);
+        return li;
     }
 
     /**
      * {@inheritDoc}
      */
-    public void writeHeader(String header) {
+    public Content getHeader(String header) {
         String pkgname = (classDoc.containingPackage() != null)?
             classDoc.containingPackage().name(): "";
         String clname = classDoc.name();
-        printHtmlHeader(clname,
-            configuration.metakeywords.getMetaKeywords(classDoc), true);
-        printTop();
-        navLinks(true);
-        hr();
-        println("<!-- ======== START OF CLASS DATA ======== -->");
-        h2();
+        Content bodyTree = getBody(true, getWindowTitle(clname));
+        addTop(bodyTree);
+        addNavLinks(true, bodyTree);
+        bodyTree.addContent(HtmlConstants.START_OF_CLASS_DATA);
+        HtmlTree div = new HtmlTree(HtmlTag.DIV);
+        div.addStyle(HtmlStyle.header);
         if (pkgname.length() > 0) {
-            font("-1"); print(pkgname); fontEnd(); br();
+            Content pkgNameContent = new StringContent(pkgname);
+            Content pkgNamePara = HtmlTree.P(HtmlStyle.subTitle, pkgNameContent);
+            div.addContent(pkgNamePara);
         }
         LinkInfoImpl linkInfo = new LinkInfoImpl( LinkInfoImpl.CONTEXT_CLASS_HEADER,
-            classDoc, false);
+                classDoc, false);
         //Let's not link to ourselves in the header.
         linkInfo.linkToSelf = false;
-        print(header + getTypeParameterLinks(linkInfo));
-        h2End();
+        Content headerContent = new StringContent(header);
+        Content heading = HtmlTree.HEADING(HtmlConstants.CLASS_PAGE_HEADING, true,
+                HtmlStyle.title, headerContent);
+        heading.addContent(new RawHtml(getTypeParameterLinks(linkInfo)));
+        div.addContent(heading);
+        bodyTree.addContent(div);
+        return bodyTree;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public Content getClassContentHeader() {
+        return getContentHeader();
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public void addFooter(Content contentTree) {
+        contentTree.addContent(HtmlConstants.END_OF_CLASS_DATA);
+        addNavLinks(false, contentTree);
+        addBottom(contentTree);
     }
 
     /**
      * {@inheritDoc}
      */
-    public void writeFooter() {
-        println("<!-- ========= END OF CLASS DATA ========= -->");
-        hr();
-        navLinks(false);
-        printBottom();
-        printBodyHtmlEnd();
+    public void printDocument(Content contentTree) {
+        printHtmlDocument(configuration.metakeywords.getMetaKeywords(classDoc),
+                true, contentTree);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public Content getClassInfoTreeHeader() {
+        return getMemberTreeHeader();
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public Content getClassInfo(Content classInfoTree) {
+        return getMemberTree(HtmlStyle.description, classInfoTree);
     }
 
     /**
      * {@inheritDoc}
      */
-    public void writeClassSignature(String modifiers) {
+    public void addClassSignature(String modifiers, Content classInfoTree) {
         boolean isInterface = classDoc.isInterface();
-        preNoNewLine();
-        writeAnnotationInfo(classDoc);
-        print(modifiers);
+        classInfoTree.addContent(new HtmlTree(HtmlTag.BR));
+        Content pre = new HtmlTree(HtmlTag.PRE);
+        addAnnotationInfo(classDoc, pre);
+        pre.addContent(modifiers);
         LinkInfoImpl linkInfo = new LinkInfoImpl(
-            LinkInfoImpl.CONTEXT_CLASS_SIGNATURE, classDoc, false);
+                LinkInfoImpl.CONTEXT_CLASS_SIGNATURE, classDoc, false);
         //Let's not link to ourselves in the signature.
         linkInfo.linkToSelf = false;
-        String name = classDoc.name() +
-            getTypeParameterLinks(linkInfo);
+        Content name = new RawHtml (classDoc.name() +
+                getTypeParameterLinks(linkInfo));
         if (configuration().linksource) {
-            printSrcLink(classDoc, name);
+            addSrcLink(classDoc, name, pre);
         } else {
-            strong(name);
+            pre.addContent(HtmlTree.STRONG(name));
         }
         if (!isInterface) {
             Type superclass = Util.getFirstVisibleSuperClass(classDoc,
-                configuration());
+                    configuration());
             if (superclass != null) {
-                println();
-                print("extends ");
-                printLink(new LinkInfoImpl(
-                    LinkInfoImpl.CONTEXT_CLASS_SIGNATURE_PARENT_NAME,
-                    superclass));
+                pre.addContent(DocletConstants.NL);
+                pre.addContent("extends ");
+                Content link = new RawHtml(getLink(new LinkInfoImpl(
+                        LinkInfoImpl.CONTEXT_CLASS_SIGNATURE_PARENT_NAME,
+                        superclass)));
+                pre.addContent(link);
             }
         }
         Type[] implIntfacs = classDoc.interfaceTypes();
@@ -202,34 +253,170 @@
             for (int i = 0; i < implIntfacs.length; i++) {
                 ClassDoc classDoc = implIntfacs[i].asClassDoc();
                 if (! (classDoc.isPublic() ||
-                    Util.isLinkable(classDoc, configuration()))) {
+                        Util.isLinkable(classDoc, configuration()))) {
                     continue;
                 }
                 if (counter == 0) {
-                    println();
-                    print(isInterface? "extends " : "implements ");
+                    pre.addContent(DocletConstants.NL);
+                    pre.addContent(isInterface? "extends " : "implements ");
                 } else {
-                    print(", ");
+                    pre.addContent(", ");
                 }
-                printLink(new LinkInfoImpl(
-                    LinkInfoImpl.CONTEXT_CLASS_SIGNATURE_PARENT_NAME,
-                    implIntfacs[i]));
+                Content link = new RawHtml(getLink(new LinkInfoImpl(
+                        LinkInfoImpl.CONTEXT_CLASS_SIGNATURE_PARENT_NAME,
+                        implIntfacs[i])));
+                pre.addContent(link);
                 counter++;
             }
         }
-        preEnd();
-        p();
+        classInfoTree.addContent(pre);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public void addClassDescription(Content classInfoTree) {
+        if(!configuration.nocomment) {
+            // generate documentation for the class.
+            if (classDoc.inlineTags().length > 0) {
+                addInlineComment(classDoc, classInfoTree);
+            }
+        }
     }
 
     /**
      * {@inheritDoc}
      */
-    public void writeClassDescription() {
+    public void addClassTagInfo(Content classInfoTree) {
         if(!configuration.nocomment) {
-            // generate documentation for the class.
-            if (classDoc.inlineTags().length > 0) {
-                printInlineComment(classDoc);
-                p();
+            // Print Information about all the tags here
+            addTagsInfo(classDoc, classInfoTree);
+        }
+    }
+
+    /**
+     * Get the class hierarchy tree for the given class.
+     *
+     * @param type the class to print the hierarchy for
+     * @return a content tree for class inheritence
+     */
+    private Content getClassInheritenceTree(Type type) {
+        Type sup;
+        HtmlTree classTreeUl = new HtmlTree(HtmlTag.UL);
+        classTreeUl.addStyle(HtmlStyle.inheritance);
+        Content liTree = null;
+        do {
+            sup = Util.getFirstVisibleSuperClass(
+                    type instanceof ClassDoc ? (ClassDoc) type : type.asClassDoc(),
+                    configuration());
+            if (sup != null) {
+                HtmlTree ul = new HtmlTree(HtmlTag.UL);
+                ul.addStyle(HtmlStyle.inheritance);
+                ul.addContent(getTreeForClassHelper(type));
+                if (liTree != null)
+                    ul.addContent(liTree);
+                Content li = HtmlTree.LI(ul);
+                liTree = li;
+                type = sup;
+            }
+            else
+                classTreeUl.addContent(getTreeForClassHelper(type));
+        }
+        while (sup != null);
+        if (liTree != null)
+            classTreeUl.addContent(liTree);
+        return classTreeUl;
+    }
+
+    /**
+     * Get the class helper tree for the given class.
+     *
+     * @param type the class to print the helper for
+     * @return a content tree for class helper
+     */
+    private Content getTreeForClassHelper(Type type) {
+        Content li = new HtmlTree(HtmlTag.LI);
+        if (type.equals(classDoc)) {
+            String typeParameters = getTypeParameterLinks(
+                    new LinkInfoImpl(LinkInfoImpl.CONTEXT_TREE,
+                    classDoc, false));
+            if (configuration.shouldExcludeQualifier(
+                    classDoc.containingPackage().name())) {
+                li.addContent(type.asClassDoc().name());
+                li.addContent(new RawHtml(typeParameters));
+            } else {
+                li.addContent(type.asClassDoc().qualifiedName());
+                li.addContent(new RawHtml(typeParameters));
+            }
+        } else {
+            Content link = new RawHtml(getLink(new LinkInfoImpl(
+                    LinkInfoImpl.CONTEXT_CLASS_TREE_PARENT,
+                    type instanceof ClassDoc ? (ClassDoc) type : type,
+                    configuration.getClassName(type.asClassDoc()), false)));
+            li.addContent(link);
+        }
+        return li;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public void addClassTree(Content classContentTree) {
+        if (!classDoc.isClass()) {
+            return;
+        }
+        classContentTree.addContent(getClassInheritenceTree(classDoc));
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public void addTypeParamInfo(Content classInfoTree) {
+        if (classDoc.typeParamTags().length > 0) {
+            TagletOutput output = (new ParamTaglet()).getTagletOutput(classDoc,
+                    getTagletWriterInstance(false));
+            Content typeParam = new RawHtml(output.toString());
+            Content dl = HtmlTree.DL(typeParam);
+            classInfoTree.addContent(dl);
+        }
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public void addSubClassInfo(Content classInfoTree) {
+        if (classDoc.isClass()) {
+            if (classDoc.qualifiedName().equals("java.lang.Object") ||
+                    classDoc.qualifiedName().equals("org.omg.CORBA.Object")) {
+                return;    // Don't generate the list, too huge
+            }
+            List<ClassDoc> subclasses = classtree.subs(classDoc, false);
+            if (subclasses.size() > 0) {
+                Content label = getResource(
+                        "doclet.Subclasses");
+                Content dt = HtmlTree.DT(label);
+                Content dl = HtmlTree.DL(dt);
+                dl.addContent(getClassLinks(LinkInfoImpl.CONTEXT_SUBCLASSES,
+                        subclasses));
+                classInfoTree.addContent(dl);
+            }
+        }
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public void addSubInterfacesInfo(Content classInfoTree) {
+        if (classDoc.isInterface()) {
+            List<ClassDoc> subInterfaces = classtree.allSubs(classDoc, false);
+            if (subInterfaces.size() > 0) {
+                Content label = getResource(
+                        "doclet.Subinterfaces");
+                Content dt = HtmlTree.DT(label);
+                Content dl = HtmlTree.DL(dt);
+                dl.addContent(getClassLinks(LinkInfoImpl.CONTEXT_SUBINTERFACES,
+                        subInterfaces));
+                classInfoTree.addContent(dl);
             }
         }
     }
@@ -237,272 +424,178 @@
     /**
      * {@inheritDoc}
      */
-    public void writeClassTagInfo() {
-        if(!configuration.nocomment) {
-            // Print Information about all the tags here
-            printTags(classDoc);
-            hr();
-            p();
-        } else {
-            hr();
+    public void addInterfaceUsageInfo (Content classInfoTree) {
+        if (! classDoc.isInterface()) {
+            return;
+        }
+        if (classDoc.qualifiedName().equals("java.lang.Cloneable") ||
+                classDoc.qualifiedName().equals("java.io.Serializable")) {
+            return;   // Don't generate the list, too big
+        }
+        List<ClassDoc> implcl = classtree.implementingclasses(classDoc);
+        if (implcl.size() > 0) {
+            Content label = getResource(
+                    "doclet.Implementing_Classes");
+            Content dt = HtmlTree.DT(label);
+            Content dl = HtmlTree.DL(dt);
+            dl.addContent(getClassLinks(LinkInfoImpl.CONTEXT_IMPLEMENTED_CLASSES,
+                    implcl));
+            classInfoTree.addContent(dl);
         }
     }
 
     /**
      * {@inheritDoc}
      */
-    public void writeClassDeprecationInfo() {
-        hr();
-        Tag[] deprs = classDoc.tags("deprecated");
-        if (Util.isDeprecated(classDoc)) {
-            strongText("doclet.Deprecated");
-            if (deprs.length > 0) {
-                Tag[] commentTags = deprs[0].inlineTags();
-                if (commentTags.length > 0) {
-                    space();
-                    printInlineDeprecatedComment(classDoc, deprs[0]);
-                }
-            }
-            p();
-        }
-    }
-
-    /**
-     * Generate the indent and get the line image for the class tree.
-     * For user accessibility, the image includes the alt attribute
-     * "extended by".  (This method is not intended for a class
-     * implementing an interface, where "implemented by" would be required.)
-     *
-     * indent  integer indicating the number of spaces to indent
-     */
-    private void writeStep(int indent) {
-        print(spaces(4 * indent - 2));
-        print("<IMG SRC=\"" + relativepathNoSlash + "/resources/inherit.gif\" " +
-              "ALT=\"" + configuration.getText("doclet.extended_by") + " \">");
-    }
-
-    /**
-     * Print the class hierarchy tree for the given class.
-     * @param type the class to print the hierarchy for.
-     * @return return the amount that should be indented in
-     * the next level of the tree.
-     */
-    private int writeTreeForClassHelper(Type type) {
-        Type sup = Util.getFirstVisibleSuperClass(
-            type instanceof ClassDoc ? (ClassDoc) type : type.asClassDoc(),
-            configuration());
-        int indent = 0;
-        if (sup != null) {
-            indent = writeTreeForClassHelper(sup);
-            writeStep(indent);
-        }
-
-        if (type.equals(classDoc)) {
-            String typeParameters = getTypeParameterLinks(
-                new LinkInfoImpl(
-                    LinkInfoImpl.CONTEXT_TREE,
-                    classDoc, false));
-            if (configuration.shouldExcludeQualifier(
-                    classDoc.containingPackage().name())) {
-                strong(type.asClassDoc().name() + typeParameters);
-            } else {
-                strong(type.asClassDoc().qualifiedName() + typeParameters);
-            }
-        } else {
-            print(getLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_CLASS_TREE_PARENT,
-                    type instanceof ClassDoc ? (ClassDoc) type : type,
-                    configuration.getClassName(type.asClassDoc()), false)));
-        }
-        println();
-        return indent + 1;
-    }
-
-    /**
-     * Print the class hierarchy tree for this class only.
-     */
-    public void writeClassTree() {
-        if (! classDoc.isClass()) {
-            return;
-        }
-        pre();
-        writeTreeForClassHelper(classDoc);
-        preEnd();
-    }
-
-    /**
-     * Write the type parameter information.
-     */
-    public void writeTypeParamInfo() {
-        if (classDoc.typeParamTags().length > 0) {
-            dl();
-            dt();
-            TagletOutput output = (new ParamTaglet()).getTagletOutput(classDoc,
-                getTagletWriterInstance(false));
-            print(output.toString());
-            dtEnd();
-            dlEnd();
+    public void addImplementedInterfacesInfo(Content classInfoTree) {
+        //NOTE:  we really should be using ClassDoc.interfaceTypes() here, but
+        //       it doesn't walk up the tree like we want it to.
+        List<Type> interfaceArray = Util.getAllInterfaces(classDoc, configuration);
+        if (classDoc.isClass() && interfaceArray.size() > 0) {
+            Content label = getResource(
+                    "doclet.All_Implemented_Interfaces");
+            Content dt = HtmlTree.DT(label);
+            Content dl = HtmlTree.DL(dt);
+            dl.addContent(getClassLinks(LinkInfoImpl.CONTEXT_IMPLEMENTED_INTERFACES,
+                    interfaceArray));
+            classInfoTree.addContent(dl);
         }
     }
 
     /**
      * {@inheritDoc}
      */
-    public void writeSubClassInfo() {
-        if (classDoc.isClass()) {
-            if (classDoc.qualifiedName().equals("java.lang.Object") ||
-                classDoc.qualifiedName().equals("org.omg.CORBA.Object")) {
-                return;    // Don't generate the list, too huge
+    public void addSuperInterfacesInfo(Content classInfoTree) {
+        //NOTE:  we really should be using ClassDoc.interfaceTypes() here, but
+        //       it doesn't walk up the tree like we want it to.
+        List<Type> interfaceArray = Util.getAllInterfaces(classDoc, configuration);
+        if (classDoc.isInterface() && interfaceArray.size() > 0) {
+            Content label = getResource(
+                    "doclet.All_Superinterfaces");
+            Content dt = HtmlTree.DT(label);
+            Content dl = HtmlTree.DL(dt);
+            dl.addContent(getClassLinks(LinkInfoImpl.CONTEXT_SUPER_INTERFACES,
+                    interfaceArray));
+            classInfoTree.addContent(dl);
+        }
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public void addNestedClassInfo(Content classInfoTree) {
+        ClassDoc outerClass = classDoc.containingClass();
+        if (outerClass != null) {
+            Content label;
+            if (outerClass.isInterface()) {
+                label = getResource(
+                        "doclet.Enclosing_Interface");
+            } else {
+                label = getResource(
+                        "doclet.Enclosing_Class");
             }
-            List<ClassDoc> subclasses = classtree.subs(classDoc, false);
-            if (subclasses.size() > 0) {
-                dl();
-                dt();
-                strongText("doclet.Subclasses");
-                dtEnd();
-                writeClassLinks(LinkInfoImpl.CONTEXT_SUBCLASSES,
-                    subclasses);
-                dlEnd();
-            }
+            Content dt = HtmlTree.DT(label);
+            Content dl = HtmlTree.DL(dt);
+            Content dd = new HtmlTree(HtmlTag.DD);
+            dd.addContent(new RawHtml(getLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_CLASS, outerClass,
+                    false))));
+            dl.addContent(dd);
+            classInfoTree.addContent(dl);
         }
     }
 
     /**
      * {@inheritDoc}
      */
-    public void writeSubInterfacesInfo() {
-        if (classDoc.isInterface()) {
-            List<ClassDoc> subInterfaces = classtree.allSubs(classDoc, false);
-            if (subInterfaces.size() > 0) {
-                dl();
-                dt();
-                strongText("doclet.Subinterfaces");
-                dtEnd();
-                writeClassLinks(LinkInfoImpl.CONTEXT_SUBINTERFACES,
-                    subInterfaces);
-                dlEnd();
+    public void addClassDeprecationInfo(Content classInfoTree) {
+        Content hr = new HtmlTree(HtmlTag.HR);
+        classInfoTree.addContent(hr);
+        Tag[] deprs = classDoc.tags("deprecated");
+        if (Util.isDeprecated(classDoc)) {
+            Content strong = HtmlTree.STRONG(deprecatedPhrase);
+            Content div = HtmlTree.DIV(HtmlStyle.block, strong);
+            if (deprs.length > 0) {
+                Tag[] commentTags = deprs[0].inlineTags();
+                if (commentTags.length > 0) {
+                    div.addContent(getSpace());
+                    addInlineDeprecatedComment(classDoc, deprs[0], div);
+                }
             }
+            classInfoTree.addContent(div);
         }
     }
 
     /**
-     * If this is the interface which are the classes, that implement this?
+     * Get links to the given classes.
+     *
+     * @param context the id of the context where the link will be printed
+     * @param list the list of classes
+     * @return a content tree for the class list
      */
-    public void writeInterfaceUsageInfo () {
-        if (! classDoc.isInterface()) {
-            return;
-        }
-        if (classDoc.qualifiedName().equals("java.lang.Cloneable") ||
-            classDoc.qualifiedName().equals("java.io.Serializable")) {
-            return;   // Don't generate the list, too big
+    private Content getClassLinks(int context, List<?> list) {
+        Object[] typeList = list.toArray();
+        Content dd = new HtmlTree(HtmlTag.DD);
+        for (int i = 0; i < list.size(); i++) {
+            if (i > 0) {
+                Content separator = new StringContent(", ");
+                dd.addContent(separator);
+            }
+            if (typeList[i] instanceof ClassDoc) {
+                Content link = new RawHtml(getLink(
+                        new LinkInfoImpl(context, (ClassDoc)(typeList[i]))));
+                dd.addContent(link);
+            } else {
+                Content link = new RawHtml(getLink(
+                        new LinkInfoImpl(context, (Type)(typeList[i]))));
+                dd.addContent(link);
+            }
         }
-        List<ClassDoc> implcl = classtree.implementingclasses(classDoc);
-        if (implcl.size() > 0) {
-            dl();
-            dt();
-            strongText("doclet.Implementing_Classes");
-            dtEnd();
-            writeClassLinks(LinkInfoImpl.CONTEXT_IMPLEMENTED_CLASSES,
-                implcl);
-            dlEnd();
-        }
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public void writeImplementedInterfacesInfo() {
-        //NOTE:  we really should be using ClassDoc.interfaceTypes() here, but
-        //       it doesn't walk up the tree like we want it to.
-        List<Type> interfaceArray = Util.getAllInterfaces(classDoc, configuration);
-        if (classDoc.isClass() && interfaceArray.size() > 0) {
-            dl();
-            dt();
-            strongText("doclet.All_Implemented_Interfaces");
-            dtEnd();
-            writeClassLinks(LinkInfoImpl.CONTEXT_IMPLEMENTED_INTERFACES,
-                interfaceArray);
-            dlEnd();
-        }
+        return dd;
     }
 
     /**
      * {@inheritDoc}
      */
-    public void writeSuperInterfacesInfo() {
-        //NOTE:  we really should be using ClassDoc.interfaceTypes() here, but
-        //       it doesn't walk up the tree like we want it to.
-        List<Type> interfaceArray = Util.getAllInterfaces(classDoc, configuration);
-        if (classDoc.isInterface() && interfaceArray.size() > 0) {
-            dl();
-            dt();
-            strongText("doclet.All_Superinterfaces");
-            dtEnd();
-            writeClassLinks(LinkInfoImpl.CONTEXT_SUPER_INTERFACES,
-                interfaceArray);
-            dlEnd();
-        }
+    protected Content getNavLinkTree() {
+        Content treeLinkContent = getHyperLink("package-tree.html",
+                "", treeLabel, "", "");
+        Content li = HtmlTree.LI(treeLinkContent);
+        return li;
     }
 
     /**
-     * Generate links to the given classes.
+     * Add summary details to the navigation bar.
+     *
+     * @param subDiv the content tree to which the summary detail links will be added
      */
-    private void writeClassLinks(int context, List<?> list) {
-        Object[] typeList = list.toArray();
-        //Sort the list to be printed.
-        print(' ');
-        dd();
-        for (int i = 0; i < list.size(); i++) {
-            if (i > 0) {
-                print(", ");
-            }
-            if (typeList[i] instanceof ClassDoc) {
-                printLink(new LinkInfoImpl(context, (ClassDoc)(typeList[i])));
-
-            } else {
-                printLink(new LinkInfoImpl(context, (Type)(typeList[i])));
-            }
-        }
-        ddEnd();
-    }
-
-    protected void navLinkTree() {
-        navCellStart();
-        printHyperLink("package-tree.html", "",
-            configuration.getText("doclet.Tree"), true, "NavBarFont1");
-        navCellEnd();
-    }
-
-    protected void printSummaryDetailLinks() {
+    protected void addSummaryDetailLinks(Content subDiv) {
         try {
-            tr();
-            tdVAlignClass("top", "NavBarCell3");
-            font("-2");
-            print("  ");
-            navSummaryLinks();
-            fontEnd();
-            tdEnd();
-            tdVAlignClass("top", "NavBarCell3");
-            font("-2");
-            navDetailLinks();
-            fontEnd();
-            tdEnd();
-            trEnd();
+            Content div = HtmlTree.DIV(getNavSummaryLinks());
+            div.addContent(getNavDetailLinks());
+            subDiv.addContent(div);
         } catch (Exception e) {
             e.printStackTrace();
             throw new DocletAbortException();
         }
     }
 
-    protected void navSummaryLinks() throws Exception {
-        printText("doclet.Summary");
-        space();
+    /**
+     * Get summary links for navigation bar.
+     *
+     * @return the content tree for the navigation summary links
+     */
+    protected Content getNavSummaryLinks() throws Exception {
+        Content li = HtmlTree.LI(summaryLabel);
+        li.addContent(getSpace());
+        Content ulNav = HtmlTree.UL(HtmlStyle.subNavList, li);
         MemberSummaryBuilder memberSummaryBuilder = (MemberSummaryBuilder)
-            configuration.getBuilderFactory().getMemberSummaryBuilder(this);
+                configuration.getBuilderFactory().getMemberSummaryBuilder(this);
         String[] navLinkLabels =  new String[] {
             "doclet.navNested", "doclet.navEnum", "doclet.navField", "doclet.navConstructor",
-                "doclet.navMethod"
+            "doclet.navMethod"
         };
         for (int i = 0; i < navLinkLabels.length; i++ ) {
+            Content liNav = new HtmlTree(HtmlTag.LI);
             if (i == VisibleMemberMap.ENUM_CONSTANTS && ! classDoc.isEnum()) {
                 continue;
             }
@@ -511,38 +604,41 @@
             }
             AbstractMemberWriter writer =
                 ((AbstractMemberWriter) memberSummaryBuilder.
-                    getMemberSummaryWriter(i));
+                getMemberSummaryWriter(i));
             if (writer == null) {
-                printText(navLinkLabels[i]);
+                liNav.addContent(getResource(navLinkLabels[i]));
             } else {
-                writer.navSummaryLink(
-                    memberSummaryBuilder.members(i),
-                    memberSummaryBuilder.getVisibleMemberMap(i));
+                writer.addNavSummaryLink(
+                        memberSummaryBuilder.members(i),
+                        memberSummaryBuilder.getVisibleMemberMap(i), liNav);
             }
             if (i < navLinkLabels.length-1) {
-                navGap();
+                addNavGap(liNav);
             }
+            ulNav.addContent(liNav);
         }
+        return ulNav;
     }
 
     /**
-     * Method navDetailLinks
+     * Get detail links for the navigation bar.
      *
-     * @throws   Exception
-     *
+     * @return the content tree for the detail links
      */
-    protected void navDetailLinks() throws Exception {
-        printText("doclet.Detail");
-        space();
+    protected Content getNavDetailLinks() throws Exception {
+        Content li = HtmlTree.LI(detailLabel);
+        li.addContent(getSpace());
+        Content ulNav = HtmlTree.UL(HtmlStyle.subNavList, li);
         MemberSummaryBuilder memberSummaryBuilder = (MemberSummaryBuilder)
-            configuration.getBuilderFactory().getMemberSummaryBuilder(this);
+                configuration.getBuilderFactory().getMemberSummaryBuilder(this);
         String[] navLinkLabels =  new String[] {
             "doclet.navNested", "doclet.navEnum", "doclet.navField", "doclet.navConstructor",
-                "doclet.navMethod"
+            "doclet.navMethod"
         };
         for (int i = 1; i < navLinkLabels.length; i++ ) {
+            Content liNav = new HtmlTree(HtmlTag.LI);
             AbstractMemberWriter writer =
-                ((AbstractMemberWriter) memberSummaryBuilder.
+                    ((AbstractMemberWriter) memberSummaryBuilder.
                     getMemberSummaryWriter(i));
             if (i == VisibleMemberMap.ENUM_CONSTANTS && ! classDoc.isEnum()) {
                 continue;
@@ -551,43 +647,27 @@
                 continue;
             }
             if (writer == null) {
-                printText(navLinkLabels[i]);
+                liNav.addContent(getResource(navLinkLabels[i]));
             } else {
-                writer.navDetailLink(memberSummaryBuilder.members(i));
+                writer.addNavDetailLink(memberSummaryBuilder.members(i), liNav);
             }
             if (i < navLinkLabels.length - 1) {
-                navGap();
+                addNavGap(liNav);
             }
+            ulNav.addContent(liNav);
         }
-    }
-
-    protected void navGap() {
-        space();
-        print('|');
-        space();
+        return ulNav;
     }
 
     /**
-     * If this is an inner class or interface, write the enclosing class or
-     * interface.
+     * Add gap between navigation bar elements.
+     *
+     * @param liNav the content tree to which the gap will be added
      */
-    public void writeNestedClassInfo() {
-        ClassDoc outerClass = classDoc.containingClass();
-        if (outerClass != null) {
-            dl();
-            dt();
-            if (outerClass.isInterface()) {
-                strongText("doclet.Enclosing_Interface");
-            } else {
-                strongText("doclet.Enclosing_Class");
-            }
-            dtEnd();
-            dd();
-            printLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_CLASS, outerClass,
-                false));
-            ddEnd();
-            dlEnd();
-        }
+    protected void addNavGap(Content liNav) {
+        liNav.addContent(getSpace());
+        liNav.addContent("|");
+        liNav.addContent(getSpace());
     }
 
     /**
@@ -598,11 +678,4 @@
     public ClassDoc getClassDoc() {
         return classDoc;
     }
-
-    /**
-     * {@inheritDoc}
-     */
-    public void completeMemberSummaryBuild() {
-        p();
-    }
 }
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ConstantsSummaryWriterImpl.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ConstantsSummaryWriterImpl.java	Mon Dec 20 21:10:57 2010 -0800
@@ -25,11 +25,12 @@
 
 package com.sun.tools.doclets.formats.html;
 
+import java.io.*;
+import java.util.*;
+import com.sun.javadoc.*;
 import com.sun.tools.doclets.internal.toolkit.*;
 import com.sun.tools.doclets.internal.toolkit.util.*;
-import com.sun.javadoc.*;
-import java.io.*;
-import java.util.*;
+import com.sun.tools.doclets.formats.html.markup.*;
 
 /**
  * Write the Constants Summary Page in HTML format.
@@ -76,67 +77,106 @@
     /**
      * {@inheritDoc}
      */
-    public void writeHeader() {
-        printHtmlHeader(configuration.getText("doclet.Constants_Summary"),
-            null, true);
-        printTop();
-        navLinks(true);
-        hr();
-
-        center();
-        h1(); printText("doclet.Constants_Summary"); h1End();
-        centerEnd();
-
-        hr(4, "noshade");
+    public Content getHeader() {
+        String label = configuration.getText("doclet.Constants_Summary");
+        Content bodyTree = getBody(true, getWindowTitle(label));
+        addTop(bodyTree);
+        addNavLinks(true, bodyTree);
+        return bodyTree;
     }
 
     /**
      * {@inheritDoc}
      */
-    public void writeFooter() {
-        hr();
-        navLinks(false);
-        printBottom();
-        printBodyHtmlEnd();
+    public Content getContentsHeader() {
+        return new HtmlTree(HtmlTag.UL);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public void addLinkToPackageContent(PackageDoc pkg, String parsedPackageName,
+            Set<String> printedPackageHeaders, Content contentListTree) {
+        String packageName = pkg.name();
+        //add link to summary
+        Content link;
+        if (packageName.length() == 0) {
+            link = getHyperLink("#" + DocletConstants.UNNAMED_PACKAGE_ANCHOR,
+                    "", defaultPackageLabel, "", "");
+        } else {
+            Content packageNameContent = getPackageLabel(parsedPackageName);
+            packageNameContent.addContent(".*");
+            link = getHyperLink("#" + parsedPackageName,
+                    "", packageNameContent, "", "");
+            printedPackageHeaders.add(parsedPackageName);
+        }
+        contentListTree.addContent(HtmlTree.LI(link));
     }
 
     /**
      * {@inheritDoc}
      */
-    public void writeContentsHeader() {
-        strong(configuration.getText("doclet.Contents"));
-        ul();
+    public Content getContentsList(Content contentListTree) {
+        Content titleContent = getResource(
+                "doclet.Constants_Summary");
+        Content pHeading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, true,
+                HtmlStyle.title, titleContent);
+        Content div = HtmlTree.DIV(HtmlStyle.header, pHeading);
+        Content headingContent = getResource(
+                "doclet.Contents");
+        div.addContent(HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, true,
+                headingContent));
+        div.addContent(contentListTree);
+        return div;
     }
 
     /**
      * {@inheritDoc}
      */
-    public void writeContentsFooter() {
-        ulEnd();
-        println();
+    public Content getConstantSummaries() {
+        HtmlTree summariesDiv = new HtmlTree(HtmlTag.DIV);
+        summariesDiv.addStyle(HtmlStyle.constantValuesContainer);
+        return summariesDiv;
     }
 
     /**
      * {@inheritDoc}
      */
-    public void writeLinkToPackageContent(PackageDoc pkg, String parsedPackageName, Set<String> printedPackageHeaders) {
-        String packageName = pkg.name();
-        //add link to summary
-        li();
-        if (packageName.length() == 0) {
-            printHyperLink("#" + DocletConstants.UNNAMED_PACKAGE_ANCHOR,
-                           DocletConstants.DEFAULT_PACKAGE_NAME);
+    public void addPackageName(PackageDoc pkg, String parsedPackageName,
+            Content summariesTree) {
+        Content pkgNameContent;
+        if (parsedPackageName.length() == 0) {
+            summariesTree.addContent(getMarkerAnchor(
+                    DocletConstants.UNNAMED_PACKAGE_ANCHOR));
+            pkgNameContent = defaultPackageLabel;
         } else {
-            printHyperLink("#" + parsedPackageName, parsedPackageName + ".*");
-            printedPackageHeaders.add(parsedPackageName);
+            summariesTree.addContent(getMarkerAnchor(
+                    parsedPackageName));
+            pkgNameContent = getPackageLabel(parsedPackageName);
         }
-        println();
+        Content headingContent = new StringContent(".*");
+        Content heading = HtmlTree.HEADING(HtmlConstants.PACKAGE_HEADING, true,
+                pkgNameContent);
+        heading.addContent(headingContent);
+        summariesTree.addContent(heading);
     }
 
     /**
      * {@inheritDoc}
      */
-    public void writeConstantMembersHeader(ClassDoc cd) {
+    public Content getClassConstantHeader() {
+        HtmlTree ul = new HtmlTree(HtmlTag.UL);
+        ul.addStyle(HtmlStyle.blockList);
+        return ul;
+    }
+
+    /**
+     * Get the table caption and header for the constant summary table
+     *
+     * @param cd classdoc to be documented
+     * @return constant members header content
+     */
+    public Content getConstantMembersHeader(ClassDoc cd) {
         //generate links backward only to public classes.
         String classlink = (cd.isPublic() || cd.isProtected())?
             getLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_CONSTANT_SUMMARY, cd,
@@ -144,112 +184,120 @@
             cd.qualifiedName();
         String name = cd.containingPackage().name();
         if (name.length() > 0) {
-            writeClassName(name + "." + classlink);
+            return getClassName(name + "." + classlink);
         } else {
-            writeClassName(classlink);
+            return getClassName(classlink);
         }
     }
 
     /**
-     * {@inheritDoc}
-     */
-    public void writeConstantMembersFooter(ClassDoc cd) {
-        tableFooter(false);
-        p();
-    }
-
-    /**
-     * Print the class name in the table heading.
-     * @param classStr the heading to print.
+     * Get the class name in the table caption and the table header.
+     *
+     * @param classStr the class name to print.
+     * @return the table caption and header
      */
-    protected void writeClassName(String classStr) {
-        table(1, 3, 0, constantsTableSummary);
-        tableSubCaptionStart();
-        write(classStr);
-        tableCaptionEnd();
-        summaryTableHeader(constantsTableHeader, "col");
-    }
-
-    private void tableFooter(boolean isHeader) {
-        fontEnd();
-        if (isHeader) {
-            thEnd();
-        } else {
-            tdEnd();
-        }
-        trEnd();
-        tableEnd();
-        p();
+    protected Content getClassName(String classStr) {
+        Content table = HtmlTree.TABLE(0, 3, 0, constantsTableSummary,
+                getTableCaption(classStr));
+        table.addContent(getSummaryTableHeader(constantsTableHeader, "col"));
+        return table;
     }
 
     /**
      * {@inheritDoc}
      */
-    public void writePackageName(PackageDoc pkg, String parsedPackageName) {
-        String pkgname;
-        if (parsedPackageName.length() == 0) {
-            anchor(DocletConstants.UNNAMED_PACKAGE_ANCHOR);
-            pkgname = DocletConstants.DEFAULT_PACKAGE_NAME;
-        } else {
-            anchor(parsedPackageName);
-            pkgname = parsedPackageName;
+    public void addConstantMembers(ClassDoc cd, List<FieldDoc> fields,
+            Content classConstantTree) {
+        currentClassDoc = cd;
+        Content tbody = new HtmlTree(HtmlTag.TBODY);
+        for (int i = 0; i < fields.size(); ++i) {
+            HtmlTree tr = new HtmlTree(HtmlTag.TR);
+            if (i%2 == 0)
+                tr.addStyle(HtmlStyle.altColor);
+            else
+                tr.addStyle(HtmlStyle.rowColor);
+            addConstantMember(fields.get(i), tr);
+            tbody.addContent(tr);
         }
-        table(1, "100%", 3, 0);
-        trBgcolorStyle("#CCCCFF", "TableHeadingColor");
-        thAlign("left");
-        font("+2");
-        write(pkgname + ".*");
-        tableFooter(true);
+        Content table = getConstantMembersHeader(cd);
+        table.addContent(tbody);
+        Content li = HtmlTree.LI(HtmlStyle.blockList, table);
+        classConstantTree.addContent(li);
+    }
+
+    /**
+     * Add the row for the constant summary table.
+     *
+     * @param member the field to be documented.
+     * @param trTree an htmltree object for the table row
+     */
+    private void addConstantMember(FieldDoc member, HtmlTree trTree) {
+        trTree.addContent(getTypeColumn(member));
+        trTree.addContent(getNameColumn(member));
+        trTree.addContent(getValue(member));
+    }
+
+    /**
+     * Get the type column for the constant summary table row.
+     *
+     * @param member the field to be documented.
+     * @return the type column of the constant table row
+     */
+    private Content getTypeColumn(FieldDoc member) {
+        Content anchor = getMarkerAnchor(currentClassDoc.qualifiedName() +
+                "." + member.name());
+        Content tdType = HtmlTree.TD(HtmlStyle.colFirst, anchor);
+        Content code = new HtmlTree(HtmlTag.CODE);
+        StringTokenizer mods = new StringTokenizer(member.modifiers());
+        while(mods.hasMoreTokens()) {
+            Content modifier = new StringContent(mods.nextToken());
+            code.addContent(modifier);
+            code.addContent(getSpace());
+        }
+        Content type = new RawHtml(getLink(new LinkInfoImpl(
+                LinkInfoImpl.CONTEXT_CONSTANT_SUMMARY, member.type())));
+        code.addContent(type);
+        tdType.addContent(code);
+        return tdType;
+    }
+
+    /**
+     * Get the name column for the constant summary table row.
+     *
+     * @param member the field to be documented.
+     * @return the name column of the constant table row
+     */
+    private Content getNameColumn(FieldDoc member) {
+        Content nameContent = new RawHtml(getDocLink(
+                LinkInfoImpl.CONTEXT_CONSTANT_SUMMARY, member, member.name(), false));
+        Content code = HtmlTree.CODE(nameContent);
+        return HtmlTree.TD(code);
+    }
+
+    /**
+     * Get the value column for the constant summary table row.
+     *
+     * @param member the field to be documented.
+     * @return the value column of the constant table row
+     */
+    private Content getValue(FieldDoc member) {
+        Content valueContent = new StringContent(member.constantValueExpression());
+        Content code = HtmlTree.CODE(valueContent);
+        return HtmlTree.TD(HtmlStyle.colLast, code);
     }
 
     /**
      * {@inheritDoc}
      */
-    public void writeConstantMembers(ClassDoc cd, List<FieldDoc> fields) {
-        currentClassDoc = cd;
-        for (int i = 0; i < fields.size(); ++i) {
-            writeConstantMember(fields.get(i));
-        }
-    }
-
-    private void writeConstantMember(FieldDoc member) {
-        trBgcolorStyle("white", "TableRowColor");
-        anchor(currentClassDoc.qualifiedName() + "." + member.name());
-        writeTypeColumn(member);
-        writeNameColumn(member);
-        writeValue(member);
-        trEnd();
+    public void addFooter(Content contentTree) {
+        addNavLinks(false, contentTree);
+        addBottom(contentTree);
     }
 
-    private void writeTypeColumn(FieldDoc member) {
-        tdAlign("right");
-        font("-1");
-        code();
-        StringTokenizer mods = new StringTokenizer(member.modifiers());
-        while(mods.hasMoreTokens()) {
-            print(mods.nextToken() + "&nbsp;");
-        }
-        printLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_CONSTANT_SUMMARY,
-            member.type()));
-        codeEnd();
-        fontEnd();
-        tdEnd();
-    }
-
-    private void writeNameColumn(FieldDoc member) {
-        tdAlign("left");
-        code();
-        printDocLink(LinkInfoImpl.CONTEXT_CONSTANT_SUMMARY, member,
-            member.name(), false);
-        codeEnd();
-        tdEnd();
-    }
-
-    private void writeValue(FieldDoc member) {
-        tdAlign("right");
-        code();
-        print(Util.escapeHtmlChars(member.constantValueExpression()));
-        codeEnd();
-        tdEnd();
+    /**
+     * {@inheritDoc}
+     */
+    public void printDocument(Content contentTree) {
+        printHtmlDocument(null, true, contentTree);
     }
 }
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ConstructorWriterImpl.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ConstructorWriterImpl.java	Mon Dec 20 21:10:57 2010 -0800
@@ -29,6 +29,7 @@
 import java.util.*;
 
 import com.sun.javadoc.*;
+import com.sun.tools.doclets.formats.html.markup.*;
 import com.sun.tools.doclets.internal.toolkit.*;
 import com.sun.tools.doclets.internal.toolkit.util.*;
 
@@ -43,7 +44,6 @@
     implements ConstructorWriter, MemberSummaryWriter {
 
     private boolean foundNonPubConstructor = false;
-    private boolean printedSummaryHeader = false;
 
     /**
      * Construct a new ConstructorWriterImpl.
@@ -75,125 +75,112 @@
     }
 
     /**
-     * Write the constructors summary header for the given class.
-     *
-     * @param classDoc the class the summary belongs to.
+     * {@inheritDoc}
      */
-    public void writeMemberSummaryHeader(ClassDoc classDoc) {
-        printedSummaryHeader = true;
-        writer.println();
-        writer.println("<!-- ======== CONSTRUCTOR SUMMARY ======== -->");
-        writer.println();
-        writer.printSummaryHeader(this, classDoc);
-    }
-
-    /**
-     * Write the constructors summary footer for the given class.
-     *
-     * @param classDoc the class the summary belongs to.
-     */
-    public void writeMemberSummaryFooter(ClassDoc classDoc) {
-        writer.printSummaryFooter(this, classDoc);
+    public Content getMemberSummaryHeader(ClassDoc classDoc,
+            Content memberSummaryTree) {
+        memberSummaryTree.addContent(HtmlConstants.START_OF_CONSTRUCTOR_SUMMARY);
+        Content memberTree = writer.getMemberTreeHeader();
+        writer.addSummaryHeader(this, classDoc, memberTree);
+        return memberTree;
     }
 
     /**
-     * Write the header for the constructor documentation.
-     *
-     * @param classDoc the class that the constructors belong to.
+     * {@inheritDoc}
      */
-    public void writeHeader(ClassDoc classDoc, String header) {
-        writer.println();
-        writer.println("<!-- ========= CONSTRUCTOR DETAIL ======== -->");
-        writer.println();
-        writer.anchor("constructor_detail");
-        writer.printTableHeadingBackground(header);
+    public Content getConstructorDetailsTreeHeader(ClassDoc classDoc,
+            Content memberDetailsTree) {
+        memberDetailsTree.addContent(HtmlConstants.START_OF_CONSTRUCTOR_DETAILS);
+        Content constructorDetailsTree = writer.getMemberTreeHeader();
+        constructorDetailsTree.addContent(writer.getMarkerAnchor("constructor_detail"));
+        Content heading = HtmlTree.HEADING(HtmlConstants.DETAILS_HEADING,
+                writer.constructorDetailsLabel);
+        constructorDetailsTree.addContent(heading);
+        return constructorDetailsTree;
     }
 
     /**
-     * Write the constructor header for the given constructor.
-     *
-     * @param constructor the constructor being documented.
-     * @param isFirst the flag to indicate whether or not the constructor is the
-     *        first to be documented.
+     * {@inheritDoc}
      */
-    public void writeConstructorHeader(ConstructorDoc constructor, boolean isFirst) {
-        if (! isFirst) {
-            writer.printMemberHeader();
-        }
-        writer.println();
+    public Content getConstructorDocTreeHeader(ConstructorDoc constructor,
+            Content constructorDetailsTree) {
         String erasureAnchor;
         if ((erasureAnchor = getErasureAnchor(constructor)) != null) {
-            writer.anchor(erasureAnchor);
+            constructorDetailsTree.addContent(writer.getMarkerAnchor((erasureAnchor)));
         }
-        writer.anchor(constructor);
-        writer.h3();
-        writer.print(constructor.name());
-        writer.h3End();
+        constructorDetailsTree.addContent(
+                writer.getMarkerAnchor(writer.getAnchor(constructor)));
+        Content constructorDocTree = writer.getMemberTreeHeader();
+        Content heading = new HtmlTree(HtmlConstants.MEMBER_HEADING);
+        heading.addContent(constructor.name());
+        constructorDocTree.addContent(heading);
+        return constructorDocTree;
     }
 
     /**
-     * Write the signature for the given constructor.
-     *
-     * @param constructor the constructor being documented.
+     * {@inheritDoc}
      */
-    public void writeSignature(ConstructorDoc constructor) {
+    public Content getSignature(ConstructorDoc constructor) {
         writer.displayLength = 0;
-        writer.pre();
-        writer.writeAnnotationInfo(constructor);
-        printModifiers(constructor);
-        //printReturnType((ConstructorDoc)constructor);
+        Content pre = new HtmlTree(HtmlTag.PRE);
+        writer.addAnnotationInfo(constructor, pre);
+        addModifiers(constructor, pre);
         if (configuration().linksource) {
-            writer.printSrcLink(constructor, constructor.name());
+            Content constructorName = new StringContent(constructor.name());
+            writer.addSrcLink(constructor, constructorName, pre);
         } else {
-            strong(constructor.name());
+            addName(constructor.name(), pre);
         }
-        writeParameters(constructor);
-        writeExceptions(constructor);
-        writer.preEnd();
-        assert !writer.getMemberDetailsListPrinted();
+        addParameters(constructor, pre);
+        addExceptions(constructor, pre);
+        return pre;
     }
 
     /**
-     * Write the deprecated output for the given constructor.
-     *
-     * @param constructor the constructor being documented.
+     * {@inheritDoc}
      */
-    public void writeDeprecated(ConstructorDoc constructor) {
-        printDeprecated(constructor);
+    @Override
+    public void setSummaryColumnStyle(HtmlTree tdTree) {
+        if (foundNonPubConstructor)
+            tdTree.addStyle(HtmlStyle.colLast);
+        else
+            tdTree.addStyle(HtmlStyle.colOne);
     }
 
     /**
-     * Write the comments for the given constructor.
-     *
-     * @param constructor the constructor being documented.
+     * {@inheritDoc}
      */
-    public void writeComments(ConstructorDoc constructor) {
-        printComment(constructor);
+    public void addDeprecated(ConstructorDoc constructor, Content constructorDocTree) {
+        addDeprecatedInfo(constructor, constructorDocTree);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public void addComments(ConstructorDoc constructor, Content constructorDocTree) {
+        addComment(constructor, constructorDocTree);
     }
 
     /**
-     * Write the tag output for the given constructor.
-     *
-     * @param constructor the constructor being documented.
+     * {@inheritDoc}
      */
-    public void writeTags(ConstructorDoc constructor) {
-        writer.printTags(constructor);
+    public void addTags(ConstructorDoc constructor, Content constructorDocTree) {
+        writer.addTagsInfo(constructor, constructorDocTree);
     }
 
     /**
-     * Write the constructor footer.
+     * {@inheritDoc}
      */
-    public void writeConstructorFooter() {
-        printMemberFooter();
+    public Content getConstructorDetails(Content constructorDetailsTree) {
+        return getMemberTree(constructorDetailsTree);
     }
 
     /**
-     * Write the footer for the constructor documentation.
-     *
-     * @param classDoc the class that the constructors belong to.
+     * {@inheritDoc}
      */
-    public void writeFooter(ClassDoc classDoc) {
-        //No footer to write for constructor documentation
+    public Content getConstructorDoc(Content constructorDocTree,
+            boolean isLastContent) {
+        return getMemberTree(constructorDocTree, isLastContent);
     }
 
     /**
@@ -212,17 +199,35 @@
         this.foundNonPubConstructor = foundNonPubConstructor;
     }
 
-    public void printSummaryLabel() {
-        writer.printText("doclet.Constructor_Summary");
+    /**
+     * {@inheritDoc}
+     */
+    public void addSummaryLabel(Content memberTree) {
+        Content label = HtmlTree.HEADING(HtmlConstants.SUMMARY_HEADING,
+                writer.getResource("doclet.Constructor_Summary"));
+        memberTree.addContent(label);
     }
 
-    public void printTableSummary() {
-        writer.tableIndexSummary(configuration().getText("doclet.Member_Table_Summary",
+    /**
+     * {@inheritDoc}
+     */
+    public String getTableSummary() {
+        return configuration().getText("doclet.Member_Table_Summary",
                 configuration().getText("doclet.Constructor_Summary"),
-                configuration().getText("doclet.constructors")));
+                configuration().getText("doclet.constructors"));
     }
 
-    public void printSummaryTableHeader(ProgramElementDoc member) {
+    /**
+     * {@inheritDoc}
+     */
+    public String getCaption() {
+        return configuration().getText("doclet.Constructors");
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public String[] getSummaryTableHeader(ProgramElementDoc member) {
         String[] header;
         if (foundNonPubConstructor) {
             header = new String[] {
@@ -239,87 +244,73 @@
                         configuration().getText("doclet.Description"))
             };
         }
-        writer.summaryTableHeader(header, "col");
+        return header;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public void addSummaryAnchor(ClassDoc cd, Content memberTree) {
+        memberTree.addContent(writer.getMarkerAnchor("constructor_summary"));
     }
 
-    public void printSummaryAnchor(ClassDoc cd) {
-        writer.anchor("constructor_summary");
+    /**
+     * {@inheritDoc}
+     */
+    public void addInheritedSummaryAnchor(ClassDoc cd, Content inheritedTree) {
     }
 
-    public void printInheritedSummaryAnchor(ClassDoc cd) {
-    }   // no such
-
-    public void printInheritedSummaryLabel(ClassDoc cd) {
-        // no such
+    /**
+     * {@inheritDoc}
+     */
+    public void addInheritedSummaryLabel(ClassDoc cd, Content inheritedTree) {
     }
 
     public int getMemberKind() {
         return VisibleMemberMap.CONSTRUCTORS;
     }
 
-    protected void navSummaryLink(List<?> members) {
-        printNavSummaryLink(classdoc,
-                members.size() > 0? true: false);
-    }
-
-    protected void printNavSummaryLink(ClassDoc cd, boolean link) {
+    /**
+     * {@inheritDoc}
+     */
+    protected Content getNavSummaryLink(ClassDoc cd, boolean link) {
         if (link) {
-            writer.printHyperLink("", "constructor_summary",
-                    ConfigurationImpl.getInstance().getText("doclet.navConstructor"));
-        } else {
-            writer.printText("doclet.navConstructor");
-        }
-    }
-
-    protected void printNavDetailLink(boolean link) {
-        if (link) {
-            writer.printHyperLink("", "constructor_detail",
-                    ConfigurationImpl.getInstance().getText("doclet.navConstructor"));
+            return writer.getHyperLink("", "constructor_summary",
+                    writer.getResource("doclet.navConstructor"));
         } else {
-            writer.printText("doclet.navConstructor");
-        }
-    }
-
-    protected void printSummaryType(ProgramElementDoc member) {
-        if (foundNonPubConstructor) {
-            writer.printTypeSummaryHeader();
-            if (member.isProtected()) {
-                print("protected ");
-            } else if (member.isPrivate()) {
-                print("private ");
-            } else if (member.isPublic()) {
-                writer.space();
-            } else {
-                writer.printText("doclet.Package_private");
-            }
-            writer.printTypeSummaryFooter();
-        }
-    }
-
-    /**
-     * Write the inherited member summary header for the given class.
-     *
-     * @param classDoc the class the summary belongs to.
-     */
-    public void writeInheritedMemberSummaryHeader(ClassDoc classDoc) {
-        if(! printedSummaryHeader){
-            //We don't want inherited summary to not be under heading.
-            writeMemberSummaryHeader(classDoc);
-            writeMemberSummaryFooter(classDoc);
-            printedSummaryHeader = true;
+            return writer.getResource("doclet.navConstructor");
         }
     }
 
     /**
      * {@inheritDoc}
      */
-    public void writeInheritedMemberSummary(ClassDoc classDoc,
-        ProgramElementDoc member, boolean isFirst, boolean isLast) {}
+    protected void addNavDetailLink(boolean link, Content liNav) {
+        if (link) {
+            liNav.addContent(writer.getHyperLink("", "constructor_detail",
+                    writer.getResource("doclet.navConstructor")));
+        } else {
+            liNav.addContent(writer.getResource("doclet.navConstructor"));
+        }
+    }
 
     /**
-     * Write the inherited member summary footer for the given class.
-     *
-     * @param classDoc the class the summary belongs to.
+     * {@inheritDoc}
      */
-    public void writeInheritedMemberSummaryFooter(ClassDoc classDoc) {}
+    protected void addSummaryType(ProgramElementDoc member, Content tdSummaryType) {
+        if (foundNonPubConstructor) {
+            Content code = new HtmlTree(HtmlTag.CODE);
+            if (member.isProtected()) {
+                code.addContent("protected ");
+            } else if (member.isPrivate()) {
+                code.addContent("private ");
+            } else if (member.isPublic()) {
+                code.addContent(writer.getSpace());
+            } else {
+                code.addContent(
+                        configuration().getText("doclet.Package_private"));
+            }
+            tdSummaryType.addContent(code);
+        }
+    }
 }
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/DeprecatedListWriter.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/DeprecatedListWriter.java	Mon Dec 20 21:10:57 2010 -0800
@@ -25,9 +25,11 @@
 
 package com.sun.tools.doclets.formats.html;
 
+import java.io.*;
+import com.sun.tools.doclets.internal.toolkit.*;
 import com.sun.tools.doclets.internal.toolkit.util.DeprecatedAPIListBuilder;
 import com.sun.tools.doclets.internal.toolkit.util.*;
-import java.io.*;
+import com.sun.tools.doclets.formats.html.markup.*;
 
 /**
  * Generate File to list all the deprecated classes and class members with the
@@ -125,28 +127,21 @@
     }
 
     /**
-     * Print the deprecated API list. Separately print all class kinds and
-     * member kinds.
+     * Generate the deprecated API list.
      *
      * @param deprapi list of deprecated API built already.
      */
     protected void generateDeprecatedListFile(DeprecatedAPIListBuilder deprapi)
-             throws IOException {
-        writeHeader();
-
-        strong(configuration.getText("doclet.Contents"));
-        ul();
-        for (int i = 0; i < DeprecatedAPIListBuilder.NUM_TYPES; i++) {
-            writeIndexLink(deprapi, i);
-        }
-        ulEnd();
-        println();
-
+            throws IOException {
+        Content body = getHeader();
+        body.addContent(getContentsList(deprapi));
         String memberTableSummary;
         String[] memberTableHeader = new String[1];
+        HtmlTree div = new HtmlTree(HtmlTag.DIV);
+        div.addStyle(HtmlStyle.contentContainer);
         for (int i = 0; i < DeprecatedAPIListBuilder.NUM_TYPES; i++) {
             if (deprapi.hasDocumentation(i)) {
-                writeAnchor(deprapi, i);
+                addAnchor(deprapi, i, div);
                 memberTableSummary =
                         configuration.getText("doclet.Member_Table_Summary",
                         configuration.getText(HEADING_KEYS[i]),
@@ -154,66 +149,87 @@
                 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], memberTableSummary, memberTableHeader);
+                writers[i].addDeprecatedAPI(deprapi.getList(i),
+                        HEADING_KEYS[i], memberTableSummary, memberTableHeader, div);
             }
         }
-        printDeprecatedFooter();
+        body.addContent(div);
+        addNavLinks(false, body);
+        addBottom(body);
+        printHtmlDocument(null, true, body);
     }
 
-    private void writeIndexLink(DeprecatedAPIListBuilder builder,
-            int type) {
+    /**
+     * Add the index link.
+     *
+     * @param builder the deprecated list builder
+     * @param type the type of list being documented
+     * @param contentTree the content tree to which the index link will be added
+     */
+    private void addIndexLink(DeprecatedAPIListBuilder builder,
+            int type, Content contentTree) {
         if (builder.hasDocumentation(type)) {
-            li();
-            printHyperLink("#" + ANCHORS[type],
-                configuration.getText(HEADING_KEYS[type]));
-            println();
-        }
-    }
-
-    private void writeAnchor(DeprecatedAPIListBuilder builder, int type) {
-        if (builder.hasDocumentation(type)) {
-            anchor(ANCHORS[type]);
+            Content li = HtmlTree.LI(getHyperLink("#" + ANCHORS[type],
+                    getResource(HEADING_KEYS[type])));
+            contentTree.addContent(li);
         }
     }
 
     /**
-     * Print the navigation bar and header for the deprecated API Listing.
+     * Get the contents list.
+     *
+     * @param deprapi the deprecated list builder
+     * @return a content tree for the contents list
      */
-    protected void writeHeader() {
-        printHtmlHeader(configuration.getText("doclet.Window_Deprecated_List"),
-            null, true);
-        printTop();
-        navLinks(true);
-        hr();
-        center();
-        h2();
-        strongText("doclet.Deprecated_API");
-        h2End();
-        centerEnd();
-
-        hr(4, "noshade");
+    public Content getContentsList(DeprecatedAPIListBuilder deprapi) {
+        Content headContent = getResource("doclet.Deprecated_API");
+        Content heading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, true,
+                HtmlStyle.title, headContent);
+        Content div = HtmlTree.DIV(HtmlStyle.header, heading);
+        Content headingContent = getResource("doclet.Contents");
+        div.addContent(HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, true,
+                headingContent));
+        Content ul = new HtmlTree(HtmlTag.UL);
+        for (int i = 0; i < DeprecatedAPIListBuilder.NUM_TYPES; i++) {
+            addIndexLink(deprapi, i, ul);
+        }
+        div.addContent(ul);
+        return div;
     }
 
     /**
-     * Print the navigation bar and the footer for the deprecated API Listing.
+     * Add the anchor.
+     *
+     * @param builder the deprecated list builder
+     * @param type the type of list being documented
+     * @param contentTree the content tree to which the anchor will be added
      */
-    protected void printDeprecatedFooter() {
-        hr();
-        navLinks(false);
-        printBottom();
-        printBodyHtmlEnd();
+    private void addAnchor(DeprecatedAPIListBuilder builder, int type, Content htmlTree) {
+        if (builder.hasDocumentation(type)) {
+            htmlTree.addContent(getMarkerAnchor(ANCHORS[type]));
+        }
     }
 
     /**
-     * Highlight the word "Deprecated" in the navigation bar as this is the same
-     * page.
+     * Get the header for the deprecated API Listing.
+     *
+     * @return a content tree for the header
      */
-    protected void navLinkDeprecated() {
-        navCellRevStart();
-        fontStyle("NavBarFont1Rev");
-        strongText("doclet.navDeprecated");
-        fontEnd();
-        navCellEnd();
+    public Content getHeader() {
+        String title = configuration.getText("doclet.Window_Deprecated_List");
+        Content bodyTree = getBody(true, getWindowTitle(title));
+        addTop(bodyTree);
+        addNavLinks(true, bodyTree);
+        return bodyTree;
+    }
+
+    /**
+     * Get the deprecated label.
+     *
+     * @return a content tree for the deprecated label
+     */
+    protected Content getNavLinkDeprecated() {
+        Content li = HtmlTree.LI(HtmlStyle.navBarCell1Rev, deprecatedLabel);
+        return li;
     }
 }
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/EnumConstantWriterImpl.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/EnumConstantWriterImpl.java	Mon Dec 20 21:10:57 2010 -0800
@@ -28,6 +28,7 @@
 import java.io.*;
 
 import com.sun.javadoc.*;
+import com.sun.tools.doclets.formats.html.markup.*;
 import com.sun.tools.doclets.internal.toolkit.*;
 import com.sun.tools.doclets.internal.toolkit.util.*;
 
@@ -40,8 +41,6 @@
 public class EnumConstantWriterImpl extends AbstractMemberWriter
     implements EnumConstantWriter, MemberSummaryWriter {
 
-    private boolean printedSummaryHeader = false;
-
     public EnumConstantWriterImpl(SubWriterHolderWriter writer,
         ClassDoc classdoc) {
         super(writer, classdoc);
@@ -52,136 +51,98 @@
     }
 
     /**
-     * Write the enum constant summary header for the given class.
-     *
-     * @param classDoc the class the summary belongs to.
-     */
-    public void writeMemberSummaryHeader(ClassDoc classDoc) {
-        printedSummaryHeader = true;
-        writer.println("<!-- =========== ENUM CONSTANT SUMMARY =========== -->");
-        writer.println();
-        writer.printSummaryHeader(this, classDoc);
-    }
-
-    /**
-     * Write the enum constant summary footer for the given class.
-     *
-     * @param classDoc the class the summary belongs to.
+     * {@inheritDoc}
      */
-    public void writeMemberSummaryFooter(ClassDoc classDoc) {
-        writer.printSummaryFooter(this, classDoc);
-    }
-
-    /**
-     * Write the inherited enum constant summary header for the given class.
-     *
-     * @param classDoc the class the summary belongs to.
-     */
-    public void writeInheritedMemberSummaryHeader(ClassDoc classDoc) {
-        if(! printedSummaryHeader){
-            //We don't want inherited summary to not be under heading.
-            writeMemberSummaryHeader(classDoc);
-            writeMemberSummaryFooter(classDoc);
-            printedSummaryHeader = true;
-        }
-        writer.printInheritedSummaryHeader(this, classDoc);
+    public Content getMemberSummaryHeader(ClassDoc classDoc,
+            Content memberSummaryTree) {
+        memberSummaryTree.addContent(HtmlConstants.START_OF_ENUM_CONSTANT_SUMMARY);
+        Content memberTree = writer.getMemberTreeHeader();
+        writer.addSummaryHeader(this, classDoc, memberTree);
+        return memberTree;
     }
 
     /**
      * {@inheritDoc}
      */
-    public void writeInheritedMemberSummary(ClassDoc classDoc,
-        ProgramElementDoc enumConstant, boolean isFirst, boolean isLast) {
-        writer.printInheritedSummaryMember(this, classDoc, enumConstant, isFirst);
+    public Content getEnumConstantsDetailsTreeHeader(ClassDoc classDoc,
+            Content memberDetailsTree) {
+        memberDetailsTree.addContent(HtmlConstants.START_OF_ENUM_CONSTANT_DETAILS);
+        Content enumConstantsDetailsTree = writer.getMemberTreeHeader();
+        enumConstantsDetailsTree.addContent(writer.getMarkerAnchor("enum_constant_detail"));
+        Content heading = HtmlTree.HEADING(HtmlConstants.DETAILS_HEADING,
+                writer.enumConstantsDetailsLabel);
+        enumConstantsDetailsTree.addContent(heading);
+        return enumConstantsDetailsTree;
     }
 
     /**
-     * Write the inherited enum constant summary footer for the given class.
-     *
-     * @param classDoc the class the summary belongs to.
+     * {@inheritDoc}
      */
-    public void writeInheritedMemberSummaryFooter(ClassDoc classDoc) {
-        writer.printInheritedSummaryFooter(this, classDoc);
+    public Content getEnumConstantsTreeHeader(FieldDoc enumConstant,
+            Content enumConstantsDetailsTree) {
+        enumConstantsDetailsTree.addContent(
+                writer.getMarkerAnchor(enumConstant.name()));
+        Content enumConstantsTree = writer.getMemberTreeHeader();
+        Content heading = new HtmlTree(HtmlConstants.MEMBER_HEADING);
+        heading.addContent(enumConstant.name());
+        enumConstantsTree.addContent(heading);
+        return enumConstantsTree;
     }
 
     /**
      * {@inheritDoc}
      */
-    public void writeHeader(ClassDoc classDoc, String header) {
-        writer.println();
-        writer.println("<!-- ============ ENUM CONSTANT DETAIL =========== -->");
-        writer.println();
-        writer.anchor("enum_constant_detail");
-        writer.printTableHeadingBackground(header);
-        writer.println();
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public void writeEnumConstantHeader(FieldDoc enumConstant, boolean isFirst) {
-        if (! isFirst) {
-            writer.printMemberHeader();
-            writer.println("");
+    public Content getSignature(FieldDoc enumConstant) {
+        Content pre = new HtmlTree(HtmlTag.PRE);
+        writer.addAnnotationInfo(enumConstant, pre);
+        addModifiers(enumConstant, pre);
+        Content enumConstantLink = new RawHtml(writer.getLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_MEMBER,
+                enumConstant.type())));
+        pre.addContent(enumConstantLink);
+        pre.addContent(" ");
+        if (configuration().linksource) {
+            Content enumConstantName = new StringContent(enumConstant.name());
+            writer.addSrcLink(enumConstant, enumConstantName, pre);
+        } else {
+            addName(enumConstant.name(), pre);
         }
-        writer.anchor(enumConstant.name());
-        writer.h3();
-        writer.print(enumConstant.name());
-        writer.h3End();
+        return pre;
     }
 
     /**
      * {@inheritDoc}
      */
-    public void writeSignature(FieldDoc enumConstant) {
-        writer.pre();
-        writer.writeAnnotationInfo(enumConstant);
-        printModifiers(enumConstant);
-        writer.printLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_MEMBER,
-            enumConstant.type()));
-        print(' ');
-        if (configuration().linksource) {
-            writer.printSrcLink(enumConstant, enumConstant.name());
-        } else {
-            strong(enumConstant.name());
-        }
-        writer.preEnd();
-        assert !writer.getMemberDetailsListPrinted();
+    public void addDeprecated(FieldDoc enumConstant, Content enumConstantsTree) {
+        addDeprecatedInfo(enumConstant, enumConstantsTree);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public void addComments(FieldDoc enumConstant, Content enumConstantsTree) {
+        addComment(enumConstant, enumConstantsTree);
     }
 
     /**
      * {@inheritDoc}
      */
-    public void writeDeprecated(FieldDoc enumConstant) {
-        printDeprecated(enumConstant);
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public void writeComments(FieldDoc enumConstant) {
-        printComment(enumConstant);
+    public void addTags(FieldDoc enumConstant, Content enumConstantsTree) {
+        writer.addTagsInfo(enumConstant, enumConstantsTree);
     }
 
     /**
      * {@inheritDoc}
      */
-    public void writeTags(FieldDoc enumConstant) {
-        writer.printTags(enumConstant);
+    public Content getEnumConstantsDetails(Content enumConstantsDetailsTree) {
+        return getMemberTree(enumConstantsDetailsTree);
     }
 
     /**
      * {@inheritDoc}
      */
-    public void writeEnumConstantFooter() {
-        printMemberFooter();
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public void writeFooter(ClassDoc classDoc) {
-        //No footer to write for enum constant documentation
+    public Content getEnumConstants(Content enumConstantsTree,
+            boolean isLastContent) {
+        return getMemberTree(enumConstantsTree, isLastContent);
     }
 
     /**
@@ -195,75 +156,127 @@
         return VisibleMemberMap.ENUM_CONSTANTS;
     }
 
-    public void printSummaryLabel() {
-        writer.printText("doclet.Enum_Constant_Summary");
+    /**
+     * {@inheritDoc}
+     */
+    public void addSummaryLabel(Content memberTree) {
+        Content label = HtmlTree.HEADING(HtmlConstants.SUMMARY_HEADING,
+                writer.getResource("doclet.Enum_Constant_Summary"));
+        memberTree.addContent(label);
     }
 
-    public void printTableSummary() {
-        writer.tableIndexSummary(configuration().getText("doclet.Member_Table_Summary",
+    /**
+     * {@inheritDoc}
+     */
+    public String getTableSummary() {
+        return configuration().getText("doclet.Member_Table_Summary",
                 configuration().getText("doclet.Enum_Constant_Summary"),
-                configuration().getText("doclet.enum_constants")));
+                configuration().getText("doclet.enum_constants"));
     }
 
-    public void printSummaryTableHeader(ProgramElementDoc member) {
+    /**
+     * {@inheritDoc}
+     */
+    public String getCaption() {
+        return configuration().getText("doclet.Enum_Constants");
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public String[] getSummaryTableHeader(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");
+        return header;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public void addSummaryAnchor(ClassDoc cd, Content memberTree) {
+        memberTree.addContent(writer.getMarkerAnchor("enum_constant_summary"));
     }
 
-    public void printSummaryAnchor(ClassDoc cd) {
-        writer.anchor("enum_constant_summary");
+    /**
+     * {@inheritDoc}
+     */
+    public void addInheritedSummaryAnchor(ClassDoc cd, Content inheritedTree) {
     }
 
-    public void printInheritedSummaryAnchor(ClassDoc cd) {
-    }   // no such
-
-    public void printInheritedSummaryLabel(ClassDoc cd) {
-        // no such
+    /**
+     * {@inheritDoc}
+     */
+    public void addInheritedSummaryLabel(ClassDoc cd, Content inheritedTree) {
     }
 
-    protected void writeSummaryLink(int context, ClassDoc cd, ProgramElementDoc member) {
-        writer.strong();
-        writer.printDocLink(context, (MemberDoc) member, member.name(), false);
-        writer.strongEnd();
+    /**
+     * {@inheritDoc}
+     */
+    protected void addSummaryLink(int context, ClassDoc cd, ProgramElementDoc member,
+            Content tdSummary) {
+        Content strong = HtmlTree.STRONG(new RawHtml(
+                writer.getDocLink(context, (MemberDoc) member, member.name(), false)));
+        Content code = HtmlTree.CODE(strong);
+        tdSummary.addContent(code);
     }
 
-    protected void writeInheritedSummaryLink(ClassDoc cd,
-            ProgramElementDoc member) {
-        writer.printDocLink(LinkInfoImpl.CONTEXT_MEMBER, (MemberDoc)member,
-            member.name(), false);
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public void setSummaryColumnStyle(HtmlTree tdTree) {
+        tdTree.addStyle(HtmlStyle.colOne);
     }
 
-    protected void printSummaryType(ProgramElementDoc member) {
+    /**
+     * {@inheritDoc}
+     */
+    protected void addInheritedSummaryLink(ClassDoc cd,
+            ProgramElementDoc member, Content linksTree) {
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    protected void addSummaryType(ProgramElementDoc member, Content tdSummaryType) {
         //Not applicable.
     }
 
-    protected void writeDeprecatedLink(ProgramElementDoc member) {
-        writer.printDocLink(LinkInfoImpl.CONTEXT_MEMBER,
-            (MemberDoc) member, ((FieldDoc)member).qualifiedName(), false);
+    /**
+     * {@inheritDoc}
+     */
+    protected Content getDeprecatedLink(ProgramElementDoc member) {
+        return writer.getDocLink(LinkInfoImpl.CONTEXT_MEMBER,
+                (MemberDoc) member, ((FieldDoc)member).qualifiedName());
     }
 
-    protected void printNavSummaryLink(ClassDoc cd, boolean link) {
+    /**
+     * {@inheritDoc}
+     */
+    protected Content getNavSummaryLink(ClassDoc cd, boolean link) {
         if (link) {
-            writer.printHyperLink("", (cd == null)?
-                        "enum_constant_summary":
-                        "enum_constants_inherited_from_class_" +
-                        configuration().getClassName(cd),
-                    configuration().getText("doclet.navEnum"));
+            return writer.getHyperLink("", (cd == null)?
+                "enum_constant_summary":
+                "enum_constants_inherited_from_class_" +
+                configuration().getClassName(cd),
+                writer.getResource("doclet.navEnum"));
         } else {
-            writer.printText("doclet.navEnum");
+            return writer.getResource("doclet.navEnum");
         }
     }
 
-    protected void printNavDetailLink(boolean link) {
+    /**
+     * {@inheritDoc}
+     */
+    protected void addNavDetailLink(boolean link, Content liNav) {
         if (link) {
-            writer.printHyperLink("", "enum_constant_detail",
-                configuration().getText("doclet.navEnum"));
+            liNav.addContent(writer.getHyperLink("", "enum_constant_detail",
+                    writer.getResource("doclet.navEnum")));
         } else {
-            writer.printText("doclet.navEnum");
+            liNav.addContent(writer.getResource("doclet.navEnum"));
         }
     }
 }
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/FieldWriterImpl.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/FieldWriterImpl.java	Mon Dec 20 21:10:57 2010 -0800
@@ -28,6 +28,7 @@
 import java.io.*;
 
 import com.sun.javadoc.*;
+import com.sun.tools.doclets.formats.html.markup.*;
 import com.sun.tools.doclets.internal.toolkit.*;
 import com.sun.tools.doclets.internal.toolkit.util.*;
 
@@ -42,8 +43,6 @@
 public class FieldWriterImpl extends AbstractMemberWriter
     implements FieldWriter, MemberSummaryWriter {
 
-    private boolean printedSummaryHeader = false;
-
     public FieldWriterImpl(SubWriterHolderWriter writer, ClassDoc classdoc) {
         super(writer, classdoc);
     }
@@ -53,177 +52,118 @@
     }
 
     /**
-     * Write the fields summary header for the given class.
-     *
-     * @param classDoc the class the summary belongs to.
+     * {@inheritDoc}
      */
-    public void writeMemberSummaryHeader(ClassDoc classDoc) {
-        printedSummaryHeader = true;
-        writer.println("<!-- =========== FIELD SUMMARY =========== -->");
-        writer.println();
-        writer.printSummaryHeader(this, classDoc);
+    public Content getMemberSummaryHeader(ClassDoc classDoc,
+            Content memberSummaryTree) {
+        memberSummaryTree.addContent(HtmlConstants.START_OF_FIELD_SUMMARY);
+        Content memberTree = writer.getMemberTreeHeader();
+        writer.addSummaryHeader(this, classDoc, memberTree);
+        return memberTree;
     }
 
     /**
-     * Write the fields summary footer for the given class.
-     *
-     * @param classDoc the class the summary belongs to.
+     * {@inheritDoc}
      */
-    public void writeMemberSummaryFooter(ClassDoc classDoc) {
-        writer.tableEnd();
-        writer.space();
+    public Content getFieldDetailsTreeHeader(ClassDoc classDoc,
+            Content memberDetailsTree) {
+        memberDetailsTree.addContent(HtmlConstants.START_OF_FIELD_DETAILS);
+        Content fieldDetailsTree = writer.getMemberTreeHeader();
+        fieldDetailsTree.addContent(writer.getMarkerAnchor("field_detail"));
+        Content heading = HtmlTree.HEADING(HtmlConstants.DETAILS_HEADING,
+                writer.fieldDetailsLabel);
+        fieldDetailsTree.addContent(heading);
+        return fieldDetailsTree;
     }
 
     /**
-     * Write the inherited fields summary header for the given class.
-     *
-     * @param classDoc the class the summary belongs to.
+     * {@inheritDoc}
      */
-    public void writeInheritedMemberSummaryHeader(ClassDoc classDoc) {
-        if(! printedSummaryHeader){
-            //We don't want inherited summary to not be under heading.
-            writeMemberSummaryHeader(classDoc);
-            writeMemberSummaryFooter(classDoc);
-            printedSummaryHeader = true;
-        }
-        writer.printInheritedSummaryHeader(this, classDoc);
+    public Content getFieldDocTreeHeader(FieldDoc field,
+            Content fieldDetailsTree) {
+        fieldDetailsTree.addContent(
+                writer.getMarkerAnchor(field.name()));
+        Content fieldDocTree = writer.getMemberTreeHeader();
+        Content heading = new HtmlTree(HtmlConstants.MEMBER_HEADING);
+        heading.addContent(field.name());
+        fieldDocTree.addContent(heading);
+        return fieldDocTree;
     }
 
     /**
      * {@inheritDoc}
      */
-    public void writeInheritedMemberSummary(ClassDoc classDoc,
-        ProgramElementDoc field, boolean isFirst, boolean isLast) {
-        writer.printInheritedSummaryMember(this, classDoc, field, isFirst);
-    }
-
-    /**
-     * Write the inherited fields summary footer for the given class.
-     *
-     * @param classDoc the class the summary belongs to.
-     */
-    public void writeInheritedMemberSummaryFooter(ClassDoc classDoc) {
-        writer.printInheritedSummaryFooter(this, classDoc);
-    }
-
-    /**
-     * Write the header for the field documentation.
-     *
-     * @param classDoc the class that the fields belong to.
-     */
-    public void writeHeader(ClassDoc classDoc, String header) {
-        writer.println();
-        writer.println("<!-- ============ FIELD DETAIL =========== -->");
-        writer.println();
-        writer.anchor("field_detail");
-        writer.printTableHeadingBackground(header);
-        writer.println();
-    }
-
-    /**
-     * Write the field header for the given field.
-     *
-     * @param field the field being documented.
-     * @param isFirst the flag to indicate whether or not the field is the
-     *        first to be documented.
-     */
-    public void writeFieldHeader(FieldDoc field, boolean isFirst) {
-        if (! isFirst) {
-            writer.printMemberHeader();
-            writer.println("");
+    public Content getSignature(FieldDoc field) {
+        Content pre = new HtmlTree(HtmlTag.PRE);
+        writer.addAnnotationInfo(field, pre);
+        addModifiers(field, pre);
+        Content fieldlink = new RawHtml(writer.getLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_MEMBER,
+                field.type())));
+        pre.addContent(fieldlink);
+        pre.addContent(" ");
+        if (configuration().linksource) {
+            Content fieldName = new StringContent(field.name());
+            writer.addSrcLink(field, fieldName, pre);
+        } else {
+            addName(field.name(), pre);
         }
-        writer.anchor(field.name());
-        writer.h3();
-        writer.print(field.name());
-        writer.h3End();
+        return pre;
     }
 
     /**
-     * Write the signature for the given field.
-     *
-     * @param field the field being documented.
+     * {@inheritDoc}
      */
-    public void writeSignature(FieldDoc field) {
-        writer.pre();
-        writer.writeAnnotationInfo(field);
-        printModifiers(field);
-        writer.printLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_MEMBER,
-            field.type()));
-        print(' ');
-        if (configuration().linksource) {
-            writer.printSrcLink(field, field.name());
-        } else {
-            strong(field.name());
-        }
-        writer.preEnd();
-        assert !writer.getMemberDetailsListPrinted();
+    public void addDeprecated(FieldDoc field, Content fieldDocTree) {
+        addDeprecatedInfo(field, fieldDocTree);
     }
 
     /**
-     * Write the deprecated output for the given field.
-     *
-     * @param field the field being documented.
+     * {@inheritDoc}
      */
-    public void writeDeprecated(FieldDoc field) {
-        printDeprecated(field);
-    }
-
-    /**
-     * Write the comments for the given field.
-     *
-     * @param field the field being documented.
-     */
-    public void writeComments(FieldDoc field) {
+    public void addComments(FieldDoc field, Content fieldDocTree) {
         ClassDoc holder = field.containingClass();
         if (field.inlineTags().length > 0) {
-            writer.printMemberDetailsListStartTag();
             if (holder.equals(classdoc) ||
-                (! (holder.isPublic() || Util.isLinkable(holder, configuration())))) {
-                writer.dd();
-                writer.printInlineComment(field);
-                writer.ddEnd();
+                    (! (holder.isPublic() || Util.isLinkable(holder, configuration())))) {
+                writer.addInlineComment(field, fieldDocTree);
             } else {
-                String classlink = writer.codeText(
-                    writer.getDocLink(LinkInfoImpl.CONTEXT_FIELD_DOC_COPY,
+                Content link = new RawHtml(
+                        writer.getDocLink(LinkInfoImpl.CONTEXT_FIELD_DOC_COPY,
                         holder, field,
                         holder.isIncluded() ?
                             holder.typeName() : holder.qualifiedTypeName(),
-                        false));
-                writer.dd();
-                writer.strong(configuration().getText(holder.isClass()?
-                   "doclet.Description_From_Class" :
-                    "doclet.Description_From_Interface", classlink));
-                writer.ddEnd();
-                writer.dd();
-                writer.printInlineComment(field);
-                writer.ddEnd();
+                            false));
+                Content codeLink = HtmlTree.CODE(link);
+                Content strong = HtmlTree.STRONG(holder.isClass()?
+                   writer.descfrmClassLabel : writer.descfrmInterfaceLabel);
+                strong.addContent(writer.getSpace());
+                strong.addContent(codeLink);
+                fieldDocTree.addContent(HtmlTree.DIV(HtmlStyle.block, strong));
+                writer.addInlineComment(field, fieldDocTree);
             }
         }
     }
 
     /**
-     * Write the tag output for the given field.
-     *
-     * @param field the field being documented.
+     * {@inheritDoc}
      */
-    public void writeTags(FieldDoc field) {
-        writer.printTags(field);
+    public void addTags(FieldDoc field, Content fieldDocTree) {
+        writer.addTagsInfo(field, fieldDocTree);
     }
 
     /**
-     * Write the field footer.
+     * {@inheritDoc}
      */
-    public void writeFieldFooter() {
-        printMemberFooter();
+    public Content getFieldDetails(Content fieldDetailsTree) {
+        return getMemberTree(fieldDetailsTree);
     }
 
     /**
-     * Write the footer for the field documentation.
-     *
-     * @param classDoc the class that the fields belong to.
+     * {@inheritDoc}
      */
-    public void writeFooter(ClassDoc classDoc) {
-        //No footer to write for field documentation
+    public Content getFieldDoc(Content fieldDocTree,
+            boolean isLastContent) {
+        return getMemberTree(fieldDocTree, isLastContent);
     }
 
     /**
@@ -237,85 +177,136 @@
         return VisibleMemberMap.FIELDS;
     }
 
-    public void printSummaryLabel() {
-        writer.printText("doclet.Field_Summary");
+    /**
+     * {@inheritDoc}
+     */
+    public void addSummaryLabel(Content memberTree) {
+        Content label = HtmlTree.HEADING(HtmlConstants.SUMMARY_HEADING,
+                writer.getResource("doclet.Field_Summary"));
+        memberTree.addContent(label);
     }
 
-    public void printTableSummary() {
-        writer.tableIndexSummary(configuration().getText("doclet.Member_Table_Summary",
+    /**
+     * {@inheritDoc}
+     */
+    public String getTableSummary() {
+        return configuration().getText("doclet.Member_Table_Summary",
                 configuration().getText("doclet.Field_Summary"),
-                configuration().getText("doclet.fields")));
+                configuration().getText("doclet.fields"));
     }
 
-    public void printSummaryTableHeader(ProgramElementDoc member) {
+    /**
+     * {@inheritDoc}
+     */
+    public String getCaption() {
+        return configuration().getText("doclet.Fields");
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public String[] getSummaryTableHeader(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");
+        return header;
     }
 
-    public void printSummaryAnchor(ClassDoc cd) {
-        writer.anchor("field_summary");
+    /**
+     * {@inheritDoc}
+     */
+    public void addSummaryAnchor(ClassDoc cd, Content memberTree) {
+        memberTree.addContent(writer.getMarkerAnchor("field_summary"));
     }
 
-    public void printInheritedSummaryAnchor(ClassDoc cd) {
-        writer.anchor("fields_inherited_from_class_" + configuration().getClassName(cd));
+    /**
+     * {@inheritDoc}
+     */
+    public void addInheritedSummaryAnchor(ClassDoc cd, Content inheritedTree) {
+        inheritedTree.addContent(writer.getMarkerAnchor(
+                "fields_inherited_from_class_" + configuration().getClassName(cd)));
     }
 
-    public void printInheritedSummaryLabel(ClassDoc cd) {
-        String classlink = writer.getPreQualifiedClassLink(
-            LinkInfoImpl.CONTEXT_MEMBER, cd, false);
-        writer.strong();
-        String key = cd.isClass()?
-            "doclet.Fields_Inherited_From_Class" :
-            "doclet.Fields_Inherited_From_Interface";
-        writer.printText(key, classlink);
-        writer.strongEnd();
+    /**
+     * {@inheritDoc}
+     */
+    public void addInheritedSummaryLabel(ClassDoc cd, Content inheritedTree) {
+        Content classLink = new RawHtml(writer.getPreQualifiedClassLink(
+                LinkInfoImpl.CONTEXT_MEMBER, cd, false));
+        Content label = new StringContent(cd.isClass() ?
+            configuration().getText("doclet.Fields_Inherited_From_Class") :
+            configuration().getText("doclet.Fields_Inherited_From_Interface"));
+        Content labelHeading = HtmlTree.HEADING(HtmlConstants.INHERITED_SUMMARY_HEADING,
+                label);
+        labelHeading.addContent(writer.getSpace());
+        labelHeading.addContent(classLink);
+        inheritedTree.addContent(labelHeading);
     }
 
-    protected void writeSummaryLink(int context, ClassDoc cd, ProgramElementDoc member) {
-        writer.strong();
-        writer.printDocLink(context, cd , (MemberDoc) member, member.name(), false);
-        writer.strongEnd();
+    /**
+     * {@inheritDoc}
+     */
+    protected void addSummaryLink(int context, ClassDoc cd, ProgramElementDoc member,
+            Content tdSummary) {
+        Content strong = HtmlTree.STRONG(new RawHtml(
+                writer.getDocLink(context, cd , (MemberDoc) member, member.name(), false)));
+        Content code = HtmlTree.CODE(strong);
+        tdSummary.addContent(code);
     }
 
-    protected void writeInheritedSummaryLink(ClassDoc cd,
-            ProgramElementDoc member) {
-        writer.printDocLink(LinkInfoImpl.CONTEXT_MEMBER, cd, (MemberDoc)member,
-            member.name(), false);
+    /**
+     * {@inheritDoc}
+     */
+    protected void addInheritedSummaryLink(ClassDoc cd,
+            ProgramElementDoc member, Content linksTree) {
+        linksTree.addContent(new RawHtml(
+                writer.getDocLink(LinkInfoImpl.CONTEXT_MEMBER, cd, (MemberDoc)member,
+                member.name(), false)));
     }
 
-    protected void printSummaryType(ProgramElementDoc member) {
+    /**
+     * {@inheritDoc}
+     */
+    protected void addSummaryType(ProgramElementDoc member, Content tdSummaryType) {
         FieldDoc field = (FieldDoc)member;
-        printModifierAndType(field, field.type());
-    }
-
-    protected void writeDeprecatedLink(ProgramElementDoc member) {
-        writer.printDocLink(LinkInfoImpl.CONTEXT_MEMBER,
-            (MemberDoc) member, ((FieldDoc)member).qualifiedName(), false);
+        addModifierAndType(field, field.type(), tdSummaryType);
     }
 
-    protected void printNavSummaryLink(ClassDoc cd, boolean link) {
+    /**
+     * {@inheritDoc}
+     */
+    protected Content getDeprecatedLink(ProgramElementDoc member) {
+        return writer.getDocLink(LinkInfoImpl.CONTEXT_MEMBER,
+                (MemberDoc) member, ((FieldDoc)member).qualifiedName());
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    protected Content getNavSummaryLink(ClassDoc cd, boolean link) {
         if (link) {
-            writer.printHyperLink("", (cd == null)?
-                        "field_summary":
-                        "fields_inherited_from_class_" +
-                        configuration().getClassName(cd),
-                    configuration().getText("doclet.navField"));
+            return writer.getHyperLink("", (cd == null)?
+                "field_summary":
+                "fields_inherited_from_class_" +
+                configuration().getClassName(cd),
+                writer.getResource("doclet.navField"));
         } else {
-            writer.printText("doclet.navField");
+            return writer.getResource("doclet.navField");
         }
     }
 
-    protected void printNavDetailLink(boolean link) {
+    /**
+     * {@inheritDoc}
+     */
+    protected void addNavDetailLink(boolean link, Content liNav) {
         if (link) {
-            writer.printHyperLink("", "field_detail",
-                configuration().getText("doclet.navField"));
+            liNav.addContent(writer.getHyperLink("", "field_detail",
+                    writer.getResource("doclet.navField")));
         } else {
-            writer.printText("doclet.navField");
+            liNav.addContent(writer.getResource("doclet.navField"));
         }
     }
 }
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/FrameOutputWriter.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/FrameOutputWriter.java	Mon Dec 20 21:10:57 2010 -0800
@@ -25,8 +25,10 @@
 
 package com.sun.tools.doclets.formats.html;
 
+import java.io.*;
 import com.sun.tools.doclets.internal.toolkit.util.*;
-import java.io.*;
+import com.sun.tools.doclets.internal.toolkit.*;
+import com.sun.tools.doclets.formats.html.markup.*;
 
 /**
  * Generate the documentation in the Html "frame" format in the browser. The
@@ -47,6 +49,8 @@
      */
     int noOfPackages;
 
+    private final String SCROLL_YES = "yes";
+
     /**
      * Constructor to construct FrameOutputWriter object.
      *
@@ -86,82 +90,93 @@
      * as well as warning if browser is not supporting the Html frames.
      */
     protected void generateFrameFile() {
+        Content frameset = getFrameDetails();
         if (configuration.windowtitle.length() > 0) {
-            printFramesetHeader(configuration.windowtitle, configuration.notimestamp);
+            printFramesetDocument(configuration.windowtitle, configuration.notimestamp,
+                    frameset);
         } else {
-            printFramesetHeader(configuration.getText("doclet.Generated_Docs_Untitled"),
-                                configuration.notimestamp);
+            printFramesetDocument(configuration.getText("doclet.Generated_Docs_Untitled"),
+                    configuration.notimestamp, frameset);
         }
-        printFrameDetails();
-        printFrameFooter();
     }
 
     /**
-     * Generate the code for issueing the warning for a non-frame capable web
+     * Add the code for issueing the warning for a non-frame capable web
      * client. Also provide links to the non-frame version documentation.
+     *
+     * @param contentTree the content tree to which the non-frames information will be added
      */
-    protected void printFrameWarning() {
-        noFrames();
-        h2();
-        printText("doclet.Frame_Alert");
-        h2End();
-        p();
-        printText("doclet.Frame_Warning_Message");
-        br();
-        printText("doclet.Link_To");
-        printHyperLink(configuration.topFile,
-            configuration.getText("doclet.Non_Frame_Version"));
-        println("");
-        noFramesEnd();
+    protected void addFrameWarning(Content contentTree) {
+        Content noframes = new HtmlTree(HtmlTag.NOFRAMES);
+        Content noScript = HtmlTree.NOSCRIPT(
+                HtmlTree.DIV(getResource("doclet.No_Script_Message")));
+        noframes.addContent(noScript);
+        Content noframesHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING,
+                getResource("doclet.Frame_Alert"));
+        noframes.addContent(noframesHead);
+        Content p = HtmlTree.P(getResource("doclet.Frame_Warning_Message"));
+        noframes.addContent(p);
+        noframes.addContent(new HtmlTree(HtmlTag.BR));
+        noframes.addContent(getResource("doclet.Link_To"));
+        Content link = getHyperLink(configuration.topFile,
+                getResource("doclet.Non_Frame_Version"));
+        noframes.addContent(link);
+        contentTree.addContent(noframes);
     }
 
     /**
-     * Print the frame sizes and their contents.
+     * Get the frame sizes and their contents.
+     *
+     * @return a content tree for the frame details
      */
-    protected void printFrameDetails() {
-        // title attribute intentionally made empty so
-        // 508 tests will not flag it as missing
-        frameSet("cols=\"20%,80%\" title=\"\" onLoad=\"top.loadFrames()\"");
+    protected Content getFrameDetails() {
+        HtmlTree frameset = HtmlTree.FRAMESET("20%,80%", null, "Documentation frame",
+                "top.loadFrames()");
         if (noOfPackages <= 1) {
-            printAllClassesFrameTag();
+            addAllClassesFrameTag(frameset);
         } else if (noOfPackages > 1) {
-            frameSet("rows=\"30%,70%\" title=\"\" onLoad=\"top.loadFrames()\"");
-            printAllPackagesFrameTag();
-            printAllClassesFrameTag();
-            frameSetEnd();
+            HtmlTree leftFrameset = HtmlTree.FRAMESET(null, "30%,70%", "Left frames",
+                "top.loadFrames()");
+            addAllPackagesFrameTag(leftFrameset);
+            addAllClassesFrameTag(leftFrameset);
+            frameset.addContent(leftFrameset);
         }
-        printClassFrameTag();
-        printFrameWarning();
-        frameSetEnd();
+        addClassFrameTag(frameset);
+        addFrameWarning(frameset);
+        return frameset;
     }
 
     /**
-     * Print the FRAME tag for the frame that lists all packages
+     * Add the FRAME tag for the frame that lists all packages.
+     *
+     * @param contentTree the content tree to which the information will be added
      */
-    private void printAllPackagesFrameTag() {
-        frame("src=\"overview-frame.html\" name=\"packageListFrame\""
-            + " title=\"" + configuration.getText("doclet.All_Packages") + "\"");
+    private void addAllPackagesFrameTag(Content contentTree) {
+        HtmlTree frame = HtmlTree.FRAME("overview-frame.html", "packageListFrame",
+                configuration.getText("doclet.All_Packages"));
+        contentTree.addContent(frame);
     }
 
     /**
-     * Print the FRAME tag for the frame that lists all classes
+     * Add the FRAME tag for the frame that lists all classes.
+     *
+     * @param contentTree the content tree to which the information will be added
      */
-    private void printAllClassesFrameTag() {
-        frame("src=\"" + "allclasses-frame.html" + "\""
-            + " name=\"packageFrame\""
-            + " title=\"" + configuration.getText("doclet.All_classes_and_interfaces")
-            + "\"");
+    private void addAllClassesFrameTag(Content contentTree) {
+        HtmlTree frame = HtmlTree.FRAME("allclasses-frame.html", "packageFrame",
+                configuration.getText("doclet.All_classes_and_interfaces"));
+        contentTree.addContent(frame);
     }
 
     /**
-     * Print the FRAME tag for the frame that describes the class in detail
+     * Add the FRAME tag for the frame that describes the class in detail.
+     *
+     * @param contentTree the content tree to which the information will be added
      */
-    private void printClassFrameTag() {
-        frame("src=\"" + configuration.topFile + "\""
-            + " name=\"classFrame\""
-            + " title=\""
-            + configuration.getText("doclet.Package_class_and_interface_descriptions")
-            + "\" scrolling=\"yes\"");
+    private void addClassFrameTag(Content contentTree) {
+        HtmlTree frame = HtmlTree.FRAME(configuration.topFile, "classFrame",
+                configuration.getText("doclet.Package_class_and_interface_descriptions"),
+                SCROLL_YES);
+        contentTree.addContent(frame);
     }
-
 }
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HelpWriter.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HelpWriter.java	Mon Dec 20 21:10:57 2010 -0800
@@ -25,8 +25,10 @@
 
 package com.sun.tools.doclets.formats.html;
 
+import java.io.*;
 import com.sun.tools.doclets.internal.toolkit.util.*;
-import java.io.*;
+import com.sun.tools.doclets.internal.toolkit.*;
+import com.sun.tools.doclets.formats.html.markup.*;
 
 /**
  * Generate the Help File for the generated API documentation. The help file
@@ -72,159 +74,242 @@
      * Generate the help file contents.
      */
     protected void generateHelpFile() {
-        printHtmlHeader(configuration.getText("doclet.Window_Help_title"),
-            null, true);
-        printTop();
-        navLinks(true);  hr();
-
-        printHelpFileContents();
-
-        navLinks(false);
-        printBottom();
-        printBodyHtmlEnd();
+        String title = configuration.getText("doclet.Window_Help_title");
+        Content body = getBody(true, getWindowTitle(title));
+        addTop(body);
+        addNavLinks(true, body);
+        addHelpFileContents(body);
+        addNavLinks(false, body);
+        addBottom(body);
+        printHtmlDocument(null, true, body);
     }
 
     /**
-     * Print the help file contents from the resource file. While generating the
+     * Add the help file contents from the resource file to the content tree. While adding the
      * help file contents it also keeps track of user options. If "-notree"
-     * is used, then the "overview-tree.html" will not get generated and hence
-     * help information also will not get generated.
+     * is used, then the "overview-tree.html" will not get added and hence
+     * help information also will not get added.
+     *
+     * @param contentTree the content tree to which the help file contents will be added
      */
-    protected void printHelpFileContents() {
-        center(); h1(); printText("doclet.Help_line_1"); h1End(); centerEnd();
-        printText("doclet.Help_line_2");
+    protected void addHelpFileContents(Content contentTree) {
+        Content heading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, false, HtmlStyle.title,
+                getResource("doclet.Help_line_1"));
+        Content div = HtmlTree.DIV(HtmlStyle.header, heading);
+        Content line2 = HtmlTree.P(HtmlStyle.subTitle,
+                getResource("doclet.Help_line_2"));
+        div.addContent(line2);
+        contentTree.addContent(div);
+        HtmlTree ul = new HtmlTree(HtmlTag.UL);
+        ul.addStyle(HtmlStyle.blockList);
         if (configuration.createoverview) {
-            h3(); printText("doclet.Overview"); h3End();
-            blockquote(); p();
-            printText("doclet.Help_line_3",
-                getHyperLink("overview-summary.html",
-                configuration.getText("doclet.Overview")));
-            blockquoteEnd();
+            Content overviewHeading = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING,
+                getResource("doclet.Overview"));
+            Content liOverview = HtmlTree.LI(HtmlStyle.blockList, overviewHeading);
+            Content line3 = getResource("doclet.Help_line_3",
+                    getHyperLinkString("overview-summary.html",
+                    configuration.getText("doclet.Overview")));
+            Content overviewPara = HtmlTree.P(line3);
+            liOverview.addContent(overviewPara);
+            ul.addContent(liOverview);
         }
-        h3(); printText("doclet.Package"); h3End();
-        blockquote(); p(); printText("doclet.Help_line_4");
-        ul();
-        li(); printText("doclet.Interfaces_Italic");
-        li(); printText("doclet.Classes");
-        li(); printText("doclet.Enums");
-        li(); printText("doclet.Exceptions");
-        li(); printText("doclet.Errors");
-        li(); printText("doclet.AnnotationTypes");
-        ulEnd();
-        blockquoteEnd();
-        h3(); printText("doclet.Help_line_5"); h3End();
-        blockquote(); p(); printText("doclet.Help_line_6");
-        ul();
-        li(); printText("doclet.Help_line_7");
-        li(); printText("doclet.Help_line_8");
-        li(); printText("doclet.Help_line_9");
-        li(); printText("doclet.Help_line_10");
-        li(); printText("doclet.Help_line_11");
-        li(); printText("doclet.Help_line_12");
-        p();
-        li(); printText("doclet.Nested_Class_Summary");
-        li(); printText("doclet.Field_Summary");
-        li(); printText("doclet.Constructor_Summary");
-        li(); printText("doclet.Method_Summary");
-        p();
-        li(); printText("doclet.Field_Detail");
-        li(); printText("doclet.Constructor_Detail");
-        li(); printText("doclet.Method_Detail");
-        ulEnd();
-        printText("doclet.Help_line_13");
-        blockquoteEnd();
-
+        Content packageHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING,
+                getResource("doclet.Package"));
+        Content liPackage = HtmlTree.LI(HtmlStyle.blockList, packageHead);
+        Content line4 = getResource("doclet.Help_line_4");
+        Content packagePara = HtmlTree.P(line4);
+        liPackage.addContent(packagePara);
+        HtmlTree ulPackage = new HtmlTree(HtmlTag.UL);
+        ulPackage.addContent(HtmlTree.LI(
+                getResource("doclet.Interfaces_Italic")));
+        ulPackage.addContent(HtmlTree.LI(
+                getResource("doclet.Classes")));
+        ulPackage.addContent(HtmlTree.LI(
+                getResource("doclet.Enums")));
+        ulPackage.addContent(HtmlTree.LI(
+                getResource("doclet.Exceptions")));
+        ulPackage.addContent(HtmlTree.LI(
+                getResource("doclet.Errors")));
+        ulPackage.addContent(HtmlTree.LI(
+                getResource("doclet.AnnotationTypes")));
+        liPackage.addContent(ulPackage);
+        ul.addContent(liPackage);
+        Content classHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING,
+                getResource("doclet.Help_line_5"));
+        Content liClass = HtmlTree.LI(HtmlStyle.blockList, classHead);
+        Content line6 = getResource("doclet.Help_line_6");
+        Content classPara = HtmlTree.P(line6);
+        liClass.addContent(classPara);
+        HtmlTree ul1 = new HtmlTree(HtmlTag.UL);
+        ul1.addContent(HtmlTree.LI(
+                getResource("doclet.Help_line_7")));
+        ul1.addContent(HtmlTree.LI(
+                getResource("doclet.Help_line_8")));
+        ul1.addContent(HtmlTree.LI(
+                getResource("doclet.Help_line_9")));
+        ul1.addContent(HtmlTree.LI(
+                getResource("doclet.Help_line_10")));
+        ul1.addContent(HtmlTree.LI(
+                getResource("doclet.Help_line_11")));
+        ul1.addContent(HtmlTree.LI(
+                getResource("doclet.Help_line_12")));
+        liClass.addContent(ul1);
+        HtmlTree ul2 = new HtmlTree(HtmlTag.UL);
+        ul2.addContent(HtmlTree.LI(
+                getResource("doclet.Nested_Class_Summary")));
+        ul2.addContent(HtmlTree.LI(
+                getResource("doclet.Field_Summary")));
+        ul2.addContent(HtmlTree.LI(
+                getResource("doclet.Constructor_Summary")));
+        ul2.addContent(HtmlTree.LI(
+                getResource("doclet.Method_Summary")));
+        liClass.addContent(ul2);
+        HtmlTree ul3 = new HtmlTree(HtmlTag.UL);
+        ul3.addContent(HtmlTree.LI(
+                getResource("doclet.Field_Detail")));
+        ul3.addContent(HtmlTree.LI(
+                getResource("doclet.Constructor_Detail")));
+        ul3.addContent(HtmlTree.LI(
+                getResource("doclet.Method_Detail")));
+        liClass.addContent(ul3);
+        Content line13 = getResource("doclet.Help_line_13");
+        Content para = HtmlTree.P(line13);
+        liClass.addContent(para);
+        ul.addContent(liClass);
         //Annotation Types
-        blockquoteEnd();
-        h3(); printText("doclet.AnnotationType"); h3End();
-        blockquote(); p(); printText("doclet.Help_annotation_type_line_1");
-        ul();
-        li(); printText("doclet.Help_annotation_type_line_2");
-        li(); printText("doclet.Help_annotation_type_line_3");
-        li(); printText("doclet.Annotation_Type_Required_Member_Summary");
-        li(); printText("doclet.Annotation_Type_Optional_Member_Summary");
-        li(); printText("doclet.Annotation_Type_Member_Detail");
-        ulEnd();
-        blockquoteEnd();
-
+        Content aHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING,
+                getResource("doclet.AnnotationType"));
+        Content liAnnotation = HtmlTree.LI(HtmlStyle.blockList, aHead);
+        Content aline1 = getResource("doclet.Help_annotation_type_line_1");
+        Content aPara = HtmlTree.P(aline1);
+        liAnnotation.addContent(aPara);
+        HtmlTree aul = new HtmlTree(HtmlTag.UL);
+        aul.addContent(HtmlTree.LI(
+                getResource("doclet.Help_annotation_type_line_2")));
+        aul.addContent(HtmlTree.LI(
+                getResource("doclet.Help_annotation_type_line_3")));
+        aul.addContent(HtmlTree.LI(
+                getResource("doclet.Annotation_Type_Required_Member_Summary")));
+        aul.addContent(HtmlTree.LI(
+                getResource("doclet.Annotation_Type_Optional_Member_Summary")));
+        aul.addContent(HtmlTree.LI(
+                getResource("doclet.Annotation_Type_Member_Detail")));
+        liAnnotation.addContent(aul);
+        ul.addContent(liAnnotation);
         //Enums
-        blockquoteEnd();
-        h3(); printText("doclet.Enum"); h3End();
-        blockquote(); p(); printText("doclet.Help_enum_line_1");
-        ul();
-        li(); printText("doclet.Help_enum_line_2");
-        li(); printText("doclet.Help_enum_line_3");
-        li(); printText("doclet.Enum_Constant_Summary");
-        li(); printText("doclet.Enum_Constant_Detail");
-        ulEnd();
-        blockquoteEnd();
-
+        Content enumHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING,
+                getResource("doclet.Enum"));
+        Content liEnum = HtmlTree.LI(HtmlStyle.blockList, enumHead);
+        Content eline1 = getResource("doclet.Help_enum_line_1");
+        Content enumPara = HtmlTree.P(eline1);
+        liEnum.addContent(enumPara);
+        HtmlTree eul = new HtmlTree(HtmlTag.UL);
+        eul.addContent(HtmlTree.LI(
+                getResource("doclet.Help_enum_line_2")));
+        eul.addContent(HtmlTree.LI(
+                getResource("doclet.Help_enum_line_3")));
+        eul.addContent(HtmlTree.LI(
+                getResource("doclet.Enum_Constant_Summary")));
+        eul.addContent(HtmlTree.LI(
+                getResource("doclet.Enum_Constant_Detail")));
+        liEnum.addContent(eul);
+        ul.addContent(liEnum);
         if (configuration.classuse) {
-            h3(); printText("doclet.Help_line_14"); h3End();
-            blockquote();
-            printText("doclet.Help_line_15");
-            blockquoteEnd();
+            Content useHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING,
+                    getResource("doclet.Help_line_14"));
+            Content liUse = HtmlTree.LI(HtmlStyle.blockList, useHead);
+            Content line15 = getResource("doclet.Help_line_15");
+            Content usePara = HtmlTree.P(line15);
+            liUse.addContent(usePara);
+            ul.addContent(liUse);
         }
         if (configuration.createtree) {
-            h3(); printText("doclet.Help_line_16"); h3End();
-            blockquote();
-            printText("doclet.Help_line_17_with_tree_link",
-                 getHyperLink("overview-tree.html",
-                 configuration.getText("doclet.Class_Hierarchy")));
-            ul();
-            li(); printText("doclet.Help_line_18");
-            li(); printText("doclet.Help_line_19");
-            ulEnd();
-            blockquoteEnd();
+            Content treeHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING,
+                    getResource("doclet.Help_line_16"));
+            Content liTree = HtmlTree.LI(HtmlStyle.blockList, treeHead);
+            Content line17 = getResource("doclet.Help_line_17_with_tree_link",
+                    getHyperLinkString("overview-tree.html",
+                    configuration.getText("doclet.Class_Hierarchy")));
+            Content treePara = HtmlTree.P(line17);
+            liTree.addContent(treePara);
+            HtmlTree tul = new HtmlTree(HtmlTag.UL);
+            tul.addContent(HtmlTree.LI(
+                    getResource("doclet.Help_line_18")));
+            tul.addContent(HtmlTree.LI(
+                    getResource("doclet.Help_line_19")));
+            liTree.addContent(tul);
+            ul.addContent(liTree);
         }
         if (!(configuration.nodeprecatedlist ||
                   configuration.nodeprecated)) {
-            h3(); printText("doclet.Deprecated_API"); h3End();
-            blockquote();
-            printText("doclet.Help_line_20_with_deprecated_api_link",
-                getHyperLink("deprecated-list.html",
-                configuration.getText("doclet.Deprecated_API")));
-            blockquoteEnd();
+            Content dHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING,
+                    getResource("doclet.Deprecated_API"));
+            Content liDeprecated = HtmlTree.LI(HtmlStyle.blockList, dHead);
+            Content line20 = getResource("doclet.Help_line_20_with_deprecated_api_link",
+                    getHyperLinkString("deprecated-list.html",
+                    configuration.getText("doclet.Deprecated_API")));
+            Content dPara = HtmlTree.P(line20);
+            liDeprecated.addContent(dPara);
+            ul.addContent(liDeprecated);
         }
         if (configuration.createindex) {
             String indexlink;
             if (configuration.splitindex) {
-                indexlink = getHyperLink("index-files/index-1.html",
-                    configuration.getText("doclet.Index"));
+                indexlink = getHyperLinkString("index-files/index-1.html",
+                        configuration.getText("doclet.Index"));
             } else {
-                indexlink = getHyperLink("index-all.html",
-                    configuration.getText("doclet.Index"));
+                indexlink = getHyperLinkString("index-all.html",
+                        configuration.getText("doclet.Index"));
             }
-            h3(); printText("doclet.Help_line_21"); h3End();
-            blockquote();
-            printText("doclet.Help_line_22", indexlink);
-            blockquoteEnd();
+            Content indexHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING,
+                    getResource("doclet.Help_line_21"));
+            Content liIndex = HtmlTree.LI(HtmlStyle.blockList, indexHead);
+            Content line22 = getResource("doclet.Help_line_22", indexlink);
+            Content indexPara = HtmlTree.P(line22);
+            liIndex.addContent(indexPara);
+            ul.addContent(liIndex);
         }
-        h3(); printText("doclet.Help_line_23"); h3End();
-        printText("doclet.Help_line_24");
-        h3(); printText("doclet.Help_line_25"); h3End();
-        printText("doclet.Help_line_26"); p();
-
-        h3(); printText("doclet.Serialized_Form"); h3End();
-        printText("doclet.Help_line_27"); p();
-
-        h3(); printText("doclet.Constants_Summary"); h3End();
-        printText("doclet.Help_line_28"); p();
-
-        font("-1"); em();
-        printText("doclet.Help_line_29");
-        emEnd(); fontEnd(); br();
-        hr();
+        Content prevHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING,
+                getResource("doclet.Help_line_23"));
+        Content liPrev = HtmlTree.LI(HtmlStyle.blockList, prevHead);
+        Content line24 = getResource("doclet.Help_line_24");
+        Content prevPara = HtmlTree.P(line24);
+        liPrev.addContent(prevPara);
+        ul.addContent(liPrev);
+        Content frameHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING,
+                getResource("doclet.Help_line_25"));
+        Content liFrame = HtmlTree.LI(HtmlStyle.blockList, frameHead);
+        Content line26 = getResource("doclet.Help_line_26");
+        Content framePara = HtmlTree.P(line26);
+        liFrame.addContent(framePara);
+        ul.addContent(liFrame);
+        Content sHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING,
+                getResource("doclet.Serialized_Form"));
+        Content liSerial = HtmlTree.LI(HtmlStyle.blockList, sHead);
+        Content line27 = getResource("doclet.Help_line_27");
+        Content serialPara = HtmlTree.P(line27);
+        liSerial.addContent(serialPara);
+        ul.addContent(liSerial);
+        Content constHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING,
+                getResource("doclet.Constants_Summary"));
+        Content liConst = HtmlTree.LI(HtmlStyle.blockList, constHead);
+        Content line28 = getResource("doclet.Help_line_28");
+        Content constPara = HtmlTree.P(line28);
+        liConst.addContent(constPara);
+        ul.addContent(liConst);
+        Content divContent = HtmlTree.DIV(HtmlStyle.contentContainer, ul);
+        Content line29 = HtmlTree.EM(getResource("doclet.Help_line_29"));
+        divContent.addContent(line29);
+        contentTree.addContent(divContent);
     }
 
     /**
-     * Highlight the word "Help" in the navigation bar as this is the help file.
+     * Get the help label.
+     *
+     * @return a content tree for the help label
      */
-    protected void navLinkHelp() {
-        navCellRevStart();
-        fontStyle("NavBarFont1Rev");
-        strongText("doclet.Help");
-        fontEnd();
-        navCellEnd();
+    protected Content getNavLinkHelp() {
+        Content li = HtmlTree.LI(HtmlStyle.navBarCell1Rev, helpLabel);
+        return li;
     }
 }
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDoclet.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDoclet.java	Mon Dec 20 21:10:57 2010 -0800
@@ -144,8 +144,12 @@
             !configuration.nohelp) {
             HelpWriter.generate(configuration);
         }
+        // If a stylesheet file is not specified, copy the default stylesheet
+        // and replace newline with platform-specific newline.
         if (configuration.stylesheetfile.length() == 0) {
-            StylesheetWriter.generate(configuration);
+            Util.copyFile(configuration, "stylesheet.css", Util.RESOURCESDIR,
+                    (configdestdir.isEmpty()) ?
+                        System.getProperty("user.dir") : configdestdir, false, true);
         }
     }
 
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java	Mon Dec 20 21:10:57 2010 -0800
@@ -88,6 +88,11 @@
     public ConfigurationImpl configuration;
 
     /**
+     * To check whether annotation heading is printed or not.
+     */
+    protected boolean printedAnnotationHeading = false;
+
+    /**
      * Constructor to construct the HtmlStandardWriter object.
      *
      * @param filename File to be generated.
@@ -169,7 +174,7 @@
             // Append slash if next character is not a slash
             if (relativepathNoSlash.length() > 0 && previndex < htmlstr.length()
                     && htmlstr.charAt(previndex) != '/') {
-                buf.append(DirectoryManager.URL_FILE_SEPERATOR);
+                buf.append(DirectoryManager.URL_FILE_SEPARATOR);
             }
         }
         return buf.toString();
@@ -192,17 +197,47 @@
         println("  <!--");
         println("  if(window==top) {");
         println("    document.writeln('"
-            + getHyperLink(link, where, label, strong, "", "", target) + "');");
+            + getHyperLinkString(link, where, label, strong, "", "", target) + "');");
         println("  }");
         println("  //-->");
         scriptEnd();
         noScript();
-        println("  " + getHyperLink(link, where, label, strong, "", "", target));
+        println("  " + getHyperLinkString(link, where, label, strong, "", "", target));
         noScriptEnd();
         println(DocletConstants.NL);
     }
 
-    private void printMethodInfo(MethodDoc method) {
+    /**
+     * Get the script to show or hide the All classes link.
+     *
+     * @param id id of the element to show or hide
+     * @return a content tree for the script
+     */
+    public Content getAllClassesLinkScript(String id) {
+        HtmlTree script = new HtmlTree(HtmlTag.SCRIPT);
+        script.addAttr(HtmlAttr.TYPE, "text/javascript");
+        String scriptCode = "<!--" + DocletConstants.NL +
+                "  allClassesLink = document.getElementById(\"" + id + "\");" + DocletConstants.NL +
+                "  if(window==top) {" + DocletConstants.NL +
+                "    allClassesLink.style.display = \"block\";" + DocletConstants.NL +
+                "  }" + DocletConstants.NL +
+                "  else {" + DocletConstants.NL +
+                "    allClassesLink.style.display = \"none\";" + DocletConstants.NL +
+                "  }" + DocletConstants.NL +
+                "  //-->" + DocletConstants.NL;
+        Content scriptContent = new RawHtml(scriptCode);
+        script.addContent(scriptContent);
+        Content div = HtmlTree.DIV(script);
+        return div;
+    }
+
+    /**
+     * Add method information.
+     *
+     * @param method the method to be documented
+     * @param dl the content tree to which the method information will be added
+     */
+    private void addMethodInfo(MethodDoc method, Content dl) {
         ClassDoc[] intfacs = method.containingClass().interfaces();
         MethodDoc overriddenMethod = method.overriddenMethod();
         // Check whether there is any implementation or overridden info to be
@@ -211,46 +246,38 @@
         if ((intfacs.length > 0 &&
                 new ImplementedMethods(method, this.configuration).build().length > 0) ||
                 overriddenMethod != null) {
-            printMemberDetailsListStartTag();
-            dd();
-            printTagsInfoHeader();
-            MethodWriterImpl.printImplementsInfo(this, method);
+            MethodWriterImpl.addImplementsInfo(this, method, dl);
             if (overriddenMethod != null) {
-                MethodWriterImpl.printOverridden(this,
-                    method.overriddenType(), overriddenMethod);
+                MethodWriterImpl.addOverridden(this,
+                        method.overriddenType(), overriddenMethod, dl);
             }
-            printTagsInfoFooter();
-            ddEnd();
         }
     }
 
-    protected void printTags(Doc doc) {
-        if(configuration.nocomment){
+    /**
+     * Adds the tags information.
+     *
+     * @param doc the doc for which the tags will be generated
+     * @param htmltree the documentation tree to which the tags will be added
+     */
+    protected void addTagsInfo(Doc doc, Content htmltree) {
+        if (configuration.nocomment) {
             return;
         }
+        Content dl = new HtmlTree(HtmlTag.DL);
         if (doc instanceof MethodDoc) {
-            printMethodInfo((MethodDoc) doc);
+            addMethodInfo((MethodDoc) doc, dl);
         }
         TagletOutputImpl output = new TagletOutputImpl("");
         TagletWriter.genTagOuput(configuration.tagletManager, doc,
             configuration.tagletManager.getCustomTags(doc),
                 getTagletWriterInstance(false), output);
         String outputString = output.toString().trim();
-        // 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 ||
-                    doc instanceof PackageDoc)) {
-                printMemberDetailsListStartTag();
-                dd();
-            }
-            printTagsInfoHeader();
-            print(outputString);
-            printTagsInfoFooter();
-            if (!(doc instanceof RootDoc || doc instanceof ClassDoc ||
-                    doc instanceof PackageDoc))
-                ddEnd();
+            Content resultString = new RawHtml(outputString);
+            dl.addContent(resultString);
         }
+        htmltree.addContent(dl);
     }
 
     /**
@@ -286,17 +313,16 @@
     }
 
     /**
-     * Print Package link, with target frame.
+     * Get Package link, with target frame.
      *
-     * @param pd The link will be to the "package-summary.html" page for this
-     * package.
-     * @param target Name of the target frame.
-     * @param label Tag for the link.
+     * @param pd The link will be to the "package-summary.html" page for this package
+     * @param target name of the target frame
+     * @param label tag for the link
+     * @return a content for the target package link
      */
-    public void printTargetPackageLink(PackageDoc pd, String target,
-        String label) {
-        print(getHyperLink(pathString(pd, "package-summary.html"), "", label,
-            false, "", "", target));
+    public Content getTargetPackageLink(PackageDoc pd, String target,
+            Content label) {
+        return getHyperLink(pathString(pd, "package-summary.html"), "", label, "", target);
     }
 
     /**
@@ -360,6 +386,64 @@
     }
 
     /**
+     * Generates the HTML document tree and prints it out.
+     *
+     * @param metakeywords Array of String keywords for META tag. Each element
+     *                     of the array is assigned to a separate META tag.
+     *                     Pass in null for no array
+     * @param includeScript true if printing windowtitle script
+     *                      false for files that appear in the left-hand frames
+     * @param body the body htmltree to be included in the document
+     */
+    public void printHtmlDocument(String[] metakeywords, boolean includeScript,
+            Content body) {
+        Content htmlDocType = DocType.Transitional();
+        Content htmlComment = new Comment(configuration.getText("doclet.New_Page"));
+        Content head = new HtmlTree(HtmlTag.HEAD);
+        if (!configuration.notimestamp) {
+            Content headComment = new Comment("Generated by javadoc (version " +
+                    ConfigurationImpl.BUILD_DATE + ") on " + today());
+            head.addContent(headComment);
+        }
+        if (configuration.charset.length() > 0) {
+            Content meta = HtmlTree.META("Content-Type", "text/html",
+                    configuration.charset);
+            head.addContent(meta);
+        }
+        head.addContent(getTitle());
+        if (!configuration.notimestamp) {
+            SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
+            Content meta = HtmlTree.META("date", dateFormat.format(new Date()));
+            head.addContent(meta);
+        }
+        if (metakeywords != null) {
+            for (int i=0; i < metakeywords.length; i++) {
+                Content meta = HtmlTree.META("keywords", metakeywords[i]);
+                head.addContent(meta);
+            }
+        }
+        head.addContent(getStyleSheetProperties());
+        Content htmlTree = HtmlTree.HTML(configuration.getLocale().getLanguage(),
+                head, body);
+        Content htmlDocument = new HtmlDocument(htmlDocType,
+                htmlComment, htmlTree);
+        print(htmlDocument.toString());
+    }
+
+    /**
+     * Get the window title.
+     *
+     * @param title the title string to construct the complete window title
+     * @return the window title string
+     */
+    public String getWindowTitle(String title) {
+        if (configuration.windowtitle.length() > 0) {
+            title += " (" + configuration.windowtitle  + ")";
+        }
+        return title;
+    }
+
+    /**
      * Print user specified header and the footer.
      *
      * @param header if true print the user provided header else print the
@@ -380,6 +464,28 @@
     }
 
     /**
+     * Get user specified header and the footer.
+     *
+     * @param header if true print the user provided header else print the
+     * user provided footer.
+     */
+    public Content getUserHeaderFooter(boolean header) {
+        String content;
+        if (header) {
+            content = replaceDocRootDir(configuration.header);
+        } else {
+            if (configuration.footer.length() != 0) {
+                content = replaceDocRootDir(configuration.footer);
+            } else {
+                content = replaceDocRootDir(configuration.header);
+            }
+        }
+        Content rawContent = new RawHtml(content);
+        Content em = HtmlTree.EM(rawContent);
+        return em;
+    }
+
+    /**
      * Print the user specified top.
      */
     public void printTop() {
@@ -388,6 +494,16 @@
     }
 
     /**
+     * Adds the user specified top.
+     *
+     * @param body the content tree to which user specified top will be added
+     */
+    public void addTop(Content body) {
+        Content top = new RawHtml(replaceDocRootDir(configuration.top));
+        body.addContent(top);
+    }
+
+    /**
      * Print the user specified bottom.
      */
     public void printBottom() {
@@ -396,6 +512,18 @@
     }
 
     /**
+     * Adds the user specified bottom.
+     *
+     * @param body the content tree to which user specified bottom will be added
+     */
+    public void addBottom(Content body) {
+        Content bottom = new RawHtml(replaceDocRootDir(configuration.bottom));
+        Content small = HtmlTree.SMALL(bottom);
+        Content p = HtmlTree.P(HtmlStyle.legalCopy, small);
+        body.addContent(p);
+    }
+
+    /**
      * Print the navigation bar for the Html page at the top and and the bottom.
      *
      * @param header If true print navigation bar at the top of the page else
@@ -408,13 +536,13 @@
                 println(DocletConstants.NL + "<!-- ========= START OF TOP NAVBAR ======= -->");
                 anchor("navbar_top");
                 println();
-                print(getHyperLink("", "skip-navbar_top", "", false, "",
+                print(getHyperLinkString("", "skip-navbar_top", "", false, "",
                     configuration.getText("doclet.Skip_navigation_links"), ""));
             } else {
                 println(DocletConstants.NL + "<!-- ======= START OF BOTTOM NAVBAR ====== -->");
                 anchor("navbar_bottom");
                 println();
-                print(getHyperLink("", "skip-navbar_bottom", "", false, "",
+                print(getHyperLinkString("", "skip-navbar_bottom", "", false, "",
                     configuration.getText("doclet.Skip_navigation_links"), ""));
             }
             table(0, "100%", 1, 0);
@@ -518,6 +646,97 @@
     }
 
     /**
+     * Adds the navigation bar for the Html page at the top and and the bottom.
+     *
+     * @param header If true print navigation bar at the top of the page else
+     * @param body the HtmlTree to which the nav links will be added
+     */
+    protected void addNavLinks(boolean header, Content body) {
+        if (!configuration.nonavbar) {
+            String allClassesId = "allclasses_";
+            HtmlTree navDiv = new HtmlTree(HtmlTag.DIV);
+            if (header) {
+                body.addContent(HtmlConstants.START_OF_TOP_NAVBAR);
+                navDiv.addStyle(HtmlStyle.topNav);
+                allClassesId += "navbar_top";
+                Content a = getMarkerAnchor("navbar_top");
+                navDiv.addContent(a);
+                Content skipLinkContent = getHyperLink("",
+                        "skip-navbar_top", HtmlTree.EMPTY, configuration.getText(
+                        "doclet.Skip_navigation_links"), "");
+                navDiv.addContent(skipLinkContent);
+            } else {
+                body.addContent(HtmlConstants.START_OF_BOTTOM_NAVBAR);
+                navDiv.addStyle(HtmlStyle.bottomNav);
+                allClassesId += "navbar_bottom";
+                Content a = getMarkerAnchor("navbar_bottom");
+                navDiv.addContent(a);
+                Content skipLinkContent = getHyperLink("",
+                        "skip-navbar_bottom", HtmlTree.EMPTY, configuration.getText(
+                        "doclet.Skip_navigation_links"), "");
+                navDiv.addContent(skipLinkContent);
+            }
+            if (header) {
+                navDiv.addContent(getMarkerAnchor("navbar_top_firstrow"));
+            } else {
+                navDiv.addContent(getMarkerAnchor("navbar_bottom_firstrow"));
+            }
+            HtmlTree navList = new HtmlTree(HtmlTag.UL);
+            navList.addStyle(HtmlStyle.navList);
+            navList.addAttr(HtmlAttr.TITLE, "Navigation");
+            if (configuration.createoverview) {
+                navList.addContent(getNavLinkContents());
+            }
+            if (configuration.packages.length == 1) {
+                navList.addContent(getNavLinkPackage(configuration.packages[0]));
+            } else if (configuration.packages.length > 1) {
+                navList.addContent(getNavLinkPackage());
+            }
+            navList.addContent(getNavLinkClass());
+            if(configuration.classuse) {
+                navList.addContent(getNavLinkClassUse());
+            }
+            if(configuration.createtree) {
+                navList.addContent(getNavLinkTree());
+            }
+            if(!(configuration.nodeprecated ||
+                     configuration.nodeprecatedlist)) {
+                navList.addContent(getNavLinkDeprecated());
+            }
+            if(configuration.createindex) {
+                navList.addContent(getNavLinkIndex());
+            }
+            if (!configuration.nohelp) {
+                navList.addContent(getNavLinkHelp());
+            }
+            navDiv.addContent(navList);
+            Content aboutDiv = HtmlTree.DIV(HtmlStyle.aboutLanguage, getUserHeaderFooter(header));
+            navDiv.addContent(aboutDiv);
+            body.addContent(navDiv);
+            Content ulNav = HtmlTree.UL(HtmlStyle.navList, getNavLinkPrevious());
+            ulNav.addContent(getNavLinkNext());
+            Content subDiv = HtmlTree.DIV(HtmlStyle.subNav, ulNav);
+            Content ulFrames = HtmlTree.UL(HtmlStyle.navList, getNavShowLists());
+            ulFrames.addContent(getNavHideLists(filename));
+            subDiv.addContent(ulFrames);
+            HtmlTree ulAllClasses = HtmlTree.UL(HtmlStyle.navList, getNavLinkClassIndex());
+            ulAllClasses.addAttr(HtmlAttr.ID, allClassesId.toString());
+            subDiv.addContent(ulAllClasses);
+            subDiv.addContent(getAllClassesLinkScript(allClassesId.toString()));
+            addSummaryDetailLinks(subDiv);
+            if (header) {
+                subDiv.addContent(getMarkerAnchor("skip-navbar_top"));
+                body.addContent(subDiv);
+                body.addContent(HtmlConstants.END_OF_TOP_NAVBAR);
+            } else {
+                subDiv.addContent(getMarkerAnchor("skip-navbar_bottom"));
+                body.addContent(subDiv);
+                body.addContent(HtmlConstants.END_OF_BOTTOM_NAVBAR);
+            }
+        }
+    }
+
+    /**
      * Print the word "NEXT" to indicate that no link is available.  Override
      * this method to customize next link.
      */
@@ -526,6 +745,16 @@
     }
 
     /**
+     * Get the word "NEXT" to indicate that no link is available.  Override
+     * this method to customize next link.
+     *
+     * @return a content tree for the link
+     */
+    protected Content getNavLinkNext() {
+        return getNavLinkNext(null);
+    }
+
+    /**
      * Print the word "PREV" to indicate that no link is available.  Override
      * this method to customize prev link.
      */
@@ -534,12 +763,28 @@
     }
 
     /**
+     * Get the word "PREV" to indicate that no link is available.  Override
+     * this method to customize prev link.
+     *
+     * @return a content tree for the link
+     */
+    protected Content getNavLinkPrevious() {
+        return getNavLinkPrevious(null);
+    }
+
+    /**
      * Do nothing. This is the default method.
      */
     protected void printSummaryDetailLinks() {
     }
 
     /**
+     * Do nothing. This is the default method.
+     */
+    protected void addSummaryDetailLinks(Content navDiv) {
+    }
+
+    /**
      * Print link to the "overview-summary.html" page.
      */
     protected void navLinkContents() {
@@ -550,6 +795,18 @@
     }
 
     /**
+     * Get link to the "overview-summary.html" page.
+     *
+     * @return a content tree for the link
+     */
+    protected Content getNavLinkContents() {
+        Content linkContent = getHyperLink(relativePath +
+                "overview-summary.html", "", overviewLabel, "", "");
+        Content li = HtmlTree.LI(linkContent);
+        return li;
+    }
+
+    /**
      * Description for a cell in the navigation bar.
      */
     protected void navCellStart() {
@@ -590,6 +847,19 @@
     }
 
     /**
+     * Get link to the "package-summary.html" page for the package passed.
+     *
+     * @param pkg Package to which link will be generated
+     * @return a content tree for the link
+     */
+    protected Content getNavLinkPackage(PackageDoc pkg) {
+        Content linkContent = getPackageLink(pkg,
+                packageLabel);
+        Content li = HtmlTree.LI(linkContent);
+        return li;
+    }
+
+    /**
      * Print the word "Package" in the navigation bar cell, to indicate that
      * link is not available here.
      */
@@ -602,6 +872,16 @@
     }
 
     /**
+     * Get the word "Package" , to indicate that link is not available here.
+     *
+     * @return a content tree for the link
+     */
+    protected Content getNavLinkPackage() {
+        Content li = HtmlTree.LI(packageLabel);
+        return li;
+    }
+
+    /**
      * Print the word "Use" in the navigation bar cell, to indicate that link
      * is not available.
      */
@@ -614,6 +894,16 @@
     }
 
     /**
+     * Get the word "Use", to indicate that link is not available.
+     *
+     * @return a content tree for the link
+     */
+    protected Content getNavLinkClassUse() {
+        Content li = HtmlTree.LI(useLabel);
+        return li;
+    }
+
+    /**
      * Print link for previous file.
      *
      * @param prev File name for the prev link.
@@ -628,6 +918,22 @@
     }
 
     /**
+     * Get link for previous file.
+     *
+     * @param prev File name for the prev link
+     * @return a content tree for the link
+     */
+    public Content getNavLinkPrevious(String prev) {
+        Content li;
+        if (prev != null) {
+            li = HtmlTree.LI(getHyperLink(prev, "", prevLabel, "", ""));
+        }
+        else
+            li = HtmlTree.LI(prevLabel);
+        return li;
+    }
+
+    /**
      * Print link for next file.  If next is null, just print the label
      * without linking it anywhere.
      *
@@ -643,16 +949,46 @@
     }
 
     /**
+     * Get link for next file.  If next is null, just print the label
+     * without linking it anywhere.
+     *
+     * @param next File name for the next link
+     * @return a content tree for the link
+     */
+    public Content getNavLinkNext(String next) {
+        Content li;
+        if (next != null) {
+            li = HtmlTree.LI(getHyperLink(next, "", nextLabel, "", ""));
+        }
+        else
+            li = HtmlTree.LI(nextLabel);
+        return li;
+    }
+
+    /**
      * Print "FRAMES" link, to switch to the frame version of the output.
      *
      * @param link File to be linked, "index.html".
      */
     protected void navShowLists(String link) {
-        print(getHyperLink(link + "?" + path + filename, "",
+        print(getHyperLinkString(link + "?" + path + filename, "",
             configuration.getText("doclet.FRAMES"), true, "", "", "_top"));
     }
 
     /**
+     * Get "FRAMES" link, to switch to the frame version of the output.
+     *
+     * @param link File to be linked, "index.html"
+     * @return a content tree for the link
+     */
+    protected Content getNavShowLists(String link) {
+        Content framesContent = getHyperLink(link + "?" + path +
+                filename, "", framesLabel, "", "_top");
+        Content li = HtmlTree.LI(framesContent);
+        return li;
+    }
+
+    /**
      * Print "FRAMES" link, to switch to the frame version of the output.
      */
     protected void navShowLists() {
@@ -660,16 +996,37 @@
     }
 
     /**
+     * Get "FRAMES" link, to switch to the frame version of the output.
+     *
+     * @return a content tree for the link
+     */
+    protected Content getNavShowLists() {
+        return getNavShowLists(relativePath + "index.html");
+    }
+
+    /**
      * Print "NO FRAMES" link, to switch to the non-frame version of the output.
      *
      * @param link File to be linked.
      */
     protected void navHideLists(String link) {
-        print(getHyperLink(link, "", configuration.getText("doclet.NO_FRAMES"),
+        print(getHyperLinkString(link, "", configuration.getText("doclet.NO_FRAMES"),
             true, "", "", "_top"));
     }
 
     /**
+     * Get "NO FRAMES" link, to switch to the non-frame version of the output.
+     *
+     * @param link File to be linked
+     * @return a content tree for the link
+     */
+    protected Content getNavHideLists(String link) {
+        Content noFramesContent = getHyperLink(link, "", noframesLabel, "", "_top");
+        Content li = HtmlTree.LI(noFramesContent);
+        return li;
+    }
+
+    /**
      * Print "Tree" link in the navigation bar. If there is only one package
      * specified on the command line, then the "Tree" link will be to the
      * only "package-tree.html" file otherwise it will be to the
@@ -689,10 +1046,39 @@
     }
 
     /**
-     * Print "Tree" link to the "overview-tree.html" file.
+     * Get "Tree" link in the navigation bar. If there is only one package
+     * specified on the command line, then the "Tree" link will be to the
+     * only "package-tree.html" file otherwise it will be to the
+     * "overview-tree.html" file.
+     *
+     * @return a content tree for the link
      */
-    protected void navLinkMainTree(String label) {
-        printHyperLink(relativePath + "overview-tree.html", label);
+    protected Content getNavLinkTree() {
+        Content treeLinkContent;
+        PackageDoc[] packages = configuration.root.specifiedPackages();
+        if (packages.length == 1 && configuration.root.specifiedClasses().length == 0) {
+            treeLinkContent = getHyperLink(pathString(packages[0],
+                    "package-tree.html"), "", treeLabel,
+                    "", "");
+        } else {
+            treeLinkContent = getHyperLink(relativePath + "overview-tree.html",
+                    "", treeLabel, "", "");
+        }
+        Content li = HtmlTree.LI(treeLinkContent);
+        return li;
+    }
+
+    /**
+     * Get the overview tree link for the main tree.
+     *
+     * @param label the label for the link
+     * @return a content tree for the link
+     */
+    protected Content getNavLinkMainTree(String label) {
+        Content mainTreeContent = getHyperLink(relativePath + "overview-tree.html",
+                new StringContent(label));
+        Content li = HtmlTree.LI(mainTreeContent);
+        return li;
     }
 
     /**
@@ -708,6 +1094,16 @@
     }
 
     /**
+     * Get the word "Class", to indicate that class link is not available.
+     *
+     * @return a content tree for the link
+     */
+    protected Content getNavLinkClass() {
+        Content li = HtmlTree.LI(classLabel);
+        return li;
+    }
+
+    /**
      * Print "Deprecated" API link in the navigation bar.
      */
     protected void navLinkDeprecated() {
@@ -718,6 +1114,18 @@
     }
 
     /**
+     * Get "Deprecated" API link in the navigation bar.
+     *
+     * @return a content tree for the link
+     */
+    protected Content getNavLinkDeprecated() {
+        Content linkContent = getHyperLink(relativePath +
+                "deprecated-list.html", "", deprecatedLabel, "", "");
+        Content li = HtmlTree.LI(linkContent);
+        return li;
+    }
+
+    /**
      * Print link for generated index. If the user has used "-splitindex"
      * command line option, then link to file "index-files/index-1.html" is
      * generated otherwise link to file "index-all.html" is generated.
@@ -727,6 +1135,21 @@
                 AllClassesFrameWriter.OUTPUT_FILE_NAME_NOFRAMES,
             "", "", configuration.getText("doclet.All_Classes"), true);
     }
+
+    /**
+     * Get link for generated index. If the user has used "-splitindex"
+     * command line option, then link to file "index-files/index-1.html" is
+     * generated otherwise link to file "index-all.html" is generated.
+     *
+     * @return a content tree for the link
+     */
+    protected Content getNavLinkClassIndex() {
+        Content allClassesContent = getHyperLink(relativePath +
+                AllClassesFrameWriter.OUTPUT_FILE_NAME_NOFRAMES, "",
+                allclassesLabel, "", "");
+        Content li = HtmlTree.LI(allClassesContent);
+        return li;
+    }
     /**
      * Print link for generated class index.
      */
@@ -743,6 +1166,20 @@
     }
 
     /**
+     * Get link for generated class index.
+     *
+     * @return a content tree for the link
+     */
+    protected Content getNavLinkIndex() {
+        Content linkContent = getHyperLink(relativePath +(configuration.splitindex?
+            DirectoryManager.getPath("index-files") + fileseparator: "") +
+            (configuration.splitindex?"index-1.html" : "index-all.html"), "",
+            indexLabel, "", "");
+        Content li = HtmlTree.LI(linkContent);
+        return li;
+    }
+
+    /**
      * Print help file link. If user has provided a help file, then generate a
      * link to the user given file, which is already copied to current or
      * destination directory.
@@ -764,6 +1201,29 @@
     }
 
     /**
+     * Get help file link. If user has provided a help file, then generate a
+     * link to the user given file, which is already copied to current or
+     * destination directory.
+     *
+     * @return a content tree for the link
+     */
+    protected Content getNavLinkHelp() {
+        String helpfilenm = configuration.helpfile;
+        if (helpfilenm.equals("")) {
+            helpfilenm = "help-doc.html";
+        } else {
+            int lastsep;
+            if ((lastsep = helpfilenm.lastIndexOf(File.separatorChar)) != -1) {
+                helpfilenm = helpfilenm.substring(lastsep + 1);
+            }
+        }
+        Content linkContent = getHyperLink(relativePath + helpfilenm, "",
+                helpLabel, "", "");
+        Content li = HtmlTree.LI(linkContent);
+        return li;
+    }
+
+    /**
      * Print the word "Detail" in the navigation bar. No link is available.
      */
     protected void navDetail() {
@@ -845,6 +1305,96 @@
     }
 
     /**
+     * Get summary table header.
+     *
+     * @param header the header for the table
+     * @param scope the scope of the headers
+     * @return a content tree for the header
+     */
+    public Content getSummaryTableHeader(String[] header, String scope) {
+        Content tr = new HtmlTree(HtmlTag.TR);
+        int size = header.length;
+        Content tableHeader;
+        if (size == 1) {
+            tableHeader = new StringContent(header[0]);
+            tr.addContent(HtmlTree.TH(HtmlStyle.colOne, scope, tableHeader));
+            return tr;
+        }
+        for (int i = 0; i < size; i++) {
+            tableHeader = new StringContent(header[i]);
+            if(i == 0)
+                tr.addContent(HtmlTree.TH(HtmlStyle.colFirst, scope, tableHeader));
+            else if(i == (size - 1))
+                tr.addContent(HtmlTree.TH(HtmlStyle.colLast, scope, tableHeader));
+            else
+                tr.addContent(HtmlTree.TH(scope, tableHeader));
+        }
+        return tr;
+    }
+
+    /**
+     * Get table caption.
+     *
+     * @param rawText the caption for the table which could be raw Html
+     * @return a content tree for the caption
+     */
+    public Content getTableCaption(String rawText) {
+        Content title = new RawHtml(rawText);
+        Content captionSpan = HtmlTree.SPAN(title);
+        Content space = getSpace();
+        Content tabSpan = HtmlTree.SPAN(HtmlStyle.tabEnd, space);
+        Content caption = HtmlTree.CAPTION(captionSpan);
+        caption.addContent(tabSpan);
+        return caption;
+    }
+
+    /**
+     * Get the marker anchor which will be added to the documentation tree.
+     *
+     * @param anchorName the anchor name attribute
+     * @return a content tree for the marker anchor
+     */
+    public Content getMarkerAnchor(String anchorName) {
+        return getMarkerAnchor(anchorName, null);
+    }
+
+    /**
+     * Get the marker anchor which will be added to the documentation tree.
+     *
+     * @param anchorName the anchor name attribute
+     * @param anchorContent the content that should be added to the anchor
+     * @return a content tree for the marker anchor
+     */
+    public Content getMarkerAnchor(String anchorName, Content anchorContent) {
+        if (anchorContent == null)
+            anchorContent = new Comment(" ");
+        Content markerAnchor = HtmlTree.A_NAME(anchorName, anchorContent);
+        return markerAnchor;
+    }
+
+    /**
+     * Returns a packagename content.
+     *
+     * @param packageDoc the package to check
+     * @return package name content
+     */
+    public Content getPackageName(PackageDoc packageDoc) {
+        return packageDoc == null || packageDoc.name().length() == 0 ?
+            defaultPackageLabel :
+            getPackageLabel(packageDoc.name());
+    }
+
+    /**
+     * Returns a package name label.
+     *
+     * @param parsedName the package name
+     * @return the package name content
+     */
+    public Content getPackageLabel(String packageName) {
+        return new StringContent(packageName);
+    }
+
+    /**
      * Prine table header information about color, column span and the font.
      *
      * @param color Background color.
@@ -1028,7 +1578,7 @@
      * @param isStrong true if the label should be strong.
      */
     public void printPackageLink(PackageDoc pkg, String label, boolean isStrong) {
-        print(getPackageLink(pkg, label, isStrong));
+        print(getPackageLinkString(pkg, label, isStrong));
     }
 
     /**
@@ -1041,7 +1591,7 @@
      */
     public void printPackageLink(PackageDoc pkg, String label, boolean isStrong,
             String style) {
-        print(getPackageLink(pkg, label, isStrong, style));
+        print(getPackageLinkString(pkg, label, isStrong, style));
     }
 
     /**
@@ -1052,9 +1602,9 @@
      * @param isStrong true if the label should be strong.
      * @return the link to the given package.
      */
-    public String getPackageLink(PackageDoc pkg, String label,
+    public String getPackageLinkString(PackageDoc pkg, String label,
                                  boolean isStrong) {
-        return getPackageLink(pkg, label, isStrong, "");
+        return getPackageLinkString(pkg, label, isStrong, "");
     }
 
     /**
@@ -1066,7 +1616,7 @@
      * @param style  the font of the package link label.
      * @return the link to the given package.
      */
-    public String getPackageLink(PackageDoc pkg, String label, boolean isStrong,
+    public String getPackageLinkString(PackageDoc pkg, String label, boolean isStrong,
             String style) {
         boolean included = pkg != null && pkg.isIncluded();
         if (! included) {
@@ -1079,12 +1629,43 @@
             }
         }
         if (included || pkg == null) {
-            return getHyperLink(pathString(pkg, "package-summary.html"),
+            return getHyperLinkString(pathString(pkg, "package-summary.html"),
                                 "", label, isStrong, style);
         } else {
             String crossPkgLink = getCrossPackageLink(Util.getPackageName(pkg));
             if (crossPkgLink != null) {
-                return getHyperLink(crossPkgLink, "", label, isStrong, style);
+                return getHyperLinkString(crossPkgLink, "", label, isStrong, style);
+            } else {
+                return label;
+            }
+        }
+    }
+
+    /**
+     * Return the link to the given package.
+     *
+     * @param pkg the package to link to.
+     * @param label the label for the link.
+     * @return a content tree for the package link.
+     */
+    public Content getPackageLink(PackageDoc pkg, Content label) {
+        boolean included = pkg != null && pkg.isIncluded();
+        if (! included) {
+            PackageDoc[] packages = configuration.packages;
+            for (int i = 0; i < packages.length; i++) {
+                if (packages[i].equals(pkg)) {
+                    included = true;
+                    break;
+                }
+            }
+        }
+        if (included || pkg == null) {
+            return getHyperLink(pathString(pkg, "package-summary.html"),
+                                "", label);
+        } else {
+            String crossPkgLink = getCrossPackageLink(Util.getPackageName(pkg));
+            if (crossPkgLink != null) {
+                return getHyperLink(crossPkgLink, "", label);
             } else {
                 return label;
             }
@@ -1112,6 +1693,29 @@
     }
 
     /**
+     * Add the link to the content tree.
+     *
+     * @param doc program element doc for which the link will be added
+     * @param label label for the link
+     * @param htmltree the content tree to which the link will be added
+     */
+    public void addSrcLink(ProgramElementDoc doc, Content label, Content htmltree) {
+        if (doc == null) {
+            return;
+        }
+        ClassDoc cd = doc.containingClass();
+        if (cd == null) {
+            //d must be a class doc since in has no containing class.
+            cd = (ClassDoc) doc;
+        }
+        String href = relativePath + DocletConstants.SOURCE_OUTPUT_DIR_NAME
+                + DirectoryManager.getDirectoryPath(cd.containingPackage())
+                + cd.name() + ".html#" + SourceToHTMLConverter.getAnchorName(doc);
+        Content linkContent = getHyperLink(href, "", label, "", "");
+        htmltree.addContent(linkContent);
+    }
+
+    /**
      * Return the link to the given class.
      *
      * @param linkInfo the information about the link.
@@ -1175,7 +1779,7 @@
                 //the -link option.  There are ways to determine if an external package
                 //exists, but no way to determine if the external class exists.  We just
                 //have to assume that it does.
-                return getHyperLink(
+                return getHyperLinkString(
                     configuration.extern.getExternalLink(packageName, relativePath,
                                 className + ".html?is-external=true"),
                     refMemName == null ? "" : refMemName,
@@ -1200,17 +1804,27 @@
             "package-summary.html?is-external=true");
     }
 
-    public void printQualifiedClassLink(int context, ClassDoc cd) {
-        printLink(new LinkInfoImpl(context, cd,
-            configuration.getClassName(cd), ""));
+    /**
+     * Get the class link.
+     *
+     * @param context the id of the context where the link will be added
+     * @param cd the class doc to link to
+     * @return a content tree for the link
+     */
+    public Content getQualifiedClassLink(int context, ClassDoc cd) {
+        return new RawHtml(getLink(new LinkInfoImpl(context, cd,
+                configuration.getClassName(cd), "")));
     }
 
     /**
-     * Print Class link, with only class name as the link and prefixing
-     * plain package name.
+     * Add the class link.
+     *
+     * @param context the id of the context where the link will be added
+     * @param cd the class doc to link to
+     * @param contentTree the content tree to which the link will be added
      */
-    public void printPreQualifiedClassLink(int context, ClassDoc cd) {
-        print(getPreQualifiedClassLink(context, cd, false));
+    public void addPreQualifiedClassLink(int context, ClassDoc cd, Content contentTree) {
+        addPreQualifiedClassLink(context, cd, false, contentTree);
     }
 
     /**
@@ -1233,13 +1847,36 @@
         return classlink;
     }
 
+    /**
+     * Add the class link with the package portion of the label in
+     * plain text. If the qualifier is excluded, it will not be included in the
+     * link label.
+     *
+     * @param context the id of the context where the link will be added
+     * @param cd the class to link to
+     * @param isStrong true if the link should be strong
+     * @param contentTree the content tree to which the link with be added
+     */
+    public void addPreQualifiedClassLink(int context,
+            ClassDoc cd, boolean isStrong, Content contentTree) {
+        PackageDoc pd = cd.containingPackage();
+        if(pd != null && ! configuration.shouldExcludeQualifier(pd.name())) {
+            contentTree.addContent(getPkgName(cd));
+        }
+        contentTree.addContent(new RawHtml(getLink(new LinkInfoImpl(
+                context, cd, cd.name(), isStrong))));
+    }
 
     /**
-     * Print Class link, with only class name as the strong link and prefixing
+     * Add the class link, with only class name as the strong link and prefixing
      * plain package name.
+     *
+     * @param context the id of the context where the link will be added
+     * @param cd the class to link to
+     * @param contentTree the content tree to which the link with be added
      */
-    public void printPreQualifiedStrongClassLink(int context, ClassDoc cd) {
-        print(getPreQualifiedClassLink(context, cd, true));
+    public void addPreQualifiedStrongClassLink(int context, ClassDoc cd, Content contentTree) {
+        addPreQualifiedClassLink(context, cd, true, contentTree);
     }
 
     public void printText(String key) {
@@ -1267,16 +1904,15 @@
     }
 
     /**
-     * Print the link for the given member.
+     * Get the link for the given member.
      *
-     * @param context the id of the context where the link will be printed.
-     * @param doc the member being linked to.
-     * @param label the label for the link.
-     * @param strong true if the link should be strong.
+     * @param context the id of the context where the link will be added
+     * @param doc the member being linked to
+     * @param label the label for the link
+     * @return a content tree for the doc link
      */
-    public void printDocLink(int context, MemberDoc doc, String label,
-            boolean strong) {
-        print(getDocLink(context, doc, label, strong));
+    public Content getDocLink(int context, MemberDoc doc, String label) {
+        return getDocLink(context, doc.containingClass(), doc, label);
     }
 
     /**
@@ -1338,6 +1974,34 @@
         }
     }
 
+    /**
+     * Return the link for the given member.
+     *
+     * @param context the id of the context where the link will be added
+     * @param classDoc the classDoc that we should link to.  This is not
+     *                 necessarily equal to doc.containingClass().  We may be
+     *                 inheriting comments
+     * @param doc the member being linked to
+     * @param label the label for the link
+     * @return the link for the given member
+     */
+    public Content getDocLink(int context, ClassDoc classDoc, MemberDoc doc,
+        String label) {
+        if (! (doc.isIncluded() ||
+            Util.isLinkable(classDoc, configuration()))) {
+            return new StringContent(label);
+        } else if (doc instanceof ExecutableMemberDoc) {
+            ExecutableMemberDoc emd = (ExecutableMemberDoc)doc;
+            return new RawHtml(getLink(new LinkInfoImpl(context, classDoc,
+                getAnchor(emd), label, false)));
+        } else if (doc instanceof MemberDoc) {
+            return new RawHtml(getLink(new LinkInfoImpl(context, classDoc,
+                doc.name(), label, false)));
+        } else {
+            return new StringContent(label);
+        }
+    }
+
     public void anchor(ExecutableMemberDoc emd) {
         anchor(getAnchor(emd));
     }
@@ -1392,14 +2056,14 @@
                 //@see is referencing an included package
                 String packageName = isplaintext ? refPackage.name() :
                     getCode() + refPackage.name() + getCodeEnd();
-                result.append(getPackageLink(refPackage,
+                result.append(getPackageLinkString(refPackage,
                     label.length() == 0 ? packageName : label, false));
             } else {
                 //@see is not referencing an included class or package.  Check for cross links.
                 String classCrossLink, packageCrossLink = getCrossPackageLink(refClassName);
                 if (packageCrossLink != null) {
                     //Package cross link found
-                    result.append(getHyperLink(packageCrossLink, "",
+                    result.append(getHyperLinkString(packageCrossLink, "",
                         (label.length() == 0)? text : label, false));
                 } else if ((classCrossLink = getCrossClassLink(refClassName,
                         refMemName, label, false, "", ! isplaintext)) != null) {
@@ -1468,18 +2132,61 @@
         printCommentTags(doc, tag.inlineTags(), false, false);
     }
 
+    /**
+     * Add the inline comment.
+     *
+     * @param doc the doc for which the inline comment will be added
+     * @param tag the inline tag to be added
+     * @param htmltree the content tree to which the comment will be added
+     */
+    public void addInlineComment(Doc doc, Tag tag, Content htmltree) {
+        addCommentTags(doc, tag.inlineTags(), false, false, htmltree);
+    }
+
     public void printInlineDeprecatedComment(Doc doc, Tag tag) {
         printCommentTags(doc, tag.inlineTags(), true, false);
     }
 
+    /**
+     * Add the inline deprecated comment.
+     *
+     * @param doc the doc for which the inline deprecated comment will be added
+     * @param tag the inline tag to be added
+     * @param htmltree the content tree to which the comment will be added
+     */
+    public void addInlineDeprecatedComment(Doc doc, Tag tag, Content htmltree) {
+        addCommentTags(doc, tag.inlineTags(), true, false, htmltree);
+    }
+
     public void printSummaryComment(Doc doc) {
         printSummaryComment(doc, doc.firstSentenceTags());
     }
 
+    /**
+     * Adds the summary content.
+     *
+     * @param doc the doc for which the summary will be generated
+     * @param htmltree the documentation tree to which the summary will be added
+     */
+    public void addSummaryComment(Doc doc, Content htmltree) {
+        addSummaryComment(doc, doc.firstSentenceTags(), htmltree);
+    }
+
     public void printSummaryComment(Doc doc, Tag[] firstSentenceTags) {
         printCommentTags(doc, firstSentenceTags, false, true);
     }
 
+    /**
+     * Adds the summary content.
+     *
+     * @param doc the doc for which the summary will be generated
+     * @param firstSentenceTags the first sentence tags for the doc
+     * @param htmltree the documentation tree to which the summary will be added
+     */
+    public void addSummaryComment(Doc doc, Tag[] firstSentenceTags, Content htmltree) {
+        addCommentTags(doc, firstSentenceTags, false, true, htmltree);
+    }
+
     public void printSummaryDeprecatedComment(Doc doc) {
         printCommentTags(doc, doc.firstSentenceTags(), true, true);
     }
@@ -1488,11 +2195,25 @@
         printCommentTags(doc, tag.firstSentenceTags(), true, true);
     }
 
+    public void addSummaryDeprecatedComment(Doc doc, Tag tag, Content htmltree) {
+        addCommentTags(doc, tag.firstSentenceTags(), true, true, htmltree);
+    }
+
     public void printInlineComment(Doc doc) {
         printCommentTags(doc, doc.inlineTags(), false, false);
         p();
     }
 
+    /**
+     * Adds the inline comment.
+     *
+     * @param doc the doc for which the inline comments will be generated
+     * @param htmltree the documentation tree to which the inline comments will be added
+     */
+    public void addInlineComment(Doc doc, Content htmltree) {
+        addCommentTags(doc, doc.inlineTags(), false, false, htmltree);
+    }
+
     public void printInlineDeprecatedComment(Doc doc) {
         printCommentTags(doc, doc.inlineTags(), true, false);
     }
@@ -1515,6 +2236,36 @@
     }
 
     /**
+     * Adds the comment tags.
+     *
+     * @param doc the doc for which the comment tags will be generated
+     * @param tags the first sentence tags for the doc
+     * @param depr true if it is deprecated
+     * @param first true if the first sentenge tags should be added
+     * @param htmltree the documentation tree to which the comment tags will be added
+     */
+    private void addCommentTags(Doc doc, Tag[] tags, boolean depr,
+            boolean first, Content htmltree) {
+        if(configuration.nocomment){
+            return;
+        }
+        Content div;
+        Content result = new RawHtml(commentTagsToString(null, doc, tags, first));
+        if (depr) {
+            Content italic = HtmlTree.I(result);
+            div = HtmlTree.DIV(HtmlStyle.block, italic);
+            htmltree.addContent(div);
+        }
+        else {
+            div = HtmlTree.DIV(HtmlStyle.block, result);
+            htmltree.addContent(div);
+        }
+        if (tags.length == 0) {
+            htmltree.addContent(getSpace());
+        }
+    }
+
+    /**
      * Converts inline tags and text to text strings, expanding the
      * inline tags along the way.  Called wherever text can contain
      * an inline tag, such as in comments or in free-form text arguments
@@ -1624,8 +2375,8 @@
             return text;
         }
 
-        if (! redirectPathFromRoot.endsWith(DirectoryManager.URL_FILE_SEPERATOR)) {
-            redirectPathFromRoot += DirectoryManager.URL_FILE_SEPERATOR;
+        if (! redirectPathFromRoot.endsWith(DirectoryManager.URL_FILE_SEPARATOR)) {
+            redirectPathFromRoot += DirectoryManager.URL_FILE_SEPARATOR;
         }
 
         //Redirect all relative links.
@@ -1751,6 +2502,27 @@
     }
 
     /**
+     * Returns a link to the stylesheet file.
+     *
+     * @return an HtmlTree for the lINK tag which provides the stylesheet location
+     */
+    public HtmlTree getStyleSheetProperties() {
+        String filename = configuration.stylesheetfile;
+        if (filename.length() > 0) {
+            File stylefile = new File(filename);
+            String parent = stylefile.getParent();
+            filename = (parent == null)?
+                filename:
+                filename.substring(parent.length() + 1);
+        } else {
+            filename = "stylesheet.css";
+        }
+        filename = relativePath + filename;
+        HtmlTree link = HtmlTree.LINK("stylesheet", "text/css", filename, "Style");
+        return link;
+    }
+
+    /**
      * According to the Java Language Specifications, all the outer classes
      * and static nested classes are core classes.
      */
@@ -1768,6 +2540,17 @@
     }
 
     /**
+     * Adds the annotatation types for the given packageDoc.
+     *
+     * @param packageDoc the package to write annotations for.
+     * @param htmltree the documentation tree to which the annotation info will be
+     *        added
+     */
+    public void addAnnotationInfo(PackageDoc packageDoc, Content htmltree) {
+        addAnnotationInfo(packageDoc, packageDoc.annotations(), htmltree);
+    }
+
+    /**
      * Write the annotatation types for the given doc.
      *
      * @param doc the doc to write annotations for.
@@ -1777,6 +2560,16 @@
     }
 
     /**
+     * Adds the annotatation types for the given doc.
+     *
+     * @param packageDoc the package to write annotations for
+     * @param htmltree the content tree to which the annotation types will be added
+     */
+    public void addAnnotationInfo(ProgramElementDoc doc, Content htmltree) {
+        addAnnotationInfo(doc, doc.annotations(), htmltree);
+    }
+
+    /**
      * Write the annotatation types for the given doc and parameter.
      *
      * @param indent the number of spaced to indent the parameters.
@@ -1788,6 +2581,19 @@
     }
 
     /**
+     * Add the annotatation types for the given doc and parameter.
+     *
+     * @param indent the number of spaces to indent the parameters.
+     * @param doc the doc to write annotations for.
+     * @param param the parameter to write annotations for.
+     * @param tree the content tree to which the annotation types will be added
+     */
+    public boolean addAnnotationInfo(int indent, Doc doc, Parameter param,
+            Content tree) {
+        return addAnnotationInfo(indent, doc, param.annotations(), false, tree);
+    }
+
+    /**
      * Write the annotatation types for the given doc.
      *
      * @param doc the doc to write annotations for.
@@ -1798,6 +2604,19 @@
     }
 
     /**
+     * Adds the annotatation types for the given doc.
+     *
+     * @param doc the doc to write annotations for.
+     * @param descList the array of {@link AnnotationDesc}.
+     * @param htmltree the documentation tree to which the annotation info will be
+     *        added
+     */
+    private void addAnnotationInfo(Doc doc, AnnotationDesc[] descList,
+            Content htmltree) {
+        addAnnotationInfo(0, doc, descList, true, htmltree);
+    }
+
+    /**
      * Write the annotatation types for the given doc.
      *
      * @param indent the number of extra spaces to indent the annotations.
@@ -1818,6 +2637,29 @@
     }
 
     /**
+     * Adds the annotatation types for the given doc.
+     *
+     * @param indent the number of extra spaces to indent the annotations.
+     * @param doc the doc to write annotations for.
+     * @param descList the array of {@link AnnotationDesc}.
+     * @param htmltree the documentation tree to which the annotation info will be
+     *        added
+     */
+    private boolean addAnnotationInfo(int indent, Doc doc,
+            AnnotationDesc[] descList, boolean lineBreak, Content htmltree) {
+        List<String> annotations = getAnnotations(indent, descList, lineBreak);
+        if (annotations.size() == 0) {
+            return false;
+        }
+        Content annotationContent;
+        for (Iterator<String> iter = annotations.iterator(); iter.hasNext();) {
+            annotationContent = new RawHtml(iter.next());
+            htmltree.addContent(annotationContent);
+        }
+        return true;
+    }
+
+   /**
      * Return the string representations of the annotation types for
      * the given doc.
      *
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HtmlSerialFieldWriter.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HtmlSerialFieldWriter.java	Mon Dec 20 21:10:57 2010 -0800
@@ -31,6 +31,7 @@
 import com.sun.tools.doclets.internal.toolkit.*;
 import com.sun.tools.doclets.internal.toolkit.taglets.*;
 import com.sun.tools.doclets.internal.toolkit.util.*;
+import com.sun.tools.doclets.formats.html.markup.*;
 
 /**
  * Generate serialized form for serializable fields.
@@ -46,8 +47,6 @@
 
     private boolean printedOverallAnchor = false;
 
-    private boolean printedFirstMember = false;
-
     public HtmlSerialFieldWriter(SubWriterHolderWriter writer,
                                     ClassDoc classdoc) {
         super(writer, classdoc);
@@ -69,109 +68,143 @@
         }
     }
 
-    public void writeHeader(String heading) {
-        if (! printedOverallAnchor) {
-            writer.anchor("serializedForm");
-            printedOverallAnchor = true;
-            writer.printTableHeadingBackground(heading);
-            writer.println();
-            if (heading.equals(
-                   configuration().getText("doclet.Serialized_Form_class"))) {
-                assert !writer.getMemberDetailsListPrinted();
-            }
-        } else {
-            writer.printTableHeadingBackground(heading);
-            writer.println();
-        }
+    /**
+     * Return the header for serializable fields section.
+     *
+     * @return a content tree for the header
+     */
+    public Content getSerializableFieldsHeader() {
+        HtmlTree ul = new HtmlTree(HtmlTag.UL);
+        ul.addStyle(HtmlStyle.blockList);
+        return ul;
     }
 
-    public void writeMemberHeader(ClassDoc fieldType, String fieldTypeStr,
-            String fieldDimensions, String fieldName) {
-        if (printedFirstMember) {
-            writer.printMemberHeader();
-        }
-        printedFirstMember = true;
-        writer.h3();
-        writer.print(fieldName);
-        writer.h3End();
-        writer.pre();
-        if (fieldType == null) {
-            writer.print(fieldTypeStr);
-        } else {
-            writer.printLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_SERIAL_MEMBER,
-                fieldType));
-        }
-        print(fieldDimensions + ' ');
-        strong(fieldName);
-        writer.preEnd();
-        assert !writer.getMemberDetailsListPrinted();
+    /**
+     * Return the header for serializable fields content section.
+     *
+     * @param isLastContent true if the cotent being documented is the last content.
+     * @return a content tree for the header
+     */
+    public Content getFieldsContentHeader(boolean isLastContent) {
+        HtmlTree li = new HtmlTree(HtmlTag.LI);
+        if (isLastContent)
+            li.addStyle(HtmlStyle.blockListLast);
+        else
+            li.addStyle(HtmlStyle.blockList);
+        return li;
     }
 
     /**
-     * Write the deprecated information for this member.
+     * Add serializable fields.
      *
-     * @param field the field to document.
+     * @param heading the heading for the section
+     * @param serializableFieldsTree the tree to be added to the serializable fileds
+     *        content tree
+     * @return a content tree for the serializable fields content
      */
-    public void writeMemberDeprecatedInfo(FieldDoc field) {
-        printDeprecated(field);
+    public Content getSerializableFields(String heading, Content serializableFieldsTree) {
+        HtmlTree li = new HtmlTree(HtmlTag.LI);
+        li.addStyle(HtmlStyle.blockList);
+        if (serializableFieldsTree.isValid()) {
+            if (!printedOverallAnchor) {
+                li.addContent(writer.getMarkerAnchor("serializedForm"));
+                printedOverallAnchor = true;
+            }
+            Content headingContent = new StringContent(heading);
+            Content serialHeading = HtmlTree.HEADING(HtmlConstants.SERIALIZED_MEMBER_HEADING,
+                    headingContent);
+            li.addContent(serialHeading);
+            li.addContent(serializableFieldsTree);
+        }
+        return li;
     }
 
     /**
-     * Write the description text for this member.
+     * Add the member header.
+     *
+     * @param fieldsType the class document to be listed
+     * @param fieldTypeStr the string for the filed type to be documented
+     * @param fieldDimensions the dimensions of the field string to be added
+     * @param firldName name of the field to be added
+     * @param contentTree the content tree to which the member header will be added
+     */
+    public void addMemberHeader(ClassDoc fieldType, String fieldTypeStr,
+            String fieldDimensions, String fieldName, Content contentTree) {
+        Content nameContent = new RawHtml(fieldName);
+        Content heading = HtmlTree.HEADING(HtmlConstants.MEMBER_HEADING, nameContent);
+        contentTree.addContent(heading);
+        Content pre = new HtmlTree(HtmlTag.PRE);
+        if (fieldType == null) {
+            pre.addContent(fieldTypeStr);
+        } else {
+            Content fieldContent = new RawHtml(writer.getLink(new LinkInfoImpl(
+                    LinkInfoImpl.CONTEXT_SERIAL_MEMBER, fieldType)));
+            pre.addContent(fieldContent);
+        }
+        pre.addContent(fieldDimensions + " ");
+        pre.addContent(fieldName);
+        contentTree.addContent(pre);
+    }
+
+    /**
+     * Add the deprecated information for this member.
      *
      * @param field the field to document.
+     * @param contentTree the tree to which the deprecated info will be added
      */
-    public void writeMemberDescription(FieldDoc field) {
+    public void addMemberDeprecatedInfo(FieldDoc field, Content contentTree) {
+        addDeprecatedInfo(field, contentTree);
+    }
+
+    /**
+     * Add the description text for this member.
+     *
+     * @param field the field to document.
+     * @param contentTree the tree to which the deprecated info will be added
+     */
+    public void addMemberDescription(FieldDoc field, Content contentTree) {
         if (field.inlineTags().length > 0) {
-            writer.printMemberDetailsListStartTag();
-            writer.dd();
-            writer.printInlineComment(field);
-            writer.ddEnd();
+            writer.addInlineComment(field, contentTree);
         }
         Tag[] tags = field.tags("serial");
         if (tags.length > 0) {
-            writer.printMemberDetailsListStartTag();
-            writer.dd();
-            writer.printInlineComment(field, tags[0]);
-            writer.ddEnd();
+            writer.addInlineComment(field, tags[0], contentTree);
         }
     }
 
     /**
-     * Write the description text for this member represented by the tag.
+     * Add the description text for this member represented by the tag.
      *
-     * @param serialFieldTag the field to document (represented by tag).
+     * @param serialFieldTag the field to document (represented by tag)
+     * @param contentTree the tree to which the deprecated info will be added
      */
-    public void writeMemberDescription(SerialFieldTag serialFieldTag) {
+    public void addMemberDescription(SerialFieldTag serialFieldTag, Content contentTree) {
         String serialFieldTagDesc = serialFieldTag.description().trim();
         if (!serialFieldTagDesc.isEmpty()) {
-            writer.dl();
-            writer.dd();
-            writer.print(serialFieldTagDesc);
-            writer.ddEnd();
-            writer.dlEnd();
+            Content serialFieldContent = new RawHtml(serialFieldTagDesc);
+            Content div = HtmlTree.DIV(HtmlStyle.block, serialFieldContent);
+            contentTree.addContent(div);
         }
     }
 
     /**
-     * Write the tag information for this member.
+     * Add the tag information for this member.
      *
      * @param field the field to document.
+     * @param contentTree the tree to which the member tags info will be added
      */
-    public void writeMemberTags(FieldDoc field) {
+    public void addMemberTags(FieldDoc field, Content contentTree) {
         TagletOutputImpl output = new TagletOutputImpl("");
         TagletWriter.genTagOuput(configuration().tagletManager, field,
-            configuration().tagletManager.getCustomTags(field),
+                configuration().tagletManager.getCustomTags(field),
                 writer.getTagletWriterInstance(false), output);
         String outputString = output.toString().trim();
+        Content dlTags = new HtmlTree(HtmlTag.DL);
         if (!outputString.isEmpty()) {
-            writer.printMemberDetailsListStartTag();
-            writer.dd();
-            writer.dl();
-            print(outputString);
-            writer.dlEnd();
-            writer.ddEnd();
+            Content tagContent = new RawHtml(outputString);
+            dlTags.addContent(tagContent);
         }
+        contentTree.addContent(dlTags);
     }
 
     /**
@@ -192,24 +225,4 @@
             return true;
         return false;
     }
-
-    public void writeMemberFooter() {
-        printMemberFooter();
-    }
-
-    /**
-     * Write the footer information. If the serilization overview section was
-     * printed, check for definition list and close list tag.
-     *
-     * @param heading the heading that was written.
-     */
-    public void writeFooter(String heading) {
-        if (printedOverallAnchor) {
-            if (heading.equals(
-                   configuration().getText("doclet.Serialized_Form_class"))) {
-                writer.printMemberDetailsListEndTag();
-                assert !writer.getMemberDetailsListPrinted();
-            }
-        }
-    }
 }
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HtmlSerialMethodWriter.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HtmlSerialMethodWriter.java	Mon Dec 20 21:10:57 2010 -0800
@@ -28,57 +28,119 @@
 import com.sun.javadoc.*;
 import com.sun.tools.doclets.internal.toolkit.*;
 import com.sun.tools.doclets.internal.toolkit.taglets.*;
+import com.sun.tools.doclets.formats.html.markup.*;
 
 /**
  * Generate serialized form for Serializable/Externalizable methods.
  * Documentation denoted by the <code>serialData</code> tag is processed.
  *
  * @author Joe Fialli
+ * @author Bhavesh Patel (Modified)
  */
 public class HtmlSerialMethodWriter extends MethodWriterImpl implements
         SerializedFormWriter.SerialMethodWriter{
 
-    private boolean printedFirstMember = false;
-
     public HtmlSerialMethodWriter(SubWriterHolderWriter writer,
             ClassDoc classdoc) {
         super(writer, classdoc);
     }
 
-    public void writeHeader(String heading) {
-        writer.anchor("serialized_methods");
-        writer.printTableHeadingBackground(heading);
-        writer.p();
+    /**
+     * Return the header for serializable methods section.
+     *
+     * @return a content tree for the header
+     */
+    public Content getSerializableMethodsHeader() {
+        HtmlTree ul = new HtmlTree(HtmlTag.UL);
+        ul.addStyle(HtmlStyle.blockList);
+        return ul;
     }
 
-    public void writeNoCustomizationMsg(String msg) {
-        writer.print(msg);
-        writer.p();
+    /**
+     * Return the header for serializable methods content section.
+     *
+     * @param isLastContent true if the cotent being documented is the last content.
+     * @return a content tree for the header
+     */
+    public Content getMethodsContentHeader(boolean isLastContent) {
+        HtmlTree li = new HtmlTree(HtmlTag.LI);
+        if (isLastContent)
+            li.addStyle(HtmlStyle.blockListLast);
+        else
+            li.addStyle(HtmlStyle.blockList);
+        return li;
+    }
+
+    /**
+     * Add serializable methods.
+     *
+     * @param heading the heading for the section
+     * @param serializableMethodContent the tree to be added to the serializable methods
+     *        content tree
+     * @return a content tree for the serializable methods content
+     */
+    public Content getSerializableMethods(String heading, Content serializableMethodContent) {
+        Content li = HtmlTree.LI(HtmlStyle.blockList, writer.getMarkerAnchor(
+                "serialized_methods"));
+        Content headingContent = new StringContent(heading);
+        Content serialHeading = HtmlTree.HEADING(HtmlConstants.SERIALIZED_MEMBER_HEADING,
+                headingContent);
+        li.addContent(serialHeading);
+        li.addContent(serializableMethodContent);
+        return li;
     }
 
-    public void writeMemberHeader(MethodDoc member) {
-        if (printedFirstMember) {
-            writer.printMemberHeader();
-        }
-        printedFirstMember = true;
-        writer.anchor(member);
-        printHead(member);
-        writeSignature(member);
+    /**
+     * Return the no customization message.
+     *
+     * @param msg the message to be displayed
+     * @return no customization message content
+     */
+    public Content getNoCustomizationMsg(String msg) {
+        Content noCustomizationMsg = new StringContent(msg);
+        return noCustomizationMsg;
+    }
+
+    /**
+     * Add the member header.
+     *
+     * @param member the method document to be listed
+     * @param methodsContentTree the content tree to which the member header will be added
+     */
+    public void addMemberHeader(MethodDoc member, Content methodsContentTree) {
+        methodsContentTree.addContent(writer.getMarkerAnchor(
+                writer.getAnchor(member)));
+        methodsContentTree.addContent(getHead(member));
+        methodsContentTree.addContent(getSignature(member));
     }
 
-    public void writeMemberFooter() {
-        printMemberFooter();
+    /**
+     * Add the deprecated information for this member.
+     *
+     * @param member the method to document.
+     * @param methodsContentTree the tree to which the deprecated info will be added
+     */
+    public void addDeprecatedMemberInfo(MethodDoc member, Content methodsContentTree) {
+        addDeprecatedInfo(member, methodsContentTree);
     }
 
-    public void writeDeprecatedMemberInfo(MethodDoc member) {
-        printDeprecated(member);
+    /**
+     * Add the description text for this member.
+     *
+     * @param member the method to document.
+     * @param methodsContentTree the tree to which the deprecated info will be added
+     */
+    public void addMemberDescription(MethodDoc member, Content methodsContentTree) {
+        addComment(member, methodsContentTree);
     }
 
-    public void writeMemberDescription(MethodDoc member) {
-        printComment(member);
-    }
-
-    public void writeMemberTags(MethodDoc member) {
+    /**
+     * Add the tag information for this member.
+     *
+     * @param member the method to document.
+     * @param methodsContentTree the tree to which the member tags info will be added
+     */
+    public void addMemberTags(MethodDoc member, Content methodsContentTree) {
         TagletOutputImpl output = new TagletOutputImpl("");
         TagletManager tagletManager =
             ConfigurationImpl.getInstance().tagletManager;
@@ -86,14 +148,12 @@
             tagletManager.getSerializedFormTags(),
             writer.getTagletWriterInstance(false), output);
         String outputString = output.toString().trim();
+        Content dlTags = new HtmlTree(HtmlTag.DL);
         if (!outputString.isEmpty()) {
-            writer.printMemberDetailsListStartTag();
-            writer.dd();
-            writer.dl();
-            print(outputString);
-            writer.dlEnd();
-            writer.ddEnd();
+            Content tagContent = new RawHtml(outputString);
+            dlTags.addContent(tagContent);
         }
+        methodsContentTree.addContent(dlTags);
         MethodDoc method = member;
         if (method.name().compareTo("writeExternal") == 0
                 && method.tags("serialData").length == 0) {
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/LinkFactoryImpl.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/LinkFactoryImpl.java	Mon Dec 20 21:10:57 2010 -0800
@@ -79,7 +79,7 @@
                 String filename = pathString(classLinkInfo);
                 if (linkInfo.linkToSelf ||
                                 !(linkInfo.classDoc.name() + ".html").equals(m_writer.filename)) {
-                        linkOutput.append(m_writer.getHyperLink(filename,
+                        linkOutput.append(m_writer.getHyperLinkString(filename,
                             classLinkInfo.where, label.toString(),
                             classLinkInfo.isStrong, classLinkInfo.styleName,
                             title, classLinkInfo.target));
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/MethodWriterImpl.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/MethodWriterImpl.java	Mon Dec 20 21:10:57 2010 -0800
@@ -28,9 +28,9 @@
 import java.io.*;
 
 import com.sun.javadoc.*;
+import com.sun.tools.doclets.formats.html.markup.*;
 import com.sun.tools.doclets.internal.toolkit.*;
 import com.sun.tools.doclets.internal.toolkit.util.*;
-import com.sun.tools.doclets.internal.toolkit.taglets.*;
 
 /**
  * Writes method documentation in HTML format.
@@ -43,8 +43,6 @@
 public class MethodWriterImpl extends AbstractExecutableMemberWriter
         implements MethodWriter, MemberSummaryWriter {
 
-    private boolean printedSummaryHeader = false;
-
     /**
      * Construct a new MethodWriterImpl.
      *
@@ -65,184 +63,127 @@
     }
 
     /**
-     * Write the methods summary header for the given class.
-     *
-     * @param classDoc the class the summary belongs to.
+     * {@inheritDoc}
      */
-    public void writeMemberSummaryHeader(ClassDoc classDoc) {
-        printedSummaryHeader = true;
-        writer.println();
-        writer.println("<!-- ========== METHOD SUMMARY =========== -->");
-        writer.println();
-        writer.printSummaryHeader(this, classDoc);
+    public Content getMemberSummaryHeader(ClassDoc classDoc,
+            Content memberSummaryTree) {
+        memberSummaryTree.addContent(HtmlConstants.START_OF_METHOD_SUMMARY);
+        Content memberTree = writer.getMemberTreeHeader();
+        writer.addSummaryHeader(this, classDoc, memberTree);
+        return memberTree;
     }
 
     /**
-     * Write the methods summary footer for the given class.
-     *
-     * @param classDoc the class the summary belongs to.
+     * {@inheritDoc}
      */
-    public void writeMemberSummaryFooter(ClassDoc classDoc) {
-        writer.printSummaryFooter(this, classDoc);
-    }
-
-    /**
-     * Write the inherited methods summary header for the given class.
-     *
-     * @param classDoc the class the summary belongs to.
-     */
-    public void writeInheritedMemberSummaryHeader(ClassDoc classDoc) {
-        if(! printedSummaryHeader){
-            //We don't want inherited summary to not be under heading.
-            writeMemberSummaryHeader(classDoc);
-            writeMemberSummaryFooter(classDoc);
-            printedSummaryHeader = true;
-        }
-        writer.printInheritedSummaryHeader(this, classDoc);
+    public Content getMethodDetailsTreeHeader(ClassDoc classDoc,
+            Content memberDetailsTree) {
+        memberDetailsTree.addContent(HtmlConstants.START_OF_METHOD_DETAILS);
+        Content methodDetailsTree = writer.getMemberTreeHeader();
+        methodDetailsTree.addContent(writer.getMarkerAnchor("method_detail"));
+        Content heading = HtmlTree.HEADING(HtmlConstants.DETAILS_HEADING,
+                writer.methodDetailsLabel);
+        methodDetailsTree.addContent(heading);
+        return methodDetailsTree;
     }
 
     /**
      * {@inheritDoc}
      */
-    public void writeInheritedMemberSummary(ClassDoc classDoc,
-        ProgramElementDoc method, boolean isFirst, boolean isLast) {
-        writer.printInheritedSummaryMember(this, classDoc, method, isFirst);
-    }
-
-    /**
-     * Write the inherited methods summary footer for the given class.
-     *
-     * @param classDoc the class the summary belongs to.
-     */
-    public void writeInheritedMemberSummaryFooter(ClassDoc classDoc) {
-        writer.printInheritedSummaryFooter(this, classDoc);        ;
-    }
-
-    /**
-     * Write the header for the method documentation.
-     *
-     * @param classDoc the class that the methods belong to.
-     */
-    public void writeHeader(ClassDoc classDoc, String header) {
-        writer.println();
-        writer.println("<!-- ============ METHOD DETAIL ========== -->");
-        writer.println();
-        writer.anchor("method_detail");
-        writer.printTableHeadingBackground(header);
-    }
-
-    /**
-     * Write the method header for the given method.
-     *
-     * @param method the method being documented.
-     * @param isFirst the flag to indicate whether or not the method is the
-     *        first to be documented.
-     */
-    public void writeMethodHeader(MethodDoc method, boolean isFirst) {
-        if (! isFirst) {
-            writer.printMemberHeader();
-        }
-        writer.println();
+    public Content getMethodDocTreeHeader(MethodDoc method,
+            Content methodDetailsTree) {
         String erasureAnchor;
         if ((erasureAnchor = getErasureAnchor(method)) != null) {
-            writer.anchor(erasureAnchor);
+            methodDetailsTree.addContent(writer.getMarkerAnchor((erasureAnchor)));
         }
-        writer.anchor(method);
-        writer.h3();
-        writer.print(method.name());
-        writer.h3End();
+        methodDetailsTree.addContent(
+                writer.getMarkerAnchor(writer.getAnchor(method)));
+        Content methodDocTree = writer.getMemberTreeHeader();
+        Content heading = new HtmlTree(HtmlConstants.MEMBER_HEADING);
+        heading.addContent(method.name());
+        methodDocTree.addContent(heading);
+        return methodDocTree;
     }
 
     /**
-     * Write the signature for the given method.
+     * Get the signature for the given method.
      *
      * @param method the method being documented.
+     * @return a content object for the signature
      */
-    public void writeSignature(MethodDoc method) {
+    public Content getSignature(MethodDoc method) {
         writer.displayLength = 0;
-        writer.pre();
-        writer.writeAnnotationInfo(method);
-        printModifiers(method);
-        writeTypeParameters(method);
-        printReturnType(method);
+        Content pre = new HtmlTree(HtmlTag.PRE);
+        writer.addAnnotationInfo(method, pre);
+        addModifiers(method, pre);
+        addTypeParameters(method, pre);
+        addReturnType(method, pre);
         if (configuration().linksource) {
-            writer.printSrcLink(method, method.name());
+            Content methodName = new StringContent(method.name());
+            writer.addSrcLink(method, methodName, pre);
         } else {
-            strong(method.name());
+            addName(method.name(), pre);
         }
-        writeParameters(method);
-        writeExceptions(method);
-        writer.preEnd();
-        assert !writer.getMemberDetailsListPrinted();
+        addParameters(method, pre);
+        addExceptions(method, pre);
+        return pre;
     }
 
     /**
-     * Write the deprecated output for the given method.
-     *
-     * @param method the method being documented.
+     * {@inheritDoc}
      */
-    public void writeDeprecated(MethodDoc method) {
-        printDeprecated(method);
+    public void addDeprecated(MethodDoc method, Content methodDocTree) {
+        addDeprecatedInfo(method, methodDocTree);
     }
 
     /**
-     * Write the comments for the given method.
-     *
-     * @param method the method being documented.
+     * {@inheritDoc}
      */
-    public void writeComments(Type holder, MethodDoc method) {
+    public void addComments(Type holder, MethodDoc method, Content methodDocTree) {
         ClassDoc holderClassDoc = holder.asClassDoc();
         if (method.inlineTags().length > 0) {
-            writer.printMemberDetailsListStartTag();
             if (holder.asClassDoc().equals(classdoc) ||
-                (! (holderClassDoc.isPublic() ||
+                    (! (holderClassDoc.isPublic() ||
                     Util.isLinkable(holderClassDoc, configuration())))) {
-                writer.dd();
-                writer.printInlineComment(method);
-                writer.ddEnd();
+                writer.addInlineComment(method, methodDocTree);
             } else {
-                String classlink = writer.codeText(
-                    writer.getDocLink(LinkInfoImpl.CONTEXT_METHOD_DOC_COPY,
+                Content link = new RawHtml(
+                        writer.getDocLink(LinkInfoImpl.CONTEXT_METHOD_DOC_COPY,
                         holder.asClassDoc(), method,
                         holder.asClassDoc().isIncluded() ?
                             holder.typeName() : holder.qualifiedTypeName(),
-                        false));
-                writer.dd();
-                writer.strongText(holder.asClassDoc().isClass()?
-                        "doclet.Description_From_Class":
-                        "doclet.Description_From_Interface",
-                    classlink);
-                writer.ddEnd();
-                writer.dd();
-                writer.printInlineComment(method);
-                writer.ddEnd();
+                            false));
+                Content codelLink = HtmlTree.CODE(link);
+                Content strong = HtmlTree.STRONG(holder.asClassDoc().isClass()?
+                    writer.descfrmClassLabel : writer.descfrmInterfaceLabel);
+                strong.addContent(writer.getSpace());
+                strong.addContent(codelLink);
+                methodDocTree.addContent(HtmlTree.DIV(HtmlStyle.block, strong));
+                writer.addInlineComment(method, methodDocTree);
             }
         }
     }
 
     /**
-     * Write the tag output for the given method.
-     *
-     * @param method the method being documented.
+     * {@inheritDoc}
      */
-    public void writeTags(MethodDoc method) {
-        writer.printTags(method);
+    public void addTags(MethodDoc method, Content methodDocTree) {
+        writer.addTagsInfo(method, methodDocTree);
     }
 
     /**
-     * Write the method footer.
+     * {@inheritDoc}
      */
-    public void writeMethodFooter() {
-        printMemberFooter();
+    public Content getMethodDetails(Content methodDetailsTree) {
+        return getMemberTree(methodDetailsTree);
     }
 
     /**
-     * Write the footer for the method documentation.
-     *
-     * @param classDoc the class that the methods belong to.
+     * {@inheritDoc}
      */
-    public void writeFooter(ClassDoc classDoc) {
-        //No footer to write for method documentation
+    public Content getMethodDoc(Content methodDocTree,
+            boolean isLastContent) {
+        return getMemberTree(methodDocTree, isLastContent);
     }
 
     /**
@@ -256,53 +197,89 @@
         return VisibleMemberMap.METHODS;
     }
 
-    public void printSummaryLabel() {
-        writer.printText("doclet.Method_Summary");
+    /**
+     * {@inheritDoc}
+     */
+    public void addSummaryLabel(Content memberTree) {
+        Content label = HtmlTree.HEADING(HtmlConstants.SUMMARY_HEADING,
+                writer.getResource("doclet.Method_Summary"));
+        memberTree.addContent(label);
     }
 
-    public void printTableSummary() {
-        writer.tableIndexSummary(configuration().getText("doclet.Member_Table_Summary",
+    /**
+     * {@inheritDoc}
+     */
+    public String getTableSummary() {
+        return configuration().getText("doclet.Member_Table_Summary",
                 configuration().getText("doclet.Method_Summary"),
-                configuration().getText("doclet.methods")));
+                configuration().getText("doclet.methods"));
     }
 
-    public void printSummaryTableHeader(ProgramElementDoc member) {
+    /**
+     * {@inheritDoc}
+     */
+    public String getCaption() {
+        return configuration().getText("doclet.Methods");
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public String[] getSummaryTableHeader(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");
+        return header;
     }
 
-    public void printSummaryAnchor(ClassDoc cd) {
-        writer.anchor("method_summary");
+    /**
+     * {@inheritDoc}
+     */
+    public void addSummaryAnchor(ClassDoc cd, Content memberTree) {
+        memberTree.addContent(writer.getMarkerAnchor("method_summary"));
     }
 
-    public void printInheritedSummaryAnchor(ClassDoc cd) {
-        writer.anchor("methods_inherited_from_class_" +
-            ConfigurationImpl.getInstance().getClassName(cd));
+    /**
+     * {@inheritDoc}
+     */
+    public void addInheritedSummaryAnchor(ClassDoc cd, Content inheritedTree) {
+        inheritedTree.addContent(writer.getMarkerAnchor(
+                "methods_inherited_from_class_" +
+                configuration().getClassName(cd)));
     }
 
-    public void printInheritedSummaryLabel(ClassDoc cd) {
-        String classlink = writer.getPreQualifiedClassLink(
-            LinkInfoImpl.CONTEXT_MEMBER, cd, false);
-        writer.strong();
-        String key = cd.isClass()?
-            "doclet.Methods_Inherited_From_Class" :
-            "doclet.Methods_Inherited_From_Interface";
-        writer.printText(key, classlink);
-        writer.strongEnd();
+    /**
+     * {@inheritDoc}
+     */
+    public void addInheritedSummaryLabel(ClassDoc cd, Content inheritedTree) {
+        Content classLink = new RawHtml(writer.getPreQualifiedClassLink(
+                LinkInfoImpl.CONTEXT_MEMBER, cd, false));
+        Content label = new StringContent(cd.isClass() ?
+            configuration().getText("doclet.Methods_Inherited_From_Class") :
+            configuration().getText("doclet.Methods_Inherited_From_Interface"));
+        Content labelHeading = HtmlTree.HEADING(HtmlConstants.INHERITED_SUMMARY_HEADING,
+                label);
+        labelHeading.addContent(writer.getSpace());
+        labelHeading.addContent(classLink);
+        inheritedTree.addContent(labelHeading);
     }
 
-    protected void printSummaryType(ProgramElementDoc member) {
+    /**
+     * {@inheritDoc}
+     */
+    protected void addSummaryType(ProgramElementDoc member, Content tdSummaryType) {
         MethodDoc meth = (MethodDoc)member;
-        printModifierAndType(meth, meth.returnType());
+        addModifierAndType(meth, meth.returnType(), tdSummaryType);
     }
 
-    protected static void printOverridden(HtmlDocletWriter writer,
-            Type overriddenType, MethodDoc method) {
+    /**
+     * {@inheritDoc}
+     */
+    protected static void addOverridden(HtmlDocletWriter writer,
+            Type overriddenType, MethodDoc method, Content dl) {
         if(writer.configuration.nocomment){
             return;
         }
@@ -317,31 +294,33 @@
             //is not visible so don't document this.
             return;
         }
-        String label = "doclet.Overrides";
+        Content label = writer.overridesLabel;
         int context = LinkInfoImpl.CONTEXT_METHOD_OVERRIDES;
 
         if (method != null) {
             if(overriddenType.asClassDoc().isAbstract() && method.isAbstract()){
                 //Abstract method is implemented from abstract class,
                 //not overridden
-                label = "doclet.Specified_By";
+                label = writer.specifiedByLabel;
                 context = LinkInfoImpl.CONTEXT_METHOD_SPECIFIED_BY;
             }
-            String overriddenTypeLink = writer.codeText(
-                writer.getLink(new LinkInfoImpl(context, overriddenType)));
+            Content dt = HtmlTree.DT(HtmlTree.STRONG(label));
+            dl.addContent(dt);
+            Content overriddenTypeLink = new RawHtml(
+                    writer.getLink(new LinkInfoImpl(context, overriddenType)));
+            Content codeOverridenTypeLink = HtmlTree.CODE(overriddenTypeLink);
             String name = method.name();
-            writer.dt();
-            writer.strongText(label);
-            writer.dtEnd();
-            writer.dd();
-            String methLink = writer.codeText(
-                writer.getLink(
+            Content methlink = new RawHtml(writer.getLink(
                     new LinkInfoImpl(LinkInfoImpl.CONTEXT_MEMBER,
-                        overriddenType.asClassDoc(),
-                        writer.getAnchor(method), name, false)
-                ));
-            writer.printText("doclet.in_class", methLink, overriddenTypeLink);
-            writer.ddEnd();
+                    overriddenType.asClassDoc(),
+                    writer.getAnchor(method), name, false)));
+            Content codeMethLink = HtmlTree.CODE(methlink);
+            Content dd = HtmlTree.DD(codeMethLink);
+            dd.addContent(writer.getSpace());
+            dd.addContent(writer.getResource("doclet.in_class"));
+            dd.addContent(writer.getSpace());
+            dd.addContent(codeOverridenTypeLink);
+            dl.addContent(dd);
         }
     }
 
@@ -363,61 +342,78 @@
         }
     }
 
-    protected static void printImplementsInfo(HtmlDocletWriter writer,
-            MethodDoc method) {
+    /**
+     * {@inheritDoc}
+     */
+    protected static void addImplementsInfo(HtmlDocletWriter writer,
+            MethodDoc method, Content dl) {
         if(writer.configuration.nocomment){
             return;
         }
         ImplementedMethods implementedMethodsFinder =
-            new ImplementedMethods(method, writer.configuration);
+                new ImplementedMethods(method, writer.configuration);
         MethodDoc[] implementedMethods = implementedMethodsFinder.build();
         for (int i = 0; i < implementedMethods.length; i++) {
             MethodDoc implementedMeth = implementedMethods[i];
             Type intfac = implementedMethodsFinder.getMethodHolder(implementedMeth);
-            String methlink = "";
-            String intfaclink = writer.codeText(
-                writer.getLink(new LinkInfoImpl(
+            Content intfaclink = new RawHtml(writer.getLink(new LinkInfoImpl(
                     LinkInfoImpl.CONTEXT_METHOD_SPECIFIED_BY, intfac)));
-            writer.dt();
-            writer.strongText("doclet.Specified_By");
-            writer.dtEnd();
-            writer.dd();
-            methlink = writer.codeText(writer.getDocLink(
-                LinkInfoImpl.CONTEXT_MEMBER, implementedMeth,
-                implementedMeth.name(), false));
-            writer.printText("doclet.in_interface", methlink, intfaclink);
-            writer.ddEnd();
-        }
-
-    }
-
-    protected void printReturnType(MethodDoc method) {
-        Type type = method.returnType();
-        if (type != null) {
-            writer.printLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_RETURN_TYPE,
-                type));
-            print(' ');
+            Content codeIntfacLink = HtmlTree.CODE(intfaclink);
+            Content dt = HtmlTree.DT(HtmlTree.STRONG(writer.specifiedByLabel));
+            dl.addContent(dt);
+            Content methlink = new RawHtml(writer.getDocLink(
+                    LinkInfoImpl.CONTEXT_MEMBER, implementedMeth,
+                    implementedMeth.name(), false));
+            Content codeMethLink = HtmlTree.CODE(methlink);
+            Content dd = HtmlTree.DD(codeMethLink);
+            dd.addContent(writer.getSpace());
+            dd.addContent(writer.getResource("doclet.in_interface"));
+            dd.addContent(writer.getSpace());
+            dd.addContent(codeIntfacLink);
+            dl.addContent(dd);
         }
     }
 
-    protected void printNavSummaryLink(ClassDoc cd, boolean link) {
-        if (link) {
-            writer.printHyperLink("", (cd == null)?
-                "method_summary":
-                "methods_inherited_from_class_" +
-                ConfigurationImpl.getInstance().getClassName(cd),
-                ConfigurationImpl.getInstance().getText("doclet.navMethod"));
-        } else {
-            writer.printText("doclet.navMethod");
+    /**
+     * Add the return type.
+     *
+     * @param method the method being documented.
+     * @param htmltree the content tree to which the return type will be added
+     */
+    protected void addReturnType(MethodDoc method, Content htmltree) {
+        Type type = method.returnType();
+        if (type != null) {
+            Content linkContent = new RawHtml(writer.getLink(
+                    new LinkInfoImpl(LinkInfoImpl.CONTEXT_RETURN_TYPE, type)));
+            htmltree.addContent(linkContent);
+            htmltree.addContent(writer.getSpace());
         }
     }
 
-    protected void printNavDetailLink(boolean link) {
+    /**
+     * {@inheritDoc}
+     */
+    protected Content getNavSummaryLink(ClassDoc cd, boolean link) {
         if (link) {
-            writer.printHyperLink("", "method_detail",
-                ConfigurationImpl.getInstance().getText("doclet.navMethod"));
+            return writer.getHyperLink("", (cd == null)?
+                "method_summary":
+                "methods_inherited_from_class_" +
+                configuration().getClassName(cd),
+                writer.getResource("doclet.navMethod"));
         } else {
-            writer.printText("doclet.navMethod");
+            return writer.getResource("doclet.navMethod");
+        }
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    protected void addNavDetailLink(boolean link, Content liNav) {
+        if (link) {
+            liNav.addContent(writer.getHyperLink("", "method_detail",
+                    writer.getResource("doclet.navMethod")));
+        } else {
+            liNav.addContent(writer.getResource("doclet.navMethod"));
         }
     }
 }
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/NestedClassWriterImpl.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/NestedClassWriterImpl.java	Mon Dec 20 21:10:57 2010 -0800
@@ -26,8 +26,10 @@
 package com.sun.tools.doclets.formats.html;
 
 import java.io.*;
+import java.util.*;
 
 import com.sun.javadoc.*;
+import com.sun.tools.doclets.formats.html.markup.*;
 import com.sun.tools.doclets.internal.toolkit.*;
 import com.sun.tools.doclets.internal.toolkit.util.*;
 
@@ -42,8 +44,6 @@
 public class NestedClassWriterImpl extends AbstractMemberWriter
     implements MemberSummaryWriter {
 
-    private boolean printedSummaryHeader = false;
-
     public NestedClassWriterImpl(SubWriterHolderWriter writer,
             ClassDoc classdoc) {
         super(writer, classdoc);
@@ -54,90 +54,17 @@
     }
 
     /**
-     * Write the classes summary header for the given class.
-     *
-     * @param classDoc the class the summary belongs to.
-     */
-    public void writeMemberSummaryHeader(ClassDoc classDoc) {
-        printedSummaryHeader = true;
-        writer.println("<!-- ======== NESTED CLASS SUMMARY ======== -->");
-        writer.println();
-        writer.printSummaryHeader(this, classDoc);
-    }
-
-    /**
-     * Write the classes summary footer for the given class.
-     *
-     * @param classDoc the class the summary belongs to.
-     */
-    public void writeMemberSummaryFooter(ClassDoc classDoc) {
-        writer.printSummaryFooter(this, classDoc);
-    }
-
-    /**
-     * Write the inherited classes summary header for the given class.
-     *
-     * @param classDoc the class the summary belongs to.
-     */
-    public void writeInheritedMemberSummaryHeader(ClassDoc classDoc) {
-        if(! printedSummaryHeader){
-            //We don't want inherited summary to not be under heading.
-            writeMemberSummaryHeader(classDoc);
-            writeMemberSummaryFooter(classDoc);
-            printedSummaryHeader = true;
-        }
-        writer.printInheritedSummaryHeader(this, classDoc);
-    }
-
-    /**
      * {@inheritDoc}
      */
-    public void writeInheritedMemberSummary(ClassDoc classDoc,
-            ProgramElementDoc nestedClass, boolean isFirst, boolean isLast) {
-        writer.printInheritedSummaryMember(this, classDoc, nestedClass, isFirst);
-    }
-
-    /**
-     * Write the inherited classes summary footer for the given class.
-     *
-     * @param classDoc the class the summary belongs to.
-     */
-    public void writeInheritedMemberSummaryFooter(ClassDoc classDoc) {
-        writer.printInheritedSummaryFooter(this, classDoc);
-        writer.println();
+    public Content getMemberSummaryHeader(ClassDoc classDoc,
+            Content memberSummaryTree) {
+        memberSummaryTree.addContent(HtmlConstants.START_OF_NESTED_CLASS_SUMMARY);
+        Content memberTree = writer.getMemberTreeHeader();
+        writer.addSummaryHeader(this, classDoc, memberTree);
+        return memberTree;
     }
 
     /**
-     * Write the header for the nested class documentation.
-     *
-     * @param classDoc the class that the classes belong to.
-     */
-    public void writeHeader(ClassDoc classDoc, String header) {
-        writer.anchor("nested class_detail");
-        writer.printTableHeadingBackground(header);
-    }
-
-    /**
-     * Write the nested class header for the given nested class.
-     *
-     * @param nestedClass the nested class being documented.
-     * @param isFirst the flag to indicate whether or not the nested class is the
-     *        first to be documented.
-     */
-    public void writeClassHeader(ClassDoc nestedClass, boolean isFirst) {
-        if (! isFirst) {
-            writer.printMemberHeader();
-            writer.println("");
-        }
-        writer.anchor(nestedClass.name());
-        writer.h3();
-        writer.print(nestedClass.name());
-        writer.h3End();
-    }
-
-
-
-    /**
      * Close the writer.
      */
     public void close() throws IOException {
@@ -148,17 +75,35 @@
         return VisibleMemberMap.INNERCLASSES;
     }
 
-    public void printSummaryLabel() {
-        writer.printText("doclet.Nested_Class_Summary");
+    /**
+     * {@inheritDoc}
+     */
+    public void addSummaryLabel(Content memberTree) {
+        Content label = HtmlTree.HEADING(HtmlConstants.SUMMARY_HEADING,
+                writer.getResource("doclet.Nested_Class_Summary"));
+        memberTree.addContent(label);
     }
 
-    public void printTableSummary() {
-        writer.tableIndexSummary(configuration().getText("doclet.Member_Table_Summary",
+    /**
+     * {@inheritDoc}
+     */
+    public String getTableSummary() {
+        return configuration().getText("doclet.Member_Table_Summary",
                 configuration().getText("doclet.Nested_Class_Summary"),
-                configuration().getText("doclet.nested_classes")));
+                configuration().getText("doclet.nested_classes"));
     }
 
-    public void printSummaryTableHeader(ProgramElementDoc member) {
+    /**
+     * {@inheritDoc}
+     */
+    public String getCaption() {
+        return configuration().getText("doclet.Nested_Classes");
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public String[] getSummaryTableHeader(ProgramElementDoc member) {
         String[] header;
         if (member.isInterface()) {
             header = new String[] {
@@ -176,92 +121,95 @@
                         configuration().getText("doclet.Description"))
             };
         }
-        writer.summaryTableHeader(header, "col");
+        return header;
     }
 
-    public void printSummaryAnchor(ClassDoc cd) {
-        writer.anchor("nested_class_summary");
-    }
-
-    public void printInheritedSummaryAnchor(ClassDoc cd) {
-        writer.anchor("nested_classes_inherited_from_class_" +
-                       cd.qualifiedName());
+    /**
+     * {@inheritDoc}
+     */
+    public void addSummaryAnchor(ClassDoc cd, Content memberTree) {
+        memberTree.addContent(writer.getMarkerAnchor("nested_class_summary"));
     }
 
-    public void printInheritedSummaryLabel(ClassDoc cd) {
-        String clslink = writer.getPreQualifiedClassLink(
-            LinkInfoImpl.CONTEXT_MEMBER, cd, false);
-        writer.strong();
-        writer.printText(cd.isInterface() ?
-            "doclet.Nested_Classes_Interface_Inherited_From_Interface" :
-            "doclet.Nested_Classes_Interfaces_Inherited_From_Class",
-            clslink);
-        writer.strongEnd();
+    /**
+     * {@inheritDoc}
+     */
+    public void addInheritedSummaryAnchor(ClassDoc cd, Content inheritedTree) {
+        inheritedTree.addContent(writer.getMarkerAnchor(
+                "nested_classes_inherited_from_class_" + cd.qualifiedName()));
     }
 
-    protected void writeSummaryLink(int context, ClassDoc cd, ProgramElementDoc member) {
-        writer.strong();
-        writer.printLink(new LinkInfoImpl(context, (ClassDoc)member, false));
-        writer.strongEnd();
+    /**
+     * {@inheritDoc}
+     */
+    public void addInheritedSummaryLabel(ClassDoc cd, Content inheritedTree) {
+        Content classLink = new RawHtml(writer.getPreQualifiedClassLink(
+                LinkInfoImpl.CONTEXT_MEMBER, cd, false));
+        Content label = new StringContent(cd.isInterface() ?
+            configuration().getText("doclet.Nested_Classes_Interface_Inherited_From_Interface") :
+            configuration().getText("doclet.Nested_Classes_Interfaces_Inherited_From_Class"));
+        Content labelHeading = HtmlTree.HEADING(HtmlConstants.INHERITED_SUMMARY_HEADING,
+                label);
+        labelHeading.addContent(writer.getSpace());
+        labelHeading.addContent(classLink);
+        inheritedTree.addContent(labelHeading);
     }
 
-    protected void writeInheritedSummaryLink(ClassDoc cd,
-            ProgramElementDoc member) {
-        writer.printLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_MEMBER,
-            (ClassDoc)member, false));
+    /**
+     * {@inheritDoc}
+     */
+    protected void addSummaryLink(int context, ClassDoc cd, ProgramElementDoc member,
+            Content tdSummary) {
+        Content strong = HtmlTree.STRONG(new RawHtml(
+                writer.getLink(new LinkInfoImpl(context, (ClassDoc)member, false))));
+        Content code = HtmlTree.CODE(strong);
+        tdSummary.addContent(code);
     }
 
-    protected void printSummaryType(ProgramElementDoc member) {
-        ClassDoc cd = (ClassDoc)member;
-        printModifierAndType(cd, null);
-    }
-
-    protected void printHeader(ClassDoc cd) {
-        // N.A.
+    /**
+     * {@inheritDoc}
+     */
+    protected void addInheritedSummaryLink(ClassDoc cd,
+            ProgramElementDoc member, Content linksTree) {
+        linksTree.addContent(new RawHtml(
+                writer.getLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_MEMBER,
+                (ClassDoc)member, false))));
     }
 
-    protected void printBodyHtmlEnd(ClassDoc cd) {
-        // N.A.
-    }
-
-    protected void printMember(ProgramElementDoc member) {
-        // N.A.
+    /**
+     * {@inheritDoc}
+     */
+    protected void addSummaryType(ProgramElementDoc member,
+            Content tdSummaryType) {
+        ClassDoc cd = (ClassDoc)member;
+        addModifierAndType(cd, null, tdSummaryType);
     }
 
-    protected void writeDeprecatedLink(ProgramElementDoc member) {
-        writer.printQualifiedClassLink(LinkInfoImpl.CONTEXT_MEMBER,
-            (ClassDoc)member);
+    /**
+     * {@inheritDoc}
+     */
+    protected Content getDeprecatedLink(ProgramElementDoc member) {
+        return writer.getQualifiedClassLink(LinkInfoImpl.CONTEXT_MEMBER,
+                (ClassDoc)member);
     }
 
-    protected void printNavSummaryLink(ClassDoc cd, boolean link) {
+    /**
+     * {@inheritDoc}
+     */
+    protected Content getNavSummaryLink(ClassDoc cd, boolean link) {
         if (link) {
-            writer.printHyperLink("", (cd == null) ? "nested_class_summary":
-                    "nested_classes_inherited_from_class_" +
+            return writer.getHyperLink("", (cd == null) ? "nested_class_summary":
+                "nested_classes_inherited_from_class_" +
                 cd.qualifiedName(),
-                ConfigurationImpl.getInstance().getText("doclet.navNested"));
+                writer.getResource("doclet.navNested"));
         } else {
-            writer.printText("doclet.navNested");
+            return writer.getResource("doclet.navNested");
         }
     }
 
-    protected void printNavDetailLink(boolean link) {
-    }
-
-    protected void printMemberLink(ProgramElementDoc member) {
-    }
-
-    protected void printMembersSummaryLink(ClassDoc cd, ClassDoc icd,
-                                           boolean link) {
-        if (link) {
-            writer.printHyperLink(cd.name() + ".html",
-                (cd == icd)?
-                    "nested_class_summary":
-                    "nested_classes_inherited_from_class_" +
-                    icd.qualifiedName(),
-                    ConfigurationImpl.getInstance().getText(
-                        "doclet.Nested_Class_Summary"));
-        } else {
-            writer.printText("doclet.Nested_Class_Summary");
-        }
+    /**
+     * {@inheritDoc}
+     */
+    protected void addNavDetailLink(boolean link, Content liNav) {
     }
 }
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageFrameWriter.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageFrameWriter.java	Mon Dec 20 21:10:57 2010 -0800
@@ -25,18 +25,20 @@
 
 package com.sun.tools.doclets.formats.html;
 
+import java.io.*;
+import java.util.*;
+import com.sun.javadoc.*;
 import com.sun.tools.doclets.internal.toolkit.util.*;
 import com.sun.tools.doclets.internal.toolkit.*;
+import com.sun.tools.doclets.formats.html.markup.*;
 
-import com.sun.javadoc.*;
-import java.io.*;
-import java.util.*;
 /**
  * Class to generate file for each package contents in the left-hand bottom
  * frame. This will list all the Class Kinds in the package. A click on any
  * class-kind will update the right-hand frame with the clicked class-kind page.
  *
  * @author Atul M Dambalkar
+ * @author Bhavesh Patel (Modified)
  */
 public class PackageFrameWriter extends HtmlDocletWriter {
 
@@ -85,132 +87,107 @@
      * @param packageDoc The package for which "pacakge-frame.html" is to be generated.
      */
     public static void generate(ConfigurationImpl configuration,
-                                PackageDoc packageDoc) {
+            PackageDoc packageDoc) {
         PackageFrameWriter packgen;
         try {
             packgen = new PackageFrameWriter(configuration, packageDoc);
             String pkgName = Util.getPackageName(packageDoc);
-            packgen.printHtmlHeader(pkgName, configuration.metakeywords.getMetaKeywords(packageDoc), false);
-            packgen.printPackageHeader(pkgName);
-            packgen.generateClassListing();
-            packgen.printBodyHtmlEnd();
+            Content body = packgen.getBody(false, packgen.getWindowTitle(pkgName));
+            Content pkgNameContent = new StringContent(pkgName);
+            Content heading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, HtmlStyle.bar,
+                    packgen.getTargetPackageLink(packageDoc, "classFrame", pkgNameContent));
+            body.addContent(heading);
+            HtmlTree div = new HtmlTree(HtmlTag.DIV);
+            div.addStyle(HtmlStyle.indexContainer);
+            packgen.addClassListing(div);
+            body.addContent(div);
+            packgen.printHtmlDocument(
+                    configuration.metakeywords.getMetaKeywords(packageDoc), false, body);
             packgen.close();
         } catch (IOException exc) {
             configuration.standardmessage.error(
-                        "doclet.exception_encountered",
-                        exc.toString(), OUTPUT_FILE_NAME);
+                    "doclet.exception_encountered",
+                    exc.toString(), OUTPUT_FILE_NAME);
             throw new DocletAbortException();
         }
     }
 
     /**
-     * Generate class listing for all the classes in this package. Divide class
+     * Add class listing for all the classes in this package. Divide class
      * listing as per the class kind and generate separate listing for
      * Classes, Interfaces, Exceptions and Errors.
+     *
+     * @param contentTree the content tree to which the listing will be added
      */
-    protected void generateClassListing() {
+    protected void addClassListing(Content contentTree) {
         Configuration config = configuration();
         if (packageDoc.isIncluded()) {
-            generateClassKindListing(packageDoc.interfaces(),
-                configuration.getText("doclet.Interfaces"));
-            generateClassKindListing(packageDoc.ordinaryClasses(),
-                configuration.getText("doclet.Classes"));
-            generateClassKindListing(packageDoc.enums(),
-                configuration.getText("doclet.Enums"));
-            generateClassKindListing(packageDoc.exceptions(),
-                configuration.getText("doclet.Exceptions"));
-            generateClassKindListing(packageDoc.errors(),
-                configuration.getText("doclet.Errors"));
-            generateClassKindListing(packageDoc.annotationTypes(),
-                configuration.getText("doclet.AnnotationTypes"));
+            addClassKindListing(packageDoc.interfaces(),
+                getResource("doclet.Interfaces"), contentTree);
+            addClassKindListing(packageDoc.ordinaryClasses(),
+                getResource("doclet.Classes"), contentTree);
+            addClassKindListing(packageDoc.enums(),
+                getResource("doclet.Enums"), contentTree);
+            addClassKindListing(packageDoc.exceptions(),
+                getResource("doclet.Exceptions"), contentTree);
+            addClassKindListing(packageDoc.errors(),
+                getResource("doclet.Errors"), contentTree);
+            addClassKindListing(packageDoc.annotationTypes(),
+                getResource("doclet.AnnotationTypes"), contentTree);
         } else {
             String name = Util.getPackageName(packageDoc);
-            generateClassKindListing(config.classDocCatalog.interfaces(name),
-                configuration.getText("doclet.Interfaces"));
-            generateClassKindListing(config.classDocCatalog.ordinaryClasses(name),
-                configuration.getText("doclet.Classes"));
-            generateClassKindListing(config.classDocCatalog.enums(name),
-                configuration.getText("doclet.Enums"));
-            generateClassKindListing(config.classDocCatalog.exceptions(name),
-                configuration.getText("doclet.Exceptions"));
-            generateClassKindListing(config.classDocCatalog.errors(name),
-                configuration.getText("doclet.Errors"));
-            generateClassKindListing(config.classDocCatalog.annotationTypes(name),
-                configuration.getText("doclet.AnnotationTypes"));
+            addClassKindListing(config.classDocCatalog.interfaces(name),
+                getResource("doclet.Interfaces"), contentTree);
+            addClassKindListing(config.classDocCatalog.ordinaryClasses(name),
+                getResource("doclet.Classes"), contentTree);
+            addClassKindListing(config.classDocCatalog.enums(name),
+                getResource("doclet.Enums"), contentTree);
+            addClassKindListing(config.classDocCatalog.exceptions(name),
+                getResource("doclet.Exceptions"), contentTree);
+            addClassKindListing(config.classDocCatalog.errors(name),
+                getResource("doclet.Errors"), contentTree);
+            addClassKindListing(config.classDocCatalog.annotationTypes(name),
+                getResource("doclet.AnnotationTypes"), contentTree);
         }
     }
 
     /**
-     * Generate specific class kind listing. Also add label to the listing.
+     * Add specific class kind listing. Also add label to the listing.
      *
-     * @param arr Array of specific class kinds, namely Class or Interface or
-     * Exception or Error.
-     * @param label Label for the listing
+     * @param arr Array of specific class kinds, namely Class or Interface or Exception or Error
+     * @param labelContent content tree of the label to be added
+     * @param contentTree the content tree to which the class kind listing will be added
      */
-    protected void generateClassKindListing(ClassDoc[] arr, String label) {
+    protected void addClassKindListing(ClassDoc[] arr, Content labelContent,
+            Content contentTree) {
         if(arr.length > 0) {
             Arrays.sort(arr);
-            printPackageTableHeader();
-            fontSizeStyle("+1", "FrameHeadingFont");
             boolean printedHeader = false;
+            HtmlTree ul = new HtmlTree(HtmlTag.UL);
+            ul.addAttr(HtmlAttr.TITLE, labelContent.toString());
             for (int i = 0; i < arr.length; i++) {
                 if (documentedClasses != null &&
-                    !documentedClasses.contains(arr[i])) {
+                        !documentedClasses.contains(arr[i])) {
                     continue;
                 }
                 if (!Util.isCoreClass(arr[i]) || !
-                    configuration.isGeneratedDoc(arr[i])) {
+                        configuration.isGeneratedDoc(arr[i])) {
                     continue;
                 }
                 if (!printedHeader) {
-                    print(label);
-                    fontEnd();
-                    println("&nbsp;");
-                    fontStyle("FrameItemFont");
+                    Content heading = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING,
+                            true, labelContent);
+                    contentTree.addContent(heading);
                     printedHeader = true;
                 }
-                br();
-                printLink(new LinkInfoImpl(
-                    LinkInfoImpl.PACKAGE_FRAME,
-                    arr[i],
-                    (arr[i].isInterface() ?
-                        italicsText(arr[i].name()) :
-                        arr[i].name()),"classFrame")
-                );
+                Content link = new RawHtml (getLink(new LinkInfoImpl(
+                        LinkInfoImpl.PACKAGE_FRAME, arr[i],
+                        (arr[i].isInterface() ? italicsText(arr[i].name()) :
+                            arr[i].name()),"classFrame")));
+                Content li = HtmlTree.LI(link);
+                ul.addContent(li);
             }
-            fontEnd();
-            printPackageTableFooter();
-            println();
+            contentTree.addContent(ul);
         }
     }
-
-    /**
-     * Print the package link at the top of the class kind listing. Clicking
-     * this link, package-summary page will appear in the right hand frame.
-     *
-     * @param heading Top Heading to be used for the class kind listing.
-     */
-    protected void printPackageHeader(String heading) {
-        fontSizeStyle("+1", "FrameTitleFont");
-        printTargetPackageLink(packageDoc, "classFrame", heading);
-        fontEnd();
-    }
-
-    /**
-     * The table for the class kind listing.
-     */
-    protected void printPackageTableHeader() {
-        table();
-        tr();
-        tdNowrap();
-    }
-
-    /**
-     * Closing Html tags for table of class kind listing.
-     */
-    protected void printPackageTableFooter() {
-        tdEnd();
-        trEnd();
-        tableEnd();
-    }
 }
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageIndexFrameWriter.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageIndexFrameWriter.java	Mon Dec 20 21:10:57 2010 -0800
@@ -25,10 +25,11 @@
 
 package com.sun.tools.doclets.formats.html;
 
+import java.io.*;
+import com.sun.javadoc.*;
+import com.sun.tools.doclets.internal.toolkit.*;
 import com.sun.tools.doclets.internal.toolkit.util.*;
-
-import com.sun.javadoc.*;
-import java.io.*;
+import com.sun.tools.doclets.formats.html.markup.*;
 
 /**
  * Generate the package index for the left-hand frame in the generated output.
@@ -58,7 +59,7 @@
         String filename = "overview-frame.html";
         try {
             packgen = new PackageIndexFrameWriter(configuration, filename);
-            packgen.generatePackageIndexFile("doclet.Window_Overview", false);
+            packgen.buildPackageIndexFile("doclet.Window_Overview", false);
             packgen.close();
         } catch (IOException exc) {
             configuration.standardmessage.error(
@@ -69,114 +70,86 @@
     }
 
     /**
-     * Print each package name on separate rows.
-     *
-     * @param pd PackageDoc
+     * {@inheritDoc}
      */
-    protected void printIndexRow(PackageDoc pd) {
-        fontStyle("FrameItemFont");
-        if (pd.name().length() > 0) {
-            print(getHyperLink(pathString(pd, "package-frame.html"), "",
-                pd.name(), false, "", "", "packageFrame"));
-        } else {
-            print(getHyperLink("package-frame.html", "", "&lt;unnamed package>",
-                false, "", "", "packageFrame"));
+    protected void addPackagesList(PackageDoc[] packages, String text,
+            String tableSummary, Content body) {
+        Content heading = HtmlTree.HEADING(HtmlConstants.PACKAGE_HEADING, true,
+                packagesLabel);
+        Content div = HtmlTree.DIV(HtmlStyle.indexContainer, heading);
+        HtmlTree ul = new HtmlTree(HtmlTag.UL);
+        ul.addAttr(HtmlAttr.TITLE, packagesLabel.toString());
+        for(int i = 0; i < packages.length; i++) {
+            if (packages[i] != null) {
+                ul.addContent(getPackage(packages[i]));
+            }
         }
-        fontEnd();
-        br();
+        div.addContent(ul);
+        body.addContent(div);
     }
 
     /**
-     * Print the "-packagesheader" string in strong format, at top of the page,
-     * if it is not the empty string.  Otherwise print the "-header" string.
-     * Despite the name, there is actually no navigation bar for this page.
+     * Gets each package name as a separate link.
+     *
+     * @param pd PackageDoc
+     * @return content for the package link
      */
-    protected void printNavigationBarHeader() {
-        printTableHeader(true);
-        fontSizeStyle("+1", "FrameTitleFont");
+    protected Content getPackage(PackageDoc pd) {
+        Content packageLinkContent;
+        Content packageLabel;
+        if (pd.name().length() > 0) {
+            packageLabel = getPackageLabel(pd.name());
+            packageLinkContent = getHyperLink(pathString(pd,
+                    "package-frame.html"), "", packageLabel, "",
+                    "packageFrame");
+        } else {
+            packageLabel = new RawHtml("&lt;unnamed package&gt;");
+            packageLinkContent = getHyperLink("package-frame.html",
+                    "", packageLabel, "", "packageFrame");
+        }
+        Content li = HtmlTree.LI(packageLinkContent);
+        return li;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    protected void addNavigationBarHeader(Content body) {
+        Content headerContent;
         if (configuration.packagesheader.length() > 0) {
-            strong(replaceDocRootDir(configuration.packagesheader));
+            headerContent = new RawHtml(replaceDocRootDir(configuration.packagesheader));
         } else {
-            strong(replaceDocRootDir(configuration.header));
+            headerContent = new RawHtml(replaceDocRootDir(configuration.header));
         }
-        fontEnd();
-        printTableFooter(true);
+        Content heading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, true,
+                HtmlStyle.bar, headerContent);
+        body.addContent(heading);
     }
 
     /**
      * Do nothing as there is no overview information in this page.
      */
-    protected void printOverviewHeader() {
-    }
-
-    /**
-     * Print Html "table" tag for the package index format.
-     *
-     * @param text Text string will not be used in this method.
-     */
-    protected void printIndexHeader(String text, String tableSummary) {
-        printTableHeader(false);
-    }
-
-    /**
-     * Print Html closing "table" tag at the end of the package index.
-     */
-    protected void printIndexFooter() {
-        printTableFooter(false);
-    }
-
-    /**
-     * Print "All Classes" link at the top of the left-hand frame page.
-     */
-    protected void printAllClassesPackagesLink() {
-        fontStyle("FrameItemFont");
-        print(getHyperLink("allclasses-frame.html", "",
-            configuration.getText("doclet.All_Classes"), false, "", "",
-            "packageFrame"));
-        fontEnd();
-        p();
-        fontSizeStyle("+1", "FrameHeadingFont");
-        printText("doclet.Packages");
-        fontEnd();
-        br();
+    protected void addOverviewHeader(Content body) {
     }
 
     /**
-     * Just print some space, since there is no navigation bar for this page.
+     * Adds "All Classes" link for the top of the left-hand frame page to the
+     * documentation tree.
+     *
+     * @param body the Content object to which the all classes link should be added
      */
-    protected void printNavigationBarFooter() {
-        p();
-        space();
+    protected void addAllClassesLink(Content body) {
+        Content linkContent = getHyperLink("allclasses-frame.html", "",
+                allclassesLabel, "", "packageFrame");
+        Content div = HtmlTree.DIV(HtmlStyle.indexHeader, linkContent);
+        body.addContent(div);
     }
 
     /**
-     * Print Html closing tags for the table for package index.
-     *
-     * @param isHeading true if this is a table for a heading.
+     * {@inheritDoc}
      */
-    private void printTableFooter(boolean isHeading) {
-        if (isHeading) {
-            thEnd();
-        } else {
-            tdEnd();
-        }
-        trEnd();
-        tableEnd();
-    }
-
-    /**
-     * Print Html tags for the table for package index.
-     *
-     * @param isHeading true if this is a table for a heading.
-     */
-    private void printTableHeader(boolean isHeading) {
-        table();
-        tr();
-        if (isHeading) {
-            thAlignNowrap("left");
-        } else {
-            tdNowrap();
-        }
-
+    protected void addNavigationBarFooter(Content body) {
+        Content p = HtmlTree.P(getSpace());
+        body.addContent(p);
     }
 }
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageIndexWriter.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageIndexWriter.java	Mon Dec 20 21:10:57 2010 -0800
@@ -25,10 +25,12 @@
 
 package com.sun.tools.doclets.formats.html;
 
-import com.sun.tools.doclets.internal.toolkit.util.*;
-import com.sun.javadoc.*;
 import java.io.*;
 import java.util.*;
+import com.sun.javadoc.*;
+import com.sun.tools.doclets.internal.toolkit.*;
+import com.sun.tools.doclets.internal.toolkit.util.*;
+import com.sun.tools.doclets.formats.html.markup.*;
 
 /**
  * Generate the package index page "overview-summary.html" for the right-hand
@@ -83,7 +85,7 @@
         String filename = "overview-summary.html";
         try {
             packgen = new PackageIndexWriter(configuration, filename);
-            packgen.generatePackageIndexFile("doclet.Window_Overview_Summary", true);
+            packgen.buildPackageIndexFile("doclet.Window_Overview_Summary", true);
             packgen.close();
         } catch (IOException exc) {
             configuration.standardmessage.error(
@@ -94,124 +96,140 @@
     }
 
     /**
-     * Print each package in separate rows in the index table. Generate link
-     * to each package.
+     * Depending upon the grouping information and their titles, add
+     * separate table indices for each package group.
      *
-     * @param pkg Package to which link is to be generated.
+     * @param body the documentation tree to which the index will be added
      */
-    protected void printIndexRow(PackageDoc pkg) {
-        if(pkg != null && pkg.name().length() > 0) {
-            trBgcolorStyle("white", "TableRowColor");
-            summaryRow(20);
-            strong();
-            printPackageLink(pkg, Util.getPackageName(pkg), false);
-            strongEnd();
-            summaryRowEnd();
-            summaryRow(0);
-            printSummaryComment(pkg);
-            summaryRowEnd();
-            trEnd();
-       }
-    }
-
-    /**
-     * Depending upon the grouping information and their titles, generate
-     * separate table indices for each package group.
-     */
-    protected void generateIndex() {
+    protected void addIndex(Content body) {
         for (int i = 0; i < groupList.size(); i++) {
         String groupname = groupList.get(i);
         List<PackageDoc> list = groupPackageMap.get(groupname);
             if (list != null && list.size() > 0) {
-                printIndexContents(list.toArray(new PackageDoc[list.size()]),
-                        groupname,
-                        configuration.getText("doclet.Member_Table_Summary",
-                        groupname,
-                        configuration.getText("doclet.packages")));
+                addIndexContents(list.toArray(new PackageDoc[list.size()]),
+                        groupname, configuration.getText("doclet.Member_Table_Summary",
+                        groupname, configuration.getText("doclet.packages")), body);
+            }
+        }
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    protected void addPackagesList(PackageDoc[] packages, String text,
+            String tableSummary, Content body) {
+        Content table = HtmlTree.TABLE(HtmlStyle.overviewSummary, 0, 3, 0, tableSummary,
+                getTableCaption(text));
+        table.addContent(getSummaryTableHeader(packageTableHeader, "col"));
+        Content tbody = new HtmlTree(HtmlTag.TBODY);
+        addPackagesList(packages, tbody);
+        table.addContent(tbody);
+        Content div = HtmlTree.DIV(HtmlStyle.contentContainer, table);
+        body.addContent(div);
+    }
+
+    /**
+     * Adds list of packages in the index table. Generate link to each package.
+     *
+     * @param packages Packages to which link is to be generated
+     * @param tbody the documentation tree to which the list will be added
+     */
+    protected void addPackagesList(PackageDoc[] packages, Content tbody) {
+        for (int i = 0; i < packages.length; i++) {
+            if (packages[i] != null && packages[i].name().length() > 0) {
+                Content packageLinkContent = getPackageLink(packages[i],
+                        getPackageName(packages[i]));
+                Content tdPackage = HtmlTree.TD(HtmlStyle.colFirst, packageLinkContent);
+                HtmlTree tdSummary = new HtmlTree(HtmlTag.TD);
+                tdSummary.addStyle(HtmlStyle.colLast);
+                addSummaryComment(packages[i], tdSummary);
+                HtmlTree tr = HtmlTree.TR(tdPackage);
+                tr.addContent(tdSummary);
+                if (i%2 == 0)
+                    tr.addStyle(HtmlStyle.altColor);
+                else
+                    tr.addStyle(HtmlStyle.rowColor);
+                tbody.addContent(tr);
             }
         }
     }
 
     /**
-     * Print the overview summary comment for this documentation. Print one line
+     * Adds the overview summary comment for this documentation. Add one line
      * summary at the top of the page and generate a link to the description,
-     * which is generated at the end of this page.
+     * which is added at the end of this page.
+     *
+     * @param body the documentation tree to which the overview header will be added
      */
-    protected void printOverviewHeader() {
+    protected void addOverviewHeader(Content body) {
         if (root.inlineTags().length > 0) {
-            printSummaryComment(root);
-            p();
-            strong(configuration.getText("doclet.See"));
-            br();
-            printNbsps();
-            printHyperLink("", "overview_description",
-                configuration.getText("doclet.Description"), true);
-            p();
+            HtmlTree p = new HtmlTree(HtmlTag.P);
+            p.addStyle(HtmlStyle.subTitle);
+            addSummaryComment(root, p);
+            Content div = HtmlTree.DIV(HtmlStyle.header, p);
+            Content see = seeLabel;
+            see.addContent(" ");
+            Content descPara = HtmlTree.P(see);
+            Content descLink = getHyperLink("", "overview_description",
+                descriptionLabel, "", "");
+            descPara.addContent(descLink);
+            div.addContent(descPara);
+            body.addContent(div);
         }
     }
 
     /**
-     * Print Html tags for the table for this package index.
-     */
-    protected void printIndexHeader(String text, String tableSummary) {
-        tableIndexSummary(tableSummary);
-        tableCaptionStart();
-        print(text);
-        tableCaptionEnd();
-        summaryTableHeader(packageTableHeader, "col");
-    }
-
-    /**
-     * Print Html closing tags for the table for this package index.
+     * Adds the overview comment as provided in the file specified by the
+     * "-overview" option on the command line.
+     *
+     * @param htmltree the documentation tree to which the overview comment will
+     *                 be added
      */
-    protected void printIndexFooter() {
-        tableEnd();
-        p();
-        space();
-    }
-
-    /**
-     * Print the overview comment as provided in the file specified by the
-     * "-overview" option on the command line.
-     */
-    protected void printOverviewComment() {
+    protected void addOverviewComment(Content htmltree) {
         if (root.inlineTags().length > 0) {
-            anchor("overview_description");
-            p();
-            printInlineComment(root);
-            p();
+            htmltree.addContent(getMarkerAnchor("overview_description"));
+            HtmlTree p = new HtmlTree(HtmlTag.P);
+            p.addStyle(HtmlStyle.subTitle);
+            addInlineComment(root, p);
+            htmltree.addContent(p);
         }
     }
 
     /**
-     * Call {@link #printOverviewComment()} and then genrate the tag information
-     * as provided in the file specified by the "-overview" option on the
-     * command line.
+     * Adds the tag information as provided in the file specified by the
+     * "-overview" option on the command line.
+     *
+     * @param body the documentation tree to which the overview will be added
      */
-    protected void printOverview() throws IOException {
-        printOverviewComment();
-        printTags(root);
+    protected void addOverview(Content body) throws IOException {
+        HtmlTree div = new HtmlTree(HtmlTag.DIV);
+        div.addStyle(HtmlStyle.footer);
+        addOverviewComment(div);
+        addTagsInfo(root, div);
+        body.addContent(div);
     }
 
     /**
-     * Print the top text (from the -top option), the upper
+     * Adds the top text (from the -top option), the upper
      * navigation bar, and then the title (from the"-title"
      * option), at the top of page.
+     *
+     * @body the documentation tree to which the navigation bar header will be added
      */
-    protected void printNavigationBarHeader() {
-        printTop();
-        navLinks(true);
-        hr();
-        printConfigurationTitle();
+    protected void addNavigationBarHeader(Content body) {
+        addTop(body);
+        addNavLinks(true, body);
+        addConfigurationTitle(body);
     }
 
     /**
-     * Print the lower navigation bar and the bottom text
+     * Adds the lower navigation bar and the bottom text
      * (from the -bottom option) at the bottom of page.
+     *
+     * @param the documentation tree to which the navigation bar footer will be added
      */
-    protected void printNavigationBarFooter() {
-        hr();
-        navLinks(false);
-        printBottom();
+    protected void addNavigationBarFooter(Content body) {
+        addNavLinks(false, body);
+        addBottom(body);
     }
 }
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageTreeWriter.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageTreeWriter.java	Mon Dec 20 21:10:57 2010 -0800
@@ -29,12 +29,15 @@
 
 import com.sun.javadoc.*;
 import com.sun.tools.doclets.internal.toolkit.util.*;
+import com.sun.tools.doclets.formats.html.markup.*;
+import com.sun.tools.doclets.internal.toolkit.*;
 
 /**
  * Class to generate Tree page for a package. The name of the file generated is
  * "package-tree.html" and it is generated in the respective package directory.
  *
  * @author Atul M Dambalkar
+ * @author Bhavesh Patel (Modified)
  */
 public class PackageTreeWriter extends AbstractTreeWriter {
 
@@ -107,94 +110,96 @@
      * Generate a separate tree file for each package.
      */
     protected void generatePackageTreeFile() throws IOException {
-        printHtmlHeader(packagedoc.name() + " "
-            + configuration.getText("doclet.Window_Class_Hierarchy"), null, true);
-
-        printPackageTreeHeader();
-
+        Content body = getPackageTreeHeader();
+        Content headContent = getResource("doclet.Hierarchy_For_Package",
+                Util.getPackageName(packagedoc));
+        Content heading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, false,
+                HtmlStyle.title, headContent);
+        Content div = HtmlTree.DIV(HtmlStyle.header, heading);
         if (configuration.packages.length > 1) {
-            printLinkToMainTree();
+            addLinkToMainTree(div);
         }
-
-        generateTree(classtree.baseclasses(), "doclet.Class_Hierarchy");
-        generateTree(classtree.baseinterfaces(), "doclet.Interface_Hierarchy");
-        generateTree(classtree.baseAnnotationTypes(), "doclet.Annotation_Type_Hierarchy");
-        generateTree(classtree.baseEnums(), "doclet.Enum_Hierarchy");
-
-        printPackageTreeFooter();
-        printBottom();
-        printBodyHtmlEnd();
-    }
-
-    /**
-     * Print the navigation bar header for the package tree file.
-     */
-    protected void printPackageTreeHeader() {
-        printTop();
-        navLinks(true);
-        hr();
-        center();
-        h2(configuration.getText("doclet.Hierarchy_For_Package",
-            Util.getPackageName(packagedoc)));
-        centerEnd();
+        body.addContent(div);
+        HtmlTree divTree = new HtmlTree(HtmlTag.DIV);
+        divTree.addStyle(HtmlStyle.contentContainer);
+        addTree(classtree.baseclasses(), "doclet.Class_Hierarchy", divTree);
+        addTree(classtree.baseinterfaces(), "doclet.Interface_Hierarchy", divTree);
+        addTree(classtree.baseAnnotationTypes(), "doclet.Annotation_Type_Hierarchy", divTree);
+        addTree(classtree.baseEnums(), "doclet.Enum_Hierarchy", divTree);
+        body.addContent(divTree);
+        addNavLinks(false, body);
+        addBottom(body);
+        printHtmlDocument(null, true, body);
     }
 
     /**
-     * Generate a link to the tree for all the packages.
+     * Get the package tree header.
+     *
+     * @return a content tree for the header
      */
-    protected void printLinkToMainTree() {
-        dl();
-        dt();
-        strongText("doclet.Package_Hierarchies");
-        dtEnd();
-        dd();
-        navLinkMainTree(configuration.getText("doclet.All_Packages"));
-        ddEnd();
-        dlEnd();
-        hr();
+    protected Content getPackageTreeHeader() {
+        String title = packagedoc.name() + " " +
+                configuration.getText("doclet.Window_Class_Hierarchy");
+        Content bodyTree = getBody(true, getWindowTitle(title));
+        addTop(bodyTree);
+        addNavLinks(true, bodyTree);
+        return bodyTree;
     }
 
     /**
-     * Print the navigation bar footer for the package tree file.
+     * Add a link to the tree for all the packages.
+     *
+     * @param div the content tree to which the link will be added
      */
-    protected void printPackageTreeFooter() {
-        hr();
-        navLinks(false);
+    protected void addLinkToMainTree(Content div) {
+        Content span = HtmlTree.SPAN(HtmlStyle.strong,
+                getResource("doclet.Package_Hierarchies"));
+        div.addContent(span);
+        HtmlTree ul = new HtmlTree (HtmlTag.UL);
+        ul.addStyle(HtmlStyle.horizontal);
+        ul.addContent(getNavLinkMainTree(configuration.getText("doclet.All_Packages")));
+        div.addContent(ul);
     }
 
     /**
-     * Link for the previous package tree file.
+     * Get link for the previous package tree file.
+     *
+     * @return a content tree for the link
      */
-    protected void navLinkPrevious() {
+    protected Content getNavLinkPrevious() {
         if (prev == null) {
-            navLinkPrevious(null);
+            return getNavLinkPrevious(null);
         } else {
             String path = DirectoryManager.getRelativePath(packagedoc.name(),
-                                                           prev.name());
-            navLinkPrevious(path + "package-tree.html");
+                    prev.name());
+            return getNavLinkPrevious(path + "package-tree.html");
         }
     }
 
     /**
-     * Link for the next package tree file.
+     * Get link for the next package tree file.
+     *
+     * @return a content tree for the link
      */
-    protected void navLinkNext() {
+    protected Content getNavLinkNext() {
         if (next == null) {
-            navLinkNext(null);
+            return getNavLinkNext(null);
         } else {
             String path = DirectoryManager.getRelativePath(packagedoc.name(),
-                                                           next.name());
-            navLinkNext(path + "package-tree.html");
+                    next.name());
+            return getNavLinkNext(path + "package-tree.html");
         }
     }
 
     /**
-     * Link to the package summary page for the package of this tree.
+     * Get link to the package summary page for the package of this tree.
+     *
+     * @return a content tree for the package link
      */
-    protected void navLinkPackage() {
-        navCellStart();
-        printHyperLink("package-summary.html", "", configuration.getText("doclet.Package"),
-                        true, "NavBarFont1");
-        navCellEnd();
+    protected Content getNavLinkPackage() {
+        Content linkContent = getHyperLink("package-summary.html", "",
+                packageLabel);
+        Content li = HtmlTree.LI(linkContent);
+        return li;
     }
 }
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageUseWriter.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageUseWriter.java	Mon Dec 20 21:10:57 2010 -0800
@@ -25,10 +25,12 @@
 
 package com.sun.tools.doclets.formats.html;
 
-import com.sun.tools.doclets.internal.toolkit.util.*;
-import com.sun.javadoc.*;
 import java.io.*;
 import java.util.*;
+import com.sun.javadoc.*;
+import com.sun.tools.doclets.internal.toolkit.util.*;
+import com.sun.tools.doclets.formats.html.markup.*;
+import com.sun.tools.doclets.internal.toolkit.*;
 
 /**
  * Generate package usage information.
@@ -106,49 +108,74 @@
 
 
     /**
-     * Print the class use list.
+     * Generate the package use list.
      */
     protected void generatePackageUseFile() throws IOException {
-        printPackageUseHeader();
-
+        Content body = getPackageUseHeader();
+        HtmlTree div = new HtmlTree(HtmlTag.DIV);
+        div.addStyle(HtmlStyle.contentContainer);
         if (usingPackageToUsedClasses.isEmpty()) {
-            printText("doclet.ClassUse_No.usage.of.0", pkgdoc.name());
-            p();
+            div.addContent(getResource(
+                    "doclet.ClassUse_No.usage.of.0", pkgdoc.name()));
         } else {
-            generatePackageUse();
+            addPackageUse(div);
         }
+        body.addContent(div);
+        addNavLinks(false, body);
+        addBottom(body);
+        printHtmlDocument(null, true, body);
+    }
 
-        printPackageUseFooter();
+    /**
+     * Add the package use information.
+     *
+     * @param contentTree the content tree to which the package use information will be added
+     */
+    protected void addPackageUse(Content contentTree) throws IOException {
+        HtmlTree ul = new HtmlTree(HtmlTag.UL);
+        ul.addStyle(HtmlStyle.blockList);
+        if (configuration.packages.length > 1) {
+            addPackageList(ul);
+        }
+        addClassList(ul);
+        contentTree.addContent(ul);
     }
 
     /**
-     * Print the class use list.
+     * Add the list of packages that use the given package.
+     *
+     * @param contentTree the content tree to which the package list will be added
      */
-    protected void generatePackageUse() throws IOException {
-        if (configuration.packages.length > 1) {
-            generatePackageList();
+    protected void addPackageList(Content contentTree) throws IOException {
+        Content table = HtmlTree.TABLE(0, 3, 0, useTableSummary,
+                getTableCaption(configuration().getText(
+                "doclet.ClassUse_Packages.that.use.0",
+                getPackageLinkString(pkgdoc, Util.getPackageName(pkgdoc), false))));
+        table.addContent(getSummaryTableHeader(packageTableHeader, "col"));
+        Content tbody = new HtmlTree(HtmlTag.TBODY);
+        Iterator<String> it = usingPackageToUsedClasses.keySet().iterator();
+        for (int i = 0; it.hasNext(); i++) {
+            PackageDoc pkg = configuration.root.packageNamed(it.next());
+            HtmlTree tr = new HtmlTree(HtmlTag.TR);
+            if (i % 2 == 0) {
+                tr.addStyle(HtmlStyle.altColor);
+            } else {
+                tr.addStyle(HtmlStyle.rowColor);
+            }
+            addPackageUse(pkg, tr);
+            tbody.addContent(tr);
         }
-        generateClassList();
+        table.addContent(tbody);
+        Content li = HtmlTree.LI(HtmlStyle.blockList, table);
+        contentTree.addContent(li);
     }
 
-    protected void generatePackageList() throws IOException {
-        tableIndexSummary(useTableSummary);
-        tableCaptionStart();
-        printText("doclet.ClassUse_Packages.that.use.0",
-            getPackageLink(pkgdoc, Util.getPackageName(pkgdoc), false));
-        tableCaptionEnd();
-        summaryTableHeader(packageTableHeader, "col");
-        Iterator<String> it = usingPackageToUsedClasses.keySet().iterator();
-        while (it.hasNext()) {
-            PackageDoc pkg = configuration.root.packageNamed(it.next());
-            generatePackageUse(pkg);
-        }
-        tableEnd();
-        space();
-        p();
-    }
-
-    protected void generateClassList() throws IOException {
+    /**
+     * Add the list of classes that use the given package.
+     *
+     * @param contentTree the content tree to which the class list will be added
+     */
+    protected void addClassList(Content contentTree) throws IOException {
         String[] classTableHeader = new String[] {
             configuration.getText("doclet.0_and_1",
                     configuration.getText("doclet.Class"),
@@ -158,117 +185,126 @@
         while (itp.hasNext()) {
             String packageName = itp.next();
             PackageDoc usingPackage = configuration.root.packageNamed(packageName);
+            HtmlTree li = new HtmlTree(HtmlTag.LI);
+            li.addStyle(HtmlStyle.blockList);
             if (usingPackage != null) {
-                anchor(usingPackage.name());
+                li.addContent(getMarkerAnchor(usingPackage.name()));
             }
-            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));
-            tableCaptionEnd();
-            summaryTableHeader(classTableHeader, "col");
+            String tableSummary = configuration.getText("doclet.Use_Table_Summary",
+                    configuration.getText("doclet.classes"));
+            Content table = HtmlTree.TABLE(0, 3, 0, tableSummary,
+                    getTableCaption(configuration().getText(
+                    "doclet.ClassUse_Classes.in.0.used.by.1",
+                    getPackageLinkString(pkgdoc, Util.getPackageName(pkgdoc), false),
+                    getPackageLinkString(usingPackage,Util.getPackageName(usingPackage), false))));
+            table.addContent(getSummaryTableHeader(classTableHeader, "col"));
+            Content tbody = new HtmlTree(HtmlTag.TBODY);
             Iterator<ClassDoc> itc =
                     usingPackageToUsedClasses.get(packageName).iterator();
-            while (itc.hasNext()) {
-                printClassRow(itc.next(), packageName);
+            for (int i = 0; itc.hasNext(); i++) {
+                HtmlTree tr = new HtmlTree(HtmlTag.TR);
+                if (i % 2 == 0) {
+                    tr.addStyle(HtmlStyle.altColor);
+                } else {
+                    tr.addStyle(HtmlStyle.rowColor);
+                }
+                addClassRow(itc.next(), packageName, tr);
+                tbody.addContent(tr);
             }
-            tableEnd();
-            space();
-            p();
+            table.addContent(tbody);
+            li.addContent(table);
+            contentTree.addContent(li);
         }
     }
 
-    protected void printClassRow(ClassDoc usedClass, String packageName) {
+    /**
+     * Add a row for the class that uses the given package.
+     *
+     * @param usedClass the class that uses the given package
+     * @param packageName the name of the package to which the class belongs
+     * @param contentTree the content tree to which the row will be added
+     */
+    protected void addClassRow(ClassDoc usedClass, String packageName,
+            Content contentTree) {
         String path = pathString(usedClass,
-                                 "class-use/" + usedClass.name() + ".html");
-
-        trBgcolorStyle("white", "TableRowColor");
-        summaryRow(0);
-        strong();
-        printHyperLink(path, packageName, usedClass.name(), true);
-        strongEnd();
-        println(); br();
-        printNbsps();
-        printIndexComment(usedClass);
-        summaryRowEnd();
-        trEnd();
-    }
-
-    /**
-     * Print the package use list.
-     */
-    protected void generatePackageUse(PackageDoc pkg) throws IOException {
-        trBgcolorStyle("white", "TableRowColor");
-        summaryRow(0);
-        //Just want an anchor here.
-        printHyperLink("", pkg.name(), Util.getPackageName(pkg), true);
-        summaryRowEnd();
-        summaryRow(0);
-        if (pkg != null) {
-            printSummaryComment(pkg);
-        }
-        space();
-        summaryRowEnd();
-        trEnd();
+                "class-use/" + usedClass.name() + ".html");
+        Content td = HtmlTree.TD(HtmlStyle.colOne,
+                getHyperLink(path, packageName, new StringContent(usedClass.name())));
+        addIndexComment(usedClass, td);
+        contentTree.addContent(td);
     }
 
     /**
-     * Print the header for the class use Listing.
+     * Add the package use information.
+     *
+     * @param pkg the package that used the given package
+     * @param contentTree the content tree to which the information will be added
      */
-    protected void printPackageUseHeader() {
-        String packageLabel = configuration.getText("doclet.Package");
-        String name = pkgdoc.name();
-        printHtmlHeader(configuration.getText("doclet.Window_ClassUse_Header",
-            packageLabel, name), null, true);
-        printTop();
-        navLinks(true);
-        hr();
-        center();
-        h2();
-        strongText("doclet.ClassUse_Title", packageLabel, name);
-        h2End();
-        centerEnd();
+    protected void addPackageUse(PackageDoc pkg, Content contentTree) throws IOException {
+        Content tdFirst = HtmlTree.TD(HtmlStyle.colFirst,
+                getHyperLink("", pkg.name(), new StringContent(Util.getPackageName(pkg))));
+        contentTree.addContent(tdFirst);
+        HtmlTree tdLast = new HtmlTree(HtmlTag.TD);
+        tdLast.addStyle(HtmlStyle.colLast);
+        if (pkg != null)
+            addSummaryComment(pkg, tdLast);
+        else
+            tdLast.addContent(getSpace());
+        contentTree.addContent(tdLast);
     }
 
     /**
-     * Print the footer for the class use Listing.
+     * Get the header for the package use listing.
+     *
+     * @return a content tree representing the package use header
      */
-    protected void printPackageUseFooter() {
-        hr();
-        navLinks(false);
-        printBottom();
-        printBodyHtmlEnd();
-    }
-
-
-    /**
-     * Print this package link
-     */
-    protected void navLinkPackage() {
-        navCellStart();
-        printHyperLink("package-summary.html", "", configuration.getText("doclet.Package"),
-                       true, "NavBarFont1");
-        navCellEnd();
+    protected Content getPackageUseHeader() {
+        String packageText = configuration.getText("doclet.Package");
+        String name = pkgdoc.name();
+        String title = configuration.getText("doclet.Window_ClassUse_Header",
+                packageText, name);
+        Content bodyTree = getBody(true, getWindowTitle(title));
+        addTop(bodyTree);
+        addNavLinks(true, bodyTree);
+        Content headContent = getResource("doclet.ClassUse_Title", packageText, name);
+        Content heading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, true,
+                HtmlStyle.title, headContent);
+        Content div = HtmlTree.DIV(HtmlStyle.header, heading);
+        bodyTree.addContent(div);
+        return bodyTree;
     }
 
     /**
-     * Print class use link
+     * Get this package link.
+     *
+     * @return a content tree for the package link
      */
-    protected void navLinkClassUse() {
-        navCellRevStart();
-        fontStyle("NavBarFont1Rev");
-        strongText("doclet.navClassUse");
-        fontEnd();
-        navCellEnd();
+    protected Content getNavLinkPackage() {
+        Content linkContent = getHyperLink("package-summary.html", "",
+                packageLabel);
+        Content li = HtmlTree.LI(linkContent);
+        return li;
     }
 
-    protected void navLinkTree() {
-        navCellStart();
-        printHyperLink("package-tree.html", "", configuration.getText("doclet.Tree"),
-                       true, "NavBarFont1");
-        navCellEnd();
+    /**
+     * Get the use link.
+     *
+     * @return a content tree for the use link
+     */
+    protected Content getNavLinkClassUse() {
+        Content li = HtmlTree.LI(HtmlStyle.navBarCell1Rev, useLabel);
+        return li;
     }
 
+    /**
+     * Get the tree link.
+     *
+     * @return a content tree for the tree link
+     */
+    protected Content getNavLinkTree() {
+        Content linkContent = getHyperLink("package-tree.html", "",
+                treeLabel);
+        Content li = HtmlTree.LI(linkContent);
+        return li;
+    }
 }
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageWriterImpl.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageWriterImpl.java	Mon Dec 20 21:10:57 2010 -0800
@@ -25,12 +25,12 @@
 
 package com.sun.tools.doclets.formats.html;
 
+import java.io.*;
+import java.util.*;
+import com.sun.javadoc.*;
 import com.sun.tools.doclets.internal.toolkit.*;
 import com.sun.tools.doclets.internal.toolkit.util.*;
-
-import com.sun.javadoc.*;
-import java.io.*;
-import java.util.*;
+import com.sun.tools.doclets.formats.html.markup.*;
 
 /**
  * Class to generate file for each package contents in the right-hand
@@ -98,189 +98,206 @@
     /**
      * {@inheritDoc}
      */
-    public void writeSummaryHeader() {}
-
-    /**
-     * {@inheritDoc}
-     */
-    public void writeSummaryFooter() {}
+    public Content getPackageHeader(String heading) {
+        String pkgName = packageDoc.name();
+        Content bodyTree = getBody(true, getWindowTitle(pkgName));
+        addTop(bodyTree);
+        addNavLinks(true, bodyTree);
+        HtmlTree div = new HtmlTree(HtmlTag.DIV);
+        div.addStyle(HtmlStyle.header);
+        Content annotationContent = new HtmlTree(HtmlTag.P);
+        addAnnotationInfo(packageDoc, annotationContent);
+        div.addContent(annotationContent);
+        Content tHeading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, true,
+                HtmlStyle.title, packageLabel);
+        tHeading.addContent(getSpace());
+        Content packageHead = new RawHtml(heading);
+        tHeading.addContent(packageHead);
+        div.addContent(tHeading);
+        if (packageDoc.inlineTags().length > 0 && ! configuration.nocomment) {
+            HtmlTree p = new HtmlTree(HtmlTag.P);
+            p.addStyle(HtmlStyle.subTitle);
+            addSummaryComment(packageDoc, p);
+            div.addContent(p);
+            Content space = getSpace();
+            Content descLink = getHyperLink("", "package_description",
+                    descriptionLabel, "", "");
+            Content descPara = new HtmlTree(HtmlTag.P, seeLabel, space, descLink);
+            div.addContent(descPara);
+        }
+        bodyTree.addContent(div);
+        return bodyTree;
+    }
 
     /**
      * {@inheritDoc}
      */
-    public void writeClassesSummary(ClassDoc[] classes, String label, String tableSummary, String[] tableHeader) {
-        if(classes.length > 0) {
-            Arrays.sort(classes);
-            tableIndexSummary(tableSummary);
-            boolean printedHeading = false;
-            for (int i = 0; i < classes.length; i++) {
-                if (!printedHeading) {
-                    printTableCaption(label);
-                    printFirstRow(tableHeader);
-                    printedHeading = true;
-                }
-                if (!Util.isCoreClass(classes[i]) ||
-                    !configuration.isGeneratedDoc(classes[i])) {
-                    continue;
-                }
-                trBgcolorStyle("white", "TableRowColor");
-                summaryRow(15);
-                strong();
-                printLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_PACKAGE,
-                    classes[i], false));
-                strongEnd();
-                summaryRowEnd();
-                summaryRow(0);
-                if (Util.isDeprecated(classes[i])) {
-                    strongText("doclet.Deprecated");
-                    if (classes[i].tags("deprecated").length > 0) {
-                        space();
-                        printSummaryDeprecatedComment(classes[i],
-                            classes[i].tags("deprecated")[0]);
-                    }
-                } else {
-                    printSummaryComment(classes[i]);
-                }
-                summaryRowEnd();
-                trEnd();
-            }
-            tableEnd();
-            println("&nbsp;");
-            p();
-        }
-    }
-
-    /**
-     * 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 tableHeader table header string for the Class listing.
-     */
-    protected void printFirstRow(String[] tableHeader) {
-        summaryTableHeader(tableHeader, "col");
+    public Content getContentHeader() {
+        HtmlTree div = new HtmlTree(HtmlTag.DIV);
+        div.addStyle(HtmlStyle.contentContainer);
+        return div;
     }
 
     /**
      * {@inheritDoc}
      */
-    public void writePackageDescription() {
-        if (packageDoc.inlineTags().length > 0) {
-            anchor("package_description");
-            h2(configuration.getText("doclet.Package_Description", packageDoc.name()));
-            p();
-            printInlineComment(packageDoc);
-            p();
+    public Content getSummaryHeader() {
+        HtmlTree ul = new HtmlTree(HtmlTag.UL);
+        ul.addStyle(HtmlStyle.blockList);
+        return ul;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public void addClassesSummary(ClassDoc[] classes, String label,
+            String tableSummary, String[] tableHeader, Content summaryContentTree) {
+        if(classes.length > 0) {
+            Arrays.sort(classes);
+            Content caption = getTableCaption(label);
+            Content table = HtmlTree.TABLE(HtmlStyle.packageSummary, 0, 3, 0,
+                    tableSummary, caption);
+            table.addContent(getSummaryTableHeader(tableHeader, "col"));
+            Content tbody = new HtmlTree(HtmlTag.TBODY);
+            for (int i = 0; i < classes.length; i++) {
+                if (!Util.isCoreClass(classes[i]) ||
+                    !configuration.isGeneratedDoc(classes[i])) {
+                    continue;
+                }
+                Content classContent = new RawHtml(getLink(new LinkInfoImpl(
+                        LinkInfoImpl.CONTEXT_PACKAGE, classes[i], false)));
+                Content tdClass = HtmlTree.TD(HtmlStyle.colFirst, classContent);
+                HtmlTree tr = HtmlTree.TR(tdClass);
+                if (i%2 == 0)
+                    tr.addStyle(HtmlStyle.altColor);
+                else
+                    tr.addStyle(HtmlStyle.rowColor);
+                HtmlTree tdClassDescription = new HtmlTree(HtmlTag.TD);
+                tdClassDescription.addStyle(HtmlStyle.colLast);
+                if (Util.isDeprecated(classes[i])) {
+                    tdClassDescription.addContent(deprecatedLabel);
+                    if (classes[i].tags("deprecated").length > 0) {
+                        addSummaryDeprecatedComment(classes[i],
+                            classes[i].tags("deprecated")[0], tdClassDescription);
+                    }
+                }
+                else
+                    addSummaryComment(classes[i], tdClassDescription);
+                tr.addContent(tdClassDescription);
+                tbody.addContent(tr);
+            }
+            table.addContent(tbody);
+            Content li = HtmlTree.LI(HtmlStyle.blockList, table);
+            summaryContentTree.addContent(li);
         }
     }
 
     /**
      * {@inheritDoc}
      */
-    public void writePackageTags() {
-        printTags(packageDoc);
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public void writePackageHeader(String heading) {
-        String pkgName = packageDoc.name();
-        printHtmlHeader(pkgName,
-            configuration.metakeywords.getMetaKeywords(packageDoc), true);
-        printTop();
-        navLinks(true);
-        hr();
-        writeAnnotationInfo(packageDoc);
-        h2(configuration.getText("doclet.Package") + " " + heading);
-        if (packageDoc.inlineTags().length > 0 && ! configuration.nocomment) {
-            printSummaryComment(packageDoc);
-            p();
-            strong(configuration.getText("doclet.See"));
-            br();
-            printNbsps();
-            printHyperLink("", "package_description",
-                configuration.getText("doclet.Description"), true);
-            p();
+    public void addPackageDescription(Content packageContentTree) {
+        if (packageDoc.inlineTags().length > 0) {
+            packageContentTree.addContent(getMarkerAnchor("package_description"));
+            Content h2Content = new StringContent(
+                    configuration.getText("doclet.Package_Description",
+                    packageDoc.name()));
+            packageContentTree.addContent(HtmlTree.HEADING(HtmlConstants.PACKAGE_HEADING,
+                    true, h2Content));
+            addInlineComment(packageDoc, packageContentTree);
         }
     }
 
     /**
      * {@inheritDoc}
      */
-    public void writePackageFooter() {
-        hr();
-        navLinks(false);
-        printBottom();
-        printBodyHtmlEnd();
+    public void addPackageTags(Content packageContentTree) {
+        addTagsInfo(packageDoc, packageContentTree);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public void addPackageFooter(Content contentTree) {
+        addNavLinks(false, contentTree);
+        addBottom(contentTree);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public void printDocument(Content contentTree) {
+        printHtmlDocument(configuration.metakeywords.getMetaKeywords(packageDoc),
+                true, contentTree);
     }
 
     /**
-     * Print "Use" link for this pacakge in the navigation bar.
+     * Get "Use" link for this pacakge in the navigation bar.
+     *
+     * @return a content tree for the class use link
      */
-    protected void navLinkClassUse() {
-        navCellStart();
-        printHyperLink("package-use.html", "", configuration.getText("doclet.navClassUse"),
-                       true, "NavBarFont1");
-        navCellEnd();
+    protected Content getNavLinkClassUse() {
+        Content useLink = getHyperLink("package-use.html", "",
+                useLabel, "", "");
+        Content li = HtmlTree.LI(useLink);
+        return li;
     }
 
     /**
-     * Print "PREV PACKAGE" link in the navigation bar.
+     * Get "PREV PACKAGE" link in the navigation bar.
+     *
+     * @return a content tree for the previous link
      */
-    protected void navLinkPrevious() {
+    public Content getNavLinkPrevious() {
+        Content li;
         if (prev == null) {
-            printText("doclet.Prev_Package");
+            li = HtmlTree.LI(prevpackageLabel);
         } else {
             String path = DirectoryManager.getRelativePath(packageDoc.name(),
                                                            prev.name());
-            printHyperLink(path + "package-summary.html", "",
-                configuration.getText("doclet.Prev_Package"), true);
+            li = HtmlTree.LI(getHyperLink(path + "package-summary.html", "",
+                prevpackageLabel, "", ""));
         }
+        return li;
     }
 
     /**
-     * Print "NEXT PACKAGE" link in the navigation bar.
+     * Get "NEXT PACKAGE" link in the navigation bar.
+     *
+     * @return a content tree for the next link
      */
-    protected void navLinkNext() {
+    public Content getNavLinkNext() {
+        Content li;
         if (next == null) {
-            printText("doclet.Next_Package");
+            li = HtmlTree.LI(nextpackageLabel);
         } else {
             String path = DirectoryManager.getRelativePath(packageDoc.name(),
                                                            next.name());
-            printHyperLink(path + "package-summary.html", "",
-                configuration.getText("doclet.Next_Package"), true);
+            li = HtmlTree.LI(getHyperLink(path + "package-summary.html", "",
+                nextpackageLabel, "", ""));
         }
+        return li;
     }
 
     /**
-     * Print "Tree" link in the navigation bar. This will be link to the package
+     * Get "Tree" link in the navigation bar. This will be link to the package
      * tree file.
+     *
+     * @return a content tree for the tree link
      */
-    protected void navLinkTree() {
-        navCellStart();
-        printHyperLink("package-tree.html", "", configuration.getText("doclet.Tree"),
-                       true, "NavBarFont1");
-        navCellEnd();
+    protected Content getNavLinkTree() {
+        Content useLink = getHyperLink("package-tree.html", "",
+                treeLabel, "", "");
+        Content li = HtmlTree.LI(useLink);
+        return li;
     }
 
     /**
      * Highlight "Package" in the navigation bar, as this is the package page.
+     *
+     * @return a content tree for the package link
      */
-    protected void navLinkPackage() {
-        navCellRevStart();
-        fontStyle("NavBarFont1Rev");
-        strongText("doclet.Package");
-        fontEnd();
-        navCellEnd();
+    protected Content getNavLinkPackage() {
+        Content li = HtmlTree.LI(HtmlStyle.navBarCell1Rev, packageLabel);
+        return li;
     }
 }
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/SerializedFormWriterImpl.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/SerializedFormWriterImpl.java	Mon Dec 20 21:10:57 2010 -0800
@@ -25,8 +25,10 @@
 
 package com.sun.tools.doclets.formats.html;
 
+import java.io.*;
 import com.sun.javadoc.*;
-import java.io.*;
+import com.sun.tools.doclets.formats.html.markup.*;
+import com.sun.tools.doclets.internal.toolkit.*;
 
 /**
  * Generate the Serialized Form Information Page.
@@ -64,76 +66,167 @@
     }
 
     /**
-     * Write the given package header.
+     * Get the given header.
      *
-     * @param packageName the package header to write.
+     * @param header the header to write
+     * @return the body content tree
      */
-    public void writePackageHeader(String packageName) {
-        hr(4, "noshade");
-        tableHeader();
-        thAlign("center");
-        font("+2");
-        strongText("doclet.Package");
-        print(' ');
-        strong(packageName);
-        tableFooter();
+    public Content getHeader(String header) {
+        Content bodyTree = getBody(true, getWindowTitle(header));
+        addTop(bodyTree);
+        addNavLinks(true, bodyTree);
+        Content h1Content = new StringContent(header);
+        Content heading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, true,
+                HtmlStyle.title, h1Content);
+        Content div = HtmlTree.DIV(HtmlStyle.header, heading);
+        bodyTree.addContent(div);
+        return bodyTree;
     }
 
     /**
-     * Write the serial UID info.
+     * Get the serialized form summaries header.
      *
-     * @param header the header that will show up before the UID.
-     * @param serialUID the serial UID to print.
+     * @return the serialized form summary header tree
      */
-    public void writeSerialUIDInfo(String header, String serialUID) {
-        strong(header + "&nbsp;");
-        println(serialUID);
-        p();
+    public Content getSerializedSummariesHeader() {
+        HtmlTree ul = new HtmlTree(HtmlTag.UL);
+        ul.addStyle(HtmlStyle.blockList);
+        return ul;
+    }
+
+    /**
+     * Get the package serialized form header.
+     *
+     * @return the package serialized form header tree
+     */
+    public Content getPackageSerializedHeader() {
+        HtmlTree li = new HtmlTree(HtmlTag.LI);
+        li.addStyle(HtmlStyle.blockList);
+        return li;
     }
 
     /**
-     * Write the footer.
+     * Get the given package header.
+     *
+     * @param packageName the package header to write
+     * @return a content tree for the package header
      */
-    public void writeFooter() {
-        p();
-        hr();
-        navLinks(false);
-        printBottom();
-        printBodyHtmlEnd();
+    public Content getPackageHeader(String packageName) {
+        Content heading = HtmlTree.HEADING(HtmlConstants.PACKAGE_HEADING, true,
+                packageLabel);
+        heading.addContent(getSpace());
+        heading.addContent(packageName);
+        return heading;
     }
 
-
     /**
-     * Write the serializable class heading.
+     * Get the serialized class header.
      *
-     * @param classDoc the class being processed.
+     * @return a content tree for the serialized class header
      */
-    public void writeClassHeader(ClassDoc classDoc) {
+    public Content getClassSerializedHeader() {
+        HtmlTree ul = new HtmlTree(HtmlTag.UL);
+        ul.addStyle(HtmlStyle.blockList);
+        return ul;
+    }
+
+    /**
+     * Get the serializable class heading.
+     *
+     * @param classDoc the class being processed
+     * @return a content tree for the class header
+     */
+    public Content getClassHeader(ClassDoc classDoc) {
         String classLink = (classDoc.isPublic() || classDoc.isProtected())?
             getLink(new LinkInfoImpl(classDoc,
-                configuration.getClassName(classDoc))):
+            configuration.getClassName(classDoc))):
             classDoc.qualifiedName();
-        p();
-        anchor(classDoc.qualifiedName());
+        Content li = HtmlTree.LI(HtmlStyle.blockList, getMarkerAnchor(
+                classDoc.qualifiedName()));
         String superClassLink =
             classDoc.superclassType() != null ?
                 getLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_SERIALIZED_FORM,
-                    classDoc.superclassType())) :
+                classDoc.superclassType())) :
                 null;
 
         //Print the heading.
         String className = superClassLink == null ?
             configuration.getText(
-                "doclet.Class_0_implements_serializable", classLink) :
+            "doclet.Class_0_implements_serializable", classLink) :
             configuration.getText(
-                "doclet.Class_0_extends_implements_serializable", classLink,
-                    superClassLink);
-        tableHeader();
-        thAlignColspan("left", 2);
-        font("+2");
-        strong(className);
-        tableFooter();
-        p();
+            "doclet.Class_0_extends_implements_serializable", classLink,
+            superClassLink);
+        Content classNameContent = new RawHtml(className);
+        li.addContent(HtmlTree.HEADING(HtmlConstants.SERIALIZED_MEMBER_HEADING,
+                classNameContent));
+        return li;
+    }
+
+    /**
+     * Get the serial UID info header.
+     *
+     * @return a content tree for the serial uid info header
+     */
+    public Content getSerialUIDInfoHeader() {
+        HtmlTree dl = new HtmlTree(HtmlTag.DL);
+        dl.addStyle(HtmlStyle.nameValue);
+        return dl;
+    }
+
+    /**
+     * Adds the serial UID info.
+     *
+     * @param header the header that will show up before the UID.
+     * @param serialUID the serial UID to print.
+     * @param serialUidTree the serial UID content tree to which the serial UID
+     *                      content will be added
+     */
+    public void addSerialUIDInfo(String header, String serialUID,
+            Content serialUidTree) {
+        Content headerContent = new StringContent(header);
+        serialUidTree.addContent(HtmlTree.DT(headerContent));
+        Content serialContent = new StringContent(serialUID);
+        serialUidTree.addContent(HtmlTree.DD(serialContent));
+    }
+
+    /**
+     * Get the class serialize content header.
+     *
+     * @return a content tree for the class serialize content header
+     */
+    public Content getClassContentHeader() {
+        HtmlTree ul = new HtmlTree(HtmlTag.UL);
+        ul.addStyle(HtmlStyle.blockList);
+        return ul;
+    }
+
+    /**
+     * Get the serialized content tree section.
+     *
+     * @param serializedTreeContent the serialized content tree to be added
+     * @return a div content tree
+     */
+    public Content getSerializedContent(Content serializedTreeContent) {
+        Content divContent = HtmlTree.DIV(HtmlStyle.serializedFormContainer,
+                serializedTreeContent);
+        return divContent;
+    }
+
+    /**
+     * Add the footer.
+     *
+     * @param serializedTree the serialized tree to be added
+     */
+    public void addFooter(Content serializedTree) {
+        addNavLinks(false, serializedTree);
+        addBottom(serializedTree);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public void printDocument(Content serializedTree) {
+        printHtmlDocument(null, true, serializedTree);
     }
 
     private void tableHeader() {
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/SingleIndexWriter.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/SingleIndexWriter.java	Mon Dec 20 21:10:57 2010 -0800
@@ -25,9 +25,10 @@
 
 package com.sun.tools.doclets.formats.html;
 
+import java.io.*;
 import com.sun.tools.doclets.internal.toolkit.util.*;
-
-import java.io.*;
+import com.sun.tools.doclets.formats.html.markup.*;
+import com.sun.tools.doclets.internal.toolkit.*;
 
 /**
  * Generate only one index file for all the Member Names with Indexing in
@@ -36,6 +37,7 @@
  *
  * @see java.lang.Character
  * @author Atul M Dambalkar
+ * @author Bhavesh Patel (Modified)
  */
 public class SingleIndexWriter extends AbstractIndexWriter {
 
@@ -82,34 +84,35 @@
      * Member Field, Method and Constructor Description.
      */
     protected void generateIndexFile() throws IOException {
-        printHtmlHeader(configuration.getText("doclet.Window_Single_Index"),
-            null, true);
-        printTop();
-        navLinks(true);
-        printLinksForIndexes();
-
-        hr();
-
+        String title = configuration.getText("doclet.Window_Single_Index");
+        Content body = getBody(true, getWindowTitle(title));
+        addTop(body);
+        addNavLinks(true, body);
+        HtmlTree divTree = new HtmlTree(HtmlTag.DIV);
+        divTree.addStyle(HtmlStyle.contentContainer);
+        addLinksForIndexes(divTree);
         for (int i = 0; i < indexbuilder.elements().length; i++) {
             Character unicode = (Character)((indexbuilder.elements())[i]);
-            generateContents(unicode, indexbuilder.getMemberList(unicode));
+            addContents(unicode, indexbuilder.getMemberList(unicode), divTree);
         }
-
-        printLinksForIndexes();
-        navLinks(false);
-
-        printBottom();
-        printBodyHtmlEnd();
+        addLinksForIndexes(divTree);
+        body.addContent(divTree);
+        addNavLinks(false, body);
+        addBottom(body);
+        printHtmlDocument(null, true, body);
     }
 
     /**
-     * Print Links for all the Index Files per unicode character.
+     * Add links for all the Index Files per unicode character.
+     *
+     * @param contentTree the content tree to which the links for indexes will be added
      */
-    protected void printLinksForIndexes() {
+    protected void addLinksForIndexes(Content contentTree) {
         for (int i = 0; i < indexbuilder.elements().length; i++) {
             String unicode = (indexbuilder.elements())[i].toString();
-            printHyperLink("#_" + unicode + "_", unicode);
-            print(' ');
+            contentTree.addContent(
+                    getHyperLink("#_" + unicode + "_", new StringContent(unicode)));
+            contentTree.addContent(getSpace());
         }
     }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/SourceToHTMLConverter.java	Mon Dec 20 21:10:57 2010 -0800
@@ -0,0 +1,298 @@
+/*
+ * Copyright (c) 2001, 2009, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.tools.doclets.formats.html;
+
+import java.io.*;
+import javax.tools.FileObject;
+import com.sun.javadoc.*;
+import com.sun.tools.doclets.internal.toolkit.*;
+import com.sun.tools.doclets.internal.toolkit.util.*;
+import com.sun.tools.doclets.formats.html.markup.*;
+
+/**
+ * Converts Java Source Code to HTML.
+ *
+ * This code is not part of an API.
+ * It is implementation that is subject to change.
+ * Do not use it as an API
+ *
+ * @author Jamie Ho
+ * @author Bhavesh Patel (Modified)
+ * @since 1.4
+ */
+public class SourceToHTMLConverter {
+
+    /**
+     * The number of trailing blank lines at the end of the page.
+     * This is inserted so that anchors at the bottom of small pages
+     * can be reached.
+     */
+    private static final int NUM_BLANK_LINES = 60;
+
+    /**
+     * New line to be added to the documentation.
+     */
+    private static final Content NEW_LINE = new RawHtml(DocletConstants.NL);
+
+    /**
+     * Relative path from the documentation root to the file that is being
+     * generated.
+     */
+    private static String relativePath = "";
+
+    /**
+     * Source is converted to HTML using static methods below.
+     */
+    private SourceToHTMLConverter() {}
+
+    /**
+     * Convert the Classes in the given RootDoc to an HTML.
+     *
+     * @param configuration the configuration.
+     * @param rd the RootDoc to convert.
+     * @param outputdir the name of the directory to output to.
+     */
+    public static void convertRoot(ConfigurationImpl configuration, RootDoc rd,
+            String outputdir) {
+        if (rd == null || outputdir == null) {
+            return;
+        }
+        PackageDoc[] pds = rd.specifiedPackages();
+        for (int i = 0; i < pds.length; i++) {
+            convertPackage(configuration, pds[i], outputdir);
+        }
+        ClassDoc[] cds = rd.specifiedClasses();
+        for (int i = 0; i < cds.length; i++) {
+            convertClass(configuration, cds[i],
+                    getPackageOutputDir(outputdir, cds[i].containingPackage()));
+        }
+    }
+
+    /**
+     * Convert the Classes in the given Package to an HTML.
+     *
+     * @param configuration the configuration.
+     * @param pd the Package to convert.
+     * @param outputdir the name of the directory to output to.
+     */
+    public static void convertPackage(ConfigurationImpl configuration, PackageDoc pd,
+            String outputdir) {
+        if (pd == null || outputdir == null) {
+            return;
+        }
+        String classOutputdir = getPackageOutputDir(outputdir, pd);
+        ClassDoc[] cds = pd.allClasses();
+        for (int i = 0; i < cds.length; i++) {
+            convertClass(configuration, cds[i], classOutputdir);
+        }
+    }
+
+    /**
+     * Return the directory write output to for the given package.
+     *
+     * @param outputDir the directory to output to.
+     * @param pd the Package to generate output for.
+     * @return the package output directory as a String.
+     */
+    private static String getPackageOutputDir(String outputDir, PackageDoc pd) {
+        return outputDir + File.separator +
+            DirectoryManager.getDirectoryPath(pd) + File.separator;
+    }
+
+    /**
+     * Convert the given Class to an HTML.
+     *
+     * @param configuration the configuration.
+     * @param cd the class to convert.
+     * @param outputdir the name of the directory to output to.
+     */
+    public static void convertClass(ConfigurationImpl configuration, ClassDoc cd,
+            String outputdir) {
+        if (cd == null || outputdir == null) {
+            return;
+        }
+        try {
+            SourcePosition sp = cd.position();
+            if (sp == null)
+                return;
+            Reader r;
+            // temp hack until we can update SourcePosition API.
+            if (sp instanceof com.sun.tools.javadoc.SourcePositionImpl) {
+                FileObject fo = ((com.sun.tools.javadoc.SourcePositionImpl) sp).fileObject();
+                if (fo == null)
+                    return;
+                r = fo.openReader(true);
+            } else {
+                File file = sp.file();
+                if (file == null)
+                    return;
+                r = new FileReader(file);
+            }
+            LineNumberReader reader = new LineNumberReader(r);
+            int lineno = 1;
+            String line;
+            relativePath = DirectoryManager.getRelativePath(DocletConstants.SOURCE_OUTPUT_DIR_NAME) +
+                    DirectoryManager.getRelativePath(cd.containingPackage());
+            Content body = getHeader();
+            Content pre = new HtmlTree(HtmlTag.PRE);
+            try {
+                while ((line = reader.readLine()) != null) {
+                    addLineNo(pre, lineno);
+                    addLine(pre, line, configuration.sourcetab, lineno);
+                    lineno++;
+                }
+            } finally {
+                reader.close();
+            }
+            addBlankLines(pre);
+            Content div = HtmlTree.DIV(HtmlStyle.sourceContainer, pre);
+            body.addContent(div);
+            writeToFile(body, outputdir, cd.name(), configuration);
+        } catch (Exception e){
+            e.printStackTrace();
+        }
+    }
+
+    /**
+     * Write the output to the file.
+     *
+     * @param body the documentation content to be written to the file.
+     * @param outputDir the directory to output to.
+     * @param className the name of the class that I am converting to HTML.
+     * @param configuration the Doclet configuration to pass notices to.
+     */
+    private static void writeToFile(Content body, String outputDir,
+            String className, ConfigurationImpl configuration) throws IOException {
+        Content htmlDocType = DocType.Transitional();
+        Content head = new HtmlTree(HtmlTag.HEAD);
+        head.addContent(HtmlTree.TITLE(new StringContent(
+                configuration.getText("doclet.Window_Source_title"))));
+        head.addContent(getStyleSheetProperties(configuration));
+        Content htmlTree = HtmlTree.HTML(configuration.getLocale().getLanguage(),
+                head, body);
+        Content htmlDocument = new HtmlDocument(htmlDocType, htmlTree);
+        File dir = new File(outputDir);
+        dir.mkdirs();
+        File newFile = new File(dir, className + ".html");
+        configuration.message.notice("doclet.Generating_0", newFile.getPath());
+        FileOutputStream fout = new FileOutputStream(newFile);
+        BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(fout));
+        bw.write(htmlDocument.toString());
+        bw.close();
+        fout.close();
+    }
+
+    /**
+     * Returns a link to the stylesheet file.
+     *
+     * @param configuration the doclet configuration for the current run of javadoc
+     * @return an HtmlTree for the lINK tag which provides the stylesheet location
+     */
+    public static HtmlTree getStyleSheetProperties(ConfigurationImpl configuration) {
+        String filename = configuration.stylesheetfile;
+        if (filename.length() > 0) {
+            File stylefile = new File(filename);
+            String parent = stylefile.getParent();
+            filename = (parent == null)?
+                filename:
+                filename.substring(parent.length() + 1);
+        } else {
+            filename = "stylesheet.css";
+        }
+        filename = relativePath + filename;
+        HtmlTree link = HtmlTree.LINK("stylesheet", "text/css", filename, "Style");
+        return link;
+    }
+
+    /**
+     * Get the header.
+     *
+     * @return the header content for the HTML file
+     */
+    private static Content getHeader() {
+        return new HtmlTree(HtmlTag.BODY);
+    }
+
+    /**
+     * Add the line numbers for the source code.
+     *
+     * @param pre the content tree to which the line number will be added
+     * @param lineno The line number
+     */
+    private static void addLineNo(Content pre, int lineno) {
+        HtmlTree span = new HtmlTree(HtmlTag.SPAN);
+        span.addStyle(HtmlStyle.sourceLineNo);
+        if (lineno < 10) {
+            span.addContent("00" + Integer.toString(lineno));
+        } else if (lineno < 100) {
+            span.addContent("0" + Integer.toString(lineno));
+        } else {
+            span.addContent(Integer.toString(lineno));
+        }
+        pre.addContent(span);
+    }
+
+    /**
+     * Add a line from source to the HTML file that is generated.
+     *
+     * @param pre the content tree to which the line will be added.
+     * @param line the string to format.
+     * @param tabLength the number of spaces for each tab.
+     * @param currentLineNo the current number.
+     */
+    private static void addLine(Content pre, String line, int tabLength,
+            int currentLineNo) {
+        if (line != null) {
+            StringBuffer lineBuffer = new StringBuffer(Util.escapeHtmlChars(line));
+            Util.replaceTabs(tabLength, lineBuffer);
+            pre.addContent(new RawHtml(lineBuffer.toString()));
+            Content anchor = HtmlTree.A_NAME("line." + Integer.toString(currentLineNo));
+            pre.addContent(anchor);
+            pre.addContent(NEW_LINE);
+        }
+    }
+
+    /**
+     * Add trailing blank lines at the end of the page.
+     *
+     * @param pre the content tree to which the blank lines will be added.
+     */
+    private static void addBlankLines(Content pre) {
+        for (int i = 0; i < NUM_BLANK_LINES; i++) {
+            pre.addContent(NEW_LINE);
+        }
+    }
+
+    /**
+     * Given a <code>Doc</code>, return an anchor name for it.
+     *
+     * @param d the <code>Doc</code> to check.
+     * @return the name of the anchor.
+     */
+    public static String getAnchorName(Doc d) {
+        return "line." + d.position().line();
+    }
+}
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/SplitIndexWriter.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/SplitIndexWriter.java	Mon Dec 20 21:10:57 2010 -0800
@@ -25,9 +25,10 @@
 
 package com.sun.tools.doclets.formats.html;
 
+import java.io.*;
 import com.sun.tools.doclets.internal.toolkit.util.*;
-
-import java.io.*;
+import com.sun.tools.doclets.formats.html.markup.*;
+import com.sun.tools.doclets.internal.toolkit.*;
 
 /**
  * Generate Separate Index Files for all the member names with Indexing in
@@ -36,6 +37,7 @@
  *
  * @see java.lang.Character
  * @author Atul M Dambalkar
+ * @author Bhavesh Patel (Modified)
  */
 public class SplitIndexWriter extends AbstractIndexWriter {
 
@@ -109,56 +111,68 @@
      * index.
      */
     protected void generateIndexFile(Character unicode) throws IOException {
-        printHtmlHeader(configuration.getText("doclet.Window_Split_Index",
-            unicode.toString()), null, true);
-        printTop();
-        navLinks(true);
-        printLinksForIndexes();
-
-        hr();
-
-        generateContents(unicode, indexbuilder.getMemberList(unicode));
-
-        navLinks(false);
-        printLinksForIndexes();
-
-        printBottom();
-        printBodyHtmlEnd();
+        String title = configuration.getText("doclet.Window_Split_Index",
+                unicode.toString());
+        Content body = getBody(true, getWindowTitle(title));
+        addTop(body);
+        addNavLinks(true, body);
+        HtmlTree divTree = new HtmlTree(HtmlTag.DIV);
+        divTree.addStyle(HtmlStyle.contentContainer);
+        addLinksForIndexes(divTree);
+        addContents(unicode, indexbuilder.getMemberList(unicode), divTree);
+        addLinksForIndexes(divTree);
+        body.addContent(divTree);
+        addNavLinks(false, body);
+        addBottom(body);
+        printHtmlDocument(null, true, body);
     }
 
     /**
-     * Print Links for all the Index Files per unicode character.
+     * Add links for all the Index Files per unicode character.
+     *
+     * @param contentTree the content tree to which the links for indexes will be added
      */
-    protected void printLinksForIndexes() {
-        for (int i = 0; i < indexbuilder.elements().length; i++) {
+    protected void addLinksForIndexes(Content contentTree) {
+        Object[] unicodeChars = indexbuilder.elements();
+        for (int i = 0; i < unicodeChars.length; i++) {
             int j = i + 1;
-            printHyperLink("index-" + j + ".html",
-                           indexbuilder.elements()[i].toString());
-            print(' ');
+            contentTree.addContent(getHyperLink("index-" + j + ".html",
+                    new StringContent(unicodeChars[i].toString())));
+            contentTree.addContent(getSpace());
         }
     }
 
     /**
-     * Print the previous unicode character index link.
+     * Get link to the previous unicode character.
+     *
+     * @return a content tree for the link
      */
-    protected void navLinkPrevious() {
+    public Content getNavLinkPrevious() {
+        Content prevletterLabel = getResource("doclet.Prev_Letter");
         if (prev == -1) {
-            printText("doclet.Prev_Letter");
-        } else {
-            printHyperLink("index-" + prev + ".html", "",
-                configuration.getText("doclet.Prev_Letter"), true);
+            return HtmlTree.LI(prevletterLabel);
+        }
+        else {
+            Content prevLink = getHyperLink("index-" + prev + ".html", "",
+                    prevletterLabel);
+            return HtmlTree.LI(prevLink);
         }
     }
 
     /**
-     * Print the next unicode character index link.
+     * Get link to the next unicode character.
+     *
+     * @return a content tree for the link
      */
-    protected void navLinkNext() {
+    public Content getNavLinkNext() {
+        Content nextletterLabel = getResource("doclet.Next_Letter");
         if (next == -1) {
-            printText("doclet.Next_Letter");
-        } else {
-            printHyperLink("index-" + next + ".html","",
-                configuration.getText("doclet.Next_Letter"), true);
+            return HtmlTree.LI(nextletterLabel);
+        }
+        else {
+            Content nextLink = getHyperLink("index-" + next + ".html","",
+                    nextletterLabel);
+            return HtmlTree.LI(nextLink);
         }
     }
 }
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/StylesheetWriter.java	Thu Dec 16 19:57:01 2010 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,130 +0,0 @@
-/*
- * Copyright (c) 1998, 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.tools.doclets.formats.html;
-
-import com.sun.tools.doclets.internal.toolkit.util.*;
-
-import java.io.*;
-
-/**
- * Writes the style sheet for the doclet output.
- *
- * @author Atul M Dambalkar
- * @author Bhavesh Patel (Modified)
- */
-public class StylesheetWriter extends HtmlDocletWriter {
-
-    /**
-     * Constructor.
-     */
-    public StylesheetWriter(ConfigurationImpl configuration,
-                            String filename) throws IOException {
-        super(configuration, filename);
-    }
-
-    /**
-     * Generate the style file contents.
-     * @throws DocletAbortException
-     */
-    public static void generate(ConfigurationImpl configuration) {
-        StylesheetWriter stylegen;
-        String filename = "";
-        try {
-            filename = "stylesheet.css";
-            stylegen = new StylesheetWriter(configuration, filename);
-            stylegen.generateStyleFile();
-            stylegen.close();
-        } catch (IOException exc) {
-            configuration.standardmessage.error(
-                        "doclet.exception_encountered",
-                        exc.toString(), filename);
-            throw new DocletAbortException();
-        }
-    }
-
-    /**
-     * Generate the style file contents.
-     */
-    protected void generateStyleFile() {
-        print("/* "); printText("doclet.Style_line_1"); println(" */");
-        println("");
-
-        print("/* "); printText("doclet.Style_line_2"); println(" */");
-        println("");
-
-        print("/* "); printText("doclet.Style_line_3"); println(" */");
-        println("body { background-color: #FFFFFF; color:#000000 }");
-        println("");
-
-        print("/* "); printText("doclet.Style_Headings"); println(" */");
-        println("h1 { font-size: 145% }");
-        println("");
-
-        print("/* "); printText("doclet.Style_line_4"); println(" */");
-        print(".TableHeadingColor     { background: #CCCCFF; color:#000000 }");
-        print(" /* "); printText("doclet.Style_line_5"); println(" */");
-        print(".TableSubHeadingColor  { background: #EEEEFF; color:#000000 }");
-        print(" /* "); printText("doclet.Style_line_6"); println(" */");
-        print(".TableRowColor         { background: #FFFFFF; color:#000000 }");
-        print(" /* "); printText("doclet.Style_line_7"); println(" */");
-        println("");
-
-        print("/* "); printText("doclet.Style_line_8"); println(" */");
-        println(".FrameTitleFont   { font-size: 100%; font-family: Helvetica, Arial, sans-serif; color:#000000 }");
-        println(".FrameHeadingFont { font-size:  90%; font-family: Helvetica, Arial, sans-serif; color:#000000 }");
-        println(".FrameItemFont    { font-size:  90%; font-family: Helvetica, Arial, sans-serif; color:#000000 }");
-        println("");
-
-       // Removed doclet.Style_line_9 as no longer needed
-
-        print("/* "); printText("doclet.Style_line_10"); println(" */");
-        print(".NavBarCell1    { background-color:#EEEEFF; color:#000000}");
-        print(" /* "); printText("doclet.Style_line_6"); println(" */");
-        print(".NavBarCell1Rev { background-color:#00008B; color:#FFFFFF}");
-        print(" /* "); printText("doclet.Style_line_11"); println(" */");
-
-        print(".NavBarFont1    { font-family: Arial, Helvetica, sans-serif; color:#000000;");
-        println("color:#000000;}");
-        print(".NavBarFont1Rev { font-family: Arial, Helvetica, sans-serif; color:#FFFFFF;");
-        println("color:#FFFFFF;}");
-        println("");
-
-        print(".NavBarCell2    { font-family: Arial, Helvetica, sans-serif; ");
-        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 Dec 16 19:57:01 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/SubWriterHolderWriter.java	Mon Dec 20 21:10:57 2010 -0800
@@ -25,10 +25,11 @@
 
 package com.sun.tools.doclets.formats.html;
 
+import java.io.*;
 import com.sun.javadoc.*;
+import com.sun.tools.doclets.internal.toolkit.*;
 import com.sun.tools.doclets.internal.toolkit.util.*;
-
-import java.io.*;
+import com.sun.tools.doclets.formats.html.markup.*;
 
 /**
  * This abstract class exists to provide functionality needed in the
@@ -71,13 +72,31 @@
         tdEnd();
     }
 
-    public void printSummaryHeader(AbstractMemberWriter mw, ClassDoc cd) {
-        mw.printSummaryAnchor(cd);
-        mw.printTableSummary();
-        tableCaptionStart();
-        mw.printSummaryLabel();
-        tableCaptionEnd();
-        mw.printSummaryTableHeader(cd);
+    /**
+     * Add the summary header.
+     *
+     * @param mw the writer for the member being documented
+     * @param cd the classdoc to be documented
+     * @param memberTree the content tree to which the summary header will be added
+     */
+    public void addSummaryHeader(AbstractMemberWriter mw, ClassDoc cd,
+            Content memberTree) {
+        mw.addSummaryAnchor(cd, memberTree);
+        mw.addSummaryLabel(memberTree);
+    }
+
+    /**
+     * Get the summary table.
+     *
+     * @param mw the writer for the member being documented
+     * @param cd the classdoc to be documented
+     * @return the content tree for the summary table
+     */
+    public Content getSummaryTableTree(AbstractMemberWriter mw, ClassDoc cd) {
+        Content table = HtmlTree.TABLE(HtmlStyle.overviewSummary, 0, 3, 0,
+                mw.getTableSummary(), getTableCaption(mw.getCaption()));
+        table.addContent(getSummaryTableHeader(mw.getSummaryTableHeader(cd), "col"));
+        return table;
     }
 
     public void printTableHeadingBackground(String str) {
@@ -88,15 +107,17 @@
         tableEnd();
     }
 
-    public void printInheritedSummaryHeader(AbstractMemberWriter mw, ClassDoc cd) {
-        mw.printInheritedSummaryAnchor(cd);
-        tableIndexSummary();
-        tableInheritedHeaderStart("#EEEEFF");
-        mw.printInheritedSummaryLabel(cd);
-        tableInheritedHeaderEnd();
-        trBgcolorStyle("white", "TableRowColor");
-        summaryRow(0);
-        code();
+    /**
+     * Add the inherited summary header.
+     *
+     * @param mw the writer for the member being documented
+     * @param cd the classdoc to be documented
+     * @param inheritedTree the content tree to which the inherited summary header will be added
+     */
+    public void addInheritedSummaryHeader(AbstractMemberWriter mw, ClassDoc cd,
+            Content inheritedTree) {
+        mw.addInheritedSummaryAnchor(cd, inheritedTree);
+        mw.addInheritedSummaryLabel(cd, inheritedTree);
     }
 
     public void printSummaryFooter(AbstractMemberWriter mw, ClassDoc cd) {
@@ -112,8 +133,14 @@
         space();
     }
 
-    protected void printIndexComment(Doc member) {
-        printIndexComment(member, member.firstSentenceTags());
+    /**
+     * Add the index comment.
+     *
+     * @param member the member being documented
+     * @param contentTree the content tree to which the comment will be added
+     */
+    protected void addIndexComment(Doc member, Content contentTree) {
+        addIndexComment(member, member.firstSentenceTags(), contentTree);
     }
 
     protected void printIndexComment(Doc member, Tag[] firstSentenceTags) {
@@ -134,17 +161,60 @@
         printSummaryComment(member, firstSentenceTags);
     }
 
-    public void printSummaryLinkType(AbstractMemberWriter mw,
-                                     ProgramElementDoc member) {
-        trBgcolorStyle("white", "TableRowColor");
-        mw.printSummaryType(member);
-        summaryRow(0);
-        code();
+    /**
+     * Add the index comment.
+     *
+     * @param member the member being documented
+     * @param firstSentenceTags the first sentence tags for the member to be documented
+     * @param tdSummary the content tree to which the comment will be added
+     */
+    protected void addIndexComment(Doc member, Tag[] firstSentenceTags,
+            Content tdSummary) {
+        Tag[] deprs = member.tags("deprecated");
+        Content div;
+        if (Util.isDeprecated((ProgramElementDoc) member)) {
+            Content strong = HtmlTree.STRONG(deprecatedPhrase);
+            div = HtmlTree.DIV(HtmlStyle.block, strong);
+            div.addContent(getSpace());
+            if (deprs.length > 0) {
+                addInlineDeprecatedComment(member, deprs[0], div);
+            }
+            tdSummary.addContent(div);
+            return;
+        } else {
+            ClassDoc cd = ((ProgramElementDoc)member).containingClass();
+            if (cd != null && Util.isDeprecated(cd)) {
+                Content strong = HtmlTree.STRONG(deprecatedPhrase);
+                div = HtmlTree.DIV(HtmlStyle.block, strong);
+                div.addContent(getSpace());
+                tdSummary.addContent(div);
+            }
+        }
+        addSummaryComment(member, firstSentenceTags, tdSummary);
     }
 
-    public void printSummaryLinkComment(AbstractMemberWriter mw,
-                                        ProgramElementDoc member) {
-        printSummaryLinkComment(mw, member, member.firstSentenceTags());
+    /**
+     * Add the summary type for the member.
+     *
+     * @param mw the writer for the member being documented
+     * @param member the member to be documented
+     * @param tdSummaryType the content tree to which the type will be added
+     */
+    public void addSummaryType(AbstractMemberWriter mw, ProgramElementDoc member,
+            Content tdSummaryType) {
+        mw.addSummaryType(member, tdSummaryType);
+    }
+
+    /**
+     * Add the summary link for the member.
+     *
+     * @param mw the writer for the member being documented
+     * @param member the member to be documented
+     * @param contentTree the content tree to which the link will be added
+     */
+    public void addSummaryLinkComment(AbstractMemberWriter mw,
+            ProgramElementDoc member, Content contentTree) {
+        addSummaryLinkComment(mw, member, member.firstSentenceTags(), contentTree);
     }
 
     public void printSummaryLinkComment(AbstractMemberWriter mw,
@@ -159,12 +229,34 @@
         trEnd();
     }
 
-    public void printInheritedSummaryMember(AbstractMemberWriter mw, ClassDoc cd,
-            ProgramElementDoc member, boolean isFirst) {
+    /**
+     * Add the summary link comment.
+     *
+     * @param mw the writer for the member being documented
+     * @param member the member being documented
+     * @param firstSentenceTags the first sentence tags for the member to be documented
+     * @param tdSummary the content tree to which the comment will be added
+     */
+    public void addSummaryLinkComment(AbstractMemberWriter mw,
+            ProgramElementDoc member, Tag[] firstSentenceTags, Content tdSummary) {
+        addIndexComment(member, firstSentenceTags, tdSummary);
+    }
+
+    /**
+     * Add the inherited member summary.
+     *
+     * @param mw the writer for the member being documented
+     * @param cd the class being documented
+     * @param member the member being documented
+     * @param isFirst true if its the first link being documented
+     * @param linksTree the content tree to which the summary will be added
+     */
+    public void addInheritedMemberSummary(AbstractMemberWriter mw, ClassDoc cd,
+            ProgramElementDoc member, boolean isFirst, Content linksTree) {
         if (! isFirst) {
-            mw.print(", ");
+            linksTree.addContent(", ");
         }
-        mw.writeInheritedSummaryLink(cd, member);
+        mw.addInheritedSummaryLink(cd, member, linksTree);
     }
 
     public void printMemberHeader() {
@@ -174,4 +266,67 @@
     public void printMemberFooter() {
     }
 
+    /**
+     * Get the document content header tree
+     *
+     * @return a content tree the document content header
+     */
+    public Content getContentHeader() {
+        HtmlTree div = new HtmlTree(HtmlTag.DIV);
+        div.addStyle(HtmlStyle.contentContainer);
+        return div;
+    }
+
+    /**
+     * Get the member header tree
+     *
+     * @return a content tree the member header
+     */
+    public Content getMemberTreeHeader() {
+        HtmlTree li = new HtmlTree(HtmlTag.LI);
+        li.addStyle(HtmlStyle.blockList);
+        return li;
+    }
+
+    /**
+     * Get the member tree
+     *
+     * @param contentTree the tree used to generate the complete member tree
+     * @return a content tree for the member
+     */
+    public Content getMemberTree(Content contentTree) {
+        Content ul = HtmlTree.UL(HtmlStyle.blockList, contentTree);
+        return ul;
+    }
+
+    /**
+     * Get the member summary tree
+     *
+     * @param contentTree the tree used to generate the member summary tree
+     * @return a content tree for the member summary
+     */
+    public Content getMemberSummaryTree(Content contentTree) {
+        return getMemberTree(HtmlStyle.summary, contentTree);
+    }
+
+    /**
+     * Get the member details tree
+     *
+     * @param contentTree the tree used to generate the member details tree
+     * @return a content tree for the member details
+     */
+    public Content getMemberDetailsTree(Content contentTree) {
+        return getMemberTree(HtmlStyle.details, contentTree);
+    }
+
+    /**
+     * Get the member tree
+     *
+     * @param style the style class to be added to the content tree
+     * @param contentTree the tree used to generate the complete member tree
+     */
+    public Content getMemberTree(HtmlStyle style, Content contentTree) {
+        Content div = HtmlTree.DIV(style, getMemberTree(contentTree));
+        return div;
+    }
 }
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/TagletWriterImpl.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/TagletWriterImpl.java	Mon Dec 20 21:10:57 2010 -0800
@@ -70,9 +70,9 @@
         Tag[] deprs = doc.tags("deprecated");
         if (doc instanceof ClassDoc) {
             if (Util.isDeprecated((ProgramElementDoc) doc)) {
-                output.append("<STRONG>" +
+                output.append("<span class=\"strong\">" +
                     ConfigurationImpl.getInstance().
-                        getText("doclet.Deprecated") + "</STRONG>&nbsp;");
+                        getText("doclet.Deprecated") + "</span>&nbsp;");
                 if (deprs.length > 0) {
                     Tag[] commentTags = deprs[0].inlineTags();
                     if (commentTags.length > 0) {
@@ -82,30 +82,24 @@
                         );
                     }
                 }
-                output.append("<p>");
             }
         } else {
             MemberDoc member = (MemberDoc) doc;
             if (Util.isDeprecated((ProgramElementDoc) doc)) {
-                output.append("<DD><STRONG>" +
+                output.append("<span class=\"strong\">" +
                     ConfigurationImpl.getInstance().
-                            getText("doclet.Deprecated") + "</STRONG>&nbsp;");
+                            getText("doclet.Deprecated") + "</span>&nbsp;");
                 if (deprs.length > 0) {
-                    output.append("<I>");
+                    output.append("<i>");
                     output.append(commentTagsToOutput(null, doc,
                         deprs[0].inlineTags(), false).toString());
-                    output.append("</I>");
+                    output.append("</i>");
                 }
-                if (member instanceof ExecutableMemberDoc) {
-                    output.append(DocletConstants.NL + "<P>" +
-                        DocletConstants.NL);
-                }
-                output.append("</DD>");
             } else {
                 if (Util.isDeprecated(member.containingClass())) {
-                    output.append("<DD><STRONG>" +
+                    output.append("<span class=\"strong\">" +
                     ConfigurationImpl.getInstance().
-                            getText("doclet.Deprecated") + "</STRONG>&nbsp;</DD>");
+                            getText("doclet.Deprecated") + "</span>&nbsp;");
                 }
             }
         }
@@ -124,8 +118,8 @@
      */
     public TagletOutput getParamHeader(String header) {
         StringBuffer result = new StringBuffer();
-        result.append("<DT>");
-        result.append("<STRONG>" +  header + "</STRONG></DT>");
+        result.append("<dt>");
+        result.append("<span class=\"strong\">" +  header + "</span></dt>");
         return new TagletOutputImpl(result.toString());
     }
 
@@ -133,8 +127,8 @@
      * {@inheritDoc}
      */
     public TagletOutput paramTagOutput(ParamTag paramTag, String paramName) {
-        TagletOutput result = new TagletOutputImpl("<DD><CODE>" + paramName + "</CODE>"
-         + " - " + htmlWriter.commentTagsToString(paramTag, null, paramTag.inlineTags(), false) + "</DD>");
+        TagletOutput result = new TagletOutputImpl("<dd><code>" + paramName + "</code>"
+         + " - " + htmlWriter.commentTagsToString(paramTag, null, paramTag.inlineTags(), false) + "</dd>");
         return result;
     }
 
@@ -142,11 +136,11 @@
      * {@inheritDoc}
      */
     public TagletOutput returnTagOutput(Tag returnTag) {
-        TagletOutput result = new TagletOutputImpl(DocletConstants.NL + "<DT>" +
-            "<STRONG>" + htmlWriter.configuration.getText("doclet.Returns") +
-            "</STRONG>" + "</DT>" + "<DD>" +
+        TagletOutput result = new TagletOutputImpl(DocletConstants.NL + "<dt>" +
+            "<span class=\"strong\">" + htmlWriter.configuration.getText("doclet.Returns") +
+            "</span>" + "</dt>" + "<dd>" +
             htmlWriter.commentTagsToString(returnTag, null, returnTag.inlineTags(),
-            false) + "</DD>");
+            false) + "</dd>");
         return result;
     }
 
@@ -168,7 +162,7 @@
                 htmlWriter instanceof ClassWriterImpl) {
             //Automatically add link to constant values page for constant fields.
             result = addSeeHeader(result);
-            result += htmlWriter.getHyperLink(htmlWriter.relativePath +
+            result += htmlWriter.getHyperLinkString(htmlWriter.relativePath +
                 ConfigurationImpl.CONSTANTS_FILE_NAME
                 + "#" + ((ClassWriterImpl) htmlWriter).getClassDoc().qualifiedName()
                 + "." + ((FieldDoc) holder).name(),
@@ -179,18 +173,19 @@
             if ((SerializedFormBuilder.serialInclude(holder) &&
                       SerializedFormBuilder.serialInclude(((ClassDoc)holder).containingPackage()))) {
                 result = addSeeHeader(result);
-                result += htmlWriter.getHyperLink(htmlWriter.relativePath + "serialized-form.html",
+                result += htmlWriter.getHyperLinkString(htmlWriter.relativePath + "serialized-form.html",
                         ((ClassDoc)holder).qualifiedName(), htmlWriter.configuration.getText("doclet.Serialized_Form"), false);
             }
         }
-        return result.equals("") ? null : new TagletOutputImpl(result + "</DD>");
+        return result.equals("") ? null : new TagletOutputImpl(result + "</dd>");
     }
 
     private String addSeeHeader(String result) {
         if (result != null && result.length() > 0) {
             return result + ", " + DocletConstants.NL;
         } else {
-            return "<DT><STRONG>" + htmlWriter.configuration().getText("doclet.See_Also") + "</STRONG></DT><DD>";
+            return "<dt><span class=\"strong\">" +
+                    htmlWriter.configuration().getText("doclet.See_Also") + "</span></dt><dd>";
         }
      }
 
@@ -198,15 +193,15 @@
      * {@inheritDoc}
      */
     public TagletOutput simpleTagOutput(Tag[] simpleTags, String header) {
-        String result = "<DT><STRONG>" + header + "</STRONG></DT>" + DocletConstants.NL +
-            "  <DD>";
+        String result = "<dt><span class=\"strong\">" + header + "</span></dt>" + DocletConstants.NL +
+            "  <dd>";
         for (int i = 0; i < simpleTags.length; i++) {
             if (i > 0) {
                 result += ", ";
             }
             result += htmlWriter.commentTagsToString(simpleTags[i], null, simpleTags[i].inlineTags(), false);
         }
-        result += "</DD>" + DocletConstants.NL;
+        result += "</dd>" + DocletConstants.NL;
         return new TagletOutputImpl(result);
     }
 
@@ -214,24 +209,24 @@
      * {@inheritDoc}
      */
     public TagletOutput simpleTagOutput(Tag simpleTag, String header) {
-        return new TagletOutputImpl("<DT><STRONG>" + header + "</STRONG></DT>" + "  <DD>"
+        return new TagletOutputImpl("<dt><span class=\"strong\">" + header + "</span></dt>" + "  <dd>"
             + htmlWriter.commentTagsToString(simpleTag, null, simpleTag.inlineTags(), false)
-            + "</DD>" + DocletConstants.NL);
+            + "</dd>" + DocletConstants.NL);
     }
 
     /**
      * {@inheritDoc}
      */
     public TagletOutput getThrowsHeader() {
-        return new TagletOutputImpl(DocletConstants.NL + "<DT>" + "<STRONG>" +
-            htmlWriter.configuration().getText("doclet.Throws") + "</STRONG></DT>");
+        return new TagletOutputImpl(DocletConstants.NL + "<dt>" + "<span class=\"strong\">" +
+            htmlWriter.configuration().getText("doclet.Throws") + "</span></dt>");
     }
 
     /**
      * {@inheritDoc}
      */
     public TagletOutput throwsTagOutput(ThrowsTag throwsTag) {
-        String result = DocletConstants.NL + "<DD>";
+        String result = DocletConstants.NL + "<dd>";
         result += throwsTag.exceptionType() == null ?
             htmlWriter.codeText(throwsTag.exceptionName()) :
             htmlWriter.codeText(
@@ -243,7 +238,7 @@
         if (text != null && text.toString().length() > 0) {
             result += " - " + text;
         }
-        result += "</DD>";
+        result += "</dd>";
         return new TagletOutputImpl(result);
     }
 
@@ -251,9 +246,9 @@
      * {@inheritDoc}
      */
     public TagletOutput throwsTagOutput(Type throwsType) {
-        return new TagletOutputImpl(DocletConstants.NL + "<DD>" +
+        return new TagletOutputImpl(DocletConstants.NL + "<dd>" +
             htmlWriter.codeText(htmlWriter.getLink(
-                new LinkInfoImpl(LinkInfoImpl.CONTEXT_MEMBER, throwsType))) + "</DD>");
+                new LinkInfoImpl(LinkInfoImpl.CONTEXT_MEMBER, throwsType))) + "</dd>");
     }
 
     /**
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/TreeWriter.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/TreeWriter.java	Mon Dec 20 21:10:57 2010 -0800
@@ -29,6 +29,8 @@
 
 import com.sun.javadoc.*;
 import com.sun.tools.doclets.internal.toolkit.util.*;
+import com.sun.tools.doclets.formats.html.markup.*;
+import com.sun.tools.doclets.internal.toolkit.*;
 
 /**
  * Generate Class Hierarchy page for all the Classes in this run.  Use
@@ -37,6 +39,7 @@
  * current or the destination directory.
  *
  * @author Atul M Dambalkar
+ * @author Bhavesh Patel (Modified)
  */
 public class TreeWriter extends AbstractTreeWriter {
 
@@ -90,86 +93,70 @@
     }
 
     /**
-     * Print the interface hierarchy and class hierarchy in the file.
+     * Generate the interface hierarchy and class hierarchy.
      */
     public void generateTreeFile() throws IOException {
-        printHtmlHeader(configuration.getText("doclet.Window_Class_Hierarchy"),
-            null, true);
-
-        printTreeHeader();
-
-        printPageHeading();
-
-        printPackageTreeLinks();
-
-        generateTree(classtree.baseclasses(), "doclet.Class_Hierarchy");
-        generateTree(classtree.baseinterfaces(), "doclet.Interface_Hierarchy");
-        generateTree(classtree.baseAnnotationTypes(), "doclet.Annotation_Type_Hierarchy");
-        generateTree(classtree.baseEnums(), "doclet.Enum_Hierarchy");
-
-        printTreeFooter();
+        Content body = getTreeHeader();
+        Content headContent = getResource("doclet.Hierarchy_For_All_Packages");
+        Content heading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, false,
+                HtmlStyle.title, headContent);
+        Content div = HtmlTree.DIV(HtmlStyle.header, heading);
+        addPackageTreeLinks(div);
+        body.addContent(div);
+        HtmlTree divTree = new HtmlTree(HtmlTag.DIV);
+        divTree.addStyle(HtmlStyle.contentContainer);
+        addTree(classtree.baseclasses(), "doclet.Class_Hierarchy", divTree);
+        addTree(classtree.baseinterfaces(), "doclet.Interface_Hierarchy", divTree);
+        addTree(classtree.baseAnnotationTypes(), "doclet.Annotation_Type_Hierarchy", divTree);
+        addTree(classtree.baseEnums(), "doclet.Enum_Hierarchy", divTree);
+        body.addContent(divTree);
+        addNavLinks(false, body);
+        addBottom(body);
+        printHtmlDocument(null, true, body);
     }
 
     /**
-     * Generate the links to all the package tree files.
+     * Add the links to all the package tree files.
+     *
+     * @param contentTree the content tree to which the links will be added
      */
-    protected void printPackageTreeLinks() {
+    protected void addPackageTreeLinks(Content contentTree) {
         //Do nothing if only unnamed package is used
         if (packages.length == 1 && packages[0].name().length() == 0) {
             return;
         }
         if (!classesonly) {
-            dl();
-            dt();
-            strongText("doclet.Package_Hierarchies");
-            dtEnd();
-            dd();
+            Content span = HtmlTree.SPAN(HtmlStyle.strong,
+                    getResource("doclet.Package_Hierarchies"));
+            contentTree.addContent(span);
+            HtmlTree ul = new HtmlTree(HtmlTag.UL);
+            ul.addStyle(HtmlStyle.horizontal);
             for (int i = 0; i < packages.length; i++) {
                 if (packages[i].name().length() == 0) {
                     continue;
                 }
-                String filename = pathString(packages[i], "package-tree.html");
-                printHyperLink(filename, "", packages[i].name());
+                String link = pathString(packages[i], "package-tree.html");
+                Content li = HtmlTree.LI(getHyperLink(
+                        link, "", new StringContent(packages[i].name())));
                 if (i < packages.length - 1) {
-                    print(", ");
+                    li.addContent(", ");
                 }
+                ul.addContent(li);
             }
-            ddEnd();
-            dlEnd();
-            hr();
+            contentTree.addContent(ul);
         }
     }
 
     /**
-     * Print the top text (from the -top option) and
-     * navigation bar at the top of page.
-     */
-    protected void printTreeHeader() {
-        printTop();
-        navLinks(true);
-        hr();
-    }
-
-    /**
-     * Print the navigation bar and bottom text (from the -bottom option)
-     * at the bottom of page.
+     * Get the tree header.
+     *
+     * @return a content tree for the tree header
      */
-    protected void printTreeFooter() {
-        hr();
-        navLinks(false);
-        printBottom();
-        printBodyHtmlEnd();
-    }
-
-    /**
-     * Print the page title "Hierarchy For All Packages" at the top of the tree
-     * page.
-     */
-    protected void printPageHeading() {
-        center();
-        h2();
-        printText("doclet.Hierarchy_For_All_Packages");
-        h2End();
-        centerEnd();
+    protected Content getTreeHeader() {
+        String title = configuration.getText("doclet.Window_Class_Hierarchy");
+        Content bodyTree = getBody(true, getWindowTitle(title));
+        addTop(bodyTree);
+        addNavLinks(true, bodyTree);
+        return bodyTree;
     }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/Comment.java	Mon Dec 20 21:10:57 2010 -0800
@@ -0,0 +1,90 @@
+/*
+ * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.tools.doclets.formats.html.markup;
+
+import com.sun.tools.doclets.internal.toolkit.Content;
+import com.sun.tools.doclets.internal.toolkit.util.*;
+
+/**
+ * Class for generating a comment for HTML pages of javadoc output.
+ *
+ * @author Bhavesh Patel
+ */
+public class Comment extends Content{
+
+    private String commentText;
+
+    /**
+     * Constructor to construct a Comment object.
+     *
+     * @param comment comment text for the comment
+     */
+    public Comment(String comment) {
+        commentText = nullCheck(comment);
+    }
+
+    /**
+     * This method is not supported by the class.
+     *
+     * @param content content that needs to be added
+     * @throws DocletAbortException this method will always throw a
+     *                              DocletAbortException because it
+     *                              is not supported.
+     */
+    public void addContent(Content content) {
+        throw new DocletAbortException();
+    }
+
+    /**
+     * This method is not supported by the class.
+     *
+     * @param stringContent string content that needs to be added
+     * @throws DocletAbortException this method will always throw a
+     *                              DocletAbortException because it
+     *                              is not supported.
+     */
+    public void addContent(String stringContent) {
+        throw new DocletAbortException();
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public boolean isEmpty() {
+        return commentText.isEmpty();
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public void write(StringBuilder contentBuilder) {
+        if (!endsWithNewLine(contentBuilder))
+            contentBuilder.append(DocletConstants.NL);
+        contentBuilder.append("<!-- ");
+        contentBuilder.append(commentText);
+        contentBuilder.append(" -->" + DocletConstants.NL);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/DocType.java	Mon Dec 20 21:10:57 2010 -0800
@@ -0,0 +1,113 @@
+/*
+ * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.tools.doclets.formats.html.markup;
+
+import com.sun.tools.doclets.internal.toolkit.Content;
+import com.sun.tools.doclets.internal.toolkit.util.*;
+
+/**
+ * Class for generating document type for HTML pages of javadoc output.
+ *
+ * @author Bhavesh Patel
+ */
+public class DocType extends Content{
+
+    private String docType;
+
+    private static DocType transitional;
+
+    private static DocType frameset;
+
+    /**
+     * Constructor to construct a DocType object.
+     *
+     * @param type the doctype to be added
+     */
+    private DocType(String type, String dtd) {
+        docType = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 " + type +
+                "//EN\" \"" + dtd + "\">" + DocletConstants.NL;
+    }
+
+     /**
+     * Construct and return a HTML 4.01 transitional DocType content
+     *
+     * @return a content tree for transitional DocType
+     */
+    public static DocType Transitional() {
+        if (transitional == null)
+            transitional = new DocType("Transitional", "http://www.w3.org/TR/html4/loose.dtd");
+        return transitional;
+    }
+
+    /**
+     * Construct and return a HTML 4.01 frameset DocType content
+     *
+     * @return a content tree for frameset DocType
+     */
+    public static DocType Frameset() {
+        if (frameset == null)
+            frameset = new DocType("Frameset", "http://www.w3.org/TR/html4/frameset.dtd");
+        return frameset;
+    }
+
+    /**
+     * This method is not supported by the class.
+     *
+     * @param content content that needs to be added
+     * @throws DocletAbortException this method will always throw a
+     *                              DocletAbortException because it
+     *                              is not supported.
+     */
+    public void addContent(Content content) {
+        throw new DocletAbortException();
+    }
+
+    /**
+     * This method is not supported by the class.
+     *
+     * @param stringContent string content that needs to be added
+     * @throws DocletAbortException this method will always throw a
+     *                              DocletAbortException because it
+     *                              is not supported.
+     */
+    public void addContent(String stringContent) {
+        throw new DocletAbortException();
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public boolean isEmpty() {
+        return (docType.length() == 0);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public void write(StringBuilder contentBuilder) {
+        contentBuilder.append(docType);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlAttr.java	Mon Dec 20 21:10:57 2010 -0800
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.tools.doclets.formats.html.markup;
+
+/**
+ * Enum representing HTML tag attributes.
+ *
+ * @author Bhavesh Patel
+ */
+public enum HtmlAttr {
+    ALT,
+    BORDER,
+    CELLPADDING,
+    CELLSPACING,
+    CHARSET,
+    CLASS,
+    CLEAR,
+    COLS,
+    CONTENT,
+    HREF,
+    HTTP_EQUIV("http-equiv"),
+    ID,
+    LANG,
+    NAME,
+    ONLOAD,
+    REL,
+    ROWS,
+    SCOPE,
+    SCROLLING,
+    SRC,
+    SUMMARY,
+    TARGET,
+    TITLE,
+    TYPE,
+    WIDTH;
+
+    private final String value;
+
+    HtmlAttr() {
+        this.value = name().toLowerCase();
+    }
+
+    HtmlAttr(String name) {
+        this.value = name;
+    }
+
+    public String toString() {
+        return value;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlConstants.java	Mon Dec 20 21:10:57 2010 -0800
@@ -0,0 +1,189 @@
+/*
+ * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.tools.doclets.formats.html.markup;
+
+import com.sun.tools.doclets.internal.toolkit.Content;
+
+/**
+ * Stores constants for Html Doclet.
+ *
+ * @author Bhavesh Patel
+ */
+public class HtmlConstants {
+
+    /**
+     * Marker to identify start of top navigation bar.
+     */
+    public static final Content START_OF_TOP_NAVBAR =
+            new Comment("========= START OF TOP NAVBAR =======");
+
+    /**
+     * Marker to identify start of bottom navigation bar.
+     */
+    public static final Content START_OF_BOTTOM_NAVBAR =
+            new Comment("======= START OF BOTTOM NAVBAR ======");
+
+    /**
+     * Marker to identify end of top navigation bar.
+     */
+    public static final Content END_OF_TOP_NAVBAR =
+            new Comment("========= END OF TOP NAVBAR =========");
+
+    /**
+     * Marker to identify end of bottom navigation bar.
+     */
+    public static final Content END_OF_BOTTOM_NAVBAR =
+            new Comment("======== END OF BOTTOM NAVBAR =======");
+
+    /**
+     * Marker to identify start of class data.
+     */
+    public static final Content START_OF_CLASS_DATA =
+            new Comment("======== START OF CLASS DATA ========");
+
+    /**
+     * Marker to identify end of class data.
+     */
+    public static final Content END_OF_CLASS_DATA =
+            new Comment("========= END OF CLASS DATA =========");
+
+    /**
+     * Marker to identify start of nested class summary.
+     */
+    public static final Content START_OF_NESTED_CLASS_SUMMARY =
+            new Comment("======== NESTED CLASS SUMMARY ========");
+
+    /**
+     * Marker to identify start of annotation type optional member summary.
+     */
+    public static final Content START_OF_ANNOTATION_TYPE_OPTIONAL_MEMBER_SUMMARY =
+            new Comment("=========== ANNOTATION TYPE OPTIONAL MEMBER SUMMARY ===========");
+
+    /**
+     * Marker to identify start of annotation type required member summary.
+     */
+    public static final Content START_OF_ANNOTATION_TYPE_REQUIRED_MEMBER_SUMMARY =
+            new Comment("=========== ANNOTATION TYPE REQUIRED MEMBER SUMMARY ===========");
+
+    /**
+     * Marker to identify start of constructor summary.
+     */
+    public static final Content START_OF_CONSTRUCTOR_SUMMARY =
+            new Comment("======== CONSTRUCTOR SUMMARY ========");
+
+    /**
+     * Marker to identify start of enum constants summary.
+     */
+    public static final Content START_OF_ENUM_CONSTANT_SUMMARY =
+            new Comment("=========== ENUM CONSTANT SUMMARY ===========");
+
+    /**
+     * Marker to identify start of field summary.
+     */
+    public static final Content START_OF_FIELD_SUMMARY =
+            new Comment("=========== FIELD SUMMARY ===========");
+
+    /**
+     * Marker to identify start of method summary.
+     */
+    public static final Content START_OF_METHOD_SUMMARY =
+            new Comment("========== METHOD SUMMARY ===========");
+
+    /**
+     * Marker to identify start of annotation type details.
+     */
+    public static final Content START_OF_ANNOTATION_TYPE_DETAILS =
+            new Comment("============ ANNOTATION TYPE MEMBER DETAIL ===========");
+
+    /**
+     * Marker to identify start of method details.
+     */
+    public static final Content START_OF_METHOD_DETAILS =
+            new Comment("============ METHOD DETAIL ==========");
+
+    /**
+     * Marker to identify start of field details.
+     */
+    public static final Content START_OF_FIELD_DETAILS =
+            new Comment("============ FIELD DETAIL ===========");
+
+    /**
+     * Marker to identify start of constructor details.
+     */
+    public static final Content START_OF_CONSTRUCTOR_DETAILS =
+            new Comment("========= CONSTRUCTOR DETAIL ========");
+
+    /**
+     * Marker to identify start of enum constants details.
+     */
+    public static final Content START_OF_ENUM_CONSTANT_DETAILS =
+            new Comment("============ ENUM CONSTANT DETAIL ===========");
+
+    /**
+     * Html tag for the page title heading.
+     */
+    public static final HtmlTag TITLE_HEADING = HtmlTag.H1;
+
+    /**
+     * Html tag for the class page title heading.
+     */
+    public static final HtmlTag CLASS_PAGE_HEADING = HtmlTag.H2;
+
+    /**
+     * Html tag for the content heading.
+     */
+    public static final HtmlTag CONTENT_HEADING = HtmlTag.H2;
+
+    /**
+     * Html tag for the package name heading.
+     */
+    public static final HtmlTag PACKAGE_HEADING = HtmlTag.H2;
+
+    /**
+     * Html tag for the member summary heading.
+     */
+    public static final HtmlTag SUMMARY_HEADING = HtmlTag.H3;
+
+    /**
+     * Html tag for the inherited member summary heading.
+     */
+    public static final HtmlTag INHERITED_SUMMARY_HEADING = HtmlTag.H3;
+
+    /**
+     * Html tag for the member details heading.
+     */
+    public static final HtmlTag DETAILS_HEADING = HtmlTag.H3;
+
+    /**
+     * Html tag for the serialized member heading.
+     */
+    public static final HtmlTag SERIALIZED_MEMBER_HEADING = HtmlTag.H3;
+
+    /**
+     * Html tag for the member heading.
+     */
+    public static final HtmlTag MEMBER_HEADING = HtmlTag.H4;
+}
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlDocWriter.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlDocWriter.java	Mon Dec 20 21:10:57 2010 -0800
@@ -87,7 +87,7 @@
      */
     public void printHyperLink(String link, String where,
                                String label, boolean strong) {
-        print(getHyperLink(link, where, label, strong, "", "", ""));
+        print(getHyperLinkString(link, where, label, strong, "", "", ""));
     }
 
     /**
@@ -115,7 +115,7 @@
     public void printHyperLink(String link, String where,
                                String label, boolean strong,
                                String stylename) {
-        print(getHyperLink(link, where, label, strong, stylename, "", ""));
+        print(getHyperLinkString(link, where, label, strong, stylename, "", ""));
     }
 
     /**
@@ -128,9 +128,9 @@
      * @param strong       Boolean that sets label to strong.
      * @return String    Hyper Link.
      */
-    public String getHyperLink(String link, String where,
+    public String getHyperLinkString(String link, String where,
                                String label, boolean strong) {
-        return getHyperLink(link, where, label, strong, "", "", "");
+        return getHyperLinkString(link, where, label, strong, "", "", "");
     }
 
     /**
@@ -144,10 +144,24 @@
      * @param stylename  String style of text defined in style sheet.
      * @return String    Hyper Link.
      */
-    public String getHyperLink(String link, String where,
+    public String getHyperLinkString(String link, String where,
                                String label, boolean strong,
                                String stylename) {
-        return getHyperLink(link, where, label, strong, stylename, "", "");
+        return getHyperLinkString(link, where, label, strong, stylename, "", "");
+    }
+
+    /**
+     * Get Html Hyper Link string.
+     *
+     * @param link       String name of the file.
+     * @param where      Position of the link in the file. Character '#' is not
+     *                   needed.
+     * @param label      Tag for the link.
+     * @return a content tree for the hyper link
+     */
+    public Content getHyperLink(String link, String where,
+                               Content label) {
+        return getHyperLink(link, where, label, "", "");
     }
 
     /**
@@ -163,11 +177,11 @@
      * @param target     Target frame.
      * @return String    Hyper Link.
      */
-    public String getHyperLink(String link, String where,
+    public String getHyperLinkString(String link, String where,
                                String label, boolean strong,
                                String stylename, String title, String target) {
         StringBuffer retlink = new StringBuffer();
-        retlink.append("<A HREF=\"");
+        retlink.append("<a href=\"");
         retlink.append(link);
         if (where != null && where.length() != 0) {
             retlink.append("#");
@@ -187,27 +201,54 @@
             retlink.append("\">");
         }
         if (strong) {
-            retlink.append("<STRONG>");
+            retlink.append("<span class=\"strong\">");
         }
         retlink.append(label);
         if (strong) {
-            retlink.append("</STRONG>");
+            retlink.append("</span>");
         }
         if (stylename != null && stylename.length() != 0) {
             retlink.append("</FONT>");
         }
-        retlink.append("</A>");
+        retlink.append("</a>");
         return retlink.toString();
     }
 
     /**
-     * Print link without positioning in the file.
+     * Get Html Hyper Link.
      *
      * @param link       String name of the file.
+     * @param where      Position of the link in the file. Character '#' is not
+     *                   needed.
      * @param label      Tag for the link.
+     * @param title      String that describes the link's content for accessibility.
+     * @param target     Target frame.
+     * @return a content tree for the hyper link.
      */
-    public void printHyperLink(String link, String label) {
-        print(getHyperLink(link, "", label, false));
+    public Content getHyperLink(String link, String where,
+            Content label, String title, String target) {
+        if (where != null && where.length() != 0) {
+            link += "#" + where;
+        }
+        HtmlTree anchor = HtmlTree.A(link, label);
+        if (title != null && title.length() != 0) {
+            anchor.addAttr(HtmlAttr.TITLE, title);
+        }
+        if (target != null && target.length() != 0) {
+            anchor.addAttr(HtmlAttr.TARGET, target);
+        }
+        return anchor;
+    }
+
+    /**
+     * Get a hyperlink to a file.
+     *
+     * @param link String name of the file
+     * @param label Label for the link
+     * @return a content for the hyperlink to the file
+     */
+    public Content getHyperLink(String link, Content label) {
+        return getHyperLink(link, "", label);
     }
 
     /**
@@ -217,8 +258,8 @@
      * @param label      Tag for the link.
      * @return Strign    Hyper link.
      */
-    public String getHyperLink(String link, String label) {
-        return getHyperLink(link, "", label, false);
+    public String getHyperLinkString(String link, String label) {
+        return getHyperLinkString(link, "", label, false);
     }
 
     /**
@@ -273,54 +314,32 @@
      * Print the frameset version of the Html file header.
      * Called only when generating an HTML frameset file.
      *
-     * @param title    Title of this HTML document.
+     * @param title Title of this HTML document
+     * @param noTimeStamp If true, don't print time stamp in header
+     * @param frameset the frameset to be added to the HTML document
      */
-    public void printFramesetHeader(String title) {
-        printFramesetHeader(title, false);
-    }
-
-    /**
-     * Print the frameset version of the Html file header.
-     * Called only when generating an HTML frameset file.
-     *
-     * @param title        Title of this HTML document.
-     * @param noTimeStamp  If true, don't print time stamp in header.
-     */
-    public void printFramesetHeader(String title, boolean noTimeStamp) {
-        println("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 " +
-                    "Frameset//EN\" " +
-                    "\"http://www.w3.org/TR/html4/frameset.dtd\">");
-        println("<!--NewPage-->");
-        html();
-        head();
+    public void printFramesetDocument(String title, boolean noTimeStamp,
+            Content frameset) {
+        Content htmlDocType = DocType.Frameset();
+        Content htmlComment = new Comment(configuration.getText("doclet.New_Page"));
+        Content head = new HtmlTree(HtmlTag.HEAD);
         if (! noTimeStamp) {
-            print("<!-- Generated by javadoc on ");
-            print(today());
-            println("-->");
+            Content headComment = new Comment("Generated by javadoc on " + today());
+            head.addContent(headComment);
         }
         if (configuration.charset.length() > 0) {
-            println("<META http-equiv=\"Content-Type\" content=\"text/html; "
-                        + "charset=" + configuration.charset + "\">");
+            Content meta = HtmlTree.META("Content-Type", "text/html",
+                    configuration.charset);
+            head.addContent(meta);
         }
-        title();
-        println(title);
-        titleEnd();
-        //Script to set the classFrame if necessary.
-        script();
-        println("    targetPage = \"\" + window.location.search;");
-        println("    if (targetPage != \"\" && targetPage != \"undefined\")");
-        println("        targetPage = targetPage.substring(1);");
-        println("    if (targetPage.indexOf(\":\") != -1)");
-        println("        targetPage = \"undefined\";");
-
-        println("    function loadFrames() {");
-        println("        if (targetPage != \"\" && targetPage != \"undefined\")");
-        println("             top.classFrame.location = top.targetPage;");
-        println("    }");
-        scriptEnd();
-        noScript();
-        noScriptEnd();
-        headEnd();
+        Content windowTitle = HtmlTree.TITLE(new StringContent(title));
+        head.addContent(windowTitle);
+        head.addContent(getFramesetJavaScript());
+        Content htmlTree = HtmlTree.HTML(configuration.getLocale().getLanguage(),
+                head, frameset);
+        Content htmlDocument = new HtmlDocument(htmlDocType,
+                htmlComment, htmlTree);
+        print(htmlDocument.toString());
     }
 
     /**
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlDocument.java	Mon Dec 20 21:10:57 2010 -0800
@@ -0,0 +1,103 @@
+/*
+ * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.tools.doclets.formats.html.markup;
+
+import java.util.*;
+import com.sun.tools.doclets.internal.toolkit.Content;
+import com.sun.tools.doclets.internal.toolkit.util.*;
+
+/**
+ * Class for generating an HTML document for javadoc output.
+ *
+ * @author Bhavesh Patel
+ */
+public class HtmlDocument extends Content {
+
+    private List<Content> docContent = Collections.<Content>emptyList();
+
+    /**
+     * Constructor to construct an HTML document.
+     *
+     * @param docType document type for the HTML document
+     * @param docComment comment for the document
+     * @param htmlTree HTML tree of the document
+     */
+    public HtmlDocument(Content docType, Content docComment, Content htmlTree) {
+        docContent = new ArrayList<Content>();
+        addContent(nullCheck(docType));
+        addContent(nullCheck(docComment));
+        addContent(nullCheck(htmlTree));
+    }
+
+    /**
+     * Constructor to construct an HTML document.
+     *
+     * @param docType document type for the HTML document
+     * @param htmlTree HTML tree of the document
+     */
+    public HtmlDocument(Content docType, Content htmlTree) {
+        docContent = new ArrayList<Content>();
+        addContent(nullCheck(docType));
+        addContent(nullCheck(htmlTree));
+    }
+
+    /**
+     * Adds content for the HTML document.
+     *
+     * @param htmlContent html content to be added
+     */
+    public void addContent(Content htmlContent) {
+        if (htmlContent.isValid())
+            docContent.add(htmlContent);
+    }
+
+    /**
+     * This method is not supported by the class.
+     *
+     * @param stringContent string content that needs to be added
+     * @throws DocletAbortException this method will always throw a
+     *                              DocletAbortException because it
+     *                              is not supported.
+     */
+    public void addContent(String stringContent) {
+        throw new DocletAbortException();
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public boolean isEmpty() {
+        return (docContent.isEmpty());
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public void write(StringBuilder contentBuilder) {
+        for (Content c : docContent)
+            c.write(contentBuilder);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlStyle.java	Mon Dec 20 21:10:57 2010 -0800
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.tools.doclets.formats.html.markup;
+
+/**
+ * Enum representing HTML styles. The name map to values in the CSS file.
+ *
+ * @author Bhavesh Patel
+ */
+public enum HtmlStyle {
+    aboutLanguage,
+    altColor,
+    bar,
+    block,
+    blockList,
+    blockListLast,
+    bottomNav,
+    classUseContainer,
+    colFirst,
+    colLast,
+    colOne,
+    constantValuesContainer,
+    contentContainer,
+    description,
+    details,
+    header,
+    horizontal,
+    footer,
+    indexContainer,
+    indexHeader,
+    inheritance,
+    legalCopy,
+    nameValue,
+    navBarCell1Rev,
+    navList,
+    overviewSummary,
+    packageSummary,
+    rowColor,
+    serializedFormContainer,
+    sourceContainer,
+    sourceLineNo,
+    strong,
+    subNav,
+    subNavList,
+    subTitle,
+    summary,
+    tabEnd,
+    title,
+    topNav;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlTag.java	Mon Dec 20 21:10:57 2010 -0800
@@ -0,0 +1,126 @@
+/*
+ * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.tools.doclets.formats.html.markup;
+
+/**
+ * Enum representing HTML tags.
+ *
+ * @author Bhavesh Patel
+ */
+public enum HtmlTag {
+    A(BlockType.INLINE, EndTag.END),
+    BLOCKQUOTE,
+    BODY(BlockType.OTHER, EndTag.END),
+    BR(BlockType.INLINE, EndTag.NOEND),
+    CAPTION,
+    CENTER,
+    CODE(BlockType.INLINE, EndTag.END),
+    DD,
+    DIV,
+    DL,
+    DT,
+    EM(BlockType.INLINE, EndTag.END),
+    FONT(BlockType.INLINE, EndTag.END),
+    FRAME(BlockType.OTHER, EndTag.NOEND),
+    FRAMESET(BlockType.OTHER, EndTag.END),
+    H1,
+    H2,
+    H3,
+    H4,
+    H5,
+    H6,
+    HEAD(BlockType.OTHER, EndTag.END),
+    HR(BlockType.BLOCK, EndTag.NOEND),
+    HTML(BlockType.OTHER, EndTag.END),
+    I(BlockType.INLINE, EndTag.END),
+    IMG(BlockType.INLINE, EndTag.NOEND),
+    LI,
+    LINK(BlockType.OTHER, EndTag.NOEND),
+    MENU,
+    META(BlockType.OTHER, EndTag.NOEND),
+    NOFRAMES(BlockType.OTHER, EndTag.END),
+    NOSCRIPT(BlockType.OTHER, EndTag.END),
+    OL,
+    P,
+    PRE,
+    SCRIPT(BlockType.OTHER, EndTag.END),
+    SMALL(BlockType.INLINE, EndTag.END),
+    SPAN(BlockType.INLINE, EndTag.END),
+    STRONG(BlockType.INLINE, EndTag.END),
+    TABLE,
+    TBODY,
+    TD,
+    TH,
+    TITLE(BlockType.OTHER, EndTag.END),
+    TR,
+    TT(BlockType.INLINE, EndTag.END),
+    UL;
+
+    protected final BlockType blockType;
+    protected final EndTag endTag;
+    private final String value;
+
+    /**
+     * Enum representing the type of HTML element.
+     */
+    protected static enum BlockType {
+        BLOCK,
+        INLINE,
+        OTHER;
+    }
+
+    /**
+     * Enum representing HTML end tag requirement.
+     */
+    protected static enum EndTag {
+        END,
+        NOEND;
+    }
+
+    HtmlTag() {
+        this(BlockType.BLOCK, EndTag.END);
+    }
+
+    HtmlTag(BlockType blockType, EndTag endTag ) {
+        this.blockType = blockType;
+        this.endTag = endTag;
+        this.value = name().toLowerCase();
+    }
+
+    /**
+     * Returns true if the end tag is required. This is specific to the standard
+     * doclet and does not exactly resemble the W3C specifications.
+     *
+     * @return true if end tag needs to be displayed else return false
+     */
+    public boolean endTagRequired() {
+        return (endTag == EndTag.END);
+    }
+
+    public String toString() {
+        return value;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlTree.java	Mon Dec 20 21:10:57 2010 -0800
@@ -0,0 +1,777 @@
+/*
+ * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.tools.doclets.formats.html.markup;
+
+import java.util.*;
+import com.sun.tools.doclets.internal.toolkit.Content;
+import com.sun.tools.doclets.internal.toolkit.util.*;
+
+/**
+ * Class for generating HTML tree for javadoc output.
+ *
+ * @author Bhavesh Patel
+ */
+public class HtmlTree extends Content {
+
+    private HtmlTag htmlTag;
+    private Map<HtmlAttr,String> attrs = Collections.<HtmlAttr,String>emptyMap();
+    private List<Content> content = Collections.<Content>emptyList();
+    public static final Content EMPTY = new StringContent("");
+
+    /**
+     * Constructor to construct HtmlTree object.
+     *
+     * @param tag HTML tag for the HtmlTree object
+     */
+    public HtmlTree(HtmlTag tag) {
+        htmlTag = nullCheck(tag);
+    }
+
+    /**
+     * Constructor to construct HtmlTree object.
+     *
+     * @param tag HTML tag for the HtmlTree object
+     * @param contents contents to be added to the tree
+     */
+    public HtmlTree(HtmlTag tag, Content... contents) {
+        this(tag);
+        for (Content content: contents)
+            addContent(content);
+    }
+
+    /**
+     * Adds an attribute for the HTML tag.
+     *
+     * @param attrName name of the attribute
+     * @param attrValue value of the attribute
+     */
+    public void addAttr(HtmlAttr attrName, String attrValue) {
+        if (attrs.isEmpty())
+            attrs = new LinkedHashMap<HtmlAttr,String>();
+        attrs.put(nullCheck(attrName), nullCheck(attrValue));
+    }
+
+    /**
+     * Adds a style for the HTML tag.
+     *
+     * @param style style to be added
+     */
+    public void addStyle(HtmlStyle style) {
+        addAttr(HtmlAttr.CLASS, style.toString());
+    }
+
+    /**
+     * Adds content for the HTML tag.
+     *
+     * @param tagContent tag content to be added
+     */
+    public void addContent(Content tagContent) {
+        if (tagContent == HtmlTree.EMPTY || tagContent.isValid()) {
+            if (content.isEmpty())
+                content = new ArrayList<Content>();
+            content.add(tagContent);
+        }
+    }
+
+    /**
+     * This method adds a string content to the htmltree. If the last content member
+     * added is a StringContent, append the string to that StringContent or else
+     * create a new StringContent and add it to the html tree.
+     *
+     * @param stringContent string content that needs to be added
+     */
+    public void addContent(String stringContent) {
+        if (!content.isEmpty()) {
+            Content lastContent = content.get(content.size() - 1);
+            if (lastContent instanceof StringContent)
+                lastContent.addContent(stringContent);
+            else
+                addContent(new StringContent(stringContent));
+        }
+        else
+            addContent(new StringContent(stringContent));
+    }
+
+    /**
+     * Generates an HTML anchor tag.
+     *
+     * @param ref reference url for the anchor tag
+     * @param body content for the anchor tag
+     * @return an HtmlTree object
+     */
+    public static HtmlTree A(String ref, Content body) {
+        HtmlTree htmltree = new HtmlTree(HtmlTag.A, nullCheck(body));
+        htmltree.addAttr(HtmlAttr.HREF, nullCheck(ref));
+        return htmltree;
+    }
+
+    /**
+     * Generates an HTML anchor tag with name attribute and content.
+     *
+     * @param name name for the anchor tag
+     * @param body content for the anchor tag
+     * @return an HtmlTree object
+     */
+    public static HtmlTree A_NAME(String name, Content body) {
+        HtmlTree htmltree = HtmlTree.A_NAME(name);
+        htmltree.addContent(nullCheck(body));
+        return htmltree;
+    }
+
+    /**
+     * Generates an HTML anchor tag with name attribute.
+     *
+     * @param name name for the anchor tag
+     * @return an HtmlTree object
+     */
+    public static HtmlTree A_NAME(String name) {
+        HtmlTree htmltree = new HtmlTree(HtmlTag.A);
+        htmltree.addAttr(HtmlAttr.NAME, nullCheck(name));
+        return htmltree;
+    }
+
+    /**
+     * Generates a CAPTION tag with some content.
+     *
+     * @param body content for the tag
+     * @return an HtmlTree object for the CAPTION tag
+     */
+    public static HtmlTree CAPTION(Content body) {
+        HtmlTree htmltree = new HtmlTree(HtmlTag.CAPTION, nullCheck(body));
+        return htmltree;
+    }
+
+    /**
+     * Generates a CODE tag with some content.
+     *
+     * @param body content for the tag
+     * @return an HtmlTree object for the CODE tag
+     */
+    public static HtmlTree CODE(Content body) {
+        HtmlTree htmltree = new HtmlTree(HtmlTag.CODE, nullCheck(body));
+        return htmltree;
+    }
+
+    /**
+     * Generates a DD tag with some content.
+     *
+     * @param body content for the tag
+     * @return an HtmlTree object for the DD tag
+     */
+    public static HtmlTree DD(Content body) {
+        HtmlTree htmltree = new HtmlTree(HtmlTag.DD, nullCheck(body));
+        return htmltree;
+    }
+
+    /**
+     * Generates a DL tag with some content.
+     *
+     * @param body content for the tag
+     * @return an HtmlTree object for the DL tag
+     */
+    public static HtmlTree DL(Content body) {
+        HtmlTree htmltree = new HtmlTree(HtmlTag.DL, nullCheck(body));
+        return htmltree;
+    }
+
+    /**
+     * Generates a DIV tag with the style class attributes. It also encloses
+     * a content.
+     *
+     * @param styleClass stylesheet class for the tag
+     * @param body content for the tag
+     * @return an HtmlTree object for the DIV tag
+     */
+    public static HtmlTree DIV(HtmlStyle styleClass, Content body) {
+        HtmlTree htmltree = new HtmlTree(HtmlTag.DIV, nullCheck(body));
+        if (styleClass != null)
+            htmltree.addStyle(styleClass);
+        return htmltree;
+    }
+
+    /**
+     * Generates a DIV tag with some content.
+     *
+     * @param body content for the tag
+     * @return an HtmlTree object for the DIV tag
+     */
+    public static HtmlTree DIV(Content body) {
+        return DIV(null, body);
+    }
+
+    /**
+     * Generates a DT tag with some content.
+     *
+     * @param body content for the tag
+     * @return an HtmlTree object for the DT tag
+     */
+    public static HtmlTree DT(Content body) {
+        HtmlTree htmltree = new HtmlTree(HtmlTag.DT, nullCheck(body));
+        return htmltree;
+    }
+
+    /**
+     * Generates a EM tag with some content.
+     *
+     * @param body content to be added to the tag
+     * @return an HtmlTree object for the EM tag
+     */
+    public static HtmlTree EM(Content body) {
+        HtmlTree htmltree = new HtmlTree(HtmlTag.EM, nullCheck(body));
+        return htmltree;
+    }
+
+    /**
+     * Generates a FRAME tag.
+     *
+     * @param src the url of the document to be shown in the frame
+     * @param name specifies the name of the frame
+     * @param title the title for the frame
+     * @param scrolling specifies whether to display scrollbars in the frame
+     * @return an HtmlTree object for the FRAME tag
+     */
+    public static HtmlTree FRAME(String src, String name, String title, String scrolling) {
+        HtmlTree htmltree = new HtmlTree(HtmlTag.FRAME);
+        htmltree.addAttr(HtmlAttr.SRC, nullCheck(src));
+        htmltree.addAttr(HtmlAttr.NAME, nullCheck(name));
+        htmltree.addAttr(HtmlAttr.TITLE, nullCheck(title));
+        if (scrolling != null)
+            htmltree.addAttr(HtmlAttr.SCROLLING, scrolling);
+        return htmltree;
+    }
+
+    /**
+     * Generates a Frame tag.
+     *
+     * @param src the url of the document to be shown in the frame
+     * @param name specifies the name of the frame
+     * @param title the title for the frame
+     * @return an HtmlTree object for the SPAN tag
+     */
+    public static HtmlTree FRAME(String src, String name, String title) {
+        return FRAME(src, name, title, null);
+    }
+
+    /**
+     * Generates a FRAMESET tag.
+     *
+     * @param cols the size of columns in the frameset
+     * @param rows the size of rows in the frameset
+     * @param title the title for the frameset
+     * @param onload the script to run when the document loads
+     * @return an HtmlTree object for the FRAMESET tag
+     */
+    public static HtmlTree FRAMESET(String cols, String rows, String title, String onload) {
+        HtmlTree htmltree = new HtmlTree(HtmlTag.FRAMESET);
+        if (cols != null)
+            htmltree.addAttr(HtmlAttr.COLS, cols);
+        if (rows != null)
+            htmltree.addAttr(HtmlAttr.ROWS, rows);
+        htmltree.addAttr(HtmlAttr.TITLE, nullCheck(title));
+        htmltree.addAttr(HtmlAttr.ONLOAD, nullCheck(onload));
+        return htmltree;
+    }
+
+    /**
+     * Generates a heading tag (h1 to h6) with the title and style class attributes. It also encloses
+     * a content.
+     *
+     * @param headingTag the heading tag to be generated
+     * @param printTitle true if title for the tag needs to be printed else false
+     * @param styleClass stylesheet class for the tag
+     * @param body content for the tag
+     * @return an HtmlTree object for the tag
+     */
+    public static HtmlTree HEADING(HtmlTag headingTag, boolean printTitle,
+            HtmlStyle styleClass, Content body) {
+        HtmlTree htmltree = new HtmlTree(headingTag, nullCheck(body));
+        if (printTitle)
+            htmltree.addAttr(HtmlAttr.TITLE, Util.stripHtml(body.toString()));
+        if (styleClass != null)
+            htmltree.addStyle(styleClass);
+        return htmltree;
+    }
+
+    /**
+     * Generates a heading tag (h1 to h6) with style class attribute. It also encloses
+     * a content.
+     *
+     * @param headingTag the heading tag to be generated
+     * @param styleClass stylesheet class for the tag
+     * @param body content for the tag
+     * @return an HtmlTree object for the tag
+     */
+    public static HtmlTree HEADING(HtmlTag headingTag, HtmlStyle styleClass, Content body) {
+        return HEADING(headingTag, false, styleClass, body);
+    }
+
+    /**
+     * Generates a heading tag (h1 to h6) with the title attribute. It also encloses
+     * a content.
+     *
+     * @param headingTag the heading tag to be generated
+     * @param printTitle true if the title for the tag needs to be printed else false
+     * @param body content for the tag
+     * @return an HtmlTree object for the tag
+     */
+    public static HtmlTree HEADING(HtmlTag headingTag, boolean printTitle, Content body) {
+        return HEADING(headingTag, printTitle, null, body);
+    }
+
+    /**
+     * Generates a heading tag (h1 to h6)  with some content.
+     *
+     * @param headingTag the heading tag to be generated
+     * @param body content for the tag
+     * @return an HtmlTree object for the tag
+     */
+    public static HtmlTree HEADING(HtmlTag headingTag, Content body) {
+        return HEADING(headingTag, false, null, body);
+    }
+
+    /**
+     * Generates an HTML tag with lang attribute. It also adds head and body
+     * content to the HTML tree.
+     *
+     * @param lang language for the HTML document
+     * @param head head for the HTML tag
+     * @param body body for the HTML tag
+     * @return an HtmlTree object for the HTML tag
+     */
+    public static HtmlTree HTML(String lang, Content head, Content body) {
+        HtmlTree htmltree = new HtmlTree(HtmlTag.HTML, nullCheck(head), nullCheck(body));
+        htmltree.addAttr(HtmlAttr.LANG, nullCheck(lang));
+        return htmltree;
+    }
+
+    /**
+     * Generates a I tag with some content.
+     *
+     * @param body content for the tag
+     * @return an HtmlTree object for the I tag
+     */
+    public static HtmlTree I(Content body) {
+        HtmlTree htmltree = new HtmlTree(HtmlTag.I, nullCheck(body));
+        return htmltree;
+    }
+
+    /**
+     * Generates a LI tag with some content.
+     *
+     * @param body content for the tag
+     * @return an HtmlTree object for the LI tag
+     */
+    public static HtmlTree LI(Content body) {
+        return LI(null, body);
+    }
+
+    /**
+     * Generates a LI tag with some content.
+     *
+     * @param styleClass style for the tag
+     * @param body content for the tag
+     * @return an HtmlTree object for the LI tag
+     */
+    public static HtmlTree LI(HtmlStyle styleClass, Content body) {
+        HtmlTree htmltree = new HtmlTree(HtmlTag.LI, nullCheck(body));
+        if (styleClass != null)
+            htmltree.addStyle(styleClass);
+        return htmltree;
+    }
+
+    /**
+     * Generates a LINK tag with the rel, type, href and title attributes.
+     *
+     * @param rel relevance of the link
+     * @param type type of link
+     * @param href the path for the link
+     * @param title title for the link
+     * @return an HtmlTree object for the LINK tag
+     */
+    public static HtmlTree LINK(String rel, String type, String href, String title) {
+        HtmlTree htmltree = new HtmlTree(HtmlTag.LINK);
+        htmltree.addAttr(HtmlAttr.REL, nullCheck(rel));
+        htmltree.addAttr(HtmlAttr.TYPE, nullCheck(type));
+        htmltree.addAttr(HtmlAttr.HREF, nullCheck(href));
+        htmltree.addAttr(HtmlAttr.TITLE, nullCheck(title));
+        return htmltree;
+    }
+
+    /**
+     * Generates a META tag with the http-equiv, content and charset attributes.
+     *
+     * @param http-equiv http equiv attribute for the META tag
+     * @param content type of content
+     * @param charset character set used
+     * @return an HtmlTree object for the META tag
+     */
+    public static HtmlTree META(String httpEquiv, String content, String charSet) {
+        HtmlTree htmltree = new HtmlTree(HtmlTag.META);
+        htmltree.addAttr(HtmlAttr.HTTP_EQUIV, nullCheck(httpEquiv));
+        htmltree.addAttr(HtmlAttr.CONTENT, nullCheck(content));
+        htmltree.addAttr(HtmlAttr.CHARSET, nullCheck(charSet));
+        return htmltree;
+    }
+
+    /**
+     * Generates a META tag with the name and content attributes.
+     *
+     * @param name name attribute
+     * @param content type of content
+     * @return an HtmlTree object for the META tag
+     */
+    public static HtmlTree META(String name, String content) {
+        HtmlTree htmltree = new HtmlTree(HtmlTag.META);
+        htmltree.addAttr(HtmlAttr.NAME, nullCheck(name));
+        htmltree.addAttr(HtmlAttr.CONTENT, nullCheck(content));
+        return htmltree;
+    }
+
+    /**
+     * Generates a NOSCRIPT tag with some content.
+     *
+     * @param body content of the noscript tag
+     * @return an HtmlTree object for the NOSCRIPT tag
+     */
+    public static HtmlTree NOSCRIPT(Content body) {
+        HtmlTree htmltree = new HtmlTree(HtmlTag.NOSCRIPT, nullCheck(body));
+        return htmltree;
+    }
+
+    /**
+     * Generates a P tag with some content.
+     *
+     * @param body content of the Paragraph tag
+     * @return an HtmlTree object for the P tag
+     */
+    public static HtmlTree P(Content body) {
+        return P(null, body);
+    }
+
+    /**
+     * Generates a P tag with some content.
+     *
+     * @param styleClass style of the Paragraph tag
+     * @param body content of the Paragraph tag
+     * @return an HtmlTree object for the P tag
+     */
+    public static HtmlTree P(HtmlStyle styleClass, Content body) {
+        HtmlTree htmltree = new HtmlTree(HtmlTag.P, nullCheck(body));
+        if (styleClass != null)
+            htmltree.addStyle(styleClass);
+        return htmltree;
+    }
+
+    /**
+     * Generates a SMALL tag with some content.
+     *
+     * @param body content for the tag
+     * @return an HtmlTree object for the SMALL tag
+     */
+    public static HtmlTree SMALL(Content body) {
+        HtmlTree htmltree = new HtmlTree(HtmlTag.SMALL, nullCheck(body));
+        return htmltree;
+    }
+
+    /**
+     * Generates a STRONG tag with some content.
+     *
+     * @param body content for the tag
+     * @return an HtmlTree object for the STRONG tag
+     */
+    public static HtmlTree STRONG(Content body) {
+        HtmlTree htmltree = new HtmlTree(HtmlTag.STRONG, nullCheck(body));
+        return htmltree;
+    }
+
+    /**
+     * Generates a SPAN tag with some content.
+     *
+     * @param body content for the tag
+     * @return an HtmlTree object for the SPAN tag
+     */
+    public static HtmlTree SPAN(Content body) {
+        return SPAN(null, body);
+    }
+
+    /**
+     * Generates a SPAN tag with style class attribute and some content.
+     *
+     * @param styleClass style class for the tag
+     * @param body content for the tag
+     * @return an HtmlTree object for the SPAN tag
+     */
+    public static HtmlTree SPAN(HtmlStyle styleClass, Content body) {
+        HtmlTree htmltree = new HtmlTree(HtmlTag.SPAN, nullCheck(body));
+        if (styleClass != null)
+            htmltree.addStyle(styleClass);
+        return htmltree;
+    }
+
+    /**
+     * Generates a Table tag with border, width and summary attributes and
+     * some content.
+     *
+     * @param border border for the table
+     * @param width width of the table
+     * @param summary summary for the table
+     * @param body content for the table
+     * @return an HtmlTree object for the TABLE tag
+     */
+    public static HtmlTree TABLE(int border, int width, String summary,
+            Content body) {
+        HtmlTree htmltree = new HtmlTree(HtmlTag.TABLE, nullCheck(body));
+        htmltree.addAttr(HtmlAttr.BORDER, Integer.toString(border));
+        htmltree.addAttr(HtmlAttr.WIDTH, Integer.toString(width));
+        htmltree.addAttr(HtmlAttr.SUMMARY, nullCheck(summary));
+        return htmltree;
+    }
+
+    /**
+     * Generates a Table tag with style class, border, cell padding,
+     * cellspacing and summary attributes and some content.
+     *
+     * @param styleClass style of the table
+     * @param border border for the table
+     * @param cellPadding cell padding for the table
+     * @param cellSpacing cell spacing for the table
+     * @param summary summary for the table
+     * @param body content for the table
+     * @return an HtmlTree object for the TABLE tag
+     */
+    public static HtmlTree TABLE(HtmlStyle styleClass, int border, int cellPadding,
+            int cellSpacing, String summary, Content body) {
+        HtmlTree htmltree = new HtmlTree(HtmlTag.TABLE, nullCheck(body));
+        if (styleClass != null)
+            htmltree.addStyle(styleClass);
+        htmltree.addAttr(HtmlAttr.BORDER, Integer.toString(border));
+        htmltree.addAttr(HtmlAttr.CELLPADDING, Integer.toString(cellPadding));
+        htmltree.addAttr(HtmlAttr.CELLSPACING, Integer.toString(cellSpacing));
+        htmltree.addAttr(HtmlAttr.SUMMARY, nullCheck(summary));
+        return htmltree;
+    }
+
+    /**
+     * Generates a Table tag with border, cell padding,
+     * cellspacing and summary attributes and some content.
+     *
+     * @param border border for the table
+     * @param cellPadding cell padding for the table
+     * @param cellSpacing cell spacing for the table
+     * @param summary summary for the table
+     * @param body content for the table
+     * @return an HtmlTree object for the TABLE tag
+     */
+    public static HtmlTree TABLE(int border, int cellPadding,
+            int cellSpacing, String summary, Content body) {
+        return TABLE(null, border, cellPadding, cellSpacing, summary, body);
+    }
+
+    /**
+     * Generates a TD tag with style class attribute and some content.
+     *
+     * @param styleClass style for the tag
+     * @param body content for the tag
+     * @return an HtmlTree object for the TD tag
+     */
+    public static HtmlTree TD(HtmlStyle styleClass, Content body) {
+        HtmlTree htmltree = new HtmlTree(HtmlTag.TD, nullCheck(body));
+        if (styleClass != null)
+            htmltree.addStyle(styleClass);
+        return htmltree;
+    }
+
+    /**
+     * Generates a TD tag for an HTML table with some content.
+     *
+     * @param body content for the tag
+     * @return an HtmlTree object for the TD tag
+     */
+    public static HtmlTree TD(Content body) {
+        return TD(null, body);
+    }
+
+    /**
+     * Generates a TH tag with style class and scope attributes and some content.
+     *
+     * @param styleClass style for the tag
+     * @param scope scope of the tag
+     * @param body content for the tag
+     * @return an HtmlTree object for the TH tag
+     */
+    public static HtmlTree TH(HtmlStyle styleClass, String scope, Content body) {
+        HtmlTree htmltree = new HtmlTree(HtmlTag.TH, nullCheck(body));
+        if (styleClass != null)
+            htmltree.addStyle(styleClass);
+        htmltree.addAttr(HtmlAttr.SCOPE, nullCheck(scope));
+        return htmltree;
+    }
+
+    /**
+     * Generates a TH tag with scope attribute and some content.
+     *
+     * @param scope scope of the tag
+     * @param body content for the tag
+     * @return an HtmlTree object for the TH tag
+     */
+    public static HtmlTree TH(String scope, Content body) {
+        return TH(null, scope, body);
+    }
+
+    /**
+     * Generates a TITLE tag with some content.
+     *
+     * @param body content for the tag
+     * @return an HtmlTree object for the TITLE tag
+     */
+    public static HtmlTree TITLE(Content body) {
+        HtmlTree htmltree = new HtmlTree(HtmlTag.TITLE, nullCheck(body));
+        return htmltree;
+    }
+
+    /**
+     * Generates a TR tag for an HTML table with some content.
+     *
+     * @param body content for the tag
+     * @return an HtmlTree object for the TR tag
+     */
+    public static HtmlTree TR(Content body) {
+        HtmlTree htmltree = new HtmlTree(HtmlTag.TR, nullCheck(body));
+        return htmltree;
+    }
+
+    /**
+     * Generates a UL tag with the style class attribute and some content.
+     *
+     * @param styleClass style for the tag
+     * @param body content for the tag
+     * @return an HtmlTree object for the UL tag
+     */
+    public static HtmlTree UL(HtmlStyle styleClass, Content body) {
+        HtmlTree htmltree = new HtmlTree(HtmlTag.UL, nullCheck(body));
+        htmltree.addStyle(nullCheck(styleClass));
+        return htmltree;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public boolean isEmpty() {
+        return (!hasContent() && !hasAttrs());
+    }
+
+    /**
+     * Returns true if the HTML tree has content.
+     *
+     * @return true if the HTML tree has content else return false
+     */
+    public boolean hasContent() {
+        return (!content.isEmpty());
+    }
+
+    /**
+     * Returns true if the HTML tree has attributes.
+     *
+     * @return true if the HTML tree has attributes else return false
+     */
+    public boolean hasAttrs() {
+        return (!attrs.isEmpty());
+    }
+
+    /**
+     * Returns true if the HTML tree has a specific attribute.
+     *
+     * @param attrName name of the attribute to check within the HTML tree
+     * @return true if the HTML tree has the specified attribute else return false
+     */
+    public boolean hasAttr(HtmlAttr attrName) {
+        return (attrs.containsKey(attrName));
+    }
+
+    /**
+     * Returns true if the HTML tree is valid. This check is more specific to
+     * standard doclet and not exactly similar to W3C specifications. But it
+     * ensures HTML validation.
+     *
+     * @return true if the HTML tree is valid
+     */
+    public boolean isValid() {
+        switch (htmlTag) {
+            case A :
+                return (hasAttr(HtmlAttr.NAME) || (hasAttr(HtmlAttr.HREF) && hasContent()));
+            case BR :
+                return (!hasContent() && (!hasAttrs() || hasAttr(HtmlAttr.CLEAR)));
+            case FRAME :
+                return (hasAttr(HtmlAttr.SRC) && !hasContent());
+            case HR :
+                return (!hasContent());
+            case IMG :
+                return (hasAttr(HtmlAttr.SRC) && hasAttr(HtmlAttr.ALT) && !hasContent());
+            case LINK :
+                return (hasAttr(HtmlAttr.HREF) && !hasContent());
+            case META :
+                return (hasAttr(HtmlAttr.CONTENT) && !hasContent());
+            default :
+                return hasContent();
+        }
+    }
+
+    /**
+     * Returns true if the element is an inline element.
+     *
+     * @return true if the HTML tag is an inline element
+     */
+    public boolean isInline() {
+        return (htmlTag.blockType == HtmlTag.BlockType.INLINE);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public void write(StringBuilder contentBuilder) {
+        if (!isInline() && !endsWithNewLine(contentBuilder))
+            contentBuilder.append(DocletConstants.NL);
+        String tagString = htmlTag.toString();
+        contentBuilder.append("<" + tagString);
+        Iterator<HtmlAttr> iterator = attrs.keySet().iterator();
+        HtmlAttr key;
+        String value = "";
+        while (iterator.hasNext()) {
+            key = iterator.next();
+            value = attrs.get(key);
+            contentBuilder.append(" " + key.toString());
+            if (!value.isEmpty())
+                contentBuilder.append("=\"" + value + "\"");
+        }
+        contentBuilder.append(">");
+        for (Content c : content)
+            c.write(contentBuilder);
+        if (htmlTag.endTagRequired())
+            contentBuilder.append("</" + tagString + ">");
+        if (!isInline())
+            contentBuilder.append(DocletConstants.NL);
+    }
+}
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlWriter.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlWriter.java	Mon Dec 20 21:10:57 2010 -0800
@@ -55,7 +55,7 @@
      * URL file separator string("/").
      */
     public static final String fileseparator =
-         DirectoryManager.URL_FILE_SEPERATOR;
+         DirectoryManager.URL_FILE_SEPARATOR;
 
     /**
      * The configuration
@@ -82,6 +82,72 @@
      */
     protected final String modifierTypeHeader;
 
+    public final Content overviewLabel;
+
+    public final Content defaultPackageLabel;
+
+    public final Content packageLabel;
+
+    public final Content useLabel;
+
+    public final Content prevLabel;
+
+    public final Content nextLabel;
+
+    public final Content prevclassLabel;
+
+    public final Content nextclassLabel;
+
+    public final Content summaryLabel;
+
+    public final Content detailLabel;
+
+    public final Content framesLabel;
+
+    public final Content noframesLabel;
+
+    public final Content treeLabel;
+
+    public final Content classLabel;
+
+    public final Content deprecatedLabel;
+
+    public final Content deprecatedPhrase;
+
+    public final Content allclassesLabel;
+
+    public final Content indexLabel;
+
+    public final Content helpLabel;
+
+    public final Content seeLabel;
+
+    public final Content descriptionLabel;
+
+    public final Content prevpackageLabel;
+
+    public final Content nextpackageLabel;
+
+    public final Content packagesLabel;
+
+    public final Content methodDetailsLabel;
+
+    public final Content annotationTypeDetailsLabel;
+
+    public final Content fieldDetailsLabel;
+
+    public final Content constructorDetailsLabel;
+
+    public final Content enumConstantsDetailsLabel;
+
+    public final Content specifiedByLabel;
+
+    public final Content overridesLabel;
+
+    public final Content descfrmClassLabel;
+
+    public final Content descfrmInterfaceLabel;
+
     /**
      * Constructor.
      *
@@ -111,6 +177,73 @@
         modifierTypeHeader = configuration.getText("doclet.0_and_1",
                 configuration.getText("doclet.Modifier"),
                 configuration.getText("doclet.Type"));
+        overviewLabel = getResource("doclet.Overview");
+        defaultPackageLabel = new RawHtml(
+                DocletConstants.DEFAULT_PACKAGE_NAME);
+        packageLabel = getResource("doclet.Package");
+        useLabel = getResource("doclet.navClassUse");
+        prevLabel = getResource("doclet.Prev");
+        nextLabel = getResource("doclet.Next");
+        prevclassLabel = getResource("doclet.Prev_Class");
+        nextclassLabel = getResource("doclet.Next_Class");
+        summaryLabel = getResource("doclet.Summary");
+        detailLabel = getResource("doclet.Detail");
+        framesLabel = getResource("doclet.FRAMES");
+        noframesLabel = getResource("doclet.NO_FRAMES");
+        treeLabel = getResource("doclet.Tree");
+        classLabel = getResource("doclet.Class");
+        deprecatedLabel = getResource("doclet.navDeprecated");
+        deprecatedPhrase = getResource("doclet.Deprecated");
+        allclassesLabel = getResource("doclet.All_Classes");
+        indexLabel = getResource("doclet.Index");
+        helpLabel = getResource("doclet.Help");
+        seeLabel = getResource("doclet.See");
+        descriptionLabel = getResource("doclet.Description");
+        prevpackageLabel = getResource("doclet.Prev_Package");
+        nextpackageLabel = getResource("doclet.Next_Package");
+        packagesLabel = getResource("doclet.Packages");
+        methodDetailsLabel = getResource("doclet.Method_Detail");
+        annotationTypeDetailsLabel = getResource("doclet.Annotation_Type_Member_Detail");
+        fieldDetailsLabel = getResource("doclet.Field_Detail");
+        constructorDetailsLabel = getResource("doclet.Constructor_Detail");
+        enumConstantsDetailsLabel = getResource("doclet.Enum_Constant_Detail");
+        specifiedByLabel = getResource("doclet.Specified_By");
+        overridesLabel = getResource("doclet.Overrides");
+        descfrmClassLabel = getResource("doclet.Description_From_Class");
+        descfrmInterfaceLabel = getResource("doclet.Description_From_Interface");
+    }
+
+    /**
+     * Get the configuration string as a content.
+     *
+     * @param key the key to look for in the configuration file
+     * @return a content tree for the text
+     */
+    public Content getResource(String key) {
+        return new StringContent(configuration.getText(key));
+    }
+
+    /**
+     * Get the configuration string as a content.
+     *
+     * @param key the key to look for in the configuration file
+     * @param a1 string argument added to configuration text
+     * @return a content tree for the text
+     */
+    public Content getResource(String key, String a1) {
+        return new RawHtml(configuration.getText(key, a1));
+    }
+
+    /**
+     * Get the configuration string as a content.
+     *
+     * @param key the key to look for in the configuration file
+     * @param a1 string argument added to configuration text
+     * @param a2 string argument added to configuration text
+     * @return a content tree for the text
+     */
+    public Content getResource(String key, String a1, String a2) {
+        return new RawHtml(configuration.getText(key, a1, a2));
     }
 
     /**
@@ -146,6 +279,48 @@
     }
 
     /**
+     * Returns an HtmlTree for the SCRIPT tag.
+     *
+     * @return an HtmlTree for the SCRIPT tag
+     */
+    protected HtmlTree getWinTitleScript(){
+        HtmlTree script = new HtmlTree(HtmlTag.SCRIPT);
+        if(winTitle != null && winTitle.length() > 0) {
+            script.addAttr(HtmlAttr.TYPE, "text/javascript");
+            String scriptCode = "<!--" + DocletConstants.NL +
+                    "    if (location.href.indexOf('is-external=true') == -1) {" + DocletConstants.NL +
+                    "        parent.document.title=\"" + winTitle + "\";" + DocletConstants.NL +
+                    "    }" + DocletConstants.NL +
+                    "//-->" + DocletConstants.NL;
+            RawHtml scriptContent = new RawHtml(scriptCode);
+            script.addContent(scriptContent);
+        }
+        return script;
+    }
+
+    /**
+     * Returns a content tree for the SCRIPT tag for the main page(index.html).
+     *
+     * @return a content for the SCRIPT tag
+     */
+    protected Content getFramesetJavaScript(){
+        HtmlTree script = new HtmlTree(HtmlTag.SCRIPT);
+        script.addAttr(HtmlAttr.TYPE, "text/javascript");
+        String scriptCode = DocletConstants.NL + "    targetPage = \"\" + window.location.search;" + DocletConstants.NL +
+                "    if (targetPage != \"\" && targetPage != \"undefined\")" + DocletConstants.NL +
+                "        targetPage = targetPage.substring(1);" + DocletConstants.NL +
+                "    if (targetPage.indexOf(\":\") != -1)" + DocletConstants.NL +
+                "        targetPage = \"undefined\";" + DocletConstants.NL +
+                "    function loadFrames() {" + DocletConstants.NL +
+                "        if (targetPage != \"\" && targetPage != \"undefined\")" + DocletConstants.NL +
+                "             top.classFrame.location = top.targetPage;" + DocletConstants.NL +
+                "    }" + DocletConstants.NL;
+        RawHtml scriptContent = new RawHtml(scriptCode);
+        script.addContent(scriptContent);
+        return script;
+    }
+
+    /**
      * Print the Javascript &lt;SCRIPT&gt; start tag with its type
      * attribute.
      */
@@ -204,6 +379,28 @@
     }
 
     /**
+     * Returns an HtmlTree for the BODY tag.
+     *
+     * @param includeScript  set true if printing windowtitle script
+     * @param title title for the window
+     * @return an HtmlTree for the BODY tag
+     */
+    public HtmlTree getBody(boolean includeScript, String title) {
+        HtmlTree body = new HtmlTree(HtmlTag.BODY);
+        // Set window title string which is later printed
+        this.winTitle = title;
+        // Don't print windowtitle script for overview-frame, allclasses-frame
+        // and package-frame
+        if (includeScript) {
+            body.addContent(getWinTitleScript());
+            Content noScript = HtmlTree.NOSCRIPT(
+                    HtmlTree.DIV(getResource("doclet.No_Script_Message")));
+            body.addContent(noScript);
+        }
+        return body;
+    }
+
+    /**
      * Print &lt;/BODY&gt; tag. Add a newline character at the end.
      */
     public void bodyEnd() {
@@ -228,6 +425,15 @@
         title();
     }
 
+    /**
+     * Returns an HtmlTree for the TITLE tag.
+     *
+     * @return an HtmlTree for the TITLE tag
+     */
+    public HtmlTree getTitle() {
+        HtmlTree title = HtmlTree.TITLE(new StringContent(winTitle));
+        return title;
+    }
 
     /**
      * Print &lt;/TITLE&gt; tag. Add a newline character at the end.
@@ -519,17 +725,17 @@
     }
 
     /**
-     * Return, text passed, with Italics &lt;I&gt; and &lt;/I&gt; tags, surrounding it.
-     * So if the text passed is "Hi", then string returned will be "&lt;I&gt;Hi&lt;/I&gt;".
+     * Return, text passed, with Italics &lt;i&gt; and &lt;/i&gt; tags, surrounding it.
+     * So if the text passed is "Hi", then string returned will be "&lt;i&gt;Hi&lt;/i&gt;".
      *
      * @param text String to be printed in between &lt;I&gt; and &lt;/I&gt; tags.
      */
     public String italicsText(String text) {
-        return "<I>" + text + "</I>";
+        return "<i>" + text + "</i>";
     }
 
     public String codeText(String text) {
-        return "<CODE>" + text + "</CODE>";
+        return "<code>" + text + "</code>";
     }
 
     /**
@@ -540,6 +746,13 @@
     }
 
     /**
+     * Return "&#38;nbsp;", non-breaking space.
+     */
+    public Content getSpace() {
+        return RawHtml.nbsp;
+    }
+
+    /**
      * Print &lt;DL&gt; tag. Add a newline character at the end.
      */
     public void dl() {
@@ -1182,21 +1395,21 @@
     }
 
     /**
-     * Get the "&lt;CODE&gt;" string.
+     * Get the "&lt;code&gt;" string.
      *
-     * @return String Return String "&lt;CODE>";
+     * @return String Return String "&lt;code&gt;";
      */
     public String getCode() {
-        return "<CODE>";
+        return "<code>";
     }
 
     /**
-     * Get the "&lt;/CODE&gt;" string.
+     * Get the "&lt;/code&gt;" string.
      *
-     * @return String Return String "&lt;/CODE&gt;";
+     * @return String Return String "&lt;/code&gt;";
      */
     public String getCodeEnd() {
-        return "</CODE>";
+        return "</code>";
     }
 
     /**
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/RawHtml.java	Mon Dec 20 21:10:57 2010 -0800
@@ -0,0 +1,88 @@
+/*
+ * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.tools.doclets.formats.html.markup;
+
+import com.sun.tools.doclets.internal.toolkit.Content;
+import com.sun.tools.doclets.internal.toolkit.util.*;
+
+/**
+ * Class for generating raw HTML content to be added to HTML pages of javadoc output.
+ *
+ * @author Bhavesh Patel
+ */
+public class RawHtml extends Content{
+
+    private String rawHtmlContent;
+
+    public static final Content nbsp = new RawHtml("&nbsp;");
+
+    /**
+     * Constructor to construct a RawHtml object.
+     *
+     * @param rawHtml raw HTML text to be added
+     */
+    public RawHtml(String rawHtml) {
+        rawHtmlContent = nullCheck(rawHtml);
+    }
+
+    /**
+     * This method is not supported by the class.
+     *
+     * @param content content that needs to be added
+     * @throws DocletAbortException this method will always throw a
+     *                              DocletAbortException because it
+     *                              is not supported.
+     */
+    public void addContent(Content content) {
+        throw new DocletAbortException();
+    }
+
+    /**
+     * This method is not supported by the class.
+     *
+     * @param stringContent string content that needs to be added
+     * @throws DocletAbortException this method will always throw a
+     *                              DocletAbortException because it
+     *                              is not supported.
+     */
+    public void addContent(String stringContent) {
+        throw new DocletAbortException();
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public boolean isEmpty() {
+        return rawHtmlContent.isEmpty();
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public void write(StringBuilder contentBuilder) {
+        contentBuilder.append(rawHtmlContent);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/StringContent.java	Mon Dec 20 21:10:57 2010 -0800
@@ -0,0 +1,99 @@
+/*
+ * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.tools.doclets.formats.html.markup;
+
+import com.sun.tools.doclets.internal.toolkit.Content;
+import com.sun.tools.doclets.internal.toolkit.util.*;
+
+/**
+ * Class for generating string content for HTML tags of javadoc output.
+ *
+ * @author Bhavesh Patel
+ */
+public class StringContent extends Content{
+
+    private StringBuilder stringContent;
+
+    /**
+     * Constructor to construct StringContent object.
+     */
+    public StringContent() {
+        stringContent = new StringBuilder();
+    }
+
+    /**
+     * Constructor to construct StringContent object with some initial content.
+     *
+     * @param initialContent initial content for the object
+     */
+    public StringContent(String initialContent) {
+        stringContent = new StringBuilder(
+                Util.escapeHtmlChars(nullCheck(initialContent)));
+    }
+
+    /**
+     * This method is not supported by the class.
+     *
+     * @param content content that needs to be added
+     * @throws DocletAbortException this method will always throw a
+     *                              DocletAbortException because it
+     *                              is not supported.
+     */
+    public void addContent(Content content) {
+        throw new DocletAbortException();
+    }
+
+    /**
+     * Adds content for the StringContent object.  The method escapes
+     * HTML characters for the string content that is added.
+     *
+     * @param strContent string content to be added
+     */
+    public void addContent(String strContent) {
+        stringContent.append(Util.escapeHtmlChars(nullCheck(strContent)));
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public boolean isEmpty() {
+        return (stringContent.length() == 0);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public String toString() {
+        return stringContent.toString();
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public void write(StringBuilder contentBuilder) {
+        contentBuilder.append(stringContent);
+    }
+}
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/resources/standard.properties	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/resources/standard.properties	Mon Dec 20 21:10:57 2010 -0800
@@ -43,6 +43,7 @@
 doclet.Window_Split_Index={0}-Index
 doclet.Help=Help
 doclet.Skip_navigation_links=Skip navigation links
+doclet.New_Page=NewPage
 doclet.None=None
 doclet.CLASSES=CLASSES
 doclet.MEMBERS=MEMBERS
@@ -53,7 +54,7 @@
 doclet.Window_Deprecated_List=Deprecated List
 doclet.Note_0_is_deprecated=Note: {0} is deprecated.
 doclet.Overrides=Overrides:
-doclet.in_class={0} in class {1}
+doclet.in_class=in class
 doclet.0_Fields_and_Methods=&quot;{0}&quot; Fields and Methods
 doclet.Index_of_Fields_and_Methods=Index of Fields and Methods
 doclet.Static_variable_in=Static variable in {0}
@@ -103,7 +104,7 @@
 doclet.Package_Description=Package {0} Description
 doclet.Description=Description
 doclet.Specified_By=Specified by:
-doclet.in_interface={0} in interface {1}
+doclet.in_interface=in interface
 doclet.Subclasses=Direct Known Subclasses:
 doclet.Subinterfaces=All Known Subinterfaces:
 doclet.Implementing_Classes=All Known Implementing Classes:
@@ -121,18 +122,20 @@
 doclet.Frame_Alert=Frame Alert
 doclet.Overview-Member-Frame=Overview Member Frame
 doclet.Frame_Warning_Message=This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client.
+doclet.No_Script_Message=JavaScript is disabled on your browser.
 doclet.Non_Frame_Version=Non-frame version.
 doclet.Frame_Version=Frame version
 doclet.Link_To=Link to
 doclet.Following_From_Class=Following copied from class: {0}
 doclet.Following_From_Interface=Following copied from interface: {0}
-doclet.Description_From_Interface=Description copied from interface: {0}
-doclet.Description_From_Class=Description copied from class: {0}
+doclet.Description_From_Interface=Description copied from interface:
+doclet.Description_From_Class=Description copied from class:
 doclet.Standard_doclet_invoked=Standard doclet invoked...
 doclet.No_Non_Deprecated_Classes_To_Document=No non-deprecated classes found to document.
 doclet.Interfaces_Italic=Interfaces (italic)
 doclet.Enclosing_Class=Enclosing class:
 doclet.Enclosing_Interface=Enclosing interface:
+doclet.Window_Source_title=Source code
 doclet.Help_title=API Help
 doclet.Window_Help_title=API Help
 doclet.Help_line_1=How This API Document Is Organized
--- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/AnnotationTypeOptionalMemberWriter.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/AnnotationTypeOptionalMemberWriter.java	Mon Dec 20 21:10:57 2010 -0800
@@ -35,14 +35,18 @@
  * Do not use it as an API
  *
  * @author Jamie Ho
+ * @author Bhavesh Patel (Modified)
  * @since 1.5
  */
 
 public interface AnnotationTypeOptionalMemberWriter extends
-    AnnotationTypeRequiredMemberWriter {
+        AnnotationTypeRequiredMemberWriter {
 
     /**
-     * Write the default value documentation.
+     * Add the the default value documentation.
+     *
+     * @param member the member being documented
+     * @param annotationDocTree content tree to which the default value will be added
      */
-    public void writeDefaultValueInfo(MemberDoc member);
+    public void addDefaultValueInfo(MemberDoc member, Content annotationDocTree);
 }
--- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/AnnotationTypeRequiredMemberWriter.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/AnnotationTypeRequiredMemberWriter.java	Mon Dec 20 21:10:57 2010 -0800
@@ -36,67 +36,79 @@
  * Do not use it as an API
  *
  * @author Jamie Ho
+ * @author Bhavesh Patel (Modified)
  * @since 1.5
  */
 
 public interface AnnotationTypeRequiredMemberWriter {
 
     /**
-     * Write the header for the member documentation.
+     * Add the annotation type details tree header.
      *
-     * @param classDoc the annotation type that the members belong to.
-     * @param header the header to write.
+     * @param classDoc the annotation type being documented
+     * @param memberDetailsTree the content tree representing member details
      */
-    public void writeHeader(ClassDoc classDoc, String header);
+    public void addAnnotationDetailsTreeHeader(ClassDoc classDoc,
+            Content memberDetailsTree);
 
     /**
-     * Write the member header for the given member.
+     * Get the annotation type documentation tree header.
      *
-     * @param member the member being documented.
-     * @param isFirst the flag to indicate whether or not the member is
-     *                the first to be documented.
+     * @param member the annotation type being documented
+     * @param annotationDetailsTree the content tree representing annotation type details
+     * @return content tree for the annotation type documentation header
      */
-    public void writeMemberHeader(MemberDoc member, boolean isFirst);
+    public Content getAnnotationDocTreeHeader(MemberDoc member,
+            Content annotationDetailsTree);
 
     /**
-     * Write the signature for the given member.
+     * Get the annotation type details tree.
      *
-     * @param member the member being documented.
+     * @param annotationDetailsTree the content tree representing annotation type details
+     * @return content tree for the annotation type details
      */
-    public void writeSignature(MemberDoc member);
+    public Content getAnnotationDetails(Content annotationDetailsTree);
 
     /**
-     * Write the deprecated output for the given member.
+     * Get the annotation type documentation.
      *
-     * @param member the member being documented.
+     * @param annotationDocTree the content tree representing annotation type documentation
+     * @param isLastContent true if the content to be added is the last content
+     * @return content tree for the annotation type documentation
      */
-    public void writeDeprecated(MemberDoc member);
+    public Content getAnnotationDoc(Content annotationDocTree, boolean isLastContent);
 
     /**
-     * Write the comments for the given member.
+     * Get the signature for the given member.
      *
-     * @param member the member being documented.
+     * @param member the member being documented
+     * @return content tree for the annotation type signature
      */
-    public void writeComments(MemberDoc member);
+    public Content getSignature(MemberDoc member);
 
     /**
-     * Write the tag output for the given member.
+     * Add the deprecated output for the given member.
      *
-     * @param member the member being documented.
+     * @param member the member being documented
+     * @param annotationDocTree content tree to which the deprecated information will be added
      */
-    public void writeTags(MemberDoc member);
+    public void addDeprecated(MemberDoc member, Content annotationDocTree);
 
     /**
-     * Write the member footer.
+     * Add the comments for the given member.
+     *
+     * @param member the member being documented
+     * @param annotationDocTree the content tree to which the comments will be added
      */
-    public void writeMemberFooter();
+    public void addComments(MemberDoc member, Content annotationDocTree);
 
     /**
-     * Write the footer for the member documentation.
+     * Add the tags for the given member.
      *
-     * @param classDoc the class that the member belong to.
+     * @param member the member being documented
+     * @param annotationDocTree the content tree to which the tags will be added
      */
-    public void writeFooter(ClassDoc classDoc);
+    public void addTags(MemberDoc member, Content annotationDocTree);
 
     /**
      * Close the writer.
--- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/AnnotationTypeWriter.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/AnnotationTypeWriter.java	Mon Dec 20 21:10:57 2010 -0800
@@ -37,43 +37,122 @@
  * Do not use it as an API.
  *
  * @author Jamie Ho
+ * @author Bhavesh Patel (Modified)
  * @since 1.5
  */
 
 public interface AnnotationTypeWriter {
 
     /**
-     * Write the header of the page.
-     * @param header the header to write.
+     * Get the header of the page.
+     *
+     * @param header the header string to write
+     * @return a content tree for the header documentation
      */
-    public void writeHeader(String header);
+    public Content getHeader(String header);
+
+    /**
+     * Get the annotation content header.
+     *
+     * @return annotation content header that needs to be added to the documentation
+     */
+    public Content getAnnotationContentHeader();
 
     /**
-     * Write the signature of the current annotation type.
+     * Get the annotation information tree header.
+     *
+     * @return annotation information tree header that needs to be added to the documentation
+     */
+    public Content getAnnotationInfoTreeHeader();
+
+    /**
+     * Get the annotation information.
      *
-     * @param modifiers the modifiers for the signature.
+     * @param annotationInfoTree content tree containing the annotation information
+     * @return a content tree for the annotation
      */
-    public void writeAnnotationTypeSignature(String modifiers);
+    public Content getAnnotationInfo(Content annotationInfoTree);
+
+    /**
+     * Add the signature of the current annotation type.
+     *
+     * @param modifiers the modifiers for the signature
+     * @param annotationInfoTree the annotation content tree to which the signature will be added
+     */
+    public void addAnnotationTypeSignature(String modifiers, Content annotationInfoTree);
 
     /**
      * Build the annotation type description.
+     *
+     * @param annotationInfoTree content tree to which the description will be added
      */
-    public void writeAnnotationTypeDescription();
+    public void addAnnotationTypeDescription(Content annotationInfoTree);
+
+    /**
+     * Add the tag information for the current annotation type.
+     *
+     * @param annotationInfoTree content tree to which the tag information will be added
+     */
+    public void addAnnotationTypeTagInfo(Content annotationInfoTree);
 
     /**
-     * Write the tag information for the current annotation type.
+     * If this annotation is deprecated, add the appropriate information.
+     *
+     * @param annotationInfoTree content tree to which the deprecated information will be added
      */
-    public void writeAnnotationTypeTagInfo();
+    public void addAnnotationTypeDeprecationInfo (Content annotationInfoTree);
+
+    /**
+     * Add the annotation type details marker.
+     *
+     * @param memberDetails the content tree representing member details marker
+     */
+    public void addAnnotationDetailsMarker(Content memberDetails);
+
+    /**
+     * Get the member tree header for the annotation type.
+     *
+     * @return a content tree for the member tree header
+     */
+    public Content getMemberTreeHeader();
 
     /**
-     * If this annotation type is deprecated, write the appropriate information.
+     * Get the member tree.
+     *
+     * @param memberTree the content tree that will be modified and returned
+     * @return a content tree for the member
      */
-    public void writeAnnotationTypeDeprecationInfo();
+    public Content getMemberTree(Content memberTree);
+
+    /**
+     * Get the member summary tree.
+     *
+     * @param memberTree the content tree that will be used to build the summary tree
+     * @return a content tree for the member summary
+     */
+    public Content getMemberSummaryTree(Content memberTree);
 
     /**
-     * Write the footer of the page.
+     * Get the member details tree.
+     *
+     * @param memberTree the content tree that will be used to build the details tree
+     * @return a content tree for the member details
      */
-    public void writeFooter();
+    public Content getMemberDetailsTree(Content memberTree);
+
+    /**
+     * Add the footer of the page.
+     *
+     * @param contentTree content tree to which the footer will be added
+     */
+    public void addFooter(Content contentTree);
+
+    /**
+     * Print the document.
+     *
+     * @param contentTree content tree that will be printed as a document
+     */
+    public void printDocument(Content contentTree);
 
     /**
      * Close the writer.
@@ -86,10 +165,4 @@
      * @return the AnnotationTypeDoc being documented.
      */
     public AnnotationTypeDoc getAnnotationTypeDoc();
-
-    /**
-     * Perform any operations that are necessary when the member summary
-     * finished building.
-     */
-    public void completeMemberSummaryBuild();
 }
--- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/ClassWriter.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/ClassWriter.java	Mon Dec 20 21:10:57 2010 -0800
@@ -37,85 +37,149 @@
  * Do not use it as an API
  *
  * @author Jamie Ho
+ * @author Bhavesh Patel (Modified)
  * @since 1.5
  */
 
 public interface ClassWriter {
 
     /**
-     * Write the header of the page.
-     * @param header the header to write.
+     * Get the header of the page.
+     *
+     * @param header the header string to write
+     * @return header content that needs to be added to the documentation
      */
-    public void writeHeader(String header);
+    public Content getHeader(String header);
 
     /**
-     * Write the class tree documentation.
+     * Get the class content header.
+     *
+     * @return class content header that needs to be added to the documentation
      */
-    public void writeClassTree();
+    public Content getClassContentHeader();
+
+    /**
+     * Add the class tree documentation.
+     *
+     * @param classContentTree class content tree to which the documentation will be added
+     */
+    public void addClassTree(Content classContentTree);
 
     /**
-     * Write all implemented interfaces if this is a class.
+     * Get the class information tree header.
+     *
+     * @return class informaion tree header that needs to be added to the documentation
      */
-    public void writeImplementedInterfacesInfo();
+    public Content getClassInfoTreeHeader();
 
     /**
-     * Write all super interfaces if this is an interface.
+     * Add the type parameter information.
+     *
+     * @param classInfoTree content tree to which the documentation will be added
      */
-    public void writeSuperInterfacesInfo();
+    public void addTypeParamInfo(Content classInfoTree);
 
     /**
-     * Write the type parameter information.
+     * Add all super interfaces if this is an interface.
+     *
+     * @param classInfoTree content tree to which the documentation will be added
      */
-    public void writeTypeParamInfo();
+    public void addSuperInterfacesInfo(Content classInfoTree);
+
+    /**
+     * Add all implemented interfaces if this is a class.
+     *
+     * @param classInfoTree content tree to which the documentation will be added
+     */
+    public void addImplementedInterfacesInfo(Content classInfoTree);
 
     /**
-     * Write all the classes that extend this one.
+     * Add all the classes that extend this one.
+     *
+     * @param classInfoTree content tree to which the documentation will be added
      */
-    public void writeSubClassInfo();
+    public void addSubClassInfo(Content classInfoTree);
 
     /**
-     * Write all the interfaces that extend this one.
+     * Add all the interfaces that extend this one.
+     *
+     * @param classInfoTree content tree to which the documentation will be added
      */
-    public void writeSubInterfacesInfo();
+    public void addSubInterfacesInfo(Content classInfoTree);
 
     /**
-     * If this is an interface, write all classes that implement this
+     * If this is an interface, add all classes that implement this
      * interface.
+     *
+     * @param classInfoTree content tree to which the documentation will be added
      */
-    public void writeInterfaceUsageInfo ();
+    public void addInterfaceUsageInfo(Content classInfoTree);
 
     /**
-     * If this is an inner class or interface, write the enclosing class or
+     * If this is an inner class or interface, add the enclosing class or
      * interface.
+     *
+     * @param classInfoTree content tree to which the documentation will be added
      */
-    public void writeNestedClassInfo ();
+    public void addNestedClassInfo (Content classInfoTree);
 
     /**
-     * If this class is deprecated, write the appropriate information.
+     * Get the class information.
+     *
+     * @param classInfoTree content tree conatining the class information
+     * @return a content tree for the class
      */
-    public void writeClassDeprecationInfo ();
+    public Content getClassInfo(Content classInfoTree);
 
     /**
-     * Write the signature of the current class.
+     * If this class is deprecated, add the appropriate information.
      *
-     * @param modifiers the modifiers for the signature.
+     * @param classInfoTree content tree to which the documentation will be added
      */
-    public void writeClassSignature(String modifiers);
+    public void addClassDeprecationInfo (Content classInfoTree);
+
+    /**
+     * Add the signature of the current class content tree.
+     *
+     * @param modifiers the modifiers for the signature
+     * @param classInfoTree the class content tree to which the signature will be added
+     */
+    public void addClassSignature(String modifiers, Content classInfoTree);
 
     /**
      * Build the class description.
+     *
+     * @param classInfoTree content tree to which the documentation will be added
      */
-    public void writeClassDescription();
+    public void addClassDescription(Content classInfoTree);
+
+    /**
+     * Add the tag information for the current class.
+     *
+     * @param classInfoTree content tree to which the tag information will be added
+     */
+    public void addClassTagInfo(Content classInfoTree);
 
     /**
-     * Write the tag information for the current class.
+     * Get the member tree header for the class.
+     *
+     * @return a content tree for the member tree header
      */
-    public void writeClassTagInfo();
+    public Content getMemberTreeHeader();
 
     /**
-     * Write the footer of the page.
+     * Add the footer of the page.
+     *
+     * @param contentTree content tree to which the footer will be added
      */
-    public void writeFooter();
+    public void addFooter(Content contentTree);
+
+    /**
+     * Print the document.
+     *
+     * @param contentTree content tree that will be printed as a document
+     */
+    public void printDocument(Content contentTree);
 
     /**
      * Close the writer.
@@ -130,8 +194,18 @@
     public ClassDoc getClassDoc();
 
     /**
-     * Perform any operations that are necessary when the member summary
-     * finished building.
+     * Get the member summary tree.
+     *
+     * @param memberTree the content tree used to build the summary tree
+     * @return a content tree for the member summary
      */
-    public void completeMemberSummaryBuild();
+    public Content getMemberSummaryTree(Content memberTree);
+
+    /**
+     * Get the member details tree.
+     *
+     * @param memberTree the content tree used to build the details tree
+     * @return a content tree for the member details
+     */
+    public Content getMemberDetailsTree(Content memberTree);
 }
--- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/ConstantsSummaryWriter.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/ConstantsSummaryWriter.java	Mon Dec 20 21:10:57 2010 -0800
@@ -25,9 +25,9 @@
 
 package com.sun.tools.doclets.internal.toolkit;
 
-import com.sun.javadoc.*;
 import java.util.*;
 import java.io.*;
+import com.sun.javadoc.*;
 
 /**
  * The interface for writing constants summary output.
@@ -37,38 +37,34 @@
  * Do not use it as an API
  *
  * @author Jamie Ho
+ * @author Bhavesh Patel (Modified)
  * @since 1.5
  */
 
 public interface ConstantsSummaryWriter {
 
     /**
-     * Write the header for the summary.
-     */
-    public abstract void writeHeader();
-
-    /**
-     * Write the footer for the summary.
-     */
-    public abstract void writeFooter();
-
-    /**
      * Close the writer.
      */
     public abstract void close() throws IOException;
 
     /**
-     * Write the header for the index.
+     * Get the header for the constant summary documentation.
+     *
+     * @return header that needs to be added to the documentation
      */
-    public abstract void writeContentsHeader();
+    public abstract Content getHeader();
 
     /**
-     * Write the footer for the index.
+     * Get the header for the constant content list.
+     *
+     * @return content header that needs to be added to the documentation
      */
-    public abstract void writeContentsFooter();
+    public abstract Content getContentsHeader();
 
     /**
-     * Add the given package name to the index.
+     * Adds the given package name link to the constant content list tree.
+     *
      * @param pkg                    the {@link PackageDoc} to index.
      * @param parsedPackageName      the parsed package name.  We only Write the
      *                               first 2 directory levels of the package
@@ -77,38 +73,70 @@
      * @param WriteedPackageHeaders the set of package headers that have already
      *                              been indexed.  We don't want to index
      *                              something more than once.
+     * @param contentListTree the content tree to which the link will be added
      */
-    public abstract void writeLinkToPackageContent(PackageDoc pkg, String parsedPackageName,
-        Set<String> WriteedPackageHeaders);
+    public abstract void addLinkToPackageContent(PackageDoc pkg, String parsedPackageName,
+        Set<String> WriteedPackageHeaders, Content contentListTree);
 
     /**
-     * Write the given package name.
-     * @param pkg                    the {@link PackageDoc} to index.
-     * @param parsedPackageName      the parsed package name.  We only Write the
-     *                               first 2 directory levels of the package
-     *                               name. For example, java.lang.ref would be
-     *                               indexed as java.lang.*.
+     * Get the content list to be added to the documentation tree.
+     *
+     * @param contentListTree the content that will be added to the list
+     * @return content list that will be added to the documentation tree
      */
-    public abstract void writePackageName(PackageDoc pkg,
-        String parsedPackageName);
+    public abstract Content getContentsList(Content contentListTree);
+
+    /**
+     * Get the constant summaries for the document.
+     *
+     * @return constant summaries header to be added to the documentation tree
+     */
+    public abstract Content getConstantSummaries();
 
     /**
-     * Write the heading for the current table of constants for a given class.
-     * @param cd the class whose constants are being documented.
+     * Adds the given package name.
+     *
+     * @param pkg the {@link PackageDoc} to index.
+     * @param parsedPackageName the parsed package name.  We only Write the
+     *                          first 2 directory levels of the package
+     *                          name. For example, java.lang.ref would be
+     *                          indexed as java.lang.*.
+     * @param summariesTree the documentation tree to which the package name will
+     *                    be written
      */
-    public abstract void writeConstantMembersHeader(ClassDoc cd);
+    public abstract void addPackageName(PackageDoc pkg,
+        String parsedPackageName, Content summariesTree);
 
     /**
-     * Document the given constants.
+     * Get the class summary header for the constants summary.
+     *
+     * @return the header content for the class constants summary
+     */
+    public abstract Content getClassConstantHeader();
+
+    /**
+     * Adds the constant member table to the documentation tree.
+     *
      * @param cd the class whose constants are being documented.
      * @param fields the constants being documented.
+     * @param classConstantTree the documentation tree to which theconstant member
+     *                    table content will be added
      */
-    public abstract void writeConstantMembers(ClassDoc cd, List<FieldDoc> fields);
+    public abstract void addConstantMembers(ClassDoc cd, List<FieldDoc> fields,
+            Content classConstantTree);
 
     /**
-     * Document the given constants.
-     * @param cd the class whose constants are being documented.
+     * Adds the footer for the summary documentation.
+     *
+     * @param contentTree content tree to which the footer will be added
      */
-    public abstract void writeConstantMembersFooter(ClassDoc cd);
+    public abstract void addFooter(Content contentTree);
+
+    /**
+     * Print the constants summary document.
+     *
+     * @param contentTree content tree which should be printed
+     */
+    public abstract void printDocument(Content contentTree);
 
 }
--- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/ConstructorWriter.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/ConstructorWriter.java	Mon Dec 20 21:10:57 2010 -0800
@@ -36,67 +36,80 @@
  * Do not use it as an API
  *
  * @author Jamie Ho
+ * @author Bhavesh Patel (Modified)
  * @since 1.5
  */
 
 public interface ConstructorWriter {
 
     /**
-     * Write the header for the constructor documentation.
+     * Get the constructor details tree header.
      *
-     * @param classDoc the class that the constructors belong to.
-     * @param header the header to write.
+     * @param classDoc the class being documented
+     * @param memberDetailsTree the content tree representing member details
+     * @return content tree for the constructor details header
      */
-    public void writeHeader(ClassDoc classDoc, String header);
+    public Content getConstructorDetailsTreeHeader(ClassDoc classDoc,
+            Content memberDetailsTree);
 
     /**
-     * Write the constructor header for the given constructor.
+     * Get the constructor documentation tree header.
      *
-     * @param constructor the constructor being documented.
-     * @param isFirst the flag to indicate whether or not the constructor is the
-     *        first to be documented.
+     * @param constructor the constructor being documented
+     * @param constructorDetailsTree the content tree representing constructor details
+     * @return content tree for the constructor documentation header
      */
-    public void writeConstructorHeader(ConstructorDoc constructor, boolean isFirst);
+    public Content getConstructorDocTreeHeader(ConstructorDoc constructor,
+            Content constructorDetailsTree);
 
     /**
-     * Write the signature for the given constructor.
+     * Get the signature for the given constructor.
      *
-     * @param constructor the constructor being documented.
+     * @param constructor the constructor being documented
+     * @return content tree for the constructor signature
      */
-    public void writeSignature(ConstructorDoc constructor);
+    public Content getSignature(ConstructorDoc constructor);
 
     /**
-     * Write the deprecated output for the given constructor.
+     * Add the deprecated output for the given constructor.
      *
-     * @param constructor the constructor being documented.
+     * @param constructor the constructor being documented
+     * @param constructorDocTree content tree to which the deprecated information will be added
      */
-    public void writeDeprecated(ConstructorDoc constructor);
+    public void addDeprecated(ConstructorDoc constructor, Content constructorDocTree);
 
     /**
-     * Write the comments for the given constructor.
+     * Add the comments for the given constructor.
      *
-     * @param constructor the constructor being documented.
+     * @param constructor the constructor being documented
+     * @param constructorDocTree the content tree to which the comments will be added
      */
-    public void writeComments(ConstructorDoc constructor);
+    public void addComments(ConstructorDoc constructor, Content constructorDocTree);
 
     /**
-     * Write the tag output for the given constructor.
+     * Add the tags for the given constructor.
      *
-     * @param constructor the constructor being documented.
+     * @param constructor the constructor being documented
+     * @param constructorDocTree the content tree to which the tags will be added
      */
-    public void writeTags(ConstructorDoc constructor);
+    public void addTags(ConstructorDoc constructor, Content constructorDocTree);
 
     /**
-     * Write the constructor footer.
+     * Get the constructor details tree.
+     *
+     * @param memberDetailsTree the content tree representing member details
+     * @return content tree for the constructor details
      */
-    public void writeConstructorFooter();
+    public Content getConstructorDetails(Content memberDetailsTree);
 
     /**
-     * Write the footer for the constructor documentation.
+     * Get the constructor documentation.
      *
-     * @param classDoc the class that the constructors belong to.
+     * @param constructorDocTree the content tree representing constructor documentation
+     * @param isLastContent true if the content to be added is the last content
+     * @return content tree for the constructor documentation
      */
-    public void writeFooter(ClassDoc classDoc);
+    public Content getConstructorDoc(Content constructorDocTree, boolean isLastContent);
 
     /**
      * Let the writer know whether a non public constructor was found.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/Content.java	Mon Dec 20 21:10:57 2010 -0800
@@ -0,0 +1,106 @@
+/*
+ * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.tools.doclets.internal.toolkit;
+
+import com.sun.tools.doclets.internal.toolkit.util.*;
+
+/**
+ * A class to create content for javadoc output pages.
+ *
+ * @author Bhavesh Patel
+ */
+public abstract class Content {
+
+    /**
+     * Returns a string representation of the content.
+     *
+     * @return string representation of the content
+     */
+    public String toString() {
+        StringBuilder contentBuilder = new StringBuilder();
+        write(contentBuilder);
+        return contentBuilder.toString();
+    }
+
+    /**
+     * Adds content to the existing content.
+     *
+     * @param content content that needs to be added
+     */
+    public abstract void addContent(Content content);
+
+    /**
+     * Adds a string content to the existing content.
+     *
+     * @param stringContent the string content to be added
+     */
+    public abstract void addContent(String stringContent);
+
+    /**
+     * Writes content to a StringBuilder.
+     *
+     */
+    public abstract void write(StringBuilder contentBuilder);
+
+    /**
+     * Returns true if the content is empty.
+     *
+     * @return true if no content to be displayed else return false
+     */
+    public abstract boolean isEmpty();
+
+    /**
+     * Returns true if the content is valid.
+     *
+     * @return true if the content is valid else return false
+     */
+    public boolean isValid() {
+        return !isEmpty();
+    }
+
+    /**
+     * Checks for null values.
+     *
+     * @param t reference type to check for null values
+     * @return the reference type if not null or else throws a null pointer exception
+     */
+    protected static <T> T nullCheck(T t) {
+        t.getClass();
+        return t;
+    }
+
+    /**
+     * Returns true if the content ends with a newline character. Empty content
+     * is considered as ending with new line.
+     *
+     * @param contentBuilder content to test for newline character at the end
+     * @return true if the content ends with newline.
+     */
+    public boolean endsWithNewLine(StringBuilder contentBuilder) {
+        return ((contentBuilder.length() == 0) ||
+                (contentBuilder.toString().endsWith(DocletConstants.NL)));
+    }
+}
--- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/EnumConstantWriter.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/EnumConstantWriter.java	Mon Dec 20 21:10:57 2010 -0800
@@ -36,67 +36,80 @@
  * Do not use it as an API
  *
  * @author Jamie Ho
+ * @author Bhavesh Patel (Modified)
  * @since 1.5
  */
 
 public interface EnumConstantWriter {
 
     /**
-     * Write the header for the enum constant documentation.
+     * Get the enum constants details tree header.
      *
-     * @param classDoc the class that the enum constants belong to.
-     * @param header the header to write.
+     * @param classDoc the class being documented
+     * @param memberDetailsTree the content tree representing member details
+     * @return content tree for the enum constants details header
      */
-    public void writeHeader(ClassDoc classDoc, String header);
+    public Content getEnumConstantsDetailsTreeHeader(ClassDoc classDoc,
+            Content memberDetailsTree);
 
     /**
-     * Write the enum constant header for the given enum constant.
+     * Get the enum constants documentation tree header.
      *
-     * @param enumConstant the enum constant being documented.
-     * @param isFirst the flag to indicate whether or not the enum constant is
-     *                the first to be documented.
+     * @param enumConstant the enum constant being documented
+     * @param enumConstantDetailsTree the content tree representing enum constant details
+     * @return content tree for the enum constant documentation header
      */
-    public void writeEnumConstantHeader(FieldDoc enumConstant, boolean isFirst);
+    public Content getEnumConstantsTreeHeader(FieldDoc enumConstant,
+            Content enumConstantsDetailsTree);
 
     /**
-     * Write the signature for the given enum constant.
+     * Get the signature for the given enum constant.
      *
-     * @param enumConstant the enum constant being documented.
+     * @param enumConstant the enum constant being documented
+     * @return content tree for the enum constant signature
      */
-    public void writeSignature(FieldDoc enumConstant);
+    public Content getSignature(FieldDoc enumConstant);
 
     /**
-     * Write the deprecated output for the given enum constant.
+     * Add the deprecated output for the given enum constant.
      *
-     * @param enumConstant the enum constant being documented.
+     * @param enumConstant the enum constant being documented
+     * @param enumConstantsTree content tree to which the deprecated information will be added
      */
-    public void writeDeprecated(FieldDoc enumConstant);
+    public void addDeprecated(FieldDoc enumConstant, Content enumConstantsTree);
 
     /**
-     * Write the comments for the given enum constant.
+     * Add the comments for the given enum constant.
      *
-     * @param enumConstant the enum constant being documented.
+     * @param enumConstant the enum constant being documented
+     * @param enumConstantsTree the content tree to which the comments will be added
      */
-    public void writeComments(FieldDoc enumConstant);
+    public void addComments(FieldDoc enumConstant, Content enumConstantsTree);
 
     /**
-     * Write the tag output for the given enum constant.
+     * Add the tags for the given enum constant.
      *
-     * @param enumConstant the enum constant being documented.
+     * @param enumConstant the enum constant being documented
+     * @param enumConstantsTree the content tree to which the tags will be added
      */
-    public void writeTags(FieldDoc enumConstant);
+    public void addTags(FieldDoc enumConstant, Content enumConstantsTree);
 
     /**
-     * Write the enum constant footer.
+     * Get the enum constants details tree.
+     *
+     * @param memberDetailsTree the content tree representing member details
+     * @return content tree for the enum constant details
      */
-    public void writeEnumConstantFooter();
+    public Content getEnumConstantsDetails(Content memberDetailsTree);
 
     /**
-     * Write the footer for the enum constant documentation.
+     * Get the enum constants documentation.
      *
-     * @param classDoc the class that the enum constant belong to.
+     * @param enumConstantsTree the content tree representing enum constants documentation
+     * @param isLastContent true if the content to be added is the last content
+     * @return content tree for the enum constants documentation
      */
-    public void writeFooter(ClassDoc classDoc);
+    public Content getEnumConstants(Content enumConstantsTree, boolean isLastContent);
 
     /**
      * Close the writer.
--- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/FieldWriter.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/FieldWriter.java	Mon Dec 20 21:10:57 2010 -0800
@@ -36,67 +36,80 @@
  * Do not use it as an API
  *
  * @author Jamie Ho
+ * @author Bhavesh Patel (Modified)
  * @since 1.5
  */
 
 public interface FieldWriter {
 
     /**
-     * Write the header for the field documentation.
+     * Get the field details tree header.
      *
-     * @param classDoc the class that the fields belong to.
-     * @param header the header to write.
+     * @param classDoc the class being documented
+     * @param memberDetailsTree the content tree representing member details
+     * @return content tree for the field details header
      */
-    public void writeHeader(ClassDoc classDoc, String header);
+    public Content getFieldDetailsTreeHeader(ClassDoc classDoc,
+            Content memberDetailsTree);
 
     /**
-     * Write the field header for the given field.
+     * Get the field documentation tree header.
      *
-     * @param field the field being documented.
-     * @param isFirst the flag to indicate whether or not the field is the
-     *        first to be documented.
+     * @param field the constructor being documented
+     * @param fieldDetailsTree the content tree representing field details
+     * @return content tree for the field documentation header
      */
-    public void writeFieldHeader(FieldDoc field, boolean isFirst);
+    public Content getFieldDocTreeHeader(FieldDoc field,
+            Content fieldDetailsTree);
 
     /**
-     * Write the signature for the given field.
+     * Get the signature for the given field.
      *
-     * @param field the field being documented.
+     * @param field the field being documented
+     * @return content tree for the field signature
      */
-    public void writeSignature(FieldDoc field);
+    public Content getSignature(FieldDoc field);
 
     /**
-     * Write the deprecated output for the given field.
+     * Add the deprecated output for the given field.
      *
-     * @param field the field being documented.
+     * @param field the field being documented
+     * @param fieldDocTree content tree to which the deprecated information will be added
      */
-    public void writeDeprecated(FieldDoc field);
+    public void addDeprecated(FieldDoc field, Content fieldDocTree);
 
     /**
-     * Write the comments for the given field.
+     * Add the comments for the given field.
      *
-     * @param field the field being documented.
+     * @param field the field being documented
+     * @param fieldDocTree the content tree to which the comments will be added
      */
-    public void writeComments(FieldDoc field);
+    public void addComments(FieldDoc field, Content fieldDocTree);
 
     /**
-     * Write the tag output for the given field.
+     * Add the tags for the given field.
      *
-     * @param field the field being documented.
+     * @param field the field being documented
+     * @param fieldDocTree the content tree to which the tags will be added
      */
-    public void writeTags(FieldDoc field);
+    public void addTags(FieldDoc field, Content fieldDocTree);
 
     /**
-     * Write the field footer.
+     * Get the field details tree.
+     *
+     * @param memberDetailsTree the content tree representing member details
+     * @return content tree for the field details
      */
-    public void writeFieldFooter();
+    public Content getFieldDetails(Content memberDetailsTree);
 
     /**
-     * Write the footer for the field documentation.
+     * Get the field documentation.
      *
-     * @param classDoc the class that the fields belong to.
+     * @param fieldDocTree the content tree representing field documentation
+     * @param isLastContent true if the content to be added is the last content
+     * @return content tree for the field documentation
      */
-    public void writeFooter(ClassDoc classDoc);
+    public Content getFieldDoc(Content fieldDocTree, boolean isLastContent);
 
     /**
      * Close the writer.
--- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/MemberSummaryWriter.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/MemberSummaryWriter.java	Mon Dec 20 21:10:57 2010 -0800
@@ -26,6 +26,7 @@
 package com.sun.tools.doclets.internal.toolkit;
 
 import java.io.*;
+import java.util.*;
 import com.sun.javadoc.*;
 
 /**
@@ -36,61 +37,77 @@
  * Do not use it as an API
  *
  * @author Jamie Ho
+ * @author Bhavesh Patel (Modified)
  * @since 1.5
  */
 
 public interface MemberSummaryWriter {
 
     /**
-     * Write the member summary header for the given class.
+     * Get the member summary header for the given class.
      *
-     * @param classDoc the class the summary belongs to.
+     * @param classDoc the class the summary belongs to
+     * @param memberSummaryTree the content tree to which the member summary will be added
+     * @return a content tree for the member summary header
      */
-    public void writeMemberSummaryHeader(ClassDoc classDoc);
+    public Content getMemberSummaryHeader(ClassDoc classDoc,
+            Content memberSummaryTree);
 
     /**
-     * Write the member summary for the given class and member.
+     * Get the summary table for the given class.
      *
-     * @param classDoc the class the summary belongs to.
-     * @param member the member that I am summarizing.
-     * @param firstSentenceTags the tags for the sentence being documented.
-     * @param isFirst true if this is the first member in the list.
-     * @param isLast true if this the last member being documented.
+     * @param classDoc the class the summary table belongs to
+     * @return a content tree for the member summary table
      */
-    public void writeMemberSummary(ClassDoc classDoc, ProgramElementDoc member,
-        Tag[] firstSentenceTags, boolean isFirst, boolean isLast);
+    public Content getSummaryTableTree(ClassDoc classDoc);
+
+    /**
+     * Add the member summary for the given class and member.
+     *
+     * @param classDoc the class the summary belongs to
+     * @param member the member that is documented
+     * @param firstSentenceTags the tags for the sentence being documented
+     * @param tableTree the content treeto which the information will be added
+     * @param counter the counter for determing style for the table row
+     */
+    public void addMemberSummary(ClassDoc classDoc, ProgramElementDoc member,
+        Tag[] firstSentenceTags, Content tableTree, int counter);
 
     /**
-     * Write the member summary footer for the given class.
+     * Get the inherited member summary header for the given class.
      *
-     * @param classDoc the class the summary belongs to.
+     * @param classDoc the class the summary belongs to
+     * @return a content tree containing the inherited summary header
      */
-    public void writeMemberSummaryFooter(ClassDoc classDoc);
-
-    /**
-     * Write the inherited member summary header for the given class.
-     *
-     * @param classDoc the class the summary belongs to.
-     */
-    public void writeInheritedMemberSummaryHeader(ClassDoc classDoc);
+    public Content getInheritedSummaryHeader(ClassDoc classDoc);
 
     /**
-     * Write the inherited member summary for the given class and member.
+     * Add the inherited member summary for the given class and member.
      *
-     * @param classDoc the class the inherited member belongs to.
-     * @param member   the inherited member that I am summarizing.
-     * @param isFirst  true if this is the first member in the list.
-     * @param isLast   true if this is the last member in the list.
+     * @param classDoc the class the inherited member belongs to
+     * @param member the inherited member that is being documented
+     * @param isFirst true if this is the first member in the list
+     * @param isLast true if this is the last member in the list
+     * @param linksTree the content tree to which the links will be added
      */
-    public void writeInheritedMemberSummary(ClassDoc classDoc,
-        ProgramElementDoc member, boolean isFirst, boolean isLast);
+    public void addInheritedMemberSummary(ClassDoc classDoc,
+        ProgramElementDoc member, boolean isFirst, boolean isLast,
+        Content linksTree);
 
     /**
-     * Write the inherited member summary footer for the given class.
+     * Get inherited summary links.
      *
-     * @param classDoc the class the summary belongs to.
+     * @return a content tree conatining the inherited summary links
      */
-    public void writeInheritedMemberSummaryFooter(ClassDoc classDoc);
+    public Content getInheritedSummaryLinksTree();
+
+    /**
+     * Get the member tree.
+     *
+     * @param memberTree the content tree representating the member
+     * @return a content tree for the member
+     */
+    public Content getMemberTree(Content memberTree);
 
     /**
      * Close the writer.
--- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/MethodWriter.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/MethodWriter.java	Mon Dec 20 21:10:57 2010 -0800
@@ -36,68 +36,81 @@
  * Do not use it as an API
  *
  * @author Jamie Ho
+ * @author Bhavesh Patel (Modified)
  * @since 1.5
  */
 
 public interface MethodWriter {
 
     /**
-     * Write the header for the method documentation.
+     * Get the method details tree header.
      *
-     * @param classDoc the class that the methods belong to.
-     * @param header the header to write.
+     * @param classDoc the class being documented
+     * @param memberDetailsTree the content tree representing member details
+     * @return content tree for the method details header
      */
-    public void writeHeader(ClassDoc classDoc, String header);
+    public Content getMethodDetailsTreeHeader(ClassDoc classDoc,
+            Content memberDetailsTree);
 
     /**
-     * Write the method header for the given method.
+     * Get the method documentation tree header.
      *
-     * @param method the method being documented.
-     * @param isFirst the flag to indicate whether or not the method is the
-     *        first to be documented.
+     * @param method the method being documented
+     * @param methodDetailsTree the content tree representing method details
+     * @return content tree for the method documentation header
      */
-    public void writeMethodHeader(MethodDoc method, boolean isFirst);
+    public Content getMethodDocTreeHeader(MethodDoc method,
+            Content methodDetailsTree);
 
     /**
-     * Write the signature for the given method.
+     * Get the signature for the given method.
      *
-     * @param method the method being documented.
+     * @param method the method being documented
+     * @return content tree for the method signature
      */
-    public void writeSignature(MethodDoc method);
+    public Content getSignature(MethodDoc method);
 
     /**
-     * Write the deprecated output for the given method.
+     * Add the deprecated output for the given method.
      *
-     * @param method the method being documented.
+     * @param method the method being documented
+     * @param methodDocTree content tree to which the deprecated information will be added
      */
-    public void writeDeprecated(MethodDoc method);
+    public void addDeprecated(MethodDoc method, Content methodDocTree);
 
     /**
-     * Write the comments for the given method.
+     * Add the comments for the given method.
      *
-     * @param holder the holder type (not erasure) of the method.
-     * @param method the method being documented.
+     * @param holder the holder type (not erasure) of the method
+     * @param method the method being documented
+     * @param methodDocTree the content tree to which the comments will be added
      */
-    public void writeComments(Type holder, MethodDoc method);
+    public void addComments(Type holder, MethodDoc method, Content methodDocTree);
 
     /**
-     * Write the tag output for the given method.
+     * Add the tags for the given method.
      *
-     * @param method the method being documented.
+     * @param method the method being documented
+     * @param methodDocTree the content tree to which the tags will be added
      */
-    public void writeTags(MethodDoc method);
+    public void addTags(MethodDoc method, Content methodDocTree);
 
     /**
-     * Write the method footer.
+     * Get the method details tree.
+     *
+     * @param methodDetailsTree the content tree representing method details
+     * @return content tree for the method details
      */
-    public void writeMethodFooter();
+    public Content getMethodDetails(Content methodDetailsTree);
 
     /**
-     * Write the footer for the method documentation.
+     * Get the method documentation.
      *
-     * @param classDoc the class that the methods belong to.
+     * @param methodDocTree the content tree representing method documentation
+     * @param isLastContent true if the content to be added is the last content
+     * @return content tree for the method documentation
      */
-    public void writeFooter(ClassDoc classDoc);
+    public Content getMethodDoc(Content methodDocTree, boolean isLastContent);
 
     /**
      * Close the writer.
--- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/NestedClassWriter.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/NestedClassWriter.java	Mon Dec 20 21:10:57 2010 -0800
@@ -26,7 +26,6 @@
 package com.sun.tools.doclets.internal.toolkit;
 
 import java.io.*;
-import com.sun.javadoc.*;
 
 /**
  * The interface for writing class output.
@@ -36,59 +35,13 @@
  * Do not use it as an API
  *
  * @author Jamie Ho
+ * @author Bhavesh Patel (Modified)
  * @since 1.5
  */
 
 public interface NestedClassWriter {
 
     /**
-     * Write the classes summary header for the given class.
-     *
-     * @param nestedClass the class the summary belongs to.
-     */
-    public void writeNestedClassSummaryHeader(ClassDoc nestedClass);
-
-    /**
-     * Write the class summary for the given class and class.
-     *
-     * @param classDoc the class the summary belongs to.
-     * @param nestedClass the nested class that I am summarizing.
-     */
-    public void writeNestedClassSummary(ClassDoc classDoc, ClassDoc nestedClass);
-
-    /**
-     * Write the classes summary footer for the given class.
-     *
-     * @param nestedClass the class the summary belongs to.
-     */
-    public void writeNestedClassSummaryFooter(ClassDoc nestedClass);
-
-    /**
-     * Write the inherited classes summary header for the given class.
-     *
-     * @param nestedClass the class the summary belongs to.
-     */
-    public void writeInheritedNestedClassSummaryHeader(ClassDoc nestedClass);
-
-    /**
-     * Write the inherited nested class summary for the given class and nested
-     * class.
-     *
-     * @param classDoc the class the inherited nested class belongs to.
-     * @param nestedClass the inherited nested class that I am summarizing.
-     * @param isFirst true if this is the first member in the list.
-     */
-    public void writeInheritedNestedClassSummary(ClassDoc classDoc,
-            ClassDoc nestedClass, boolean isFirst);
-
-    /**
-     * Write the inherited classes summary footer for the given class.
-     *
-     * @param nestedClass the class the summary belongs to.
-     */
-    public void writeInheritedNestedClassSummaryFooter(ClassDoc nestedClass);
-
-    /**
      * Close the writer.
      */
     public void close() throws IOException;
--- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/PackageSummaryWriter.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/PackageSummaryWriter.java	Mon Dec 20 21:10:57 2010 -0800
@@ -36,6 +36,7 @@
  * Do not use it as an API
  *
  * @author Jamie Ho
+ * @author Bhavesh Patel (Modified)
  * @since 1.5
  */
 
@@ -49,45 +50,70 @@
     public abstract String getOutputFileName();
 
     /**
-     * Write the header for the package summary.
+     * Get the header for the summary.
+     *
+     * @param heading Package name.
+     * @return the header to be added to the content tree
      */
-    public abstract void writeSummaryHeader();
+    public abstract Content getPackageHeader(String heading);
 
     /**
-     * Write the footer for the package summary.
+     * Get the header for the package content.
+     *
+     * @return a content tree for the package content header
      */
-    public abstract void writeSummaryFooter();
+    public abstract Content getContentHeader();
 
     /**
-     * Write the table of classes in this package.
+     * Get the header for the package summary.
+     *
+     * @return a content tree with the package summary header
+     */
+    public abstract Content getSummaryHeader();
+
+    /**
+     * Adds the table of classes to the documentation tree.
      *
      * @param classes the array of classes to document.
      * @param label the label for this table.
+     * @param tableSummary the summary string for the table
+     * @param tableHeader array of table headers
+     * @param summaryContentTree the content tree to which the summaries will be added
      */
-    public abstract void writeClassesSummary(ClassDoc[] classes, String label, String tableSummary, String[] tableHeader);
+    public abstract void addClassesSummary(ClassDoc[] classes, String label,
+            String tableSummary, String[] tableHeader, Content summaryContentTree);
 
     /**
-     * Write the header for the summary.
+     * Adds the package description from the "packages.html" file to the documentation
+     * tree.
      *
-     * @param heading Package name.
+     * @param packageContentTree the content tree to which the package description
+     *                           will be added
      */
-    public abstract void writePackageHeader(String heading);
+    public abstract void addPackageDescription(Content packageContentTree);
 
     /**
-     * Print the package description from the "packages.html" file.
+     * Adds the tag information from the "packages.html" file to the documentation
+     * tree.
+     *
+     * @param packageContentTree the content tree to which the package tags will
+     *                           be added
      */
-    public abstract void writePackageDescription();
+    public abstract void addPackageTags(Content packageContentTree);
 
     /**
-     * Print the tag information from the "packages.html" file.
+     * Adds the footer to the documentation tree.
+     *
+     * @param contentTree the tree to which the footer will be added
      */
-    public abstract void writePackageTags();
+    public abstract void addPackageFooter(Content contentTree);
 
     /**
-     * Write the footer for the summary.
+     * Print the package summary document.
      *
+     * @param contentTree the content tree that will be printed
      */
-    public abstract void writePackageFooter();
+    public abstract void printDocument(Content contentTree);
 
     /**
      * Close the writer.
--- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/SerializedFormWriter.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/SerializedFormWriter.java	Mon Dec 20 21:10:57 2010 -0800
@@ -43,33 +43,73 @@
 public interface SerializedFormWriter {
 
     /**
-     * Write the given header.
+     * Get the header.
      *
      * @param header the header to write.
+     * @return the header content tree
      */
-    public void writeHeader(String header);
+    public Content getHeader(String header);
+
+    /**
+     * Get the serialized form summaries header.
+     *
+     * @return the serialized form summary header tree
+     */
+    public Content getSerializedSummariesHeader();
+
+    /**
+     * Get the package serialized form header.
+     *
+     * @return the package serialized form header tree
+     */
+    public Content getPackageSerializedHeader();
 
     /**
-     * Write the given package header.
+     * Get the given package header.
      *
-     * @param packageName the package header to write.
+     * @param packageName the package header to write
+     * @return a content tree for the package header
      */
-    public void writePackageHeader(String packageName);
+    public Content getPackageHeader(String packageName);
+
+    /**
+     * Get the serialized class header.
+     *
+     * @return a content tree for the serialized class header
+     */
+    public Content getClassSerializedHeader();
 
     /**
-     * Write the heading for the serializable class.
+     * Get the heading for the serializable class.
      *
-     * @param classDoc the class being processed.
+     * @param classDoc the class being processed
+     * @return a content tree for the class heading
      */
-    public void writeClassHeader(ClassDoc classDoc);
+    public Content getClassHeader(ClassDoc classDoc);
 
     /**
-     * Write the serial UID info.
+     * Get the serial UID info header.
+     *
+     * @return a content tree for the serial uid info header
+     */
+    public Content getSerialUIDInfoHeader();
+
+    /**
+     * Adds the serial UID info.
      *
      * @param header the header that will show up before the UID.
      * @param serialUID the serial UID to print.
+     * @param serialUidTree the serial UID tree to which the content will be added.
      */
-    public void writeSerialUIDInfo(String header, String serialUID);
+    public void addSerialUIDInfo(String header, String serialUID,
+            Content serialUidTree);
+
+    /**
+     * Get the class serialize content header.
+     *
+     * @return a content tree for the class serialize content header
+     */
+    public Content getClassContentHeader();
 
     /**
      * Return an instance of a SerialFieldWriter.
@@ -91,9 +131,26 @@
     public abstract void close() throws IOException;
 
     /**
-     * Write the footer.
+     * Get the serialized content.
+     *
+     * @param serializedTreeContent content for serialized data
+     * @return a content tree for serialized information
      */
-    public void writeFooter();
+    public Content getSerializedContent(Content serializedTreeContent);
+
+    /**
+     * Add the footer.
+     *
+     * @param serializedTree the serialized tree to be added
+     */
+    public void addFooter(Content serializedTree);
+
+    /**
+     * Print the serialized form document.
+     *
+     * @param serializedTree the content tree that will be printed
+     */
+    public abstract void printDocument(Content serializedTree);
 
     /**
      * Write the serialized form for a given field.
@@ -101,56 +158,73 @@
     public interface SerialFieldWriter {
 
         /**
-         * Write the given heading.
+         * Get the serializable field header.
          *
-         * @param heading the heading to write.
+         * @return serialized fields header content tree
          */
-        public void writeHeader(String heading);
+        public Content getSerializableFieldsHeader();
 
         /**
-         * Write the deprecated information for this member.
+         * Get the field content header.
          *
-         * @param field the field to document.
+         * @param isLastContent true if this is the last content to be documented
+         * @return fields header content tree
          */
-        public void writeMemberDeprecatedInfo(FieldDoc field);
+        public Content getFieldsContentHeader(boolean isLastContent);
 
         /**
-         * Write the description text for this member.
+         * Get the fields content.
+         *
+         * @param heading the heading to write.
+         * @param contentTree content tree to which the heading will be added
+         * @return serializable fields content tree
+         */
+        public Content getSerializableFields(String heading, Content contentTree);
+
+        /**
+         * Adds the deprecated information for this member.
          *
          * @param field the field to document.
+         * @param contentTree content tree to which the deprecated information will be added
          */
-        public void writeMemberDescription(FieldDoc field);
+        public void addMemberDeprecatedInfo(FieldDoc field, Content contentTree);
 
         /**
-         * Write the description text for this member represented by the tag.
+         * Adds the description text for this member.
+         *
+         * @param field the field to document.
+         * @param contentTree content tree to which the member description will be added
+         */
+        public void addMemberDescription(FieldDoc field, Content contentTree);
+
+        /**
+         * Adds the description text for this member represented by the tag.
          *
          * @param serialFieldTag the field to document (represented by tag).
+         * @param contentTree content tree to which the member description will be added
          */
-        public void writeMemberDescription(SerialFieldTag serialFieldTag);
+        public void addMemberDescription(SerialFieldTag serialFieldTag, Content contentTree);
 
         /**
-         * Write the tag information for this member.
+         * Adds the tag information for this member.
          *
          * @param field the field to document.
+         * @param contentTree content tree to which the member tags will be added
          */
-        public void writeMemberTags(FieldDoc field);
+        public void addMemberTags(FieldDoc field, Content contentTree);
 
         /**
-         * Write the member header.
+         * Adds the member header.
          *
          * @param fieldType the type of the field.
          * @param fieldTypeStr the type of the field in string format.  We will
          * print this out if we can't link to the type.
          * @param fieldDimensions the dimensions of the field.
          * @param fieldName the name of the field.
+         * @param contentTree content tree to which the member header will be added
          */
-        public void writeMemberHeader(ClassDoc fieldType, String fieldTypeStr,
-            String fieldDimensions, String fieldName);
-
-        /**
-         * Write the member footer.
-         */
-        public void writeMemberFooter();
+        public void addMemberHeader(ClassDoc fieldType, String fieldTypeStr,
+            String fieldDimensions, String fieldName, Content contentTree);
 
         /**
          * Check to see if overview details should be printed. If
@@ -162,13 +236,6 @@
          * @return true if overview details need to be printed
          */
         public boolean shouldPrintOverview(FieldDoc field);
-
-        /**
-         * Write the footer.
-         *
-         * @param heading the heading that was written.
-         */
-        public void writeFooter (String heading);
     }
 
     /**
@@ -177,44 +244,70 @@
     public interface SerialMethodWriter {
 
         /**
+         * Get the serializable method header.
+         *
+         * @return serializable methods content tree
+         */
+        public Content getSerializableMethodsHeader();
+
+        /**
+         * Get the method content header.
+         *
+         * @param isLastContent true if this is the last content to be documented
+         * @return methods content tree
+         */
+        public Content getMethodsContentHeader(boolean isLastContent);
+
+        /**
          * Write the given heading.
          *
-         * @param heading the heading to write.
+         * @param heading the heading to write
+         * @param serializableMethodTree content tree which will be added
+         * @return serializable methods content tree
          */
-        public void writeHeader(String heading);
+        public Content getSerializableMethods(String heading, Content serializableMethodTree);
 
         /**
          * Write a warning that no serializable methods exist.
          *
-         * @param msg the warning to print.
+         * @param msg the warning to print
+         * @return no customization message tree
          */
-        public void writeNoCustomizationMsg(String msg);
+        public Content getNoCustomizationMsg(String msg);
 
         /**
-         * Write the header.
+         * Adds the header.
          *
-         * @param member the member to write the header for.
+         * @param member the member to write the header for
+         * @param methodsContentTree content tree to which the header will be added
          */
-        public void writeMemberHeader(MethodDoc member);
+        public void addMemberHeader(MethodDoc member, Content methodsContentTree);
 
         /**
-         * Write the footer.
+         * Adds the deprecated information for this member.
+         *
+         * @param member the member to write the deprecated information for
+         * @param methodsContentTree content tree to which the deprecated
+         * information will be added
          */
-        public void writeMemberFooter();
-
-        /**
-         * Write the deprecated information for this member.
-         */
-        public void writeDeprecatedMemberInfo(MethodDoc member);
+        public void addDeprecatedMemberInfo(MethodDoc member, Content methodsContentTree);
 
         /**
-         * Write the description for this member.
+         * Adds the description for this member.
+         *
+         * @param member the member to write the information for
+         * @param methodsContentTree content tree to which the member
+         * information will be added
          */
-        public void writeMemberDescription(MethodDoc member);
+        public void addMemberDescription(MethodDoc member, Content methodsContentTree);
 
         /**
-         * Write the tag information for this member.
+         * Adds the tag information for this member.
+         *
+         * @param member the member to write the tags information for
+         * @param methodsContentTree content tree to which the tags
+         * information will be added
          */
-        public void writeMemberTags(MethodDoc member);
+        public void addMemberTags(MethodDoc member, Content methodsContentTree);
     }
 }
--- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AbstractBuilder.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AbstractBuilder.java	Mon Dec 20 21:10:57 2010 -0800
@@ -95,13 +95,14 @@
      * Build the documentation, as specified by the given XML element.
      *
      * @param node the XML element that specifies which component to document.
+     * @param contentTree content tree to which the documentation will be added
      */
-    protected void build(XMLNode node) {
+    protected void build(XMLNode node, Content contentTree) {
         String component = node.name;
         try {
             invokeMethod("build" + component,
-                    new Class<?>[] { XMLNode.class },
-                    new Object[] { node });
+                    new Class<?>[]{XMLNode.class, Content.class},
+                    new Object[]{node, contentTree});
         } catch (NoSuchMethodException e) {
             e.printStackTrace();
             configuration.root.printError("Unknown element: " + component);
@@ -111,8 +112,8 @@
         } catch (Exception e) {
             e.printStackTrace();
             configuration.root.printError("Exception " +
-                e.getClass().getName() +
-                " thrown while processing element: " + component);
+                    e.getClass().getName() +
+                    " thrown while processing element: " + component);
             throw new DocletAbortException();
         }
     }
@@ -121,10 +122,11 @@
      * Build the documentation, as specified by the children of the given XML element.
      *
      * @param node the XML element that specifies which components to document.
+     * @param contentTree content tree to which the documentation will be added
      */
-    protected void buildChildren(XMLNode node) {
-        for (XMLNode child: node.children)
-            build(child);
+    protected void buildChildren(XMLNode node, Content contentTree) {
+        for (XMLNode child : node.children)
+            build(child, contentTree);
     }
 
     /**
@@ -140,8 +142,7 @@
             Object[] params)
     throws Exception {
         if (DEBUG) {
-            configuration.root.printError("DEBUG: " + this.getClass().getName()
-                + "." + methodName);
+            configuration.root.printError("DEBUG: " + this.getClass().getName() + "." + methodName);
         }
         Method method = this.getClass().getMethod(methodName, paramClasses);
         method.invoke(this, params);
--- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AbstractMemberBuilder.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AbstractMemberBuilder.java	Mon Dec 20 21:10:57 2010 -0800
@@ -27,6 +27,7 @@
 
 import com.sun.tools.doclets.internal.toolkit.*;
 import com.sun.tools.doclets.internal.toolkit.util.*;
+import java.util.*;
 
 /**
  * The superclass for all member builders.  Member builders are only executed
@@ -66,12 +67,13 @@
     /**
      * Build the sub component if there is anything to document.
      *
-     * @param elements {@inheritDoc}
+     * @param node the XML element that specifies which components to document.
+     * @param contentTree content tree to which the documentation will be added
      */
     @Override
-    public void build(XMLNode node) {
+    public void build(XMLNode node, Content contentTree) {
         if (hasMembersToDocument()) {
-            super.build(node);
+            super.build(node, contentTree);
         }
     }
 
--- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AnnotationTypeBuilder.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AnnotationTypeBuilder.java	Mon Dec 20 21:10:57 2010 -0800
@@ -25,11 +25,11 @@
 
 package com.sun.tools.doclets.internal.toolkit.builders;
 
+import java.io.*;
+import java.util.*;
 import com.sun.tools.doclets.internal.toolkit.util.*;
 import com.sun.tools.doclets.internal.toolkit.*;
 import com.sun.javadoc.*;
-import java.io.*;
-import java.util.*;
 
 /**
  * Builds the summary for a given annotation type.
@@ -39,6 +39,7 @@
  * Do not use it as an API
  *
  * @author Jamie Ho
+ * @author Bhavesh Patel (Modified)
  * @since 1.5
  */
 public class AnnotationTypeBuilder extends AbstractBuilder {
@@ -59,6 +60,11 @@
     private AnnotationTypeWriter writer;
 
     /**
+     * The content tree for the annotation documentation.
+     */
+    private Content contentTree;
+
+    /**
      * Construct a new ClassBuilder.
      *
      * @param configuration the current configuration of the
@@ -92,7 +98,7 @@
      * {@inheritDoc}
      */
     public void build() throws IOException {
-        build(LayoutParser.getInstance(configuration).parseXML(ROOT));
+        build(LayoutParser.getInstance(configuration).parseXML(ROOT), contentTree);
     }
 
     /**
@@ -102,18 +108,24 @@
         return ROOT;
     }
 
-     /**
-      * Handles the &lt;AnnotationTypeDoc> tag.
+    /**
+      * Build the annotation type documentation.
       *
-      * @param elements the XML elements that specify how to document a class.
+      * @param node the XML element that specifies which components to document
+      * @param contentTree the content tree to which the documentation will be added
       */
-     public void buildAnnotationTypeDoc(XMLNode node) throws Exception {
-        buildChildren(node);
-        writer.close();
-        copyDocFiles();
+     public void buildAnnotationTypeDoc(XMLNode node, Content contentTree) throws Exception {
+        contentTree = writer.getHeader(configuration.getText("doclet.AnnotationType") +
+                " " + annotationTypeDoc.name());
+        Content annotationContentTree = writer.getAnnotationContentHeader();
+         buildChildren(node, annotationContentTree);
+         contentTree.addContent(annotationContentTree);
+         writer.addFooter(contentTree);
+         writer.printDocument(contentTree);
+         writer.close();
+         copyDocFiles();
      }
 
-
      /**
       * Copy the doc files for the current ClassDoc if necessary.
       */
@@ -137,86 +149,112 @@
      }
 
     /**
-     * Build the header of the page.
+     * Build the annotation information tree documentation.
+     *
+     * @param node the XML element that specifies which components to document
+     * @param annotationContentTree the content tree to which the documentation will be added
      */
-    public void buildAnnotationTypeHeader(XMLNode node) {
-        writer.writeHeader(configuration.getText("doclet.AnnotationType") +
-            " " + annotationTypeDoc.name());
+    public void buildAnnotationTypeInfo(XMLNode node, Content annotationContentTree) {
+        Content annotationInfoTree = writer.getAnnotationInfoTreeHeader();
+        buildChildren(node, annotationInfoTree);
+        annotationContentTree.addContent(writer.getAnnotationInfo(annotationInfoTree));
     }
 
     /**
-     * If this class is deprecated, print the appropriate information.
+     * If this annotation is deprecated, build the appropriate information.
+     *
+     * @param node the XML element that specifies which components to document
+     * @param annotationInfoTree the content tree to which the documentation will be added
      */
-    public void buildDeprecationInfo (XMLNode node) {
-        writer.writeAnnotationTypeDeprecationInfo();
+    public void buildDeprecationInfo (XMLNode node, Content annotationInfoTree) {
+        writer.addAnnotationTypeDeprecationInfo(annotationInfoTree);
     }
 
     /**
      * Build the signature of the current annotation type.
+     *
+     * @param node the XML element that specifies which components to document
+     * @param annotationInfoTree the content tree to which the documentation will be added
      */
-    public void buildAnnotationTypeSignature(XMLNode node) {
+    public void buildAnnotationTypeSignature(XMLNode node, Content annotationInfoTree) {
         StringBuffer modifiers = new StringBuffer(
-            annotationTypeDoc.modifiers() + " ");
-        writer.writeAnnotationTypeSignature(
-            Util.replaceText(
-                modifiers.toString(), "interface", "@interface"));
+                annotationTypeDoc.modifiers() + " ");
+        writer.addAnnotationTypeSignature(Util.replaceText(
+                modifiers.toString(), "interface", "@interface"), annotationInfoTree);
     }
 
     /**
-     * Build the class description.
+     * Build the annotation type description.
+     *
+     * @param node the XML element that specifies which components to document
+     * @param annotationInfoTree the content tree to which the documentation will be added
      */
-    public void buildAnnotationTypeDescription(XMLNode node) {
-       writer.writeAnnotationTypeDescription();
+    public void buildAnnotationTypeDescription(XMLNode node, Content annotationInfoTree) {
+        writer.addAnnotationTypeDescription(annotationInfoTree);
     }
 
     /**
-     * Build the tag information for the current class.
+     * Build the tag information for the current annotation type.
+     *
+     * @param node the XML element that specifies which components to document
+     * @param annotationInfoTree the content tree to which the documentation will be added
      */
-    public void buildAnnotationTypeTagInfo(XMLNode node) {
-       writer.writeAnnotationTypeTagInfo();
+    public void buildAnnotationTypeTagInfo(XMLNode node, Content annotationInfoTree) {
+        writer.addAnnotationTypeTagInfo(annotationInfoTree);
     }
 
     /**
-     * Build the contents of the page.
+     * Build the member summary contents of the page.
      *
-     * @param elements the XML elements that specify how a member summary is
-     *                 documented.
+     * @param node the XML element that specifies which components to document
+     * @param annotationContentTree the content tree to which the documentation will be added
      */
-    public void buildMemberSummary(XMLNode node) throws Exception {
+    public void buildMemberSummary(XMLNode node, Content annotationContentTree)
+            throws Exception {
+        Content memberSummaryTree = writer.getMemberTreeHeader();
         configuration.getBuilderFactory().
-            getMemberSummaryBuilder(writer).buildChildren(node);
-        writer.completeMemberSummaryBuild();
+                getMemberSummaryBuilder(writer).buildChildren(node, memberSummaryTree);
+        annotationContentTree.addContent(writer.getMemberSummaryTree(memberSummaryTree));
+    }
+
+    /**
+     * Build the member details contents of the page.
+     *
+     * @param node the XML element that specifies which components to document
+     * @param annotationContentTree the content tree to which the documentation will be added
+     */
+    public void buildAnnotationTypeMemberDetails(XMLNode node, Content annotationContentTree) {
+        Content memberDetailsTree = writer.getMemberTreeHeader();
+        buildChildren(node, memberDetailsTree);
+        if (memberDetailsTree.isValid()) {
+            Content memberDetails = writer.getMemberTreeHeader();
+            writer.addAnnotationDetailsMarker(memberDetails);
+            memberDetails.addContent(writer.getMemberTree(memberDetailsTree));
+            annotationContentTree.addContent(writer.getMemberDetailsTree(memberDetails));
+        }
     }
 
     /**
      * Build the annotation type optional member documentation.
      *
-     * @param elements the XML elements that specify how a annotation type
-     *                 members are documented.
+     * @param node the XML element that specifies which components to document
+     * @param memberDetailsTree the content tree to which the documentation will be added
      */
-    public void buildAnnotationTypeOptionalMemberDetails(XMLNode node)
-    throws Exception {
+    public void buildAnnotationTypeOptionalMemberDetails(XMLNode node, Content memberDetailsTree)
+            throws Exception {
         configuration.getBuilderFactory().
-            getAnnotationTypeOptionalMemberBuilder(writer).buildChildren(node);
+                getAnnotationTypeOptionalMemberBuilder(writer).buildChildren(node, memberDetailsTree);
     }
 
     /**
      * Build the annotation type required member documentation.
      *
-     * @param elements the XML elements that specify how a annotation type
-     *                 members are documented.
+     * @param node the XML element that specifies which components to document
+     * @param memberDetailsTree the content tree to which the documentation will be added
      */
-    public void buildAnnotationTypeRequiredMemberDetails(XMLNode node)
-    throws Exception {
+    public void buildAnnotationTypeRequiredMemberDetails(XMLNode node, Content memberDetailsTree)
+            throws Exception {
         configuration.getBuilderFactory().
-            getAnnotationTypeRequiredMemberBuilder(writer).buildChildren(node);
-    }
-
-
-    /**
-     * Build the footer of the page.
-     */
-    public void buildAnnotationTypeFooter(XMLNode node) {
-        writer.writeFooter();
+                getAnnotationTypeRequiredMemberBuilder(writer).buildChildren(node, memberDetailsTree);
     }
 }
--- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AnnotationTypeOptionalMemberBuilder.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AnnotationTypeOptionalMemberBuilder.java	Mon Dec 20 21:10:57 2010 -0800
@@ -25,11 +25,10 @@
 
 package com.sun.tools.doclets.internal.toolkit.builders;
 
-
+import java.util.*;
 import com.sun.tools.doclets.internal.toolkit.util.*;
 import com.sun.tools.doclets.internal.toolkit.*;
 import com.sun.javadoc.*;
-import java.util.*;
 
 /**
  * Builds documentation for optional annotation type members.
@@ -39,6 +38,7 @@
  * Do not use it as an API
  *
  * @author Jamie Ho
+ * @author Bhavesh Patel (Modified)
  * @since 1.5
  */
 public class AnnotationTypeOptionalMemberBuilder extends
@@ -90,27 +90,25 @@
     }
 
     /**
-     * Build the member documentation.
+     * Build the annotation type optional member documentation.
      *
-     * @param elements the XML elements that specify how to construct this
-     *                documentation.
+     * @param node the XML element that specifies which components to document
+     * @param memberDetailsTree the content tree to which the documentation will be added
      */
-    public void buildAnnotationTypeOptionalMember(XMLNode node) {
-        if (writer == null) {
-            return;
-        }
-        for (currentMemberIndex = 0; currentMemberIndex < members.size();
-            currentMemberIndex++) {
-            buildChildren(node);
-        }
+    public void buildAnnotationTypeOptionalMember(XMLNode node, Content memberDetailsTree) {
+        buildAnnotationTypeMember(node, memberDetailsTree);
     }
 
     /**
-     * Document the default value for this optional member.
+     * Build the default value for this optional member.
+     *
+     * @param node the XML element that specifies which components to document
+     * @param annotationDocTree the content tree to which the documentation will be added
      */
-    public void buildDefaultValueInfo(XMLNode node) {
-        ((AnnotationTypeOptionalMemberWriter) writer).writeDefaultValueInfo(
-            (MemberDoc) members.get(currentMemberIndex));
+    public void buildDefaultValueInfo(XMLNode node, Content annotationDocTree) {
+        ((AnnotationTypeOptionalMemberWriter) writer).addDefaultValueInfo(
+                (MemberDoc) members.get(currentMemberIndex),
+                annotationDocTree);
     }
 
     /**
--- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AnnotationTypeRequiredMemberBuilder.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AnnotationTypeRequiredMemberBuilder.java	Mon Dec 20 21:10:57 2010 -0800
@@ -25,11 +25,10 @@
 
 package com.sun.tools.doclets.internal.toolkit.builders;
 
-
+import java.util.*;
 import com.sun.tools.doclets.internal.toolkit.util.*;
 import com.sun.tools.doclets.internal.toolkit.*;
 import com.sun.javadoc.*;
-import java.util.*;
 
 /**
  * Builds documentation for required annotation type members.
@@ -39,6 +38,7 @@
  * Do not use it as an API
  *
  * @author Jamie Ho
+ * @author Bhavesh Patel (Modified)
  * @since 1.5
  */
 public class AnnotationTypeRequiredMemberBuilder extends AbstractMemberBuilder {
@@ -141,81 +141,86 @@
     }
 
     /**
+     * Build the annotation type required member documentation.
+     *
+     * @param node the XML element that specifies which components to document
+     * @param memberDetailsTree the content tree to which the documentation will be added
+     */
+    public void buildAnnotationTypeRequiredMember(XMLNode node, Content memberDetailsTree) {
+        buildAnnotationTypeMember(node, memberDetailsTree);
+    }
+
+    /**
      * Build the member documentation.
      *
-     * @param elements the XML elements that specify how to construct this
-     *                documentation.
+     * @param node the XML element that specifies which components to document
+     * @param memberDetailsTree the content tree to which the documentation will be added
      */
-    public void buildAnnotationTypeRequiredMember(XMLNode node) {
+    public void buildAnnotationTypeMember(XMLNode node, Content memberDetailsTree) {
         if (writer == null) {
             return;
         }
-        for (currentMemberIndex = 0; currentMemberIndex < members.size();
+        int size = members.size();
+        if (size > 0) {
+            writer.addAnnotationDetailsTreeHeader(
+                    classDoc, memberDetailsTree);
+            for (currentMemberIndex = 0; currentMemberIndex < size;
             currentMemberIndex++) {
-            buildChildren(node);
+                Content annotationDocTree = writer.getAnnotationDocTreeHeader(
+                        (MemberDoc) members.get(currentMemberIndex),
+                        memberDetailsTree);
+                buildChildren(node, annotationDocTree);
+                memberDetailsTree.addContent(writer.getAnnotationDoc(
+                        annotationDocTree, (currentMemberIndex == size - 1)));
+            }
         }
     }
 
     /**
-     * Build the overall header.
-     */
-    public void buildHeader(XMLNode node) {
-        writer.writeHeader(classDoc,
-            configuration.getText("doclet.Annotation_Type_Member_Detail"));
-    }
-
-    /**
-     * Build the header for the individual members.
+     * Build the signature.
+     *
+     * @param node the XML element that specifies which components to document
+     * @param annotationDocTree the content tree to which the documentation will be added
      */
-    public void buildMemberHeader(XMLNode node) {
-        writer.writeMemberHeader((MemberDoc) members.get(
-                currentMemberIndex),
-            currentMemberIndex == 0);
-    }
-
-    /**
-     * Build the signature.
-     */
-    public void buildSignature(XMLNode node) {
-        writer.writeSignature((MemberDoc) members.get(currentMemberIndex));
+    public void buildSignature(XMLNode node, Content annotationDocTree) {
+        annotationDocTree.addContent(
+                writer.getSignature((MemberDoc) members.get(currentMemberIndex)));
     }
 
     /**
      * Build the deprecation information.
+     *
+     * @param node the XML element that specifies which components to document
+     * @param annotationDocTree the content tree to which the documentation will be added
      */
-    public void buildDeprecationInfo(XMLNode node) {
-        writer.writeDeprecated((MemberDoc) members.get(currentMemberIndex));
+    public void buildDeprecationInfo(XMLNode node, Content annotationDocTree) {
+        writer.addDeprecated((MemberDoc) members.get(currentMemberIndex),
+                annotationDocTree);
     }
 
     /**
      * Build the comments for the member.  Do nothing if
      * {@link Configuration#nocomment} is set to true.
+     *
+     * @param node the XML element that specifies which components to document
+     * @param annotationDocTree the content tree to which the documentation will be added
      */
-    public void buildMemberComments(XMLNode node) {
+    public void buildMemberComments(XMLNode node, Content annotationDocTree) {
         if(! configuration.nocomment){
-            writer.writeComments((MemberDoc) members.get(currentMemberIndex));
+            writer.addComments((MemberDoc) members.get(currentMemberIndex),
+                    annotationDocTree);
         }
     }
 
     /**
      * Build the tag information.
-     */
-    public void buildTagInfo(XMLNode node) {
-        writer.writeTags((MemberDoc) members.get(currentMemberIndex));
-    }
-
-    /**
-     * Build the footer for the individual member.
+     *
+     * @param node the XML element that specifies which components to document
+     * @param annotationDocTree the content tree to which the documentation will be added
      */
-    public void buildMemberFooter(XMLNode node) {
-        writer.writeMemberFooter();
-    }
-
-    /**
-     * Build the overall footer.
-     */
-    public void buildFooter(XMLNode node) {
-        writer.writeFooter(classDoc);
+    public void buildTagInfo(XMLNode node, Content annotationDocTree) {
+        writer.addTags((MemberDoc) members.get(currentMemberIndex),
+                annotationDocTree);
     }
 
     /**
--- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ClassBuilder.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ClassBuilder.java	Mon Dec 20 21:10:57 2010 -0800
@@ -25,11 +25,11 @@
 
 package com.sun.tools.doclets.internal.toolkit.builders;
 
+import java.io.*;
+import java.util.*;
 import com.sun.tools.doclets.internal.toolkit.util.*;
 import com.sun.tools.doclets.internal.toolkit.*;
 import com.sun.javadoc.*;
-import java.io.*;
-import java.util.*;
 
 /**
  * Builds the summary for a given class.
@@ -39,6 +39,7 @@
  * Do not use it as an API
  *
  * @author Jamie Ho
+ * @author Bhavesh Patel (Modified)
  * @since 1.5
  */
 public class ClassBuilder extends AbstractBuilder {
@@ -69,6 +70,11 @@
     private boolean isEnum = false;
 
     /**
+     * The content tree for the class documentation.
+     */
+    private Content contentTree;
+
+    /**
      * Construct a new ClassBuilder.
      *
      * @param configuration the current configuration of the
@@ -108,7 +114,7 @@
      * {@inheritDoc}
      */
     public void build() throws IOException {
-        build(LayoutParser.getInstance(configuration).parseXML(ROOT));
+        build(LayoutParser.getInstance(configuration).parseXML(ROOT), contentTree);
     }
 
     /**
@@ -121,121 +127,159 @@
      /**
       * Handles the &lt;ClassDoc> tag.
       *
-      * @param elements the XML elements that specify how to document a class.
+      * @param node the XML element that specifies which components to document
+      * @param contentTree the content tree to which the documentation will be added
       */
-     public void buildClassDoc(XMLNode node) throws Exception {
-        buildChildren(node);
-        writer.close();
-        copyDocFiles();
+     public void buildClassDoc(XMLNode node, Content contentTree) throws Exception {
+         String key;
+         if (isInterface) {
+             key =  "doclet.Interface";
+         } else if (isEnum) {
+             key = "doclet.Enum";
+         } else {
+             key =  "doclet.Class";
+         }
+         contentTree = writer.getHeader(configuration.getText(key) + " " +
+                 classDoc.name());
+         Content classContentTree = writer.getClassContentHeader();
+         buildChildren(node, classContentTree);
+         contentTree.addContent(classContentTree);
+         writer.addFooter(contentTree);
+         writer.printDocument(contentTree);
+         writer.close();
+         copyDocFiles();
      }
 
+     /**
+      * Build the class tree documentation.
+      *
+      * @param node the XML element that specifies which components to document
+      * @param classContentTree the content tree to which the documentation will be added
+      */
+    public void buildClassTree(XMLNode node, Content classContentTree) {
+        writer.addClassTree(classContentTree);
+    }
 
-     /**
-      * Copy the doc files for the current ClassDoc if necessary.
-      */
+    /**
+     * Build the class information tree documentation.
+     *
+     * @param node the XML element that specifies which components to document
+     * @param classContentTree the content tree to which the documentation will be added
+     */
+    public void buildClassInfo(XMLNode node, Content classContentTree) {
+        Content classInfoTree = writer.getClassInfoTreeHeader();
+        buildChildren(node, classInfoTree);
+        classContentTree.addContent(writer.getClassInfo(classInfoTree));
+    }
+
+    /**
+     * Build the typeparameters of this class.
+     *
+     * @param node the XML element that specifies which components to document
+     * @param classInfoTree the content tree to which the documentation will be added
+     */
+    public void buildTypeParamInfo(XMLNode node, Content classInfoTree) {
+        writer.addTypeParamInfo(classInfoTree);
+    }
+
+    /**
+     * If this is an interface, list all super interfaces.
+     *
+     * @param node the XML element that specifies which components to document
+     * @param classInfoTree the content tree to which the documentation will be added
+     */
+    public void buildSuperInterfacesInfo(XMLNode node, Content classInfoTree) {
+        writer.addSuperInterfacesInfo(classInfoTree);
+    }
+
+    /**
+     * If this is a class, list all interfaces implemented by this class.
+     *
+     * @param node the XML element that specifies which components to document
+     * @param classInfoTree the content tree to which the documentation will be added
+     */
+    public void buildImplementedInterfacesInfo(XMLNode node, Content classInfoTree) {
+        writer.addImplementedInterfacesInfo(classInfoTree);
+    }
+
+    /**
+     * List all the classes extend this one.
+     *
+     * @param node the XML element that specifies which components to document
+     * @param classInfoTree the content tree to which the documentation will be added
+     */
+    public void buildSubClassInfo(XMLNode node, Content classInfoTree) {
+        writer.addSubClassInfo(classInfoTree);
+    }
+
+    /**
+     * List all the interfaces that extend this one.
+     *
+     * @param node the XML element that specifies which components to document
+     * @param classInfoTree the content tree to which the documentation will be added
+     */
+    public void buildSubInterfacesInfo(XMLNode node, Content classInfoTree) {
+        writer.addSubInterfacesInfo(classInfoTree);
+    }
+
+    /**
+     * If this is an interface, list all classes that implement this interface.
+     *
+     * @param node the XML element that specifies which components to document
+     * @param classInfoTree the content tree to which the documentation will be added
+     */
+    public void buildInterfaceUsageInfo(XMLNode node, Content classInfoTree) {
+        writer.addInterfaceUsageInfo(classInfoTree);
+    }
+
+    /**
+     * If this class is deprecated, build the appropriate information.
+     *
+     * @param node the XML element that specifies which components to document
+     * @param classInfoTree the content tree to which the documentation will be added
+     */
+    public void buildDeprecationInfo (XMLNode node, Content classInfoTree) {
+        writer.addClassDeprecationInfo(classInfoTree);
+    }
+
+    /**
+     * If this is an inner class or interface, list the enclosing class or interface.
+     *
+     * @param node the XML element that specifies which components to document
+     * @param classInfoTree the content tree to which the documentation will be added
+     */
+    public void buildNestedClassInfo (XMLNode node, Content classInfoTree) {
+        writer.addNestedClassInfo(classInfoTree);
+    }
+
+    /**
+     * Copy the doc files for the current ClassDoc if necessary.
+     */
      private void copyDocFiles() {
         PackageDoc containingPackage = classDoc.containingPackage();
         if((configuration.packages == null ||
                 Arrays.binarySearch(configuration.packages,
-                                    containingPackage) < 0) &&
-           ! containingPackagesSeen.contains(containingPackage.name())){
+                containingPackage) < 0) &&
+                ! containingPackagesSeen.contains(containingPackage.name())){
             //Only copy doc files dir if the containing package is not
             //documented AND if we have not documented a class from the same
             //package already. Otherwise, we are making duplicate copies.
             Util.copyDocFiles(configuration,
-                Util.getPackageSourcePath(configuration,
+                    Util.getPackageSourcePath(configuration,
                     classDoc.containingPackage()) +
-                DirectoryManager.getDirectoryPath(classDoc.containingPackage())
+                    DirectoryManager.getDirectoryPath(classDoc.containingPackage())
                     + File.separator, DocletConstants.DOC_FILES_DIR_NAME, true);
             containingPackagesSeen.add(containingPackage.name());
         }
      }
 
     /**
-     * Build the header of the page.
-     */
-    public void buildClassHeader(XMLNode node) {
-        String key;
-        if (isInterface) {
-            key =  "doclet.Interface";
-        } else if (isEnum) {
-            key = "doclet.Enum";
-        } else {
-            key =  "doclet.Class";
-        }
-
-        writer.writeHeader(configuration.getText(key) + " " + classDoc.name());
-    }
-
-    /**
-     * Build the class tree documentation.
-     */
-    public void buildClassTree(XMLNode node) {
-        writer.writeClassTree();
-    }
-
-    /**
-     * If this is a class, list all interfaces
-     * implemented by this class.
-     */
-    public void buildImplementedInterfacesInfo(XMLNode node) {
-        writer.writeImplementedInterfacesInfo();
-    }
-
-    /**
-     * If this is an interface, list all super interfaces.
-     */
-    public void buildSuperInterfacesInfo(XMLNode node) {
-        writer.writeSuperInterfacesInfo();
-    }
-
-    /**
-     * List the parameters of this class.
+     * Build the signature of the current class.
+     *
+     * @param node the XML element that specifies which components to document
+     * @param classInfoTree the content tree to which the documentation will be added
      */
-    public void buildTypeParamInfo(XMLNode node) {
-        writer.writeTypeParamInfo();
-    }
-
-    /**
-     * List all the classes extend this one.
-     */
-    public void buildSubClassInfo(XMLNode node) {
-        writer.writeSubClassInfo();
-    }
-
-    /**
-     * List all the interfaces that extend this one.
-     */
-    public void buildSubInterfacesInfo(XMLNode node) {
-        writer.writeSubInterfacesInfo();
-    }
-
-    /**
-     * If this is an interface, list all classes that implement this interface.
-     */
-    public void buildInterfaceUsageInfo (XMLNode node) {
-        writer.writeInterfaceUsageInfo();
-    }
-
-    /**
-     * If this is an inner class or interface, list the enclosing class or
-     * interface.
-     */
-    public void buildNestedClassInfo (XMLNode node) {
-        writer.writeNestedClassInfo();
-    }
-
-    /**
-     * If this class is deprecated, print the appropriate information.
-     */
-    public void buildDeprecationInfo (XMLNode node) {
-        writer.writeClassDeprecationInfo();
-    }
-
-    /**
-     * Build the signature of the current class.
-     */
-    public void buildClassSignature(XMLNode node) {
+    public void buildClassSignature(XMLNode node, Content classInfoTree) {
         StringBuffer modifiers = new StringBuffer(classDoc.modifiers() + " ");
         if (isEnum) {
             modifiers.append("enum ");
@@ -243,93 +287,111 @@
             if ((index = modifiers.indexOf("abstract")) >= 0) {
                 modifiers.delete(index, index + (new String("abstract")).length());
                 modifiers = new StringBuffer(
-                    Util.replaceText(modifiers.toString(), "  ", " "));
+                        Util.replaceText(modifiers.toString(), "  ", " "));
             }
             if ((index = modifiers.indexOf("final")) >= 0) {
                 modifiers.delete(index, index + (new String("final")).length());
                 modifiers = new StringBuffer(
-                    Util.replaceText(modifiers.toString(), "  ", " "));
+                        Util.replaceText(modifiers.toString(), "  ", " "));
             }
         //} else if (classDoc.isAnnotationType()) {
             //modifiers.append("@interface ");
         } else if (! isInterface) {
             modifiers.append("class ");
         }
-        writer.writeClassSignature(modifiers.toString());
+        writer.addClassSignature(modifiers.toString(), classInfoTree);
     }
 
     /**
      * Build the class description.
+     *
+     * @param node the XML element that specifies which components to document
+     * @param classInfoTree the content tree to which the documentation will be added
      */
-    public void buildClassDescription(XMLNode node) {
-       writer.writeClassDescription();
+    public void buildClassDescription(XMLNode node, Content classInfoTree) {
+       writer.addClassDescription(classInfoTree);
     }
 
     /**
      * Build the tag information for the current class.
+     *
+     * @param node the XML element that specifies which components to document
+     * @param classInfoTree the content tree to which the documentation will be added
      */
-    public void buildClassTagInfo(XMLNode node) {
-       writer.writeClassTagInfo();
+    public void buildClassTagInfo(XMLNode node, Content classInfoTree) {
+       writer.addClassTagInfo(classInfoTree);
     }
 
     /**
-     * Build the contents of the page.
+     * Build the member summary contents of the page.
      *
-     * @param elements the XML elements that specify how a member summary is
-     *                 documented.
+     * @param node the XML element that specifies which components to document
+     * @param classContentTree the content tree to which the documentation will be added
      */
-    public void buildMemberSummary(XMLNode node) throws Exception {
+    public void buildMemberSummary(XMLNode node, Content classContentTree) throws Exception {
+        Content memberSummaryTree = writer.getMemberTreeHeader();
         configuration.getBuilderFactory().
-            getMemberSummaryBuilder(writer).buildChildren(node);
-        writer.completeMemberSummaryBuild();
+                getMemberSummaryBuilder(writer).buildChildren(node, memberSummaryTree);
+        classContentTree.addContent(writer.getMemberSummaryTree(memberSummaryTree));
+    }
+
+    /**
+     * Build the member details contents of the page.
+     *
+     * @param node the XML element that specifies which components to document
+     * @param classContentTree the content tree to which the documentation will be added
+     */
+    public void buildMemberDetails(XMLNode node, Content classContentTree) {
+        Content memberDetailsTree = writer.getMemberTreeHeader();
+        buildChildren(node, memberDetailsTree);
+        classContentTree.addContent(writer.getMemberDetailsTree(memberDetailsTree));
     }
 
     /**
      * Build the enum constants documentation.
      *
-     * @param elements the XML elements that specify how a enum constants are
-     *                 documented.
+     * @param node the XML element that specifies which components to document
+     * @param memberDetailsTree the content tree to which the documentation will be added
      */
-    public void buildEnumConstantsDetails(XMLNode node) throws Exception {
+    public void buildEnumConstantsDetails(XMLNode node,
+            Content memberDetailsTree) throws Exception {
         configuration.getBuilderFactory().
-            getEnumConstantsBuilder(writer).buildChildren(node);
+                getEnumConstantsBuilder(writer).buildChildren(node, memberDetailsTree);
     }
 
     /**
      * Build the field documentation.
      *
-     * @param elements the XML elements that specify how a field is documented.
+     * @param node the XML element that specifies which components to document
+     * @param memberDetailsTree the content tree to which the documentation will be added
      */
-    public void buildFieldDetails(XMLNode node) throws Exception {
+    public void buildFieldDetails(XMLNode node,
+            Content memberDetailsTree) throws Exception {
         configuration.getBuilderFactory().
-            getFieldBuilder(writer).buildChildren(node);
+                getFieldBuilder(writer).buildChildren(node, memberDetailsTree);
     }
 
     /**
      * Build the constructor documentation.
      *
-     * @param elements the XML elements that specify how to document a
-     * constructor.
+     * @param node the XML element that specifies which components to document
+     * @param memberDetailsTree the content tree to which the documentation will be added
      */
-    public void buildConstructorDetails(XMLNode node) throws Exception {
+    public void buildConstructorDetails(XMLNode node,
+            Content memberDetailsTree) throws Exception {
         configuration.getBuilderFactory().
-            getConstructorBuilder(writer).buildChildren(node);
+                getConstructorBuilder(writer).buildChildren(node, memberDetailsTree);
     }
 
     /**
      * Build the method documentation.
      *
-     * @param elements the XML elements that specify how a method is documented.
+     * @param node the XML element that specifies which components to document
+     * @param memberDetailsTree the content tree to which the documentation will be added
      */
-    public void buildMethodDetails(XMLNode node) throws Exception {
+    public void buildMethodDetails(XMLNode node,
+            Content memberDetailsTree) throws Exception {
         configuration.getBuilderFactory().
-                getMethodBuilder(writer).buildChildren(node);
-    }
-
-    /**
-     * Build the footer of the page.
-     */
-    public void buildClassFooter(XMLNode node) {
-        writer.writeFooter();
+                getMethodBuilder(writer).buildChildren(node, memberDetailsTree);
     }
 }
--- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ConstantsSummaryBuilder.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ConstantsSummaryBuilder.java	Mon Dec 20 21:10:57 2010 -0800
@@ -25,11 +25,11 @@
 
 package com.sun.tools.doclets.internal.toolkit.builders;
 
+import java.io.*;
+import java.util.*;
+import com.sun.javadoc.*;
 import com.sun.tools.doclets.internal.toolkit.util.*;
 import com.sun.tools.doclets.internal.toolkit.*;
-import com.sun.javadoc.*;
-import java.io.*;
-import java.util.*;
 
 /**
  * Builds the Constants Summary Page.
@@ -39,6 +39,7 @@
  * Do not use it as an API
  *
  * @author Jamie Ho
+ * @author Bhavesh Patel (Modified)
  * @since 1.5
  */
 public class ConstantsSummaryBuilder extends AbstractBuilder {
@@ -80,6 +81,11 @@
     private ClassDoc currentClass;
 
     /**
+     * The content tree for the constant summary documentation.
+     */
+    private Content contentTree;
+
+    /**
      * Construct a new ConstantsSummaryBuilder.
      *
      * @param configuration the current configuration of the
@@ -113,7 +119,7 @@
             //Doclet does not support this output.
             return;
         }
-        build(LayoutParser.getInstance(configuration).parseXML(ROOT));
+        build(LayoutParser.getInstance(configuration).parseXML(ROOT), contentTree);
     }
 
     /**
@@ -126,85 +132,85 @@
     /**
      * Build the constant summary.
      *
-     * @param elements the list of elements describing constant summary
-     *                 documentation.
+     * @param node the XML element that specifies which components to document
+     * @param contentTree the content tree to which the documentation will be added
      */
-    public void buildConstantSummary(XMLNode node) throws Exception {
-        buildChildren(node);
+    public void buildConstantSummary(XMLNode node, Content contentTree) throws Exception {
+        contentTree = writer.getHeader();
+        buildChildren(node, contentTree);
+        writer.addFooter(contentTree);
+        writer.printDocument(contentTree);
         writer.close();
     }
 
     /**
-     * Build the header.
-     */
-    public void buildHeader(XMLNode node) {
-        writer.writeHeader();
-    }
-
-    /**
-     * Build the footer.
+     * Build the list of packages.
+     *
+     * @param node the XML element that specifies which components to document
+     * @param contentTree the content tree to which the content list will be added
      */
-    public void buildFooter(XMLNode node) {
-        writer.writeFooter();
-    }
-
-    /**
-     * Build the table of contents.
-     */
-    public void buildContents(XMLNode node) {
-        writer.writeContentsHeader();
+    public void buildContents(XMLNode node, Content contentTree) {
+        Content contentListTree = writer.getContentsHeader();
         PackageDoc[] packages = configuration.packages;
         printedPackageHeaders = new HashSet<String>();
         for (int i = 0; i < packages.length; i++) {
             if (hasConstantField(packages[i]) && ! hasPrintedPackageIndex(packages[i].name())) {
-                writer.writeLinkToPackageContent(packages[i],
+                writer.addLinkToPackageContent(packages[i],
                     parsePackageName(packages[i].name()),
-                    printedPackageHeaders);
+                    printedPackageHeaders, contentListTree);
             }
         }
-        writer.writeContentsFooter();
+        contentTree.addContent(writer.getContentsList(contentListTree));
     }
 
     /**
      * Build the summary for each documented package.
      *
-     * @param elements the XML elements that represent the components
-     *                 of documentation for each package.
+     * @param node the XML element that specifies which components to document
+     * @param contentTree the tree to which the summaries will be added
      */
-    public void buildConstantSummaries(XMLNode node) {
+    public void buildConstantSummaries(XMLNode node, Content contentTree) {
         PackageDoc[] packages = configuration.packages;
         printedPackageHeaders = new HashSet<String>();
+        Content summariesTree = writer.getConstantSummaries();
         for (int i = 0; i < packages.length; i++) {
             if (hasConstantField(packages[i])) {
                 currentPackage = packages[i];
                 //Build the documentation for the current package.
-                buildChildren(node);
+                buildChildren(node, summariesTree);
             }
         }
+        contentTree.addContent(summariesTree);
     }
 
     /**
-     * Build the summary for the current package.
+     * Build the header for the given package.
      *
-     * @param elements the list of XML elements that make up package
-     *                 documentation.
+     * @param node the XML element that specifies which components to document
+     * @param summariesTree the tree to which the package header will be added
      */
-    public void buildPackageConstantSummary(XMLNode node) {
-        buildChildren(node);
+    public void buildPackageHeader(XMLNode node, Content summariesTree) {
+        String parsedPackageName = parsePackageName(currentPackage.name());
+        if (! printedPackageHeaders.contains(parsedPackageName)) {
+            writer.addPackageName(currentPackage,
+                parsePackageName(currentPackage.name()), summariesTree);
+            printedPackageHeaders.add(parsedPackageName);
+        }
     }
 
     /**
      * Build the summary for the current class.
      *
-     * @param elements the list of XML elements that make up the class
-     *                 constant summary.
+     * @param node the XML element that specifies which components to document
+     * @param summariesTree the tree to which the class constant summary will be added
      */
-    public void buildClassConstantSummary(XMLNode node) {
+    public void buildClassConstantSummary(XMLNode node, Content summariesTree) {
         ClassDoc[] classes = currentPackage.name().length() > 0 ?
             currentPackage.allClasses() :
             configuration.classDocCatalog.allClasses(
                 DocletConstants.DEFAULT_PACKAGE_NAME);
         Arrays.sort(classes);
+        Content classConstantTree = writer.getClassConstantHeader();
         for (int i = 0; i < classes.length; i++) {
             if (! classDocsWithConstFields.contains(classes[i]) ||
                 ! classes[i].isIncluded()) {
@@ -212,42 +218,20 @@
             }
             currentClass = classes[i];
             //Build the documentation for the current class.
-            buildChildren(node);
+            buildChildren(node, classConstantTree);
         }
-    }
-
-    /**
-     * Build the header for the given class.
-     */
-    public void buildPackageHeader(XMLNode node) {
-        String parsedPackageName = parsePackageName(currentPackage.name());
-        if (! printedPackageHeaders.contains(parsedPackageName)) {
-            writer.writePackageName(currentPackage,
-                parsePackageName(currentPackage.name()));
-            printedPackageHeaders.add(parsedPackageName);
-        }
+        summariesTree.addContent(classConstantTree);
     }
 
     /**
-     * Build the header for the given class.
-     */
-    public void buildClassHeader(XMLNode node) {
-        writer.writeConstantMembersHeader(currentClass);
-    }
-
-    /**
-     * Print summary of constant members in the
-     * class.
+     * Build the summary of constant members in the class.
+     *
+     * @param node the XML element that specifies which components to document
+     * @param classConstantTree the tree to which the constant members table
+     *                          will be added
      */
-    public void buildConstantMembers(XMLNode node) {
-        new ConstantFieldBuilder(currentClass).buildMembersSummary(node);
-    }
-
-    /**
-     * Build the footer for the given class.
-     */
-    public void buildClassFooter(XMLNode node) {
-        writer.writeConstantMembersFooter(currentClass);
+    public void buildConstantMembers(XMLNode node, Content classConstantTree) {
+        new ConstantFieldBuilder(currentClass).buildMembersSummary(node, classConstantTree);
     }
 
     /**
@@ -346,12 +330,16 @@
 
         /**
          * Builds the table of constants for a given class.
+         *
+         * @param node the XML element that specifies which components to document
+         * @param classConstantTree the tree to which the class constants table
+         *                          will be added
          */
-        protected void buildMembersSummary(XMLNode node) {
+        protected void buildMembersSummary(XMLNode node, Content classConstantTree) {
             List<FieldDoc> members = new ArrayList<FieldDoc>(members());
             if (members.size() > 0) {
                 Collections.sort(members);
-                writer.writeConstantMembers(classdoc, members);
+                writer.addConstantMembers(classdoc, members, classConstantTree);
             }
         }
 
--- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ConstructorBuilder.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ConstructorBuilder.java	Mon Dec 20 21:10:57 2010 -0800
@@ -25,10 +25,10 @@
 
 package com.sun.tools.doclets.internal.toolkit.builders;
 
+import java.util.*;
 import com.sun.tools.doclets.internal.toolkit.util.*;
 import com.sun.tools.doclets.internal.toolkit.*;
 import com.sun.javadoc.*;
-import java.util.*;
 
 /**
  * Builds documentation for a constructor.
@@ -38,200 +38,195 @@
  * Do not use it as an API
  *
  * @author Jamie Ho
+ * @author Bhavesh Patel (Modified)
  * @since 1.5
  */
 public class ConstructorBuilder extends AbstractMemberBuilder {
 
-        /**
-         * The name of this builder.
-         */
-        public static final String NAME = "ConstructorDetails";
+    /**
+     * The name of this builder.
+     */
+    public static final String NAME = "ConstructorDetails";
 
-        /**
-         * The index of the current field that is being documented at this point
-         * in time.
-         */
-        private int currentMethodIndex;
+    /**
+     * The index of the current field that is being documented at this point
+     * in time.
+     */
+    private int currentConstructorIndex;
 
-        /**
-         * The class whose constructors are being documented.
-         */
-        private ClassDoc classDoc;
+    /**
+     * The class whose constructors are being documented.
+     */
+    private ClassDoc classDoc;
 
-        /**
-         * The visible constructors for the given class.
-         */
-        private VisibleMemberMap visibleMemberMap;
+    /**
+     * The visible constructors for the given class.
+     */
+    private VisibleMemberMap visibleMemberMap;
 
-        /**
-         * The writer to output the constructor documentation.
-         */
-        private ConstructorWriter writer;
+    /**
+     * The writer to output the constructor documentation.
+     */
+    private ConstructorWriter writer;
 
-        /**
-         * The constructors being documented.
-         */
-        private List<ProgramElementDoc> constructors;
+    /**
+     * The constructors being documented.
+     */
+    private List<ProgramElementDoc> constructors;
 
-        /**
-         * Construct a new ConstructorBuilder.
-         *
-         * @param configuration the current configuration of the
-         *                      doclet.
-         */
-        private ConstructorBuilder(Configuration configuration) {
-                super(configuration);
-        }
+    /**
+     * Construct a new ConstructorBuilder.
+     *
+     * @param configuration the current configuration of the
+     *                      doclet.
+     */
+    private ConstructorBuilder(Configuration configuration) {
+        super(configuration);
+    }
 
-        /**
-         * Construct a new ConstructorBuilder.
-         *
-         * @param configuration the current configuration of the doclet.
-         * @param classDoc the class whoses members are being documented.
-         * @param writer the doclet specific writer.
-         */
-        public static ConstructorBuilder getInstance(
-                Configuration configuration,
-                ClassDoc classDoc,
-                ConstructorWriter writer) {
-                ConstructorBuilder builder = new ConstructorBuilder(configuration);
-                builder.classDoc = classDoc;
-                builder.writer = writer;
-                builder.visibleMemberMap =
-                        new VisibleMemberMap(
-                                classDoc,
-                                VisibleMemberMap.CONSTRUCTORS,
-                                configuration.nodeprecated);
-                builder.constructors =
-                        new ArrayList<ProgramElementDoc>(builder.visibleMemberMap.getMembersFor(classDoc));
-                for (int i = 0; i < builder.constructors.size(); i++) {
-                        if (builder.constructors.get(i).isProtected()
-                                || builder.constructors.get(i).isPrivate()) {
-                                writer.setFoundNonPubConstructor(true);
-                        }
-                }
-                if (configuration.getMemberComparator() != null) {
-                        Collections.sort(
-                                builder.constructors,
-                                configuration.getMemberComparator());
-                }
-                return builder;
+    /**
+     * Construct a new ConstructorBuilder.
+     *
+     * @param configuration the current configuration of the doclet.
+     * @param classDoc the class whoses members are being documented.
+     * @param writer the doclet specific writer.
+     */
+    public static ConstructorBuilder getInstance(
+            Configuration configuration,
+            ClassDoc classDoc,
+            ConstructorWriter writer) {
+        ConstructorBuilder builder = new ConstructorBuilder(configuration);
+        builder.classDoc = classDoc;
+        builder.writer = writer;
+        builder.visibleMemberMap =
+                new VisibleMemberMap(
+                classDoc,
+                VisibleMemberMap.CONSTRUCTORS,
+                configuration.nodeprecated);
+        builder.constructors =
+                new ArrayList<ProgramElementDoc>(builder.visibleMemberMap.getMembersFor(classDoc));
+        for (int i = 0; i < builder.constructors.size(); i++) {
+            if (builder.constructors.get(i).isProtected()
+                    || builder.constructors.get(i).isPrivate()) {
+                writer.setFoundNonPubConstructor(true);
+            }
         }
-
-        /**
-         * {@inheritDoc}
-         */
-        public String getName() {
-                return NAME;
+        if (configuration.getMemberComparator() != null) {
+            Collections.sort(
+                    builder.constructors,
+                    configuration.getMemberComparator());
         }
+        return builder;
+    }
 
-        /**
-         * {@inheritDoc}
-         */
-        public boolean hasMembersToDocument() {
-                return constructors.size() > 0;
-        }
+    /**
+     * {@inheritDoc}
+     */
+    public String getName() {
+        return NAME;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public boolean hasMembersToDocument() {
+        return constructors.size() > 0;
+    }
 
-        /**
-         * Returns a list of constructors that will be documented for the given class.
-         * This information can be used for doclet specific documentation
-         * generation.
-         *
-         * @return a list of constructors that will be documented.
-         */
-        public List<ProgramElementDoc> members(ClassDoc classDoc) {
-                return visibleMemberMap.getMembersFor(classDoc);
-        }
+    /**
+     * Returns a list of constructors that will be documented for the given class.
+     * This information can be used for doclet specific documentation
+     * generation.
+     *
+     * @return a list of constructors that will be documented.
+     */
+    public List<ProgramElementDoc> members(ClassDoc classDoc) {
+        return visibleMemberMap.getMembersFor(classDoc);
+    }
 
-        /**
-         * Return the constructor writer for this builder.
-         *
-         * @return the constructor writer for this builder.
-         */
-        public ConstructorWriter getWriter() {
-                return writer;
-        }
+    /**
+     * Return the constructor writer for this builder.
+     *
+     * @return the constructor writer for this builder.
+     */
+    public ConstructorWriter getWriter() {
+        return writer;
+    }
 
-        /**
-         * Build the constructor documentation.
-         *
-         * @param elements the XML elements that specify how to construct this
-         *                documentation.
-         */
-        public void buildConstructorDoc(XMLNode node) {
-                if (writer == null) {
-                        return;
-                }
-                for (currentMethodIndex = 0;
-                        currentMethodIndex < constructors.size();
-                        currentMethodIndex++) {
-                        buildChildren(node);
-                }
+    /**
+     * Build the constructor documentation.
+     *
+     * @param node the XML element that specifies which components to document
+     * @param memberDetailsTree the content tree to which the documentation will be added
+     */
+    public void buildConstructorDoc(XMLNode node, Content memberDetailsTree) {
+        if (writer == null) {
+            return;
         }
-
-        /**
-         * Build the overall header.
-         */
-        public void buildHeader(XMLNode node) {
-                writer.writeHeader(
-                        classDoc,
-                        configuration.getText("doclet.Constructor_Detail"));
+        int size = constructors.size();
+        if (size > 0) {
+            Content constructorDetailsTree = writer.getConstructorDetailsTreeHeader(
+                    classDoc, memberDetailsTree);
+            for (currentConstructorIndex = 0; currentConstructorIndex < size;
+                    currentConstructorIndex++) {
+                Content constructorDocTree = writer.getConstructorDocTreeHeader(
+                        (ConstructorDoc) constructors.get(currentConstructorIndex),
+                        constructorDetailsTree);
+                buildChildren(node, constructorDocTree);
+                constructorDetailsTree.addContent(writer.getConstructorDoc(
+                        constructorDocTree, (currentConstructorIndex == size - 1)));
+            }
+            memberDetailsTree.addContent(
+                    writer.getConstructorDetails(constructorDetailsTree));
         }
+    }
 
-        /**
-         * Build the header for the individual constructor.
-         */
-        public void buildConstructorHeader(XMLNode node) {
-                writer.writeConstructorHeader(
-                        (ConstructorDoc) constructors.get(currentMethodIndex),
-                        currentMethodIndex == 0);
-        }
+    /**
+     * Build the signature.
+     *
+     * @param node the XML element that specifies which components to document
+     * @param constructorDocTree the content tree to which the documentation will be added
+     */
+    public void buildSignature(XMLNode node, Content constructorDocTree) {
+        constructorDocTree.addContent(
+                writer.getSignature(
+                (ConstructorDoc) constructors.get(currentConstructorIndex)));
+    }
 
-        /**
-         * Build the signature.
-         */
-        public void buildSignature(XMLNode node) {
-                writer.writeSignature(
-                        (ConstructorDoc) constructors.get(currentMethodIndex));
-        }
-
-        /**
-         * Build the deprecation information.
-         */
-        public void buildDeprecationInfo(XMLNode node) {
-                writer.writeDeprecated(
-                        (ConstructorDoc) constructors.get(currentMethodIndex));
-        }
+    /**
+     * Build the deprecation information.
+     *
+     * @param node the XML element that specifies which components to document
+     * @param constructorDocTree the content tree to which the documentation will be added
+     */
+    public void buildDeprecationInfo(XMLNode node, Content constructorDocTree) {
+        writer.addDeprecated(
+                (ConstructorDoc) constructors.get(currentConstructorIndex), constructorDocTree);
+    }
 
-        /**
-         * Build the comments for the constructor.  Do nothing if
-         * {@link Configuration#nocomment} is set to true.
-         */
-        public void buildConstructorComments(XMLNode node) {
-                if (!configuration.nocomment) {
-                        writer.writeComments(
-                                (ConstructorDoc) constructors.get(currentMethodIndex));
-                }
+    /**
+     * Build the comments for the constructor.  Do nothing if
+     * {@link Configuration#nocomment} is set to true.
+     *
+     * @param node the XML element that specifies which components to document
+     * @param constructorDocTree the content tree to which the documentation will be added
+     */
+    public void buildConstructorComments(XMLNode node, Content constructorDocTree) {
+        if (!configuration.nocomment) {
+            writer.addComments(
+                    (ConstructorDoc) constructors.get(currentConstructorIndex),
+                    constructorDocTree);
         }
+    }
 
-        /**
-         * Build the tag information.
-         */
-        public void buildTagInfo(XMLNode node) {
-                writer.writeTags((ConstructorDoc) constructors.get(currentMethodIndex));
-        }
-
-        /**
-         * Build the footer for the individual constructor.
-         */
-        public void buildConstructorFooter(XMLNode node) {
-                writer.writeConstructorFooter();
-        }
-
-        /**
-         * Build the overall footer.
-         */
-        public void buildFooter(XMLNode node) {
-                writer.writeFooter(classDoc);
-        }
+    /**
+     * Build the tag information.
+     *
+     * @param node the XML element that specifies which components to document
+     * @param constructorDocTree the content tree to which the documentation will be added
+     */
+    public void buildTagInfo(XMLNode node, Content constructorDocTree) {
+        writer.addTags((ConstructorDoc) constructors.get(currentConstructorIndex),
+                constructorDocTree);
+    }
 }
--- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/EnumConstantBuilder.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/EnumConstantBuilder.java	Mon Dec 20 21:10:57 2010 -0800
@@ -25,10 +25,10 @@
 
 package com.sun.tools.doclets.internal.toolkit.builders;
 
+import java.util.*;
 import com.sun.tools.doclets.internal.toolkit.util.*;
 import com.sun.tools.doclets.internal.toolkit.*;
 import com.sun.javadoc.*;
-import java.util.*;
 
 /**
  * Builds documentation for a enum constants.
@@ -38,200 +38,195 @@
  * Do not use it as an API
  *
  * @author Jamie Ho
+ * @author Bhavesh Patel (Modified)
  * @since 1.5
  */
 public class EnumConstantBuilder extends AbstractMemberBuilder {
 
-        /**
-         * The class whose enum constants are being documented.
-         */
-        private ClassDoc classDoc;
+    /**
+     * The class whose enum constants are being documented.
+     */
+    private ClassDoc classDoc;
 
-        /**
-         * The visible enum constantss for the given class.
-         */
-        private VisibleMemberMap visibleMemberMap;
+    /**
+     * The visible enum constantss for the given class.
+     */
+    private VisibleMemberMap visibleMemberMap;
 
-        /**
-         * The writer to output the enum constants documentation.
-         */
-        private EnumConstantWriter writer;
+    /**
+     * The writer to output the enum constants documentation.
+     */
+    private EnumConstantWriter writer;
 
-        /**
-         * The list of enum constants being documented.
-         */
-        private List<ProgramElementDoc> enumConstants;
+    /**
+     * The list of enum constants being documented.
+     */
+    private List<ProgramElementDoc> enumConstants;
 
-        /**
-         * The index of the current enum constant that is being documented at this point
-         * in time.
-         */
-        private int currentEnumConstantsIndex;
+    /**
+     * The index of the current enum constant that is being documented at this point
+     * in time.
+     */
+    private int currentEnumConstantsIndex;
 
-        /**
-         * Construct a new EnumConstantsBuilder.
-         *
-         * @param configuration the current configuration of the
-         *                      doclet.
-         */
-        private EnumConstantBuilder(Configuration configuration) {
-                super(configuration);
-        }
+    /**
+     * Construct a new EnumConstantsBuilder.
+     *
+     * @param configuration the current configuration of the
+     *                      doclet.
+     */
+    private EnumConstantBuilder(Configuration configuration) {
+        super(configuration);
+    }
 
-        /**
-         * Construct a new EnumConstantsBuilder.
-         *
-         * @param configuration the current configuration of the doclet.
-         * @param classDoc the class whoses members are being documented.
-         * @param writer the doclet specific writer.
-         */
-        public static EnumConstantBuilder getInstance(
-                Configuration configuration,
-                ClassDoc classDoc,
-                EnumConstantWriter writer) {
-                EnumConstantBuilder builder = new EnumConstantBuilder(configuration);
-                builder.classDoc = classDoc;
-                builder.writer = writer;
-                builder.visibleMemberMap =
-                        new VisibleMemberMap(
-                                classDoc,
-                                VisibleMemberMap.ENUM_CONSTANTS,
-                                configuration.nodeprecated);
-                builder.enumConstants =
-                        new ArrayList<ProgramElementDoc>(builder.visibleMemberMap.getMembersFor(classDoc));
-                if (configuration.getMemberComparator() != null) {
-                        Collections.sort(
-                                builder.enumConstants,
-                                configuration.getMemberComparator());
-                }
-                return builder;
+    /**
+     * Construct a new EnumConstantsBuilder.
+     *
+     * @param configuration the current configuration of the doclet.
+     * @param classDoc the class whoses members are being documented.
+     * @param writer the doclet specific writer.
+     */
+    public static EnumConstantBuilder getInstance(
+            Configuration configuration,
+            ClassDoc classDoc,
+            EnumConstantWriter writer) {
+        EnumConstantBuilder builder = new EnumConstantBuilder(configuration);
+        builder.classDoc = classDoc;
+        builder.writer = writer;
+        builder.visibleMemberMap =
+                new VisibleMemberMap(
+                classDoc,
+                VisibleMemberMap.ENUM_CONSTANTS,
+                configuration.nodeprecated);
+        builder.enumConstants =
+                new ArrayList<ProgramElementDoc>(builder.visibleMemberMap.getMembersFor(classDoc));
+        if (configuration.getMemberComparator() != null) {
+            Collections.sort(
+                    builder.enumConstants,
+                    configuration.getMemberComparator());
         }
+        return builder;
+    }
 
-        /**
-         * {@inheritDoc}
-         */
-        public String getName() {
-                return "EnumConstantDetails";
-        }
+    /**
+     * {@inheritDoc}
+     */
+    public String getName() {
+        return "EnumConstantDetails";
+    }
 
-        /**
-         * Returns a list of enum constants that will be documented for the given class.
-         * This information can be used for doclet specific documentation
-         * generation.
-         *
-         * @param classDoc the {@link ClassDoc} we want to check.
-         * @return a list of enum constants that will be documented.
-         */
-        public List<ProgramElementDoc> members(ClassDoc classDoc) {
-                return visibleMemberMap.getMembersFor(classDoc);
-        }
+    /**
+     * Returns a list of enum constants that will be documented for the given class.
+     * This information can be used for doclet specific documentation
+     * generation.
+     *
+     * @param classDoc the {@link ClassDoc} we want to check.
+     * @return a list of enum constants that will be documented.
+     */
+    public List<ProgramElementDoc> members(ClassDoc classDoc) {
+        return visibleMemberMap.getMembersFor(classDoc);
+    }
 
-        /**
-         * Returns the visible member map for the enum constants of this class.
-         *
-         * @return the visible member map for the enum constants of this class.
-         */
-        public VisibleMemberMap getVisibleMemberMap() {
-                return visibleMemberMap;
-        }
+    /**
+     * Returns the visible member map for the enum constants of this class.
+     *
+     * @return the visible member map for the enum constants of this class.
+     */
+    public VisibleMemberMap getVisibleMemberMap() {
+        return visibleMemberMap;
+    }
 
-        /**
-         * summaryOrder.size()
-         */
-        public boolean hasMembersToDocument() {
-                return enumConstants.size() > 0;
-        }
-
-        /**
-         * Build the enum constant documentation.
-         *
-         * @param elements the XML elements that specify how to construct this
-         *                documentation.
-         */
-        public void buildEnumConstant(XMLNode node) {
-                if (writer == null) {
-                        return;
-                }
-                for (currentEnumConstantsIndex = 0;
-                        currentEnumConstantsIndex < enumConstants.size();
-                        currentEnumConstantsIndex++) {
-                        buildChildren(node);
-                }
-        }
+    /**
+     * summaryOrder.size()
+     */
+    public boolean hasMembersToDocument() {
+        return enumConstants.size() > 0;
+    }
 
-        /**
-         * Build the overall header.
-         */
-        public void buildHeader(XMLNode node) {
-                writer.writeHeader(
-                        classDoc,
-                        configuration.getText("doclet.Enum_Constant_Detail"));
+    /**
+     * Build the enum constant documentation.
+     *
+     * @param node the XML element that specifies which components to document
+     * @param memberDetailsTree the content tree to which the documentation will be added
+     */
+    public void buildEnumConstant(XMLNode node, Content memberDetailsTree) {
+        if (writer == null) {
+            return;
         }
+        int size = enumConstants.size();
+        if (size > 0) {
+            Content enumConstantsDetailsTree = writer.getEnumConstantsDetailsTreeHeader(
+                    classDoc, memberDetailsTree);
+            for (currentEnumConstantsIndex = 0; currentEnumConstantsIndex < size;
+                    currentEnumConstantsIndex++) {
+                Content enumConstantsTree = writer.getEnumConstantsTreeHeader(
+                        (FieldDoc) enumConstants.get(currentEnumConstantsIndex),
+                        enumConstantsDetailsTree);
+                buildChildren(node, enumConstantsTree);
+                enumConstantsDetailsTree.addContent(writer.getEnumConstants(
+                        enumConstantsTree, (currentEnumConstantsIndex == size - 1)));
+            }
+            memberDetailsTree.addContent(
+                    writer.getEnumConstantsDetails(enumConstantsDetailsTree));
+        }
+    }
 
-        /**
-         * Build the header for the individual enum constants.
-         */
-        public void buildEnumConstantHeader(XMLNode node) {
-                writer.writeEnumConstantHeader(
-                        (FieldDoc) enumConstants.get(currentEnumConstantsIndex),
-                        currentEnumConstantsIndex == 0);
-        }
-
-        /**
-         * Build the signature.
-         */
-        public void buildSignature(XMLNode node) {
-                writer.writeSignature(
-                        (FieldDoc) enumConstants.get(currentEnumConstantsIndex));
-        }
+    /**
+     * Build the signature.
+     *
+     * @param node the XML element that specifies which components to document
+     * @param enumConstantsTree the content tree to which the documentation will be added
+     */
+    public void buildSignature(XMLNode node, Content enumConstantsTree) {
+        enumConstantsTree.addContent(writer.getSignature(
+                (FieldDoc) enumConstants.get(currentEnumConstantsIndex)));
+    }
 
-        /**
-         * Build the deprecation information.
-         */
-        public void buildDeprecationInfo(XMLNode node) {
-                writer.writeDeprecated(
-                        (FieldDoc) enumConstants.get(currentEnumConstantsIndex));
-        }
-
-        /**
-         * Build the comments for the enum constant.  Do nothing if
-         * {@link Configuration#nocomment} is set to true.
-         */
-        public void buildEnumConstantComments(XMLNode node) {
-                if (!configuration.nocomment) {
-                        writer.writeComments(
-                                (FieldDoc) enumConstants.get(currentEnumConstantsIndex));
-                }
-        }
+    /**
+     * Build the deprecation information.
+     *
+     * @param node the XML element that specifies which components to document
+     * @param enumConstantsTree the content tree to which the documentation will be added
+     */
+    public void buildDeprecationInfo(XMLNode node, Content enumConstantsTree) {
+        writer.addDeprecated(
+                (FieldDoc) enumConstants.get(currentEnumConstantsIndex),
+                enumConstantsTree);
+    }
 
-        /**
-         * Build the tag information.
-         */
-        public void buildTagInfo(XMLNode node) {
-                writer.writeTags(
-                        (FieldDoc) enumConstants.get(currentEnumConstantsIndex));
+    /**
+     * Build the comments for the enum constant.  Do nothing if
+     * {@link Configuration#nocomment} is set to true.
+     *
+     * @param node the XML element that specifies which components to document
+     * @param enumConstantsTree the content tree to which the documentation will be added
+     */
+    public void buildEnumConstantComments(XMLNode node, Content enumConstantsTree) {
+        if (!configuration.nocomment) {
+            writer.addComments(
+                    (FieldDoc) enumConstants.get(currentEnumConstantsIndex),
+                    enumConstantsTree);
         }
-
-        /**
-         * Build the footer for the individual enum constants.
-         */
-        public void buildEnumConstantFooter(XMLNode node) {
-                writer.writeEnumConstantFooter();
-        }
+    }
 
-        /**
-         * Build the overall footer.
-         */
-        public void buildFooter(XMLNode node) {
-                writer.writeFooter(classDoc);
-        }
+    /**
+     * Build the tag information.
+     *
+     * @param node the XML element that specifies which components to document
+     * @param enumConstantsTree the content tree to which the documentation will be added
+     */
+    public void buildTagInfo(XMLNode node, Content enumConstantsTree) {
+        writer.addTags(
+                (FieldDoc) enumConstants.get(currentEnumConstantsIndex),
+                enumConstantsTree);
+    }
 
-        /**
-         * Return the enum constant writer for this builder.
-         *
-         * @return the enum constant writer for this builder.
-         */
-        public EnumConstantWriter getWriter() {
-                return writer;
-        }
+    /**
+     * Return the enum constant writer for this builder.
+     *
+     * @return the enum constant writer for this builder.
+     */
+    public EnumConstantWriter getWriter() {
+        return writer;
+    }
 }
--- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/FieldBuilder.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/FieldBuilder.java	Mon Dec 20 21:10:57 2010 -0800
@@ -25,10 +25,10 @@
 
 package com.sun.tools.doclets.internal.toolkit.builders;
 
+import java.util.*;
 import com.sun.tools.doclets.internal.toolkit.util.*;
 import com.sun.tools.doclets.internal.toolkit.*;
 import com.sun.javadoc.*;
-import java.util.*;
 
 /**
  * Builds documentation for a field.
@@ -38,197 +38,191 @@
  * Do not use it as an API
  *
  * @author Jamie Ho
+ * @author Bhavesh Patel (Modified)
  * @since 1.5
  */
 public class FieldBuilder extends AbstractMemberBuilder {
 
-        /**
-         * The class whose fields are being documented.
-         */
-        private ClassDoc classDoc;
+    /**
+     * The class whose fields are being documented.
+     */
+    private ClassDoc classDoc;
 
-        /**
-         * The visible fields for the given class.
-         */
-        private VisibleMemberMap visibleMemberMap;
+    /**
+     * The visible fields for the given class.
+     */
+    private VisibleMemberMap visibleMemberMap;
 
-        /**
-         * The writer to output the field documentation.
-         */
-        private FieldWriter writer;
+    /**
+     * The writer to output the field documentation.
+     */
+    private FieldWriter writer;
 
-        /**
-         * The list of fields being documented.
-         */
-        private List<ProgramElementDoc> fields;
+    /**
+     * The list of fields being documented.
+     */
+    private List<ProgramElementDoc> fields;
 
-        /**
-         * The index of the current field that is being documented at this point
-         * in time.
-         */
-        private int currentFieldIndex;
+    /**
+     * The index of the current field that is being documented at this point
+     * in time.
+     */
+    private int currentFieldIndex;
 
-        /**
-         * Construct a new FieldBuilder.
-         *
-         * @param configuration the current configuration of the
-         *                      doclet.
-         */
-        private FieldBuilder(Configuration configuration) {
-                super(configuration);
-        }
+    /**
+     * Construct a new FieldBuilder.
+     *
+     * @param configuration the current configuration of the
+     *                      doclet.
+     */
+    private FieldBuilder(Configuration configuration) {
+        super(configuration);
+    }
 
-        /**
-         * Construct a new FieldBuilder.
-         *
-         * @param configuration the current configuration of the doclet.
-         * @param classDoc the class whoses members are being documented.
-         * @param writer the doclet specific writer.
-         */
-        public static FieldBuilder getInstance(
-                Configuration configuration,
-                ClassDoc classDoc,
-                FieldWriter writer) {
-                FieldBuilder builder = new FieldBuilder(configuration);
-                builder.classDoc = classDoc;
-                builder.writer = writer;
-                builder.visibleMemberMap =
-                        new VisibleMemberMap(
-                                classDoc,
-                                VisibleMemberMap.FIELDS,
-                                configuration.nodeprecated);
-                builder.fields =
-                        new ArrayList<ProgramElementDoc>(builder.visibleMemberMap.getLeafClassMembers(
-                            configuration));
-                if (configuration.getMemberComparator() != null) {
-                        Collections.sort(
-                                builder.fields,
-                                configuration.getMemberComparator());
-                }
-                return builder;
+    /**
+     * Construct a new FieldBuilder.
+     *
+     * @param configuration the current configuration of the doclet.
+     * @param classDoc the class whoses members are being documented.
+     * @param writer the doclet specific writer.
+     */
+    public static FieldBuilder getInstance(
+            Configuration configuration,
+            ClassDoc classDoc,
+            FieldWriter writer) {
+        FieldBuilder builder = new FieldBuilder(configuration);
+        builder.classDoc = classDoc;
+        builder.writer = writer;
+        builder.visibleMemberMap =
+                new VisibleMemberMap(
+                classDoc,
+                VisibleMemberMap.FIELDS,
+                configuration.nodeprecated);
+        builder.fields =
+                new ArrayList<ProgramElementDoc>(builder.visibleMemberMap.getLeafClassMembers(
+                configuration));
+        if (configuration.getMemberComparator() != null) {
+            Collections.sort(
+                    builder.fields,
+                    configuration.getMemberComparator());
         }
+        return builder;
+    }
 
-        /**
-         * {@inheritDoc}
-         */
-        public String getName() {
-                return "FieldDetails";
-        }
+    /**
+     * {@inheritDoc}
+     */
+    public String getName() {
+        return "FieldDetails";
+    }
 
-        /**
-         * Returns a list of fields that will be documented for the given class.
-         * This information can be used for doclet specific documentation
-         * generation.
-         *
-         * @param classDoc the {@link ClassDoc} we want to check.
-         * @return a list of fields that will be documented.
-         */
-        public List<ProgramElementDoc> members(ClassDoc classDoc) {
-                return visibleMemberMap.getMembersFor(classDoc);
-        }
-
-        /**
-         * Returns the visible member map for the fields of this class.
-         *
-         * @return the visible member map for the fields of this class.
-         */
-        public VisibleMemberMap getVisibleMemberMap() {
-                return visibleMemberMap;
-        }
+    /**
+     * Returns a list of fields that will be documented for the given class.
+     * This information can be used for doclet specific documentation
+     * generation.
+     *
+     * @param classDoc the {@link ClassDoc} we want to check.
+     * @return a list of fields that will be documented.
+     */
+    public List<ProgramElementDoc> members(ClassDoc classDoc) {
+        return visibleMemberMap.getMembersFor(classDoc);
+    }
 
-        /**
-         * summaryOrder.size()
-         */
-        public boolean hasMembersToDocument() {
-                return fields.size() > 0;
-        }
+    /**
+     * Returns the visible member map for the fields of this class.
+     *
+     * @return the visible member map for the fields of this class.
+     */
+    public VisibleMemberMap getVisibleMemberMap() {
+        return visibleMemberMap;
+    }
 
-        /**
-         * Build the field documentation.
-         *
-         * @param elements the XML elements that specify how to construct this
-         *                documentation.
-         */
-        public void buildFieldDoc(XMLNode node) {
-                if (writer == null) {
-                        return;
-                }
-                for (currentFieldIndex = 0;
-                        currentFieldIndex < fields.size();
-                        currentFieldIndex++) {
-                        buildChildren(node);
-                }
-        }
+    /**
+     * summaryOrder.size()
+     */
+    public boolean hasMembersToDocument() {
+        return fields.size() > 0;
+    }
 
-        /**
-         * Build the overall header.
-         */
-        public void buildHeader(XMLNode node) {
-                writer.writeHeader(
-                        classDoc,
-                        configuration.getText("doclet.Field_Detail"));
+    /**
+     * Build the field documentation.
+     *
+     * @param node the XML element that specifies which components to document
+     * @param memberDetailsTree the content tree to which the documentation will be added
+     */
+    public void buildFieldDoc(XMLNode node, Content memberDetailsTree) {
+        if (writer == null) {
+            return;
         }
-
-        /**
-         * Build the header for the individual field.
-         */
-        public void buildFieldHeader(XMLNode node) {
-                writer.writeFieldHeader(
+        int size = fields.size();
+        if (size > 0) {
+            Content fieldDetailsTree = writer.getFieldDetailsTreeHeader(
+                    classDoc, memberDetailsTree);
+            for (currentFieldIndex = 0; currentFieldIndex < size;
+                    currentFieldIndex++) {
+                Content fieldDocTree = writer.getFieldDocTreeHeader(
                         (FieldDoc) fields.get(currentFieldIndex),
-                        currentFieldIndex == 0);
-        }
-
-        /**
-         * Build the signature.
-         */
-        public void buildSignature(XMLNode node) {
-                writer.writeSignature((FieldDoc) fields.get(currentFieldIndex));
+                        fieldDetailsTree);
+                buildChildren(node, fieldDocTree);
+                fieldDetailsTree.addContent(writer.getFieldDoc(
+                        fieldDocTree, (currentFieldIndex == size - 1)));
+            }
+            memberDetailsTree.addContent(
+                    writer.getFieldDetails(fieldDetailsTree));
         }
+    }
 
-        /**
-         * Build the deprecation information.
-         */
-        public void buildDeprecationInfo(XMLNode node) {
-                writer.writeDeprecated((FieldDoc) fields.get(currentFieldIndex));
-        }
+    /**
+     * Build the signature.
+     *
+     * @param node the XML element that specifies which components to document
+     * @param fieldDocTree the content tree to which the documentation will be added
+     */
+    public void buildSignature(XMLNode node, Content fieldDocTree) {
+        fieldDocTree.addContent(
+                writer.getSignature((FieldDoc) fields.get(currentFieldIndex)));
+    }
 
-        /**
-         * Build the comments for the field.  Do nothing if
-         * {@link Configuration#nocomment} is set to true.
-         */
-        public void buildFieldComments(XMLNode node) {
-                if (!configuration.nocomment) {
-                        writer.writeComments((FieldDoc) fields.get(currentFieldIndex));
-                }
-        }
+    /**
+     * Build the deprecation information.
+     *
+     * @param node the XML element that specifies which components to document
+     * @param fieldDocTree the content tree to which the documentation will be added
+     */
+    public void buildDeprecationInfo(XMLNode node, Content fieldDocTree) {
+        writer.addDeprecated(
+                (FieldDoc) fields.get(currentFieldIndex), fieldDocTree);
+    }
 
-        /**
-         * Build the tag information.
-         */
-        public void buildTagInfo(XMLNode node) {
-                writer.writeTags((FieldDoc) fields.get(currentFieldIndex));
+    /**
+     * Build the comments for the field.  Do nothing if
+     * {@link Configuration#nocomment} is set to true.
+     *
+     * @param node the XML element that specifies which components to document
+     * @param fieldDocTree the content tree to which the documentation will be added
+     */
+    public void buildFieldComments(XMLNode node, Content fieldDocTree) {
+        if (!configuration.nocomment) {
+            writer.addComments((FieldDoc) fields.get(currentFieldIndex), fieldDocTree);
         }
-
-        /**
-         * Build the footer for the individual field.
-         */
-        public void buildFieldFooter(XMLNode node) {
-                writer.writeFieldFooter();
-        }
+    }
 
-        /**
-         * Build the overall footer.
-         */
-        public void buildFooter(XMLNode node) {
-                writer.writeFooter(classDoc);
-        }
+    /**
+     * Build the tag information.
+     *
+     * @param node the XML element that specifies which components to document
+     * @param fieldDocTree the content tree to which the documentation will be added
+     */
+    public void buildTagInfo(XMLNode node, Content fieldDocTree) {
+        writer.addTags((FieldDoc) fields.get(currentFieldIndex), fieldDocTree);
+    }
 
-        /**
-         * Return the field writer for this builder.
-         *
-         * @return the field writer for this builder.
-         */
-        public FieldWriter getWriter() {
-                return writer;
-        }
+    /**
+     * Return the field writer for this builder.
+     *
+     * @return the field writer for this builder.
+     */
+    public FieldWriter getWriter() {
+        return writer;
+    }
 }
--- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/LayoutParser.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/LayoutParser.java	Mon Dec 20 21:10:57 2010 -0800
@@ -76,7 +76,7 @@
     /**
      * Parse the XML specifying the layout of the documentation.
      *
-     * @return List the list of XML elements parsed.
+     * @return the list of XML elements parsed.
      */
     public XMLNode parseXML(String root) {
         if (xmlElementsMap.containsKey(root)) {
--- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/MemberSummaryBuilder.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/MemberSummaryBuilder.java	Mon Dec 20 21:10:57 2010 -0800
@@ -25,10 +25,10 @@
 
 package com.sun.tools.doclets.internal.toolkit.builders;
 
+import java.util.*;
 import com.sun.tools.doclets.internal.toolkit.util.*;
 import com.sun.tools.doclets.internal.toolkit.*;
 import com.sun.javadoc.*;
-import java.util.*;
 
 /**
  * Builds the member summary.
@@ -38,49 +38,50 @@
  * Do not use it as an API
  *
  * @author Jamie Ho
+ * @author Bhavesh Patel (Modified)
  * @since 1.5
  */
 public class MemberSummaryBuilder extends AbstractMemberBuilder {
 
-        /**
-         * The XML root for this builder.
-         */
-        public static final String NAME = "MemberSummary";
+    /**
+     * The XML root for this builder.
+     */
+    public static final String NAME = "MemberSummary";
 
-        /**
-         * The visible members for the given class.
-         */
-        private VisibleMemberMap[] visibleMemberMaps;
+    /**
+     * The visible members for the given class.
+     */
+    private VisibleMemberMap[] visibleMemberMaps;
 
-        /**
-         * The member summary writers for the given class.
-         */
-        private MemberSummaryWriter[] memberSummaryWriters;
+    /**
+     * The member summary writers for the given class.
+     */
+    private MemberSummaryWriter[] memberSummaryWriters;
 
-        /**
-         * The type being documented.
-         */
-        private ClassDoc classDoc;
+    /**
+     * The type being documented.
+     */
+    private ClassDoc classDoc;
 
-        private MemberSummaryBuilder(Configuration configuration) {
-                super(configuration);
-        }
+    private MemberSummaryBuilder(Configuration configuration) {
+        super(configuration);
+    }
 
-        /**
-         * Construct a new MemberSummaryBuilder.
-         *
-         * @param classWriter   the writer for the class whose members are being
-         *                      summarized.
-         * @param configuration the current configuration of the doclet.
-         */
-        public static MemberSummaryBuilder getInstance(
-                ClassWriter classWriter, Configuration configuration)
-        throws Exception {
-                MemberSummaryBuilder builder = new MemberSummaryBuilder(configuration);
-                builder.classDoc = classWriter.getClassDoc();
-                builder.init(classWriter);
-                return builder;
-        }
+    /**
+     * Construct a new MemberSummaryBuilder.
+     *
+     * @param classWriter   the writer for the class whose members are being
+     *                      summarized.
+     * @param configuration the current configuration of the doclet.
+     */
+    public static MemberSummaryBuilder getInstance(
+            ClassWriter classWriter, Configuration configuration)
+            throws Exception {
+        MemberSummaryBuilder builder = new MemberSummaryBuilder(configuration);
+        builder.classDoc = classWriter.getClassDoc();
+        builder.init(classWriter);
+        return builder;
+    }
 
     /**
      * Construct a new MemberSummaryBuilder.
@@ -90,8 +91,8 @@
      * @param configuration the current configuration of the doclet.
      */
     public static MemberSummaryBuilder getInstance(
-        AnnotationTypeWriter annotationTypeWriter, Configuration configuration)
-    throws Exception {
+            AnnotationTypeWriter annotationTypeWriter, Configuration configuration)
+            throws Exception {
         MemberSummaryBuilder builder = new MemberSummaryBuilder(configuration);
         builder.classDoc = annotationTypeWriter.getAnnotationTypeDoc();
         builder.init(annotationTypeWriter);
@@ -100,200 +101,209 @@
 
     private void init(Object writer) throws Exception {
         visibleMemberMaps =
-            new VisibleMemberMap[VisibleMemberMap.NUM_MEMBER_TYPES];
+                new VisibleMemberMap[VisibleMemberMap.NUM_MEMBER_TYPES];
         for (int i = 0; i < VisibleMemberMap.NUM_MEMBER_TYPES; i++) {
             visibleMemberMaps[i] =
-                new VisibleMemberMap(
+                    new VisibleMemberMap(
                     classDoc,
                     i,
                     configuration.nodeprecated);
         }
         memberSummaryWriters =
-            new MemberSummaryWriter[VisibleMemberMap.NUM_MEMBER_TYPES];
+                new MemberSummaryWriter[VisibleMemberMap.NUM_MEMBER_TYPES];
         for (int i = 0; i < VisibleMemberMap.NUM_MEMBER_TYPES; i++) {
             if (classDoc.isAnnotationType()) {
                 memberSummaryWriters[i] =
                     visibleMemberMaps[i].noVisibleMembers()?
                         null :
                         configuration.getWriterFactory().getMemberSummaryWriter(
-                            (AnnotationTypeWriter) writer, i);
+                        (AnnotationTypeWriter) writer, i);
             } else {
                 memberSummaryWriters[i] =
                     visibleMemberMaps[i].noVisibleMembers()?
                         null :
                         configuration.getWriterFactory().getMemberSummaryWriter(
-                            (ClassWriter) writer, i);
+                        (ClassWriter) writer, i);
             }
         }
 
     }
 
-        /**
-         * {@inheritDoc}
-         */
-        public String getName() {
-                return NAME;
-        }
+    /**
+     * {@inheritDoc}
+     */
+    public String getName() {
+        return NAME;
+    }
 
-        /**
-         * Return the specified visible member map.
-         *
-         * @param type the type of visible member map to return.
-         * @return the specified visible member map.
-         * @throws ArrayIndexOutOfBoundsException when the type is invalid.
-         * @see VisibleMemberMap
-         */
-        public VisibleMemberMap getVisibleMemberMap(int type) {
-                return visibleMemberMaps[type];
-        }
+    /**
+     * Return the specified visible member map.
+     *
+     * @param type the type of visible member map to return.
+     * @return the specified visible member map.
+     * @throws ArrayIndexOutOfBoundsException when the type is invalid.
+     * @see VisibleMemberMap
+     */
+    public VisibleMemberMap getVisibleMemberMap(int type) {
+        return visibleMemberMaps[type];
+    }
 
-        /**
-         * Return the specified member summary writer.
-         *
-         * @param type the type of member summary writer to return.
-         * @return the specified member summary writer.
-         * @throws ArrayIndexOutOfBoundsException when the type is invalid.
-         * @see VisibleMemberMap
-         */
-        public MemberSummaryWriter getMemberSummaryWriter(int type) {
-                return memberSummaryWriters[type];
-        }
+    /**
+     * Return the specified member summary writer.
+     *
+     * @param type the type of member summary writer to return.
+     * @return the specified member summary writer.
+     * @throws ArrayIndexOutOfBoundsException when the type is invalid.
+     * @see VisibleMemberMap
+     */
+    public MemberSummaryWriter getMemberSummaryWriter(int type) {
+        return memberSummaryWriters[type];
+    }
 
-        /**
-         * Returns a list of methods that will be documented for the given class.
-         * This information can be used for doclet specific documentation
-         * generation.
-         *
-         * @param classDoc the {@link ClassDoc} we want to check.
-         * @param type the type of members to return.
-         * @return a list of methods that will be documented.
-         * @see VisibleMemberMap
-         */
-        public List<ProgramElementDoc> members(int type) {
-                return visibleMemberMaps[type].getLeafClassMembers(configuration);
-        }
+    /**
+     * Returns a list of methods that will be documented for the given class.
+     * This information can be used for doclet specific documentation
+     * generation.
+     *
+     * @param classDoc the {@link ClassDoc} we want to check.
+     * @param type the type of members to return.
+     * @return a list of methods that will be documented.
+     * @see VisibleMemberMap
+     */
+    public List<ProgramElementDoc> members(int type) {
+        return visibleMemberMaps[type].getLeafClassMembers(configuration);
+    }
 
-        /**
-         * Return true it there are any members to summarize.
-         *
-         * @return true if there are any members to summarize.
-         */
-        public boolean hasMembersToDocument() {
+    /**
+     * Return true it there are any members to summarize.
+     *
+     * @return true if there are any members to summarize.
+     */
+    public boolean hasMembersToDocument() {
         if (classDoc instanceof AnnotationTypeDoc) {
             return ((AnnotationTypeDoc) classDoc).elements().length > 0;
         }
-                for (int i = 0; i < VisibleMemberMap.NUM_MEMBER_TYPES; i++) {
-                        VisibleMemberMap members = visibleMemberMaps[i];
-                        if (!members.noVisibleMembers()) {
-                                return true;
-                        }
-                }
-                return false;
+        for (int i = 0; i < VisibleMemberMap.NUM_MEMBER_TYPES; i++) {
+            VisibleMemberMap members = visibleMemberMaps[i];
+            if (!members.noVisibleMembers()) {
+                return true;
+            }
         }
-
-        /**
-         * Build the summary for the enum constants.
-         */
-        public void buildEnumConstantsSummary(XMLNode node) {
-                buildSummary(
-                        memberSummaryWriters[VisibleMemberMap.ENUM_CONSTANTS],
-                        visibleMemberMaps[VisibleMemberMap.ENUM_CONSTANTS]);
-        }
+        return false;
+    }
 
     /**
-     * Build the summary for the optional members.
+     * Build the summary for the enum constants.
+     *
+     * @param node the XML element that specifies which components to document
+     * @param memberSummaryTree the content tree to which the documentation will be added
      */
-    public void buildAnnotationTypeOptionalMemberSummary(XMLNode node) {
-        buildSummary(
-            memberSummaryWriters[VisibleMemberMap.ANNOTATION_TYPE_MEMBER_OPTIONAL],
-                visibleMemberMaps[VisibleMemberMap.ANNOTATION_TYPE_MEMBER_OPTIONAL]);
+    public void buildEnumConstantsSummary(XMLNode node, Content memberSummaryTree) {
+        MemberSummaryWriter writer =
+                memberSummaryWriters[VisibleMemberMap.ENUM_CONSTANTS];
+        VisibleMemberMap visibleMemberMap =
+                visibleMemberMaps[VisibleMemberMap.ENUM_CONSTANTS];
+        addSummary(writer, visibleMemberMap, false, memberSummaryTree);
     }
 
     /**
      * Build the summary for the optional members.
+     *
+     * @param node the XML element that specifies which components to document
+     * @param memberSummaryTree the content tree to which the documentation will be added
      */
-    public void buildAnnotationTypeRequiredMemberSummary(XMLNode node) {
-        buildSummary(
-            memberSummaryWriters[VisibleMemberMap.ANNOTATION_TYPE_MEMBER_REQUIRED],
-                visibleMemberMaps[VisibleMemberMap.ANNOTATION_TYPE_MEMBER_REQUIRED]);
+    public void buildAnnotationTypeOptionalMemberSummary(XMLNode node, Content memberSummaryTree) {
+        MemberSummaryWriter writer =
+                memberSummaryWriters[VisibleMemberMap.ANNOTATION_TYPE_MEMBER_OPTIONAL];
+        VisibleMemberMap visibleMemberMap =
+                visibleMemberMaps[VisibleMemberMap.ANNOTATION_TYPE_MEMBER_OPTIONAL];
+        addSummary(writer, visibleMemberMap, false, memberSummaryTree);
+    }
+
+    /**
+     * Build the summary for the optional members.
+     *
+     * @param node the XML element that specifies which components to document
+     * @param memberSummaryTree the content tree to which the documentation will be added
+     */
+    public void buildAnnotationTypeRequiredMemberSummary(XMLNode node, Content memberSummaryTree) {
+        MemberSummaryWriter writer =
+                memberSummaryWriters[VisibleMemberMap.ANNOTATION_TYPE_MEMBER_REQUIRED];
+        VisibleMemberMap visibleMemberMap =
+                visibleMemberMaps[VisibleMemberMap.ANNOTATION_TYPE_MEMBER_REQUIRED];
+        addSummary(writer, visibleMemberMap, false, memberSummaryTree);
+    }
+
+    /**
+     * Build the summary for the fields.
+     *
+     * @param node the XML element that specifies which components to document
+     * @param memberSummaryTree the content tree to which the documentation will be added
+     */
+    public void buildFieldsSummary(XMLNode node, Content memberSummaryTree) {
+        MemberSummaryWriter writer =
+                memberSummaryWriters[VisibleMemberMap.FIELDS];
+        VisibleMemberMap visibleMemberMap =
+                visibleMemberMaps[VisibleMemberMap.FIELDS];
+        addSummary(writer, visibleMemberMap, true, memberSummaryTree);
     }
 
-        /**
-         * Build the summary for the fields.
-         */
-        public void buildFieldsSummary(XMLNode node) {
-                buildSummary(
-                        memberSummaryWriters[VisibleMemberMap.FIELDS],
-                        visibleMemberMaps[VisibleMemberMap.FIELDS]);
-        }
-
-        /**
-         * Build the inherited summary for the fields.
-         */
-        public void buildFieldsInheritedSummary(XMLNode node) {
-                buildInheritedSummary(
-                        memberSummaryWriters[VisibleMemberMap.FIELDS],
-                        visibleMemberMaps[VisibleMemberMap.FIELDS]);
-        }
-
-        /**
-         * Build the summary for the nested classes.
-         */
-        public void buildNestedClassesSummary(XMLNode node) {
-                buildSummary(
-                        memberSummaryWriters[VisibleMemberMap.INNERCLASSES],
-                        visibleMemberMaps[VisibleMemberMap.INNERCLASSES]);
-        }
-
-        /**
-         * Build the inherited summary for the nested classes.
-         */
-        public void buildNestedClassesInheritedSummary(XMLNode node) {
-                buildInheritedSummary(
-                        memberSummaryWriters[VisibleMemberMap.INNERCLASSES],
-                        visibleMemberMaps[VisibleMemberMap.INNERCLASSES]);
-        }
+    /**
+     * Build the summary for the nested classes.
+     *
+     * @param node the XML element that specifies which components to document
+     * @param memberSummaryTree the content tree to which the documentation will be added
+     */
+    public void buildNestedClassesSummary(XMLNode node, Content memberSummaryTree) {
+        MemberSummaryWriter writer =
+                memberSummaryWriters[VisibleMemberMap.INNERCLASSES];
+        VisibleMemberMap visibleMemberMap =
+                visibleMemberMaps[VisibleMemberMap.INNERCLASSES];
+        addSummary(writer, visibleMemberMap, true, memberSummaryTree);
+    }
 
-        /**
-         * Build the method summary.
-         */
-        public void buildMethodsSummary(XMLNode node) {
-                buildSummary(
-                        memberSummaryWriters[VisibleMemberMap.METHODS],
-                        visibleMemberMaps[VisibleMemberMap.METHODS]);
-        }
-
-        /**
-         * Build the inherited method summary.
-         */
-        public void buildMethodsInheritedSummary(XMLNode node) {
-                buildInheritedSummary(
-                        memberSummaryWriters[VisibleMemberMap.METHODS],
-                        visibleMemberMaps[VisibleMemberMap.METHODS]);
-        }
+    /**
+     * Build the method summary.
+     *
+     * @param node the XML element that specifies which components to document
+     * @param memberSummaryTree the content tree to which the documentation will be added
+     */
+    public void buildMethodsSummary(XMLNode node, Content memberSummaryTree) {
+        MemberSummaryWriter writer =
+                memberSummaryWriters[VisibleMemberMap.METHODS];
+        VisibleMemberMap visibleMemberMap =
+                visibleMemberMaps[VisibleMemberMap.METHODS];
+        addSummary(writer, visibleMemberMap, true, memberSummaryTree);
+    }
 
-        /**
-         * Build the constructor summary.
-         */
-        public void buildConstructorsSummary(XMLNode node) {
-                buildSummary(
-                        memberSummaryWriters[VisibleMemberMap.CONSTRUCTORS],
-                        visibleMemberMaps[VisibleMemberMap.CONSTRUCTORS]);
-        }
+    /**
+     * Build the constructor summary.
+     *
+     * @param node the XML element that specifies which components to document
+     * @param memberSummaryTree the content tree to which the documentation will be added
+     */
+    public void buildConstructorsSummary(XMLNode node, Content memberSummaryTree) {
+        MemberSummaryWriter writer =
+                memberSummaryWriters[VisibleMemberMap.CONSTRUCTORS];
+        VisibleMemberMap visibleMemberMap =
+                visibleMemberMaps[VisibleMemberMap.CONSTRUCTORS];
+        addSummary(writer, visibleMemberMap, false, memberSummaryTree);
+    }
 
-        /**
-         * Build the member summary for the given members.
-         *
-         * @param writer           the summary writer to write the output.
-         * @param visibleMemberMap the given members to summarize.
-         */
-        private void buildSummary(MemberSummaryWriter writer,
-            VisibleMemberMap visibleMemberMap) {
+    /**
+     * Build the member summary for the given members.
+     *
+     * @param writer the summary writer to write the output.
+     * @param visibleMemberMap the given members to summarize.
+     * @param summaryTreeList list of content trees to which the documentation will be added
+     */
+    private void buildSummary(MemberSummaryWriter writer,
+            VisibleMemberMap visibleMemberMap, LinkedList<Content> summaryTreeList) {
         List<ProgramElementDoc> members = new ArrayList<ProgramElementDoc>(visibleMemberMap.getLeafClassMembers(
-            configuration));
+                configuration));
         if (members.size() > 0) {
             Collections.sort(members);
-            writer.writeMemberSummaryHeader(classDoc);
+            Content tableTree = writer.getSummaryTableTree(classDoc);
             for (int i = 0; i < members.size(); i++) {
                 ProgramElementDoc member = members.get(i);
                 Tag[] firstSentenceTags = member.firstSentenceTags();
@@ -301,32 +311,32 @@
                     //Inherit comments from overriden or implemented method if
                     //necessary.
                     DocFinder.Output inheritedDoc =
-                        DocFinder.search(new DocFinder.Input((MethodDoc) member));
+                            DocFinder.search(new DocFinder.Input((MethodDoc) member));
                     if (inheritedDoc.holder != null &&
                             inheritedDoc.holder.firstSentenceTags().length > 0) {
                         firstSentenceTags = inheritedDoc.holder.firstSentenceTags();
                     }
                 }
-                writer.writeMemberSummary(classDoc, member, firstSentenceTags,
-                    i == 0, i == members.size() - 1);
+                writer.addMemberSummary(classDoc, member, firstSentenceTags, tableTree, i);
             }
-            writer.writeMemberSummaryFooter(classDoc);
+            summaryTreeList.add(tableTree);
         }
-        }
+    }
 
     /**
      * Build the inherited member summary for the given methods.
      *
-     * @param writer           the writer for this member summary.
+     * @param writer the writer for this member summary.
      * @param visibleMemberMap the map for the members to document.
+     * @param summaryTreeList list of content trees to which the documentation will be added
      */
-        private void buildInheritedSummary(MemberSummaryWriter writer,
-            VisibleMemberMap visibleMemberMap) {
+    private void buildInheritedSummary(MemberSummaryWriter writer,
+            VisibleMemberMap visibleMemberMap, LinkedList<Content> summaryTreeList) {
         for (Iterator<ClassDoc> iter = visibleMemberMap.getVisibleClassesList().iterator();
                 iter.hasNext();) {
             ClassDoc inhclass = iter.next();
             if (! (inhclass.isPublic() ||
-                Util.isLinkable(inhclass, configuration))) {
+                    Util.isLinkable(inhclass, configuration))) {
                 continue;
             }
             if (inhclass == classDoc) {
@@ -335,18 +345,45 @@
             List<ProgramElementDoc> inhmembers = visibleMemberMap.getMembersFor(inhclass);
             if (inhmembers.size() > 0) {
                 Collections.sort(inhmembers);
-                writer.writeInheritedMemberSummaryHeader(inhclass);
+                Content inheritedTree = writer.getInheritedSummaryHeader(inhclass);
+                Content linksTree = writer.getInheritedSummaryLinksTree();
                 for (int j = 0; j < inhmembers.size(); ++j) {
-                    writer.writeInheritedMemberSummary(
-                        inhclass.isPackagePrivate() &&
+                    writer.addInheritedMemberSummary(
+                            inhclass.isPackagePrivate() &&
                             ! Util.isLinkable(inhclass, configuration) ?
                             classDoc : inhclass,
-                        inhmembers.get(j),
-                        j == 0,
-                        j == inhmembers.size() - 1);
+                            inhmembers.get(j),
+                            j == 0,
+                            j == inhmembers.size() - 1, linksTree);
                 }
-                writer.writeInheritedMemberSummaryFooter(inhclass);
+                inheritedTree.addContent(linksTree);
+                summaryTreeList.add(writer.getMemberTree(inheritedTree));
             }
         }
     }
+
+    /**
+     * Add the summary for the documentation.
+     *
+     * @param writer the writer for this member summary.
+     * @param visibleMemberMap the map for the members to document.
+     * @param showInheritedSummary true if inherited summary should be documented
+     * @param memberSummaryTree the content tree to which the documentation will be added
+     */
+    private void addSummary(MemberSummaryWriter writer,
+            VisibleMemberMap visibleMemberMap, boolean showInheritedSummary,
+            Content memberSummaryTree) {
+        LinkedList<Content> summaryTreeList = new LinkedList<Content>();
+        buildSummary(writer, visibleMemberMap, summaryTreeList);
+        if (showInheritedSummary)
+            buildInheritedSummary(writer, visibleMemberMap, summaryTreeList);
+        if (!summaryTreeList.isEmpty()) {
+            Content memberTree = writer.getMemberSummaryHeader(
+                    classDoc, memberSummaryTree);
+            for (int i = 0; i < summaryTreeList.size(); i++) {
+                memberTree.addContent(summaryTreeList.get(i));
+            }
+            memberSummaryTree.addContent(writer.getMemberTree(memberTree));
+        }
+    }
 }
--- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/MethodBuilder.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/MethodBuilder.java	Mon Dec 20 21:10:57 2010 -0800
@@ -25,10 +25,10 @@
 
 package com.sun.tools.doclets.internal.toolkit.builders;
 
+import java.util.*;
 import com.sun.tools.doclets.internal.toolkit.util.*;
 import com.sun.tools.doclets.internal.toolkit.*;
 import com.sun.javadoc.*;
-import java.util.*;
 
 /**
  * Builds documentation for a method.
@@ -38,204 +38,199 @@
  * Do not use it as an API
  *
  * @author Jamie Ho
+ * @author Bhavesh Patel (Modified)
  * @since 1.5
  */
 public class MethodBuilder extends AbstractMemberBuilder {
 
-        /**
-         * The index of the current field that is being documented at this point
-         * in time.
-         */
-        private int currentMethodIndex;
+    /**
+     * The index of the current field that is being documented at this point
+     * in time.
+     */
+    private int currentMethodIndex;
 
-        /**
-         * The class whose methods are being documented.
-         */
-        private ClassDoc classDoc;
+    /**
+     * The class whose methods are being documented.
+     */
+    private ClassDoc classDoc;
 
-        /**
-         * The visible methods for the given class.
-         */
-        private VisibleMemberMap visibleMemberMap;
+    /**
+     * The visible methods for the given class.
+     */
+    private VisibleMemberMap visibleMemberMap;
 
-        /**
-         * The writer to output the method documentation.
-         */
-        private MethodWriter writer;
+    /**
+     * The writer to output the method documentation.
+     */
+    private MethodWriter writer;
 
-        /**
-         * The methods being documented.
-         */
-        private List<ProgramElementDoc> methods;
+    /**
+     * The methods being documented.
+     */
+    private List<ProgramElementDoc> methods;
 
-        private MethodBuilder(Configuration configuration) {
-                super(configuration);
-        }
+    private MethodBuilder(Configuration configuration) {
+        super(configuration);
+    }
 
-        /**
-         * Construct a new MethodBuilder.
-         *
-         * @param configuration the current configuration of the doclet.
-         * @param classDoc the class whoses members are being documented.
-         * @param writer the doclet specific writer.
-         *
-         * @return an instance of a MethodBuilder.
-         */
-        public static MethodBuilder getInstance(
-                Configuration configuration,
-                ClassDoc classDoc,
-                MethodWriter writer) {
-                MethodBuilder builder = new MethodBuilder(configuration);
-                builder.classDoc = classDoc;
-                builder.writer = writer;
-                builder.visibleMemberMap =
-                        new VisibleMemberMap(
-                                classDoc,
-                                VisibleMemberMap.METHODS,
-                                configuration.nodeprecated);
-                builder.methods =
-                        new ArrayList<ProgramElementDoc>(builder.visibleMemberMap.getLeafClassMembers(
+    /**
+     * Construct a new MethodBuilder.
+     *
+     * @param configuration the current configuration of the doclet.
+     * @param classDoc the class whoses members are being documented.
+     * @param writer the doclet specific writer.
+     *
+     * @return an instance of a MethodBuilder.
+     */
+    public static MethodBuilder getInstance(
+            Configuration configuration,
+            ClassDoc classDoc,
+            MethodWriter writer) {
+        MethodBuilder builder = new MethodBuilder(configuration);
+        builder.classDoc = classDoc;
+        builder.writer = writer;
+        builder.visibleMemberMap =
+                new VisibleMemberMap(
+                classDoc,
+                VisibleMemberMap.METHODS,
+                configuration.nodeprecated);
+        builder.methods =
+                new ArrayList<ProgramElementDoc>(builder.visibleMemberMap.getLeafClassMembers(
                 configuration));
-                if (configuration.getMemberComparator() != null) {
-                        Collections.sort(
-                                builder.methods,
-                                configuration.getMemberComparator());
-                }
-                return builder;
+        if (configuration.getMemberComparator() != null) {
+            Collections.sort(
+                    builder.methods,
+                    configuration.getMemberComparator());
         }
+        return builder;
+    }
 
-        /**
-         * {@inheritDoc}
-         */
-        public String getName() {
-                return "MethodDetails";
-        }
+    /**
+     * {@inheritDoc}
+     */
+    public String getName() {
+        return "MethodDetails";
+    }
 
-        /**
-         * Returns a list of methods that will be documented for the given class.
-         * This information can be used for doclet specific documentation
-         * generation.
-         *
-         * @param classDoc the {@link ClassDoc} we want to check.
-         * @return a list of methods that will be documented.
-         */
-        public List<ProgramElementDoc> members(ClassDoc classDoc) {
-                return visibleMemberMap.getMembersFor(classDoc);
-        }
+    /**
+     * Returns a list of methods that will be documented for the given class.
+     * This information can be used for doclet specific documentation
+     * generation.
+     *
+     * @param classDoc the {@link ClassDoc} we want to check.
+     * @return a list of methods that will be documented.
+     */
+    public List<ProgramElementDoc> members(ClassDoc classDoc) {
+        return visibleMemberMap.getMembersFor(classDoc);
+    }
 
-        /**
-         * Returns the visible member map for the methods of this class.
-         *
-         * @return the visible member map for the methods of this class.
-         */
-        public VisibleMemberMap getVisibleMemberMap() {
-                return visibleMemberMap;
-        }
+    /**
+     * Returns the visible member map for the methods of this class.
+     *
+     * @return the visible member map for the methods of this class.
+     */
+    public VisibleMemberMap getVisibleMemberMap() {
+        return visibleMemberMap;
+    }
 
-        /**
-         * {@inheritDoc}
-         */
-        public boolean hasMembersToDocument() {
-                return methods.size() > 0;
-        }
+    /**
+     * {@inheritDoc}
+     */
+    public boolean hasMembersToDocument() {
+        return methods.size() > 0;
+    }
 
-        /**
-         * Build the method documentation.
-         */
-        public void buildMethodDoc(XMLNode node) {
-                if (writer == null) {
-                        return;
-                }
-                for (currentMethodIndex = 0;
-                        currentMethodIndex < methods.size();
-                        currentMethodIndex++) {
-                        buildChildren(node);
-                }
+    /**
+     * Build the method documentation.
+     *
+     * @param node the XML element that specifies which components to document
+     * @param memberDetailsTree the content tree to which the documentation will be added
+     */
+    public void buildMethodDoc(XMLNode node, Content memberDetailsTree) {
+        if (writer == null) {
+            return;
         }
-
-        /**
-         * Build the overall header.
-         */
-        public void buildHeader(XMLNode node) {
-                writer.writeHeader(
-                        classDoc,
-                        configuration.getText("doclet.Method_Detail"));
+        int size = methods.size();
+        if (size > 0) {
+            Content methodDetailsTree = writer.getMethodDetailsTreeHeader(
+                    classDoc, memberDetailsTree);
+            for (currentMethodIndex = 0; currentMethodIndex < size;
+                    currentMethodIndex++) {
+                Content methodDocTree = writer.getMethodDocTreeHeader(
+                        (MethodDoc) methods.get(currentMethodIndex),
+                        methodDetailsTree);
+                buildChildren(node, methodDocTree);
+                methodDetailsTree.addContent(writer.getMethodDoc(
+                        methodDocTree, (currentMethodIndex == size - 1)));
+            }
+            memberDetailsTree.addContent(
+                    writer.getMethodDetails(methodDetailsTree));
         }
+    }
 
-        /**
-         * Build the header for the individual method.
-         */
-        public void buildMethodHeader(XMLNode node) {
-                writer.writeMethodHeader(
-                        (MethodDoc) methods.get(currentMethodIndex),
-                        currentMethodIndex == 0);
-        }
+    /**
+     * Build the signature.
+     *
+     * @param node the XML element that specifies which components to document
+     * @param methodDocTree the content tree to which the documentation will be added
+     */
+    public void buildSignature(XMLNode node, Content methodDocTree) {
+        methodDocTree.addContent(
+                writer.getSignature((MethodDoc) methods.get(currentMethodIndex)));
+    }
 
-        /**
-         * Build the signature.
-         */
-        public void buildSignature(XMLNode node) {
-                writer.writeSignature((MethodDoc) methods.get(currentMethodIndex));
-        }
+    /**
+     * Build the deprecation information.
+     *
+     * @param node the XML element that specifies which components to document
+     * @param methodDocTree the content tree to which the documentation will be added
+     */
+    public void buildDeprecationInfo(XMLNode node, Content methodDocTree) {
+        writer.addDeprecated(
+                (MethodDoc) methods.get(currentMethodIndex), methodDocTree);
+    }
 
-        /**
-         * Build the deprecation information.
-         */
-        public void buildDeprecationInfo(XMLNode node) {
-                writer.writeDeprecated((MethodDoc) methods.get(currentMethodIndex));
-        }
-
-        /**
-         * Build the comments for the method.  Do nothing if
-         * {@link Configuration#nocomment} is set to true.  If this method
-         */
-        public void buildMethodComments(XMLNode node) {
-                if (!configuration.nocomment) {
+    /**
+     * Build the comments for the method.  Do nothing if
+     * {@link Configuration#nocomment} is set to true.
+     *
+     * @param node the XML element that specifies which components to document
+     * @param methodDocTree the content tree to which the documentation will be added
+     */
+    public void buildMethodComments(XMLNode node, Content methodDocTree) {
+        if (!configuration.nocomment) {
             MethodDoc method = (MethodDoc) methods.get(currentMethodIndex);
 
             if (method.inlineTags().length == 0) {
                 DocFinder.Output docs = DocFinder.search(
-                    new DocFinder.Input(method));
+                        new DocFinder.Input(method));
                 method = docs.inlineTags != null && docs.inlineTags.length > 0 ?
                     (MethodDoc) docs.holder : method;
-
             }
             //NOTE:  When we fix the bug where ClassDoc.interfaceTypes() does
             //       not pass all implemented interfaces, holder will be the
             //       interface type.  For now, it is really the erasure.
-            writer.writeComments(method.containingClass(), method);
-                }
+            writer.addComments(method.containingClass(), method, methodDocTree);
         }
-
-
-
-        /**
-         * Build the tag information.
-         */
-        public void buildTagInfo(XMLNode node) {
-                writer.writeTags((MethodDoc) methods.get(currentMethodIndex));
-        }
+    }
 
-        /**
-         * Build the footer of the method.
-         */
-        public void buildMethodFooter(XMLNode node) {
-                writer.writeMethodFooter();
-        }
+    /**
+     * Build the tag information.
+     *
+     * @param node the XML element that specifies which components to document
+     * @param methodDocTree the content tree to which the documentation will be added
+     */
+    public void buildTagInfo(XMLNode node, Content methodDocTree) {
+        writer.addTags((MethodDoc) methods.get(currentMethodIndex),
+                methodDocTree);
+    }
 
-        /**
-         * Build the overall footer.
-         */
-        public void buildFooter(XMLNode node) {
-                writer.writeFooter(classDoc);
-        }
-
-        /**
-         * Return the method writer for this builder.
-         *
-         * @return the method writer for this builder.
-         */
-        public MethodWriter getWriter() {
-                return writer;
-        }
+    /**
+     * Return the method writer for this builder.
+     *
+     * @return the method writer for this builder.
+     */
+    public MethodWriter getWriter() {
+        return writer;
+    }
 }
--- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/PackageSummaryBuilder.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/PackageSummaryBuilder.java	Mon Dec 20 21:10:57 2010 -0800
@@ -25,10 +25,10 @@
 
 package com.sun.tools.doclets.internal.toolkit.builders;
 
+import java.io.*;
+import com.sun.javadoc.*;
 import com.sun.tools.doclets.internal.toolkit.util.*;
 import com.sun.tools.doclets.internal.toolkit.*;
-import com.sun.javadoc.*;
-import java.io.*;
 
 /**
  * Builds the summary for a given package.
@@ -42,281 +42,315 @@
  * @since 1.5
  */
 public class PackageSummaryBuilder extends AbstractBuilder {
+    /**
+     * The root element of the package summary XML is {@value}.
+     */
+    public static final String ROOT = "PackageDoc";
 
-        /**
-         * The root element of the package summary XML is {@value}.
-         */
-        public static final String ROOT = "PackageDoc";
+    /**
+     * The package being documented.
+     */
+    private PackageDoc packageDoc;
 
-        /**
-         * The package being documented.
-         */
-        private PackageDoc packageDoc;
+    /**
+     * The doclet specific writer that will output the result.
+     */
+    private PackageSummaryWriter packageWriter;
 
-        /**
-         * The doclet specific writer that will output the result.
-         */
-        private PackageSummaryWriter packageWriter;
+    /**
+     * The content that will be added to the package summary documentation tree.
+     */
+    private Content contentTree;
 
-        private PackageSummaryBuilder(Configuration configuration) {
-                super(configuration);
-        }
+    private PackageSummaryBuilder(Configuration configuration) {
+        super(configuration);
+    }
 
-        /**
-         * Construct a new PackageSummaryBuilder.
-         * @param configuration the current configuration of the doclet.
-         * @param pkg the package being documented.
-         * @param packageWriter the doclet specific writer that will output the
-         *        result.
-         *
-         * @return an instance of a PackageSummaryBuilder.
-         */
-        public static PackageSummaryBuilder getInstance(
-                Configuration configuration,
-                PackageDoc pkg,
-                PackageSummaryWriter packageWriter) {
-                PackageSummaryBuilder builder =
-                        new PackageSummaryBuilder(configuration);
-                builder.packageDoc = pkg;
-                builder.packageWriter = packageWriter;
-                return builder;
+    /**
+     * Construct a new PackageSummaryBuilder.
+     * @param configuration the current configuration of the doclet.
+     * @param pkg the package being documented.
+     * @param packageWriter the doclet specific writer that will output the
+     *        result.
+     *
+     * @return an instance of a PackageSummaryBuilder.
+     */
+    public static PackageSummaryBuilder getInstance(
+        Configuration configuration,
+        PackageDoc pkg,
+        PackageSummaryWriter packageWriter) {
+        PackageSummaryBuilder builder =
+                new PackageSummaryBuilder(configuration);
+        builder.packageDoc = pkg;
+        builder.packageWriter = packageWriter;
+        return builder;
+    }
+
+    /**
+     * Build the package summary.
+     */
+    public void build() throws IOException {
+        if (packageWriter == null) {
+            //Doclet does not support this output.
+            return;
         }
+        build(LayoutParser.getInstance(configuration).parseXML(ROOT), contentTree);
+    }
 
-        /**
-         * Build the package summary.
-         */
-        public void build() throws IOException {
-                if (packageWriter == null) {
-                        //Doclet does not support this output.
-                        return;
-                }
-                build(LayoutParser.getInstance(configuration).parseXML(ROOT));
-        }
-
-        /**
-         * {@inheritDoc}
-         */
-        public String getName() {
-                return ROOT;
-        }
+    /**
+     * {@inheritDoc}
+     */
+    public String getName() {
+        return ROOT;
+    }
 
-        /**
-         * Build the package documentation.
-         */
-        public void buildPackageDoc(XMLNode node) throws Exception {
-                buildChildren(node);
-                packageWriter.close();
-                Util.copyDocFiles(
-                        configuration,
-                        Util.getPackageSourcePath(configuration, packageDoc),
-                        DirectoryManager.getDirectoryPath(packageDoc)
-                                + File.separator
-                                + DocletConstants.DOC_FILES_DIR_NAME,
-                        true);
-        }
+    /**
+     * Build the package documentation.
+     *
+     * @param node the XML element that specifies which components to document
+     * @param contentTree the content tree to which the documentation will be added
+     */
+    public void buildPackageDoc(XMLNode node, Content contentTree) throws Exception {
+        contentTree = packageWriter.getPackageHeader(
+                Util.getPackageName(packageDoc));
+        buildChildren(node, contentTree);
+        packageWriter.addPackageFooter(contentTree);
+        packageWriter.printDocument(contentTree);
+        packageWriter.close();
+        Util.copyDocFiles(
+                configuration,
+                Util.getPackageSourcePath(configuration, packageDoc),
+                DirectoryManager.getDirectoryPath(packageDoc)
+                        + File.separator
+                        + DocletConstants.DOC_FILES_DIR_NAME,
+                true);
+    }
 
-        /**
-         * Build the header of the summary.
-         */
-        public void buildPackageHeader(XMLNode node) {
-                packageWriter.writePackageHeader(Util.getPackageName(packageDoc));
-        }
+    /**
+     * Build the content for the package doc.
+     *
+     * @param node the XML element that specifies which components to document
+     * @param contentTree the content tree to which the package contents
+     *                    will be added
+     */
+    public void buildContent(XMLNode node, Content contentTree) {
+        Content packageContentTree = packageWriter.getContentHeader();
+        buildChildren(node, packageContentTree);
+        contentTree.addContent(packageContentTree);
+    }
 
-        /**
-         * Build the description of the summary.
-         */
-        public void buildPackageDescription(XMLNode node) {
-                if (configuration.nocomment) {
-                        return;
-                }
-                packageWriter.writePackageDescription();
-        }
+    /**
+     * Build the package summary.
+     *
+     * @param node the XML element that specifies which components to document
+     * @param packageContentTree the package content tree to which the summaries will
+     *                           be added
+     */
+    public void buildSummary(XMLNode node, Content packageContentTree) {
+        Content summaryContentTree = packageWriter.getSummaryHeader();
+        buildChildren(node, summaryContentTree);
+        packageContentTree.addContent(summaryContentTree);
+    }
 
-        /**
-         * Build the tags of the summary.
-         */
-        public void buildPackageTags(XMLNode node) {
-                if (configuration.nocomment) {
-                        return;
-                }
-                packageWriter.writePackageTags();
+    /**
+     * Build the summary for the interfaces in this package.
+     *
+     * @param node the XML element that specifies which components to document
+     * @param summaryContentTree the summary tree to which the interface summary
+     *                           will be added
+     */
+    public void buildInterfaceSummary(XMLNode node, Content summaryContentTree) {
+        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(
+                                Util.getPackageName(packageDoc));
+        if (interfaces.length > 0) {
+            packageWriter.addClassesSummary(
+                    interfaces,
+                    configuration.getText("doclet.Interface_Summary"),
+                    interfaceTableSummary, interfaceTableHeader, summaryContentTree);
         }
-
-        /**
-         * Build the package summary.
-         */
-        public void buildSummary(XMLNode node) {
-                buildChildren(node);
-        }
+    }
 
-        /**
-         * Build the overall header.
-         */
-        public void buildSummaryHeader(XMLNode node) {
-                packageWriter.writeSummaryHeader();
-        }
-
-        /**
-         * Build the overall footer.
-         */
-        public void buildSummaryFooter(XMLNode node) {
-                packageWriter.writeSummaryFooter();
-        }
-
-        /**
-         * Build the summary for the classes in this package.
-         */
-        public void buildClassSummary(XMLNode node) {
-            String classTableSummary =
-                    configuration.getText("doclet.Member_Table_Summary",
+    /**
+     * Build the summary for the classes in this package.
+     *
+     * @param node the XML element that specifies which components to document
+     * @param summaryContentTree the summary tree to which the class summary will
+     *                           be added
+     */
+    public void buildClassSummary(XMLNode node, Content summaryContentTree) {
+        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(
+                                Util.getPackageName(packageDoc));
+        if (classes.length > 0) {
+            packageWriter.addClassesSummary(
+                    classes,
                     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(
-                                        Util.getPackageName(packageDoc));
-                if (classes.length > 0) {
-                        packageWriter.writeClassesSummary(
-                                classes,
-                                configuration.getText("doclet.Class_Summary"),
-                                classTableSummary, classTableHeader);
-                }
+                    classTableSummary, classTableHeader, summaryContentTree);
         }
+    }
 
-        /**
-         * Build the summary for the interfaces in this package.
-         */
-        public void buildInterfaceSummary(XMLNode node) {
-            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(
-                                        Util.getPackageName(packageDoc));
-                if (interfaces.length > 0) {
-                        packageWriter.writeClassesSummary(
-                                interfaces,
-                                configuration.getText("doclet.Interface_Summary"),
-                                interfaceTableSummary, interfaceTableHeader);
-                }
-        }
-
-        /**
-         * Build the summary for the enums in this package.
-         */
-        public void buildAnnotationTypeSummary(XMLNode node) {
-            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(
-                                        Util.getPackageName(packageDoc));
-                if (annotationTypes.length > 0) {
-                        packageWriter.writeClassesSummary(
-                                annotationTypes,
-                                configuration.getText("doclet.Annotation_Types_Summary"),
-                                annotationtypeTableSummary, annotationtypeTableHeader);
-                }
-        }
-
-        /**
-         * Build the summary for the enums in this package.
-         */
-        public void buildEnumSummary(XMLNode node) {
-            String enumTableSummary =
-                    configuration.getText("doclet.Member_Table_Summary",
+    /**
+     * Build the summary for the enums in this package.
+     *
+     * @param node the XML element that specifies which components to document
+     * @param summaryContentTree the summary tree to which the enum summary will
+     *                           be added
+     */
+    public void buildEnumSummary(XMLNode node, Content summaryContentTree) {
+        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(
+                                Util.getPackageName(packageDoc));
+        if (enums.length > 0) {
+            packageWriter.addClassesSummary(
+                    enums,
                     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(
-                                        Util.getPackageName(packageDoc));
-                if (enums.length > 0) {
-                        packageWriter.writeClassesSummary(
-                                enums,
-                                configuration.getText("doclet.Enum_Summary"),
-                                enumTableSummary, enumTableHeader);
-                }
+                    enumTableSummary, enumTableHeader, summaryContentTree);
         }
+    }
 
-        /**
-         * Build the summary for the exceptions in this package.
-         */
-        public void buildExceptionSummary(XMLNode node) {
-            String exceptionTableSummary =
-                    configuration.getText("doclet.Member_Table_Summary",
+    /**
+     * Build the summary for the exceptions in this package.
+     *
+     * @param node the XML element that specifies which components to document
+     * @param summaryContentTree the summary tree to which the exception summary will
+     *                           be added
+     */
+    public void buildExceptionSummary(XMLNode node, Content summaryContentTree) {
+        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(
+                                Util.getPackageName(packageDoc));
+        if (exceptions.length > 0) {
+            packageWriter.addClassesSummary(
+                    exceptions,
                     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(
-                                        Util.getPackageName(packageDoc));
-                if (exceptions.length > 0) {
-                        packageWriter.writeClassesSummary(
-                                exceptions,
-                                configuration.getText("doclet.Exception_Summary"),
-                                exceptionTableSummary, exceptionTableHeader);
-                }
+                    exceptionTableSummary, exceptionTableHeader, summaryContentTree);
         }
+    }
 
-        /**
-         * Build the summary for the errors in this package.
-         */
-        public void buildErrorSummary(XMLNode node) {
-            String errorTableSummary =
-                    configuration.getText("doclet.Member_Table_Summary",
+    /**
+     * Build the summary for the errors in this package.
+     *
+     * @param node the XML element that specifies which components to document
+     * @param summaryContentTree the summary tree to which the error summary will
+     *                           be added
+     */
+    public void buildErrorSummary(XMLNode node, Content summaryContentTree) {
+        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(
+                                Util.getPackageName(packageDoc));
+        if (errors.length > 0) {
+            packageWriter.addClassesSummary(
+                    errors,
                     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(
-                                        Util.getPackageName(packageDoc));
-                if (errors.length > 0) {
-                        packageWriter.writeClassesSummary(
-                                errors,
-                                configuration.getText("doclet.Error_Summary"),
-                                errorTableSummary, errorTableHeader);
-                }
+                    errorTableSummary, errorTableHeader, summaryContentTree);
         }
+    }
 
-        /**
-         * Build the footer of the summary.
-         */
-        public void buildPackageFooter(XMLNode node) {
-                packageWriter.writePackageFooter();
+    /**
+     * Build the summary for the annotation type in this package.
+     *
+     * @param node the XML element that specifies which components to document
+     * @param summaryContentTree the summary tree to which the annotation type
+     *                           summary will be added
+     */
+    public void buildAnnotationTypeSummary(XMLNode node, Content summaryContentTree) {
+        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(
+                                Util.getPackageName(packageDoc));
+        if (annotationTypes.length > 0) {
+            packageWriter.addClassesSummary(
+                    annotationTypes,
+                    configuration.getText("doclet.Annotation_Types_Summary"),
+                    annotationtypeTableSummary, annotationtypeTableHeader,
+                    summaryContentTree);
         }
+    }
+
+    /**
+     * Build the description of the summary.
+     *
+     * @param node the XML element that specifies which components to document
+     * @param packageContentTree the tree to which the package description will
+     *                           be added
+     */
+    public void buildPackageDescription(XMLNode node, Content packageContentTree) {
+        if (configuration.nocomment) {
+            return;
+        }
+        packageWriter.addPackageDescription(packageContentTree);
+    }
+
+    /**
+     * Build the tags of the summary.
+     *
+     * @param node the XML element that specifies which components to document
+     * @param packageContentTree the tree to which the package tags will be added
+     */
+    public void buildPackageTags(XMLNode node, Content packageContentTree) {
+        if (configuration.nocomment) {
+            return;
+        }
+        packageWriter.addPackageTags(packageContentTree);
+    }
 }
--- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/SerializedFormBuilder.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/SerializedFormBuilder.java	Mon Dec 20 21:10:57 2010 -0800
@@ -27,7 +27,6 @@
 
 import java.io.*;
 import java.util.*;
-
 import com.sun.javadoc.*;
 import com.sun.tools.doclets.internal.toolkit.util.*;
 import com.sun.tools.doclets.internal.toolkit.*;
@@ -87,6 +86,11 @@
      */
     protected MemberDoc currentMember;
 
+    /**
+     * The content that will be added to the serialized form documentation tree.
+     */
+    private Content contentTree;
+
     private SerializedFormBuilder(Configuration configuration) {
         super(configuration);
     }
@@ -117,7 +121,7 @@
         } catch (Exception e) {
             throw new DocletAbortException();
         }
-        build(LayoutParser.getInstance(configuration).parseXML(NAME));
+        build(LayoutParser.getInstance(configuration).parseXML(NAME), contentTree);
         writer.close();
     }
 
@@ -130,34 +134,44 @@
 
     /**
      * Build the serialized form.
+     *
+     * @param node the XML element that specifies which components to document
+     * @param serializedTree content tree to which the documentation will be added
      */
-    public void buildSerializedForm(XMLNode node) throws Exception {
-        buildChildren(node);
+    public void buildSerializedForm(XMLNode node, Content serializedTree) throws Exception {
+        serializedTree = writer.getHeader(configuration.getText(
+                "doclet.Serialized_Form"));
+        buildChildren(node, serializedTree);
+        writer.addFooter(serializedTree);
+        writer.printDocument(serializedTree);
         writer.close();
     }
 
     /**
-     * Build the header.
+     * Build the serialized form summaries.
+     *
+     * @param node the XML element that specifies which components to document
+     * @param serializedTree content tree to which the documentation will be added
      */
-    public void buildHeader(XMLNode node) {
-        writer.writeHeader(configuration.getText("doclet.Serialized_Form"));
+    public void buildSerializedFormSummaries(XMLNode node, Content serializedTree) {
+        Content serializedSummariesTree = writer.getSerializedSummariesHeader();
+        PackageDoc[] packages = configuration.packages;
+        for (int i = 0; i < packages.length; i++) {
+            currentPackage = packages[i];
+            buildChildren(node, serializedSummariesTree);
+        }
+        serializedTree.addContent(writer.getSerializedContent(
+                serializedSummariesTree));
     }
 
     /**
-     * Build the contents.
+     * Build the package serialized form for the current package being processed.
+     *
+     * @param node the XML element that specifies which components to document
+     * @param serializedSummariesTree content tree to which the documentation will be added
      */
-    public void buildSerializedFormSummaries(XMLNode node) {
-        PackageDoc[] packages = configuration.packages;
-        for (int i = 0; i < packages.length; i++) {
-            currentPackage = packages[i];
-            buildChildren(node);
-        }
-    }
-
-    /**
-     * Build the package serialized for for the current package being processed.
-     */
-    public void buildPackageSerializedForm(XMLNode node) {
+    public void buildPackageSerializedForm(XMLNode node, Content serializedSummariesTree) {
+        Content packageSerializedTree = writer.getPackageSerializedHeader();
         String foo = currentPackage.name();
         ClassDoc[] classes = currentPackage.allClasses(false);
         if (classes == null || classes.length == 0) {
@@ -169,14 +183,29 @@
         if (!serialClassFoundToDocument(classes)) {
             return;
         }
-        buildChildren(node);
+        buildChildren(node, packageSerializedTree);
+        serializedSummariesTree.addContent(packageSerializedTree);
     }
 
-    public void buildPackageHeader(XMLNode node) {
-        writer.writePackageHeader(Util.getPackageName(currentPackage));
+    /**
+     * Build the package header.
+     *
+     * @param node the XML element that specifies which components to document
+     * @param packageSerializedTree content tree to which the documentation will be added
+     */
+    public void buildPackageHeader(XMLNode node, Content packageSerializedTree) {
+        packageSerializedTree.addContent(writer.getPackageHeader(
+                Util.getPackageName(currentPackage)));
     }
 
-    public void buildClassSerializedForm(XMLNode node) {
+    /**
+     * Build the class serialized form.
+     *
+     * @param node the XML element that specifies which components to document
+     * @param packageSerializedTree content tree to which the documentation will be added
+     */
+    public void buildClassSerializedForm(XMLNode node, Content packageSerializedTree) {
+        Content classSerializedTree = writer.getClassSerializedHeader();
         ClassDoc[] classes = currentPackage.allClasses(false);
         Arrays.sort(classes);
         for (int j = 0; j < classes.length; j++) {
@@ -187,35 +216,293 @@
                 if(!serialClassInclude(currentClass)) {
                     continue;
                 }
-                buildChildren(node);
+                Content classTree = writer.getClassHeader(currentClass);
+                buildChildren(node, classTree);
+                classSerializedTree.addContent(classTree);
+            }
+        }
+        packageSerializedTree.addContent(classSerializedTree);
+    }
+
+    /**
+     * Build the serial UID information for the given class.
+     *
+     * @param node the XML element that specifies which components to document
+     * @param classTree content tree to which the serial UID information will be added
+     */
+    public void buildSerialUIDInfo(XMLNode node, Content classTree) {
+        Content serialUidTree = writer.getSerialUIDInfoHeader();
+        FieldDoc[] fields = currentClass.fields(false);
+        for (int i = 0; i < fields.length; i++) {
+            if (fields[i].name().equals("serialVersionUID") &&
+                fields[i].constantValueExpression() != null) {
+                writer.addSerialUIDInfo(SERIAL_VERSION_UID_HEADER,
+                        fields[i].constantValueExpression(), serialUidTree);
+                break;
+            }
+        }
+        classTree.addContent(serialUidTree);
+    }
+
+    /**
+     * Build the summaries for the methods and fields.
+     *
+     * @param node the XML element that specifies which components to document
+     * @param classTree content tree to which the documentation will be added
+     */
+    public void buildClassContent(XMLNode node, Content classTree) {
+        Content classContentTree = writer.getClassContentHeader();
+        buildChildren(node, classContentTree);
+        classTree.addContent(classContentTree);
+    }
+
+    /**
+     * Build the summaries for the methods that belong to the given
+     * class.
+     *
+     * @param node the XML element that specifies which components to document
+     * @param classContentTree content tree to which the documentation will be added
+     */
+    public void buildSerializableMethods(XMLNode node, Content classContentTree) {
+        Content serializableMethodTree = methodWriter.getSerializableMethodsHeader();
+        MemberDoc[] members = currentClass.serializationMethods();
+        int membersLength = members.length;
+        if (membersLength > 0) {
+            for (int i = 0; i < membersLength; i++) {
+                currentMember = members[i];
+                Content methodsContentTree = methodWriter.getMethodsContentHeader(
+                        (i == membersLength - 1));
+                buildChildren(node, methodsContentTree);
+                serializableMethodTree.addContent(methodsContentTree);
+            }
+        }
+        if (currentClass.serializationMethods().length > 0) {
+            classContentTree.addContent(methodWriter.getSerializableMethods(
+                    configuration.getText("doclet.Serialized_Form_methods"),
+                    serializableMethodTree));
+            if (currentClass.isSerializable() && !currentClass.isExternalizable()) {
+                if (currentClass.serializationMethods().length == 0) {
+                    Content noCustomizationMsg = methodWriter.getNoCustomizationMsg(
+                            configuration.getText(
+                            "doclet.Serializable_no_customization"));
+                    classContentTree.addContent(methodWriter.getSerializableMethods(
+                    configuration.getText("doclet.Serialized_Form_methods"),
+                    noCustomizationMsg));
+                }
             }
         }
     }
 
-    public void buildClassHeader(XMLNode node) {
-        writer.writeClassHeader(currentClass);
+    /**
+     * Build the method sub header.
+     *
+     * @param node the XML element that specifies which components to document
+     * @param methodsContentTree content tree to which the documentation will be added
+     */
+    public void buildMethodSubHeader(XMLNode node, Content methodsContentTree)  {
+        methodWriter.addMemberHeader((MethodDoc)currentMember, methodsContentTree);
+    }
+
+    /**
+     * Build the deprecated method description.
+     *
+     * @param node the XML element that specifies which components to document
+     * @param methodsContentTree content tree to which the documentation will be added
+     */
+    public void buildDeprecatedMethodInfo(XMLNode node, Content methodsContentTree) {
+        methodWriter.addDeprecatedMemberInfo((MethodDoc) currentMember, methodsContentTree);
     }
 
     /**
-     * Build the serial UID information for the given class.
+     * Build the information for the method.
+     *
+     * @param node the XML element that specifies which components to document
+     * @param methodsContentTree content tree to which the documentation will be added
+     */
+    public void buildMethodInfo(XMLNode node, Content methodsContentTree)  {
+        if(configuration.nocomment){
+            return;
+        }
+        buildChildren(node, methodsContentTree);
+    }
+
+    /**
+     * Build method description.
+     *
+     * @param node the XML element that specifies which components to document
+     * @param methodsContentTree content tree to which the documentation will be added
      */
-    public void buildSerialUIDInfo(XMLNode node) {
-        FieldDoc[] fields = currentClass.fields(false);
-        for (int i = 0; i < fields.length; i++) {
-            if (fields[i].name().equals("serialVersionUID") &&
-                fields[i].constantValueExpression() != null) {
-                writer.writeSerialUIDInfo(SERIAL_VERSION_UID_HEADER,
-                    fields[i].constantValueExpression());
-                return;
+    public void buildMethodDescription(XMLNode node, Content methodsContentTree) {
+        methodWriter.addMemberDescription((MethodDoc) currentMember, methodsContentTree);
+    }
+
+    /**
+     * Build the method tags.
+     *
+     * @param node the XML element that specifies which components to document
+     * @param methodsContentTree content tree to which the documentation will be added
+     */
+    public void buildMethodTags(XMLNode node, Content methodsContentTree) {
+        methodWriter.addMemberTags((MethodDoc) currentMember, methodsContentTree);
+        MethodDoc method = (MethodDoc)currentMember;
+        if (method.name().compareTo("writeExternal") == 0
+                && method.tags("serialData").length == 0) {
+            if (configuration.serialwarn) {
+                configuration.getDocletSpecificMsg().warning(
+                        currentMember.position(), "doclet.MissingSerialDataTag",
+                        method.containingClass().qualifiedName(), method.name());
             }
         }
     }
 
     /**
-     * Build the footer.
+     * Build the field header.
+     *
+     * @param node the XML element that specifies which components to document
+     * @param classContentTree content tree to which the documentation will be added
+     */
+    public void buildFieldHeader(XMLNode node, Content classContentTree) {
+        if (currentClass.serializableFields().length > 0) {
+            buildFieldSerializationOverview(currentClass, classContentTree);
+        }
+    }
+
+    /**
+     * Build the serialization overview for the given class.
+     *
+     * @param classDoc the class to print the overview for.
+     * @param classContentTree content tree to which the documentation will be added
+     */
+    public void buildFieldSerializationOverview(ClassDoc classDoc, Content classContentTree) {
+        if (classDoc.definesSerializableFields()) {
+            FieldDoc serialPersistentField =
+                Util.asList(classDoc.serializableFields()).get(0);
+            // Check to see if there are inline comments, tags or deprecation
+            // information to be printed.
+            if (fieldWriter.shouldPrintOverview(serialPersistentField)) {
+                Content serializableFieldsTree = fieldWriter.getSerializableFieldsHeader();
+                Content fieldsOverviewContentTree = fieldWriter.getFieldsContentHeader(true);
+                fieldWriter.addMemberDeprecatedInfo(serialPersistentField,
+                        fieldsOverviewContentTree);
+                if (!configuration.nocomment) {
+                    fieldWriter.addMemberDescription(serialPersistentField,
+                            fieldsOverviewContentTree);
+                    fieldWriter.addMemberTags(serialPersistentField,
+                            fieldsOverviewContentTree);
+                }
+                serializableFieldsTree.addContent(fieldsOverviewContentTree);
+                classContentTree.addContent(fieldWriter.getSerializableFields(
+                        configuration.getText("doclet.Serialized_Form_class"),
+                        serializableFieldsTree));
+            }
+        }
+    }
+
+    /**
+     * Build the summaries for the fields that belong to the given class.
+     *
+     * @param node the XML element that specifies which components to document
+     * @param classContentTree content tree to which the documentation will be added
      */
-    public void buildFooter(XMLNode node) {
-        writer.writeFooter();
+    public void buildSerializableFields(XMLNode node, Content classContentTree) {
+        MemberDoc[] members = currentClass.serializableFields();
+        int membersLength = members.length;
+        if (membersLength > 0) {
+            Content serializableFieldsTree = fieldWriter.getSerializableFieldsHeader();
+            for (int i = 0; i < membersLength; i++) {
+                currentMember = members[i];
+                if (!currentClass.definesSerializableFields()) {
+                    Content fieldsContentTree = fieldWriter.getFieldsContentHeader(
+                            (i == membersLength - 1));
+                    buildChildren(node, fieldsContentTree);
+                    serializableFieldsTree.addContent(fieldsContentTree);
+                }
+                else {
+                    buildSerialFieldTagsInfo(serializableFieldsTree);
+                }
+            }
+            classContentTree.addContent(fieldWriter.getSerializableFields(
+                    configuration.getText("doclet.Serialized_Form_fields"),
+                    serializableFieldsTree));
+        }
+    }
+
+    /**
+     * Build the field sub header.
+     *
+     * @param node the XML element that specifies which components to document
+     * @param fieldsContentTree content tree to which the documentation will be added
+     */
+    public void buildFieldSubHeader(XMLNode node, Content fieldsContentTree) {
+        if (!currentClass.definesSerializableFields()) {
+            FieldDoc field = (FieldDoc) currentMember;
+            fieldWriter.addMemberHeader(field.type().asClassDoc(),
+                    field.type().typeName(), field.type().dimension(), field.name(),
+                    fieldsContentTree);
+        }
+    }
+
+    /**
+     * Build the field deprecation information.
+     *
+     * @param node the XML element that specifies which components to document
+     * @param fieldsContentTree content tree to which the documentation will be added
+     */
+    public void buildFieldDeprecationInfo(XMLNode node, Content fieldsContentTree) {
+        if (!currentClass.definesSerializableFields()) {
+            FieldDoc field = (FieldDoc)currentMember;
+            fieldWriter.addMemberDeprecatedInfo(field, fieldsContentTree);
+        }
+    }
+
+    /**
+     * Build the serial field tags information.
+     *
+     * @param serializableFieldsTree content tree to which the documentation will be added
+     */
+    public void buildSerialFieldTagsInfo(Content serializableFieldsTree) {
+        if(configuration.nocomment){
+            return;
+        }
+        FieldDoc field = (FieldDoc)currentMember;
+        // Process Serializable Fields specified as array of
+        // ObjectStreamFields. Print a member for each serialField tag.
+        // (There should be one serialField tag per ObjectStreamField
+        // element.)
+        SerialFieldTag[] tags = field.serialFieldTags();
+        Arrays.sort(tags);
+        int tagsLength = tags.length;
+        for (int i = 0; i < tagsLength; i++) {
+            Content fieldsContentTree = fieldWriter.getFieldsContentHeader(
+                    (i == tagsLength - 1));
+            fieldWriter.addMemberHeader(tags[i].fieldTypeDoc(),
+                    tags[i].fieldType(), "", tags[i].fieldName(), fieldsContentTree);
+            fieldWriter.addMemberDescription(tags[i], fieldsContentTree);
+            serializableFieldsTree.addContent(fieldsContentTree);
+        }
+    }
+
+    /**
+     * Build the field information.
+     *
+     * @param node the XML element that specifies which components to document
+     * @param fieldsContentTree content tree to which the documentation will be added
+     */
+    public void buildFieldInfo(XMLNode node, Content fieldsContentTree) {
+        if(configuration.nocomment){
+            return;
+        }
+        FieldDoc field = (FieldDoc)currentMember;
+        ClassDoc cd = field.containingClass();
+        // Process default Serializable field.
+        if ((field.tags("serial").length == 0) && ! field.isSynthetic()
+                && configuration.serialwarn) {
+            configuration.message.warning(field.position(),
+                    "doclet.MissingSerialTag", cd.qualifiedName(),
+                    field.name());
+        }
+        fieldWriter.addMemberDescription(field, fieldsContentTree);
+        fieldWriter.addMemberTags(field, fieldsContentTree);
     }
 
     /**
@@ -297,208 +584,4 @@
         }
         return false;
     }
-
-    /**
-     * Build the method header.
-     */
-    public void buildMethodHeader(XMLNode node) {
-        if (currentClass.serializationMethods().length > 0) {
-            methodWriter.writeHeader(
-                configuration.getText("doclet.Serialized_Form_methods"));
-            if (currentClass.isSerializable() && !currentClass.isExternalizable()) {
-                if (currentClass.serializationMethods().length == 0) {
-                    methodWriter.writeNoCustomizationMsg(
-                        configuration.getText(
-                            "doclet.Serializable_no_customization"));
-                }
-            }
-        }
-    }
-
-    /**
-     * Build the method sub header.
-     */
-    public void buildMethodSubHeader(XMLNode node)  {
-        methodWriter.writeMemberHeader((MethodDoc) currentMember);
-    }
-
-    /**
-     * Build the deprecated method description.
-     */
-    public void buildDeprecatedMethodInfo(XMLNode node) {
-        methodWriter.writeDeprecatedMemberInfo((MethodDoc) currentMember);
-    }
-
-    /**
-     * Build method tags.
-     */
-    public void buildMethodDescription(XMLNode node) {
-        methodWriter.writeMemberDescription((MethodDoc) currentMember);
-    }
-
-    /**
-     * Build the method tags.
-     */
-    public void buildMethodTags(XMLNode node) {
-        methodWriter.writeMemberTags((MethodDoc) currentMember);
-        MethodDoc method = (MethodDoc)currentMember;
-        if (method.name().compareTo("writeExternal") == 0
-            && method.tags("serialData").length == 0) {
-            if (configuration.serialwarn) {
-                configuration.getDocletSpecificMsg().warning(
-                    currentMember.position(), "doclet.MissingSerialDataTag",
-                    method.containingClass().qualifiedName(), method.name());
-            }
-        }
-    }
-
-    /**
-     * build the information for the method.
-     */
-    public void buildMethodInfo(XMLNode node)  {
-        if(configuration.nocomment){
-            return;
-        }
-        buildChildren(node);
-    }
-
-    /**
-     * Build the method footer.
-     */
-    public void buildMethodFooter(XMLNode node) {
-        methodWriter.writeMemberFooter();
-    }
-
-    /**
-     * Build the field header.
-     */
-    public void buildFieldHeader(XMLNode node) {
-        if (currentClass.serializableFields().length > 0) {
-            buildFieldSerializationOverview(currentClass);
-            fieldWriter.writeHeader(configuration.getText(
-                "doclet.Serialized_Form_fields"));
-        }
-    }
-
-    /**
-     * If possible, build the serialization overview for the given
-     * class.
-     *
-     * @param classDoc the class to print the overview for.
-     */
-    public void buildFieldSerializationOverview(ClassDoc classDoc) {
-        if (classDoc.definesSerializableFields()) {
-            FieldDoc serialPersistentField =
-                Util.asList(classDoc.serializableFields()).get(0);
-            // Check to see if there are inline comments, tags or deprecation
-            // information to be printed.
-            if (fieldWriter.shouldPrintOverview(serialPersistentField)) {
-                fieldWriter.writeHeader(
-                        configuration.getText("doclet.Serialized_Form_class"));
-                fieldWriter.writeMemberDeprecatedInfo(serialPersistentField);
-                if (!configuration.nocomment) {
-                    fieldWriter.writeMemberDescription(serialPersistentField);
-                    fieldWriter.writeMemberTags(serialPersistentField);
-                }
-                // Footer required to close the definition list tag
-                // for serialization overview.
-                fieldWriter.writeFooter(
-                        configuration.getText("doclet.Serialized_Form_class"));
-            }
-        }
-    }
-
-    /**
-     * Build the field sub header.
-     */
-    public void buildFieldSubHeader(XMLNode node) {
-        if (! currentClass.definesSerializableFields() ){
-            FieldDoc field = (FieldDoc) currentMember;
-            fieldWriter.writeMemberHeader(field.type().asClassDoc(),
-                field.type().typeName(), field.type().dimension(), field.name());
-        }
-    }
-
-    /**
-     * Build the field deprecation information.
-     */
-    public void buildFieldDeprecationInfo(XMLNode node) {
-        if (!currentClass.definesSerializableFields()) {
-            FieldDoc field = (FieldDoc)currentMember;
-            fieldWriter.writeMemberDeprecatedInfo(field);
-        }
-    }
-
-    /**
-     * Build the field information.
-     */
-    public void buildFieldInfo(XMLNode node) {
-        if(configuration.nocomment){
-            return;
-        }
-        FieldDoc field = (FieldDoc)currentMember;
-        ClassDoc cd = field.containingClass();
-        if (cd.definesSerializableFields()) {
-            // Process Serializable Fields specified as array of
-            // ObjectStreamFields. Print a member for each serialField tag.
-            // (There should be one serialField tag per ObjectStreamField
-            // element.)
-            SerialFieldTag[] tags = field.serialFieldTags();
-            Arrays.sort(tags);
-            for (int i = 0; i < tags.length; i++) {
-                fieldWriter.writeMemberHeader(tags[i].fieldTypeDoc(),
-                        tags[i].fieldType(), "", tags[i].fieldName());
-                fieldWriter.writeMemberDescription(tags[i]);
-
-            }
-        } else {
-
-            // Process default Serializable field.
-            if ((field.tags("serial").length == 0) && ! field.isSynthetic()
-                && configuration.serialwarn) {
-                configuration.message.warning(field.position(),
-                        "doclet.MissingSerialTag", cd.qualifiedName(),
-                        field.name());
-            }
-            fieldWriter.writeMemberDescription(field);
-            fieldWriter.writeMemberTags(field);
-        }
-    }
-
-    /**
-     * Build the field sub footer.
-     */
-    public void buildFieldSubFooter(XMLNode node) {
-        if (! currentClass.definesSerializableFields()) {
-            fieldWriter.writeMemberFooter();
-        }
-    }
-
-    /**
-     * Build the summaries for the methods that belong to the given
-     * class.
-     */
-    public void buildSerializableMethods(XMLNode node) {
-        MemberDoc[] members = currentClass.serializationMethods();
-        if (members.length > 0) {
-            for (int i = 0; i < members.length; i++) {
-                currentMember = members[i];
-                buildChildren(node);
-            }
-        }
-    }
-
-    /**
-     * Build the summaries for the fields that belong to the given
-     * class.
-     */
-    public void buildSerializableFields(XMLNode node) {
-        MemberDoc[] members = currentClass.serializableFields();
-        if (members.length > 0) {
-            for (int i = 0; i < members.length; i++) {
-                currentMember = members[i];
-                buildChildren(node);
-            }
-        }
-    }
 }
--- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/doclet.xml	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/doclet.xml	Mon Dec 20 21:10:57 2010 -0800
@@ -29,177 +29,144 @@
 <Doclet>
 
     <PackageDoc>
-        <PackageHeader/>
-        <Summary>
-            <SummaryHeader/>
-            <InterfaceSummary/>
-            <ClassSummary/>
-            <EnumSummary/>
-            <ExceptionSummary/>
-            <ErrorSummary/>
-            <AnnotationTypeSummary/>
-            <SummaryFooter/>
-        </Summary>
-        <PackageDescription/>
-        <PackageTags/>
-        <PackageFooter/>
+        <Content>
+            <Summary>
+                <InterfaceSummary/>
+                <ClassSummary/>
+                <EnumSummary/>
+                <ExceptionSummary/>
+                <ErrorSummary/>
+                <AnnotationTypeSummary/>
+            </Summary>
+            <PackageDescription/>
+            <PackageTags/>
+        </Content>
     </PackageDoc>
 
     <AnnotationTypeDoc>
-        <AnnotationTypeHeader/>
-        <DeprecationInfo/>
-        <AnnotationTypeSignature/>
-        <AnnotationTypeDescription/>
-        <AnnotationTypeTagInfo/>
+        <AnnotationTypeInfo>
+            <DeprecationInfo/>
+            <AnnotationTypeSignature/>
+            <AnnotationTypeDescription/>
+            <AnnotationTypeTagInfo/>
+        </AnnotationTypeInfo>
         <MemberSummary>
-                <AnnotationTypeRequiredMemberSummary/>
+            <AnnotationTypeRequiredMemberSummary/>
             <AnnotationTypeOptionalMemberSummary/>
         </MemberSummary>
-        <AnnotationTypeRequiredMemberDetails>
-            <Header/>
-            <AnnotationTypeRequiredMember>
-                <MemberHeader/>
-                <Signature/>
-                <DeprecationInfo/>
-                <MemberComments/>
-                <TagInfo/>
-                <MemberFooter/>
-            </AnnotationTypeRequiredMember>
-        </AnnotationTypeRequiredMemberDetails>
-        <AnnotationTypeOptionalMemberDetails>
-            <AnnotationTypeOptionalMember>
-                <MemberHeader/>
-                <Signature/>
-                <DeprecationInfo/>
-                <MemberComments/>
-                <TagInfo/>
-                <DefaultValueInfo/>
-                <MemberFooter/>
-            </AnnotationTypeOptionalMember>
-            <Footer/>
-        </AnnotationTypeOptionalMemberDetails>
-        <AnnotationTypeFooter/>
+        <AnnotationTypeMemberDetails>
+            <AnnotationTypeRequiredMemberDetails>
+                <AnnotationTypeRequiredMember>
+                    <Signature/>
+                    <DeprecationInfo/>
+                    <MemberComments/>
+                    <TagInfo/>
+                </AnnotationTypeRequiredMember>
+            </AnnotationTypeRequiredMemberDetails>
+            <AnnotationTypeOptionalMemberDetails>
+                <AnnotationTypeOptionalMember>
+                    <Signature/>
+                    <DeprecationInfo/>
+                    <MemberComments/>
+                    <TagInfo/>
+                    <DefaultValueInfo/>
+                </AnnotationTypeOptionalMember>
+            </AnnotationTypeOptionalMemberDetails>
+        </AnnotationTypeMemberDetails>
     </AnnotationTypeDoc>
 
     <ClassDoc>
-        <ClassHeader/>
         <ClassTree/>
-        <TypeParamInfo/>
-        <SuperInterfacesInfo/>
-        <ImplementedInterfacesInfo/>
-        <SubClassInfo/>
-        <SubInterfacesInfo/>
-        <InterfaceUsageInfo/>
-        <NestedClassInfo/>
-        <DeprecationInfo/>
-        <ClassSignature/>
-        <ClassDescription/>
-        <ClassTagInfo/>
+        <ClassInfo>
+            <TypeParamInfo/>
+            <SuperInterfacesInfo/>
+            <ImplementedInterfacesInfo/>
+            <SubClassInfo/>
+            <SubInterfacesInfo/>
+            <InterfaceUsageInfo/>
+            <NestedClassInfo/>
+            <DeprecationInfo/>
+            <ClassSignature/>
+            <ClassDescription/>
+            <ClassTagInfo/>
+        </ClassInfo>
         <MemberSummary>
             <NestedClassesSummary/>
-            <NestedClassesInheritedSummary/>
             <EnumConstantsSummary/>
             <FieldsSummary/>
-            <FieldsInheritedSummary/>
             <ConstructorsSummary/>
             <MethodsSummary/>
-            <MethodsInheritedSummary/>
         </MemberSummary>
-        <EnumConstantsDetails>
-            <Header/>
-            <EnumConstant>
-                <EnumConstantHeader/>
-                <Signature/>
-                <DeprecationInfo/>
-                <EnumConstantComments/>
-                <TagInfo/>
-                <EnumConstantFooter/>
-            </EnumConstant>
-            <Footer/>
-        </EnumConstantsDetails>
-        <FieldDetails>
-            <Header/>
-            <FieldDoc>
-                <FieldHeader/>
-                <Signature/>
-                <DeprecationInfo/>
-                <FieldComments/>
-                <TagInfo/>
-                <FieldFooter/>
-            </FieldDoc>
-            <Footer/>
-        </FieldDetails>
-        <ConstructorDetails>
-            <Header/>
-            <ConstructorDoc>
-                <ConstructorHeader/>
-                <Signature/>
-                <DeprecationInfo/>
-                <ConstructorComments/>
-                <TagInfo/>
-                <ConstructorFooter/>
-            </ConstructorDoc>
-            <Footer/>
-        </ConstructorDetails>
-        <MethodDetails>
-            <Header/>
-            <MethodDoc>
-                <MethodHeader/>
-                <Signature/>
-                <DeprecationInfo/>
-                <MethodComments/>
-                <TagInfo/>
-                <MethodFooter/>
-            </MethodDoc>
-            <Footer/>
-        </MethodDetails>
-        <ClassFooter/>
+        <MemberDetails>
+            <EnumConstantsDetails>
+                <EnumConstant>
+                    <Signature/>
+                    <DeprecationInfo/>
+                    <EnumConstantComments/>
+                    <TagInfo/>
+                </EnumConstant>
+            </EnumConstantsDetails>
+            <FieldDetails>
+                <FieldDoc>
+                    <Signature/>
+                    <DeprecationInfo/>
+                    <FieldComments/>
+                    <TagInfo/>
+                </FieldDoc>
+            </FieldDetails>
+            <ConstructorDetails>
+                <ConstructorDoc>
+                    <Signature/>
+                    <DeprecationInfo/>
+                    <ConstructorComments/>
+                    <TagInfo/>
+                </ConstructorDoc>
+            </ConstructorDetails>
+            <MethodDetails>
+                <MethodDoc>
+                    <Signature/>
+                    <DeprecationInfo/>
+                    <MethodComments/>
+                    <TagInfo/>
+                </MethodDoc>
+            </MethodDetails>
+        </MemberDetails>
     </ClassDoc>
 
     <ConstantSummary>
-        <Header/>
         <Contents/>
         <ConstantSummaries>
-            <PackageConstantSummary>
-                <PackageHeader/>
-                <ClassConstantSummary>
-                    <ClassHeader/>
-                    <ConstantMembers/>
-                    <ClassFooter/>
-                </ClassConstantSummary>
-            </PackageConstantSummary>
+            <PackageHeader/>
+            <ClassConstantSummary>
+                <ConstantMembers/>
+            </ClassConstantSummary>
         </ConstantSummaries>
-        <Footer/>
     </ConstantSummary>
 
     <SerializedForm>
-        <Header/>
         <SerializedFormSummaries>
             <PackageSerializedForm>
                 <PackageHeader/>
                 <ClassSerializedForm>
-                    <ClassHeader/>
                     <SerialUIDInfo/>
-                    <MethodHeader/>
-                    <SerializableMethods>
-                        <MethodSubHeader/>
-                        <DeprecatedMethodInfo/>
-                        <MethodInfo>
-                            <MethodDescription/>
-                            <MethodTags/>
-                        </MethodInfo>
-                        <MethodFooter/>
-                    </SerializableMethods>
-                    <FieldHeader/>
-                    <SerializableFields>
-                        <FieldSubHeader/>
-                        <FieldDeprecationInfo/>
-                        <FieldInfo/>
-                        <FieldSubFooter/>
-                    </SerializableFields>
+                    <ClassContent>
+                        <SerializableMethods>
+                            <MethodSubHeader/>
+                            <DeprecatedMethodInfo/>
+                            <MethodInfo>
+                                <MethodDescription/>
+                                <MethodTags/>
+                            </MethodInfo>
+                        </SerializableMethods>
+                        <FieldHeader/>
+                        <SerializableFields>
+                            <FieldSubHeader/>
+                            <FieldDeprecationInfo/>
+                            <FieldInfo/>
+                        </SerializableFields>
+                    </ClassContent>
                 </ClassSerializedForm>
             </PackageSerializedForm>
         </SerializedFormSummaries>
-        <Footer/>
     </SerializedForm>
 </Doclet>
--- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/doclets.properties	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/doclets.properties	Mon Dec 20 21:10:57 2010 -0800
@@ -111,12 +111,12 @@
 doclet.extends=extends
 doclet.Package_private=(package private)
 doclet.implements=implementsdoclet.Same_package_name_used=Package name format used twice: {0}
-doclet.Nested_Classes_Interfaces_Inherited_From_Class=Nested classes/interfaces inherited from class {0}
-doclet.Nested_Classes_Interface_Inherited_From_Interface=Nested classes/interfaces inherited from interface {0}
-doclet.Methods_Inherited_From_Class=Methods inherited from class {0}
-doclet.Methods_Inherited_From_Interface=Methods inherited from interface {0}
-doclet.Fields_Inherited_From_Class=Fields inherited from class {0}
-doclet.Fields_Inherited_From_Interface=Fields inherited from interface {0}
+doclet.Nested_Classes_Interfaces_Inherited_From_Class=Nested classes/interfaces inherited from class
+doclet.Nested_Classes_Interface_Inherited_From_Interface=Nested classes/interfaces inherited from interface
+doclet.Methods_Inherited_From_Class=Methods inherited from class
+doclet.Methods_Inherited_From_Interface=Methods inherited from interface
+doclet.Fields_Inherited_From_Class=Fields inherited from class
+doclet.Fields_Inherited_From_Interface=Fields inherited from interface
 doclet.Serializable=Serializable
 doclet.Externalizable=Externalizable
 doclet.Annotation_Type_Member_Detail=Element Detail
@@ -136,12 +136,19 @@
 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.Fields=Fields
 doclet.constructors=constructors
+doclet.Constructors=Constructors
 doclet.methods=methods
+doclet.Methods=Methods
 doclet.annotation_type_optional_members=optional elements
+doclet.Annotation_Type_Optional_Members=Optional Elements
 doclet.annotation_type_required_members=required elements
+doclet.Annotation_Type_Required_Members=Required Elements
 doclet.enum_constants=enum constants
+doclet.Enum_Constants=Enum Constants
 doclet.nested_classes=nested classes
+doclet.Nested_Classes=Nested Classes
 doclet.subclasses=subclasses
 doclet.subinterfaces=subinterfaces
 doclet.Modifier=Modifier
@@ -173,7 +180,7 @@
 
 doclet.enum_valueof_doc=\n\
  Returns the enum constant of this type with the specified name.\n\
- The string must match <I>exactly</I> an identifier used to declare an\n\
+ The string must match <i>exactly</i> an identifier used to declare an\n\
  enum constant in this type.  (Extraneous whitespace characters are \n\
  not permitted.)\n\
  \n\
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/stylesheet.css	Mon Dec 20 21:10:57 2010 -0800
@@ -0,0 +1,439 @@
+/* Javadoc style sheet */
+/*
+Overall document style
+*/
+* {
+    margin:0;
+    padding:0;
+}
+body {
+    font-family:Helvetica, Arial, sans-serif;
+    color:#000000;
+}
+p {
+    margin:20px 0;
+}
+pre {
+    font-size:1.0em;
+}
+h1 {
+    font-size:1.4em;
+}
+h2 {
+    font-size:1.35em;
+}
+h3 {
+    font-size:1.3em;
+}
+h4 {
+    font-size:1.25em;
+}
+ul {
+    margin:10px 0 10px 20px;
+}
+li {
+    list-style:disc;
+}
+dl dt {
+    font-size:0.95em;
+    font-weight:bold;
+    margin:10px 0 0 0;
+}
+dl dd {
+    margin:10px 0 10px 20px;
+}
+dl dd ul {
+    margin-left:0;
+}
+dl dd ul li {
+    list-style:none;
+    margin:10px 0 10px 0;
+}
+caption {
+    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;
+    width:auto;
+}
+/*
+Document title and Copyright styles
+*/
+.aboutLanguage {
+    float:right;
+    font-size:0.9em;
+    color:#000000;
+}
+.legalCopy {
+    margin:7px;
+}
+.bar {
+    font-size:1em;
+    margin:10px 0 0 10px;
+}
+.bar a {
+    font-weight:normal;
+}
+/*
+Navigation bar styles
+*/
+.topNav {
+    border-top:2px solid #C0C0C0;
+    margin:7px;
+    padding:7px 0;
+    height:2.8em;
+    width:99%;
+    min-width:600px;
+}
+.bottomNav {
+    border-top:2px solid #C0C0C0;
+    margin:7px;
+    padding:7px 0;
+    height:2.8em;
+    width:99%;
+}
+.subNav {
+    border-bottom:2px solid #C0C0C0;
+    float:left;
+    width:99%;
+    margin:7px;
+    min-width:600px;
+}
+.subNav div {
+    clear:left;
+    float:left;
+    padding:0 0 5px 2px;
+    width:100%;
+}
+.topNav a:link,.topNav a:active, .topNav a:visited, .topNav a:hover,
+.bottomNav a:link,.bottomNav a:active, .bottomNav a:visited, .bottomNav a:hover {
+    color:#000000;
+    font-weight:bold;
+    text-decoration:underline;
+    font-size:1em;
+}
+/* Navigation bar list styles */
+.topNav ul.navList, .bottomNav ul.navList {
+    background-color:#EEEEFF;
+    padding:7px 5px;
+    margin:0;
+    float:left;
+    width:80%;
+}
+ul.navList li{
+    list-style:none;
+    float:left;
+    padding:3px 4px;
+    color:#000000;
+    font-size:0.98em;
+}
+ul.navList li.navBarCell1Rev {
+    background-color:#00008B;
+    color:#FFFFFF;
+    font-weight:bold;
+    font-size:0.97em;
+}
+/* Sub-navigation bar list styles */
+.subNav ul.navList {
+    float:left;
+    margin:0;
+    font-size:0.7em;
+    width:350px;
+}
+ul.subNavList {
+    float:left;
+    margin:0;
+    font-size:0.7em;
+    width:350px;
+}
+ul.subNavList li{
+    list-style:none;
+    float:left;
+    font-size:90%;
+}
+/*
+Page header and footer styles
+*/
+.header, .footer {
+    clear:both;
+    margin:0 7px;
+}
+.indexHeader {
+    font-size:0.9em;
+    margin:10px 0 7px 10px;
+}
+.header ul {
+    padding-left:20px;
+}
+/* Header and footer title styles */ 
+.header h1.title {
+    font-size:1.4em;
+    text-align:center;
+    margin:0;
+}
+.header h2.title {
+    font-size:1.35em;
+    margin:0;
+}
+.subTitle {
+    margin:0;
+    padding-top:10px;
+    font-size:0.75em;
+    font-weight:bold;
+}
+/*
+Page layout container styles
+*/
+.contentContainer, .sourceContainer, .classUseContainer, .serializedFormContainer,
+.constantValuesContainer {
+    clear:both;
+    padding:10px 10px;
+    position:relative;
+}
+.indexContainer {
+    padding:0 0 10px 10px;
+    font-size:0.9em;
+}
+/*
+Class inheritance information styles
+*/
+ul.inheritance {
+    margin:0;
+    padding:0;
+}
+ul.inheritance li {
+    display:inline;
+    list-style:none;
+}
+ul.inheritance li ul.inheritance {
+    margin-left:15px;
+    background-image:url(resources/inherit.gif);
+    background-repeat:no-repeat;
+    padding-left:15px;
+    padding-top:1px;
+}
+/*
+Heading styles
+*/
+.indexContainer h2 {
+    font-weight:normal;
+    font-size:1.0em;
+    padding:10px 0 0 0;
+}
+.contentContainer h2 {
+    margin:10px 0;
+}
+.constantValuesContainer h2 {
+    background:#CCCCFF;
+    border:2px ridge;
+    padding:3px;
+    margin:0 0 10px 0;
+}
+.serializedFormContainer ul.blockList li.blockList h2 {
+    background:#EEEEFF;
+    border:2px ridge;
+    padding:3px;
+    margin:0 0 15px 0;
+    text-align:center;
+}
+.classUseContainer ul li ul li h3 {
+    margin-bottom:30px;
+    padding:3px;
+}
+.serializedFormContainer ul.blockList li.blockList ul.blockList li.blockList h3 {
+    background:#EEEEFF;
+    margin:0 0 15px 0;
+    padding:3px;
+}
+.serializedFormContainer ul.blockList li.blockList ul.blockList li.blockList ul.blockList li.blockList h3 {
+    background:#CCCCFF;
+    margin:0 0 15px 0;
+    padding:3px;
+    border:2px ridge;
+}
+ul.blockList ul.blockList li.blockList h3, ul.blockList ul.blockList li.blockList h3 {
+    background:#CCCCFF;
+    border:2px ridge;
+    padding-left:5px;
+}
+div.summary ul.blockList ul.blockList li.blockList h3 {
+    background:#CCCCFF;
+    border:0;
+    border:2px ridge;
+    padding-left:5px;
+}
+div.summary ul.blockList ul.blockList ul.blockList li.blockList h3 {
+    background:#EEEEFF;
+    border:0;
+    border-bottom:2px ridge;
+}
+div.details ul.blockList ul.blockList ul.blockList li.blockList h4,
+div.details ul.blockList ul.blockList ul.blockListLast li.blockList h4 {
+    font-size:1.15em;
+    font-weight:bold;
+    padding:0 0 10px 0;
+}
+/*
+Table styles
+*/
+.contentContainer table {
+    border-collapse: collapse ;
+    width:100%;
+}
+.contentContainer table td, .contentContainer table th {
+    border:2px ridge;
+    padding:3px;
+}
+/* Constant values page table styles */
+.constantValuesContainer table {
+    border-collapse: collapse ;
+    margin:0 0 10px 0;
+}
+.constantValuesContainer table caption{
+    font-size:0.95em;
+    padding:3px;
+    background:#EEEEFF;
+}
+.constantValuesContainer table td, .constantValuesContainer table th {
+    border:2px ridge;
+    padding:3px;
+}
+/* Class-use/Package-use page table styles */
+.classUseContainer table {
+    border-collapse: collapse ;
+    width:100%;
+    margin:0 0 15px 0;
+}
+.classUseContainer ul li ul li table {
+    margin-bottom:30px;
+}
+.classUseContainer ul li ul li table caption{
+    font-size:0.95em;
+    padding:3px;
+    background:#EEEEFF;
+}
+.classUseContainer table td, .classUseContainer table th {
+    border:2px ridge;
+    padding:3px;
+}
+/* Summary table styles */
+ul.blockList li.blockList table.overviewSummary {
+    margin:0;
+    margin-bottom:15px;
+}
+ul.blockList li.blockList table caption {
+    padding:3px;
+}
+ul.blockList li.blockList table.overviewSummary td.colFirst{
+    text-align:right;
+}
+table.packageSummary td.colFirst, table.overviewSummary th.colFirst {
+    width:15%;
+}
+div.summary ul.blockList ul.blockList li.blockList caption {
+    display:none;
+}
+div.summary ul.blockList li.blockList ul.blockList li.blockList table.overviewSummary th {
+    border-top:0;
+}
+/* Table column block styles */
+ul.blockList li.blockList table.overviewSummary td.colLast div.block{
+    padding:0;
+    padding-left:40px;
+}
+ul.blockList li.blockList table.overviewSummary td.colOne div.block{
+    padding:0;
+    padding-left:40px;
+}
+.contentContainer ul.blockList li.blockList table .colOne div.block{
+    padding-left:40px;
+}
+.classUseContainer ul li ul li table .colLast div.block,
+.classUseContainer ul li ul li table .colOne div.block{
+    padding-left:40px;
+}
+/*
+List styles
+*/
+ul.horizontal li {
+    display:inline;
+    font-size:0.9em;   
+}
+/* Container specific list styles */
+.indexContainer ul {
+    margin:0;
+}
+.indexContainer ul li {
+    list-style:none;
+}
+.serializedFormContainer ul.blockList li.blockList ul.blockList li.blockList ul.blockList li.blockList {
+    border:0;
+}
+.serializedFormContainer ul.blockList li.blockList ul.blockList li.blockList ul.blockList li.blockList ul.blockList li.blockList {
+    list-style:none;
+    border:0;
+    border-bottom:2px ridge;
+}
+.serializedFormContainer ul.blockList li.blockList ul.blockList li.blockList ul.blockList li.blockList ul.blockList li.blockListLast {
+    list-style:none;
+}
+/* General list styles */
+ul.blockList, ul.blockListLast {
+    margin-left:0;
+    padding-left:0;
+}
+ul.blockList li.blockList, ul.blockListLast li.blockList {
+    list-style:none;
+    margin-bottom:25px;
+}
+ul.blockList ul.blockList ul.blockList li.blockList {
+    border:2px ridge;
+}
+div.details ul.blockList ul.blockList ul.blockList li.blockList {
+    border:0;
+    border-bottom:2px ridge;
+}
+/* Definition list styles */
+ul.blockList li.blockList dl{
+    margin-bottom:15px;
+}
+ul.blockList li.blockList dl dd{
+    margin:0 0 0 30px;
+}
+ul.blockList li.blockList ul.blockList li.blockList ul.blockList li.blockList dl,
+ul.blockList li.blockList ul.blockList li.blockList ul.blockListLast li.blockList dl{
+    padding:0 0 10px 35px;
+}
+dl.nameValue dt, dl.nameValue dd{
+    display:inline;
+}
+ul.blockList li.blockList pre{
+    margin:0 0 15px 0;
+}
+/* List content styles */
+ul.blockList li.blockList ul.blockList li.blockList pre{
+    margin:10px 0 15px 0;
+}
+ul.blockList li.blockList ul.blockList li.blockList ul.blockList li.blockList pre,
+ul.blockList li.blockList ul.blockList li.blockList ul.blockListLast li.blockList pre{
+    padding:0 0 10px 0;
+}
+ul.blockList li.blockList ul.blockList li.blockList ul.blockList li.blockList div.block,
+ul.blockList li.blockList ul.blockList li.blockList ul.blockListLast li.blockList div.block{
+    padding:0 0 10px 35px;
+}
+/*
+Formatting effect styles
+*/
+.strong {
+    font-weight:bold;
+}
+.sourceLineNo {
+    color:green;
+    padding:0 30px 0 0;
+}
--- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/DirectoryManager.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/DirectoryManager.java	Mon Dec 20 21:10:57 2010 -0800
@@ -46,7 +46,7 @@
     /**
      * The file separator string, "/", used in the formation of the URL path.
      */
-    public static final String URL_FILE_SEPERATOR = "/";
+    public static final String URL_FILE_SEPARATOR = "/";
 
     /**
      * Never instaniated.
@@ -123,13 +123,13 @@
         for (int i = 0; i < packageName.length(); i++) {
             char ch = packageName.charAt(i);
             if (ch == '.') {
-                pathstr.append(URL_FILE_SEPERATOR);
+                pathstr.append(URL_FILE_SEPARATOR);
             } else {
                 pathstr.append(ch);
             }
         }
-        if (pathstr.length() > 0 && ! pathstr.toString().endsWith(URL_FILE_SEPERATOR)) {
-            pathstr.append(URL_FILE_SEPERATOR);
+        if (pathstr.length() > 0 && ! pathstr.toString().endsWith(URL_FILE_SEPARATOR)) {
+            pathstr.append(URL_FILE_SEPARATOR);
         }
         return pathstr.toString();
     }
@@ -155,7 +155,7 @@
         for (int i = 0; i < name.length(); i++) {
             char ch = name.charAt(i);
             if (ch == '.') {
-                pathstr.append(URL_FILE_SEPERATOR);
+                pathstr.append(URL_FILE_SEPARATOR);
             } else {
                 pathstr.append(ch);
             }
@@ -184,7 +184,7 @@
         StringBuffer pathstr = new StringBuffer();
         pathstr.append(getRelativePath(from));
         pathstr.append(getPath(to));
-        pathstr.append(URL_FILE_SEPERATOR);
+        pathstr.append(URL_FILE_SEPARATOR);
         return pathstr.toString();
     }
 
@@ -226,10 +226,10 @@
         for (int i = 0; i < from.length(); i++) {
             char ch = from.charAt(i);
             if (ch == '.') {
-                pathstr.append(".." + URL_FILE_SEPERATOR);
+                pathstr.append(".." + URL_FILE_SEPARATOR);
             }
         }
-        pathstr.append(".." + URL_FILE_SEPERATOR);
+        pathstr.append(".." + URL_FILE_SEPARATOR);
         return pathstr.toString();
     }
 
@@ -297,7 +297,7 @@
         String pathstr = createPathString(pd);
         if (pathstr.length() > 0) {
             buf.append(pathstr);
-            buf.append(URL_FILE_SEPERATOR);
+            buf.append(URL_FILE_SEPARATOR);
         }
         buf.append(filename);
         return buf.toString();
--- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/SourceToHTMLConverter.java	Thu Dec 16 19:57:01 2010 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,303 +0,0 @@
-/*
- * Copyright (c) 2001, 2009, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.tools.doclets.internal.toolkit.util;
-
-import java.io.*;
-import java.util.*;
-import javax.tools.FileObject;
-
-import com.sun.javadoc.*;
-import com.sun.tools.doclets.internal.toolkit.*;
-
-/**
- * Converts Java Source Code to HTML.
- *
- * This code is not part of an API.
- * It is implementation that is subject to change.
- * Do not use it as an API
- *
- * @author Jamie Ho
- * @since 1.4
- */
-public class SourceToHTMLConverter {
-
-    /**
-     * The background color.
-     */
-    protected static final String BGCOLOR = "white";
-
-    /**
-     * The line number color.
-     */
-    protected static final String LINE_NO_COLOR = "green";
-
-    /**
-     * The number of trailing blank lines at the end of the page.
-     * This is inserted so that anchors at the bottom of small pages
-     * can be reached.
-     */
-    protected static final int NUM_BLANK_LINES = 60;
-
-
-    /**
-     * Source is converted to HTML using static methods below.
-     */
-    private SourceToHTMLConverter() {}
-
-    /**
-     * Convert the Classes in the given RootDoc to an HTML.
-     * @param configuration the configuration.
-     * @param rd the RootDoc to convert.
-     * @param outputdir the name of the directory to output to.
-     */
-    public static void convertRoot(Configuration configuration, RootDoc rd, String outputdir) {
-        if (rd == null || outputdir == null) {
-            return;
-        }
-        PackageDoc[] pds = rd.specifiedPackages();
-        for (int i = 0; i < pds.length; i++) {
-            convertPackage(configuration, pds[i], outputdir);
-        }
-        ClassDoc[] cds = rd.specifiedClasses();
-        for (int i = 0; i < cds.length; i++) {
-            convertClass(configuration, cds[i],
-                getPackageOutputDir(outputdir, cds[i].containingPackage()));
-        }
-    }
-
-    /**
-     * Convert the Classes in the given Package to an HTML.
-     * @param configuration the configuration.
-     * @param pd the Package to convert.
-     * @param outputdir the name of the directory to output to.
-     */
-    public static void convertPackage(Configuration configuration, PackageDoc pd, String outputdir) {
-        if (pd == null || outputdir == null) {
-            return;
-        }
-        String classOutputdir = getPackageOutputDir(outputdir, pd);
-        ClassDoc[] cds = pd.allClasses();
-        for (int i = 0; i < cds.length; i++) {
-            convertClass(configuration, cds[i], classOutputdir);
-        }
-    }
-
-    /**
-     * Return the directory write output to for the given package.
-     * @param outputDir the directory to output to.
-     * @param pd the Package to generate output for.
-     */
-    private static String getPackageOutputDir(String outputDir, PackageDoc pd) {
-        return outputDir + File.separator +
-            DirectoryManager.getDirectoryPath(pd) + File.separator;
-    }
-
-    /**
-     * Convert the given Class to an HTML.
-     * @param configuration the configuration.
-     * @param cd the class to convert.
-     * @param outputdir the name of the directory to output to.
-     */
-    public static void convertClass(Configuration configuration, ClassDoc cd, String outputdir) {
-        if (cd == null || outputdir == null) {
-            return;
-        }
-        try {
-            SourcePosition sp = cd.position();
-            if (sp == null)
-                return;
-            Reader r;
-            // temp hack until we can update SourcePosition API.
-            if (sp instanceof com.sun.tools.javadoc.SourcePositionImpl) {
-                FileObject fo = ((com.sun.tools.javadoc.SourcePositionImpl) sp).fileObject();
-                if (fo == null)
-                    return;
-                r = fo.openReader(true);
-            } else {
-                File file = sp.file();
-                if (file == null)
-                    return;
-                r = new FileReader(file);
-            }
-            LineNumberReader reader = new LineNumberReader(r);
-            int lineno = 1;
-            String line;
-            StringBuffer output = new StringBuffer();
-            try {
-                while ((line = reader.readLine()) != null) {
-                    output.append(formatLine(line, configuration.sourcetab, lineno));
-                    lineno++;
-                }
-            } finally {
-                reader.close();
-            }
-            output = addLineNumbers(output.toString());
-            output.insert(0, getHeader(configuration));
-            output.append(getFooter());
-            writeToFile(output.toString(), outputdir, cd.name(), configuration);
-        } catch (Exception e){
-            e.printStackTrace();
-        }
-    }
-
-    /**
-     * Write the output to the file.
-     * @param output the string to output.
-     * @param outputDir the directory to output to.
-     * @param className the name of the class that I am converting to HTML.
-     * @param configuration the Doclet configuration to pass notices to.
-     */
-    private static void writeToFile(String output, String outputDir, String className, Configuration configuration) throws IOException {
-        File dir = new File(outputDir);
-        dir.mkdirs();
-        File newFile = new File(dir, className + ".html");
-        configuration.message.notice("doclet.Generating_0", newFile.getPath());
-        FileOutputStream fout = new FileOutputStream(newFile);
-        BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(fout));
-        bw.write(output);
-        bw.close();
-        fout.close();
-    }
-
-    /**
-     * Given a <code>String</code>, add line numbers.
-     * @param s the text to add line numbers to.
-     *
-     * @return the string buffer with the line numbering for each line.
-     */
-    private static StringBuffer addLineNumbers(String s) {
-        StringBuffer sb = new StringBuffer();
-        StringTokenizer st = new StringTokenizer(s, "\n", true);
-        int lineno = 1;
-        String current;
-        while(st.hasMoreTokens()){
-            current = st.nextToken();
-            sb.append(current.equals("\n") ?
-                    getHTMLLineNo(lineno) + current :
-                    getHTMLLineNo(lineno) + current + st.nextToken());
-            lineno++;
-        }
-        return sb;
-    }
-
-    /**
-     * Get the header.
-     * @param configuration the Doclet configuration
-     * @return the header to the output file
-     */
-    protected static String getHeader(Configuration configuration) {
-        StringBuffer result = new StringBuffer("<HTML lang=\"" + configuration.getLocale().getLanguage() + "\">" + DocletConstants.NL);
-        result.append("<BODY BGCOLOR=\""+ BGCOLOR + "\">" + DocletConstants.NL);
-        result.append("<PRE>" + DocletConstants.NL);
-        return result.toString();
-    }
-
-    /**
-     * Get the footer
-     * @return the footer to the output file
-     */
-    protected static String getFooter() {
-        StringBuffer footer = new StringBuffer();
-        for (int i = 0; i < NUM_BLANK_LINES; i++) {
-            footer.append(DocletConstants.NL);
-        }
-        footer.append("</PRE>" + DocletConstants.NL + "</BODY>" +
-            DocletConstants.NL + "</HTML>" + DocletConstants.NL);
-        return footer.toString();
-    }
-
-    /**
-     * Get the HTML for the lines.
-     * @param lineno The line number
-     * @return the HTML code for the line
-     */
-    protected static String getHTMLLineNo(int lineno) {
-        StringBuffer result = new StringBuffer("<FONT color=\"" + LINE_NO_COLOR
-            + "\">");
-        if (lineno < 10) {
-            result.append("00" + ((new Integer(lineno)).toString()));
-        } else if (lineno < 100) {
-            result.append("0" + ((new Integer(lineno)).toString()));
-        } else {
-            result.append((new Integer(lineno)).toString());
-        }
-        result.append("</FONT>    ");
-        return result.toString();
-    }
-
-    /**
-     * Format a given line of source. <br>
-     * Note:  In the future, we will add special colors for constructs in the
-     * language.
-     * @param line the string to format.
-     * @param tabLength the number of spaces for each tab.
-     * @param currentLineNo the current number.
-     */
-    protected static String formatLine(String line, int tabLength, int currentLineNo) {
-        if (line == null) {
-            return null;
-        }
-        StringBuffer lineBuffer = new StringBuffer(Util.escapeHtmlChars(line));
-        //Insert an anchor for the line
-        lineBuffer.append("<a name=\"line." + Integer.toString(currentLineNo) + "\"></a>");
-        lineBuffer.append(DocletConstants.NL);
-        Util.replaceTabs(tabLength, lineBuffer);
-        return lineBuffer.toString();
-    }
-
-    /**
-     * Given an array of <code>Doc</code>s, add to the given <code>HashMap</code> the
-     * line numbers and anchors that should be inserted in the output at those lines.
-     * @param docs the array of <code>Doc</code>s to add anchors for.
-     * @param hash the <code>HashMap</code> to add to.
-     */
-    protected static void addToHash(Doc[] docs, HashMap<Integer,String> hash) {
-        if(docs == null) {
-            return;
-        }
-        for(int i = 0; i < docs.length; i++) {
-            hash.put(docs[i].position().line(), getAnchor(docs[i]));
-        }
-    }
-
-    /**
-     * Given a <code>Doc</code>, return an anchor for it.
-     * @param d the <code>Doc</code> to check.
-     * @return an anchor of the form &lt;a name="my_name">&lt;/a>
-     */
-    protected static String getAnchor(Doc d) {
-        return "    <a name=\"" + getAnchorName(d) + "\"></a>";
-    }
-
-    /**
-     * Given a <code>Doc</code>, return an anchor name for it.
-     * @param d the <code>Doc</code> to check.
-     * @return the name of the anchor.
-     */
-    public static String getAnchorName(Doc d) {
-        return "line." + d.position().line();
-    }
-}
--- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/Util.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/Util.java	Mon Dec 20 21:10:57 2010 -0800
@@ -51,6 +51,11 @@
     {{"&", "&amp;"}, {"<", "&lt;"}, {">", "&gt;"}};
 
     /**
+     * Name of the resource directory.
+     */
+    public static final String RESOURCESDIR = "resources";
+
+    /**
      * Return array of class members whose documentation is to be generated.
      * If the member is deprecated do not include such a member in the
      * returned array.
@@ -206,14 +211,14 @@
         try {
             while ((len = input.read(bytearr)) != -1) {
                 output.write(bytearr, 0, len);
-            }
+                }
         } catch (FileNotFoundException exc) {
         } catch (SecurityException exc) {
-        } finally {
+            } finally {
             input.close();
             output.close();
+            }
         }
-    }
 
     /**
      * Copy the given directory contents from the source package directory
@@ -236,8 +241,8 @@
         String destname = configuration.docFileDestDirName;
         File srcdir = new File(path + dir);
         if (destname.length() > 0 && !destname.endsWith(
-               DirectoryManager.URL_FILE_SEPERATOR)) {
-            destname += DirectoryManager.URL_FILE_SEPERATOR;
+               DirectoryManager.URL_FILE_SEPARATOR)) {
+            destname += DirectoryManager.URL_FILE_SEPARATOR;
         }
         String dest = destname + dir;
         try {
@@ -263,7 +268,7 @@
                         && ! configuration.shouldExcludeDocFileDir(
                           srcfile.getName())){
                         copyDocFiles(configuration, path, dir +
-                                    DirectoryManager.URL_FILE_SEPERATOR + srcfile.getName(),
+                                    DirectoryManager.URL_FILE_SEPARATOR + srcfile.getName(),
                                 overwrite);
                     }
                 }
@@ -322,28 +327,64 @@
      *                       it already exists.
      */
     public static void copyResourceFile(Configuration configuration,
-            String resourcefile,
-            boolean overwrite) {
-        String destdir = configuration.destDirName;
-        String destresourcesdir = destdir + "resources";
-        DirectoryManager.createDirectory(configuration, destresourcesdir);
-        File destfile = new File(destresourcesdir, resourcefile);
+            String resourcefile, boolean overwrite) {
+        String destresourcesdir = configuration.destDirName + RESOURCESDIR;
+        copyFile(configuration, resourcefile, RESOURCESDIR, destresourcesdir,
+                overwrite, false);
+    }
+
+    /**
+     * Copy a file from a source directory to a destination directory
+     * (if it is not there already). If <code>overwrite</code> is true and
+     * the destination file already exists, overwrite it.
+     *
+     * @param configuration Holds the error message
+     * @param file The name of the file to copy
+     * @param source The source directory
+     * @param destination The destination directory where the file needs to be copied
+     * @param overwrite A flag to indicate whether the file in the
+     *                  destination directory will be overwritten if
+     *                  it already exists.
+     * @param replaceNewLine true if the newline needs to be replaced with platform-
+     *                  specific newline.
+     */
+    public static void copyFile(Configuration configuration, String file, String source,
+            String destination, boolean overwrite, boolean replaceNewLine) {
+        DirectoryManager.createDirectory(configuration, destination);
+        File destfile = new File(destination, file);
         if(destfile.exists() && (! overwrite)) return;
         try {
-
             InputStream in = Configuration.class.getResourceAsStream(
-                "resources/" + resourcefile);
-
+                    source + DirectoryManager.URL_FILE_SEPARATOR + file);
             if(in==null) return;
-
             OutputStream out = new FileOutputStream(destfile);
-            byte[] buf = new byte[2048];
-            int n;
-            while((n = in.read(buf))>0) out.write(buf,0,n);
-
-            in.close();
-            out.close();
-        } catch(Throwable t) {}
+            try {
+                if (!replaceNewLine) {
+                    byte[] buf = new byte[2048];
+                    int n;
+                    while((n = in.read(buf))>0) out.write(buf,0,n);
+                } else {
+                    BufferedReader reader = new BufferedReader(new InputStreamReader(in));
+                    BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(out));
+                    try {
+                        String line;
+                        while ((line = reader.readLine()) != null) {
+                            writer.write(line);
+                            writer.write(DocletConstants.NL);
+                        }
+                    } finally {
+                        reader.close();
+                        writer.close();
+                    }
+                }
+            } finally {
+                in.close();
+                out.close();
+            }
+        } catch (IOException ie) {
+            ie.printStackTrace();
+            throw new DocletAbortException();
+        }
     }
 
     /**
@@ -357,12 +398,12 @@
         try{
             String pkgPath = DirectoryManager.getDirectoryPath(pkgDoc);
             String completePath = new SourcePath(configuration.sourcepath).
-                getDirectory(pkgPath) + DirectoryManager.URL_FILE_SEPERATOR;
+                getDirectory(pkgPath) + DirectoryManager.URL_FILE_SEPARATOR;
             //Make sure that both paths are using the same seperators.
             completePath = Util.replaceText(completePath, File.separator,
-                    DirectoryManager.URL_FILE_SEPERATOR);
+                    DirectoryManager.URL_FILE_SEPARATOR);
             pkgPath = Util.replaceText(pkgPath, File.separator,
-                    DirectoryManager.URL_FILE_SEPERATOR);
+                    DirectoryManager.URL_FILE_SEPARATOR);
             return completePath.substring(0, completePath.indexOf(pkgPath));
         } catch (Exception e){
             return "";
@@ -572,6 +613,24 @@
     }
 
     /**
+     * Given a string, strips all html characters and
+     * return the result.
+     *
+     * @param rawString The string to check.
+     * @return the original string with all of the HTML characters
+     * stripped.
+     *
+     */
+    public static String stripHtml(String rawString) {
+        // remove HTML tags
+        rawString = rawString.replaceAll("\\<.*?>", " ");
+        // consolidate multiple spaces between a word to a single space
+        rawString = rawString.replaceAll("\\b\\s{2,}\\b", " ");
+        // remove extra whitespaces
+        return rawString.trim();
+    }
+
+    /**
      * Create the directory path for the file to be generated, construct
      * FileOutputStream and OutputStreamWriter depending upon docencoding.
      *
--- a/langtools/src/share/classes/com/sun/tools/javac/api/JavacTrees.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/api/JavacTrees.java	Mon Dec 20 21:10:57 2010 -0800
@@ -228,6 +228,17 @@
         return new JavacScope(getAttrContext(path));
     }
 
+    public String getDocComment(TreePath path) {
+        CompilationUnitTree t = path.getCompilationUnit();
+        if (t instanceof JCTree.JCCompilationUnit) {
+            JCCompilationUnit cu = (JCCompilationUnit) t;
+            if (cu.docComments != null) {
+                return cu.docComments.get(path.getLeaf());
+            }
+        }
+        return null;
+    }
+
     public boolean isAccessible(Scope scope, TypeElement type) {
         if (scope instanceof JavacScope && type instanceof ClassSymbol) {
             Env<AttrContext> env = ((JavacScope) scope).env;
--- a/langtools/src/share/classes/com/sun/tools/javac/code/Lint.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/Lint.java	Mon Dec 20 21:10:57 2010 -0800
@@ -134,6 +134,11 @@
         CAST("cast"),
 
         /**
+         * Warn about issues related to classfile contents
+         */
+        CLASSFILE("classfile"),
+
+        /**
          * Warn about use of deprecated items.
          */
         DEPRECATION("deprecation"),
--- a/langtools/src/share/classes/com/sun/tools/javac/code/Scope.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/Scope.java	Mon Dec 20 21:10:57 2010 -0800
@@ -83,6 +83,10 @@
         }
     };
 
+    /** A list of scopes to be notified if items are to be removed from this scope.
+     */
+    List<Scope> listeners = List.nil();
+
     public static class ScopeCounter {
         protected static final Context.Key<ScopeCounter> scopeCounterKey =
             new Context.Key<ScopeCounter>();
@@ -220,7 +224,7 @@
         int n = 0;
         for (int i = oldtable.length; --i >= 0; ) {
             Entry e = oldtable[i];
-            if (e != null && e != sentinel && ! e.isBogus()) {
+            if (e != null && e != sentinel) {
                 table[getIndex(e.sym.name)] = e;
                 n++;
             }
@@ -300,6 +304,11 @@
             }
             te = te.sibling;
         }
+
+        // remove items from scopes that have done importAll
+        for (List<Scope> l = listeners; l.nonEmpty(); l = l.tail) {
+            l.head.remove(sym);
+        }
     }
 
     /** Enter symbol sym in this scope if not already there.
@@ -365,7 +374,7 @@
         int h = name.hashCode();
         int i = h & hashMask;
         // The expression below is always odd, so it is guaranteed
-        // be be mutually prime with table.length, a power of 2.
+        // to be mutually prime with table.length, a power of 2.
         int x = hashMask - ((h + (h >> 16)) << 1);
         int d = -1; // Index of a deleted item.
         for (;;) {
@@ -486,6 +495,11 @@
             return shadowed;
         }
 
+        public Entry next(Filter<Symbol> sf) {
+            if (shadowed.sym == null || sf.accepts(shadowed.sym)) return shadowed;
+            else return shadowed.next(sf);
+        }
+
         public Scope getOrigin() {
             // The origin is only recorded for import scopes.  For all
             // other scope entries, the "enclosing" type is available
@@ -495,8 +509,6 @@
             // in many cases.
             return scope;
         }
-
-        protected boolean isBogus () { return false; }
     }
 
     public static class ImportScope extends Scope {
@@ -510,15 +522,6 @@
             return new ImportEntry(sym, shadowed, sibling, scope, origin);
         }
 
-        public Entry lookup(Name name) {
-            Entry e = table[getIndex(name)];
-            if (e == null)
-                return sentinel;
-            while (e.isBogus())
-                e = e.shadowed;
-            return e;
-        }
-
         static class ImportEntry extends Entry {
             private Scope origin;
 
@@ -526,35 +529,25 @@
                 super(sym, shadowed, sibling, scope);
                 this.origin = origin;
             }
-            public Entry next() {
-                Entry e = super.shadowed;
-                while (e.isBogus())
-                    e = e.shadowed;
-                return e;
-            }
 
             @Override
             public Scope getOrigin() { return origin; }
+        }
+    }
 
-            /**
-             * Is this a bogus inner-class import?
-             * An inner class {@code Outer$Inner.class} read from a class file
-             * starts out in a package scope under the name {@code Outer$Inner},
-             * which (if star-imported) gets copied to the import scope.
-             * When the InnerClasses attribute is processed, the ClassSymbol
-             * is renamed in place (to {@code Inner}), and the owner changed
-             * to the {@code Outer} class.  The ImportScope still has the old
-             * Entry that was created and hashed as {@code "Outer$Inner"},
-             * but whose name was changed to {@code "Inner"}.  This violates
-             * the invariants for the Scope hash table, and so is pretty bogus.
-             * When the symbol was renamed, it should have been removed from
-             * the import scope (and not just the package scope); however,
-             * doing so is difficult.  A better fix would be to change
-             * import scopes to indirectly reference package symbols, rather
-             * than copy from them.
-             * Until then, we detect and skip the bogus entries using this test.
-             */
-            protected boolean isBogus () { return sym.owner != scope.owner; }
+    public static class StarImportScope extends ImportScope {
+
+        public StarImportScope(Symbol owner) {
+            super(owner);
+        }
+
+        public void importAll (Scope fromScope) {
+            for (Scope.Entry e = fromScope.elems; e != null; e = e.sibling) {
+                if (e.sym.kind == Kinds.TYP && !includes(e.sym))
+                    enter(e.sym, fromScope);
+            }
+            // Register to be notified when imported items are removed
+            fromScope.listeners = fromScope.listeners.prepend(this);
         }
     }
 
--- a/langtools/src/share/classes/com/sun/tools/javac/code/Source.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/Source.java	Mon Dec 20 21:10:57 2010 -0800
@@ -177,6 +177,9 @@
     public boolean allowStringsInSwitch() {
         return compareTo(JDK1_7) >= 0;
     }
+    public boolean allowSimplifiedVarargs() {
+        return compareTo(JDK1_7) >= 0;
+    }
     public static SourceVersion toSourceVersion(Source source) {
         switch(source) {
         case JDK1_2:
--- a/langtools/src/share/classes/com/sun/tools/javac/code/Symbol.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/Symbol.java	Mon Dec 20 21:10:57 2010 -0800
@@ -1103,18 +1103,24 @@
                  impl == null && is.nonEmpty();
                  is = is.tail) {
                 TypeSymbol i = is.head.tsym;
-                for (Scope.Entry e = i.members().lookup(name);
-                     impl == null && e.scope != null;
-                     e = e.next()) {
-                    if (this.overrides(e.sym, (TypeSymbol)owner, types, true) &&
-                        // FIXME: I suspect the following requires a
-                        // subst() for a parametric return type.
-                        types.isSameType(type.getReturnType(),
-                                         types.memberType(owner.type, e.sym).getReturnType())) {
-                        impl = e.sym;
-                    }
-                    if (impl == null)
-                        impl = implemented(i, types);
+                impl = implementedIn(i, types);
+                if (impl == null)
+                    impl = implemented(i, types);
+            }
+            return impl;
+        }
+
+        public Symbol implementedIn(TypeSymbol c, Types types) {
+            Symbol impl = null;
+            for (Scope.Entry e = c.members().lookup(name);
+                 impl == null && e.scope != null;
+                 e = e.next()) {
+                if (this.overrides(e.sym, (TypeSymbol)owner, types, true) &&
+                    // FIXME: I suspect the following requires a
+                    // subst() for a parametric return type.
+                    types.isSameType(type.getReturnType(),
+                                     types.memberType(owner.type, e.sym).getReturnType())) {
+                    impl = e.sym;
                 }
             }
             return impl;
--- a/langtools/src/share/classes/com/sun/tools/javac/code/Symtab.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/Symtab.java	Mon Dec 20 21:10:57 2010 -0800
@@ -154,6 +154,7 @@
     public final Type proprietaryType;
     public final Type systemType;
     public final Type autoCloseableType;
+    public final Type trustMeType;
 
     /** The symbol representing the length field of an array.
      */
@@ -461,6 +462,7 @@
                              new MethodType(List.<Type>nil(), voidType,
                                             List.of(exceptionType), methodClass),
                              autoCloseableType.tsym);
+        trustMeType = enterClass("java.lang.SafeVarargs");
 
         synthesizeEmptyInterfaceIfMissing(cloneableType);
         synthesizeEmptyInterfaceIfMissing(serializableType);
--- a/langtools/src/share/classes/com/sun/tools/javac/code/Type.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/Type.java	Mon Dec 20 21:10:57 2010 -0800
@@ -245,7 +245,7 @@
     public String argtypes(boolean varargs) {
         List<Type> args = getParameterTypes();
         if (!varargs) return args.toString();
-        StringBuffer buf = new StringBuffer();
+        StringBuilder buf = new StringBuilder();
         while (args.tail.nonEmpty()) {
             buf.append(args.head);
             args = args.tail;
@@ -754,6 +754,10 @@
             return (ARRAY << 5) + elemtype.hashCode();
         }
 
+        public boolean isVarargs() {
+            return false;
+        }
+
         public List<Type> allparams() { return elemtype.allparams(); }
 
         public boolean isErroneous() {
@@ -768,6 +772,15 @@
             return elemtype.isRaw();
         }
 
+        public ArrayType makeVarargs() {
+            return new ArrayType(elemtype, tsym) {
+                @Override
+                public boolean isVarargs() {
+                    return true;
+                }
+            };
+        }
+
         public Type map(Mapping f) {
             Type elemtype1 = f.apply(elemtype);
             if (elemtype1 == elemtype) return this;
@@ -935,7 +948,7 @@
 
     public static class TypeVar extends Type implements TypeVariable {
 
-        /** The bound of this type variable; set from outside.
+        /** The upper bound of this type variable; set from outside.
          *  Must be nonempty once it is set.
          *  For a bound, `bound' is the bound type itself.
          *  Multiple bounds are expressed as a single class type which has the
@@ -946,6 +959,12 @@
          *  points to the first class or interface bound.
          */
         public Type bound = null;
+
+        /** The lower bound of this type variable.
+         *  TypeVars don't normally have a lower bound, so it is normally set
+         *  to syms.botType.
+         *  Subtypes, such as CapturedType, may provide a different value.
+         */
         public Type lower;
 
         public TypeVar(Name name, Symbol owner, Type lower) {
@@ -965,10 +984,12 @@
             return v.visitTypeVar(this, s);
         }
 
+        @Override
         public Type getUpperBound() { return bound; }
 
         int rank_field = -1;
 
+        @Override
         public Type getLowerBound() {
             return lower;
         }
@@ -992,7 +1013,6 @@
      */
     public static class CapturedType extends TypeVar {
 
-        public Type lower;
         public WildcardType wildcard;
 
         public CapturedType(Name name,
@@ -1012,10 +1032,6 @@
             return v.visitCapturedType(this, s);
         }
 
-        public Type getLowerBound() {
-            return lower;
-        }
-
         @Override
         public boolean isCaptured() {
             return true;
--- a/langtools/src/share/classes/com/sun/tools/javac/code/Types.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/Types.java	Mon Dec 20 21:10:57 2010 -0800
@@ -33,6 +33,7 @@
 
 import com.sun.tools.javac.jvm.ClassReader;
 import com.sun.tools.javac.code.Attribute.RetentionPolicy;
+import com.sun.tools.javac.code.Lint.LintCategory;
 import com.sun.tools.javac.comp.Check;
 
 import static com.sun.tools.javac.code.Type.*;
@@ -272,13 +273,36 @@
     public boolean isConvertible(Type t, Type s, Warner warn) {
         boolean tPrimitive = t.isPrimitive();
         boolean sPrimitive = s.isPrimitive();
-        if (tPrimitive == sPrimitive)
+        if (tPrimitive == sPrimitive) {
+            checkUnsafeVarargsConversion(t, s, warn);
             return isSubtypeUnchecked(t, s, warn);
+        }
         if (!allowBoxing) return false;
         return tPrimitive
             ? isSubtype(boxedClass(t).type, s)
             : isSubtype(unboxedType(t), s);
     }
+    //where
+    private void checkUnsafeVarargsConversion(Type t, Type s, Warner warn) {
+        if (t.tag != ARRAY || isReifiable(t)) return;
+        ArrayType from = (ArrayType)t;
+        boolean shouldWarn = false;
+        switch (s.tag) {
+            case ARRAY:
+                ArrayType to = (ArrayType)s;
+                shouldWarn = from.isVarargs() &&
+                        !to.isVarargs() &&
+                        !isReifiable(from);
+                break;
+            case CLASS:
+                shouldWarn = from.isVarargs() &&
+                        isSubtype(from, s);
+                break;
+        }
+        if (shouldWarn) {
+            warn.warn(LintCategory.VARARGS);
+        }
+    }
 
     /**
      * Is t a subtype of or convertiable via boxing/unboxing
@@ -301,9 +325,18 @@
      */
     public boolean isSubtypeUnchecked(Type t, Type s, Warner warn) {
         if (t.tag == ARRAY && s.tag == ARRAY) {
-            return (((ArrayType)t).elemtype.tag <= lastBaseTag)
-                ? isSameType(elemtype(t), elemtype(s))
-                : isSubtypeUnchecked(elemtype(t), elemtype(s), warn);
+            if (((ArrayType)t).elemtype.tag <= lastBaseTag) {
+                return isSameType(elemtype(t), elemtype(s));
+            } else {
+                ArrayType from = (ArrayType)t;
+                ArrayType to = (ArrayType)s;
+                if (from.isVarargs() &&
+                        !to.isVarargs() &&
+                        !isReifiable(from)) {
+                    warn.warn(LintCategory.VARARGS);
+                }
+                return isSubtypeUnchecked(elemtype(t), elemtype(s), warn);
+            }
         } else if (isSubtype(t, s)) {
             return true;
         }
@@ -319,9 +352,9 @@
             Type t2 = asSuper(t, s.tsym);
             if (t2 != null && t2.isRaw()) {
                 if (isReifiable(s))
-                    warn.silentUnchecked();
+                    warn.silentWarn(LintCategory.UNCHECKED);
                 else
-                    warn.warnUnchecked();
+                    warn.warn(LintCategory.UNCHECKED);
                 return true;
             }
         }
@@ -641,7 +674,7 @@
                         if (!set.remove(new SingletonType(x)))
                             return false;
                     }
-                    return (set.size() == 0);
+                    return (set.isEmpty());
                 }
                 return t.tsym == s.tsym
                     && visit(t.getEnclosingType(), s.getEnclosingType())
@@ -838,26 +871,26 @@
                     return isSameType(t, s);
             }
 
-            void debugContainsType(WildcardType t, Type s) {
-                System.err.println();
-                System.err.format(" does %s contain %s?%n", t, s);
-                System.err.format(" %s U(%s) <: U(%s) %s = %s%n",
-                                  upperBound(s), s, t, U(t),
-                                  t.isSuperBound()
-                                  || isSubtypeNoCapture(upperBound(s), U(t)));
-                System.err.format(" %s L(%s) <: L(%s) %s = %s%n",
-                                  L(t), t, s, lowerBound(s),
-                                  t.isExtendsBound()
-                                  || isSubtypeNoCapture(L(t), lowerBound(s)));
-                System.err.println();
-            }
+//            void debugContainsType(WildcardType t, Type s) {
+//                System.err.println();
+//                System.err.format(" does %s contain %s?%n", t, s);
+//                System.err.format(" %s U(%s) <: U(%s) %s = %s%n",
+//                                  upperBound(s), s, t, U(t),
+//                                  t.isSuperBound()
+//                                  || isSubtypeNoCapture(upperBound(s), U(t)));
+//                System.err.format(" %s L(%s) <: L(%s) %s = %s%n",
+//                                  L(t), t, s, lowerBound(s),
+//                                  t.isExtendsBound()
+//                                  || isSubtypeNoCapture(L(t), lowerBound(s)));
+//                System.err.println();
+//            }
 
             @Override
             public Boolean visitWildcardType(WildcardType t, Type s) {
                 if (s.tag >= firstPartialTag)
                     return containedBy(s, t);
                 else {
-                    // debugContainsType(t, s);
+//                    debugContainsType(t, s);
                     return isSameWildcard(t, s)
                         || isCaptureOf(s, t)
                         || ((t.isExtendsBound() || isSubtypeNoCapture(L(t), lowerBound(s))) &&
@@ -922,6 +955,7 @@
         if (warn != warnStack.head) {
             try {
                 warnStack = warnStack.prepend(warn);
+                checkUnsafeVarargsConversion(t, s, warn);
                 return isCastable.visit(t,s);
             } finally {
                 warnStack = warnStack.tail;
@@ -964,7 +998,7 @@
 
                 if (s.tag == TYPEVAR) {
                     if (isCastable(t, s.getUpperBound(), Warner.noWarnings)) {
-                        warnStack.head.warnUnchecked();
+                        warnStack.head.warn(LintCategory.UNCHECKED);
                         return true;
                     } else {
                         return false;
@@ -980,8 +1014,8 @@
                         if (!visit(intf, s))
                             return false;
                     }
-                    if (warnStack.head.unchecked == true)
-                        oldWarner.warnUnchecked();
+                    if (warnStack.head.hasLint(LintCategory.UNCHECKED))
+                        oldWarner.warn(LintCategory.UNCHECKED);
                     return true;
                 }
 
@@ -996,13 +1030,13 @@
                         || isSubtype(erasure(s), erasure(t))) {
                         if (!upcast && s.tag == ARRAY) {
                             if (!isReifiable(s))
-                                warnStack.head.warnUnchecked();
+                                warnStack.head.warn(LintCategory.UNCHECKED);
                             return true;
                         } else if (s.isRaw()) {
                             return true;
                         } else if (t.isRaw()) {
                             if (!isUnbounded(s))
-                                warnStack.head.warnUnchecked();
+                                warnStack.head.warn(LintCategory.UNCHECKED);
                             return true;
                         }
                         // Assume |a| <: |b|
@@ -1033,14 +1067,9 @@
                                 && !disjointTypes(aHigh.allparams(), lowSub.allparams())
                                 && !disjointTypes(aLow.allparams(), highSub.allparams())
                                 && !disjointTypes(aLow.allparams(), lowSub.allparams())) {
-                                if (s.isInterface() &&
-                                        !t.isInterface() &&
-                                        t.isFinal() &&
-                                        !isSubtype(t, s)) {
-                                    return false;
-                                } else if (upcast ? giveWarning(a, b) :
+                                if (upcast ? giveWarning(a, b) :
                                     giveWarning(b, a))
-                                    warnStack.head.warnUnchecked();
+                                    warnStack.head.warn(LintCategory.UNCHECKED);
                                 return true;
                             }
                         }
@@ -1077,7 +1106,7 @@
                     return true;
                 case TYPEVAR:
                     if (isCastable(s, t, Warner.noWarnings)) {
-                        warnStack.head.warnUnchecked();
+                        warnStack.head.warn(LintCategory.UNCHECKED);
                         return true;
                     } else {
                         return false;
@@ -1085,7 +1114,8 @@
                 case CLASS:
                     return isSubtype(t, s);
                 case ARRAY:
-                    if (elemtype(t).tag <= lastBaseTag) {
+                    if (elemtype(t).tag <= lastBaseTag ||
+                            elemtype(s).tag <= lastBaseTag) {
                         return elemtype(t).tag == elemtype(s).tag;
                     } else {
                         return visit(elemtype(t), elemtype(s));
@@ -1105,7 +1135,7 @@
                     if (isSubtype(t, s)) {
                         return true;
                     } else if (isCastable(t.bound, s, Warner.noWarnings)) {
-                        warnStack.head.warnUnchecked();
+                        warnStack.head.warn(LintCategory.UNCHECKED);
                         return true;
                     } else {
                         return false;
@@ -1322,6 +1352,13 @@
         }
     }
 
+    public Type elemtypeOrType(Type t) {
+        Type elemtype = elemtype(t);
+        return elemtype != null ?
+            elemtype :
+            t;
+    }
+
     /**
      * Mapping to take element type of an arraytype
      */
@@ -2031,7 +2068,7 @@
                 TypeSymbol c = t.tsym;
                 for (Scope.Entry e = c.members().lookup(ms.name, implFilter);
                      e.scope != null;
-                     e = e.next()) {
+                     e = e.next(implFilter)) {
                     if (e.sym != null &&
                              e.sym.overrides(ms, origin, types, checkResult))
                         return (MethodSymbol)e.sym;
@@ -2903,7 +2940,7 @@
             return true;
         if (!isSubtype(r1.getReturnType(), erasure(r2res)))
             return false;
-        warner.warnUnchecked();
+        warner.warn(LintCategory.UNCHECKED);
         return true;
     }
 
@@ -3119,7 +3156,7 @@
             commonSupers = commonSupers.tail;
         }
         if (giveWarning && !isReifiable(reverse ? from : to))
-            warn.warnUnchecked();
+            warn.warn(LintCategory.UNCHECKED);
         if (!source.allowCovariantReturns())
             // reject if there is a common method signature with
             // incompatible return types.
@@ -3153,7 +3190,7 @@
             chk.checkCompatibleAbstracts(warn.pos(), from, to);
         if (!isReifiable(target) &&
             (reverse ? giveWarning(t2, t1) : giveWarning(t1, t2)))
-            warn.warnUnchecked();
+            warn.warn(LintCategory.UNCHECKED);
         return true;
     }
 
@@ -3377,8 +3414,8 @@
         public Type visitCapturedType(CapturedType t, Void s) {
             Type bound = visitWildcardType(t.wildcard, null);
             return (bound.contains(t)) ?
-                    (high ? syms.objectType : syms.botType) :
-                        bound;
+                    erasure(bound) :
+                    bound;
         }
 
         @Override
@@ -3386,7 +3423,7 @@
             if (rewriteTypeVars) {
                 Type bound = high ?
                     (t.bound.contains(t) ?
-                        syms.objectType :
+                        erasure(t.bound) :
                         visit(t.bound)) :
                     syms.botType;
                 return rewriteAsWildcardType(bound, t);
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Attr.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Attr.java	Mon Dec 20 21:10:57 2010 -0800
@@ -38,6 +38,7 @@
 import com.sun.tools.javac.util.List;
 
 import com.sun.tools.javac.jvm.Target;
+import com.sun.tools.javac.code.Lint.LintCategory;
 import com.sun.tools.javac.code.Symbol.*;
 import com.sun.tools.javac.tree.JCTree.*;
 import com.sun.tools.javac.code.Type.*;
@@ -669,6 +670,7 @@
 
         Lint lint = env.info.lint.augment(m.attributes_field, m.flags());
         Lint prevLint = chk.setLint(lint);
+        MethodSymbol prevMethod = chk.setMethod(m);
         try {
             chk.checkDeprecatedAnnotation(tree.pos(), m);
 
@@ -676,6 +678,7 @@
 
             // If we override any other methods, check that we do so properly.
             // JLS ???
+            chk.checkClashes(tree.pos(), env.enclClass.type, m);
             chk.checkOverride(tree, m);
 
             // Create a new environment with local scope
@@ -699,7 +702,7 @@
                 attribStat(l.head, localEnv);
             }
 
-            chk.checkVarargMethodDecl(tree);
+            chk.checkVarargsMethodDecl(localEnv, tree);
 
             // Check that type parameters are well-formed.
             chk.validate(tree.typarams, localEnv);
@@ -788,6 +791,7 @@
         }
         finally {
             chk.setLint(prevLint);
+            chk.setMethod(prevMethod);
         }
     }
 
@@ -1587,13 +1591,26 @@
         } else if (allowDiamondFinder &&
                 clazztype.getTypeArguments().nonEmpty() &&
                 findDiamonds) {
-            Type inferred = attribDiamond(localEnv,
-                    tree,
-                    clazztype,
-                    mapping,
-                    argtypes,
-                    typeargtypes);
-            if (!inferred.isErroneous() &&
+            boolean prevDeferDiags = log.deferDiagnostics;
+            Queue<JCDiagnostic> prevDeferredDiags = log.deferredDiagnostics;
+            Type inferred = null;
+            try {
+                //disable diamond-related diagnostics
+                log.deferDiagnostics = true;
+                log.deferredDiagnostics = ListBuffer.lb();
+                inferred = attribDiamond(localEnv,
+                        tree,
+                        clazztype,
+                        mapping,
+                        argtypes,
+                        typeargtypes);
+            }
+            finally {
+                log.deferDiagnostics = prevDeferDiags;
+                log.deferredDiagnostics = prevDeferredDiags;
+            }
+            if (inferred != null &&
+                    !inferred.isErroneous() &&
                     inferred.tag == CLASS &&
                     types.isAssignable(inferred, pt.tag == NONE ? clazztype : pt, Warner.noWarnings) &&
                     chk.checkDiamond((ClassType)inferred).isEmpty()) {
@@ -2258,8 +2275,8 @@
                 ((VarSymbol)sitesym).isResourceVariable() &&
                 sym.kind == MTH &&
                 sym.overrides(syms.autoCloseableClose, sitesym.type.tsym, types, true) &&
-                env.info.lint.isEnabled(Lint.LintCategory.TRY)) {
-            log.warning(Lint.LintCategory.TRY, tree, "try.explicit.close.call");
+                env.info.lint.isEnabled(LintCategory.TRY)) {
+            log.warning(LintCategory.TRY, tree, "try.explicit.close.call");
         }
 
         // Disallow selecting a type from an expression
@@ -2686,7 +2703,7 @@
         // For methods, we need to compute the instance type by
         // Resolve.instantiate from the symbol's type as well as
         // any type arguments and value arguments.
-        noteWarner.warned = false;
+        noteWarner.clear();
         Type owntype = rs.instantiate(env,
                                       site,
                                       sym,
@@ -2695,7 +2712,7 @@
                                       true,
                                       useVarargs,
                                       noteWarner);
-        boolean warned = noteWarner.warned;
+        boolean warned = noteWarner.hasNonSilentLint(LintCategory.UNCHECKED);
 
         // If this fails, something went wrong; we should not have
         // found the identifier in the first place.
@@ -2720,7 +2737,7 @@
                 JCTree arg = args.head;
                 Warner warn = chk.convertWarner(arg.pos(), arg.type, formals.head);
                 assertConvertible(arg, arg.type, formals.head, warn);
-                warned |= warn.warned;
+                warned |= warn.hasNonSilentLint(LintCategory.UNCHECKED);
                 args = args.tail;
                 formals = formals.tail;
             }
@@ -2730,7 +2747,7 @@
                     JCTree arg = args.head;
                     Warner warn = chk.convertWarner(arg.pos(), arg.type, varArg);
                     assertConvertible(arg, arg.type, varArg, warn);
-                    warned |= warn.warned;
+                    warned |= warn.hasNonSilentLint(LintCategory.UNCHECKED);
                     args = args.tail;
                 }
             } else if ((sym.flags() & VARARGS) != 0 && allowVarargs) {
@@ -2762,7 +2779,7 @@
                 JCTree tree = env.tree;
                 Type argtype = owntype.getParameterTypes().last();
                 if (owntype.getReturnType().tag != FORALL || warned) {
-                    chk.checkVararg(env.tree.pos(), owntype.getParameterTypes(), sym, env);
+                    chk.checkVararg(env.tree.pos(), owntype.getParameterTypes(), sym);
                 }
                 Type elemtype = types.elemtype(argtype);
                 switch (tree.getTag()) {
@@ -2876,8 +2893,15 @@
     }
 
     public void visitTypeDisjunction(JCTypeDisjunction tree) {
-        List<Type> alternatives = attribTypes(tree.alternatives, env);
-        tree.type = result = check(tree, types.lub(alternatives), TYP, pkind, pt);
+        ListBuffer<Type> multicatchTypes = ListBuffer.lb();
+        for (JCExpression typeTree : tree.alternatives) {
+            Type ctype = attribType(typeTree, env);
+            ctype = chk.checkType(typeTree.pos(),
+                          chk.checkClassType(typeTree.pos(), ctype),
+                          syms.throwableType);
+            multicatchTypes.append(ctype);
+        }
+        tree.type = result = check(tree, types.lub(multicatchTypes.toList()), TYP, pkind, pt);
     }
 
     public void visitTypeParameter(JCTypeParameter tree) {
@@ -3154,7 +3178,7 @@
         chk.checkNonCyclicElements(tree);
 
         // Check for proper use of serialVersionUID
-        if (env.info.lint.isEnabled(Lint.LintCategory.SERIAL) &&
+        if (env.info.lint.isEnabled(LintCategory.SERIAL) &&
             isSerializable(c) &&
             (c.flags() & Flags.ENUM) == 0 &&
             (c.flags() & ABSTRACT) == 0) {
@@ -3183,7 +3207,7 @@
             Scope.Entry e = c.members().lookup(names.serialVersionUID);
             while (e.scope != null && e.sym.kind != VAR) e = e.next();
             if (e.scope == null) {
-                log.warning(Lint.LintCategory.SERIAL,
+                log.warning(LintCategory.SERIAL,
                         tree.pos(), "missing.SVUID", c);
                 return;
             }
@@ -3192,17 +3216,17 @@
             VarSymbol svuid = (VarSymbol)e.sym;
             if ((svuid.flags() & (STATIC | FINAL)) !=
                 (STATIC | FINAL))
-                log.warning(Lint.LintCategory.SERIAL,
+                log.warning(LintCategory.SERIAL,
                         TreeInfo.diagnosticPositionFor(svuid, tree), "improper.SVUID", c);
 
             // check that it is long
             else if (svuid.type.tag != TypeTags.LONG)
-                log.warning(Lint.LintCategory.SERIAL,
+                log.warning(LintCategory.SERIAL,
                         TreeInfo.diagnosticPositionFor(svuid, tree), "long.SVUID", c);
 
             // check constant
             else if (svuid.getConstValue() == null)
-                log.warning(Lint.LintCategory.SERIAL,
+                log.warning(LintCategory.SERIAL,
                         TreeInfo.diagnosticPositionFor(svuid, tree), "constant.SVUID", c);
         }
 
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Check.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Check.java	Mon Dec 20 21:10:57 2010 -0800
@@ -75,6 +75,10 @@
     // visits all the various parts of the trees during attribution.
     private Lint lint;
 
+    // The method being analyzed in Attr - it is set/reset as needed by
+    // Attr as it visits new method declarations.
+    private MethodSymbol method;
+
     public static Check instance(Context context) {
         Check instance = context.get(checkKey);
         if (instance == null)
@@ -100,6 +104,7 @@
         allowGenerics = source.allowGenerics();
         allowAnnotations = source.allowAnnotations();
         allowCovariantReturns = source.allowCovariantReturns();
+        allowSimplifiedVarargs = source.allowSimplifiedVarargs();
         complexInference = options.isSet(COMPLEXINFERENCE);
         skipAnnotations = options.isSet("skipAnnotations");
         warnOnSyntheticConflicts = options.isSet("warnOnSyntheticConflicts");
@@ -136,6 +141,10 @@
      */
     boolean allowCovariantReturns;
 
+    /** Switch: simplified varargs enabled?
+     */
+    boolean allowSimplifiedVarargs;
+
     /** Switch: -complexinference option set?
      */
     boolean complexInference;
@@ -175,6 +184,12 @@
         return prev;
     }
 
+    MethodSymbol setMethod(MethodSymbol newMethod) {
+        MethodSymbol prev = method;
+        method = newMethod;
+        return prev;
+    }
+
     /** Warn about deprecated symbol.
      *  @param pos        Position to be used for error reporting.
      *  @param sym        The deprecated symbol.
@@ -197,9 +212,9 @@
      *  @param pos        Position to be used for error reporting.
      *  @param sym        The deprecated symbol.
      */
-    void warnUnsafeVararg(DiagnosticPosition pos, Type elemType) {
-        if (!lint.isSuppressed(LintCategory.VARARGS))
-            unsafeVarargsHandler.report(pos, "varargs.non.reifiable.type", elemType);
+    void warnUnsafeVararg(DiagnosticPosition pos, String key, Object... args) {
+        if (lint.isEnabled(LintCategory.VARARGS) && allowSimplifiedVarargs)
+            log.warning(LintCategory.VARARGS, pos, key, args);
     }
 
     /** Warn about using proprietary API.
@@ -222,7 +237,6 @@
     public void reportDeferredDiagnostics() {
         deprecationHandler.reportDeferredDiagnostic();
         uncheckedHandler.reportDeferredDiagnostic();
-        unsafeVarargsHandler.reportDeferredDiagnostic();
         sunApiHandler.reportDeferredDiagnostic();
     }
 
@@ -705,29 +719,56 @@
         }
     }
 
-    void checkVarargMethodDecl(JCMethodDecl tree) {
+    void checkVarargsMethodDecl(Env<AttrContext> env, JCMethodDecl tree) {
         MethodSymbol m = tree.sym;
-        //check the element type of the vararg
+        if (!allowSimplifiedVarargs) return;
+        boolean hasTrustMeAnno = m.attribute(syms.trustMeType.tsym) != null;
+        Type varargElemType = null;
         if (m.isVarArgs()) {
-            Type varargElemType = types.elemtype(tree.params.last().type);
-            if (!types.isReifiable(varargElemType)) {
-                warnUnsafeVararg(tree.params.head.pos(), varargElemType);
+            varargElemType = types.elemtype(tree.params.last().type);
+        }
+        if (hasTrustMeAnno && !isTrustMeAllowedOnMethod(m)) {
+            if (varargElemType != null) {
+                log.error(tree,
+                        "varargs.invalid.trustme.anno",
+                        syms.trustMeType.tsym,
+                        diags.fragment("varargs.trustme.on.virtual.varargs", m));
+            } else {
+                log.error(tree,
+                            "varargs.invalid.trustme.anno",
+                            syms.trustMeType.tsym,
+                            diags.fragment("varargs.trustme.on.non.varargs.meth", m));
             }
+        } else if (hasTrustMeAnno && varargElemType != null &&
+                            types.isReifiable(varargElemType)) {
+            warnUnsafeVararg(tree,
+                            "varargs.redundant.trustme.anno",
+                            syms.trustMeType.tsym,
+                            diags.fragment("varargs.trustme.on.reifiable.varargs", varargElemType));
+        }
+        else if (!hasTrustMeAnno && varargElemType != null &&
+                !types.isReifiable(varargElemType)) {
+            warnUnchecked(tree.params.head.pos(), "unchecked.varargs.non.reifiable.type", varargElemType);
         }
     }
+    //where
+        private boolean isTrustMeAllowedOnMethod(Symbol s) {
+            return (s.flags() & VARARGS) != 0 &&
+                (s.isConstructor() ||
+                    (s.flags() & (STATIC | FINAL)) != 0);
+        }
 
     /**
      * Check that vararg method call is sound
      * @param pos Position to be used for error reporting.
      * @param argtypes Actual arguments supplied to vararg method.
      */
-    void checkVararg(DiagnosticPosition pos, List<Type> argtypes, Symbol msym, Env<AttrContext> env) {
-        Env<AttrContext> calleeLintEnv = env;
-        while (calleeLintEnv.info.lint == null)
-            calleeLintEnv = calleeLintEnv.next;
-        Lint calleeLint = calleeLintEnv.info.lint.augment(msym.attributes_field, msym.flags());
+    void checkVararg(DiagnosticPosition pos, List<Type> argtypes, Symbol msym) {
         Type argtype = argtypes.last();
-        if (!types.isReifiable(argtype) && !calleeLint.isSuppressed(Lint.LintCategory.VARARGS)) {
+        if (!types.isReifiable(argtype) &&
+                (!allowSimplifiedVarargs ||
+                msym.attribute(syms.trustMeType.tsym) == null ||
+                !isTrustMeAllowedOnMethod(msym))) {
             warnUnchecked(pos,
                               "unchecked.generic.array.creation",
                               argtype);
@@ -1075,12 +1116,12 @@
         }
 
         void checkRaw(JCTree tree, Env<AttrContext> env) {
-            if (lint.isEnabled(Lint.LintCategory.RAW) &&
+            if (lint.isEnabled(LintCategory.RAW) &&
                 tree.type.tag == CLASS &&
                 !TreeInfo.isDiamond(tree) &&
                 !env.enclClass.name.isEmpty() &&  //anonymous or intersection
                 tree.type.isRaw()) {
-                log.warning(Lint.LintCategory.RAW,
+                log.warning(LintCategory.RAW,
                         tree.pos(), "raw.class.use", tree.type, tree.type.tsym.type);
             }
         }
@@ -1347,7 +1388,7 @@
         Type mtres = mt.getReturnType();
         Type otres = types.subst(ot.getReturnType(), otvars, mtvars);
 
-        overrideWarner.warned = false;
+        overrideWarner.clear();
         boolean resultTypesOK =
             types.returnTypeSubstitutable(mt, ot, otres, overrideWarner);
         if (!resultTypesOK) {
@@ -1362,7 +1403,7 @@
                           mtres, otres);
                 return;
             }
-        } else if (overrideWarner.warned) {
+        } else if (overrideWarner.hasNonSilentLint(LintCategory.UNCHECKED)) {
             warnUnchecked(TreeInfo.diagnosticPositionFor(m, tree),
                     "override.unchecked.ret",
                     uncheckedOverrides(m, other),
@@ -1391,7 +1432,7 @@
 
         // Optional warning if varargs don't agree
         if ((((m.flags() ^ other.flags()) & Flags.VARARGS) != 0)
-            && lint.isEnabled(Lint.LintCategory.OVERRIDES)) {
+            && lint.isEnabled(LintCategory.OVERRIDES)) {
             log.warning(TreeInfo.diagnosticPositionFor(m, tree),
                         ((m.flags() & Flags.VARARGS) != 0)
                         ? "override.varargs.missing"
@@ -1668,12 +1709,6 @@
                     checkOverride(tree, m, (MethodSymbol)e.sym, origin);
                 }
             }
-            else if (!checkNameClash(origin, e.sym, m)) {
-                log.error(tree,
-                            "name.clash.same.erasure.no.override",
-                            m, m.location(),
-                            e.sym, e.sym.location());
-            }
             e = e.next();
         }
     }
@@ -2022,6 +2057,60 @@
         }
     }
 
+    /** Check that all non-override equivalent methods accessible from 'site'
+     *  are mutually compatible (JLS 8.4.8/9.4.1).
+     *
+     *  @param pos  Position to be used for error reporting.
+     *  @param site The class whose methods are checked.
+     *  @param sym  The method symbol to be checked.
+     */
+    void checkClashes(DiagnosticPosition pos, Type site, Symbol sym) {
+        List<Type> supertypes = types.closure(site);
+        for (List<Type> l = supertypes; l.nonEmpty(); l = l.tail) {
+            for (List<Type> m = supertypes; m.nonEmpty(); m = m.tail) {
+                checkClashes(pos, l.head, m.head, site, sym);
+            }
+        }
+    }
+
+    /** Reports an error whenever 'sym' seen as a member of type 't1' clashes with
+     *  some unrelated method defined in 't2'.
+     */
+    private void checkClashes(DiagnosticPosition pos, Type t1, Type t2, Type site, Symbol s1) {
+        ClashFilter cf = new ClashFilter(site);
+        s1 = ((MethodSymbol)s1).implementedIn(t1.tsym, types);
+        if (s1 == null) return;
+        Type st1 = types.memberType(site, s1);
+        for (Scope.Entry e2 = t2.tsym.members().lookup(s1.name, cf); e2.scope != null; e2 = e2.next(cf)) {
+            Symbol s2 = e2.sym;
+            if (s1 == s2) continue;
+            Type st2 = types.memberType(site, s2);
+            if (!types.overrideEquivalent(st1, st2) &&
+                    !checkNameClash((ClassSymbol)site.tsym, s1, s2)) {
+                log.error(pos,
+                        "name.clash.same.erasure.no.override",
+                        s1, s1.location(),
+                        s2, s2.location());
+            }
+        }
+    }
+    //where
+    private class ClashFilter implements Filter<Symbol> {
+
+        Type site;
+
+        ClashFilter(Type site) {
+            this.site = site;
+        }
+
+        public boolean accepts(Symbol s) {
+            return s.kind == MTH &&
+                    (s.flags() & SYNTHETIC) == 0 &&
+                    s.isInheritedIn(site.tsym, types) &&
+                    !s.isConstructor();
+        }
+    }
+
     /** Report a conflict between a user symbol and a synthetic symbol.
      */
     private void syntheticError(DiagnosticPosition pos, Symbol sym) {
@@ -2332,11 +2421,11 @@
 
     void checkDeprecatedAnnotation(DiagnosticPosition pos, Symbol s) {
         if (allowAnnotations &&
-            lint.isEnabled(Lint.LintCategory.DEP_ANN) &&
+            lint.isEnabled(LintCategory.DEP_ANN) &&
             (s.flags() & DEPRECATED) != 0 &&
             !syms.deprecatedType.isErroneous() &&
             s.attribute(syms.deprecatedType.tsym) == null) {
-            log.warning(Lint.LintCategory.DEP_ANN,
+            log.warning(LintCategory.DEP_ANN,
                     pos, "missing.deprecated.annotation");
         }
     }
@@ -2482,13 +2571,13 @@
      */
     void checkDivZero(DiagnosticPosition pos, Symbol operator, Type operand) {
         if (operand.constValue() != null
-            && lint.isEnabled(Lint.LintCategory.DIVZERO)
+            && lint.isEnabled(LintCategory.DIVZERO)
             && operand.tag <= LONG
             && ((Number) (operand.constValue())).longValue() == 0) {
             int opc = ((OperatorSymbol)operator).opcode;
             if (opc == ByteCodes.idiv || opc == ByteCodes.imod
                 || opc == ByteCodes.ldiv || opc == ByteCodes.lmod) {
-                log.warning(Lint.LintCategory.DIVZERO, pos, "div.zero");
+                log.warning(LintCategory.DIVZERO, pos, "div.zero");
             }
         }
     }
@@ -2497,8 +2586,8 @@
      * Check for empty statements after if
      */
     void checkEmptyIf(JCIf tree) {
-        if (tree.thenpart.getTag() == JCTree.SKIP && tree.elsepart == null && lint.isEnabled(Lint.LintCategory.EMPTY))
-            log.warning(Lint.LintCategory.EMPTY, tree.thenpart.pos(), "empty.if");
+        if (tree.thenpart.getTag() == JCTree.SKIP && tree.elsepart == null && lint.isEnabled(LintCategory.EMPTY))
+            log.warning(LintCategory.EMPTY, tree.thenpart.pos(), "empty.if");
     }
 
     /** Check that symbol is unique in given scope.
@@ -2606,23 +2695,36 @@
         }
 
     private class ConversionWarner extends Warner {
-        final String key;
+        final String uncheckedKey;
         final Type found;
         final Type expected;
-        public ConversionWarner(DiagnosticPosition pos, String key, Type found, Type expected) {
+        public ConversionWarner(DiagnosticPosition pos, String uncheckedKey, Type found, Type expected) {
             super(pos);
-            this.key = key;
+            this.uncheckedKey = uncheckedKey;
             this.found = found;
             this.expected = expected;
         }
 
         @Override
-        public void warnUnchecked() {
+        public void warn(LintCategory lint) {
             boolean warned = this.warned;
-            super.warnUnchecked();
+            super.warn(lint);
             if (warned) return; // suppress redundant diagnostics
-            Object problem = diags.fragment(key);
-            Check.this.warnUnchecked(pos(), "prob.found.req", problem, found, expected);
+            switch (lint) {
+                case UNCHECKED:
+                    Check.this.warnUnchecked(pos(), "prob.found.req", diags.fragment(uncheckedKey), found, expected);
+                    break;
+                case VARARGS:
+                    if (method != null &&
+                            method.attribute(syms.trustMeType.tsym) != null &&
+                            isTrustMeAllowedOnMethod(method) &&
+                            !types.isReifiable(method.type.getParameterTypes().last())) {
+                        Check.this.warnUnsafeVararg(pos(), "varargs.unsafe.use.varargs.param", method.params.last());
+                    }
+                    break;
+                default:
+                    throw new AssertionError("Unexpected lint: " + lint);
+            }
         }
     }
 
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Enter.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Enter.java	Mon Dec 20 21:10:57 2010 -0800
@@ -30,16 +30,17 @@
 import javax.tools.JavaFileManager;
 
 import com.sun.tools.javac.code.*;
+import com.sun.tools.javac.code.Scope.*;
+import com.sun.tools.javac.code.Symbol.*;
+import com.sun.tools.javac.code.Type.*;
 import com.sun.tools.javac.jvm.*;
+import com.sun.tools.javac.main.RecognizedOptions.PkgInfo;
 import com.sun.tools.javac.tree.*;
+import com.sun.tools.javac.tree.JCTree.*;
 import com.sun.tools.javac.util.*;
 import com.sun.tools.javac.util.JCDiagnostic.DiagnosticPosition;
 import com.sun.tools.javac.util.List;
 
-import com.sun.tools.javac.code.Type.*;
-import com.sun.tools.javac.code.Symbol.*;
-import com.sun.tools.javac.main.RecognizedOptions.PkgInfo;
-import com.sun.tools.javac.tree.JCTree.*;
 
 import static com.sun.tools.javac.code.Flags.*;
 import static com.sun.tools.javac.code.Kinds.*;
@@ -207,8 +208,8 @@
         Env<AttrContext> localEnv = new Env<AttrContext>(tree, new AttrContext());
         localEnv.toplevel = tree;
         localEnv.enclClass = predefClassDef;
-        tree.namedImportScope = new Scope.ImportScope(tree.packge);
-        tree.starImportScope = new Scope.ImportScope(tree.packge);
+        tree.namedImportScope = new ImportScope(tree.packge);
+        tree.starImportScope = new StarImportScope(tree.packge);
         localEnv.info.scope = tree.namedImportScope;
         localEnv.info.lint = lint;
         return localEnv;
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Flow.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Flow.java	Mon Dec 20 21:10:57 2010 -0800
@@ -886,6 +886,8 @@
         alive = resolveBreaks(tree, prevPendingExits) ||
             tree.cond != null && !tree.cond.type.isTrue();
         nextadr = nextadrPrev;
+        inits.excludeFrom(nextadr);
+        uninits.excludeFrom(nextadr);
     }
 
     public void visitForeachLoop(JCEnhancedForLoop tree) {
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Infer.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Infer.java	Mon Dec 20 21:10:57 2010 -0800
@@ -481,7 +481,7 @@
                     checkWithinBounds(all_tvars,
                            types.subst(inferredTypes, tvars, inferred), warn);
                     if (useVarargs) {
-                        chk.checkVararg(env.tree.pos(), formals, msym, env);
+                        chk.checkVararg(env.tree.pos(), formals, msym);
                     }
                     return super.inst(inferred, types);
             }};
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/MemberEnter.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/MemberEnter.java	Mon Dec 20 21:10:57 2010 -0800
@@ -77,6 +77,7 @@
     private final Target target;
 
     private final boolean skipAnnotations;
+    private final boolean allowSimplifiedVarargs;
 
     public static MemberEnter instance(Context context) {
         MemberEnter instance = context.get(memberEnterKey);
@@ -103,6 +104,8 @@
         target = Target.instance(context);
         Options options = Options.instance(context);
         skipAnnotations = options.isSet("skipAnnotations");
+        Source source = Source.instance(context);
+        allowSimplifiedVarargs = source.allowSimplifiedVarargs();
     }
 
     /** A queue for classes whose members still need to be entered into the
@@ -143,12 +146,7 @@
                 log.error(pos, "doesnt.exist", tsym);
             }
         }
-        final Scope fromScope = tsym.members();
-        final Scope toScope = env.toplevel.starImportScope;
-        for (Scope.Entry e = fromScope.elems; e != null; e = e.sibling) {
-            if (e.sym.kind == TYP && !toScope.includes(e.sym))
-                toScope.enter(e.sym, fromScope);
-        }
+        env.toplevel.starImportScope.importAll(tsym.members());
     }
 
     /** Import all static members of a class or package on demand.
@@ -622,6 +620,14 @@
             localEnv.info.staticLevel++;
         }
         attr.attribType(tree.vartype, localEnv);
+        if ((tree.mods.flags & VARARGS) != 0) {
+            //if we are entering a varargs parameter, we need to replace its type
+            //(a plain array type) with the more precise VarargsType --- we need
+            //to do it this way because varargs is represented in the tree as a modifier
+            //on the parameter declaration, and not as a distinct type of array node.
+            ArrayType atype = (ArrayType)tree.vartype.type;
+            tree.vartype.type = atype.makeVarargs();
+        }
         Scope enclScope = enter.enterScope(env);
         VarSymbol v =
             new VarSymbol(0, tree.name, tree.vartype.type, enclScope.owner);
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Resolve.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Resolve.java	Mon Dec 20 21:10:57 2010 -0800
@@ -197,7 +197,7 @@
         }
         return (checkInner == false || c.type.getEnclosingType() == Type.noType) ?
             isAccessible :
-            isAccessible & isAccessible(env, c.type.getEnclosingType(), checkInner);
+            isAccessible && isAccessible(env, c.type.getEnclosingType(), checkInner);
     }
     //where
         /** Is given class a subclass of given base class, or an inner class
@@ -234,7 +234,6 @@
     }
     public boolean isAccessible(Env<AttrContext> env, Type site, Symbol sym, boolean checkInner) {
         if (sym.name == names.init && sym.owner != site.tsym) return false;
-        ClassSymbol sub;
         switch ((short)(sym.flags() & AccessFlags)) {
         case PRIVATE:
             return
@@ -470,7 +469,9 @@
             throw inapplicableMethodException.setMessage("arg.length.mismatch"); // not enough args
 
         if (useVarargs) {
-            Type elt = types.elemtype(varargsFormal);
+            //note: if applicability check is triggered by most specific test,
+            //the last argument of a varargs is _not_ an array type (see JLS 15.12.2.5)
+            Type elt = types.elemtypeOrType(varargsFormal);
             while (argtypes.nonEmpty()) {
                 if (!types.isConvertible(argtypes.head, elt, warn))
                     throw inapplicableMethodException.setMessage("varargs.argument.mismatch",
@@ -724,23 +725,11 @@
         switch (m2.kind) {
         case MTH:
             if (m1 == m2) return m1;
-            Type mt1 = types.memberType(site, m1);
-            noteWarner.unchecked = false;
-            boolean m1SignatureMoreSpecific =
-                (instantiate(env, site, m2, types.lowerBoundArgtypes(mt1), null,
-                             allowBoxing, false, noteWarner) != null ||
-                 useVarargs && instantiate(env, site, m2, types.lowerBoundArgtypes(mt1), null,
-                                           allowBoxing, true, noteWarner) != null) &&
-                !noteWarner.unchecked;
-            Type mt2 = types.memberType(site, m2);
-            noteWarner.unchecked = false;
-            boolean m2SignatureMoreSpecific =
-                (instantiate(env, site, m1, types.lowerBoundArgtypes(mt2), null,
-                             allowBoxing, false, noteWarner) != null ||
-                 useVarargs && instantiate(env, site, m1, types.lowerBoundArgtypes(mt2), null,
-                                           allowBoxing, true, noteWarner) != null) &&
-                !noteWarner.unchecked;
+            boolean m1SignatureMoreSpecific = signatureMoreSpecific(env, site, m1, m2, allowBoxing, useVarargs);
+            boolean m2SignatureMoreSpecific = signatureMoreSpecific(env, site, m2, m1, allowBoxing, useVarargs);
             if (m1SignatureMoreSpecific && m2SignatureMoreSpecific) {
+                Type mt1 = types.memberType(site, m1);
+                Type mt2 = types.memberType(site, m2);
                 if (!types.overrideEquivalent(mt1, mt2))
                     return new AmbiguityError(m1, m2);
                 // same signature; select (a) the non-bridge method, or
@@ -824,6 +813,56 @@
             throw new AssertionError();
         }
     }
+    //where
+    private boolean signatureMoreSpecific(Env<AttrContext> env, Type site, Symbol m1, Symbol m2, boolean allowBoxing, boolean useVarargs) {
+        noteWarner.clear();
+        Type mtype1 = types.memberType(site, adjustVarargs(m1, m2, useVarargs));
+        return (instantiate(env, site, adjustVarargs(m2, m1, useVarargs), types.lowerBoundArgtypes(mtype1), null,
+                             allowBoxing, false, noteWarner) != null ||
+                 useVarargs && instantiate(env, site, adjustVarargs(m2, m1, useVarargs), types.lowerBoundArgtypes(mtype1), null,
+                                           allowBoxing, true, noteWarner) != null) &&
+                !noteWarner.hasLint(Lint.LintCategory.UNCHECKED);
+    }
+    //where
+    private Symbol adjustVarargs(Symbol to, Symbol from, boolean useVarargs) {
+        List<Type> fromArgs = from.type.getParameterTypes();
+        List<Type> toArgs = to.type.getParameterTypes();
+        if (useVarargs &&
+                (from.flags() & VARARGS) != 0 &&
+                (to.flags() & VARARGS) != 0) {
+            Type varargsTypeFrom = fromArgs.last();
+            Type varargsTypeTo = toArgs.last();
+            ListBuffer<Type> args = ListBuffer.lb();
+            if (toArgs.length() < fromArgs.length()) {
+                //if we are checking a varargs method 'from' against another varargs
+                //method 'to' (where arity of 'to' < arity of 'from') then expand signature
+                //of 'to' to 'fit' arity of 'from' (this means adding fake formals to 'to'
+                //until 'to' signature has the same arity as 'from')
+                while (fromArgs.head != varargsTypeFrom) {
+                    args.append(toArgs.head == varargsTypeTo ? types.elemtype(varargsTypeTo) : toArgs.head);
+                    fromArgs = fromArgs.tail;
+                    toArgs = toArgs.head == varargsTypeTo ?
+                        toArgs :
+                        toArgs.tail;
+                }
+            } else {
+                //formal argument list is same as original list where last
+                //argument (array type) is removed
+                args.appendList(toArgs.reverse().tail.reverse());
+            }
+            //append varargs element type as last synthetic formal
+            args.append(types.elemtype(varargsTypeTo));
+            MethodSymbol msym = new MethodSymbol(to.flags_field,
+                                                 to.name,
+                                                 (Type)to.type.clone(), //see: 6990136
+                                                 to.owner);
+            MethodType mtype = msym.type.asMethodType();
+            mtype.argtypes = args.toList();
+            return msym;
+        } else {
+            return to;
+        }
+    }
 
     /** Find best qualified method matching given name, type and value
      *  arguments.
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/TransTypes.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/TransTypes.java	Mon Dec 20 21:10:57 2010 -0800
@@ -719,7 +719,7 @@
                 tree.sym = ((MethodSymbol)tree.sym).
                     implemented((TypeSymbol)tree.sym.owner, types);
             }
-            tree.selected = cast(
+            tree.selected = coerce(
                 translate(tree.selected, erasure(tree.selected.type)),
                 erasure(tree.sym.owner.type));
         } else
--- a/langtools/src/share/classes/com/sun/tools/javac/jvm/ClassReader.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/jvm/ClassReader.java	Mon Dec 20 21:10:57 2010 -0800
@@ -32,6 +32,7 @@
 import java.util.Arrays;
 import java.util.EnumSet;
 import java.util.HashMap;
+import java.util.HashSet;
 import java.util.Map;
 import java.util.Set;
 import javax.lang.model.SourceVersion;
@@ -44,11 +45,13 @@
 
 import com.sun.tools.javac.comp.Annotate;
 import com.sun.tools.javac.code.*;
+import com.sun.tools.javac.code.Lint.LintCategory;
 import com.sun.tools.javac.code.Type.*;
 import com.sun.tools.javac.code.Symbol.*;
 import com.sun.tools.javac.code.Symtab;
 import com.sun.tools.javac.file.BaseFileObject;
 import com.sun.tools.javac.util.*;
+import com.sun.tools.javac.util.JCDiagnostic.DiagnosticPosition;
 
 import static com.sun.tools.javac.code.Flags.*;
 import static com.sun.tools.javac.code.Kinds.*;
@@ -102,6 +105,15 @@
      */
     boolean allowAnnotations;
 
+    /** Switch: allow simplified varargs.
+     */
+    boolean allowSimplifiedVarargs;
+
+   /** Lint option: warn about classfile issues
+     */
+    boolean lintClassfile;
+
+
     /** Switch: preserve parameter names from the variable table.
      */
     public boolean saveParameterNames;
@@ -207,6 +219,11 @@
      */
     boolean haveParameterNameIndices;
 
+    /**
+     * The set of attribute names for which warnings have been generated for the current class
+     */
+    Set<Name> warnedAttrs = new HashSet<Name>();
+
     /** Get the ClassReader instance for this invocation. */
     public static ClassReader instance(Context context) {
         ClassReader instance = context.get(classReaderKey);
@@ -267,6 +284,7 @@
         allowGenerics    = source.allowGenerics();
         allowVarargs     = source.allowVarargs();
         allowAnnotations = source.allowAnnotations();
+        allowSimplifiedVarargs = source.allowSimplifiedVarargs();
         saveParameterNames = options.isSet("save-parameter-names");
         cacheCompletionFailure = options.isUnset("dev");
         preferSource = "source".equals(options.get("-Xprefer"));
@@ -279,6 +297,8 @@
         typevars = new Scope(syms.noSymbol);
         debugJSR308 = options.isSet("TA:reader");
 
+        lintClassfile = Lint.instance(context).isEnabled(LintCategory.CLASSFILE);
+
         initAttributeReaders();
     }
 
@@ -863,20 +883,35 @@
 
     protected enum AttributeKind { CLASS, MEMBER };
     protected abstract class AttributeReader {
-        AttributeReader(Name name, Version version, Set<AttributeKind> kinds) {
+        AttributeReader(Name name, ClassFile.Version version, Set<AttributeKind> kinds) {
             this.name = name;
             this.version = version;
             this.kinds = kinds;
         }
 
         boolean accepts(AttributeKind kind) {
-            return kinds.contains(kind) && majorVersion >= version.major;
+            if (kinds.contains(kind)) {
+                if (majorVersion > version.major || (majorVersion == version.major && minorVersion >= version.minor))
+                    return true;
+
+                if (lintClassfile && !warnedAttrs.contains(name)) {
+                    JavaFileObject prev = log.useSource(currentClassFile);
+                    try {
+                        log.warning(LintCategory.CLASSFILE, (DiagnosticPosition) null, "future.attr",
+                                name, version.major, version.minor, majorVersion, minorVersion);
+                    } finally {
+                        log.useSource(prev);
+                    }
+                    warnedAttrs.add(name);
+                }
+            }
+            return false;
         }
 
         abstract void read(Symbol sym, int attrLen);
 
         final Name name;
-        final Version version;
+        final ClassFile.Version version;
         final Set<AttributeKind> kinds;
     }
 
@@ -889,7 +924,7 @@
 
     protected Map<Name, AttributeReader> attributeReaders = new HashMap<Name, AttributeReader>();
 
-    protected void initAttributeReaders() {
+    private void initAttributeReaders() {
         AttributeReader[] readers = {
             // v45.3 attributes
 
@@ -1561,7 +1596,7 @@
         public void accept(Visitor v) { ((ProxyVisitor)v).visitCompoundAnnotationProxy(this); }
         @Override
         public String toString() {
-            StringBuffer buf = new StringBuffer();
+            StringBuilder buf = new StringBuilder();
             buf.append("@");
             buf.append(type.tsym.getQualifiedName());
             buf.append("/*proxy*/{");
@@ -1854,7 +1889,7 @@
             // instance, however, there is no reliable way to tell so
             // we never strip this$n
             if (!currentOwner.name.isEmpty())
-                type = new MethodType(type.getParameterTypes().tail,
+                type = new MethodType(adjustMethodParams(flags, type.getParameterTypes()),
                                       type.getReturnType(),
                                       type.getThrownTypes(),
                                       syms.methodClass);
@@ -1874,6 +1909,21 @@
         return m;
     }
 
+    private List<Type> adjustMethodParams(long flags, List<Type> args) {
+        boolean isVarargs = (flags & VARARGS) != 0;
+        if (isVarargs) {
+            Type varargsElem = args.last();
+            ListBuffer<Type> adjustedArgs = ListBuffer.lb();
+            for (Type t : args) {
+                adjustedArgs.append(t != varargsElem ?
+                    t :
+                    ((ArrayType)t).makeVarargs());
+            }
+            args = adjustedArgs.toList();
+        }
+        return args.tail;
+    }
+
     /**
      * Init the parameter names array.
      * Parameter names are currently inferred from the names in the
@@ -2286,6 +2336,7 @@
             throw new CompletionFailure(c, "user-selected completion failure by class name");
         }
         currentOwner = c;
+        warnedAttrs.clear();
         JavaFileObject classfile = c.classfile;
         if (classfile != null) {
             JavaFileObject previousClassFile = currentClassFile;
--- a/langtools/src/share/classes/com/sun/tools/javac/jvm/ClassWriter.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/jvm/ClassWriter.java	Mon Dec 20 21:10:57 2010 -0800
@@ -1168,7 +1168,7 @@
                 VarSymbol sym = var.sym;
                 databuf.appendChar(pool.put(sym.name));
                 Type vartype = sym.erasure(types);
-                if (!types.isSameType(sym.type, vartype))
+                if (needsLocalVariableTypeEntry(sym.type))
                     nGenericVars++;
                 databuf.appendChar(pool.put(typeSig(vartype)));
                 databuf.appendChar(var.reg);
@@ -1185,7 +1185,7 @@
             for (int i=0; i<code.varBufferSize; i++) {
                 Code.LocalVar var = code.varBuffer[i];
                 VarSymbol sym = var.sym;
-                if (types.isSameType(sym.type, sym.erasure(types)))
+                if (!needsLocalVariableTypeEntry(sym.type))
                     continue;
                 count++;
                 // write variable info
@@ -1209,6 +1209,14 @@
         }
         endAttrs(acountIdx, acount);
     }
+    //where
+    private boolean needsLocalVariableTypeEntry(Type t) {
+        //a local variable needs a type-entry if its type T is generic
+        //(i.e. |T| != T) and if it's not an intersection type (not supported
+        //in signature attribute grammar)
+        return (!types.isSameType(t, types.erasure(t)) &&
+                !t.isCompound());
+    }
 
     void writeStackMap(Code code) {
         int nframes = code.stackMapBufferSize;
--- a/langtools/src/share/classes/com/sun/tools/javac/jvm/Gen.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/jvm/Gen.java	Mon Dec 20 21:10:57 2010 -0800
@@ -1802,7 +1802,7 @@
          */
         Item makeNewArray(DiagnosticPosition pos, Type type, int ndims) {
             Type elemtype = types.elemtype(type);
-            if (types.dimensions(elemtype) + ndims > ClassFile.MAX_DIMENSIONS) {
+            if (types.dimensions(type) > ClassFile.MAX_DIMENSIONS) {
                 log.error(pos, "limit.dimensions");
                 nerrs++;
             }
--- a/langtools/src/share/classes/com/sun/tools/javac/parser/JavacParser.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/parser/JavacParser.java	Mon Dec 20 21:10:57 2010 -0800
@@ -498,7 +498,7 @@
             try {
                 n = Float.valueOf(proper);
             } catch (NumberFormatException ex) {
-                // error already repoted in scanner
+                // error already reported in scanner
                 n = Float.NaN;
             }
             if (n.floatValue() == 0.0f && !isZero(proper))
--- a/langtools/src/share/classes/com/sun/tools/javac/resources/compiler.properties	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/resources/compiler.properties	Mon Dec 20 21:10:57 2010 -0800
@@ -516,6 +516,15 @@
 compiler.err.var.might.be.assigned.in.loop=\
     variable {0} might be assigned in loop
 
+compiler.err.varargs.invalid.trustme.anno=\
+    Invalid {0} annotation. {1}
+compiler.misc.varargs.trustme.on.reifiable.varargs=\
+    Varargs element type {0} is reifiable.
+compiler.misc.varargs.trustme.on.non.varargs.meth=\
+    Method {0} is not a varargs method.
+compiler.misc.varargs.trustme.on.virtual.varargs=\
+    Instance method {0} is not final.
+
 # In the following string, {1} will always be the detail message from
 # java.io.IOException.
 compiler.err.class.cant.write=\
@@ -600,20 +609,6 @@
 compiler.note.unchecked.plural.additional=\
     Some input files additionally use unchecked or unsafe operations.
 
-compiler.note.varargs.filename=\
-    {0} declares unsafe vararg methods.
-compiler.note.varargs.plural=\
-    Some input files declare unsafe vararg methods.
-# The following string may appear after one of the above unsafe varargs
-# messages.
-compiler.note.varargs.recompile=\
-    Recompile with -Xlint:varargs for details.
-
-compiler.note.varargs.filename.additional=\
-    {0} declares additional unsafe vararg methods.
-compiler.note.varargs.plural.additional=\
-    Some input files additionally declares unsafe vararg methods.
-
 compiler.note.sunapi.filename=\
     {0} uses internal proprietary API that may be removed in a future release.
 compiler.note.sunapi.plural=\
@@ -767,6 +762,9 @@
 compiler.warn.source.no.bootclasspath=\
     bootstrap class path not set in conjunction with -source {0}
 
+compiler.warn.future.attr=\
+    {0} attribute introduced in version {1}.{2} class files is ignored in version {3}.{4} class files
+
 # Warnings related to annotation processing
 compiler.warn.proc.package.does.not.exist=\
     package {0} does not exist
@@ -838,9 +836,12 @@
 compiler.warn.unchecked.generic.array.creation=\
     unchecked generic array creation for varargs parameter of type {0}
 
-compiler.warn.varargs.non.reifiable.type=\
+compiler.warn.unchecked.varargs.non.reifiable.type=\
     Possible heap pollution from parameterized vararg type {0}
 
+compiler.warn.varargs.unsafe.use.varargs.param=\
+    Varargs method could cause heap pollution from non-reifiable varargs parameter {0}
+
 compiler.warn.missing.deprecated.annotation=\
     deprecated item is not annotated with @Deprecated
 
@@ -873,6 +874,9 @@
     explicit: {0}\n\
     inferred: {1}
 
+compiler.warn.varargs.redundant.trustme.anno=\
+    Redundant {0} annotation. {1}
+
 #####
 
 ## The following are tokens which are non-terminals in the language. They should
--- a/langtools/src/share/classes/com/sun/tools/javac/tree/JCTree.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/tree/JCTree.java	Mon Dec 20 21:10:57 2010 -0800
@@ -37,7 +37,7 @@
 import com.sun.tools.javac.util.JCDiagnostic.DiagnosticPosition;
 import com.sun.tools.javac.util.List;
 import com.sun.tools.javac.code.*;
-import com.sun.tools.javac.code.Scope;
+import com.sun.tools.javac.code.Scope.*;
 import com.sun.tools.javac.code.Symbol.*;
 import com.sun.source.tree.*;
 
@@ -434,8 +434,8 @@
         public List<JCTree> defs;
         public JavaFileObject sourcefile;
         public PackageSymbol packge;
-        public Scope namedImportScope;
-        public Scope starImportScope;
+        public ImportScope namedImportScope;
+        public StarImportScope starImportScope;
         public long flags;
         public Position.LineMap lineMap = null;
         public Map<JCTree, String> docComments = null;
@@ -445,8 +445,8 @@
                         List<JCTree> defs,
                         JavaFileObject sourcefile,
                         PackageSymbol packge,
-                        Scope namedImportScope,
-                        Scope starImportScope) {
+                        ImportScope namedImportScope,
+                        StarImportScope starImportScope) {
             this.packageAnnotations = packageAnnotations;
             this.pid = pid;
             this.defs = defs;
--- a/langtools/src/share/classes/com/sun/tools/javac/tree/TreeInfo.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/tree/TreeInfo.java	Mon Dec 20 21:10:57 2010 -0800
@@ -502,7 +502,7 @@
                 else super.visitVarDef(that);
             }
             public void visitTypeParameter(JCTypeParameter that) {
-                if (that.type.tsym == sym) result = that;
+                if (that.type != null && that.type.tsym == sym) result = that;
                 else super.visitTypeParameter(that);
             }
         }
--- a/langtools/src/share/classes/com/sun/tools/javac/tree/TreeMaker.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/tree/TreeMaker.java	Mon Dec 20 21:10:57 2010 -0800
@@ -734,8 +734,9 @@
             result = Literal(BYTE, value).
                 setType(syms.byteType.constType(value));
         } else if (value instanceof Character) {
+            int v = (int) (((Character) value).toString().charAt(0));
             result = Literal(CHAR, value).
-                setType(syms.charType.constType(value));
+                setType(syms.charType.constType(v));
         } else if (value instanceof Double) {
             result = Literal(DOUBLE, value).
                 setType(syms.doubleType.constType(value));
@@ -745,6 +746,10 @@
         } else if (value instanceof Short) {
             result = Literal(SHORT, value).
                 setType(syms.shortType.constType(value));
+        } else if (value instanceof Boolean) {
+            int v = ((Boolean) value) ? 1 : 0;
+            result = Literal(BOOLEAN, v).
+                setType(syms.booleanType.constType(v));
         } else {
             throw new AssertionError(value);
         }
--- a/langtools/src/share/classes/com/sun/tools/javac/util/Bits.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/util/Bits.java	Mon Dec 20 21:10:57 2010 -0800
@@ -101,6 +101,15 @@
                 (1 << (x & wordmask));
     }
 
+    /** Exclude [start...end] from this set.
+     */
+    public void excludeFrom(int start) {
+        Bits temp = new Bits();
+        temp.sizeTo(bits.length);
+        temp.inclRange(0, start);
+        andSet(temp);
+    }
+
     /** Exclude x from this set.
      */
     public void excl(int x) {
--- a/langtools/src/share/classes/com/sun/tools/javac/util/List.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/util/List.java	Mon Dec 20 21:10:57 2010 -0800
@@ -103,7 +103,7 @@
 
     /** Construct a list consisting of given elements.
      */
-    @SuppressWarnings("varargs")
+    @SuppressWarnings({"varargs", "unchecked"})
     public static <A> List<A> of(A x1, A x2, A x3, A... rest) {
         return new List<A>(x1, new List<A>(x2, new List<A>(x3, from(rest))));
     }
--- a/langtools/src/share/classes/com/sun/tools/javac/util/RawDiagnosticFormatter.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/util/RawDiagnosticFormatter.java	Mon Dec 20 21:10:57 2010 -0800
@@ -27,6 +27,7 @@
 import java.util.Collection;
 import java.util.EnumSet;
 import java.util.Locale;
+import javax.tools.JavaFileObject;
 
 import com.sun.tools.javac.api.DiagnosticFormatter.Configuration.*;
 import com.sun.tools.javac.api.Formattable;
@@ -62,7 +63,7 @@
     //provide common default formats
     public String formatDiagnostic(JCDiagnostic d, Locale l) {
         try {
-            StringBuffer buf = new StringBuffer();
+            StringBuilder buf = new StringBuilder();
             if (d.getPosition() != Position.NOPOS) {
                 buf.append(formatSource(d, false, null));
                 buf.append(':');
@@ -71,16 +72,22 @@
                 buf.append(formatPosition(d, COLUMN, null));
                 buf.append(':');
             }
+            else if (d.getSource() != null && d.getSource().getKind() == JavaFileObject.Kind.CLASS) {
+                buf.append(formatSource(d, false, null));
+                buf.append(":-:-:");
+            }
             else
                 buf.append('-');
             buf.append(' ');
             buf.append(formatMessage(d, null));
-            if (displaySource(d))
-                buf.append("\n" + formatSourceLine(d, 0));
+            if (displaySource(d)) {
+                buf.append("\n");
+                buf.append(formatSourceLine(d, 0));
+            }
             return buf.toString();
         }
         catch (Exception e) {
-            e.printStackTrace();
+            //e.printStackTrace();
             return null;
         }
     }
@@ -96,7 +103,9 @@
                 buf.append(",{");
                 for (String sub : formatSubdiagnostics(d, null)) {
                     buf.append(sep);
-                    buf.append("(" + sub + ")");
+                    buf.append("(");
+                    buf.append(sub);
+                    buf.append(")");
                     sep = ",";
                 }
                 buf.append('}');
--- a/langtools/src/share/classes/com/sun/tools/javac/util/Warner.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/util/Warner.java	Mon Dec 20 21:10:57 2010 -0800
@@ -25,7 +25,9 @@
 
 package com.sun.tools.javac.util;
 
+import com.sun.tools.javac.code.Lint.LintCategory;
 import com.sun.tools.javac.util.JCDiagnostic.DiagnosticPosition;
+import java.util.EnumSet;
 
 /**
  * An interface to support optional warnings, needed for support of
@@ -40,25 +42,45 @@
     public static final Warner noWarnings = new Warner();
 
     private DiagnosticPosition pos = null;
-    public boolean warned = false;
-    public boolean unchecked = false;
+    protected boolean warned = false;
+    private EnumSet<LintCategory> nonSilentLintSet = EnumSet.noneOf(LintCategory.class);
+    private EnumSet<LintCategory> silentLintSet = EnumSet.noneOf(LintCategory.class);
 
     public DiagnosticPosition pos() {
         return pos;
     }
 
-    public void warnUnchecked() {
-        warned = true;
-        unchecked = true;
+    public void warn(LintCategory lint) {
+        nonSilentLintSet.add(lint);
     }
-    public void silentUnchecked() {
-        unchecked = true;
+
+    public void silentWarn(LintCategory lint) {
+        silentLintSet.add(lint);
     }
 
     public Warner(DiagnosticPosition pos) {
         this.pos = pos;
     }
 
+    public boolean hasSilentLint(LintCategory lint) {
+        return silentLintSet.contains(lint);
+    }
+
+    public boolean hasNonSilentLint(LintCategory lint) {
+        return nonSilentLintSet.contains(lint);
+    }
+
+    public boolean hasLint(LintCategory lint) {
+        return hasSilentLint(lint) ||
+                hasNonSilentLint(lint);
+    }
+
+    public void clear() {
+        nonSilentLintSet.clear();
+        silentLintSet.clear();
+        this.warned = false;
+    }
+
     public Warner() {
         this(null);
     }
--- a/langtools/src/share/classes/com/sun/tools/javap/AttributeWriter.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javap/AttributeWriter.java	Mon Dec 20 21:10:57 2010 -0800
@@ -158,17 +158,15 @@
         indent(+1);
         for (int i = 0; i < attr.character_range_table.length; i++) {
             CharacterRangeTable_attribute.Entry e = attr.character_range_table[i];
-            print("    " + e.start_pc + ", " +
-                    e.end_pc + ", " +
-                    Integer.toHexString(e.character_range_start) + ", " +
-                    Integer.toHexString(e.character_range_end) + ", " +
-                    Integer.toHexString(e.flags));
+            print(String.format("    %2d, %2d, %6x, %6x, %4x",
+                    e.start_pc, e.end_pc,
+                    e.character_range_start, e.character_range_end,
+                    e.flags));
             tab();
-            print("// ");
-            print(e.start_pc + ", " +
-                    e.end_pc + ", " +
-                    (e.character_range_start >> 10) + ":" + (e.character_range_start & 0x3ff) + ", " +
-                    (e.character_range_end >> 10) + ":" + (e.character_range_end & 0x3ff));
+            print(String.format("// %2d, %2d, %4d:%02d, %4d:%02d",
+                    e.start_pc, e.end_pc,
+                    (e.character_range_start >> 10), (e.character_range_start & 0x3ff),
+                    (e.character_range_end >> 10), (e.character_range_end & 0x3ff)));
             if ((e.flags & CharacterRangeTable_attribute.CRT_STATEMENT) != 0)
                 print(", statement");
             if ((e.flags & CharacterRangeTable_attribute.CRT_BLOCK) != 0)
@@ -187,6 +185,7 @@
                 print(", branch-true");
             if ((e.flags & CharacterRangeTable_attribute.CRT_BRANCH_FALSE) != 0)
                 print(", branch-false");
+            println();
         }
         indent(-1);
         return null;
--- a/langtools/src/share/classes/javax/lang/model/element/package-info.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/src/share/classes/javax/lang/model/element/package-info.java	Mon Dec 20 21:10:57 2010 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  * 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,12 +66,14 @@
  * <p>During annotation processing, operating on incomplete or
  * erroneous programs is necessary; however, there are fewer
  * guarantees about the nature of the resulting model.  If the source
- * code is not syntactically well-formed, a model may or may not be
- * provided as a quality of implementation issue.  If a program is
- * syntactically valid but erroneous in some other fashion, the
- * returned model must have no less information than if all the method
- * bodies in the program were replaced by {@code "throw new
- * RuntimeException();"}.  If a program refers to a missing type XYZ,
+ * code is not syntactically well-formed or has some other
+ * irrecoverable error that could not be removed by the generation of
+ * new types, a model may or may not be provided as a quality of
+ * implementation issue.
+ * If a program is syntactically valid but erroneous in some other
+ * fashion, any returned model must have no less information than if
+ * all the method bodies in the program were replaced by {@code "throw
+ * new RuntimeException();"}.  If a program refers to a missing type XYZ,
  * the returned model must contain no less information than if the
  * declaration of type XYZ were assumed to be {@code "class XYZ {}"},
  * {@code "interface XYZ {}"}, {@code "enum XYZ {}"}, or {@code
--- a/langtools/test/com/sun/javadoc/AccessAsciiArt/AccessAsciiArt.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/test/com/sun/javadoc/AccessAsciiArt/AccessAsciiArt.java	Mon Dec 20 21:10:57 2010 -0800
@@ -84,17 +84,17 @@
 
             // Test the top line of the class tree
             {
-"  <IMG SRC=\"../../resources/inherit.gif\" ALT=\"extended by \"><A HREF=\"../../p1/C.html\" title=\"class in p1\">p1.C</A>",
+"<li><a href=\"../../p1/C.html\" title=\"class in p1\">p1.C</a></li>",
                      TMPDEST_DIR1 + "p1" + FS + "subpkg" + FS + "SSC.html" },
 
             // Test the second line of the class tree
             {
-"      <IMG SRC=\"../../resources/inherit.gif\" ALT=\"extended by \"><A HREF=\"../../p1/SC.html\" title=\"class in p1\">p1.SC</A>",
+"<li><a href=\"../../p1/SC.html\" title=\"class in p1\">p1.SC</a></li>",
                      TMPDEST_DIR1 + "p1" + FS + "subpkg" + FS + "SSC.html" },
 
             // Test the third line of the class tree
             {
-"          <IMG SRC=\"../../resources/inherit.gif\" ALT=\"extended by \"><STRONG>p1.subpkg.SSC</STRONG>",
+"<li>p1.subpkg.SSC</li>",
                      TMPDEST_DIR1 + "p1" + FS + "subpkg" + FS +"SSC.html" },
 
         };
--- a/langtools/test/com/sun/javadoc/AccessH1/AccessH1.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/test/com/sun/javadoc/AccessH1/AccessH1.java	Mon Dec 20 21:10:57 2010 -0800
@@ -83,18 +83,19 @@
      * NOTE: The standard doclet uses the same separator "\n" for all OS's
      */
     private static final String[][] testArray = {
-
-            // Test the style sheet
-            {
-               "h1 { font-size: 145% }",
-                     TMPDEST_DIR1 + "stylesheet.css"              },
-
-            // Test the doc title in the overview page
-            {
-               "<H1>" + LS + "Document Title" + LS + "</H1>",
-                          TMPDEST_DIR1 + "overview-summary.html"  }
-
-        };
+        // Test the style sheet
+        {
+            ".header h1.title {" + LS + "    font-size:1.4em;" + LS +
+            "    text-align:center;" + LS + "    margin:0;" + LS +
+            "}",
+            TMPDEST_DIR1 + "stylesheet.css"
+        },
+        // Test the doc title in the overview page
+        {
+            "<h1 class=\"title\">Document Title</h1>",
+            TMPDEST_DIR1 + "overview-summary.html"
+        }
+    };
 
     public static void runTestsOnHTML(String[][] testArray) {
 
--- a/langtools/test/com/sun/javadoc/AccessSkipNav/AccessSkipNav.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/test/com/sun/javadoc/AccessSkipNav/AccessSkipNav.java	Mon Dec 20 21:10:57 2010 -0800
@@ -46,6 +46,7 @@
     private static final String BUGNAME = "AccessSkipNav";
     private static final String FS = System.getProperty("file.separator");
     private static final String PS = System.getProperty("path.separator");
+    private static final String LS = System.getProperty("line.separator");
     private static final String TMPDEST_DIR1 = "." + FS + "docs1" + FS;
     private static final String TMPDEST_DIR2 = "." + FS + "docs2" + FS;
 
@@ -84,20 +85,22 @@
 
             // Testing only for the presence of the <a href> and <a name>
 
-            // Top navbar <A HREF>
-            { "<A HREF=\"#skip-navbar_top\" title=\"Skip navigation links\"></A>",
+            // Top navbar <a href>
+            { "<a href=\"#skip-navbar_top\" title=\"Skip navigation links\"></a>",
                      TMPDEST_DIR1 + "p1" + FS + "C1.html" },
 
-            // Top navbar <A NAME>
-            { "<A NAME=\"skip-navbar_top\"></A>",
+            // Top navbar <a name>
+            { "<a name=\"skip-navbar_top\">" + LS +
+                      "<!--   -->" + LS + "</a>",
                      TMPDEST_DIR1 + "p1" + FS + "C1.html" },
 
-            // Bottom navbar <A HREF>
-            { "<A HREF=\"#skip-navbar_bottom\" title=\"Skip navigation links\"></A>",
+            // Bottom navbar <a href>
+            { "<a href=\"#skip-navbar_bottom\" title=\"Skip navigation links\"></a>",
                      TMPDEST_DIR1 + "p1" + FS + "C1.html" },
 
-            // Bottom navbar <A NAME>
-            { "<A NAME=\"skip-navbar_bottom\"></A>",
+            // Bottom navbar <a name>
+            { "<a name=\"skip-navbar_bottom\">" + LS +
+                      "<!--   -->" + LS + "</a>",
                      TMPDEST_DIR1 + "p1" + FS + "C1.html" }
         };
 
--- a/langtools/test/com/sun/javadoc/AccessSummary/AccessSummary.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/test/com/sun/javadoc/AccessSummary/AccessSummary.java	Mon Dec 20 21:10:57 2010 -0800
@@ -24,7 +24,7 @@
 /*
  * @test
  * @bug      4637604 4775148
- * @summary  Test the tables for summary=""
+ * @summary  Test the tables for summary attribute
  * @author   dkramer
  * @library  ../lib/
  * @build    JavadocTester
@@ -44,15 +44,15 @@
 
         // Test that the summary attribute appears
         { OUTPUT_DIR1 + "overview-summary.html",
-                 "SUMMARY=\"\"" },
+                 "summary=\"Packages table, listing packages, and an explanation\"" },
 
         // Test that the summary attribute appears
         { OUTPUT_DIR1 + "p1" + FS + "C1.html",
-                 "SUMMARY=\"\"" },
+                 "summary=\"Constructor Summary table, listing constructors, and an explanation\"" },
 
         // Test that the summary attribute appears
         { OUTPUT_DIR1 + "constant-values.html",
-                 "SUMMARY=\"\"" }
+                 "summary=\"Constant Field Values table, listing constant fields, and values\"" }
     };
 
     // First test with -header only
--- a/langtools/test/com/sun/javadoc/AuthorDD/AuthorDD.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/test/com/sun/javadoc/AuthorDD/AuthorDD.java	Mon Dec 20 21:10:57 2010 -0800
@@ -86,12 +86,12 @@
 
              // Test single @since tag:
 
-            { "<DT><STRONG>Since:</STRONG></DT>"+NL+"  <DD>JDK 1.0</DD>",
+            { "<dt><span class=\"strong\">Since:</span></dt>"+NL+"  <dd>JDK 1.0</dd>",
                                   BUGID + FS + "p1" + FS + "C1.html" },
 
             // Test multiple @author tags:
 
-            { "<DT><STRONG>Author:</STRONG></DT>"+NL+"  <DD>Doug Kramer, Jamie, Neal</DD>",
+            { "<dt><span class=\"strong\">Author:</span></dt>"+NL+"  <dd>Doug Kramer, Jamie, Neal</dd>",
                                   BUGID + FS + "p1" + FS + "C1.html" },
 
         };
--- a/langtools/test/com/sun/javadoc/JavascriptWinTitle/JavascriptWinTitle.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/test/com/sun/javadoc/JavascriptWinTitle/JavascriptWinTitle.java	Mon Dec 20 21:10:57 2010 -0800
@@ -90,44 +90,34 @@
     private static final String[][] testArray = {
 
             // Test the javascript "type" attribute is present:
-            {  "<SCRIPT type=\"text/javascript\">",
+            {  "<script type=\"text/javascript\">",
                      TMPDEST_DIR1 + "overview-summary.html"  },
 
-            // Test onload is present:
-            {  "onload=\"windowTitle();\"",
+            // Test onload is absent:
+            {  "<body>",
                      TMPDEST_DIR1 + "overview-summary.html"  },
 
             // Test onload is present:
-            {  "onload=\"windowTitle();\"",
+            {  "<body>",
                      TMPDEST_DIR1 + FS + "p1" + FS + "package-summary.html"  },
 
-            // Test onload is present:
-            {  "onload=\"windowTitle();\"",
-                     TMPDEST_DIR1 + FS + "p1" + FS + "C.html"  },
-
             // Test that "onload" is not present in BODY tag:
-            {   "<BODY BGCOLOR=\"white\">",
+            {   "<body>",
                      TMPDEST_DIR1 + "overview-frame.html"  },
 
             // Test that "onload" is not present in BODY tag:
-            {   "<BODY BGCOLOR=\"white\">",
+            {   "<body>",
                      TMPDEST_DIR1 + "allclasses-frame.html"  },
 
             // Test that "onload" is not present in BODY tag:
-            {   "<BODY BGCOLOR=\"white\">",
+            {   "<body>",
                      TMPDEST_DIR1 + FS + "p1" + FS + "package-frame.html"  },
 
             // Test that win title javascript is followed by NOSCRIPT code.
-            {"<SCRIPT type=\"text/javascript\">" + LS +
-                    "function windowTitle()" + LS +
-                    "{" + LS +
-                    "    if (location.href.indexOf('is-external=true') == -1) {" + LS +
-                    "        parent.document.title=\"C (Window Title)\";" + LS +
-                    "    }" + LS +
-                    "}" + LS +
-             "</SCRIPT>" + LS +
-             "<NOSCRIPT>" + LS +
-             "</NOSCRIPT>",
+            {"<script type=\"text/javascript\"><!--" + LS +
+                     "    if (location.href.indexOf('is-external=true') == -1) {" + LS +
+                     "        parent.document.title=\"C (Window Title)\";" + LS +
+                     "    }" + LS + "//-->" + LS + "</script>",
              TMPDEST_DIR1 + FS + "p1" + FS + "C.html"
             }
 
--- a/langtools/test/com/sun/javadoc/MetaTag/MetaTag.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/test/com/sun/javadoc/MetaTag/MetaTag.java	Mon Dec 20 21:10:57 2010 -0800
@@ -67,31 +67,31 @@
     private static final String[][] TEST = {
 
         { OUTPUT_DIR + FS + "p1" + FS + "C1.html",
-           "<META NAME=\"keywords\" CONTENT=\"p1.C1 class\">" },
+           "<meta name=\"keywords\" content=\"p1.C1 class\">" },
 
         { OUTPUT_DIR + FS + "p1" + FS + "C1.html",
-           "<META NAME=\"keywords\" CONTENT=\"field1\">" },
+           "<meta name=\"keywords\" content=\"field1\">" },
 
         { OUTPUT_DIR + FS + "p1" + FS + "C1.html",
-           "<META NAME=\"keywords\" CONTENT=\"field2\">" },
+           "<meta name=\"keywords\" content=\"field2\">" },
 
         { OUTPUT_DIR + FS + "p1" + FS + "C1.html",
-           "<META NAME=\"keywords\" CONTENT=\"method1()\">" },
+           "<meta name=\"keywords\" content=\"method1()\">" },
 
         { OUTPUT_DIR + FS + "p1" + FS + "C1.html",
-           "<META NAME=\"keywords\" CONTENT=\"method2()\">" },
+           "<meta name=\"keywords\" content=\"method2()\">" },
 
         { OUTPUT_DIR + FS + "p1" + FS + "package-summary.html",
-           "<META NAME=\"keywords\" CONTENT=\"p1 package\">" },
+           "<meta name=\"keywords\" content=\"p1 package\">" },
 
         { OUTPUT_DIR + FS + "overview-summary.html",
-           "<META NAME=\"keywords\" CONTENT=\"Overview, Sample Packages\">" },
+           "<meta name=\"keywords\" content=\"Overview, Sample Packages\">" },
 
         //NOTE: Hopefully, this regression test is not run at midnight.  If the output
         //was generated yesterday and this test is run today, the test will fail.
         {OUTPUT_DIR + FS + "overview-summary.html",
-           "<META NAME=\"date\" "
-                            + "CONTENT=\"" + m_dateFormat.format(new Date()) + "\">"},
+           "<meta name=\"date\" "
+                            + "content=\"" + m_dateFormat.format(new Date()) + "\">"},
     };
 
     private static final String[][] NEGATED_TEST = NO_TEST;
--- a/langtools/test/com/sun/javadoc/ValidHtml/ValidHtml.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/test/com/sun/javadoc/ValidHtml/ValidHtml.java	Mon Dec 20 21:10:57 2010 -0800
@@ -33,12 +33,10 @@
  * @run main ValidHtml
  */
 
-
 import com.sun.javadoc.*;
 import java.util.*;
 import java.io.*;
 
-
 /**
  * Runs javadoc and runs regression tests on the resulting HTML.
  * It reads each file, complete with newlines, into a string to easily
@@ -66,13 +64,14 @@
         String srcdir = System.getProperty("test.src", ".");
 
         // Test for all cases except the split index page
-        runJavadoc(new String[] {"-d", TMPDEST_DIR1,
-                                 "-doctitle", "Document Title",
-                                 "-windowtitle", "Window Title",
-                                 "-use",
-                                 "-overview", (srcdir + FS + "overview.html"),
-                                 "-sourcepath", srcdir,
-                                 "p1", "p2"});
+        runJavadoc(new String[]{"-d", TMPDEST_DIR1,
+                    "-doctitle", "Document Title",
+                    "-windowtitle", "Window Title",
+                    "-use",
+                    "-overview", (srcdir + FS + "overview.html"),
+                    "-sourcepath", srcdir,
+                    "p1", "p2"
+                });
         runTestsOnHTML(testArray);
 
         printSummary();
@@ -90,53 +89,52 @@
      * NOTE: The standard doclet uses the same separator "\n" for all OS's
      */
     private static final String[][] testArray = {
-
-            // Test the proper DOCTYPE element is present:
-            {
-"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Frameset//EN\" \"http://www.w3.org/TR/html4/frameset.dtd\">",
-                     TMPDEST_DIR1 + "index.html"  },
-
-            // Test the proper DOCTYPE element is present:
-            {
-"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">",
-                     TMPDEST_DIR1 + "overview-summary.html"  },
-
-            // Test the proper DOCTYPE element is present:
-            {
-"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">",
-                     TMPDEST_DIR1 + "p1" + FS + "package-summary.html"  },
-
-            // Test the proper DOCTYPE element is present:
-            {
-"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">",
-                     TMPDEST_DIR1 + "p1" + FS + "C.html"  },
-
-            // Test the proper DOCTYPE element is present:
-            {
-"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">",
-                     TMPDEST_DIR1 + "overview-frame.html"  },
-
-            // Test the proper DOCTYPE element is present:
-            {
-"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">",
-                     TMPDEST_DIR1 + "allclasses-frame.html"  },
-
-            // Test the proper DOCTYPE element is present:
-            {
-"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">",
-                     TMPDEST_DIR1 + "p1" + FS + "package-frame.html"  },
-
-            // Test that <NOFRAMES> is inside <FRAMESET> element:
-            {
-"</NOFRAMES>" + LS + "</FRAMESET>",
-                     TMPDEST_DIR1 + "index.html"  },
-
-            // Test the table elements are in the correct order:
-            {
-"</FONT></TD>" + LS + "</TR>",
-                     TMPDEST_DIR1 + FS + "p1" + FS + "package-use.html"  }
-
-        };
+        // Test the proper DOCTYPE element is present:
+        {
+            "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Frameset//EN\" \"http://www.w3.org/TR/html4/frameset.dtd\">",
+            TMPDEST_DIR1 + "index.html"
+        },
+        // Test the proper DOCTYPE element is present:
+        {
+            "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">",
+            TMPDEST_DIR1 + "overview-summary.html"
+        },
+        // Test the proper DOCTYPE element is present:
+        {
+            "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">",
+            TMPDEST_DIR1 + "p1" + FS + "package-summary.html"
+        },
+        // Test the proper DOCTYPE element is present:
+        {
+            "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">",
+            TMPDEST_DIR1 + "p1" + FS + "C.html"
+        },
+        // Test the proper DOCTYPE element is present:
+        {
+            "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">",
+            TMPDEST_DIR1 + "overview-frame.html"
+        },
+        // Test the proper DOCTYPE element is present:
+        {
+            "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">",
+            TMPDEST_DIR1 + "allclasses-frame.html"
+        },
+        // Test the proper DOCTYPE element is present:
+        {
+            "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">",
+            TMPDEST_DIR1 + "p1" + FS + "package-frame.html"
+        },
+        // Test that <NOFRAMES> is inside <FRAMESET> element:
+        {
+            "</noframes>" + LS + "</frameset>",
+            TMPDEST_DIR1 + "index.html"
+        },
+        // Test the table elements are in the correct order:
+        {
+            "</td>" + LS + "</tr>",
+            TMPDEST_DIR1 + FS + "p1" + FS + "package-use.html"
+        }
+    };
 
     public static void runTestsOnHTML(String[][] testArray) {
 
@@ -152,10 +150,7 @@
 
             // Find string in file's contents
             if (findString(fileString, stringToFind) == -1) {
-                System.out.println("\nSub-test " + (subtestNum)
-                    + " for bug " + BUGID + " (" + BUGNAME + ") FAILED\n"
-                    + "when searching for:\n"
-                    + stringToFind);
+                System.out.println("\nSub-test " + (subtestNum) + " for bug " + BUGID + " (" + BUGNAME + ") FAILED\n" + "when searching for:\n" + stringToFind);
             } else {
                 numSubtestsPassed += 1;
                 System.out.println("\nSub-test " + (subtestNum) + " passed:\n" + stringToFind);
@@ -164,11 +159,10 @@
     }
 
     public static void printSummary() {
-        if ( numSubtestsPassed == subtestNum ) {
+        if (numSubtestsPassed == subtestNum) {
             System.out.println("\nAll " + numSubtestsPassed + " subtests passed");
         } else {
-            throw new Error("\n" + (subtestNum - numSubtestsPassed) + " of " + (subtestNum)
-                             + " subtests failed for bug " + BUGID + " (" + BUGNAME + ")\n");
+            throw new Error("\n" + (subtestNum - numSubtestsPassed) + " of " + (subtestNum) + " subtests failed for bug " + BUGID + " (" + BUGNAME + ")\n");
         }
     }
 
@@ -176,16 +170,16 @@
     public static String readFileToString(String filename) {
         try {
             File file = new File(filename);
-            if ( !file.exists() ) {
+            if (!file.exists()) {
                 System.out.println("\nFILE DOES NOT EXIST: " + filename);
             }
             BufferedReader in = new BufferedReader(new FileReader(file));
 
             // Create an array of characters the size of the file
-            char[] allChars = new char[(int)file.length()];
+            char[] allChars = new char[(int) file.length()];
 
             // Read the characters into the allChars array
-            in.read(allChars, 0, (int)file.length());
+            in.read(allChars, 0, (int) file.length());
             in.close();
 
             // Convert to a string
--- a/langtools/test/com/sun/javadoc/VersionNumber/VersionNumber.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/test/com/sun/javadoc/VersionNumber/VersionNumber.java	Mon Dec 20 21:10:57 2010 -0800
@@ -84,7 +84,7 @@
 
             // Test the proper DOCTYPE element is present:
             {
-                 "<!-- Generated by javadoc (build",
+                 "<!-- Generated by javadoc (version",
                      TMPDEST_DIR1 + "p1" + FS + "C.html"  },
 
         };
--- a/langtools/test/com/sun/javadoc/WindowTitles/WindowTitles.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/test/com/sun/javadoc/WindowTitles/WindowTitles.java	Mon Dec 20 21:10:57 2010 -0800
@@ -94,52 +94,52 @@
      */
     private static final String[][] testArray = {
 
-            { "<TITLE>" + LS + "Overview" + LS + "</TITLE>",
+            { "<title>Overview</title>",
                     TMPDIR_STRING1 + "overview-summary.html"                  },
 
-            { "<TITLE>" + LS + "Class Hierarchy" + LS + "</TITLE>",
+            { "<title>Class Hierarchy</title>",
                     TMPDIR_STRING1 + "overview-tree.html"                     },
 
-            { "<TITLE>" + LS + "Overview List" + LS + "</TITLE>",
+            { "<title>Overview List</title>",
                     TMPDIR_STRING1 + "overview-frame.html"                    },
 
-            { "<TITLE>" + LS + "p1" + LS + "</TITLE>",
+            { "<title>p1</title>",
                     TMPDIR_STRING1 + "p1" + FS + "package-summary.html"       },
 
-            { "<TITLE>" + LS + "p1" + LS + "</TITLE>",
+            { "<title>p1</title>",
                     TMPDIR_STRING1 + "p1" + FS + "package-frame.html"         },
 
-            { "<TITLE>" + LS + "p1 Class Hierarchy" + LS + "</TITLE>",
+            { "<title>p1 Class Hierarchy</title>",
                     TMPDIR_STRING1 + "p1" + FS + "package-tree.html"          },
 
-            { "<TITLE>" + LS + "Uses of Package p1" + LS + "</TITLE>",
+            { "<title>Uses of Package p1</title>",
                     TMPDIR_STRING1 + "p1" + FS + "package-use.html"           },
 
-            { "<TITLE>" + LS + "C1" + LS + "</TITLE>",
+            { "<title>C1</title>",
                     TMPDIR_STRING1 + "p1" + FS + "C1.html"                    },
 
-            { "<TITLE>" + LS + "All Classes" + LS + "</TITLE>",
+            { "<title>All Classes</title>",
                     TMPDIR_STRING1 + "allclasses-frame.html"                  },
 
-            { "<TITLE>" + LS + "All Classes" + LS + "</TITLE>",
+            { "<title>All Classes</title>",
                     TMPDIR_STRING1 + "allclasses-noframe.html"                },
 
-            { "<TITLE>" + LS + "Constant Field Values" + LS + "</TITLE>",
+            { "<title>Constant Field Values</title>",
                     TMPDIR_STRING1 + "constant-values.html"                   },
 
-            { "<TITLE>" + LS + "Deprecated List" + LS + "</TITLE>",
+            { "<title>Deprecated List</title>",
                     TMPDIR_STRING1 + "deprecated-list.html"                   },
 
-            { "<TITLE>" + LS + "Serialized Form" + LS + "</TITLE>",
+            { "<title>Serialized Form</title>",
                     TMPDIR_STRING1 + "serialized-form.html"                   },
 
-            { "<TITLE>" + LS + "API Help" + LS + "</TITLE>",
+            { "<title>API Help</title>",
                     TMPDIR_STRING1 + "help-doc.html"                          },
 
-            { "<TITLE>" + LS + "Index" + LS + "</TITLE>",
+            { "<title>Index</title>",
                     TMPDIR_STRING1 + "index-all.html"                         },
 
-            { "<TITLE>" + LS + "Uses of Class p1.C1" + LS + "</TITLE>",
+            { "<title>Uses of Class p1.C1</title>",
                     TMPDIR_STRING1 + "p1" + FS + "class-use" + FS + "C1.html" },
         };
 
@@ -147,7 +147,7 @@
      * Assign value for [ stringToFind, filename ] for split index page
      */
     private static final String[][] testSplitIndexArray = {
-            { "<TITLE>" + LS + "C-Index" + LS + "</TITLE>",
+            { "<title>C-Index</title>",
                     TMPDIR_STRING2 + "index-files" + FS + "index-1.html"       },
         };
 
--- a/langtools/test/com/sun/javadoc/constantValues/TestConstantValuesDriver.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/test/com/sun/javadoc/constantValues/TestConstantValuesDriver.java	Mon Dec 20 21:10:57 2010 -0800
@@ -51,7 +51,7 @@
             tests[i][1] = "TEST"+(i+1)+"PASSES";
         }
         tests[tests.length-1][0] = BUG_ID + FS + "constant-values.html";
-        tests[tests.length-1][1] = "<CODE>\"&lt;Hello World&gt;\"</CODE>";
+        tests[tests.length-1][1] = "<code>\"&lt;Hello World&gt;\"</code>";
         TestConstantValuesDriver tester = new TestConstantValuesDriver();
         run(tester, ARGS, tests, NO_TEST);
         tester.printSummary();
--- a/langtools/test/com/sun/javadoc/testClassCrossReferences/TestClassCrossReferences.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/test/com/sun/javadoc/testClassCrossReferences/TestClassCrossReferences.java	Mon Dec 20 21:10:57 2010 -0800
@@ -37,18 +37,20 @@
     private static final String BUG_ID = "4652655-4857717";
     private static final String[][] TEST = {
         {BUG_ID + FS + "C.html",
-            "<A HREF=\"http://java.sun.com/j2se/1.4/docs/api/java/math/package-summary.html?is-external=true\"><CODE>Link to math package</CODE></A>"},
+            "<a href=\"http://java.sun.com/j2se/1.4/docs/api/java/math/package-summary.html?is-external=true\"><code>Link to math package</code></a>"},
         {BUG_ID + FS + "C.html",
-            "<A HREF=\"http://java.sun.com/j2se/1.4/docs/api/javax/swing/text/AbstractDocument.AttributeContext.html?is-external=true\" " +
-            "title=\"class or interface in javax.swing.text\"><CODE>Link to AttributeContext innerclass</CODE></A>"},
+            "<a href=\"http://java.sun.com/j2se/1.4/docs/api/javax/swing/text/AbstractDocument.AttributeContext.html?is-external=true\" " +
+            "title=\"class or interface in javax.swing.text\"><code>Link to AttributeContext innerclass</code></a>"},
         {BUG_ID + FS + "C.html",
-            "<A HREF=\"http://java.sun.com/j2se/1.4/docs/api/java/math/BigDecimal.html?is-external=true\" " +
-                "title=\"class or interface in java.math\"><CODE>Link to external class BigDecimal</CODE></A>"},
+            "<a href=\"http://java.sun.com/j2se/1.4/docs/api/java/math/BigDecimal.html?is-external=true\" " +
+                "title=\"class or interface in java.math\"><code>Link to external class BigDecimal</code></a>"},
         {BUG_ID + FS + "C.html",
-            "<A HREF=\"http://java.sun.com/j2se/1.4/docs/api/java/math/BigInteger.html?is-external=true#gcd(java.math.BigInteger)\" " +
-                "title=\"class or interface in java.math\"><CODE>Link to external member gcd</CODE></A>"},
+            "<a href=\"http://java.sun.com/j2se/1.4/docs/api/java/math/BigInteger.html?is-external=true#gcd(java.math.BigInteger)\" " +
+                "title=\"class or interface in java.math\"><code>Link to external member gcd</code></a>"},
         {BUG_ID + FS + "C.html",
-            "<STRONG>Overrides:</STRONG></DT><DD><CODE>toString</CODE> in class <CODE>java.lang.Object</CODE>"}
+            "<dl>" + NL + "<dt><strong>Overrides:</strong></dt>" + NL +
+            "<dd><code>toString</code>&nbsp;in class&nbsp;<code>java.lang.Object</code></dd>" + NL +
+            "</dl>"}
     };
     private static final String[][] NEGATED_TEST = NO_TEST;
     private static final String[] ARGS =
--- a/langtools/test/com/sun/javadoc/testClassTree/TestClassTree.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/test/com/sun/javadoc/testClassTree/TestClassTree.java	Mon Dec 20 21:10:57 2010 -0800
@@ -48,32 +48,29 @@
     //Input for string search tests.
     private static final String[][] TEST = {
         {BUG_ID + FS + "pkg" + FS + "package-tree.html",
-            "<LI TYPE=\"circle\">pkg.<A HREF=\"../pkg/ParentClass.html\" " +
-            "title=\"class in pkg\"><STRONG>ParentClass</STRONG></A><UL>"},
-
-        {BUG_ID + FS + "pkg" + FS + "package-tree.html",
-            "Annotation Type Hierarchy" + NL + "</H2>" + NL + "<UL>" + NL +
-            "<LI TYPE=\"circle\">pkg.<A HREF=\"../pkg/AnnotationType.html\" " +
-            "title=\"annotation in pkg\"><STRONG>AnnotationType</STRONG></A> " +
-            "(implements java.lang.annotation.Annotation)" + NL + "</UL>"},
+            "<ul>" + NL + "<li type=\"circle\">pkg.<a href=\"../pkg/ParentClass.html\" " +
+            "title=\"class in pkg\"><span class=\"strong\">ParentClass</span></a>"},
 
         {BUG_ID + FS + "pkg" + FS + "package-tree.html",
-            "<H2>" + NL +
-            "Enum Hierarchy" + NL +
-            "</H2>" + NL +
-            "<UL>" + NL +
-            "<LI TYPE=\"circle\">java.lang.Object<UL>" + NL +
-            "<LI TYPE=\"circle\">java.lang.Enum&lt;E&gt; (implements java.lang.Comparable&lt;T&gt;, java.io.Serializable)" + NL +
-            "<UL>" + NL +
-            "<LI TYPE=\"circle\">pkg.<A HREF=\"../pkg/Coin.html\" title=\"enum in pkg\"><STRONG>Coin</STRONG></A></UL>" + NL +
-            "</UL>" + NL +
-            "</UL>"
+            "<h2 title=\"Annotation Type Hierarchy\">Annotation Type Hierarchy</h2>" + NL +
+            "<ul>" + NL + "<li type=\"circle\">pkg.<a href=\"../pkg/AnnotationType.html\" " +
+            "title=\"annotation in pkg\"><span class=\"strong\">AnnotationType</span></a> " +
+            "(implements java.lang.annotation.Annotation)</li>" + NL + "</ul>"},
+
+        {BUG_ID + FS + "pkg" + FS + "package-tree.html",
+            "<h2 title=\"Enum Hierarchy\">Enum Hierarchy</h2>" + NL + "<ul>" + NL +
+            "<li type=\"circle\">java.lang.Object" + NL + "<ul>" + NL +
+            "<li type=\"circle\">java.lang.Enum&lt;E&gt; (implements java.lang." +
+            "Comparable&lt;T&gt;, java.io.Serializable)" + NL + "<ul>" + NL +
+            "<li type=\"circle\">pkg.<a href=\"../pkg/Coin.html\" " +
+            "title=\"enum in pkg\"><span class=\"strong\">Coin</span></a></li>" + NL +
+            "</ul>" + NL + "</li>" + NL + "</ul>" + NL + "</li>" + NL + "</ul>"
         },
     };
     private static final String[][] NEGATED_TEST = {
         {BUG_ID + FS + "pkg" + FS + "package-tree.html",
-            "<LI TYPE=\"circle\">class pkg.<A HREF=\"../pkg/ParentClass.html\" " +
-            "title=\"class in pkg\"><STRONG>ParentClass</STRONG></A><UL>"}
+            "<li type=\"circle\">class pkg.<a href=\"../pkg/ParentClass.html\" " +
+            "title=\"class in pkg\"><span class=\"strong\">ParentClass</span></a></li>"}
         };
 
     /**
--- a/langtools/test/com/sun/javadoc/testConstructorIndent/TestConstructorIndent.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/test/com/sun/javadoc/testConstructorIndent/TestConstructorIndent.java	Mon Dec 20 21:10:57 2010 -0800
@@ -45,10 +45,10 @@
 
     //Input for string search tests.
     private static final String[][] TEST = {
-        {BUG_ID + FS + "C.html", "<DL>" + NL + "<DD>This is just a simple constructor." + NL +
-            "<P>" + NL + "</DD>" + NL + "<DD><DL>" + NL + "<DT><STRONG>Parameters:</STRONG>" +
-            "</DT><DD><CODE>i</CODE> - a param.</DD></DL>" + NL +
-            "</DD>" + NL + "</DL>"
+        {BUG_ID + FS + "C.html", "<div class=\"block\">" +
+                 "This is just a simple constructor.</div>" + NL +
+                 "<dl><dt><span class=\"strong\">Parameters:</span></dt><dd>" +
+                 "<code>i</code> - a param.</dd></dl>"
         }
     };
     private static final String[][] NEGATED_TEST = NO_TEST;
--- a/langtools/test/com/sun/javadoc/testDeprecatedDocs/TestDeprecatedDocs.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/test/com/sun/javadoc/testDeprecatedDocs/TestDeprecatedDocs.java	Mon Dec 20 21:10:57 2010 -0800
@@ -76,24 +76,21 @@
         {TARGET_FILE, "pkg.DeprecatedClassByAnnotation.method()"},
         {TARGET_FILE, "pkg.DeprecatedClassByAnnotation.field"},
 
-        {TARGET_FILE2, "<STRONG>Deprecated.</STRONG>" + NL +
-                "<P>" + NL +
-            "<PRE><FONT SIZE=\"-1\">@Deprecated" + NL +
-            "</FONT>public class <STRONG>DeprecatedClassByAnnotation</STRONG>"},
+        {TARGET_FILE2, "<pre>@Deprecated" + NL +
+                 "public class <strong>DeprecatedClassByAnnotation</strong>" + NL +
+                 "extends java.lang.Object</pre>"},
 
-        {TARGET_FILE2, "public int <STRONG>field</STRONG></PRE>" + NL +
-            "<DL>" + NL +
-            "<DD><STRONG>Deprecated.</STRONG>&nbsp;</DD></DL>"},
+        {TARGET_FILE2, "<pre>@Deprecated" + NL +
+                 "public&nbsp;int field</pre>" + NL +
+                 "<div class=\"block\"><span class=\"strong\">Deprecated.</span>&nbsp;</div>"},
 
-        {TARGET_FILE2, "<FONT SIZE=\"-1\">@Deprecated" + NL +
-            "</FONT>public <STRONG>DeprecatedClassByAnnotation</STRONG>()</PRE>" + NL +
-            "<DL>" + NL +
-            "<DD><STRONG>Deprecated.</STRONG>"},
+        {TARGET_FILE2, "<pre>@Deprecated" + NL +
+                 "public&nbsp;DeprecatedClassByAnnotation()</pre>" + NL +
+                 "<div class=\"block\"><span class=\"strong\">Deprecated.</span>&nbsp;</div>"},
 
-        {TARGET_FILE2, "<FONT SIZE=\"-1\">@Deprecated" + NL +
-            "</FONT>public void <STRONG>method</STRONG>()</PRE>" + NL +
-            "<DL>" + NL +
-            "<DD><STRONG>Deprecated.</STRONG>"},
+        {TARGET_FILE2, "<pre>@Deprecated" + NL +
+                 "public&nbsp;void&nbsp;method()</pre>" + NL +
+                 "<div class=\"block\"><span class=\"strong\">Deprecated.</span>&nbsp;</div>"},
     };
 
     private static final String[][] NEGATED_TEST = NO_TEST;
--- a/langtools/test/com/sun/javadoc/testDocRootInlineTag/TestDocRootInlineTag.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/test/com/sun/javadoc/testDocRootInlineTag/TestDocRootInlineTag.java	Mon Dec 20 21:10:57 2010 -0800
@@ -39,13 +39,13 @@
     private static final String BUG_ID = "4369014-4851991";
     private static final String[][] TEST = {
         {BUG_ID + FS + "TestDocRootTag.html",
-            "<A HREF=\"http://www.java.sun.com/j2se/1.4/docs/api/java/io/File.html?is-external=true\" " +
-            "title=\"class or interface in java.io\"><CODE>File</CODE></A>"},
+            "<a href=\"http://www.java.sun.com/j2se/1.4/docs/api/java/io/File.html?is-external=true\" " +
+            "title=\"class or interface in java.io\"><code>File</code></a>"},
         {BUG_ID + FS + "TestDocRootTag.html",
             "<a href=\"./glossary.html\">glossary</a>"},
         {BUG_ID + FS + "TestDocRootTag.html",
-            "<A HREF=\"http://www.java.sun.com/j2se/1.4/docs/api/java/io/File.html?is-external=true\" " +
-            "title=\"class or interface in java.io\"><CODE>Second File Link</CODE></A>"},
+            "<a href=\"http://www.java.sun.com/j2se/1.4/docs/api/java/io/File.html?is-external=true\" " +
+            "title=\"class or interface in java.io\"><code>Second File Link</code></a>"},
         {BUG_ID + FS + "TestDocRootTag.html", "The value of @docRoot is \"./\""},
         {BUG_ID + FS + "index-all.html", "My package page is " +
             "<a href=\"./pkg/package-summary.html\">here</a>"}
--- a/langtools/test/com/sun/javadoc/testExternalOverridenMethod/TestExternalOverridenMethod.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/test/com/sun/javadoc/testExternalOverridenMethod/TestExternalOverridenMethod.java	Mon Dec 20 21:10:57 2010 -0800
@@ -39,17 +39,17 @@
     private static final String BUG_ID = "4857717";
     private static final String[][] TEST = {
         {BUG_ID + FS + "pkg" + FS + "XReader.html",
-            "<STRONG>Overrides:</STRONG></DT><DD><CODE><A HREF=\"" +
-            "http://java.sun.com/j2se/1.4.1/docs/api/java/io/FilterReader.html?is-external=true#read()\"" +
-                " title=\"class or interface in java.io\">read</A></CODE> in class " +
-                "<CODE><A HREF=\"http://java.sun.com/j2se/1.4.1/docs/api/java/io/FilterReader.html?is-external=true\"" +
-                " title=\"class or interface in java.io\">FilterReader</A>"},
+            "<dt><strong>Overrides:</strong></dt>" + NL +
+            "<dd><code><a href=\"http://java.sun.com/j2se/1.4.1/docs/api/java/io/FilterReader.html?is-external=true#read()\" " +
+            "title=\"class or interface in java.io\">read</a></code>&nbsp;in class&nbsp;<code>" +
+            "<a href=\"http://java.sun.com/j2se/1.4.1/docs/api/java/io/FilterReader.html?is-external=true\" " +
+            "title=\"class or interface in java.io\">FilterReader</a></code></dd>"},
         {BUG_ID + FS + "pkg" + FS + "XReader.html",
-            "<STRONG>Specified by:</STRONG></DT><DD><CODE><A HREF=\"" +
-            "http://java.sun.com/j2se/1.4.1/docs/api/java/io/DataInput.html?is-external=true#readInt()\"" +
-            " title=\"class or interface in java.io\">readInt</A></CODE> in interface " +
-            "<CODE><A HREF=\"http://java.sun.com/j2se/1.4.1/docs/api/java/io/DataInput.html?is-external=true\"" +
-            " title=\"class or interface in java.io\">DataInput</A>"}};
+            "<dt><strong>Specified by:</strong></dt>" + NL +
+            "<dd><code><a href=\"http://java.sun.com/j2se/1.4.1/docs/api/java/io/DataInput.html?is-external=true#readInt()\" " +
+            "title=\"class or interface in java.io\">readInt</a></code>&nbsp;in interface&nbsp;<code>" +
+            "<a href=\"http://java.sun.com/j2se/1.4.1/docs/api/java/io/DataInput.html?is-external=true\" " +
+            "title=\"class or interface in java.io\">DataInput</a></code></dd>"}};
 
 
 
--- a/langtools/test/com/sun/javadoc/testHeadings/TestHeadings.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/test/com/sun/javadoc/testHeadings/TestHeadings.java	Mon Dec 20 21:10:57 2010 -0800
@@ -47,80 +47,65 @@
     private static final String[][] TEST = {
         //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>"
+            "<th class=\"colFirst\" scope=\"col\">" +
+            "Class</th>" + NL + "<th class=\"colLast\" scope=\"col\"" +
+            ">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>"
+            "<th class=\"colFirst\" scope=\"col\">Modifier and Type</th>" + NL +
+            "<th class=\"colLast\" scope=\"col\">Field and Description</th>"
         },
         {BUG_ID + FS + "pkg1" + FS + "C1.html",
-            "<TH ALIGN=\"left\"><STRONG>Methods inherited from class " +            "java.lang.Object</STRONG></TH>"
+            "<h3>Methods inherited from class&nbsp;java.lang.Object</h3>"
         },
 
         // Class use documentation
         {BUG_ID + FS + "pkg1" + FS + "class-use" + FS + "C1.html",
-            "<TH CLASS=\"TableHeader\" SCOPE=\"col\" NOWRAP>" +
-            "Package</TH>" + NL + "<TH CLASS=\"TableHeader\"" +
-            " SCOPE=\"col\" NOWRAP>Description</TH>"
+            "<th class=\"colFirst\" scope=\"col\">Package</th>" + NL +
+            "<th class=\"colLast\" scope=\"col\">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 CLASS=\"TableHeader\" SCOPE=\"col\" NOWRAP>" +
-            "Modifier and Type</TH>" + NL + "<TH CLASS=\"TableHeader\"" +
-            " SCOPE=\"col\" NOWRAP>Field and Description</TH>"
+            "<th class=\"colFirst\" scope=\"col\">Modifier and Type</th>" + NL +
+            "<th class=\"colLast\" scope=\"col\">Field and Description</th>"
         },
 
         // Deprecated
         {BUG_ID + FS + "deprecated-list.html",
-            "<TH CLASS=\"TableHeader\" SCOPE=\"col\" NOWRAP>" +
-            "Method and Description</TH>"
+            "<th class=\"colOne\" scope=\"col\">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>"
+            "<th class=\"colFirst\" scope=\"col\">" +
+            "Modifier and Type</th>" + NL + "<th scope=\"col\">Constant Field</th>" + NL +
+            "<th class=\"colLast\" scope=\"col\">Value</th>"
         },
 
         // Serialized Form
         {BUG_ID + FS + "serialized-form.html",
-            "<TH ALIGN=\"center\"><FONT SIZE=\"+2\">" + NL +
-            "<STRONG>Package</STRONG> <STRONG>pkg1</STRONG></FONT></TH>"
+            "<h2 title=\"Package\">Package&nbsp;pkg1</h2>"
         },
         {BUG_ID + FS + "serialized-form.html",
-            "<TH ALIGN=\"left\" COLSPAN=\"2\"><FONT SIZE=\"+2\">" + NL +
-            "<STRONG>Class <A HREF=\"pkg1/C1.html\" " +            "title=\"class in pkg1\">pkg1.C1</A> extends java.lang.Object " +            "implements Serializable</STRONG></FONT></TH>"
+            "<h3>Class <a href=\"pkg1/C1.html\" title=\"class in pkg1\">" +
+            "pkg1.C1</a> extends java.lang.Object implements Serializable</h3>"
         },
         {BUG_ID + FS + "serialized-form.html",
-            "<TH ALIGN=\"left\" COLSPAN=\"1\"><FONT SIZE=\"+2\">" + NL +
-            "<STRONG>Serialized Fields</STRONG></FONT></TH>"
+            "<h3>Serialized Fields</h3>"
         },
 
         // Overview Frame
         {BUG_ID + FS + "overview-frame.html",
-            "<TH ALIGN=\"left\" NOWRAP><FONT size=\"+1\" " +            "CLASS=\"FrameTitleFont\">" + NL + "<STRONG>Test Files</STRONG></FONT></TH>"
+            "<h1 title=\"Test Files\" class=\"bar\">Test Files</h1>"
         },
         {BUG_ID + FS + "overview-frame.html",
-            "<TITLE>" + NL +
-            "Overview List" + NL +
-            "</TITLE>"
+            "<title>Overview List</title>"
         },
 
         // Overview Summary
         {BUG_ID + FS + "overview-summary.html",
-            "<TITLE>" + NL +
-            "Overview" + NL +
-            "</TITLE>"
+            "<title>Overview</title>"
         },
 
     };
--- a/langtools/test/com/sun/javadoc/testHelpOption/TestHelpOption.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/test/com/sun/javadoc/testHelpOption/TestHelpOption.java	Mon Dec 20 21:10:57 2010 -0800
@@ -91,8 +91,7 @@
 
     private static final String[][] TEST2 = {
         {BUG_ID + FS + "TestHelpOption.html",
-            "<A HREF=\"help-doc.html\"><FONT CLASS=\"NavBarFont1\">" +
-            "<STRONG>Help</STRONG></FONT></A>"
+            "<li><a href=\"help-doc.html\">Help</a></li>"
         },
     };
     private static final String[][] NEGATED_TEST2 = NO_TEST;
--- a/langtools/test/com/sun/javadoc/testHref/TestHref.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/test/com/sun/javadoc/testHref/TestHref.java	Mon Dec 20 21:10:57 2010 -0800
@@ -47,37 +47,41 @@
     private static final String[][] TEST = {
         //External link.
         {BUG_ID + FS + "pkg" + FS + "C1.html",
-            "HREF=\"http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html?is-external=true#wait(long, int)\""
+            "href=\"http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html?is-external=true#wait(long, int)\""
         },
         //Member summary table link.
         {BUG_ID + FS + "pkg" + FS + "C1.html",
-            "HREF=\"../pkg/C1.html#method(int, int, java.util.ArrayList)\""
+            "href=\"../pkg/C1.html#method(int, int, java.util.ArrayList)\""
         },
         //Anchor test.
         {BUG_ID + FS + "pkg" + FS + "C1.html",
-            "<A NAME=\"method(int, int, java.util.ArrayList)\"><!-- --></A>"
+            "<a name=\"method(int, int, java.util.ArrayList)\">" + NL +
+            "<!--   -->" + NL +
+            "</a>"
         },
         //Backward compatibility anchor test.
         {BUG_ID + FS + "pkg" + FS + "C1.html",
-            "<A NAME=\"method(int, int, java.util.ArrayList)\"><!-- --></A>"
+            "<a name=\"method(int, int, java.util.ArrayList)\">" + NL +
+            "<!--   -->" + NL +
+            "</a>"
         },
         //{@link} test.
         {BUG_ID + FS + "pkg" + FS + "C2.html",
-            "Link: <A HREF=\"../pkg/C1.html#method(int, int, java.util.ArrayList)\">"
+            "Link: <a href=\"../pkg/C1.html#method(int, int, java.util.ArrayList)\">"
         },
         //@see test.
         {BUG_ID + FS + "pkg" + FS + "C2.html",
-            "See Also:</STRONG></DT><DD><A HREF=\"../pkg/C1.html#method(int, int, java.util.ArrayList)\">"
+            "See Also:</span></dt><dd><a href=\"../pkg/C1.html#method(int, int, java.util.ArrayList)\">"
         },
 
         //Header does not link to the page itself.
         {BUG_ID + FS + "pkg" + FS + "C4.html",
-            "Class C4&lt;E extends C4&lt;E&gt;&gt;</H2>"
+            "Class C4&lt;E extends C4&lt;E&gt;&gt;</h2>"
         },
 
         //Signature does not link to the page itself.
         {BUG_ID + FS + "pkg" + FS + "C4.html",
-            "public abstract class <STRONG>C4&lt;E extends C4&lt;E&gt;&gt;</STRONG>"
+            "public abstract class <strong>C4&lt;E extends C4&lt;E&gt;&gt;</strong>"
         },
     };
     private static final String[][] NEGATED_TEST =
--- a/langtools/test/com/sun/javadoc/testHtmlDefinitionListTag/TestHtmlDefinitionListTag.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/test/com/sun/javadoc/testHtmlDefinitionListTag/TestHtmlDefinitionListTag.java	Mon Dec 20 21:10:57 2010 -0800
@@ -43,152 +43,77 @@
     // Optional Element should print properly nested definition list tags
     // for default value.
     private static final String[][] TEST_ALL = {
-        {BUG_ID + FS + "pkg1" + FS + "C1.html", "<PRE>public class " +
-                 "<STRONG>C1</STRONG>" + NL + "extends " +
-                 "java.lang.Object" + NL + "implements " +
-                 "java.io.Serializable</PRE>"},
-        {BUG_ID + FS + "pkg1" + FS + "C4.html", "<DL>" + NL + "<DD><DL>" + NL +
-                 "<DT><STRONG>Default:</STRONG></DT><DD>true</DD>" + NL +
-                 "</DL>" + NL + "</DD>" + NL + "</DL>"}};
+        {BUG_ID + FS + "pkg1" + FS + "C1.html", "<pre>public class <strong>C1</strong>" + NL +
+                 "extends java.lang.Object" + NL + "implements java.io.Serializable</pre>"},
+        {BUG_ID + FS + "pkg1" + FS + "C4.html", "<dl>" + NL +
+                 "<dt>Default:</dt>" + NL + "<dd>true</dd>" + NL +
+                 "</dl>"}};
 
     // Test for normal run of javadoc in which various ClassDocs and
     // 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>" +
-                 "<A HREF=\"../pkg1/C2.html\" title=\"class in pkg1\">" +
-                 "<CODE>C2</CODE></A>, " + NL +
-                 "<A HREF=\"../serialized-form.html#pkg1.C1\">" +
-                 "Serialized Form</A></DD></DL>"},
-        {BUG_ID + FS + "pkg1" + FS + "C1.html", "<DL>" + NL +
-                 "<DD><STRONG>Deprecated.</STRONG>&nbsp;<I>As of JDK version" +
-                 " 1.5, replaced by" + NL +
-                 " <A HREF=\"../pkg1/C1.html#setUndecorated(boolean)\">" +
-                 "<CODE>setUndecorated(boolean)</CODE></A>.</I></DD>" +
-                 "<DD>This field indicates whether the C1 is undecorated." + NL +
-                 "<P>" + NL + "</DD>" + NL + "<DD><DL>" + NL + "<DT><STRONG>" +
-                 "Since:</STRONG></DT>" + NL + "  <DD>1.4</DD>" + NL + "<DT>" +
-                 "<STRONG>See Also:</STRONG></DT><DD>" +
-                 "<A HREF=\"../pkg1/C1.html#setUndecorated(boolean)\"><CODE>" +
-                 "setUndecorated(boolean)</CODE></A></DD></DL>" + NL +"</DD>" + NL +
-                 "</DL>"},
-        {BUG_ID + FS + "pkg1" + FS + "C1.html", "<DL>" + NL +
-                 "<DD>Constructor." + NL + "<P>" + NL + "</DD>" + NL +
-                 "<DD><DL>" + NL + "<DT><STRONG>Parameters:</STRONG></DT><DD>" +
-                 "<CODE>title</CODE> - the title</DD><DD><CODE>test</CODE>" +
-                 " - boolean value</DD>" + NL + "<DT><STRONG>Throws:</STRONG></DT>" + NL +
-                 "<DD><CODE>java.lang.IllegalArgumentException</CODE>" +
-                 " - if the <code>owner</code>'s" + NL + "     <code>GraphicsConfiguration" +
-                 "</code> is not from a screen device</DD>" + NL +"<DD><CODE>" +
-                 "HeadlessException</CODE></DD></DL>" + NL + "</DD>" + NL +
-                 "</DL>"},
-        {BUG_ID + FS + "pkg1" + FS + "C1.html", "<DL>" + NL +
-                 "<DD>Method comments." + NL + "<P>" + NL +
-                 "</DD>" + NL + "<DD><DL>" + NL + "<DT><STRONG>Parameters:" +
-                 "</STRONG></DT><DD><CODE>undecorated</CODE> - <code>true</code>" +
-                 " if no decorations are" + NL + "         to be enabled;" + NL +
-                 "         <code>false</code> if decorations are to be enabled." +
-                 "</DD><DT><STRONG>Since:</STRONG></DT>" + NL +
-                 "  <DD>1.4</DD>" + NL + "<DT><STRONG>See Also:</STRONG></DT>" +
-                 "<DD><A HREF=\"../pkg1/C1.html#readObject()\"><CODE>" +
-                 "readObject()</CODE></A></DD></DL>" + NL + "</DD>" + NL +
-                 "</DL>"},
-        {BUG_ID + FS + "pkg1" + FS + "C1.html", "<DL>" + NL + "<DD><DL>" + NL +
-                 "<DT><STRONG>Throws:</STRONG></DT>" + NL + "<DD><CODE>" +
-                 "java.io.IOException</CODE></DD><DT><STRONG>See Also:" +
-                 "</STRONG></DT><DD>" +
-                 "<A HREF=\"../pkg1/C1.html#setUndecorated(boolean)\">" +
-                 "<CODE>setUndecorated(boolean)</CODE></A></DD></DL>" + NL +
-                 "</DD>" + NL + "</DL>"},
-        {BUG_ID + FS + "pkg1" + FS + "C1.ModalExclusionType.html", "<DL>" + NL +
-                 "<DD>No modal exclusion." + NL + "<P>" + NL +"</DD>" + NL +
-                 "</DL>"},
-        {BUG_ID + FS + "pkg1" + FS + "C2.html", "<DL>" + NL + "<DD>Constructor." + NL +
-                 "<P>" + NL +"</DD>" + NL + "</DL>"},
-        {BUG_ID + FS + "pkg1" + FS + "C2.html", "<DL>" + NL + "<DD><STRONG>" +
-                 "Deprecated.</STRONG>&nbsp;<I>As of JDK version 1.5, replaced " +
-                 "by" + NL + " <A HREF=\"../pkg1/C1.html#setUndecorated(boolean)\">" +
-                 "<CODE>setUndecorated(boolean)</CODE></A>.</I>" + NL + "<P>" + NL +
-                 "</DD><DD>Set visible." + NL + "<P>" + NL + "</DD>" +NL +
-                 "<DD><DL>" + NL + "<DT><STRONG>Parameters:</STRONG></DT><DD>" +
-                 "<CODE>set</CODE> - boolean</DD><DT><STRONG>Since:</STRONG></DT>" + NL +
-                 "  <DD>1.4</DD></DL>" + NL + "</DD>" + NL + "</DL>"},
-        {BUG_ID + FS + "pkg1" + FS + "C3.html", "<DL>" + NL + "<DD>Comment." + NL +
-                 "<P>" + NL + "</DD>" + NL + "</DL>"},
-        {BUG_ID + FS + "serialized-form.html", "<DL>" + NL + "<DD><DL>" + NL +
-                 "<DT><STRONG>Throws:</STRONG></DT>" + NL + "<DD><CODE>" +
-                 "java.io.IOException</CODE></DD><DT><STRONG>See Also:</STRONG>" +
-                 "</DT><DD><A HREF=\"pkg1/C1.html#setUndecorated(boolean)\">" +
-                 "<CODE>C1.setUndecorated(boolean)</CODE></A></DD></DL>" + NL +
-                 "</DD>" + NL + "</DL>"},
-        {BUG_ID + FS + "serialized-form.html", "<DL>" + NL +
-                 "<DD><STRONG>Deprecated.</STRONG>&nbsp;<I>As of JDK version " +
-                 "1.5, replaced by" + NL +
-                 " <A HREF=\"pkg1/C1.html#setUndecorated(boolean)\">" +
-                 "<CODE>setUndecorated(boolean)</CODE></A>.</I></DD>" +
-                 "<DD>This field indicates whether the C1 is undecorated." + NL +
-                 "<P>" + NL + "</DD>" + NL + "<DD>&nbsp;</DD>" + NL +
-                 "<DD><DL>" + NL + "<DT><STRONG>Since:</STRONG></DT>" + NL +
-                 "  <DD>1.4</DD>" + NL + "<DT><STRONG>See Also:</STRONG>" +
-                 "</DT><DD><A HREF=\"pkg1/C1.html#setUndecorated(boolean)\">" +
-                 "<CODE>C1.setUndecorated(boolean)</CODE></A></DD></DL>" + NL +
-                 "</DD>" + NL + "</DL>"},
-        {BUG_ID + FS + "serialized-form.html", "<DL>" + NL +
-                 "<DD><STRONG>Deprecated.</STRONG>&nbsp;<I>As of JDK version" +
-                 " 1.5, replaced by" + NL +
-                 " <A HREF=\"pkg1/C1.html#setUndecorated(boolean)\">" +
-                 "<CODE>setUndecorated(boolean)</CODE></A>.</I>" + NL + "<P>" + NL +
-                 "</DD><DD>Reads the object stream." + NL + "<P>" + NL +
-                 "</DD>" + NL + "<DD><DL>" + NL + "<DT><STRONG>Throws:" +
-                 "</STRONG></DT>" + NL + "<DD><CODE><code>" +
-                 "IOException</code></CODE></DD>" + NL +
-                 "<DD><CODE>java.io.IOException</CODE></DD></DL>" + NL +
-                 "</DD>" + NL + "</DL>"},
-        {BUG_ID + FS + "serialized-form.html", "<DL>" + NL +
-                 "<DD><STRONG>Deprecated.</STRONG>&nbsp;</DD><DD>" +
-                 "The name for this class." + NL + "<P>" + NL + "</DD>" + NL +
-                 "<DD>&nbsp;</DD>" + NL + "</DL>"}};
-
-    // Test with -nocomment option. The ClassDocs and serialized form should
-    // have properly nested definition list tags enclosing deprecated
-    // information and should not display definition lists for comments
-    // and tags.
-    private static final String[][] TEST_NOCMNT = {
-        {BUG_ID + FS + "pkg1" + FS + "C1.html", "<DL>" + NL + "<DD><STRONG>" +
-                 "Deprecated.</STRONG>&nbsp;<I>As of JDK version 1.5, replaced by" + NL +
-                 " <A HREF=\"../pkg1/C1.html#setUndecorated(boolean)\"><CODE>" +
-                 "setUndecorated(boolean)</CODE></A>.</I></DD></DL>"},
-        {BUG_ID + FS + "pkg1" + FS + "C2.html", "<DL>" + NL +
-                 "<DD><STRONG>Deprecated.</STRONG>&nbsp;<I>As of JDK version" +
-                 " 1.5, replaced by" + NL +
-                 " <A HREF=\"../pkg1/C1.html#setUndecorated(boolean)\">" +
-                 "<CODE>setUndecorated(boolean)</CODE></A>.</I>" + NL + "<P>" + NL +
-                 "</DD></DL>"},
-        {BUG_ID + FS + "pkg1" + FS + "C5.html", "<PRE>" + NL +
-                 "protected <STRONG>C5</STRONG>()</PRE>" + NL + "<DL>" + NL +
-                 "<DD><STRONG>Deprecated.</STRONG>&nbsp;</DD></DL>"},
-        {BUG_ID + FS + "pkg1" + FS + "C5.html", "<PRE>" + NL +
-                 "public void <STRONG>printInfo</STRONG>()</PRE>" + NL + "<DL>" + NL +
-                 "<DD><STRONG>Deprecated.</STRONG>&nbsp;</DD></DL>"},
-        {BUG_ID + FS + "serialized-form.html", "<PRE>" + NL + "boolean <STRONG>" +
-                 "undecorated</STRONG></PRE>" + NL + "<DL>" + NL + "<DD><STRONG>" +
-                 "Deprecated.</STRONG>&nbsp;<I>As of JDK version 1.5, replaced by" + NL +
-                 " <A HREF=\"pkg1/C1.html#setUndecorated(boolean)\"><CODE>" +
-                 "setUndecorated(boolean)</CODE></A>.</I></DD></DL>"},
-        {BUG_ID + FS + "serialized-form.html", "<DL>" + NL + "<DD><STRONG>" +
-                 "Deprecated.</STRONG>&nbsp;<I>As of JDK version" +
-                 " 1.5, replaced by" + NL +
-                 " <A HREF=\"pkg1/C1.html#setUndecorated(boolean)\">" +
-                 "<CODE>setUndecorated(boolean)</CODE></A>.</I>" + NL + "<P>" + NL +
-                 "</DD></DL>"},
-        {BUG_ID + FS + "serialized-form.html", "<PRE>" + NL + "int <STRONG>" +
-                 "publicKey</STRONG></PRE>" + NL + "<DL>" + NL + "<DD><STRONG>" +
-                 "Deprecated.</STRONG>&nbsp;</DD></DL>"}};
+        {BUG_ID + FS + "pkg1" + FS + "package-summary.html", "<dl>" +
+                 "<dt><span class=\"strong\">Since:</span></dt>" + NL +
+                 "  <dd>JDK1.0</dd></dl>"},
+        {BUG_ID + FS + "pkg1" + FS + "C1.html", "<dl><dt><span class=\"strong\">Since:</span></dt>" + NL +
+                 "  <dd>JDK1.0</dd>" + NL + "<dt><span class=\"strong\">See Also:</span></dt>" +
+                 "<dd><a href=\"../pkg1/C2.html\" title=\"class in pkg1\"><code>" +
+                 "C2</code></a>, " + NL + "<a href=\"../serialized-form.html#pkg1.C1\">" +
+                 "Serialized Form</a></dd></dl>"},
+        {BUG_ID + FS + "pkg1" + FS + "C1.html", "<dl><dt><span class=\"strong\">Since:</span></dt>" + NL +
+                 "  <dd>1.4</dd>" + NL +
+                 "<dt><span class=\"strong\">See Also:</span></dt><dd>" +
+                 "<a href=\"../pkg1/C1.html#setUndecorated(boolean)\">" +
+                 "<code>setUndecorated(boolean)</code></a></dd></dl>"},
+        {BUG_ID + FS + "pkg1" + FS + "C1.html", "<dl><dt><span class=\"strong\">Parameters:</span></dt><dd><code>title" +
+                 "</code> - the title</dd><dd><code>test</code> - boolean value" +
+                 "</dd>" + NL + "<dt><span class=\"strong\">Throws:</span></dt>" + NL +
+                 "<dd><code>java.lang.IllegalArgumentException</code> - if the " +
+                 "<code>owner</code>'s" + NL +
+                 "     <code>GraphicsConfiguration</code> is not from a screen " +
+                 "device</dd>" + NL + "<dd><code>HeadlessException</code></dd></dl>"},
+        {BUG_ID + FS + "pkg1" + FS + "C1.html", "<dl><dt><span class=\"strong\">Parameters:</span></dt><dd><code>undecorated" +
+                 "</code> - <code>true</code> if no decorations are" + NL +
+                 "         to be enabled;" + NL + "         <code>false</code> " +
+                 "if decorations are to be enabled.</dd><dt><span class=\"strong\">Since:" +
+                 "</span></dt>" + NL + "  <dd>1.4</dd>" + NL +
+                 "<dt><span class=\"strong\">See Also:</span></dt><dd>" +
+                 "<a href=\"../pkg1/C1.html#readObject()\"><code>readObject()" +
+                 "</code></a></dd></dl>"},
+        {BUG_ID + FS + "pkg1" + FS + "C1.html", "<dl><dt><span class=\"strong\">Throws:</span></dt>" + NL +
+                 "<dd><code>java.io.IOException</code></dd><dt><span class=\"strong\">See Also:" +
+                 "</span></dt><dd><a href=\"../pkg1/C1.html#setUndecorated(boolean)\">" +
+                 "<code>setUndecorated(boolean)</code></a></dd></dl>"},
+        {BUG_ID + FS + "pkg1" + FS + "C2.html", "<dl><dt><span class=\"strong\">Parameters:" +
+                 "</span></dt><dd><code>set</code> - boolean</dd><dt><span class=\"strong\">" +
+                 "Since:</span></dt>" + NL + "  <dd>1.4</dd></dl>"},
+        {BUG_ID + FS + "serialized-form.html", "<dl><dt><span class=\"strong\">Throws:</span>" +
+                 "</dt>" + NL + "<dd><code>" +
+                 "java.io.IOException</code></dd><dt><span class=\"strong\">See Also:</span>" +
+                 "</dt><dd><a href=\"pkg1/C1.html#setUndecorated(boolean)\">" +
+                 "<code>C1.setUndecorated(boolean)</code></a></dd></dl>"},
+        {BUG_ID + FS + "serialized-form.html", "<span class=\"strong\">Deprecated.</span>" +
+                 "&nbsp;<i>As of JDK version 1.5, replaced by" + NL +
+                 " <a href=\"pkg1/C1.html#setUndecorated(boolean)\">" +
+                 "<code>setUndecorated(boolean)</code></a>.</i></div>" + NL +
+                 "<div class=\"block\">This field indicates whether the C1 is " +
+                 "undecorated.</div>" + NL + "&nbsp;" + NL + "<dl><dt><span class=\"strong\">Since:</span></dt>" + NL +
+                 "  <dd>1.4</dd>" + NL + "<dt><span class=\"strong\">See Also:</span>" +
+                 "</dt><dd><a href=\"pkg1/C1.html#setUndecorated(boolean)\">" +
+                 "<code>C1.setUndecorated(boolean)</code></a></dd></dl>"},
+        {BUG_ID + FS + "serialized-form.html", "<span class=\"strong\">Deprecated.</span>" +
+                 "&nbsp;<i>As of JDK version 1.5, replaced by" + NL +
+                 " <a href=\"pkg1/C1.html#setUndecorated(boolean)\">" +
+                 "<code>setUndecorated(boolean)</code></a>.</i></div>" + NL +
+                 "<div class=\"block\">Reads the object stream.</div>" + NL +
+                 "<dl><dt><span class=\"strong\">Throws:" +
+                 "</span></dt>" + NL + "<dd><code><code>" +
+                 "IOException</code></code></dd>" + NL +
+                 "<dd><code>java.io.IOException</code></dd></dl>"},
+        {BUG_ID + FS + "serialized-form.html", "<span class=\"strong\">Deprecated.</span>" +
+                 "&nbsp;</div>" + NL +
+                 "<div class=\"block\">The name for this class.</div>"}};
 
     // Test with -nodeprecated option. The ClassDocs should have properly nested
     // definition list tags enclosing comments and tags. The ClassDocs should not
@@ -196,138 +121,104 @@
     // 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>" +
-                 "<A HREF=\"../pkg1/C2.html\" title=\"class in pkg1\">" +
-                 "<CODE>C2</CODE></A>, " + NL +
-                 "<A HREF=\"../serialized-form.html#pkg1.C1\">" +
-                 "Serialized Form</A></DD></DL>"},
-        {BUG_ID + FS + "pkg1" + FS + "C1.html", "<DL>" + NL +
-                 "<DD>Constructor." + NL + "<P>" + NL + "</DD>" + NL +
-                 "<DD><DL>" + NL + "<DT><STRONG>Parameters:</STRONG></DT><DD>" +
-                 "<CODE>title</CODE> - the title</DD><DD><CODE>test</CODE>" +
-                 " - boolean value</DD>" + NL + "<DT><STRONG>Throws:</STRONG></DT>" + NL +
-                 "<DD><CODE>java.lang.IllegalArgumentException</CODE>" +
-                 " - if the <code>owner</code>'s" + NL + "     <code>GraphicsConfiguration" +
-                 "</code> is not from a screen device</DD>" + NL +"<DD><CODE>" +
-                 "HeadlessException</CODE></DD></DL>" + NL + "</DD>" + NL +
-                 "</DL>"},
-        {BUG_ID + FS + "pkg1" + FS + "C1.html", "<DL>" + NL +
-                 "<DD>Method comments." + NL + "<P>" + NL +
-                 "</DD>" + NL + "<DD><DL>" + NL + "<DT><STRONG>Parameters:" +
-                 "</STRONG></DT><DD><CODE>undecorated</CODE> - <code>true</code>" +
+        {BUG_ID + FS + "pkg1" + FS + "package-summary.html", "<dl>" +
+                 "<dt><span class=\"strong\">Since:</span></dt>" + NL +
+                 "  <dd>JDK1.0</dd></dl>"},
+        {BUG_ID + FS + "pkg1" + FS + "C1.html", "<dl><dt><span class=\"strong\">Since:</span>" +
+                 "</dt>" + NL + "  <dd>JDK1.0</dd>" + NL + "<dt><span class=\"strong\">See Also:" +
+                 "</span></dt><dd><a href=\"../pkg1/C2.html\" title=\"class in pkg1\">" +
+                 "<code>C2</code></a>, " + NL + "<a href=\"../serialized-form.html#pkg1.C1\">" +
+                 "Serialized Form</a></dd></dl>"},
+        {BUG_ID + FS + "pkg1" + FS + "C1.html", "<dl><dt><span class=\"strong\">Parameters:" +
+                 "</span></dt><dd><code>title</code> - the title</dd><dd><code>" +
+                 "test</code> - boolean value</dd>" + NL + "<dt><span class=\"strong\">Throws:" +
+                 "</span></dt>" + NL + "<dd><code>java.lang.IllegalArgumentException" +
+                 "</code> - if the <code>owner</code>'s" + NL + "     <code>GraphicsConfiguration" +
+                 "</code> is not from a screen device</dd>" + NL + "<dd><code>" +
+                 "HeadlessException</code></dd></dl>"},
+        {BUG_ID + FS + "pkg1" + FS + "C1.html", "<dl><dt><span class=\"strong\">Parameters:" +
+                 "</span></dt><dd><code>undecorated</code> - <code>true</code>" +
                  " if no decorations are" + NL + "         to be enabled;" + NL +
                  "         <code>false</code> if decorations are to be enabled." +
-                 "</DD><DT><STRONG>Since:</STRONG></DT>" + NL +
-                 "  <DD>1.4</DD>" + NL + "<DT><STRONG>See Also:</STRONG></DT>" +
-                 "<DD><A HREF=\"../pkg1/C1.html#readObject()\"><CODE>" +
-                 "readObject()</CODE></A></DD></DL>" + NL + "</DD>" + NL +
-                 "</DL>"},
-        {BUG_ID + FS + "pkg1" + FS + "C1.html", "<DL>" + NL + "<DD><DL>" + NL +
-                 "<DT><STRONG>Throws:</STRONG></DT>" + NL + "<DD><CODE>" +
-                 "java.io.IOException</CODE></DD><DT><STRONG>See Also:" +
-                 "</STRONG></DT><DD>" +
-                 "<A HREF=\"../pkg1/C1.html#setUndecorated(boolean)\">" +
-                 "<CODE>setUndecorated(boolean)</CODE></A></DD></DL>" + NL +
-                 "</DD>" + NL + "</DL>"},
-        {BUG_ID + FS + "pkg1" + FS + "C1.ModalExclusionType.html", "<DL>" + NL +
-                 "<DD>No modal exclusion." + NL + "<P>" + NL +"</DD>" + NL +
-                 "</DL>"},
-        {BUG_ID + FS + "pkg1" + FS + "C2.html", "<DL>" + NL + "<DD>Constructor." + NL +
-                 "<P>" + NL +"</DD>" + NL + "</DL>"},
-        {BUG_ID + FS + "pkg1" + FS + "C3.html", "<DL>" + NL + "<DD>Comment." + NL +
-                 "<P>" + NL + "</DD>" + NL + "</DL>"},
-        {BUG_ID + FS + "serialized-form.html", "<DL>" + NL + "<DD><DL>" + NL +
-                 "<DT><STRONG>Throws:</STRONG></DT>" + NL + "<DD><CODE>" +
-                 "java.io.IOException</CODE></DD><DT><STRONG>See Also:</STRONG>" +
-                 "</DT><DD><A HREF=\"pkg1/C1.html#setUndecorated(boolean)\">" +
-                 "<CODE>C1.setUndecorated(boolean)</CODE></A></DD></DL>" + NL +
-                 "</DD>" + NL + "</DL>"},
-        {BUG_ID + FS + "serialized-form.html", "<DL>" + NL +
-                 "<DD><STRONG>Deprecated.</STRONG>&nbsp;<I>As of JDK version " +
-                 "1.5, replaced by" + NL +
-                 " <A HREF=\"pkg1/C1.html#setUndecorated(boolean)\">" +
-                 "<CODE>setUndecorated(boolean)</CODE></A>.</I></DD>" +
-                 "<DD>This field indicates whether the C1 is undecorated." + NL +
-                 "<P>" + NL + "</DD>" + NL + "<DD>&nbsp;</DD>" + NL +
-                 "<DD><DL>" + NL + "<DT><STRONG>Since:</STRONG></DT>" + NL +
-                 "  <DD>1.4</DD>" + NL + "<DT><STRONG>See Also:</STRONG>" +
-                 "</DT><DD><A HREF=\"pkg1/C1.html#setUndecorated(boolean)\">" +
-                 "<CODE>C1.setUndecorated(boolean)</CODE></A></DD></DL>" + NL +
-                 "</DD>" + NL + "</DL>"},
-        {BUG_ID + FS + "serialized-form.html", "<DL>" + NL +
-                 "<DD><STRONG>Deprecated.</STRONG>&nbsp;<I>As of JDK version" +
-                 " 1.5, replaced by" + NL +
-                 " <A HREF=\"pkg1/C1.html#setUndecorated(boolean)\">" +
-                 "<CODE>setUndecorated(boolean)</CODE></A>.</I>" + NL + "<P>" + NL +
-                 "</DD><DD>Reads the object stream." + NL + "<P>" + NL +
-                 "</DD>" + NL + "<DD><DL>" + NL + "<DT><STRONG>Throws:" +
-                 "</STRONG></DT>" + NL + "<DD><CODE><code>" +
-                 "IOException</code></CODE></DD>" + NL +
-                 "<DD><CODE>java.io.IOException</CODE></DD></DL>" + NL +
-                 "</DD>" + NL + "</DL>"},
-        {BUG_ID + FS + "serialized-form.html", "<DL>" + NL +
-                 "<DD><STRONG>Deprecated.</STRONG>&nbsp;</DD><DD>" +
-                 "The name for this class." + NL + "<P>" + NL + "</DD>" + NL +
-                 "<DD>&nbsp;</DD>" + NL + "</DL>"}};
+                 "</dd><dt><span class=\"strong\">Since:</span></dt>" + NL + "  <dd>1.4</dd>" + NL +
+                 "<dt><span class=\"strong\">See Also:</span></dt><dd><a href=\"../pkg1/C1.html#readObject()\">" +
+                 "<code>readObject()</code></a></dd></dl>"},
+        {BUG_ID + FS + "pkg1" + FS + "C1.html", "<dl><dt><span class=\"strong\">Throws:</span>" +
+                 "</dt>" + NL + "<dd><code>java.io.IOException</code></dd><dt>" +
+                 "<span class=\"strong\">See Also:</span></dt><dd><a href=\"../pkg1/C1.html#setUndecorated(boolean)\">" +
+                 "<code>setUndecorated(boolean)</code></a></dd></dl>"},
+        {BUG_ID + FS + "serialized-form.html", "<dl><dt><span class=\"strong\">Throws:</span>" +
+                 "</dt>" + NL + "<dd><code>" +
+                 "java.io.IOException</code></dd><dt><span class=\"strong\">See Also:</span>" +
+                 "</dt><dd><a href=\"pkg1/C1.html#setUndecorated(boolean)\">" +
+                 "<code>C1.setUndecorated(boolean)</code></a></dd></dl>"},
+        {BUG_ID + FS + "serialized-form.html", "<span class=\"strong\">Deprecated.</span>" +
+                 "&nbsp;<i>As of JDK version 1.5, replaced by" + NL +
+                 " <a href=\"pkg1/C1.html#setUndecorated(boolean)\">" +
+                 "<code>setUndecorated(boolean)</code></a>.</i></div>" + NL +
+                 "<div class=\"block\">This field indicates whether the C1 is " +
+                 "undecorated.</div>" + NL + "&nbsp;" + NL + "<dl><dt><span class=\"strong\">Since:</span></dt>" + NL +
+                 "  <dd>1.4</dd>" + NL + "<dt><span class=\"strong\">See Also:</span>" +
+                 "</dt><dd><a href=\"pkg1/C1.html#setUndecorated(boolean)\">" +
+                 "<code>C1.setUndecorated(boolean)</code></a></dd></dl>"},
+        {BUG_ID + FS + "serialized-form.html", "<span class=\"strong\">Deprecated.</span>" +
+                 "&nbsp;<i>As of JDK version 1.5, replaced by" + NL +
+                 " <a href=\"pkg1/C1.html#setUndecorated(boolean)\">" +
+                 "<code>setUndecorated(boolean)</code></a>.</i></div>" + NL +
+                 "<div class=\"block\">Reads the object stream.</div>" + NL +
+                 "<dl><dt><span class=\"strong\">Throws:" +
+                 "</span></dt>" + NL + "<dd><code><code>" +
+                 "IOException</code></code></dd>" + NL +
+                 "<dd><code>java.io.IOException</code></dd></dl>"},
+        {BUG_ID + FS + "serialized-form.html", "<span class=\"strong\">Deprecated.</span>" +
+                 "&nbsp;</div>" + NL + "<div class=\"block\">" +
+                 "The name for this class.</div>"}};
 
     // Test with -nocomment and -nodeprecated options. The ClassDocs whould
-    // not display definition lists for any member details. The serialized
-    // form should display properly nested definition list tags for
-    // deprecated information only.
+    // not display definition lists for any member details.
     private static final String[][] TEST_NOCMNT_NODEPR = {
-        {BUG_ID + FS + "pkg1" + FS + "C1.html", "<PRE>" + NL + "public void " +
-                 "<STRONG>readObject</STRONG>()" + NL + "                throws" +
-                 " java.io.IOException</PRE>" + NL + "<HR>"},
-        {BUG_ID + FS + "pkg1" + FS + "C2.html", "<PRE>" +NL + "public <STRONG>" +
-                 "C2</STRONG>()</PRE>" + NL + "<HR>"},
-        {BUG_ID + FS + "pkg1" + FS + "C1.ModalExclusionType.html", "<PRE>" + NL +
-                 "public static final " +
-                 "<A HREF=\"../pkg1/C1.ModalExclusionType.html\" " +
-                 "title=\"enum in pkg1\">C1.ModalExclusionType</A> <STRONG>" +
-                 "APPLICATION_EXCLUDE</STRONG></PRE>" + NL + "<HR>"},
-        {BUG_ID + FS + "serialized-form.html", "<PRE>" + NL + "boolean <STRONG>" +
-                 "undecorated</STRONG></PRE>" + NL + "<DL>" + NL + "<DD><STRONG>" +
-                 "Deprecated.</STRONG>&nbsp;<I>As of JDK version 1.5, replaced by" + NL +
-                 " <A HREF=\"pkg1/C1.html#setUndecorated(boolean)\"><CODE>" +
-                 "setUndecorated(boolean)</CODE></A>.</I></DD></DL>"},
-        {BUG_ID + FS + "serialized-form.html", "<DL>" + NL + "<DD><STRONG>" +
-                 "Deprecated.</STRONG>&nbsp;<I>As of JDK version" +
+        {BUG_ID + FS + "pkg1" + FS + "C1.html", "<pre>public&nbsp;void&nbsp;readObject()" + NL +
+                 "                throws java.io.IOException</pre>" + NL + "</li>"},
+        {BUG_ID + FS + "pkg1" + FS + "C2.html", "<pre>public&nbsp;C2()</pre>" + NL +
+                 "</li>"},
+        {BUG_ID + FS + "pkg1" + FS + "C1.ModalExclusionType.html", "<pre>public " +
+                 "static final&nbsp;<a href=\"../pkg1/C1.ModalExclusionType.html\" " +
+                 "title=\"enum in pkg1\">C1.ModalExclusionType</a> " +
+                 "APPLICATION_EXCLUDE</pre>" + NL + "</li>"},
+        {BUG_ID + FS + "serialized-form.html", "<pre>boolean " +
+                 "undecorated</pre>" + NL + "<div class=\"block\"><span class=\"strong\">" +
+                 "Deprecated.</span>&nbsp;<i>As of JDK version 1.5, replaced by" + NL +
+                 " <a href=\"pkg1/C1.html#setUndecorated(boolean)\"><code>" +
+                 "setUndecorated(boolean)</code></a>.</i></div>" + NL + "</li>"},
+        {BUG_ID + FS + "serialized-form.html", "<span class=\"strong\">" +
+                 "Deprecated.</span>&nbsp;<i>As of JDK version" +
                  " 1.5, replaced by" + NL +
-                 " <A HREF=\"pkg1/C1.html#setUndecorated(boolean)\">" +
-                 "<CODE>setUndecorated(boolean)</CODE></A>.</I>" + NL + "<P>" + NL +
-                 "</DD></DL>"},
-        {BUG_ID + FS + "serialized-form.html", "<PRE>" + NL + "int <STRONG>" +
-                 "publicKey</STRONG></PRE>" + NL + "<DL>" + NL + "<DD><STRONG>" +
-                 "Deprecated.</STRONG>&nbsp;</DD></DL>"}};
+                 " <a href=\"pkg1/C1.html#setUndecorated(boolean)\">" +
+                 "<code>setUndecorated(boolean)</code></a>.</i></div>" + NL + "</li>"}};
 
     // 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>"},
-        {BUG_ID + FS + "pkg1" + FS + "C1.ModalExclusionType.html", "<DL>" + NL + "</DL>"},
-        {BUG_ID + FS + "pkg1" + FS + "C2.html", "<DL></DL>"},
-        {BUG_ID + FS + "pkg1" + FS + "C2.html", "<DL>" + NL + "</DL>"},
-        {BUG_ID + FS + "pkg1" + FS + "C2.ModalType.html", "<DL></DL>"},
-        {BUG_ID + FS + "pkg1" + FS + "C2.ModalType.html", "<DL>" + NL + "</DL>"},
-        {BUG_ID + FS + "pkg1" + FS + "C3.html", "<DL></DL>"},
-        {BUG_ID + FS + "pkg1" + FS + "C3.html", "<DL>" + NL + "</DL>"},
-        {BUG_ID + FS + "pkg1" + FS + "C4.html", "<DL></DL>"},
-        {BUG_ID + FS + "pkg1" + FS + "C4.html", "<DL>" + NL + "</DL>"},
-        {BUG_ID + FS + "pkg1" + FS + "C5.html", "<DL></DL>"},
-        {BUG_ID + FS + "pkg1" + FS + "C5.html", "<DL>" + NL + "</DL>"},
-        {BUG_ID + FS + "overview-tree.html", "<DL></DL>"},
-        {BUG_ID + FS + "overview-tree.html", "<DL>" + NL + "</DL>"},
-        {BUG_ID + FS + "serialized-form.html", "<DL></DL>"},
-        {BUG_ID + FS + "serialized-form.html", "<DL>" + NL + "</DL>"}};
+        {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>"},
+        {BUG_ID + FS + "pkg1" + FS + "C1.ModalExclusionType.html", "<dl>" + NL + "</dl>"},
+        {BUG_ID + FS + "pkg1" + FS + "C2.html", "<dl></dl>"},
+        {BUG_ID + FS + "pkg1" + FS + "C2.html", "<dl>" + NL + "</dl>"},
+        {BUG_ID + FS + "pkg1" + FS + "C2.ModalType.html", "<dl></dl>"},
+        {BUG_ID + FS + "pkg1" + FS + "C2.ModalType.html", "<dl>" + NL + "</dl>"},
+        {BUG_ID + FS + "pkg1" + FS + "C3.html", "<dl></dl>"},
+        {BUG_ID + FS + "pkg1" + FS + "C3.html", "<dl>" + NL + "</dl>"},
+        {BUG_ID + FS + "pkg1" + FS + "C4.html", "<dl></dl>"},
+        {BUG_ID + FS + "pkg1" + FS + "C4.html", "<dl>" + NL + "</dl>"},
+        {BUG_ID + FS + "pkg1" + FS + "C5.html", "<dl></dl>"},
+        {BUG_ID + FS + "pkg1" + FS + "C5.html", "<dl>" + NL + "</dl>"},
+        {BUG_ID + FS + "overview-tree.html", "<dl></dl>"},
+        {BUG_ID + FS + "overview-tree.html", "<dl>" + NL + "</dl>"},
+        {BUG_ID + FS + "serialized-form.html", "<dl></dl>"},
+        {BUG_ID + FS + "serialized-form.html", "<dl>" + NL + "</dl>"}};
 
     private static final String[] ARGS1 =
         new String[] {
@@ -355,7 +246,7 @@
         run(tester, ARGS1, TEST_ALL, NEGATED_TEST);
         run(tester, ARGS1, TEST_CMNT_DEPR, NEGATED_TEST);
         run(tester, ARGS2, TEST_ALL, NEGATED_TEST);
-        run(tester, ARGS2, TEST_NOCMNT, TEST_CMNT_DEPR);
+        run(tester, ARGS2, NO_TEST, TEST_CMNT_DEPR);
         run(tester, ARGS3, TEST_ALL, NEGATED_TEST);
         run(tester, ARGS3, TEST_NODEPR, TEST_NOCMNT_NODEPR);
         run(tester, ARGS4, TEST_ALL, NEGATED_TEST);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/com/sun/javadoc/testHtmlDocument/TestHtmlDocument.java	Mon Dec 20 21:10:57 2010 -0800
@@ -0,0 +1,160 @@
+/*
+ * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 6851834
+ * @summary This test verifies the HTML document generation for javadoc output.
+ * @author Bhavesh Patel
+ * @build TestHtmlDocument
+ * @run main TestHtmlDocument
+ */
+
+import java.io.*;
+import com.sun.tools.doclets.formats.html.markup.*;
+
+/**
+ * The class reads each file, complete with newlines, into a string to easily
+ * compare the existing markup with the generated markup.
+ */
+public class TestHtmlDocument {
+
+    private static final String BUGID = "6851834";
+    private static final String BUGNAME = "TestHtmlDocument";
+    private static final String FS = System.getProperty("file.separator");
+    private static final String LS = System.getProperty("line.separator");
+    private static String srcdir = System.getProperty("test.src", ".");
+
+    // Entry point
+    public static void main(String[] args) throws IOException {
+        // Check whether the generated markup is same as the existing markup.
+        if (generateHtmlTree().equals(readFileToString(srcdir + FS + "testMarkup.html"))) {
+            System.out.println("\nTest passed for bug " + BUGID + " (" + BUGNAME + ")\n");
+        } else {
+            throw new Error("\nTest failed for bug " + BUGID + " (" + BUGNAME + ")\n");
+        }
+    }
+
+    // Generate the HTML output using the HTML document generation within doclet.
+    public static String generateHtmlTree() {
+        // Document type for the HTML document
+        DocType htmlDocType = DocType.Transitional();
+        HtmlTree html = new HtmlTree(HtmlTag.HTML);
+        HtmlTree head = new HtmlTree(HtmlTag.HEAD);
+        HtmlTree title = new HtmlTree(HtmlTag.TITLE);
+        // String content within the document
+        StringContent titleContent = new StringContent("Markup test");
+        title.addContent(titleContent);
+        head.addContent(title);
+        // Test META tag
+        HtmlTree meta = new HtmlTree(HtmlTag.META);
+        meta.addAttr(HtmlAttr.NAME, "keywords");
+        meta.addAttr(HtmlAttr.CONTENT, "testContent");
+        head.addContent(meta);
+        // Test invalid META tag
+        HtmlTree invmeta = new HtmlTree(HtmlTag.META);
+        head.addContent(invmeta);
+        // Test LINK tag
+        HtmlTree link = new HtmlTree(HtmlTag.LINK);
+        link.addAttr(HtmlAttr.REL, "testRel");
+        link.addAttr(HtmlAttr.HREF, "testLink.html");
+        head.addContent(link);
+        // Test invalid LINK tag
+        HtmlTree invlink = new HtmlTree(HtmlTag.LINK);
+        head.addContent(invlink);
+        html.addContent(head);
+        // Comment within the document
+        Comment bodyMarker = new Comment("======== START OF BODY ========");
+        html.addContent(bodyMarker);
+        HtmlTree body = new HtmlTree(HtmlTag.BODY);
+        Comment pMarker = new Comment("======== START OF PARAGRAPH ========");
+        body.addContent(pMarker);
+        HtmlTree p = new HtmlTree(HtmlTag.P);
+        StringContent bodyContent = new StringContent(
+                "This document is generated from sample source code and HTML " +
+                "files with examples of a wide variety of Java language constructs: packages, " +
+                "subclasses, subinterfaces, nested classes, nested interfaces," +
+                "inheriting from other packages, constructors, fields," +
+                "methods, and so forth. ");
+        p.addContent(bodyContent);
+        StringContent anchorContent = new StringContent("Click Here");
+        p.addContent(HtmlTree.A("testLink.html", anchorContent));
+        StringContent pContent = new StringContent(" to <test> out a link.");
+        p.addContent(pContent);
+        body.addContent(p);
+        HtmlTree p1 = new HtmlTree(HtmlTag.P);
+        // Test another version of A tag.
+        HtmlTree anchor = new HtmlTree(HtmlTag.A);
+        anchor.addAttr(HtmlAttr.HREF, "testLink.html");
+        anchor.addAttr(HtmlAttr.NAME, "Another version of a tag");
+        p1.addContent(anchor);
+        body.addContent(p1);
+        // Test for empty tags.
+        HtmlTree dl = new HtmlTree(HtmlTag.DL);
+        html.addContent(dl);
+        // Test for empty nested tags.
+        HtmlTree dlTree = new HtmlTree(HtmlTag.DL);
+        dlTree.addContent(new HtmlTree(HtmlTag.DT));
+        dlTree.addContent(new HtmlTree (HtmlTag.DD));
+        html.addContent(dlTree);
+        HtmlTree dlDisplay = new HtmlTree(HtmlTag.DL);
+        dlDisplay.addContent(new HtmlTree(HtmlTag.DT));
+        HtmlTree dd = new HtmlTree (HtmlTag.DD);
+        StringContent ddContent = new StringContent("Test DD");
+        dd.addContent(ddContent);
+        dlDisplay.addContent(dd);
+        body.addContent(dlDisplay);
+        StringContent emptyString = new StringContent("");
+        body.addContent(emptyString);
+        Comment emptyComment = new Comment("");
+        body.addContent(emptyComment);
+        HtmlTree hr = new HtmlTree(HtmlTag.HR);
+        body.addContent(hr);
+        html.addContent(body);
+        HtmlDocument htmlDoc = new HtmlDocument(htmlDocType, html);
+        return htmlDoc.toString();
+    }
+
+    // Read the file into a String
+    public static String readFileToString(String filename) throws IOException {
+        File file = new File(filename);
+        if ( !file.exists() ) {
+            System.out.println("\nFILE DOES NOT EXIST: " + filename);
+        }
+        BufferedReader in = new BufferedReader(new FileReader(file));
+        StringBuilder fileString = new StringBuilder();
+        // Create an array of characters the size of the file
+        try {
+            String line;
+            while ((line = in.readLine()) != null) {
+                fileString.append(line);
+                fileString.append(LS);
+            }
+        } finally {
+            in.close();
+        }
+        return fileString.toString();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/com/sun/javadoc/testHtmlDocument/testLink.html	Mon Dec 20 21:10:57 2010 -0800
@@ -0,0 +1,9 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+<title>Markup test</title>
+</head>
+<body>
+This is a test for link.
+</body>
+</html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/com/sun/javadoc/testHtmlDocument/testMarkup.html	Mon Dec 20 21:10:57 2010 -0800
@@ -0,0 +1,18 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+<title>Markup test</title>
+<meta name="keywords" content="testContent">
+<link rel="testRel" href="testLink.html">
+</head>
+<!-- ======== START OF BODY ======== -->
+<body>
+<!-- ======== START OF PARAGRAPH ======== -->
+<p>This document is generated from sample source code and HTML files with examples of a wide variety of Java language constructs: packages, subclasses, subinterfaces, nested classes, nested interfaces,inheriting from other packages, constructors, fields,methods, and so forth. <a href="testLink.html">Click Here</a> to &lt;test&gt; out a link.</p>
+<p><a href="testLink.html" name="Another version of a tag"></a></p>
+<dl>
+<dd>Test DD</dd>
+</dl>
+<hr>
+</body>
+</html>
--- a/langtools/test/com/sun/javadoc/testHtmlStrongTag/TestHtmlStrongTag.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/test/com/sun/javadoc/testHtmlStrongTag/TestHtmlStrongTag.java	Mon Dec 20 21:10:57 2010 -0800
@@ -38,7 +38,7 @@
 
     private static final String BUG_ID = "6786028";
     private static final String[][] TEST1 = {
-        {BUG_ID + FS + "pkg1" + FS + "C1.html", "<STRONG>See Also:</STRONG>"}};
+        {BUG_ID + FS + "pkg1" + FS + "C1.html", "<span class=\"strong\">See Also:</span>"}};
     private static final String[][] NEGATED_TEST1 = {
         {BUG_ID + FS + "pkg1" + FS + "C1.html", "<STRONG>Method Summary</STRONG>"},
         {BUG_ID + FS + "pkg1" + FS + "C1.html", "<B>"},
--- a/langtools/test/com/sun/javadoc/testHtmlTableTags/TestHtmlTableTags.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/test/com/sun/javadoc/testHtmlTableTags/TestHtmlTableTags.java	Mon Dec 20 21:10:57 2010 -0800
@@ -50,139 +50,128 @@
 
         //Package summary
         {BUG_ID + FS + "pkg1" + FS + "package-summary.html",
-            "<TABLE BORDER=\"1\" WIDTH=\"100%\" CELLPADDING=\"3\" " +
-            "CELLSPACING=\"0\" SUMMARY=\"Class Summary table, " +
+            "<table class=\"packageSummary\" border=\"0\" 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, " +
+            "<table class=\"packageSummary\" border=\"0\" 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, " +
+            "<table class=\"packageSummary\" border=\"0\" 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, " +
+            "<table class=\"packageSummary\" border=\"0\" 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\">"
+            "<table class=\"overviewSummary\" border=\"0\" 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\">"
+            "<table class=\"overviewSummary\" border=\"0\" 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\">"
+            "<table class=\"overviewSummary\" border=\"0\" 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\">"
+            "<table class=\"overviewSummary\" border=\"0\" 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\">"
+            "<table class=\"overviewSummary\" border=\"0\" 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, " +
+            "<table class=\"overviewSummary\" border=\"0\" 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, " +
+            "<table class=\"overviewSummary\" border=\"0\" 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\">"
+            "<table border=\"0\" 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\">"
+            "<table border=\"0\" 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\">"
+            "<table border=\"0\" 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\">"
+            "<table border=\"0\" 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\">"
+            "<table border=\"0\" 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\">"
+            "<table border=\"0\" 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\">"
+            "<table border=\"0\" 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\">"
+            "<table border=\"0\" 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\">"
+            "<table border=\"0\" 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\">"
+            "<table border=\"0\" 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\">"
+            "<table border=\"0\" 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\">"
+            "<table border=\"0\" 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\">"
+            "<table border=\"0\" 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 " +
+            "<table border=\"0\" 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, " +
+            "<table class=\"overviewSummary\" border=\"0\" cellpadding=\"3\" " +
+            "cellspacing=\"0\" summary=\"Packages table, " +
             "listing packages, and an explanation\">"
         },
 
@@ -192,125 +181,117 @@
 
         //Package summary
         {BUG_ID + FS + "pkg1" + FS + "package-summary.html",
-            "<CAPTION CLASS=\"TableCaption\">" + NL +
-            "Class Summary</CAPTION>"
+            "<caption><span>Class Summary</span><span class=\"tabEnd\">" +
+            "&nbsp;</span></caption>"
         },
         {BUG_ID + FS + "pkg1" + FS + "package-summary.html",
-            "<CAPTION CLASS=\"TableCaption\">" + NL +
-            "Interface Summary</CAPTION>"
+            "<caption><span>Interface Summary</span><span class=\"tabEnd\">" +
+            "&nbsp;</span></caption>"
         },
         {BUG_ID + FS + "pkg2" + FS + "package-summary.html",
-            "<CAPTION CLASS=\"TableCaption\">" + NL +
-            "Enum Summary</CAPTION>"
+            "<caption><span>Enum Summary</span><span class=\"tabEnd\">" +
+            "&nbsp;</span></caption>"
         },
         {BUG_ID + FS + "pkg2" + FS + "package-summary.html",
-            "<CAPTION CLASS=\"TableCaption\">" + NL +
-            "Annotation Types Summary</CAPTION>"
+            "<caption><span>Annotation Types Summary</span><span class=\"tabEnd\">" +
+            "&nbsp;</span></caption>"
         },
         // Class documentation
         {BUG_ID + FS + "pkg1" + FS + "C1.html",
-            "<CAPTION CLASS=\"TableCaption\">" + NL +
-            "Field Summary</CAPTION>"
+            "<caption><span>Fields</span><span class=\"tabEnd\">&nbsp;</span></caption>"
         },
         {BUG_ID + FS + "pkg1" + FS + "C1.html",
-            "<CAPTION CLASS=\"TableCaption\">" + NL +
-            "Method Summary</CAPTION>"
+            "<caption><span>Methods</span><span class=\"tabEnd\">&nbsp;</span></caption>"
         },
         {BUG_ID + FS + "pkg2" + FS + "C2.html",
-            "<CAPTION CLASS=\"TableCaption\">" + NL +
-            "Nested Class Summary</CAPTION>"
+            "<caption><span>Nested Classes</span><span class=\"tabEnd\">&nbsp;</span></caption>"
         },
         {BUG_ID + FS + "pkg2" + FS + "C2.html",
-            "<CAPTION CLASS=\"TableCaption\">" + NL +
-            "Constructor Summary</CAPTION>"
+            "<caption><span>Constructors</span><span class=\"tabEnd\">&nbsp;</span></caption>"
         },
         {BUG_ID + FS + "pkg2" + FS + "C2.ModalExclusionType.html",
-            "<CAPTION CLASS=\"TableCaption\">" + NL +
-            "Enum Constant Summary</CAPTION>"
+            "<caption><span>Enum Constants</span><span class=\"tabEnd\">&nbsp;</span></caption>"
         },
         {BUG_ID + FS + "pkg2" + FS + "C3.html",
-            "<CAPTION CLASS=\"TableCaption\">" + NL +
-            "Required Element Summary</CAPTION>"
+            "<caption><span>Required Elements</span><span class=\"tabEnd\">&nbsp;" +
+            "</span></caption>"
         },
         {BUG_ID + FS + "pkg2" + FS + "C4.html",
-            "<CAPTION CLASS=\"TableCaption\">" + NL +
-            "Optional Element Summary</CAPTION>"
+            "<caption><span>Optional Elements</span><span class=\"tabEnd\">&nbsp;" +
+            "</span></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>"
+            "<caption><span>Packages that use <a href=\"../../pkg1/I1.html\" " +
+            "title=\"interface in pkg1\">I1</a></span><span class=\"tabEnd\">" +
+            "&nbsp;</span></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>"
+            "<caption><span>Fields in <a href=\"../../pkg2/package-summary.html\">" +
+            "pkg2</a> declared as <a href=\"../../pkg1/C1.html\" " +
+            "title=\"class in pkg1\">C1</a></span><span class=\"tabEnd\">&nbsp;" +
+            "</span></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>"
+            "<caption><span>Methods in <a href=\"../../pkg2/package-summary.html\">" +
+            "pkg2</a> that return <a href=\"../../pkg1/C1.html\" " +
+            "title=\"class in pkg1\">C1</a></span><span class=\"tabEnd\">" +
+            "&nbsp;</span></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>"
+            "<caption><span>Fields in <a href=\"../../pkg1/package-summary.html\">" +
+            "pkg1</a> declared as <a href=\"../../pkg2/C2.html\" " +
+            "title=\"class in pkg2\">C2</a></span><span class=\"tabEnd\">" +
+            "&nbsp;</span></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>"
+            "<caption><span>Methods in <a href=\"../../pkg1/package-summary.html\">" +
+            "pkg1</a> that return <a href=\"../../pkg2/C2.html\" " +
+            "title=\"class in pkg2\">C2</a></span><span class=\"tabEnd\">" +
+            "&nbsp;</span></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>"
+            "<caption><span>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></span>" +
+            "<span class=\"tabEnd\">&nbsp;</span></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>"
+            "<caption><span>Packages that use <a href=\"../pkg1/package-summary.html\">" +
+            "pkg1</a></span><span class=\"tabEnd\">&nbsp;</span></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>"
+            "<caption><span>Classes in <a href=\"../pkg1/package-summary.html\">" +
+            "pkg1</a> used by <a href=\"../pkg1/package-summary.html\">pkg1</a>" +
+            "</span><span class=\"tabEnd\">&nbsp;</span></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>"
+            "<caption><span>Packages that use <a href=\"../pkg2/package-summary.html\">" +
+            "pkg2</a></span><span class=\"tabEnd\">&nbsp;</span></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>"
+            "<caption><span>Classes in <a href=\"../pkg2/package-summary.html\">" +
+            "pkg2</a> used by <a href=\"../pkg1/package-summary.html\">pkg1</a>" +
+            "</span><span class=\"tabEnd\">&nbsp;</span></caption>"
         },
         // Deprecated
         {BUG_ID + FS + "deprecated-list.html",
-            "<CAPTION CLASS=\"TableCaption\">" + NL +
-            "Deprecated Fields</CAPTION>"
+            "<caption><span>Deprecated Fields</span><span class=\"tabEnd\">" +
+            "&nbsp;</span></caption>"
         },
         {BUG_ID + FS + "deprecated-list.html",
-            "<CAPTION CLASS=\"TableCaption\">" + NL +
-            "Deprecated Methods</CAPTION>"
+            "<caption><span>Deprecated Methods</span><span class=\"tabEnd\">" +
+            "&nbsp;</span></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>"
+            "<caption><span>pkg1.<a href=\"pkg1/C1.html\" title=\"class in pkg1\">" +
+            "C1</a></span><span class=\"tabEnd\">&nbsp;</span></caption>"
         },
         // Overview Summary
         {BUG_ID + FS + "overview-summary.html",
-            "<CAPTION CLASS=\"TableCaption\">" + NL +
-            "Packages</CAPTION>"
+            "<caption><span>Packages</span><span class=\"tabEnd\">&nbsp;</span></caption>"
         },
 
         /*
@@ -319,135 +300,115 @@
 
         //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>"
+            "<th class=\"colFirst\" scope=\"col\">" +
+            "Class</th>" + NL + "<th class=\"colLast\" scope=\"col\"" +
+            ">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>"
+            "<th class=\"colFirst\" scope=\"col\">" +
+            "Interface</th>" + NL + "<th class=\"colLast\" scope=\"col\"" +
+            ">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>"
+            "<th class=\"colFirst\" scope=\"col\">" +
+            "Enum</th>" + NL + "<th class=\"colLast\" scope=\"col\"" +
+            ">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>"
+            "<th class=\"colFirst\" scope=\"col\">" +
+            "Annotation Type</th>" + NL + "<th class=\"colLast\"" +
+            " scope=\"col\">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>"
+            "<th class=\"colFirst\" scope=\"col\">Modifier and Type</th>" + NL +
+            "<th class=\"colLast\" scope=\"col\">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>"
+            "<th class=\"colFirst\" scope=\"col\">Modifier and Type</th>" + NL +
+            "<th class=\"colLast\" scope=\"col\">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>"
+            "<th class=\"colFirst\" scope=\"col\">Modifier and Type</th>" + NL +
+            "<th class=\"colLast\" scope=\"col\">Class and Description</th>"
         },
         {BUG_ID + FS + "pkg2" + FS + "C2.html",
-            "<TH CLASS=\"TableHeader\" SCOPE=\"col\" NOWRAP>" +
-            "Constructor and Description</TH>"
+            "<th class=\"colOne\" scope=\"col\">Constructor and Description</th>"
         },
         {BUG_ID + FS + "pkg2" + FS + "C2.ModalExclusionType.html",
-            "<TH CLASS=\"TableHeader\" SCOPE=\"col\" NOWRAP>" +
-            "Enum Constant and Description</TH>"
+            "<th class=\"colOne\" scope=\"col\">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>"
+            "<th class=\"colFirst\" scope=\"col\">Modifier and Type</th>" + NL +
+            "<th class=\"colLast\" scope=\"col\">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>"
+            "<th class=\"colFirst\" scope=\"col\">Modifier and Type</th>" + NL +
+            "<th class=\"colLast\" scope=\"col\">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>"
+            "<th class=\"colFirst\" scope=\"col\">Package</th>" + NL +
+            "<th class=\"colLast\" scope=\"col\">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>"
+            "<th class=\"colFirst\" scope=\"col\">Modifier and Type</th>" + NL +
+            "<th class=\"colLast\" scope=\"col\">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>"
+            "<th class=\"colFirst\" scope=\"col\">Modifier and Type</th>" + NL +
+            "<th class=\"colLast\" scope=\"col\">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>"
+            "<th class=\"colFirst\" scope=\"col\">Modifier and Type</th>" + NL +
+            "<th class=\"colLast\" scope=\"col\">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>"
+            "<th class=\"colFirst\" scope=\"col\">Modifier and Type</th>" + NL +
+            "<th class=\"colLast\" scope=\"col\">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>"
+            "<th class=\"colFirst\" scope=\"col\">Package</th>" + NL +
+            "<th class=\"colLast\" scope=\"col\">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>"
+            "<th class=\"colFirst\" scope=\"col\">Modifier and Type</th>" + NL +
+            "<th class=\"colLast\" scope=\"col\">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>"
+            "<th class=\"colFirst\" scope=\"col\">Package</th>" + NL +
+            "<th class=\"colLast\" scope=\"col\">Description</th>"
         },
         {BUG_ID + FS + "pkg1" + FS + "package-use.html",
-            "<TH CLASS=\"TableHeader\" SCOPE=\"col\" NOWRAP>" +
-            "Class and Description</TH>"
+            "<th class=\"colOne\" scope=\"col\">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>"
+            "<th class=\"colFirst\" scope=\"col\">Package</th>" + NL +
+            "<th class=\"colLast\" scope=\"col\">Description</th>"
         },
         {BUG_ID + FS + "pkg2" + FS + "package-use.html",
-            "<TH CLASS=\"TableHeader\" SCOPE=\"col\" NOWRAP>" +
-            "Class and Description</TH>"
+            "<th class=\"colOne\" scope=\"col\">Class and Description</th>"
         },
         // Deprecated
         {BUG_ID + FS + "deprecated-list.html",
-            "<TH CLASS=\"TableHeader\" SCOPE=\"col\" NOWRAP>" +
-            "Field and Description</TH>"
+            "<th class=\"colOne\" scope=\"col\">Field and Description</th>"
         },
         {BUG_ID + FS + "deprecated-list.html",
-            "<TH CLASS=\"TableHeader\" SCOPE=\"col\" NOWRAP>" +
-            "Method and Description</TH>"
+            "<th class=\"colOne\" scope=\"col\">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>"
+            "<th class=\"colFirst\" scope=\"col\">" +
+            "Modifier and Type</th>" + NL + "<th" +
+            " scope=\"col\">Constant Field</th>" + NL +
+            "<th class=\"colLast\" scope=\"col\">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>"
+            "<th class=\"colFirst\" scope=\"col\">" +
+            "Package</th>" + NL + "<th class=\"colLast\" scope=\"col\"" +
+            ">Description</th>"
         }
     };
     private static final String[][] NEGATED_TEST = NO_TEST;
--- a/langtools/test/com/sun/javadoc/testHtmlTag/TestHtmlTag.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/test/com/sun/javadoc/testHtmlTag/TestHtmlTag.java	Mon Dec 20 21:10:57 2010 -0800
@@ -40,20 +40,20 @@
 
     private static final String BUG_ID = "6786682";
     private static final String[][] TEST1 = {
-        {BUG_ID + FS + "pkg1" + FS + "C1.html", "<HTML lang=\"" + Locale.getDefault().getLanguage() + "\">"},
-        {BUG_ID + FS + "pkg1" + FS + "package-summary.html", "<HTML lang=\"" + Locale.getDefault().getLanguage() + "\">"}};
+        {BUG_ID + FS + "pkg1" + FS + "C1.html", "<html lang=\"" + Locale.getDefault().getLanguage() + "\">"},
+        {BUG_ID + FS + "pkg1" + FS + "package-summary.html", "<html lang=\"" + Locale.getDefault().getLanguage() + "\">"}};
     private static final String[][] NEGATED_TEST1 = {
-        {BUG_ID + FS + "pkg1" + FS + "C1.html", "<HTML>"}};
+        {BUG_ID + FS + "pkg1" + FS + "C1.html", "<html>"}};
     private static final String[][] TEST2 = {
-        {BUG_ID + FS + "pkg2" + FS + "C2.html", "<HTML lang=\"ja\">"},
-        {BUG_ID + FS + "pkg2" + FS + "package-summary.html", "<HTML lang=\"ja\">"}};
+        {BUG_ID + FS + "pkg2" + FS + "C2.html", "<html lang=\"ja\">"},
+        {BUG_ID + FS + "pkg2" + FS + "package-summary.html", "<html lang=\"ja\">"}};
     private static final String[][] NEGATED_TEST2 = {
-        {BUG_ID + FS + "pkg2" + FS + "C2.html", "<HTML>"}};
+        {BUG_ID + FS + "pkg2" + FS + "C2.html", "<html>"}};
     private static final String[][] TEST3 = {
-        {BUG_ID + FS + "pkg1" + FS + "C1.html", "<HTML lang=\"en\">"},
-        {BUG_ID + FS + "pkg1" + FS + "package-summary.html", "<HTML lang=\"en\">"}};
+        {BUG_ID + FS + "pkg1" + FS + "C1.html", "<html lang=\"en\">"},
+        {BUG_ID + FS + "pkg1" + FS + "package-summary.html", "<html lang=\"en\">"}};
     private static final String[][] NEGATED_TEST3 = {
-        {BUG_ID + FS + "pkg1" + FS + "C1.html", "<HTML>"}};
+        {BUG_ID + FS + "pkg1" + FS + "C1.html", "<html>"}};
 
     private static final String[] ARGS1 =
         new String[] {
--- a/langtools/test/com/sun/javadoc/testIndex/TestIndex.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/test/com/sun/javadoc/testIndex/TestIndex.java	Mon Dec 20 21:10:57 2010 -0800
@@ -48,35 +48,34 @@
     private static final String[][] TEST = {
         //Make sure the horizontal scroll bar does not appear in class frame.
         {BUG_ID + FS + "index.html",
-            "<FRAME src=\"overview-summary.html\" name=\"classFrame\" " +
-            "title=\"Package, class and interface descriptions\" " +
-            "scrolling=\"yes\">"},
+            "<frame src=\"overview-summary.html\" name=\"classFrame\" title=\"" +
+            "Package, class and interface descriptions\" scrolling=\"yes\">"},
 
         //Test index-all.html
         {BUG_ID + FS + "index-all.html",
-            "<A HREF=\"./pkg/C.html\" title=\"class in pkg\"><STRONG>C</STRONG></A>" +
-            " - Class in <A HREF=\"./pkg/package-summary.html\">pkg</A>"},
+            "<a href=\"./pkg/C.html\" title=\"class in pkg\"><span class=\"strong\">C</span></a>" +
+            " - Class in <a href=\"./pkg/package-summary.html\">pkg</a>"},
         {BUG_ID + FS + "index-all.html",
-            "<A HREF=\"./pkg/Interface.html\" title=\"interface in pkg\">" +
-            "<STRONG>Interface</STRONG></A> - Interface in " +
-            "<A HREF=\"./pkg/package-summary.html\">pkg</A>"},
+            "<a href=\"./pkg/Interface.html\" title=\"interface in pkg\">" +
+            "<span class=\"strong\">Interface</span></a> - Interface in " +
+            "<a href=\"./pkg/package-summary.html\">pkg</a>"},
         {BUG_ID + FS + "index-all.html",
-            "<A HREF=\"./pkg/AnnotationType.html\" title=\"annotation in pkg\">" +
-            "<STRONG>AnnotationType</STRONG></A> - Annotation Type in " +
-            "<A HREF=\"./pkg/package-summary.html\">pkg</A>"},
+            "<a href=\"./pkg/AnnotationType.html\" title=\"annotation in pkg\">" +
+            "<span class=\"strong\">AnnotationType</span></a> - Annotation Type in " +
+            "<a href=\"./pkg/package-summary.html\">pkg</a>"},
         {BUG_ID + FS + "index-all.html",
-            "<A HREF=\"./pkg/Coin.html\" title=\"enum in pkg\">" +
-            "<STRONG>Coin</STRONG></A> - Enum in " +
-            "<A HREF=\"./pkg/package-summary.html\">pkg</A>"},
+            "<a href=\"./pkg/Coin.html\" title=\"enum in pkg\">" +
+            "<span class=\"strong\">Coin</span></a> - Enum in " +
+            "<a href=\"./pkg/package-summary.html\">pkg</a>"},
         {BUG_ID + FS + "index-all.html",
-            "Class in <A HREF=\"./package-summary.html\">&lt;Unnamed&gt;</A>"},
+            "Class in <a href=\"./package-summary.html\">&lt;Unnamed&gt;</a>"},
         {BUG_ID + FS + "index-all.html",
-            "<DT><A HREF=\"./pkg/C.html#Java\"><STRONG>Java</STRONG></A> - " + NL +
-            "Static variable in class pkg.<A HREF=\"./pkg/C.html\" title=\"class in pkg\">C</A>" + NL +
-            "</DT><DD>&nbsp;</DD>" + NL + NL +
-            "<DT><A HREF=\"./pkg/C.html#JDK\"><STRONG>JDK</STRONG></A> - " + NL +
-            "Static variable in class pkg.<A HREF=\"./pkg/C.html\" title=\"class in pkg\">C</A>" + NL +
-            "</DT><DD>&nbsp;</DD>"},
+            "<dl>" + NL + "<dt><span class=\"strong\"><a href=\"./pkg/C.html#Java\">" +
+            "Java</a></span> - Static variable in class pkg.<a href=\"./pkg/C.html\" " +
+            "title=\"class in pkg\">C</a></dt>" + NL + "<dd>&nbsp;</dd>" + NL +
+            "<dt><span class=\"strong\"><a href=\"./pkg/C.html#JDK\">JDK</a></span> " +
+            "- Static variable in class pkg.<a href=\"./pkg/C.html\" title=\"class in pkg\">" +
+            "C</a></dt>" + NL + "<dd>&nbsp;</dd>" + NL + "</dl>"},
     };
     private static final String[][] NEGATED_TEST = NO_TEST;
 
--- a/langtools/test/com/sun/javadoc/testInlineLinkLabel/TestInlineLinkLabel.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/test/com/sun/javadoc/testInlineLinkLabel/TestInlineLinkLabel.java	Mon Dec 20 21:10:57 2010 -0800
@@ -37,10 +37,10 @@
     private static final String BUG_ID = "4524136";
     private static final String[][] TEST = {
         //Search for the label to the package link.
-        {BUG_ID + FS + "pkg" + FS + "C1.html" , "<A HREF=\"../pkg/package-summary.html\"><CODE>Here is a link to a package</CODE></A>"},
+        {BUG_ID + FS + "pkg" + FS + "C1.html" , "<a href=\"../pkg/package-summary.html\"><code>Here is a link to a package</code></a>"},
 
         //Search for the label to the class link
-        {BUG_ID + FS + "pkg" + FS + "C1.html" , "<A HREF=\"../pkg/C2.html\" title=\"class in pkg\"><CODE>Here is a link to a class</CODE></A>"}
+        {BUG_ID + FS + "pkg" + FS + "C1.html" , "<a href=\"../pkg/C2.html\" title=\"class in pkg\"><code>Here is a link to a class</code></a>"}
     };
     private static final String[][] NEGATED_TEST = NO_TEST;
     private static final String[] ARGS =
--- a/langtools/test/com/sun/javadoc/testInterface/TestInterface.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/test/com/sun/javadoc/testInterface/TestInterface.java	Mon Dec 20 21:10:57 2010 -0800
@@ -48,51 +48,62 @@
     //Input for string search tests.
     private static final String[][] TEST = {
         {BUG_ID + FS + "pkg" + FS + "Interface.html",
-            "int <STRONG>method</STRONG>()"},
+            "<pre>int&nbsp;method()</pre>"},
         {BUG_ID + FS + "pkg" + FS + "Interface.html",
-            "static final int <STRONG>field</STRONG>"},
+            "<pre>static final&nbsp;int field</pre>"},
 
 
         // Make sure known implementing class list is correct and omits type parameters.
         {BUG_ID + FS + "pkg" + FS + "Interface.html",
-            "<DT><STRONG>All Known Implementing Classes:</STRONG></DT> " +
-            "<DD><A HREF=\"../pkg/Child.html\" " +
-            "title=\"class in pkg\">Child</A>, " +
-            "<A HREF=\"../pkg/Parent.html\" title=\"class in pkg\">" +
-            "Parent</A></DD>"},
+            "<dl>" + NL + "<dt>All Known Implementing Classes:</dt>" + NL +
+            "<dd><a href=\"../pkg/Child.html\" title=\"class in pkg\">Child" +
+            "</a>, <a href=\"../pkg/Parent.html\" title=\"class in pkg\">Parent" +
+            "</a></dd>" + NL + "</dl>"},
 
          // Make sure "All Implemented Interfaces": has substituted type parameters
          {BUG_ID + FS + "pkg" + FS + "Child.html",
-            "<STRONG>All Implemented Interfaces:</STRONG></DT> <DD>" +
-            "<A HREF=\"../pkg/Interface.html\" title=\"interface in pkg\">" +
-            "Interface</A>&lt;T&gt;"
+            "<dl>" + NL + "<dt>All Implemented Interfaces:</dt>" + NL +
+            "<dd><a href=\"../pkg/Interface.html\" title=\"interface in pkg\">" +
+            "Interface</a>&lt;T&gt;</dd>" + NL + "</dl>"
          },
          //Make sure Class Tree has substituted type parameters.
          {BUG_ID + FS + "pkg" + FS + "Child.html",
-            "<PRE>" + NL +
-            "java.lang.Object" + NL +
-            "  <IMG SRC=\"../resources/inherit.gif\" ALT=\"extended by \"><A HREF=\"../pkg/Parent.html\" title=\"class in pkg\">pkg.Parent</A>&lt;T&gt;" + NL +
-            "      <IMG SRC=\"../resources/inherit.gif\" ALT=\"extended by \"><STRONG>pkg.Child&lt;T&gt;</STRONG>" + NL +
-            "</PRE>"
+            "<ul class=\"inheritance\">" + NL + "<li>java.lang.Object</li>" + NL +
+            "<li>" + NL + "<ul class=\"inheritance\">" + NL +
+            "<li><a href=\"../pkg/Parent.html\" title=\"class in pkg\">" +
+            "pkg.Parent</a>&lt;T&gt;</li>" + NL + "<li>" + NL +
+            "<ul class=\"inheritance\">" + NL + "<li>pkg.Child&lt;T&gt;</li>" + NL +
+            "</ul>" + NL + "</li>" + NL + "</ul>" + NL + "</li>" + NL + "</ul>"
          },
          //Make sure "Direct Know Subclasses" omits type parameters
         {BUG_ID + FS + "pkg" + FS + "Parent.html",
-            "<STRONG>Direct Known Subclasses:</STRONG></DT> <DD><A HREF=\"../pkg/Child.html\" title=\"class in pkg\">Child</A>"
+            "<dl>" + NL + "<dt>Direct Known Subclasses:</dt>" + NL +
+            "<dd><a href=\"../pkg/Child.html\" title=\"class in pkg\">Child" +
+            "</a></dd>" + NL + "</dl>"
         },
         //Make sure "Specified By" has substituted type parameters.
         {BUG_ID + FS + "pkg" + FS + "Child.html",
-            "<STRONG>Specified by:</STRONG></DT><DD><CODE><A HREF=\"../pkg/Interface.html#method()\">method</A></CODE> in interface <CODE><A HREF=\"../pkg/Interface.html\" title=\"interface in pkg\">Interface</A>&lt;<A HREF=\"../pkg/Child.html\" title=\"type parameter in Child\">T</A>&gt;</CODE>"
+            "<dt><strong>Specified by:</strong></dt>" + NL +
+            "<dd><code><a href=\"../pkg/Interface.html#method()\">method</a>" +
+            "</code>&nbsp;in interface&nbsp;<code>" +
+            "<a href=\"../pkg/Interface.html\" title=\"interface in pkg\">" +
+            "Interface</a>&lt;<a href=\"../pkg/Child.html\" title=\"type parameter in Child\">" +
+            "T</a>&gt;</code></dd>"
          },
         //Make sure "Overrides" has substituted type parameters.
         {BUG_ID + FS + "pkg" + FS + "Child.html",
-            "<STRONG>Overrides:</STRONG></DT><DD><CODE><A HREF=\"../pkg/Parent.html#method()\">method</A></CODE> in class <CODE><A HREF=\"../pkg/Parent.html\" title=\"class in pkg\">Parent</A>&lt;<A HREF=\"../pkg/Child.html\" title=\"type parameter in Child\">T</A>&gt;</CODE>"
+            "<dt><strong>Overrides:</strong></dt>" + NL +
+            "<dd><code><a href=\"../pkg/Parent.html#method()\">method</a>" +
+            "</code>&nbsp;in class&nbsp;<code><a href=\"../pkg/Parent.html\" " +
+            "title=\"class in pkg\">Parent</a>&lt;<a href=\"../pkg/Child.html\" " +
+            "title=\"type parameter in Child\">T</a>&gt;</code></dd>"
          },
     };
     private static final String[][] NEGATED_TEST = {
         {BUG_ID + FS + "pkg" + FS + "Interface.html",
-            "public int <STRONG>method</STRONG>()"},
+            "public int&nbsp;method()"},
         {BUG_ID + FS + "pkg" + FS + "Interface.html",
-            "public static final int <STRONG>field</STRONG>"},
+            "public static final&nbsp;int field"},
     };
 
     /**
--- a/langtools/test/com/sun/javadoc/testJavascript/TestJavascript.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/test/com/sun/javadoc/testJavascript/TestJavascript.java	Mon Dec 20 21:10:57 2010 -0800
@@ -45,11 +45,11 @@
     //Input for string search tests.
     private static final String[][] TEST = {
         {BUG_ID + FS + "pkg" + FS + "C.html",
-            "<A HREF=\"../index.html?pkg/C.html\" target=\"_top\"><STRONG>FRAMES</STRONG></A>"},
+            "<a href=\"../index.html?pkg/C.html\" target=\"_top\">FRAMES</a>"},
         {BUG_ID + FS + "TestJavascript.html",
-            "<A HREF=\"index.html?TestJavascript.html\" target=\"_top\"><STRONG>FRAMES</STRONG></A>"},
+            "<a href=\"index.html?TestJavascript.html\" target=\"_top\">FRAMES</a>"},
         {BUG_ID + FS + "index.html",
-            "<SCRIPT type=\"text/javascript\">" + NL +
+            "<script type=\"text/javascript\">" + NL +
                         "    targetPage = \"\" + window.location.search;" + NL +
             "    if (targetPage != \"\" && targetPage != \"undefined\")" + NL +
             "        targetPage = targetPage.substring(1);" + NL +
@@ -59,7 +59,7 @@
             "        if (targetPage != \"\" && targetPage != \"undefined\")" + NL +
             "             top.classFrame.location = top.targetPage;" + NL +
             "    }" + NL +
-            "</SCRIPT>"},
+            "</script>"},
 
         //Make sure title javascript only runs if is-external is not true
         {BUG_ID + FS + "pkg" + FS + "C.html",
--- a/langtools/test/com/sun/javadoc/testLinkOption/TestLinkOption.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/test/com/sun/javadoc/testLinkOption/TestLinkOption.java	Mon Dec 20 21:10:57 2010 -0800
@@ -46,25 +46,25 @@
 
     private static final String[][] TEST1 = {
         {BUG_ID + "-1" + FS + "pkg" + FS + "C.html",
-            "<A HREF=\"http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html?is-external=true\" " +
-            "title=\"class or interface in java.lang\"><CODE>Link to String Class</CODE></A>"
+            "<a href=\"http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html?is-external=true\" " +
+            "title=\"class or interface in java.lang\"><code>Link to String Class</code></a>"
         },
         //Make sure the parameters are indented properly when the -link option is used.
         {BUG_ID + "-1" + FS + "pkg" + FS + "C.html",
                                 "(int&nbsp;p1," + NL +
-            "                     int&nbsp;p2," + NL +
-            "                     int&nbsp;p3)"
+                                "      int&nbsp;p2," + NL +
+                                "      int&nbsp;p3)"
         },
         {BUG_ID + "-1" + FS + "pkg" + FS + "C.html",
                                 "(int&nbsp;p1," + NL +
-            "                     int&nbsp;p2," + NL +
-            "                     " +
-            "<A HREF=\"http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html?is-external=true\" " +
-            "title=\"class or interface in java.lang\">Object</A>&nbsp;p3)"
+                                "      int&nbsp;p2," + NL +
+                                "      <a href=\"http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html?is-external=true\" title=\"class or interface in java.lang\">" +
+                                "Object</a>&nbsp;p3)"
         },
         {BUG_ID + "-1" + FS + "java" + FS + "lang" + FS + "StringBuilderChild.html",
-                "public abstract class <STRONG>StringBuilderChild</STRONG>" + NL +
-                "extends <A HREF=\"http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html?is-external=true\" title=\"class or interface in java.lang\">Object</A>"
+                "<pre>public abstract class <strong>StringBuilderChild</strong>" + NL +
+                "extends <a href=\"http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html?is-external=true\" " +
+                "title=\"class or interface in java.lang\">Object</a></pre>"
         },
 
     };
@@ -79,8 +79,8 @@
 
     private static final String[][] TEST2 = {
         {BUG_ID + "-2" + FS + "pkg2" + FS + "C2.html",
-            "This is a link to <A HREF=\"../../" + BUG_ID + "-1/pkg/C.html?is-external=true\" " +
-            "title=\"class or interface in pkg\"><CODE>Class C</CODE></A>."
+            "This is a link to <a href=\"../../" + BUG_ID + "-1/pkg/C.html?is-external=true\" " +
+            "title=\"class or interface in pkg\"><code>Class C</code></a>."
         }
     };
     private static final String[][] NEGATED_TEST2 = NO_TEST;
--- a/langtools/test/com/sun/javadoc/testLinkTaglet/TestLinkTaglet.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/test/com/sun/javadoc/testLinkTaglet/TestLinkTaglet.java	Mon Dec 20 21:10:57 2010 -0800
@@ -46,20 +46,22 @@
     //Input for string search tests.
     private static final String[][] TEST = {
         {BUG_ID + FS + "pkg" + FS + "C.html",
-            "Qualified Link: <A HREF=\"../pkg/C.InnerC.html\" title=\"class in pkg\"><CODE>C.InnerC</CODE></A>.<br/>\n" +
-            " Unqualified Link1: <A HREF=\"../pkg/C.InnerC.html\" title=\"class in pkg\"><CODE>C.InnerC</CODE></A>.<br/>\n" +
-            " Unqualified Link2: <A HREF=\"../pkg/C.InnerC.html\" title=\"class in pkg\"><CODE>C.InnerC</CODE></A>.<br/>\n" +
-            " Qualified Link: <A HREF=\"../pkg/C.html#method(pkg.C.InnerC, pkg.C.InnerC2)\"><CODE>method(pkg.C.InnerC, pkg.C.InnerC2)</CODE></A>.<br/>\n" +
-            " Unqualified Link: <A HREF=\"../pkg/C.html#method(pkg.C.InnerC, pkg.C.InnerC2)\"><CODE>method(C.InnerC, C.InnerC2)</CODE></A>.<br/>\n" +
-            " Unqualified Link: <A HREF=\"../pkg/C.html#method(pkg.C.InnerC, pkg.C.InnerC2)\"><CODE>method(InnerC, InnerC2)</CODE></A>.<br/>"
+            "Qualified Link: <a href=\"../pkg/C.InnerC.html\" title=\"class in pkg\"><code>C.InnerC</code></a>.<br/>\n" +
+            " Unqualified Link1: <a href=\"../pkg/C.InnerC.html\" title=\"class in pkg\"><code>C.InnerC</code></a>.<br/>\n" +
+            " Unqualified Link2: <a href=\"../pkg/C.InnerC.html\" title=\"class in pkg\"><code>C.InnerC</code></a>.<br/>\n" +
+            " Qualified Link: <a href=\"../pkg/C.html#method(pkg.C.InnerC, pkg.C.InnerC2)\"><code>method(pkg.C.InnerC, pkg.C.InnerC2)</code></a>.<br/>\n" +
+            " Unqualified Link: <a href=\"../pkg/C.html#method(pkg.C.InnerC, pkg.C.InnerC2)\"><code>method(C.InnerC, C.InnerC2)</code></a>.<br/>\n" +
+            " Unqualified Link: <a href=\"../pkg/C.html#method(pkg.C.InnerC, pkg.C.InnerC2)\"><code>method(InnerC, InnerC2)</code></a>.<br/>"
         },
         {BUG_ID + FS + "pkg" + FS + "C.InnerC.html",
-            "Link to member in outer class: <A HREF=\"../pkg/C.html#MEMBER\"><CODE>C.MEMBER</CODE></A> <br/>\n" +
-            " Link to member in inner class: <A HREF=\"../pkg/C.InnerC2.html#MEMBER2\"><CODE>C.InnerC2.MEMBER2</CODE></A> <br/>\n" +
-            " Link to another inner class: <A HREF=\"../pkg/C.InnerC2.html\" title=\"class in pkg\"><CODE>C.InnerC2</CODE></A>"
+            "Link to member in outer class: <a href=\"../pkg/C.html#MEMBER\"><code>C.MEMBER</code></a> <br/>\n" +
+            " Link to member in inner class: <a href=\"../pkg/C.InnerC2.html#MEMBER2\"><code>C.InnerC2.MEMBER2</code></a> <br/>\n" +
+            " Link to another inner class: <a href=\"../pkg/C.InnerC2.html\" title=\"class in pkg\"><code>C.InnerC2</code></a>"
         },
         {BUG_ID + FS + "pkg" + FS + "C.InnerC2.html",
-            "Enclosing class:</STRONG></DT><DD><A HREF=\"../pkg/C.html\" title=\"class in pkg\">C</A>"
+            "<dl>" + NL + "<dt>Enclosing class:</dt>" + NL +
+            "<dd><a href=\"../pkg/C.html\" title=\"class in pkg\">C</a></dd>" + NL +
+            "</dl>"
         },
     };
     private static final String[][] NEGATED_TEST = {
--- a/langtools/test/com/sun/javadoc/testLinkToSerialForm/TestLinkToSerialForm.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/test/com/sun/javadoc/testLinkToSerialForm/TestLinkToSerialForm.java	Mon Dec 20 21:10:57 2010 -0800
@@ -37,8 +37,8 @@
 
     private static final String BUG_ID = "4521661";
     private static final String[][] TEST = {
-        {BUG_ID + FS + "serialized-form.html", "<A NAME=\"pkg.C\">"},
-        {BUG_ID + FS + "pkg" + FS + "C.html", "<A HREF=\"../serialized-form.html#pkg.C\">"}
+        {BUG_ID + FS + "serialized-form.html", "<a name=\"pkg.C\">"},
+        {BUG_ID + FS + "pkg" + FS + "C.html", "<a href=\"../serialized-form.html#pkg.C\">"}
     };
     private static final String[][] NEGATED_TEST = NO_TEST;
     private static final String[] ARGS =
--- a/langtools/test/com/sun/javadoc/testMemberInheritence/TestMemberInheritence.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/test/com/sun/javadoc/testMemberInheritence/TestMemberInheritence.java	Mon Dec 20 21:10:57 2010 -0800
@@ -40,55 +40,57 @@
     private static final String[][] TEST = {
         //Public field should be inherited
         {BUG_ID + FS + "pkg" + FS + "SubClass.html",
-         "<A HREF=\"../pkg/BaseClass.html#pubField\">"},
+         "<a href=\"../pkg/BaseClass.html#pubField\">"},
 
         //Public method should be inherited
         {BUG_ID + FS + "pkg" + FS + "SubClass.html",
-         "<A HREF=\"../pkg/BaseClass.html#pubMethod()\">"},
+         "<a href=\"../pkg/BaseClass.html#pubMethod()\">"},
 
         //Public inner class should be inherited.
         {BUG_ID + FS + "pkg" + FS + "SubClass.html",
-         "<A HREF=\"../pkg/BaseClass.pubInnerClass.html\" title=\"class in pkg\">"},
+         "<a href=\"../pkg/BaseClass.pubInnerClass.html\" title=\"class in pkg\">"},
 
         //Protected field should be inherited
         {BUG_ID + FS + "pkg" + FS + "SubClass.html",
-         "<A HREF=\"../pkg/BaseClass.html#proField\">"},
+         "<a href=\"../pkg/BaseClass.html#proField\">"},
 
         //Protected method should be inherited
         {BUG_ID + FS + "pkg" + FS + "SubClass.html",
-         "<A HREF=\"../pkg/BaseClass.html#proMethod()\">"},
+         "<a href=\"../pkg/BaseClass.html#proMethod()\">"},
 
         //Protected inner class should be inherited.
         {BUG_ID + FS + "pkg" + FS + "SubClass.html",
-         "<A HREF=\"../pkg/BaseClass.proInnerClass.html\" title=\"class in pkg\">"},
+         "<a href=\"../pkg/BaseClass.proInnerClass.html\" title=\"class in pkg\">"},
 
         // New labels as of 1.5.0
         {BUG_ID + FS + "pkg" + FS + "SubClass.html",
-         "<STRONG>Nested classes/interfaces inherited from class pkg." +
-         "<A HREF=\"../pkg/BaseClass.html\" title=\"class in pkg\">" +
-         "BaseClass</A></STRONG>"},
+         "Nested classes/interfaces inherited from class&nbsp;pkg." +
+                 "<a href=\"../pkg/BaseClass.html\" title=\"class in pkg\">BaseClass</a>"},
         {BUG_ID + FS + "pkg" + FS + "SubClass.html",
-         "<STRONG>Nested classes/interfaces inherited from interface pkg." +
-         "<A HREF=\"../pkg/BaseInterface.html\" title=\"interface in pkg\">" +
-         "BaseInterface</A></STRONG>"},
+         "Nested classes/interfaces inherited from interface&nbsp;pkg." +
+                 "<a href=\"../pkg/BaseInterface.html\" title=\"interface in pkg\">BaseInterface</a>"},
 
          // Test overriding/implementing methods with generic parameters.
                  {BUG_ID + FS + "pkg" + FS + "BaseClass.html",
-         "<DT><STRONG>Specified by:</STRONG></DT><DD><CODE><A HREF=\"../pkg/BaseInterface.html#getAnnotation(java.lang.Class)\">getAnnotation</A></CODE> in interface <CODE><A HREF=\"../pkg/BaseInterface.html\" title=\"interface in pkg\">BaseInterface</A></CODE></DD>"+NL+"</DL>"},
+         "<dl>" + NL + "<dt><strong>Specified by:</strong></dt>" + NL +
+                          "<dd><code><a href=\"../pkg/BaseInterface.html#getAnnotation(java.lang.Class)\">" +
+                          "getAnnotation</a></code>&nbsp;in interface&nbsp;<code>" +
+                          "<a href=\"../pkg/BaseInterface.html\" title=\"interface in pkg\">" +
+                          "BaseInterface</a></code></dd>" + NL + "</dl>"},
 
          // Test diamond inheritence member summary (6256068)
                  {BUG_ID + FS + "diamond" + FS + "Z.html",
-                 "<TD><CODE><A HREF=\"../diamond/A.html#aMethod()\">aMethod</A></CODE></TD>"},
+                 "<code><a href=\"../diamond/A.html#aMethod()\">aMethod</a></code>"},
 
          // Test that doc is inherited from closed parent (6270645)
                  {BUG_ID + FS + "inheritDist" + FS + "C.html",
-                 "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;m1-B</TD>"},
+                 "<div class=\"block\">m1-B</div>"},
 
     };
 
     private static final String[][] NEGATED_TEST = {
         {BUG_ID + FS + "pkg" + FS + "SubClass.html",
-        "<A HREF=\"../pkg/BaseClass.html#staticMethod()\">staticMethod</A></CODE>"},
+        "<a href=\"../pkg/BaseClass.html#staticMethod()\">staticMethod</a></code>"},
     };
     private static final String[] ARGS =
         new String[] {
--- a/langtools/test/com/sun/javadoc/testMemberSummary/TestMemberSummary.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/test/com/sun/javadoc/testMemberSummary/TestMemberSummary.java	Mon Dec 20 21:10:57 2010 -0800
@@ -48,21 +48,23 @@
     private static final String[][] TEST = {
         // Check return type in member summary.
         {BUG_ID + FS + "pkg" + FS + "PublicChild.html",
-            "<CODE>&nbsp;<A HREF=\"../pkg/PublicChild.html\" " +
-            "title=\"class in pkg\">PublicChild</A></CODE></FONT></TD>" + NL +
-            "<TD><CODE><STRONG><A HREF=\"../pkg/PublicChild.html#" +
-            "returnTypeTest()\">returnTypeTest</A></STRONG>()</CODE>"
+            "<code><a href=\"../pkg/PublicChild.html\" title=\"class in pkg\">PublicChild</a></code></td>" + NL +
+            "<td class=\"colLast\"><code><strong><a href=\"../pkg/PublicChild.html#returnTypeTest()\">" +
+            "returnTypeTest</a></strong>()</code>"
         },
         // Check return type in member detail.
         {BUG_ID + FS + "pkg" + FS + "PublicChild.html",
-            "public <A HREF=\"../pkg/PublicChild.html\" " +
-            "title=\"class in pkg\">PublicChild</A> " +
-            "<STRONG>returnTypeTest</STRONG>()"
+            "<pre>public&nbsp;<a href=\"../pkg/PublicChild.html\" title=\"class in pkg\">" +
+            "PublicChild</a>&nbsp;returnTypeTest()</pre>"
         },
 
          // Legacy anchor dimensions (6290760)
         {BUG_ID + FS + "pkg2" + FS + "A.html",
-            "<A NAME=\"f(java.lang.Object[])\"><!-- --></A><A NAME=\"f(T[])\"><!-- --></A>"
+            "<a name=\"f(java.lang.Object[])\">" + NL +
+            "<!--   -->" + NL +
+            "</a><a name=\"f(T[])\">" + NL +
+            "<!--   -->" + NL +
+            "</a>"
         },
     };
     private static final String[][] NEGATED_TEST = NO_TEST;
--- a/langtools/test/com/sun/javadoc/testNavagation/TestNavagation.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/test/com/sun/javadoc/testNavagation/TestNavagation.java	Mon Dec 20 21:10:57 2010 -0800
@@ -45,24 +45,24 @@
 
     //Input for string search tests.
     private static final String[][] TEST = {
-        {BUG_ID + FS + "pkg" + FS + "A.html", "&nbsp;PREV CLASS&nbsp;"},
+        {BUG_ID + FS + "pkg" + FS + "A.html", "<li>PREV CLASS</li>"},
         {BUG_ID + FS + "pkg" + FS + "A.html",
-            "<A HREF=\"../pkg/C.html\" title=\"class in pkg\"><STRONG>NEXT CLASS</STRONG></A>"},
+            "<a href=\"../pkg/C.html\" title=\"class in pkg\"><span class=\"strong\">NEXT CLASS</span></a>"},
         {BUG_ID + FS + "pkg" + FS + "C.html",
-            "<A HREF=\"../pkg/A.html\" title=\"annotation in pkg\"><STRONG>PREV CLASS</STRONG></A>"},
+            "<a href=\"../pkg/A.html\" title=\"annotation in pkg\"><span class=\"strong\">PREV CLASS</span></a>"},
         {BUG_ID + FS + "pkg" + FS + "C.html",
-            "<A HREF=\"../pkg/E.html\" title=\"enum in pkg\"><STRONG>NEXT CLASS</STRONG></A>"},
+            "<a href=\"../pkg/E.html\" title=\"enum in pkg\"><span class=\"strong\">NEXT CLASS</span></a>"},
         {BUG_ID + FS + "pkg" + FS + "E.html",
-            "<A HREF=\"../pkg/C.html\" title=\"class in pkg\"><STRONG>PREV CLASS</STRONG></A>"},
+            "<a href=\"../pkg/C.html\" title=\"class in pkg\"><span class=\"strong\">PREV CLASS</span></a>"},
         {BUG_ID + FS + "pkg" + FS + "E.html",
-            "<A HREF=\"../pkg/I.html\" title=\"interface in pkg\"><STRONG>NEXT CLASS</STRONG></A>"},
+            "<a href=\"../pkg/I.html\" title=\"interface in pkg\"><span class=\"strong\">NEXT CLASS</span></a>"},
         {BUG_ID + FS + "pkg" + FS + "I.html",
-            "<A HREF=\"../pkg/E.html\" title=\"enum in pkg\"><STRONG>PREV CLASS</STRONG></A>"},
-        {BUG_ID + FS + "pkg" + FS + "I.html", "&nbsp;NEXT CLASS"},
+            "<a href=\"../pkg/E.html\" title=\"enum in pkg\"><span class=\"strong\">PREV CLASS</span></a>"},
+        {BUG_ID + FS + "pkg" + FS + "I.html", "<li>NEXT CLASS</li>"},
         // Test for 4664607
         {BUG_ID + FS + "pkg" + FS + "I.html",
-            "<TD COLSPAN=2 BGCOLOR=\"#EEEEFF\" CLASS=\"NavBarCell1\">" + NL +
-            "<A NAME=\"navbar_top_firstrow\"><!-- --></A>"}
+            "<a href=\"#skip-navbar_top\" title=\"Skip navigation links\"></a><a name=\"navbar_top_firstrow\">" + NL +
+            "<!--   -->" + NL + "</a>"}
     };
     private static final String[][] NEGATED_TEST = NO_TEST;
 
--- a/langtools/test/com/sun/javadoc/testNewLanguageFeatures/TestNewLanguageFeatures.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/test/com/sun/javadoc/testNewLanguageFeatures/TestNewLanguageFeatures.java	Mon Dec 20 21:10:57 2010 -0800
@@ -51,18 +51,18 @@
             // ENUM TESTING
             //=================================
             //Make sure enum header is correct.
-            {BUG_ID + FS + "pkg" + FS + "Coin.html", "Enum Coin</H2>"},
+            {BUG_ID + FS + "pkg" + FS + "Coin.html", "Enum Coin</h2>"},
             //Make sure enum signature is correct.
-            {BUG_ID + FS + "pkg" + FS + "Coin.html", "public enum "+
-                "<STRONG>Coin</STRONG>" + NL + "extends java.lang.Enum&lt;" +
-                "<A HREF=\"../pkg/Coin.html\" title=\"enum in pkg\">Coin</A>&gt;"
+            {BUG_ID + FS + "pkg" + FS + "Coin.html", "<pre>public enum <strong>Coin</strong>" + NL +
+                "extends java.lang.Enum&lt;<a href=\"../pkg/Coin.html\" " +
+                "title=\"enum in pkg\">Coin</a>&gt;</pre>"
             },
             //Check for enum constant section
-            {BUG_ID + FS + "pkg" + FS + "Coin.html", "<CAPTION CLASS=\"TableCaption\">" + NL +
-                     "Enum Constant Summary</CAPTION>"},
+            {BUG_ID + FS + "pkg" + FS + "Coin.html", "<caption><span>Enum Constants" +
+                     "</span><span class=\"tabEnd\">&nbsp;</span></caption>"},
             //Detail for enum constant
             {BUG_ID + FS + "pkg" + FS + "Coin.html",
-                "<STRONG><A HREF=\"../pkg/Coin.html#Dime\">Dime</A></STRONG>"},
+                "<strong><a href=\"../pkg/Coin.html#Dime\">Dime</a></strong>"},
             //Automatically insert documentation for values() and valueOf().
             {BUG_ID + FS + "pkg" + FS + "Coin.html",
                 "Returns an array containing the constants of this enum type,"},
@@ -77,38 +77,39 @@
             //=================================
             //Make sure the header is correct.
             {BUG_ID + FS + "pkg" + FS + "TypeParameters.html",
-                "Class TypeParameters&lt;E&gt;</H2>"},
+                "Class TypeParameters&lt;E&gt;</h2>"},
             //Check class type parameters section.
             {BUG_ID + FS + "pkg" + FS + "TypeParameters.html",
-                "<DT><STRONG>Type Parameters:</STRONG></DT><DD><CODE>E</CODE> - " +
+                "<dt><span class=\"strong\">Type Parameters:</span></dt><dd><code>E</code> - " +
                 "the type parameter for this class."},
             //Type parameters in @see/@link
             {BUG_ID + FS + "pkg" + FS + "TypeParameters.html",
-                "<DT><STRONG>See Also:</STRONG></DT><DD><A HREF=\"../pkg/TypeParameters.html\" " +
-                    "title=\"class in pkg\"><CODE>TypeParameters</CODE></A></DD></DL>"},
+                "<dl><dt><span class=\"strong\">See Also:</span></dt><dd>" +
+                "<a href=\"../pkg/TypeParameters.html\" title=\"class in pkg\">" +
+                "<code>TypeParameters</code></a></dd></dl>"},
             //Method that uses class type parameter.
             {BUG_ID + FS + "pkg" + FS + "TypeParameters.html",
-                "(<A HREF=\"../pkg/TypeParameters.html\" title=\"type " +
-                    "parameter in TypeParameters\">E</A>&nbsp;param)"},
+                "(<a href=\"../pkg/TypeParameters.html\" title=\"type " +
+                    "parameter in TypeParameters\">E</a>&nbsp;param)"},
             //Method type parameter section.
             {BUG_ID + FS + "pkg" + FS + "TypeParameters.html",
-                "<STRONG>Type Parameters:</STRONG></DT><DD><CODE>T</CODE> - This is the first " +
-                    "type parameter.</DD><DD><CODE>V</CODE> - This is the second type " +
+                "<span class=\"strong\">Type Parameters:</span></dt><dd><code>T</code> - This is the first " +
+                    "type parameter.</dd><dd><code>V</code> - This is the second type " +
                     "parameter."},
             //Signature of method with type parameters
             {BUG_ID + FS + "pkg" + FS + "TypeParameters.html",
-                "public &lt;T extends java.util.List,V&gt; " +
-                    "java.lang.String[] <STRONG>methodThatHasTypeParameters</STRONG>"},
+                "public&nbsp;&lt;T extends java.util.List,V&gt;&nbsp;" +
+                "java.lang.String[]&nbsp;methodThatHasTypeParameters"},
             //Wildcard testing.
             {BUG_ID + FS + "pkg" + FS + "Wildcards.html",
-                "<A HREF=\"../pkg/TypeParameters.html\" title=\"class in pkg\">" +
-                "TypeParameters</A>&lt;? super java.lang.String&gt;&nbsp;a"},
+                "<a href=\"../pkg/TypeParameters.html\" title=\"class in pkg\">" +
+                "TypeParameters</a>&lt;? super java.lang.String&gt;&nbsp;a"},
             {BUG_ID + FS + "pkg" + FS + "Wildcards.html",
-                "<A HREF=\"../pkg/TypeParameters.html\" title=\"class in pkg\">" +
-                "TypeParameters</A>&lt;? extends java.lang.StringBuffer&gt;&nbsp;b"},
+                "<a href=\"../pkg/TypeParameters.html\" title=\"class in pkg\">" +
+                "TypeParameters</a>&lt;? extends java.lang.StringBuffer&gt;&nbsp;b"},
             {BUG_ID + FS + "pkg" + FS + "Wildcards.html",
-                "<A HREF=\"../pkg/TypeParameters.html\" title=\"class in pkg\">" +
-                    "TypeParameters</A>&nbsp;c"},
+                "<a href=\"../pkg/TypeParameters.html\" title=\"class in pkg\">" +
+                    "TypeParameters</a>&nbsp;c"},
             //Bad type parameter warnings.
             {WARNING_OUTPUT, "warning - @param argument " +
                 "\"<BadClassTypeParam>\" is not a type parameter name."},
@@ -117,18 +118,27 @@
 
             //Signature of subclass that has type parameters.
             {BUG_ID + FS + "pkg" + FS + "TypeParameterSubClass.html",
-                "public class <STRONG>TypeParameterSubClass&lt;T extends java.lang.String&gt;" +
-                "</STRONG>" + NL + "extends <A HREF=\"../pkg/TypeParameterSuperClass.html\" " +
-                "title=\"class in pkg\">TypeParameterSuperClass</A>&lt;T&gt;"},
+                "<pre>public class <strong>TypeParameterSubClass&lt;T extends " +
+                "java.lang.String&gt;</strong>" + NL + "extends " +
+                "<a href=\"../pkg/TypeParameterSuperClass.html\" title=\"class in pkg\">" +
+                "TypeParameterSuperClass</a>&lt;T&gt;</pre>"},
 
             //Interface generic parameter substitution
             //Signature of subclass that has type parameters.
             {BUG_ID + FS + "pkg" + FS + "TypeParameters.html",
-                "<STRONG>All Implemented Interfaces:</STRONG></DT> <DD><A HREF=\"../pkg/SubInterface.html\" title=\"interface in pkg\">SubInterface</A>&lt;E&gt;, <A HREF=\"../pkg/SuperInterface.html\" title=\"interface in pkg\">SuperInterface</A>&lt;E&gt;</DD>"},
+                "<dl>" + NL + "<dt>All Implemented Interfaces:</dt>" + NL +
+                "<dd><a href=\"../pkg/SubInterface.html\" title=\"interface in pkg\">" +
+                "SubInterface</a>&lt;E&gt;, <a href=\"../pkg/SuperInterface.html\" " +
+                "title=\"interface in pkg\">SuperInterface</a>&lt;E&gt;</dd>" + NL +
+                "</dl>"},
             {BUG_ID + FS + "pkg" + FS + "SuperInterface.html",
-                "<STRONG>All Known Subinterfaces:</STRONG></DT> <DD><A HREF=\"../pkg/SubInterface.html\" title=\"interface in pkg\">SubInterface</A>&lt;V&gt;</DD>"},
+                "<dl>" + NL + "<dt>All Known Subinterfaces:</dt>" + NL +
+                "<dd><a href=\"../pkg/SubInterface.html\" title=\"interface in pkg\">" +
+                "SubInterface</a>&lt;V&gt;</dd>" + NL + "</dl>"},
             {BUG_ID + FS + "pkg" + FS + "SubInterface.html",
-                "<STRONG>All Superinterfaces:</STRONG></DT> <DD><A HREF=\"../pkg/SuperInterface.html\" title=\"interface in pkg\">SuperInterface</A>&lt;V&gt;</DD>"},
+                "<dl>" + NL + "<dt>All Superinterfaces:</dt>" + NL +
+                "<dd><a href=\"../pkg/SuperInterface.html\" title=\"interface in pkg\">" +
+                "SuperInterface</a>&lt;V&gt;</dd>" + NL + "</dl>"},
 
             //=================================
             // VAR ARG TESTING
@@ -137,39 +147,40 @@
             {BUG_ID + FS + "pkg" + FS + "VarArgs.html", "(int[][]...&nbsp;i)"},
             {BUG_ID + FS + "pkg" + FS + "VarArgs.html", "(int[]...)"},
             {BUG_ID + FS + "pkg" + FS + "VarArgs.html",
-                "<A HREF=\"../pkg/TypeParameters.html\" title=\"class in pkg\">" +
-                "TypeParameters</A>...&nbsp;t"},
+                "<a href=\"../pkg/TypeParameters.html\" title=\"class in pkg\">" +
+                "TypeParameters</a>...&nbsp;t"},
 
             //=================================
             // ANNOTATION TYPE TESTING
             //=================================
             //Make sure the summary links are correct.
             {BUG_ID + FS + "pkg" + FS + "AnnotationType.html",
-                "SUMMARY:&nbsp;<A HREF=\"#annotation_type_required_element_summary\">" +
-                "REQUIRED</A>&nbsp;|&nbsp;<A HREF=\"#annotation_type_optional_element_summary\">" +
-                "OPTIONAL</A>"},
+                "<li>SUMMARY:&nbsp;</li>" + NL +
+                "<li><a href=\"#annotation_type_required_element_summary\">" +
+                "REQUIRED</a>&nbsp;|&nbsp;</li>" + NL + "<li>" +
+                "<a href=\"#annotation_type_optional_element_summary\">OPTIONAL</a></li>"},
             //Make sure the detail links are correct.
             {BUG_ID + FS + "pkg" + FS + "AnnotationType.html",
-                "DETAIL:&nbsp;<A HREF=\"#annotation_type_element_detail\">ELEMENT</A>"},
+                "<li>DETAIL:&nbsp;</li>" + NL +
+                "<li><a href=\"#annotation_type_element_detail\">ELEMENT</a></li>"},
             //Make sure the heading is correct.
             {BUG_ID + FS + "pkg" + FS + "AnnotationType.html",
-                "Annotation Type AnnotationType</H2>"},
+                "Annotation Type AnnotationType</h2>"},
             //Make sure the signature is correct.
             {BUG_ID + FS + "pkg" + FS + "AnnotationType.html",
-                "public @interface <STRONG>AnnotationType</STRONG>"},
+                "public @interface <strong>AnnotationType</strong>"},
             //Make sure member summary headings are correct.
             {BUG_ID + FS + "pkg" + FS + "AnnotationType.html",
-                "<CAPTION CLASS=\"TableCaption\">" + NL +
-                "Required Element Summary</CAPTION>"},
+                "<h3>Required Element Summary</h3>"},
             {BUG_ID + FS + "pkg" + FS + "AnnotationType.html",
-                "<CAPTION CLASS=\"TableCaption\">" + NL +
-                "Optional Element Summary</CAPTION>"},
+                "<h3>Optional Element Summary</h3>"},
             //Make sure element detail heading is correct
             {BUG_ID + FS + "pkg" + FS + "AnnotationType.html",
                 "Element Detail"},
             //Make sure default annotation type value is printed when necessary.
             {BUG_ID + FS + "pkg" + FS + "AnnotationType.html",
-                "<STRONG>Default:</STRONG></DT><DD>\"unknown\"</DD>"},
+                "<dl>" + NL + "<dt>Default:</dt>" + NL + "<dd>\"unknown\"</dd>" + NL +
+                "</dl>"},
 
             //=================================
             // ANNOTATION TYPE USAGE TESTING
@@ -177,51 +188,65 @@
 
             //PACKAGE
             {BUG_ID + FS + "pkg" + FS + "package-summary.html",
-                "<A HREF=\"../pkg/AnnotationType.html\" title=\"annotation in pkg\">@AnnotationType</A>(<A HREF=\"../pkg/AnnotationType.html#optional()\">optional</A>=\"Package Annotation\"," + NL +
-                "                <A HREF=\"../pkg/AnnotationType.html#required()\">required</A>=1994)"},
+                "<a href=\"../pkg/AnnotationType.html\" title=\"annotation in pkg\">@AnnotationType</a>(<a href=\"../pkg/AnnotationType.html#optional()\">optional</a>=\"Package Annotation\"," + NL +
+                "                <a href=\"../pkg/AnnotationType.html#required()\">required</a>=1994)"},
 
             //CLASS
             {BUG_ID + FS + "pkg" + FS + "AnnotationTypeUsage.html",
-                "<FONT SIZE=\"-1\">" +
-                "<A HREF=\"../pkg/AnnotationType.html\" title=\"annotation in pkg\">@AnnotationType</A>(<A HREF=\"../pkg/AnnotationType.html#optional()\">optional</A>=\"Class Annotation\","+NL +
-                "                <A HREF=\"../pkg/AnnotationType.html#required()\">required</A>=1994)"+NL +
-                "</FONT>public class <STRONG>AnnotationTypeUsage</STRONG>" + NL +
-                "extends java.lang.Object"},
+                "<pre><a href=\"../pkg/AnnotationType.html\" " +
+                "title=\"annotation in pkg\">@AnnotationType</a>(" +
+                "<a href=\"../pkg/AnnotationType.html#optional()\">optional</a>" +
+                "=\"Class Annotation\"," + NL +
+                "                <a href=\"../pkg/AnnotationType.html#required()\">" +
+                "required</a>=1994)" + NL + "public class <strong>" +
+                "AnnotationTypeUsage</strong>" + NL + "extends java.lang.Object</pre>"},
 
             //FIELD
             {BUG_ID + FS + "pkg" + FS + "AnnotationTypeUsage.html",
-                "<FONT SIZE=\"-1\">" +
-                "<A HREF=\"../pkg/AnnotationType.html\" title=\"annotation in pkg\">@AnnotationType</A>(<A HREF=\"../pkg/AnnotationType.html#optional()\">optional</A>=\"Field Annotation\","+NL +
-                "                <A HREF=\"../pkg/AnnotationType.html#required()\">required</A>=1994)"+NL +
-                "</FONT>public int <STRONG>field</STRONG>"},
+                "<pre><a href=\"../pkg/AnnotationType.html\" " +
+                "title=\"annotation in pkg\">@AnnotationType</a>(" +
+                "<a href=\"../pkg/AnnotationType.html#optional()\">optional</a>" +
+                "=\"Field Annotation\"," + NL +
+                "                <a href=\"../pkg/AnnotationType.html#required()\">" +
+                "required</a>=1994)" + NL + "public&nbsp;int field</pre>"},
 
             //CONSTRUCTOR
             {BUG_ID + FS + "pkg" + FS + "AnnotationTypeUsage.html",
-                "<FONT SIZE=\"-1\">" +
-                "<A HREF=\"../pkg/AnnotationType.html\" title=\"annotation in pkg\">@AnnotationType</A>(<A HREF=\"../pkg/AnnotationType.html#optional()\">optional</A>=\"Constructor Annotation\","+NL +
-                "                <A HREF=\"../pkg/AnnotationType.html#required()\">required</A>=1994)"+NL +
-                "</FONT>public <STRONG>AnnotationTypeUsage</STRONG>()"},
+                "<pre><a href=\"../pkg/AnnotationType.html\" " +
+                "title=\"annotation in pkg\">@AnnotationType</a>(" +
+                "<a href=\"../pkg/AnnotationType.html#optional()\">optional</a>" +
+                "=\"Constructor Annotation\"," + NL +
+                "                <a href=\"../pkg/AnnotationType.html#required()\">" +
+                "required</a>=1994)" + NL + "public&nbsp;AnnotationTypeUsage()</pre>"},
 
             //METHOD
             {BUG_ID + FS + "pkg" + FS + "AnnotationTypeUsage.html",
-                "<FONT SIZE=\"-1\">" +
-                "<A HREF=\"../pkg/AnnotationType.html\" title=\"annotation in pkg\">@AnnotationType</A>(<A HREF=\"../pkg/AnnotationType.html#optional()\">optional</A>=\"Method Annotation\","+NL +
-                "                <A HREF=\"../pkg/AnnotationType.html#required()\">required</A>=1994)"+NL +
-                "</FONT>public void <STRONG>method</STRONG>()"},
+                "<pre><a href=\"../pkg/AnnotationType.html\" " +
+                "title=\"annotation in pkg\">@AnnotationType</a>(" +
+                "<a href=\"../pkg/AnnotationType.html#optional()\">optional</a>" +
+                "=\"Method Annotation\"," + NL +
+                "                <a href=\"../pkg/AnnotationType.html#required()\">" +
+                "required</a>=1994)" + NL + "public&nbsp;void&nbsp;method()</pre>"},
 
             //METHOD PARAMS
             {BUG_ID + FS + "pkg" + FS + "AnnotationTypeUsage.html",
-                "<PRE>" + NL +
-                "public void <STRONG>methodWithParams</STRONG>(<FONT SIZE=\"-1\"><A HREF=\"../pkg/AnnotationType.html\" title=\"annotation in pkg\">@AnnotationType</A>(<A HREF=\"../pkg/AnnotationType.html#optional()\">optional</A>=\"Parameter Annotation\",<A HREF=\"../pkg/AnnotationType.html#required()\">required</A>=1994)</FONT>" + NL +
-                "                             int&nbsp;documented," + NL +
-                "                             int&nbsp;undocmented)</PRE>"},
+                "<pre>public&nbsp;void&nbsp;methodWithParams(" +
+                "<a href=\"../pkg/AnnotationType.html\" title=\"annotation in pkg\">" +
+                "@AnnotationType</a>(<a href=\"../pkg/AnnotationType.html#optional()\">" +
+                "optional</a>=\"Parameter Annotation\",<a " +
+                "href=\"../pkg/AnnotationType.html#required()\">required</a>=1994)" + NL +
+                "                    int&nbsp;documented," + NL +
+                "                    int&nbsp;undocmented)</pre>"},
 
             //CONSTRUCTOR PARAMS
             {BUG_ID + FS + "pkg" + FS + "AnnotationTypeUsage.html",
-                "<PRE>" + NL +
-                                "public <STRONG>AnnotationTypeUsage</STRONG>(<FONT SIZE=\"-1\"><A HREF=\"../pkg/AnnotationType.html\" title=\"annotation in pkg\">@AnnotationType</A>(<A HREF=\"../pkg/AnnotationType.html#optional()\">optional</A>=\"Constructor Param Annotation\",<A HREF=\"../pkg/AnnotationType.html#required()\">required</A>=1994)</FONT>" + NL +
-                                "                           int&nbsp;documented," + NL +
-                "                           int&nbsp;undocmented)</PRE>"},
+                "<pre>public&nbsp;AnnotationTypeUsage(<a " +
+                "href=\"../pkg/AnnotationType.html\" title=\"annotation in pkg\">" +
+                "@AnnotationType</a>(<a href=\"../pkg/AnnotationType.html#optional()\">" +
+                "optional</a>=\"Constructor Param Annotation\",<a " +
+                "href=\"../pkg/AnnotationType.html#required()\">required</a>=1994)" + NL +
+                "                   int&nbsp;documented," + NL +
+                "                   int&nbsp;undocmented)</pre>"},
 
             //=================================
             // ANNOTATION TYPE USAGE TESTING (All Different Types).
@@ -229,59 +254,59 @@
 
             //Integer
             {BUG_ID + FS + "pkg1" + FS + "B.html",
-                "<A HREF=\"../pkg1/A.html#d()\">d</A>=3.14,"},
+                "<a href=\"../pkg1/A.html#d()\">d</a>=3.14,"},
 
             //Double
             {BUG_ID + FS + "pkg1" + FS + "B.html",
-                "<A HREF=\"../pkg1/A.html#d()\">d</A>=3.14,"},
+                "<a href=\"../pkg1/A.html#d()\">d</a>=3.14,"},
 
             //Boolean
             {BUG_ID + FS + "pkg1" + FS + "B.html",
-                "<A HREF=\"../pkg1/A.html#b()\">b</A>=true,"},
+                "<a href=\"../pkg1/A.html#b()\">b</a>=true,"},
 
             //String
             {BUG_ID + FS + "pkg1" + FS + "B.html",
-                "<A HREF=\"../pkg1/A.html#s()\">s</A>=\"sigh\","},
+                "<a href=\"../pkg1/A.html#s()\">s</a>=\"sigh\","},
 
             //Class
             {BUG_ID + FS + "pkg1" + FS + "B.html",
-                "<A HREF=\"../pkg1/A.html#c()\">c</A>=<A HREF=\"../pkg2/Foo.html\" title=\"class in pkg2\">Foo.class</A>,"},
+                "<a href=\"../pkg1/A.html#c()\">c</a>=<a href=\"../pkg2/Foo.html\" title=\"class in pkg2\">Foo.class</a>,"},
 
             //Bounded Class
             {BUG_ID + FS + "pkg1" + FS + "B.html",
-                "<A HREF=\"../pkg1/A.html#w()\">w</A>=<A HREF=\"../pkg/TypeParameterSubClass.html\" title=\"class in pkg\">TypeParameterSubClass.class</A>,"},
+                "<a href=\"../pkg1/A.html#w()\">w</a>=<a href=\"../pkg/TypeParameterSubClass.html\" title=\"class in pkg\">TypeParameterSubClass.class</a>,"},
 
             //Enum
             {BUG_ID + FS + "pkg1" + FS + "B.html",
-                "<A HREF=\"../pkg1/A.html#e()\">e</A>=<A HREF=\"../pkg/Coin.html#Penny\">Penny</A>,"},
+                "<a href=\"../pkg1/A.html#e()\">e</a>=<a href=\"../pkg/Coin.html#Penny\">Penny</a>,"},
 
             //Annotation Type
             {BUG_ID + FS + "pkg1" + FS + "B.html",
-                "<A HREF=\"../pkg1/A.html#a()\">a</A>=<A HREF=\"../pkg/AnnotationType.html\" title=\"annotation in pkg\">@AnnotationType</A>(<A HREF=\"../pkg/AnnotationType.html#optional()\">optional</A>=\"foo\",<A HREF=\"../pkg/AnnotationType.html#required()\">required</A>=1994),"},
+                "<a href=\"../pkg1/A.html#a()\">a</a>=<a href=\"../pkg/AnnotationType.html\" title=\"annotation in pkg\">@AnnotationType</a>(<a href=\"../pkg/AnnotationType.html#optional()\">optional</a>=\"foo\",<a href=\"../pkg/AnnotationType.html#required()\">required</a>=1994),"},
 
             //String Array
             {BUG_ID + FS + "pkg1" + FS + "B.html",
-                "<A HREF=\"../pkg1/A.html#sa()\">sa</A>={\"up\",\"down\"},"},
+                "<a href=\"../pkg1/A.html#sa()\">sa</a>={\"up\",\"down\"},"},
 
             //Primitive
             {BUG_ID + FS + "pkg1" + FS + "B.html",
-                "<A HREF=\"../pkg1/A.html#primitiveClassTest()\">primitiveClassTest</A>=boolean.class,"},
+                "<a href=\"../pkg1/A.html#primitiveClassTest()\">primitiveClassTest</a>=boolean.class,"},
 
             //XXX:  Add array test case after this if fixed:
             //5020899: Incorrect internal representation of class-valued annotation elements
 
             //Make sure that annotations are surrounded by <pre> and </pre>
             {BUG_ID + FS + "pkg1" + FS + "B.html",
-                "<PRE><FONT SIZE=\"-1\"><A HREF=\"../pkg1/A.html\" title=\"annotation in pkg1\">@A</A>"},
+                "<pre><a href=\"../pkg1/A.html\" title=\"annotation in pkg1\">@A</a>"},
             {BUG_ID + FS + "pkg1" + FS + "B.html",
-                "</FONT>public interface <STRONG>B</STRONG></PRE>"},
+                "public interface <strong>B</strong></pre>"},
 
 
             //==============================================================
             // Handle multiple bounds.
             //==============================================================
             {BUG_ID + FS + "pkg" + FS + "MultiTypeParameters.html",
-                "public &lt;T extends java.lang.Number & java.lang.Runnable&gt; T <STRONG>foo</STRONG>(T&nbsp;t)"},
+                "public&nbsp;&lt;T extends java.lang.Number & java.lang.Runnable&gt;&nbsp;T&nbsp;foo(T&nbsp;t)"},
 
             //==============================================================
             // Test Class-Use Documenation for Type Parameters.
@@ -289,347 +314,356 @@
 
             //ClassUseTest1: <T extends Foo & Foo2>
             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo.html",
-                     "<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>"
+                     "<caption><span>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></span><span class=\"tabEnd\">&nbsp;</span></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>"
+                     "<td class=\"colLast\"><code><strong><a href=\"../../pkg2/" +
+                     "ClassUseTest1.html\" title=\"class in pkg2\">ClassUseTest1" +
+                     "&lt;T extends Foo & Foo2&gt;</a></strong></code>&nbsp;</td>"
+            },
+            {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo.html",
+                     "<caption><span>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></span><span class=\"tabEnd\">&nbsp;</span></caption>"
             },
             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo.html",
-                     "<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>"
+                     "<td class=\"colLast\"><span class=\"strong\">ClassUseTest1." +
+                     "</span><code><strong><a href=\"../../pkg2/" +
+                     "ClassUseTest1.html#method(T)\">method</a></strong>" +
+                     "(T&nbsp;t)</code>&nbsp;</td>"
             },
             {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>"
+                     "<caption><span>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></span><span class=\"tabEnd\">&nbsp;</span></caption>"
             },
             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo.html",
-                     "<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>"
+                     "td class=\"colFirst\"><code><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></td>"
             },
 
             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest.html",
-                     "<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>"
+                     "<caption><span>Fields in <a href=\"../../pkg2/" +
+                     "package-summary.html\">pkg2</a> declared as <a href=\"../" +
+                     "../pkg2/ParamTest.html\" title=\"class in pkg2\">ParamTest" +
+                     "</a></span><span class=\"tabEnd\">&nbsp;</span></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>"
+                     "<td class=\"colFirst\"><code><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></td>"
             },
 
            {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo2.html",
-                    "<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>"
+                    "<caption><span>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></span><span class=\"tabEnd\">&nbsp;" +
+                    "</span></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>"
+                    "<td class=\"colLast\"><code><strong><a href=\"../../pkg2/" +
+                    "ClassUseTest1.html\" title=\"class in pkg2\">" +
+                    "ClassUseTest1&lt;T extends Foo & Foo2&gt;</a></strong>" +
+                    "</code>&nbsp;</td>"
            },
            {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo2.html",
-                    "<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>"
+                    "<caption><span>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></span><span class=\"tabEnd\">&nbsp;" +
+                    "</span></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>"
+                     "<td class=\"colLast\"><span class=\"strong\">" +
+                     "ClassUseTest1.</span><code><strong><a href=\"../../" +
+                     "pkg2/ClassUseTest1.html#method(T)\">method</a></strong>" +
+                     "(T&nbsp;t)</code>&nbsp;</td>"
             },
 
             //ClassUseTest2: <T extends ParamTest<Foo3>>
             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest.html",
-                     "<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>"
+                     "<caption><span>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></span><span class=\"tabEnd\">" +
+                     "&nbsp;</span></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>"
+                     "<td class=\"colLast\"><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>&nbsp;</td>"
             },
             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest.html",
-                     "<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>"
+                     "<caption><span>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></span><span class=\"tabEnd\">" +
+                     "&nbsp;</span></caption>"
+            },
+            {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest.html",
+                     "<td class=\"colLast\"><span class=\"strong\">ClassUseTest2." +
+                     "</span><code><strong><a href=\"../../pkg2/" +
+                     "ClassUseTest2.html#method(T)\">method</a></strong>" +
+                     "(T&nbsp;t)</code>&nbsp;</td>"
             },
             {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>"
+                     "<caption><span>Fields in <a href=\"../../pkg2/" +
+                     "package-summary.html\">pkg2</a> declared as <a href=\"../" +
+                     "../pkg2/ParamTest.html\" title=\"class in pkg2\">ParamTest" +
+                     "</a></span><span class=\"tabEnd\">&nbsp;</span></caption>"
             },
             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest.html",
-                     "<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>"
+                     "<td class=\"colFirst\"><code><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></td>"
             },
             {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>"
+                     "<caption><span>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></span><span class=\"tabEnd\">" +
+                     "&nbsp;</span></caption>"
             },
             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest.html",
-                     "<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;"
+                     "<td class=\"colFirst\"><code>&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;&nbsp;<br><a href=\"../../pkg2/" +
+                     "ParamTest.html\" title=\"class in pkg2\">ParamTest</a>" +
+                     "&lt;<a href=\"../../pkg2/Foo3.html\" title=\"class in " +
+                     "pkg2\">Foo3</a>&gt;</code></td>"
             },
 
             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo3.html",
-                     "<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>"
+                     "<caption><span>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></span><span class=\"tabEnd\">&nbsp;</span></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>"
+                     "<td class=\"colLast\"><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>&nbsp;</td>"
+            },
+            {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo3.html",
+                     "<caption><span>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></span><span class=\"tabEnd\">&nbsp;" +
+                     "</span></caption>"
             },
             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo3.html",
-                     "<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>"
+                     "<td class=\"colLast\"><span class=\"strong\">ClassUseTest2." +
+                     "</span><code><strong><a href=\"../../pkg2/" +
+                     "ClassUseTest2.html#method(T)\">method</a></strong>" +
+                     "(T&nbsp;t)</code>&nbsp;</td>"
             },
             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo3.html",
-                     "<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>"
+                     "<caption><span>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></span><span class=\"tabEnd\">" +
+                     "&nbsp;</span></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;"
+                     "<td class=\"colFirst\"><code>&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;&nbsp;<br><a href=\"../../pkg2/ParamTest.html\" " +
+                     "title=\"class in pkg2\">ParamTest</a>&lt;<a href=\"../../pkg2/" +
+                     "Foo3.html\" title=\"class in pkg2\">Foo3</a>&gt;</code></td>"
             },
 
             //ClassUseTest3: <T extends ParamTest2<List<? extends Foo4>>>
             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest2.html",
-                     "<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>"
+                     "<caption><span>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></span><span class=\"tabEnd\">" +
+                     "&nbsp;</span></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>"
+                     "<td class=\"colLast\"><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>&nbsp;</td>"
             },
             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest2.html",
-                     "<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>"
+                     "<caption><span>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></span><span class=\"tabEnd\">" +
+                     "&nbsp;</span></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>"
+                     "<td class=\"colLast\"><span class=\"strong\">ClassUseTest3" +
+                     ".</span><code><strong><a href=\"../../pkg2/ClassUseTest3." +
+                     "html#method(T)\">method</a></strong>(T&nbsp;t)</code>&nbsp;</td>"
             },
             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "ParamTest2.html",
-                     "<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;"
+                     "<td class=\"colFirst\"><code>&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;&nbsp;<br><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;</code></td>"
             },
 
             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo4.html",
-                     "<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>"
+                     "<caption><span>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></span><span class=\"tabEnd\">&nbsp;" +
+                     "</span></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>"
+                     "<td class=\"colLast\"><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>&nbsp;</td>"
+            },
+            {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo4.html",
+                     "<caption><span>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></span><span class=\"tabEnd\">&nbsp;</span></caption>"
             },
             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo4.html",
-                     "<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>"
+                     "<td class=\"colLast\"><span class=\"strong\">ClassUseTest3." +
+                     "</span><code><strong><a href=\"../../pkg2/ClassUseTest3." +
+                     "html#method(T)\">method</a></strong>(T&nbsp;t)</code>" +
+                     "&nbsp;</td>"
             },
             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo4.html",
-                     "<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>"
+                     "<caption><span>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></span><span class=\"" +
+                     "tabEnd\">&nbsp;</span></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;"
+                     "<td class=\"colFirst\"><code>&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;&nbsp;<br><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;</code></td>"
             },
 
             //Type parameters in constructor and method args
             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo4.html",
-                     "<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>"
+                     "<caption><span>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></span><span class=\"tabEnd\">&nbsp;" +
+                     "</span></caption>" + NL + "<tr>" + NL +
+                     "<th class=\"colFirst\" scope=\"col\">Modifier and Type</th>" + NL +
+                     "<th class=\"colLast\" scope=\"col\">Method and Description</th>" + NL +
+                     "</tr>" + NL + "<tbody>" + NL + "<tr class=\"altColor\">" + NL +
+                     "<td class=\"colFirst\"><code>void</code></td>" + NL +
+                     "<td class=\"colLast\"><span class=\"strong\">ClassUseTest3." +
+                     "</span><code><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>&nbsp;</td>" + NL +
+                     "</tr>" + NL + "</tbody>"
             },
             {BUG_ID + FS + "pkg2" + FS + "class-use" + FS + "Foo4.html",
-                     "<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>"
+                     "<caption><span>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></span><span class=\"tabEnd\">&nbsp;" +
+                     "</span></caption>"
             },
 
             //=================================
             // Annotatation Type Usage
             //=================================
             {BUG_ID + FS + "pkg" + FS + "class-use" + FS + "AnnotationType.html",
-                     "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>"
+                     "<caption><span>Packages with annotations of type <a href=\"" +
+                     "../../pkg/AnnotationType.html\" title=\"annotation in pkg\">" +
+                     "AnnotationType</a></span><span class=\"tabEnd\">&nbsp;" +
+                     "</span></caption>"
             },
 
             {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></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>"
+                     "<caption><span>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></span><span class" +
+                     "=\"tabEnd\">&nbsp;</span></caption>"
             },
 
             {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></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>"
+                     "<caption><span>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></span><span class=\"tabEnd\">" +
+                     "&nbsp;</span></caption>"
             },
 
             {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></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>"
+                     "<caption><span>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></span><span class=\"tabEnd\">" +
+                     "&nbsp;</span></caption>"
             },
 
             {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></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>"
+                     "<caption><span>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></span><span class=\"tabEnd\">" +
+                     "&nbsp;</span></caption>"
             },
 
             {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></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>"
+                     "<caption><span>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></span><span class=\"tabEnd\">" +
+                     "&nbsp;</span></caption>"
             },
 
             {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></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>"
+                     "<caption><span>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></span><span class=\"" +
+                     "tabEnd\">&nbsp;</span></caption>"
             },
 
             //=================================
             // TYPE PARAMETER IN INDEX
             //=================================
             {BUG_ID + FS + "index-all.html",
-                "<A HREF=\"./pkg2/Foo.html#method(java.util.Vector)\"><STRONG>method(Vector&lt;Object&gt;)</STRONG></A>"
+                "<span class=\"strong\"><a href=\"./pkg2/Foo.html#method(java.util.Vector)\">" +
+                "method(Vector&lt;Object&gt;)</a></span>"
             },
             //=================================
             // TYPE PARAMETER IN INDEX
             //=================================
             {BUG_ID + FS + "index-all.html",
-                "<A HREF=\"./pkg2/Foo.html#method(java.util.Vector)\"><STRONG>method(Vector&lt;Object&gt;)</STRONG></A>"
+                "<span class=\"strong\"><a href=\"./pkg2/Foo.html#method(java.util.Vector)\">" +
+                "method(Vector&lt;Object&gt;)</a></span>"
             },
         };
     private static final String[][] NEGATED_TEST = {
@@ -637,15 +671,15 @@
         // ENUM TESTING
         //=================================
         //NO constructor section
-        {BUG_ID + FS + "pkg" + FS + "Coin.html", "<STRONG>Constructor Summary</STRONG>"},
+        {BUG_ID + FS + "pkg" + FS + "Coin.html", "<span class=\"strong\">Constructor Summary</span>"},
         //=================================
         // TYPE PARAMETER TESTING
         //=================================
         //No type parameters in class frame.
         {BUG_ID + FS + "allclasses-frame.html",
-            "<A HREF=\"../pkg/TypeParameters.html\" title=\"class in pkg\">" +
-                    "TypeParameters</A>&lt;<A HREF=\"../pkg/TypeParameters.html\" " +
-                    "title=\"type parameter in TypeParameters\">E</A>&gt;"
+            "<a href=\"../pkg/TypeParameters.html\" title=\"class in pkg\">" +
+                    "TypeParameters</a>&lt;<a href=\"../pkg/TypeParameters.html\" " +
+                    "title=\"type parameter in TypeParameters\">E</a>&gt;"
         },
 
         //==============================================================
@@ -654,31 +688,27 @@
 
         //CLASS
         {BUG_ID + FS + "pkg" + FS + "AnnotationTypeUsage.html",
-            "<FONT SIZE=\"-1\">" + NL +
-            "<A HREF=\"../pkg/AnnotationTypeUndocumented.html\" title=\"annotation in pkg\">@AnnotationTypeUndocumented</A>(<A HREF=\"../pkg/AnnotationType.html#optional\">optional</A>=\"Class Annotation\"," + NL +
-            "                <A HREF=\"../pkg/AnnotationType.html#required\">required</A>=1994)" + NL +
-            "</FONT>public class <STRONG>AnnotationTypeUsage</STRONG></DT><DT>extends java.lang.Object</DT></DL>"},
+            "<a href=\"../pkg/AnnotationTypeUndocumented.html\" title=\"annotation in pkg\">@AnnotationTypeUndocumented</a>(<a href=\"../pkg/AnnotationType.html#optional\">optional</a>=\"Class Annotation\"," + NL +
+            "                <a href=\"../pkg/AnnotationType.html#required\">required</a>=1994)" + NL +
+            "public class <strong>AnnotationTypeUsage</strong></dt><dt>extends java.lang.Object</dt>"},
 
         //FIELD
         {BUG_ID + FS + "pkg" + FS + "AnnotationTypeUsage.html",
-            "<FONT SIZE=\"-1\">" + NL +
-            "<A HREF=\"../pkg/AnnotationTypeUndocumented.html\" title=\"annotation in pkg\">@AnnotationTypeUndocumented</A>(<A HREF=\"../pkg/AnnotationType.html#optional\">optional</A>=\"Field Annotation\"," + NL +
-            "                <A HREF=\"../pkg/AnnotationType.html#required\">required</A>=1994)" + NL +
-            "</FONT>public int <STRONG>field</STRONG>"},
+            "<a href=\"../pkg/AnnotationTypeUndocumented.html\" title=\"annotation in pkg\">@AnnotationTypeUndocumented</a>(<a href=\"../pkg/AnnotationType.html#optional\">optional</a>=\"Field Annotation\"," + NL +
+            "                <a href=\"../pkg/AnnotationType.html#required\">required</a>=1994)" + NL +
+            "public int <strong>field</strong>"},
 
         //CONSTRUCTOR
         {BUG_ID + FS + "pkg" + FS + "AnnotationTypeUsage.html",
-            "<FONT SIZE=\"-1\">" + NL +
-            "<A HREF=\"../pkg/AnnotationTypeUndocumented.html\" title=\"annotation in pkg\">@AnnotationTypeUndocumented</A>(<A HREF=\"../pkg/AnnotationType.html#optional\">optional</A>=\"Constructor Annotation\"," + NL +
-            "                <A HREF=\"../pkg/AnnotationType.html#required\">required</A>=1994)" + NL +
-            "</FONT>public <STRONG>AnnotationTypeUsage</STRONG>()"},
+            "<a href=\"../pkg/AnnotationTypeUndocumented.html\" title=\"annotation in pkg\">@AnnotationTypeUndocumented</a>(<a href=\"../pkg/AnnotationType.html#optional\">optional</a>=\"Constructor Annotation\"," + NL +
+            "                <a href=\"../pkg/AnnotationType.html#required\">required</a>=1994)" + NL +
+            "public <strong>AnnotationTypeUsage</strong>()"},
 
         //METHOD
         {BUG_ID + FS + "pkg" + FS + "AnnotationTypeUsage.html",
-            "<FONT SIZE=\"-1\">" + NL +
-            "<A HREF=\"../pkg/AnnotationTypeUndocumented.html\" title=\"annotation in pkg\">@AnnotationTypeUndocumented</A>(<A HREF=\"../pkg/AnnotationType.html#optional\">optional</A>=\"Method Annotation\"," + NL +
-            "                <A HREF=\"../pkg/AnnotationType.html#required\">required</A>=1994)" + NL +
-            "</FONT>public void <STRONG>method</STRONG>()"},
+            "<a href=\"../pkg/AnnotationTypeUndocumented.html\" title=\"annotation in pkg\">@AnnotationTypeUndocumented</a>(<a href=\"../pkg/AnnotationType.html#optional\">optional</a>=\"Method Annotation\"," + NL +
+            "                <a href=\"../pkg/AnnotationType.html#required\">required</a>=1994)" + NL +
+            "public void <strong>method</strong>()"},
 
         //=================================
         // Make sure annotation types do not
--- a/langtools/test/com/sun/javadoc/testOverridenMethods/TestMultiInheritence.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/test/com/sun/javadoc/testOverridenMethods/TestMultiInheritence.java	Mon Dec 20 21:10:57 2010 -0800
@@ -46,27 +46,34 @@
     //Method foo() is inherited from BOTH I2 and I3
     private static final String[][] TEST = {
        {BUG_ID + FS + "pkg3" + FS + "I1.html",
-        "Methods inherited from interface pkg3." +        "<A HREF=\"../pkg3/I2.html\" title=\"interface in pkg3\">I2</A>"},
+        "Methods inherited from interface&nbsp;pkg3." +
+                "<a href=\"../pkg3/I2.html\" title=\"interface in pkg3\">" +
+                "I2</a>"},
         {BUG_ID + FS + "pkg3" + FS +"I1.html",
-        "Methods inherited from interface pkg3." +
-        "<A HREF=\"../pkg3/I3.html\" title=\"interface in pkg3\">I3</A>"},
+        "Methods inherited from interface&nbsp;pkg3." +
+                 "<a href=\"../pkg3/I3.html\" title=\"interface in pkg3\">" +
+                 "I3</a>"},
         {BUG_ID + FS + "pkg3" + FS + "I0.html",
-        "Methods inherited from interface pkg3." +
-        "<A HREF=\"../pkg3/I2.html\" title=\"interface in pkg3\">I2</A>"},
+        "Methods inherited from interface&nbsp;pkg3." +
+                 "<a href=\"../pkg3/I2.html\" title=\"interface in pkg3\">" +
+                 "I2</a>"},
         {BUG_ID + FS + "pkg3" + FS +"I0.html",
-        "Methods inherited from interface pkg3." +
-        "<A HREF=\"../pkg3/I3.html\" title=\"interface in pkg3\">I3</A>"},
+        "Methods inherited from interface&nbsp;pkg3." +
+                 "<a href=\"../pkg3/I3.html\" title=\"interface in pkg3\">" +
+                 "I3</a>"},
     };
 
     //Method foo() is NOT inherited from I4 because it is overriden by
     //I3.
     private static final String[][] NEGATED_TEST = {
         {BUG_ID + FS + "pkg3" + FS + "I1.html",
-        "Methods inherited from interface pkg3." +
-        "<A HREF=\"../pkg3/I4.html\" title=\"interface in pkg3\">I4</A>"},
+        "Methods inherited from interface&nbsp;pkg3." +
+                 "<a href=\"../pkg3/I4.html\" title=\"interface in pkg3\">" +
+                 "I4</a>"},
         {BUG_ID + FS + "pkg3" + FS + "I0.html",
-        "Methods inherited from interface pkg3." +
-        "<A HREF=\"../pkg3/I4.html\" title=\"interface in pkg3\">I4</A>"},
+        "Methods inherited from interface&nbsp;pkg3." +
+                 "<a href=\"../pkg3/I4.html\" title=\"interface in pkg3\">" +
+                 "I4</a>"},
     };
 
     /**
--- a/langtools/test/com/sun/javadoc/testOverridenMethods/TestOverridenMethodDocCopy.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/test/com/sun/javadoc/testOverridenMethods/TestOverridenMethodDocCopy.java	Mon Dec 20 21:10:57 2010 -0800
@@ -46,9 +46,9 @@
     //Input for string search tests.
     private static final String[][] TEST = {
         {BUG_ID + FS + "pkg1" + FS + "SubClass.html",
-            "<STRONG>Description copied from class: <CODE>" +
-            "<A HREF=\"../pkg1/BaseClass.html#overridenMethodWithDocsToCopy()\">" +
-            "BaseClass</A></CODE></STRONG>"
+            "<strong>Description copied from class:&nbsp;<code>" +
+            "<a href=\"../pkg1/BaseClass.html#overridenMethodWithDocsToCopy()\">" +
+            "BaseClass</a></code></strong>"
         }
     };
     private static final String[][] NEGATED_TEST = NO_TEST;
--- a/langtools/test/com/sun/javadoc/testOverridenMethods/TestOverridenPrivateMethods.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/test/com/sun/javadoc/testOverridenMethods/TestOverridenPrivateMethods.java	Mon Dec 20 21:10:57 2010 -0800
@@ -40,11 +40,13 @@
     private static final String[][] TEST = {
         //The public method should be overriden
         {BUG_ID + FS + "pkg1" + FS + "SubClass.html",
-         "Overrides:</STRONG></DT><DD><CODE><A HREF=\"../pkg1/BaseClass.html#publicMethod"},
+         "<dt><strong>Overrides:</strong></dt>" + NL +
+                 "<dd><code><a href=\"../pkg1/BaseClass.html#publicMethod"},
 
         //The public method in different package should be overriden
         {BUG_ID + FS + "pkg2" + FS + "SubClass.html",
-         "Overrides:</STRONG></DT><DD><CODE><A HREF=\"../pkg1/BaseClass.html#publicMethod"}
+         "<dt><strong>Overrides:</strong></dt>" + NL +
+                 "<dd><code><a href=\"../pkg1/BaseClass.html#publicMethod"}
     };
 
     private static final String[][] NEGATED_TEST = {
@@ -52,20 +54,23 @@
         //The package private method should be overriden since the base and sub class are in the same
         //package.  However, the link should not show up because the package private methods are not documented.
         {BUG_ID + FS + "pkg1" + FS + "SubClass.html",
-         "Overrides:</STRONG></DT><DD><CODE><A HREF=\"../pkg1/BaseClass.html#packagePrivateMethod"},
+         "<dt><strong>Overrides:</strong></dt>" + NL +
+                 "<dd><code><a href=\"../pkg1/BaseClass.html#packagePrivateMethod"},
 
         //The private method in should not be overriden
         {BUG_ID + FS + "pkg1" + FS + "SubClass.html",
-         "Overrides:</STRONG></DT><DD><CODE><A HREF=\"../pkg1/BaseClass.html#privateMethod"},
+         "<dt><strong>Overrides:</strong></dt>" + NL +
+                 "<dd><code><a href=\"../pkg1/BaseClass.html#privateMethod"},
 
         //The private method in different package should not be overriden
         {BUG_ID + FS + "pkg2" + FS + "SubClass.html",
-         "Overrides:</STRONG></DT><DD><CODE><A HREF=\"../pkg1/BaseClass.html#privateMethod"},
+         "<dt><strong>Overrides:</strong></dt>" + NL +
+                 "<dd><code><a href=\"../pkg1/BaseClass.html#privateMethod"},
 
         //The package private method should not be overriden since the base and sub class are in
         //different packages.
         {BUG_ID + FS + "pkg2" + FS + "SubClass.html",
-         "Overrides:</STRONG></DT><DD><CODE><A HREF=\"../pkg1/BaseClass.html#packagePrivateMethod"}
+         "Overrides:</strong></dt><dd><code><a href=\"../pkg1/BaseClass.html#packagePrivateMethod"}
     };
 
     private static final String[] ARGS =
--- a/langtools/test/com/sun/javadoc/testOverridenMethods/TestOverridenPrivateMethodsWithPackageFlag.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/test/com/sun/javadoc/testOverridenMethods/TestOverridenPrivateMethodsWithPackageFlag.java	Mon Dec 20 21:10:57 2010 -0800
@@ -40,32 +40,44 @@
     private static final String[][] TEST = {
         //The public method should be overriden
         {BUG_ID + FS + "pkg1" + FS + "SubClass.html",
-         "Overrides:</STRONG></DT><DD><CODE><A HREF=\"../pkg1/BaseClass.html#publicMethod"},
+         "<dt><strong>Overrides:</strong></dt>" + NL +
+                 "<dd><code><a href=\"../pkg1/BaseClass.html#publicMethod()\">" +
+                 "publicMethod</a></code>&nbsp;in class&nbsp;<code>" +
+                 "<a href=\"../pkg1/BaseClass.html\" title=\"class in pkg1\">BaseClass</a></code></dd>"},
 
         //The public method in different package should be overriden
         {BUG_ID + FS + "pkg2" + FS + "SubClass.html",
-         "Overrides:</STRONG></DT><DD><CODE><A HREF=\"../pkg1/BaseClass.html#publicMethod"},
+         "<dt><strong>Overrides:</strong></dt>" + NL +
+                 "<dd><code><a href=\"../pkg1/BaseClass.html#publicMethod()\">" +
+                 "publicMethod</a></code>&nbsp;in class&nbsp;<code>" +
+                 "<a href=\"../pkg1/BaseClass.html\" title=\"class in pkg1\">BaseClass</a></code></dd>"},
 
         //The package private method should be overriden since the base and sub class are in the same
         //package.
         {BUG_ID + FS + "pkg1" + FS + "SubClass.html",
-         "Overrides:</STRONG></DT><DD><CODE><A HREF=\"../pkg1/BaseClass.html#packagePrivateMethod"}
+         "<dt><strong>Overrides:</strong></dt>" + NL +
+                 "<dd><code><a href=\"../pkg1/BaseClass.html#packagePrivateMethod()\">" +
+                 "packagePrivateMethod</a></code>&nbsp;in class&nbsp;<code>" +
+                 "<a href=\"../pkg1/BaseClass.html\" title=\"class in pkg1\">BaseClass</a></code></dd>"}
     };
 
     private static final String[][] NEGATED_TEST = {
 
         //The private method in should not be overriden
         {BUG_ID + FS + "pkg1" + FS + "SubClass.html",
-         "Overrides:</STRONG></DT><DD><CODE><A HREF=\"../pkg1/BaseClass.html#privateMethod"},
+         "<dt><strong>Overrides:</strong></dt>" + NL +
+                 "<dd><code><a href=\"../pkg1/BaseClass.html#privateMethod()\">"},
 
         //The private method in different package should not be overriden
         {BUG_ID + FS + "pkg2" + FS + "SubClass.html",
-         "Overrides:</STRONG></DT><DD><CODE><A HREF=\"../pkg1/BaseClass.html#privateMethod"},
+         "<dt><strong>Overrides:</strong></dt>" + NL +
+                 "<dd><code><a href=\"../pkg1/BaseClass.html#privateMethod()\">"},
 
         //The package private method should not be overriden since the base and sub class are in
         //different packages.
         {BUG_ID + FS + "pkg2" + FS + "SubClass.html",
-         "Overrides:</STRONG></DT><DD><CODE><A HREF=\"../pkg1/BaseClass.html#packagePrivateMethod"},
+         "<dt><strong>Overrides:</strong></dt>" + NL +
+                 "<dd><code><a href=\"../pkg1/BaseClass.html#packagePrivateMethod()\">"},
     };
 
     private static final String[] ARGS =
--- a/langtools/test/com/sun/javadoc/testOverridenMethods/TestOverridenPrivateMethodsWithPrivateFlag.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/test/com/sun/javadoc/testOverridenMethods/TestOverridenPrivateMethodsWithPrivateFlag.java	Mon Dec 20 21:10:57 2010 -0800
@@ -40,32 +40,38 @@
     private static final String[][] TEST = {
         //The public method should be overriden
         {BUG_ID + FS + "pkg1" + FS + "SubClass.html",
-         "Overrides:</STRONG></DT><DD><CODE><A HREF=\"../pkg1/BaseClass.html#publicMethod"},
+         "<dt><strong>Overrides:</strong></dt>" + NL +
+                 "<dd><code><a href=\"../pkg1/BaseClass.html#publicMethod"},
 
         //The package private method should be overriden since the base and sub class are in the same
         //package.
         {BUG_ID + FS + "pkg1" + FS + "SubClass.html",
-         "Overrides:</STRONG></DT><DD><CODE><A HREF=\"../pkg1/BaseClass.html#packagePrivateMethod"},
+         "<dt><strong>Overrides:</strong></dt>" + NL +
+                 "<dd><code><a href=\"../pkg1/BaseClass.html#packagePrivateMethod"},
 
         //The public method in different package should be overriden
         {BUG_ID + FS + "pkg2" + FS + "SubClass.html",
-         "Overrides:</STRONG></DT><DD><CODE><A HREF=\"../pkg1/BaseClass.html#publicMethod"},
+         "<dt><strong>Overrides:</strong></dt>" + NL +
+                 "<dd><code><a href=\"../pkg1/BaseClass.html#publicMethod"},
     };
 
     private static final String[][] NEGATED_TEST = {
 
         //The private method in should not be overriden
         {BUG_ID + FS + "pkg1" + FS + "SubClass.html",
-         "Overrides:</STRONG></DT><DD><CODE><A HREF=\"../pkg1/BaseClass.html#privateMethod"},
+         "<dt><strong>Overrides:</strong></dt>" + NL +
+                 "<dd><code><a href=\"../pkg1/BaseClass.html#privateMethod"},
 
         //The private method in different package should not be overriden
         {BUG_ID + FS + "pkg2" + FS + "SubClass.html",
-         "Overrides:</STRONG></DT><DD><CODE><A HREF=\"../pkg1/BaseClass.html#privateMethod"},
+         "<dt><strong>Overrides:</strong></dt>" + NL +
+                 "<dd><code><a href=\"../pkg1/BaseClass.html#privateMethod"},
 
         //The package private method should not be overriden since the base and sub class are in
         //different packages.
         {BUG_ID + FS + "pkg2" + FS + "SubClass.html",
-         "Overrides:</STRONG></DT><DD><CODE><A HREF=\"../pkg1/BaseClass.html#packagePrivateMethod"}
+         "<dt><strong>Overrides:</strong></dt>" + NL +
+                 "<dd><code><a href=\"../pkg1/BaseClass.html#packagePrivateMethod"}
 
 
     };
--- a/langtools/test/com/sun/javadoc/testPackagePage/TestPackagePage.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/test/com/sun/javadoc/testPackagePage/TestPackagePage.java	Mon Dec 20 21:10:57 2010 -0800
@@ -43,37 +43,32 @@
         },
         //With just one package, all general pages link to the single package page.
         {BUG_ID + "-1" + FS + "com" + FS + "pkg" + FS + "C.html",
-            "<A HREF=\"../../com/pkg/package-summary.html\">" +
-            "<FONT CLASS=\"NavBarFont1\"><STRONG>Package</STRONG></FONT></A>"
+            "<a href=\"../../com/pkg/package-summary.html\">Package</a>"
         },
         {BUG_ID + "-1" + FS + "com" + FS + "pkg" + FS + "package-tree.html",
-            "<A HREF=\"../../com/pkg/package-summary.html\">" +
-            "<FONT CLASS=\"NavBarFont1\"><STRONG>Package</STRONG></FONT></A>"
+            "<li><a href=\"../../com/pkg/package-summary.html\">Package</a></li>"
         },
         {BUG_ID + "-1" + FS + "deprecated-list.html",
-            "<A HREF=\"com/pkg/package-summary.html\">" +
-            "<FONT CLASS=\"NavBarFont1\"><STRONG>Package</STRONG></FONT></A>"
+            "<li><a href=\"com/pkg/package-summary.html\">Package</a></li>"
         },
         {BUG_ID + "-1" + FS + "index-all.html",
-            "<A HREF=\"./com/pkg/package-summary.html\">" +
-            "<FONT CLASS=\"NavBarFont1\"><STRONG>Package</STRONG></FONT></A>"
+            "<li><a href=\"./com/pkg/package-summary.html\">Package</a></li>"
         },
         {BUG_ID + "-1" + FS + "help-doc.html",
-            "<A HREF=\"com/pkg/package-summary.html\">" +
-            "<FONT CLASS=\"NavBarFont1\"><STRONG>Package</STRONG></FONT></A>"
+            "<li><a href=\"com/pkg/package-summary.html\">Package</a></li>"
         },
     };
 
     private static final String[][] TEST2 = {
         //With multiple packages, there is no package link in general pages.
         {BUG_ID + "-2" + FS + "deprecated-list.html",
-            " <FONT CLASS=\"NavBarFont1\">Package</FONT>&nbsp;"
+            "<li>Package</li>"
         },
         {BUG_ID + "-2" + FS + "index-all.html",
-            " <FONT CLASS=\"NavBarFont1\">Package</FONT>&nbsp;"
+            "<li>Package</li>"
         },
         {BUG_ID + "-2" + FS + "help-doc.html",
-            " <FONT CLASS=\"NavBarFont1\">Package</FONT>&nbsp;"
+            "<li>Package</li>"
         },
     };
 
--- a/langtools/test/com/sun/javadoc/testParamTaglet/TestParamTaglet.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/test/com/sun/javadoc/testParamTaglet/TestParamTaglet.java	Mon Dec 20 21:10:57 2010 -0800
@@ -48,20 +48,20 @@
     private static final String[][] TEST = {
         //Regular param tags.
         {BUG_ID + FS + "pkg" + FS + "C.html",
-            "<STRONG>Parameters:</STRONG></DT><DD><CODE>param1</CODE> - testing 1 2 3.</DD>" +
-                "<DD><CODE>param2</CODE> - testing 1 2 3."
+            "<span class=\"strong\">Parameters:</span></dt><dd><code>param1</code> - testing 1 2 3.</dd>" +
+                "<dd><code>param2</code> - testing 1 2 3."
         },
         //Param tags that don't match with any real parameters.
         {BUG_ID + FS + "pkg" + FS + "C.html",
-            "<STRONG>Parameters:</STRONG></DT><DD><CODE><I>p1</I></CODE> - testing 1 2 3.</DD>" +
-                "<DD><CODE><I>p2</I></CODE> - testing 1 2 3."
+            "<span class=\"strong\">Parameters:</span></dt><dd><code><I>p1</I></code> - testing 1 2 3.</dd>" +
+                "<dd><code><I>p2</I></code> - testing 1 2 3."
         },
         //{@inherit} doc misuse does not cause doclet to throw exception.
         // Param is printed with nothing inherited.
         //XXX: in the future when Configuration is available during doc inheritence,
         //print a warning for this mistake.
         {BUG_ID + FS + "pkg" + FS + "C.html",
-            "<CODE><I>inheritBug</I></CODE> -"
+            "<code><I>inheritBug</I></code> -"
         },
 
     };
--- a/langtools/test/com/sun/javadoc/testPrivateClasses/TestPrivateClasses.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/test/com/sun/javadoc/testPrivateClasses/TestPrivateClasses.java	Mon Dec 20 21:10:57 2010 -0800
@@ -58,50 +58,50 @@
     private static final String[][] TEST1 = {
         // Field inheritence from non-public superclass.
         {BUG_ID + "-1" + FS + "pkg" + FS + "PublicChild.html",
-            "<A HREF=\"../pkg/PublicChild.html#fieldInheritedFromParent\">" +
-                "fieldInheritedFromParent</A>"
+            "<a href=\"../pkg/PublicChild.html#fieldInheritedFromParent\">" +
+                "fieldInheritedFromParent</a>"
         },
 
         // Method inheritence from non-public superclass.
         {BUG_ID + "-1" + FS + "pkg" + FS + "PublicChild.html",
-            "<A HREF=\"../pkg/PublicChild.html#methodInheritedFromParent(int)\">" +
-                "methodInheritedFromParent</A>"
+            "<a href=\"../pkg/PublicChild.html#methodInheritedFromParent(int)\">" +
+                "methodInheritedFromParent</a>"
         },
 
         // Field inheritence from non-public superinterface.
         {BUG_ID + "-1" + FS + "pkg" + FS + "PublicInterface.html",
-            "<A HREF=\"../pkg/PublicInterface.html#fieldInheritedFromInterface\">" +
-                "fieldInheritedFromInterface</A>"
+            "<a href=\"../pkg/PublicInterface.html#fieldInheritedFromInterface\">" +
+                "fieldInheritedFromInterface</a>"
         },
 
         // Method inheritence from non-public superinterface.
         {BUG_ID + "-1" + FS + "pkg" + FS + "PublicInterface.html",
-            "<A HREF=\"../pkg/PublicInterface.html#methodInterface(int)\">" +
-                "methodInterface</A>"
+            "<a href=\"../pkg/PublicInterface.html#methodInterface(int)\">" +
+                "methodInterface</a>"
         },
 
         // private class does not show up in tree
         {BUG_ID + "-1" + FS + "pkg" + FS + "PublicChild.html",
-            "<PRE>" + NL +
-                "java.lang.Object" + NL +
-                "  <IMG SRC=\"../resources/inherit.gif\" " +
-                "ALT=\"extended by \"><STRONG>pkg.PublicChild</STRONG>" + NL +
-            "</PRE>"
+            "<ul class=\"inheritance\">" + NL + "<li>java.lang.Object</li>" + NL +
+            "<li>" + NL + "<ul class=\"inheritance\">" + NL + "<li>pkg.PublicChild</li>" + NL +
+            "</ul>" + NL + "</li>" + NL + "</ul>"
         },
 
         // Method is documented as though it is declared in the inheriting method.
         {BUG_ID + "-1" + FS + "pkg" + FS + "PublicChild.html",
-            "public void <STRONG>methodInheritedFromParent</STRONG>(int&nbsp;p1)"
+            "<pre>public&nbsp;void&nbsp;methodInheritedFromParent(int&nbsp;p1)"
         },
 
         //Make sure implemented interfaces from private superclass are inherited
         {BUG_ID + "-1" + FS + "pkg" + FS + "PublicInterface.html",
-            "<STRONG>All Known Implementing Classes:</STRONG></DT> <DD><A HREF=\"../pkg/PublicChild.html\" " +
-            "title=\"class in pkg\">PublicChild</A>"},
+            "<dl>" + NL + "<dt>All Known Implementing Classes:</dt>" + NL +
+            "<dd><a href=\"../pkg/PublicChild.html\" title=\"class in pkg\">" +
+            "PublicChild</a></dd>" + NL + "</dl>"},
 
         {BUG_ID + "-1" + FS + "pkg" + FS + "PublicChild.html",
-            "<STRONG>All Implemented Interfaces:</STRONG></DT> <DD><A HREF=\"../pkg/PublicInterface.html\" " +
-            "title=\"interface in pkg\">PublicInterface</A>"},
+            "<dl>" + NL + "<dt>All Implemented Interfaces:</dt>" + NL +
+            "<dd><a href=\"../pkg/PublicInterface.html\" title=\"interface in pkg\">" +
+            "PublicInterface</a></dd>" + NL + "</dl>"},
 
         //Generic interface method test.
         {BUG_ID + "-1" + FS + "pkg2" + FS + "C.html",
@@ -110,12 +110,12 @@
     private static final String[][] NEGATED_TEST1 = {
        // Should not document that a method overrides method from private class.
       {BUG_ID + "-1" + FS + "pkg" + FS + "PublicChild.html",
-        "<STRONG>Overrides:</STRONG>"},
+        "<strong>Overrides:</strong>"},
       // Should not document that a method specified by private interface.
       {BUG_ID + "-1" + FS + "pkg" + FS + "PublicChild.html",
-        "<STRONG>Specified by:</STRONG>"},
+        "<strong>Specified by:</strong>"},
       {BUG_ID + "-1" + FS + "pkg" + FS + "PublicInterface.html",
-        "<STRONG>Specified by:</STRONG>"},
+        "<strong>Specified by:</strong>"},
       // Should not mention that any documentation was copied.
       {BUG_ID + "-1" + FS + "pkg" + FS + "PublicChild.html",
         "Description copied from"},
@@ -137,64 +137,64 @@
         //Do not inherit private interface method with generic parameters.
         //This method has been implemented.
         {BUG_ID + "-1" + FS + "pkg2" + FS + "C.html",
-            "<STRONG><A HREF=\"../pkg2/I.html#hello(T)\">hello</A></STRONG>"},
+            "<strong><a href=\"../pkg2/I.html#hello(T)\">hello</a></strong>"},
     };
 
     // Test output when -private flag is used.
     private static final String[][] TEST2 = {
         // Field inheritence from non-public superclass.
         {BUG_ID + "-2" + FS + "pkg" + FS + "PublicChild.html",
-            "Fields inherited from class " +
-            "pkg.<A HREF=\"../pkg/PrivateParent.html\" " +
-            "title=\"class in pkg\">PrivateParent</A>"
+            "Fields inherited from class&nbsp;pkg." +
+            "<a href=\"../pkg/PrivateParent.html\" title=\"class in pkg\">" +
+            "PrivateParent</a>"
         },
         {BUG_ID + "-2" + FS + "pkg" + FS + "PublicChild.html",
-            "<A HREF=\"../pkg/PrivateParent.html#fieldInheritedFromParent\">" +
-                "fieldInheritedFromParent</A>"
+            "<a href=\"../pkg/PrivateParent.html#fieldInheritedFromParent\">" +
+                "fieldInheritedFromParent</a>"
         },
         // Field inheritence from non-public superinterface.
         {BUG_ID + "-2" + FS + "pkg" + FS + "PublicInterface.html",
-            "Fields inherited from interface " +
-            "pkg.<A HREF=\"../pkg/PrivateInterface.html\" " +
-            "title=\"interface in pkg\">PrivateInterface</A>"
+            "Fields inherited from interface&nbsp;pkg." +
+            "<a href=\"../pkg/PrivateInterface.html\" title=\"interface in pkg\">" +
+            "PrivateInterface</a>"
         },
         {BUG_ID + "-2" + FS + "pkg" + FS + "PublicInterface.html",
-            "<A HREF=\"../pkg/PrivateInterface.html#fieldInheritedFromInterface\">" +
-                "fieldInheritedFromInterface</A>"
+            "<a href=\"../pkg/PrivateInterface.html#fieldInheritedFromInterface\">" +
+                "fieldInheritedFromInterface</a>"
         },
         // Method inheritence from non-public superclass.
         {BUG_ID + "-2" + FS + "pkg" + FS + "PublicChild.html",
-            "Methods inherited from class " +
-            "pkg.<A HREF=\"../pkg/PrivateParent.html\" " +
-            "title=\"class in pkg\">PrivateParent</A>"
+            "Methods inherited from class&nbsp;pkg." +
+            "<a href=\"../pkg/PrivateParent.html\" title=\"class in pkg\">" +
+            "PrivateParent</a>"
         },
         {BUG_ID + "-2" + FS + "pkg" + FS + "PublicChild.html",
-            "<A HREF=\"../pkg/PrivateParent.html#methodInheritedFromParent(int)\">" +
-                "methodInheritedFromParent</A>"
+            "<a href=\"../pkg/PrivateParent.html#methodInheritedFromParent(int)\">" +
+                "methodInheritedFromParent</a>"
         },
         // Should document that a method overrides method from private class.
        {BUG_ID + "-2" + FS + "pkg" + FS + "PublicChild.html",
-            "<STRONG>Overrides:</STRONG></DT><DD><CODE>" +
-            "<A HREF=\"../pkg/PrivateParent.html#methodOverridenFromParent(char[], int, T, V, java.util.List)\">" +
-            "methodOverridenFromParent</A></CODE> in class <CODE>" +
-            "<A HREF=\"../pkg/PrivateParent.html\" title=\"class in pkg\">" +
-            "PrivateParent</A></CODE></DD>" + NL + "</DL>"},
+            "<dt><strong>Overrides:</strong></dt>" + NL +
+            "<dd><code><a href=\"../pkg/PrivateParent.html#methodOverridenFromParent(char[], int, T, V, java.util.List)\">" +
+            "methodOverridenFromParent</a></code>&nbsp;in class&nbsp;<code>" +
+            "<a href=\"../pkg/PrivateParent.html\" title=\"class in pkg\">" +
+            "PrivateParent</a></code></dd>"},
        // Should document that a method is specified by private interface.
        {BUG_ID + "-2" + FS + "pkg" + FS + "PublicChild.html",
-            "<STRONG>Specified by:</STRONG></DT><DD><CODE>" +
-            "<A HREF=\"../pkg/PrivateInterface.html#methodInterface(int)\">" +
-            "methodInterface</A></CODE> in interface <CODE>" +
-            "<A HREF=\"../pkg/PrivateInterface.html\" title=\"interface in pkg\">" +
-            "PrivateInterface</A></CODE></DD>" + NL + "</DL>" + NL + "</DD>"},
+            "<dt><strong>Specified by:</strong></dt>" + NL +
+            "<dd><code><a href=\"../pkg/PrivateInterface.html#methodInterface(int)\">" +
+            "methodInterface</a></code>&nbsp;in interface&nbsp;<code>" +
+            "<a href=\"../pkg/PrivateInterface.html\" title=\"interface in pkg\">" +
+            "PrivateInterface</a></code></dd>"},
        // Method inheritence from non-public superinterface.
        {BUG_ID + "-2" + FS + "pkg" + FS + "PublicInterface.html",
-            "Methods inherited from interface " +
-            "pkg.<A HREF=\"../pkg/PrivateInterface.html\" " +
-            "title=\"interface in pkg\">PrivateInterface</A>"
+            "Methods inherited from interface&nbsp;pkg." +
+            "<a href=\"../pkg/PrivateInterface.html\" title=\"interface in pkg\">" +
+            "PrivateInterface</a>"
         },
         {BUG_ID + "-2" + FS + "pkg" + FS + "PrivateInterface.html",
-            "<A HREF=\"../pkg/PrivateInterface.html#methodInterface(int)\">" +
-                "methodInterface</A>"
+            "<a href=\"../pkg/PrivateInterface.html#methodInterface(int)\">" +
+                "methodInterface</a>"
         },
       // Should mention that any documentation was copied.
       {BUG_ID + "-2" + FS + "pkg" + FS + "PublicChild.html",
@@ -209,26 +209,31 @@
 
       //Make sure implemented interfaces from private superclass are inherited
       {BUG_ID + "-2" + FS + "pkg" + FS + "PublicInterface.html",
-        "<STRONG>All Known Implementing Classes:</STRONG></DT> <DD><A HREF=\"../pkg/PrivateParent.html\" " +
-        "title=\"class in pkg\">PrivateParent</A>, " +
-        "<A HREF=\"../pkg/PublicChild.html\" title=\"class in pkg\">PublicChild</A>"},
+        "<dl>" + NL + "<dt>All Known Implementing Classes:</dt>" + NL +
+        "<dd><a href=\"../pkg/PrivateParent.html\" title=\"class in pkg\">" +
+        "PrivateParent</a>, " +
+        "<a href=\"../pkg/PublicChild.html\" title=\"class in pkg\">PublicChild" +
+        "</a></dd>" + NL + "</dl>"},
 
       {BUG_ID + "-2" + FS + "pkg" + FS + "PublicChild.html",
-        "<STRONG>All Implemented Interfaces:</STRONG></DT> <DD><A HREF=\"../pkg/PrivateInterface.html\" " +
-        "title=\"interface in pkg\">PrivateInterface</A>, " +
-        "<A HREF=\"../pkg/PublicInterface.html\" title=\"interface in pkg\">" +
-        "PublicInterface</A>"},
+        "<dl>" + NL + "<dt>All Implemented Interfaces:</dt>" + NL +
+        "<dd><a href=\"../pkg/PrivateInterface.html\" title=\"interface in pkg\">" +
+        "PrivateInterface</a>, " +
+        "<a href=\"../pkg/PublicInterface.html\" title=\"interface in pkg\">" +
+        "PublicInterface</a></dd>" + NL + "</dl>"},
 
       //Since private flag is used, we can document that private interface method
       //with generic parameters has been implemented.
       {BUG_ID + "-2" + FS + "pkg2" + FS + "C.html",
-            "<STRONG>Description copied from interface: " +
-            "<CODE><A HREF=\"../pkg2/I.html#hello(T)\">I</A></CODE></STRONG>"},
+            "<strong>Description copied from interface:&nbsp;<code>" +
+            "<a href=\"../pkg2/I.html#hello(T)\">I</a></code></strong>"},
 
       {BUG_ID + "-2" + FS + "pkg2" + FS + "C.html",
-            "<STRONG>Specified by:</STRONG></DT><DD><CODE><A HREF=\"../pkg2/I.html#hello(T)\">" +
-            "hello</A></CODE> in interface <CODE><A HREF=\"../pkg2/I.html\" " +
-            "title=\"interface in pkg2\">I</A>"},
+            "<dt><strong>Specified by:</strong></dt>" + NL +
+            "<dd><code><a href=\"../pkg2/I.html#hello(T)\">hello</a></code>" +
+            "&nbsp;in interface&nbsp;<code>" +
+            "<a href=\"../pkg2/I.html\" title=\"interface in pkg2\">I</a>" +
+            "&lt;java.lang.String&gt;</code></dd>"},
     };
     private static final String[][] NEGATED_TEST2 = NO_TEST;
 
--- a/langtools/test/com/sun/javadoc/testSerializedForm/TestSerializedForm.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/test/com/sun/javadoc/testSerializedForm/TestSerializedForm.java	Mon Dec 20 21:10:57 2010 -0800
@@ -47,11 +47,11 @@
 
     private static final String[][] TEST = {
         {BUG_ID + FS + "serialized-form.html",
-            "protected java.lang.Object <STRONG>readResolve</STRONG>()"},
+            "protected&nbsp;java.lang.Object&nbsp;readResolve()"},
         {BUG_ID + FS + "serialized-form.html",
-            "protected java.lang.Object <STRONG>writeReplace</STRONG>()"},
+            "protected&nbsp;java.lang.Object&nbsp;writeReplace()"},
         {BUG_ID + FS + "serialized-form.html",
-            "protected java.lang.Object <STRONG>readObjectNoData</STRONG>()"},
+            "protected&nbsp;java.lang.Object&nbsp;readObjectNoData()"},
         {BUG_ID + FS + "serialized-form.html",
             "See Also"},
     };
--- a/langtools/test/com/sun/javadoc/testSerializedFormDeprecationInfo/TestSerializedFormDeprecationInfo.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/test/com/sun/javadoc/testSerializedFormDeprecationInfo/TestSerializedFormDeprecationInfo.java	Mon Dec 20 21:10:57 2010 -0800
@@ -41,58 +41,47 @@
     // Test for normal run of javadoc. The serialized-form.html should
     // display the inline comments, tags and deprecation information if any.
     private static final String[][] TEST_CMNT_DEPR = {
-        {BUG_ID + FS + "serialized-form.html", "<DL>" + NL + "<DD><DL>" + NL +
-                 "<DT><STRONG>Throws:</STRONG></DT>" + NL + "<DD><CODE>" +
-                 "java.io.IOException</CODE></DD><DT><STRONG>See Also:</STRONG>" +
-                 "</DT><DD><A HREF=\"pkg1/C1.html#setUndecorated(boolean)\">" +
-                 "<CODE>C1.setUndecorated(boolean)</CODE></A></DD></DL>" + NL +
-                 "</DD>" + NL + "</DL>"},
-        {BUG_ID + FS + "serialized-form.html", "<DL>" + NL +
-                 "<DD><STRONG>Deprecated.</STRONG>&nbsp;<I>As of JDK version " +
-                 "1.5, replaced by" + NL +
-                 " <A HREF=\"pkg1/C1.html#setUndecorated(boolean)\">" +
-                 "<CODE>setUndecorated(boolean)</CODE></A>.</I></DD>" +
-                 "<DD>This field indicates whether the C1 is undecorated." + NL +
-                 "<P>" + NL + "</DD>" + NL + "<DD>&nbsp;</DD>" + NL +
-                 "<DD><DL>" + NL + "<DT><STRONG>Since:</STRONG></DT>" + NL +
-                 "  <DD>1.4</DD>" + NL + "<DT><STRONG>See Also:</STRONG>" +
-                 "</DT><DD><A HREF=\"pkg1/C1.html#setUndecorated(boolean)\">" +
-                 "<CODE>C1.setUndecorated(boolean)</CODE></A></DD></DL>" + NL +
-                 "</DD>" + NL + "</DL>"},
-        {BUG_ID + FS + "serialized-form.html", "<DL>" + NL +
-                 "<DD><STRONG>Deprecated.</STRONG>&nbsp;<I>As of JDK version" +
-                 " 1.5, replaced by" + NL +
-                 " <A HREF=\"pkg1/C1.html#setUndecorated(boolean)\">" +
-                 "<CODE>setUndecorated(boolean)</CODE></A>.</I>" + NL + "<P>" + NL +
-                 "</DD><DD>Reads the object stream." + NL + "<P>" + NL +
-                 "</DD>" + NL + "<DD><DL>" + NL + "<DT><STRONG>Throws:" +
-                 "</STRONG></DT>" + NL + "<DD><CODE><code>" +
-                 "IOException</code></CODE></DD>" + NL +
-                 "<DD><CODE>java.io.IOException</CODE></DD></DL>" + NL +
-                 "</DD>" + NL + "</DL>"},
-        {BUG_ID + FS + "serialized-form.html", "<DL>" + NL +
-                 "<DD><STRONG>Deprecated.</STRONG>&nbsp;</DD><DD>" +
-                 "The name for this class." + NL + "<P>" + NL + "</DD>" + NL +
-                 "<DD>&nbsp;</DD>" + NL + "</DL>"}};
+        {BUG_ID + FS + "serialized-form.html", "<dl>" +
+                 "<dt><span class=\"strong\">Throws:</span></dt>" + NL + "<dd><code>" +
+                 "java.io.IOException</code></dd><dt><span class=\"strong\">See Also:</span>" +
+                 "</dt><dd><a href=\"pkg1/C1.html#setUndecorated(boolean)\">" +
+                 "<code>C1.setUndecorated(boolean)</code></a></dd></dl>"},
+        {BUG_ID + FS + "serialized-form.html", "<span class=\"strong\">Deprecated.</span>" +
+                 "&nbsp;<i>As of JDK version 1.5, replaced by" + NL +
+                 " <a href=\"pkg1/C1.html#setUndecorated(boolean)\">" +
+                 "<code>setUndecorated(boolean)</code></a>.</i></div>" + NL +
+                 "<div class=\"block\">This field indicates whether the C1 " +
+                 "is undecorated.</div>" + NL + "&nbsp;" + NL +
+                 "<dl><dt><span class=\"strong\">Since:</span></dt>" + NL +
+                 "  <dd>1.4</dd>" + NL + "<dt><span class=\"strong\">See Also:</span>" +
+                 "</dt><dd><a href=\"pkg1/C1.html#setUndecorated(boolean)\">" +
+                 "<code>C1.setUndecorated(boolean)</code></a></dd></dl>"},
+        {BUG_ID + FS + "serialized-form.html", "<span class=\"strong\">Deprecated.</span>" +
+                 "&nbsp;<i>As of JDK version 1.5, replaced by" + NL +
+                 " <a href=\"pkg1/C1.html#setUndecorated(boolean)\">" +
+                 "<code>setUndecorated(boolean)</code></a>.</i></div>" + NL +
+                 "<div class=\"block\">Reads the object stream.</div>" + NL +
+                 "<dl><dt><span class=\"strong\">Throws:</span></dt>" + NL + "<dd><code><code>" +
+                 "IOException</code></code></dd>" + NL +
+                 "<dd><code>java.io.IOException</code></dd></dl>"},
+        {BUG_ID + FS + "serialized-form.html", "<span class=\"strong\">Deprecated.</span>" +
+                 "&nbsp;</div>" + NL + "<div class=\"block\">" +
+                 "The name for this class.</div>"}};
 
     // Test with -nocomment option. The serialized-form.html should
     // not display the inline comments and tags but should display deprecation
     // information if any.
     private static final String[][] TEST_NOCMNT = {
-        {BUG_ID + FS + "serialized-form.html", "<PRE>" + NL + "boolean <STRONG>" +
-                 "undecorated</STRONG></PRE>" + NL + "<DL>" + NL + "<DD><STRONG>" +
-                 "Deprecated.</STRONG>&nbsp;<I>As of JDK version 1.5, replaced by" + NL +
-                 " <A HREF=\"pkg1/C1.html#setUndecorated(boolean)\"><CODE>" +
-                 "setUndecorated(boolean)</CODE></A>.</I></DD></DL>"},
-        {BUG_ID + FS + "serialized-form.html", "<DL>" + NL + "<DD><STRONG>" +
-                 "Deprecated.</STRONG>&nbsp;<I>As of JDK version" +
+        {BUG_ID + FS + "serialized-form.html", "<pre>boolean undecorated</pre>" + NL +
+                 "<div class=\"block\"><span class=\"strong\">Deprecated.</span>&nbsp;<i>" +
+                 "As of JDK version 1.5, replaced by" + NL +
+                 " <a href=\"pkg1/C1.html#setUndecorated(boolean)\"><code>" +
+                 "setUndecorated(boolean)</code></a>.</i></div>" + NL + "</li>"},
+        {BUG_ID + FS + "serialized-form.html", "<span class=\"strong\">" +
+                 "Deprecated.</span>&nbsp;<i>As of JDK version" +
                  " 1.5, replaced by" + NL +
-                 " <A HREF=\"pkg1/C1.html#setUndecorated(boolean)\">" +
-                 "<CODE>setUndecorated(boolean)</CODE></A>.</I>" + NL + "<P>" + NL +
-                 "</DD></DL>"},
-        {BUG_ID + FS + "serialized-form.html", "<PRE>" + NL + "int <STRONG>" +
-                 "publicKey</STRONG></PRE>" + NL + "<DL>" + NL + "<DD><STRONG>" +
-                 "Deprecated.</STRONG>&nbsp;</DD></DL>"}};
+                 " <a href=\"pkg1/C1.html#setUndecorated(boolean)\">" +
+                 "<code>setUndecorated(boolean)</code></a>.</i></div>" + NL + "</li>"}};
 
     // Test with -nodeprecated option. The serialized-form.html should
     // ignore the -nodeprecated tag and display the deprecation info. This
--- a/langtools/test/com/sun/javadoc/testSimpleTag/TestSimpleTag.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/test/com/sun/javadoc/testSimpleTag/TestSimpleTag.java	Mon Dec 20 21:10:57 2010 -0800
@@ -42,13 +42,13 @@
     private static final String[][] TEST =
         new String[][] {
             {"./" + BUG_ID + "/C.html",
-                "<STRONG>Todo:</STRONG>"},
+                "<span class=\"strong\">Todo:</span>"},
             {"./" + BUG_ID + "/C.html",
-                "<STRONG>EJB Beans:</STRONG>"},
+                "<span class=\"strong\">EJB Beans:</span>"},
             {"./" + BUG_ID + "/C.html",
-                "<STRONG>Regular Tag:</STRONG>"},
+                "<span class=\"strong\">Regular Tag:</span>"},
             {"./" + BUG_ID + "/C.html",
-                "<STRONG>Back-Slash-Tag:</STRONG>"},
+                "<span class=\"strong\">Back-Slash-Tag:</span>"},
         };
 
     private static final String[] ARGS = new String[] {
--- a/langtools/test/com/sun/javadoc/testStylesheet/TestStylesheet.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/test/com/sun/javadoc/testStylesheet/TestStylesheet.java	Mon Dec 20 21:10:57 2010 -0800
@@ -45,32 +45,24 @@
     //Input for string search tests.
     private static final String[][] TEST = {
         {BUG_ID + FS + "stylesheet.css",
-                "body { background-color: #FFFFFF; color:#000000 }"},
+                "/* Javadoc style sheet */"},
         {BUG_ID + FS + "stylesheet.css",
-                ".TableHeadingColor     { background: #CCCCFF; color:#000000 }"},
-        {BUG_ID + FS + "stylesheet.css",
-                ".TableSubHeadingColor  { background: #EEEEFF; color:#000000 }"},
+                "/*" + NL + "Overall document style" + NL + "*/"},
         {BUG_ID + FS + "stylesheet.css",
-                ".TableRowColor         { background: #FFFFFF; color:#000000 }"},
+                "/*" + NL + "Heading styles" + NL + "*/"},
         {BUG_ID + FS + "stylesheet.css",
-                ".FrameTitleFont   { font-size: 100%; font-family: Helvetica, Arial, sans-serif; color:#000000 }"},
-        {BUG_ID + FS + "stylesheet.css",
-                ".FrameHeadingFont { font-size:  90%; font-family: Helvetica, Arial, sans-serif; color:#000000 }"},
+                "/*" + NL + "Navigation bar styles" + NL + "*/"},
         {BUG_ID + FS + "stylesheet.css",
-                ".FrameItemFont    { font-size:  90%; font-family: Helvetica, Arial, sans-serif; color:#000000 }"},
-        {BUG_ID + FS + "stylesheet.css",
-                ".NavBarCell1    { background-color:#EEEEFF; color:#000000}"},
-        {BUG_ID + FS + "stylesheet.css",
-                ".NavBarCell1Rev { background-color:#00008B; color:#FFFFFF}"},
+                "body {" + NL + "    font-family:Helvetica, Arial, sans-serif;" + NL +
+                "    color:#000000;" + NL + "}"},
         {BUG_ID + FS + "stylesheet.css",
-                ".NavBarFont1    { font-family: Arial, Helvetica, sans-serif; color:#000000;color:#000000;}"},
-        {BUG_ID + FS + "stylesheet.css",
-                ".NavBarFont1Rev { font-family: Arial, Helvetica, sans-serif; color:#FFFFFF;color:#FFFFFF;}"},
-        {BUG_ID + FS + "stylesheet.css",
-                ".NavBarCell2    { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF; color:#000000}"},
-        {BUG_ID + FS + "stylesheet.css",
-                ".NavBarCell3    { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF; color:#000000}"},
-
+                "dl dd ul li {" + NL + "    list-style:none;" + NL +
+                "    margin:10px 0 10px 0;" + NL + "}"},
+        // Test whether a link to the stylesheet file is inserted properly
+        // in the class documentation.
+        {BUG_ID + FS + "pkg" + FS + "A.html",
+                "<link rel=\"stylesheet\" type=\"text/css\" " +
+                "href=\"../stylesheet.css\" title=\"Style\">"}
     };
     private static final String[][] NEGATED_TEST = NO_TEST;
 
--- a/langtools/test/com/sun/javadoc/testSummaryHeading/TestSummaryHeading.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/test/com/sun/javadoc/testSummaryHeading/TestSummaryHeading.java	Mon Dec 20 21:10:57 2010 -0800
@@ -46,8 +46,7 @@
 
     //Input for string search tests.
     private static final String[][] TEST = {
-        {BUG_ID + FS + "C.html",  "<CAPTION CLASS=\"TableCaption\">" + NL +
-                 "Method Summary</CAPTION>"}
+        {BUG_ID + FS + "C.html",  "<h3>Method Summary</h3>"}
     };
     private static final String[][] NEGATED_TEST = NO_TEST;
 
--- a/langtools/test/com/sun/javadoc/testSuperclassInSerialForm/TestSuperClassInSerialForm.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/test/com/sun/javadoc/testSuperclassInSerialForm/TestSuperClassInSerialForm.java	Mon Dec 20 21:10:57 2010 -0800
@@ -39,7 +39,7 @@
 
     private static final String[][] TEST = {
         {BUG_ID + FS + "serialized-form.html",
-         "<A HREF=\"pkg/SubClass.html\" title=\"class in pkg\">pkg.SubClass</A> extends <A HREF=\"pkg/SuperClass.html\" title=\"class in pkg\">SuperClass</A>"}
+         "<a href=\"pkg/SubClass.html\" title=\"class in pkg\">pkg.SubClass</a> extends <a href=\"pkg/SuperClass.html\" title=\"class in pkg\">SuperClass</a>"}
     };
 
     private static final String[][] NEGATED_TEST = NO_TEST;
--- a/langtools/test/com/sun/javadoc/testTagInheritence/TestTagInheritence.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/test/com/sun/javadoc/testTagInheritence/TestTagInheritence.java	Mon Dec 20 21:10:57 2010 -0800
@@ -59,12 +59,12 @@
         //First sentence test (6253614)
         tests[tests.length - 2][0] =BUG_ID + FS + "firstSentence" + FS +
             "B.html";
-        tests[tests.length - 2][1] =  "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;First sentence.</TD>";
+        tests[tests.length - 2][1] =  "<div class=\"block\">First sentence.</div>";
 
         //Another first sentence test (6253604)
         tests[tests.length - 1][0] =BUG_ID + FS + "firstSentence2" + FS +
             "C.html";
-        tests[tests.length - 1][1] =  "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;First sentence.</TD>";
+        tests[tests.length - 1][1] =  "<div class=\"block\">First sentence.</div>";
 
         TestTagInheritence tester = new TestTagInheritence();
         run(tester, ARGS, tests, NO_TEST);
--- a/langtools/test/com/sun/javadoc/testTaglets/TestTaglets.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/test/com/sun/javadoc/testTaglets/TestTaglets.java	Mon Dec 20 21:10:57 2010 -0800
@@ -55,13 +55,15 @@
 
     //Input for string search tests.
     private static final String[][] TEST_4654308 = new String[][] {
-        {"4654308" + FS + "C.html", "<B>Foo:</B><DD>my only method is " +            "<A HREF=\"C.html#method()\"><CODE>here</CODE></A>"}
+        {"4654308" + FS + "C.html", "<span class=\"strong\">Foo:</span></dt>" +
+                 "<dd>my only method is <a href=\"C.html#method()\"><code>here" +
+                 "</code></a></dd></dl>"}
     };
     private static final String[][] NEGATED_TEST_4654308 = NO_TEST;
 
     private static final String[][] TEST_4767038 = new String[][] {
         {"4767038" + FS + "Child.html",
-            "&nbsp;This is the first sentence.</TD>"}
+            "This is the first sentence."}
     };
     private static final String[][] NEGATED_TEST_4767038 = NO_TEST;
 
--- a/langtools/test/com/sun/javadoc/testTaglets/taglets/Foo.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/test/com/sun/javadoc/testTaglets/taglets/Foo.java	Mon Dec 20 21:10:57 2010 -0800
@@ -50,9 +50,9 @@
      */
     public TagletOutput getTagletOutput(Tag tag, TagletWriter writer) {
         ArrayList inlineTags = new ArrayList();
-        inlineTags.add(new TextTag(tag.holder(), "<DT><B>Foo:</B><DD>"));
+        inlineTags.add(new TextTag(tag.holder(), "<dt><span class=\"strong\">Foo:</span></dt><dd>"));
         inlineTags.addAll(Arrays.asList(tag.inlineTags()));
-        inlineTags.add(new TextTag(tag.holder(), "</DD>"));
+        inlineTags.add(new TextTag(tag.holder(), "</dd>"));
         return writer.commentTagsToOutput(tag,
                 (Tag[]) inlineTags.toArray(new Tag[] {}));
     }
--- a/langtools/test/com/sun/javadoc/testThrowsHead/TestThrowsHead.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/test/com/sun/javadoc/testThrowsHead/TestThrowsHead.java	Mon Dec 20 21:10:57 2010 -0800
@@ -38,7 +38,7 @@
 
     private static final String BUG_ID = "4530727";
     private static final String[][] TEST = {
-        {BUG_ID + FS + "C.html", "<DT><STRONG>Throws:</STRONG>"}
+        {BUG_ID + FS + "C.html", "<dt><span class=\"strong\">Throws:</span>"}
     };
     private static final String[][] NEGATED_TEST = NO_TEST;
     private static final String[] ARGS = new String[] {
--- a/langtools/test/com/sun/javadoc/testThrowsTag/TestThrowsTag.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/test/com/sun/javadoc/testThrowsTag/TestThrowsTag.java	Mon Dec 20 21:10:57 2010 -0800
@@ -46,14 +46,14 @@
     //Input for string search tests.
     private static final String[][] TEST = {
         {BUG_ID + FS + "pkg" + FS + "C.html",
-            "<DD><CODE><A HREF=\"../pkg/T1.html\" title=\"class in pkg\">T1</A></CODE> - the first throws tag.</DD>" + NL +
-            "<DD><CODE><A HREF=\"../pkg/T2.html\" title=\"class in pkg\">T2</A></CODE> - the second throws tag.</DD>" + NL +
-            "<DD><CODE><A HREF=\"../pkg/T3.html\" title=\"class in pkg\">T3</A></CODE> - the third throws tag.</DD>" + NL +
-            "<DD><CODE><A HREF=\"../pkg/T4.html\" title=\"class in pkg\">T4</A></CODE> - the fourth throws tag.</DD>" + NL +
-            "<DD><CODE><A HREF=\"../pkg/T5.html\" title=\"class in pkg\">T5</A></CODE> - the first inherited throws tag.</DD>" + NL +
-            "<DD><CODE><A HREF=\"../pkg/T6.html\" title=\"class in pkg\">T6</A></CODE> - the second inherited throws tag.</DD>" + NL +
-            "<DD><CODE><A HREF=\"../pkg/T7.html\" title=\"class in pkg\">T7</A></CODE> - the third inherited throws tag.</DD>" + NL +
-            "<DD><CODE><A HREF=\"../pkg/T8.html\" title=\"class in pkg\">T8</A></CODE> - the fourth inherited throws tag.</DD>"
+            "<dd><code><a href=\"../pkg/T1.html\" title=\"class in pkg\">T1</a></code> - the first throws tag.</dd>" + NL +
+            "<dd><code><a href=\"../pkg/T2.html\" title=\"class in pkg\">T2</a></code> - the second throws tag.</dd>" + NL +
+            "<dd><code><a href=\"../pkg/T3.html\" title=\"class in pkg\">T3</a></code> - the third throws tag.</dd>" + NL +
+            "<dd><code><a href=\"../pkg/T4.html\" title=\"class in pkg\">T4</a></code> - the fourth throws tag.</dd>" + NL +
+            "<dd><code><a href=\"../pkg/T5.html\" title=\"class in pkg\">T5</a></code> - the first inherited throws tag.</dd>" + NL +
+            "<dd><code><a href=\"../pkg/T6.html\" title=\"class in pkg\">T6</a></code> - the second inherited throws tag.</dd>" + NL +
+            "<dd><code><a href=\"../pkg/T7.html\" title=\"class in pkg\">T7</a></code> - the third inherited throws tag.</dd>" + NL +
+            "<dd><code><a href=\"../pkg/T8.html\" title=\"class in pkg\">T8</a></code> - the fourth inherited throws tag.</dd>"
         },
     };
     private static final String[][] NEGATED_TEST = NO_TEST;
--- a/langtools/test/com/sun/javadoc/testTitleInHref/TestTitleInHref.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/test/com/sun/javadoc/testTitleInHref/TestTitleInHref.java	Mon Dec 20 21:10:57 2010 -0800
@@ -38,13 +38,13 @@
 
     private static final String[][] TEST = {
         //Test to make sure that the title shows up in a class link.
-        {BUG_ID + FS + "pkg" + FS + "Links.html", "<A HREF=\"../pkg/Class.html\" title=\"class in pkg\">"},
+        {BUG_ID + FS + "pkg" + FS + "Links.html", "<a href=\"../pkg/Class.html\" title=\"class in pkg\">"},
 
         //Test to make sure that the title shows up in an interface link.
-        {BUG_ID + FS + "pkg" + FS + "Links.html", "<A HREF=\"../pkg/Interface.html\" title=\"interface in pkg\">"},
+        {BUG_ID + FS + "pkg" + FS + "Links.html", "<a href=\"../pkg/Interface.html\" title=\"interface in pkg\">"},
 
         //Test to make sure that the title shows up in cross link shows up
-        {BUG_ID + FS + "pkg" + FS + "Links.html", "<A HREF=\"http://java.sun.com/j2se/1.4/docs/api/java/io/File.html?is-external=true\" title=\"class or interface in java.io\"><CODE>This is a cross link to class File</CODE></A>"},
+        {BUG_ID + FS + "pkg" + FS + "Links.html", "<a href=\"http://java.sun.com/j2se/1.4/docs/api/java/io/File.html?is-external=true\" title=\"class or interface in java.io\"><code>This is a cross link to class File</code></a>"},
 
     };
 
--- a/langtools/test/com/sun/javadoc/testTypeParams/TestTypeParameters.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/test/com/sun/javadoc/testTypeParams/TestTypeParameters.java	Mon Dec 20 21:10:57 2010 -0800
@@ -49,16 +49,17 @@
     private static final String[][] TEST =
     {
         {BUG_ID + FS + "pkg" + FS + "C.html",
-            "<CODE>&lt;W extends java.lang.String,V extends java.util.List&gt; " + NL +
-            "<BR>" + NL +
-            "java.lang.Object</CODE>"},
+            "<td class=\"colFirst\"><code>&lt;W extends java.lang.String,V extends " +
+            "java.util.List&gt;&nbsp;<br>java.lang.Object</code></td>"},
         {BUG_ID + FS + "pkg" + FS + "C.html",
-            "<CODE>&lt;T&gt; java.lang.Object</CODE>"},
+            "<code>&lt;T&gt;&nbsp;java.lang.Object</code>"},
         {BUG_ID + FS + "pkg" + FS + "package-summary.html",
             "C&lt;E extends Parent&gt;"},
         //Nested type parameters
         {BUG_ID + FS + "pkg" + FS + "C.html",
-            "<A NAME=\"formatDetails(java.util.Collection, java.util.Collection)\"><!-- --></A>"},
+            "<a name=\"formatDetails(java.util.Collection, java.util.Collection)\">" + NL +
+            "<!--   -->" + NL +
+            "</a>"},
 
     };
     private static final String[][] NEGATED_TEST = NO_TEST;
--- a/langtools/test/com/sun/javadoc/testUnnamedPackage/TestUnnamedPackage.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/test/com/sun/javadoc/testUnnamedPackage/TestUnnamedPackage.java	Mon Dec 20 21:10:57 2010 -0800
@@ -46,7 +46,7 @@
     //Input for string search tests.
     private static final String[][] TEST = {
         {BUG_ID + FS + "package-summary.html",
-            "<H2>"+NL+"Package &lt;Unnamed&gt;"+NL+"</H2>"
+            "<h1 title=\"Package\" class=\"title\">Package&nbsp;&lt;Unnamed&gt;</h1>"
         },
         {BUG_ID + FS + "package-summary.html",
             "This is a package comment for the unnamed package."
@@ -55,12 +55,12 @@
             "This is a class in the unnamed package."
         },
         {BUG_ID + FS + "package-tree.html",
-            "<H2>"+NL+"Hierarchy For Package &lt;Unnamed&gt;"+NL+"</H2>"
+            "<h1 class=\"title\">Hierarchy For Package &lt;Unnamed&gt;</h1>"
         },
         {BUG_ID + FS + "index-all.html",
             "title=\"class in &lt;Unnamed&gt;\""
         },
-        {BUG_ID + FS + "C.html", "<A HREF=\"package-summary.html\">"}
+        {BUG_ID + FS + "C.html", "<a href=\"package-summary.html\">"}
     };
     private static final String[][] NEGATED_TEST = {
         {ERROR_OUTPUT, "BadSource"},
--- a/langtools/test/com/sun/javadoc/testValueTag/TestValueTag.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/test/com/sun/javadoc/testValueTag/TestValueTag.java	Mon Dec 20 21:10:57 2010 -0800
@@ -52,44 +52,44 @@
             "Result:  \"Test 1 passes\""},
         //Retrieve value of constant in same class.
         {BUG_ID + FS + "pkg1" + FS + "Class1.html",
-            "Result:  <A HREF=\"../pkg1/Class1.html#TEST_2_PASSES\">\"Test 2 passes\"</A>"},
+            "Result:  <a href=\"../pkg1/Class1.html#TEST_2_PASSES\">\"Test 2 passes\"</a>"},
         {BUG_ID + FS + "pkg1" + FS + "Class1.html",
-            "Result:  <A HREF=\"../pkg1/Class1.html#TEST_3_PASSES\">\"Test 3 passes\"</A>"},
+            "Result:  <a href=\"../pkg1/Class1.html#TEST_3_PASSES\">\"Test 3 passes\"</a>"},
         {BUG_ID + FS + "pkg1" + FS + "Class1.html",
-            "Result:  <A HREF=\"../pkg1/Class1.html#TEST_4_PASSES\">\"Test 4 passes\"</A>"},
+            "Result:  <a href=\"../pkg1/Class1.html#TEST_4_PASSES\">\"Test 4 passes\"</a>"},
         {BUG_ID + FS + "pkg1" + FS + "Class1.html",
-            "Result:  <A HREF=\"../pkg1/Class1.html#TEST_5_PASSES\">\"Test 5 passes\"</A>"},
+            "Result:  <a href=\"../pkg1/Class1.html#TEST_5_PASSES\">\"Test 5 passes\"</a>"},
         {BUG_ID + FS + "pkg1" + FS + "Class1.html",
-            "Result:  <A HREF=\"../pkg1/Class1.html#TEST_6_PASSES\">\"Test 6 passes\"</A>"},
+            "Result:  <a href=\"../pkg1/Class1.html#TEST_6_PASSES\">\"Test 6 passes\"</a>"},
         //Retrieve value of constant in different class.
         {BUG_ID + FS + "pkg1" + FS + "Class2.html",
-            "Result:  <A HREF=\"../pkg1/Class1.html#TEST_7_PASSES\">\"Test 7 passes\"</A>"},
+            "Result:  <a href=\"../pkg1/Class1.html#TEST_7_PASSES\">\"Test 7 passes\"</a>"},
         {BUG_ID + FS + "pkg1" + FS + "Class2.html",
-            "Result:  <A HREF=\"../pkg1/Class1.html#TEST_8_PASSES\">\"Test 8 passes\"</A>"},
+            "Result:  <a href=\"../pkg1/Class1.html#TEST_8_PASSES\">\"Test 8 passes\"</a>"},
         {BUG_ID + FS + "pkg1" + FS + "Class2.html",
-            "Result:  <A HREF=\"../pkg1/Class1.html#TEST_9_PASSES\">\"Test 9 passes\"</A>"},
+            "Result:  <a href=\"../pkg1/Class1.html#TEST_9_PASSES\">\"Test 9 passes\"</a>"},
         {BUG_ID + FS + "pkg1" + FS + "Class2.html",
-            "Result:  <A HREF=\"../pkg1/Class1.html#TEST_10_PASSES\">\"Test 10 passes\"</A>"},
+            "Result:  <a href=\"../pkg1/Class1.html#TEST_10_PASSES\">\"Test 10 passes\"</a>"},
         {BUG_ID + FS + "pkg1" + FS + "Class2.html",
-            "Result:  <A HREF=\"../pkg1/Class1.html#TEST_11_PASSES\">\"Test 11 passes\"</A>"},
+            "Result:  <a href=\"../pkg1/Class1.html#TEST_11_PASSES\">\"Test 11 passes\"</a>"},
         //Retrieve value of constant in different package
         {BUG_ID + FS + "pkg1" + FS + "Class2.html",
-            "Result:  <A HREF=\"../pkg2/Class3.html#TEST_12_PASSES\">\"Test 12 passes\"</A>"},
+            "Result:  <a href=\"../pkg2/Class3.html#TEST_12_PASSES\">\"Test 12 passes\"</a>"},
         {BUG_ID + FS + "pkg1" + FS + "Class2.html",
-            "Result:  <A HREF=\"../pkg2/Class3.html#TEST_13_PASSES\">\"Test 13 passes\"</A>"},
+            "Result:  <a href=\"../pkg2/Class3.html#TEST_13_PASSES\">\"Test 13 passes\"</a>"},
         {BUG_ID + FS + "pkg1" + FS + "Class2.html",
-            "Result:  <A HREF=\"../pkg2/Class3.html#TEST_14_PASSES\">\"Test 14 passes\"</A>"},
+            "Result:  <a href=\"../pkg2/Class3.html#TEST_14_PASSES\">\"Test 14 passes\"</a>"},
         {BUG_ID + FS + "pkg1" + FS + "Class2.html",
-            "Result:  <A HREF=\"../pkg2/Class3.html#TEST_15_PASSES\">\"Test 15 passes\"</A>"},
+            "Result:  <a href=\"../pkg2/Class3.html#TEST_15_PASSES\">\"Test 15 passes\"</a>"},
         {BUG_ID + FS + "pkg1" + FS + "Class2.html",
-            "Result:  <A HREF=\"../pkg2/Class3.html#TEST_16_PASSES\">\"Test 16 passes\"</A>"},
+            "Result:  <a href=\"../pkg2/Class3.html#TEST_16_PASSES\">\"Test 16 passes\"</a>"},
         //Retrieve value of constant from a package page
         {BUG_ID + FS + "pkg2" + FS + "package-summary.html",
-            "Result: <A HREF=\"../pkg2/Class3.html#TEST_17_PASSES\">\"Test 17 passes\"</A>"},
+            "Result: <a href=\"../pkg2/Class3.html#TEST_17_PASSES\">\"Test 17 passes\"</a>"},
         //Test @value tag used with custom tag.
         {BUG_ID + FS + "pkg1" + FS + "CustomTagUsage.html",
-            "<DT><STRONG>Todo:</STRONG></DT>" + NL +
-                "  <DD>the value of this constant is 55.</DD>"},
+            "<dt><span class=\"strong\">Todo:</span></dt>" + NL +
+                "  <dd>the value of this constant is 55.</dd>"},
         //Test @value warning printed when used with non-constant.
         {WARNING_OUTPUT,"warning - @value tag (which references nonConstant) " +
             "can only be used in constants."
--- a/langtools/test/com/sun/javadoc/testWarnings/TestWarnings.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/test/com/sun/javadoc/testWarnings/TestWarnings.java	Mon Dec 20 21:10:57 2010 -0800
@@ -65,9 +65,9 @@
     };
 
     private static final String[][] TEST2 = {
-        {BUG_ID + FS + "pkg" + FS + "X.html", "<A HREF=\"../pkg/X.html#m()\"><CODE>m()</CODE></A><br/>"},
-        {BUG_ID + FS + "pkg" + FS + "X.html", "<A HREF=\"../pkg/X.html#X()\"><CODE>X()</CODE></A><br/>"},
-        {BUG_ID + FS + "pkg" + FS + "X.html", "<A HREF=\"../pkg/X.html#f\"><CODE>f</CODE></A><br/>"},
+        {BUG_ID + FS + "pkg" + FS + "X.html", "<a href=\"../pkg/X.html#m()\"><code>m()</code></a><br/>"},
+        {BUG_ID + FS + "pkg" + FS + "X.html", "<a href=\"../pkg/X.html#X()\"><code>X()</code></a><br/>"},
+        {BUG_ID + FS + "pkg" + FS + "X.html", "<a href=\"../pkg/X.html#f\"><code>f</code></a><br/>"},
     };
 
     private static final String[][] NEGATED_TEST2 = NO_TEST;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/4917091/Test255.java	Mon Dec 20 21:10:57 2010 -0800
@@ -0,0 +1,89 @@
+/*
+ * Copyright 2010 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute 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 4917091
+ * @summary javac rejects array over 128 in length
+ */
+
+
+public class Test255 {
+    public static void main(String... args) {
+            // allocating an array with 255 dimensions is allowed
+            Object expected = (Object)new Object
+                [1/*001*/][1/*002*/][1/*003*/][1/*004*/][1/*005*/]
+                [1/*006*/][1/*007*/][1/*008*/][1/*009*/][1/*010*/]
+                [1/*011*/][1/*012*/][1/*013*/][1/*014*/][1/*015*/]
+                [1/*016*/][1/*017*/][1/*018*/][1/*019*/][1/*020*/]
+                [1/*021*/][1/*022*/][1/*023*/][1/*024*/][1/*025*/]
+                [1/*026*/][1/*027*/][1/*028*/][1/*029*/][1/*030*/]
+                [1/*031*/][1/*032*/][1/*033*/][1/*034*/][1/*035*/]
+                [1/*036*/][1/*037*/][1/*038*/][1/*039*/][1/*040*/]
+                [1/*041*/][1/*042*/][1/*043*/][1/*044*/][1/*045*/]
+                [1/*046*/][1/*047*/][1/*048*/][1/*049*/][1/*050*/]
+                [1/*051*/][1/*052*/][1/*053*/][1/*054*/][1/*055*/]
+                [1/*056*/][1/*057*/][1/*058*/][1/*059*/][1/*060*/]
+                [1/*061*/][1/*062*/][1/*063*/][1/*064*/][1/*065*/]
+                [1/*066*/][1/*067*/][1/*068*/][1/*069*/][1/*070*/]
+                [1/*071*/][1/*072*/][1/*073*/][1/*074*/][1/*075*/]
+                [1/*076*/][1/*077*/][1/*078*/][1/*079*/][1/*080*/]
+                [1/*081*/][1/*082*/][1/*083*/][1/*084*/][1/*085*/]
+                [1/*086*/][1/*087*/][1/*088*/][1/*089*/][1/*090*/]
+                [1/*091*/][1/*092*/][1/*093*/][1/*094*/][1/*095*/]
+                [1/*096*/][1/*097*/][1/*098*/][1/*099*/][1/*100*/]
+
+                [1/*101*/][1/*102*/][1/*103*/][1/*104*/][1/*105*/]
+                [1/*106*/][1/*107*/][1/*108*/][1/*109*/][1/*110*/]
+                [1/*111*/][1/*112*/][1/*113*/][1/*114*/][1/*115*/]
+                [1/*116*/][1/*117*/][1/*118*/][1/*119*/][1/*120*/]
+                [1/*121*/][1/*122*/][1/*123*/][1/*124*/][1/*125*/]
+                [1/*126*/][1/*127*/][1/*128*/][1/*129*/][1/*130*/]
+                [1/*131*/][1/*132*/][1/*133*/][1/*134*/][1/*135*/]
+                [1/*136*/][1/*137*/][1/*138*/][1/*139*/][1/*140*/]
+                [1/*141*/][1/*142*/][1/*143*/][1/*144*/][1/*145*/]
+                [1/*146*/][1/*147*/][1/*148*/][1/*149*/][1/*150*/]
+                [1/*151*/][1/*152*/][1/*153*/][1/*154*/][1/*155*/]
+                [1/*156*/][1/*157*/][1/*158*/][1/*159*/][1/*160*/]
+                [1/*161*/][1/*162*/][1/*163*/][1/*164*/][1/*165*/]
+                [1/*166*/][1/*167*/][1/*168*/][1/*169*/][1/*170*/]
+                [1/*171*/][1/*172*/][1/*173*/][1/*174*/][1/*175*/]
+                [1/*176*/][1/*177*/][1/*178*/][1/*179*/][1/*180*/]
+                [1/*181*/][1/*182*/][1/*183*/][1/*184*/][1/*185*/]
+                [1/*186*/][1/*187*/][1/*188*/][1/*189*/][1/*190*/]
+                [1/*191*/][1/*192*/][1/*193*/][1/*194*/][1/*195*/]
+                [1/*196*/][1/*197*/][1/*198*/][1/*199*/][1/*200*/]
+
+                [1/*201*/][1/*202*/][1/*203*/][1/*204*/][1/*205*/]
+                [1/*206*/][1/*207*/][1/*208*/][1/*209*/][1/*210*/]
+                [1/*211*/][1/*212*/][1/*213*/][1/*214*/][1/*215*/]
+                [1/*216*/][1/*217*/][1/*218*/][1/*219*/][1/*220*/]
+                [1/*221*/][1/*222*/][1/*223*/][1/*224*/][1/*225*/]
+                [1/*226*/][1/*227*/][1/*228*/][1/*229*/][1/*230*/]
+                [1/*231*/][1/*232*/][1/*233*/][1/*234*/][1/*235*/]
+                [1/*236*/][1/*237*/][1/*238*/][1/*239*/][1/*240*/]
+                [1/*241*/][1/*242*/][1/*243*/][1/*244*/][1/*245*/]
+                [1/*246*/][1/*247*/][1/*248*/][1/*249*/][1/*250*/]
+                [1/*251*/][1/*252*/][1/*253*/][1/*254*/][1/*255*/];
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/4917091/Test256a.java	Mon Dec 20 21:10:57 2010 -0800
@@ -0,0 +1,88 @@
+/*
+ * Copyright 2010 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute 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 4917091
+ * @summary javac rejects array over 128 in length
+ * @compile/fail/ref=Test256a.out -XDrawDiagnostics Test256a.java
+ */
+
+public class Test256a {
+            // allocating an array with more than 255 dimensions is not allowed
+            static Object expected = (Object)new Object
+                [1/*001*/][1/*002*/][1/*003*/][1/*004*/][1/*005*/]
+                [1/*006*/][1/*007*/][1/*008*/][1/*009*/][1/*010*/]
+                [1/*011*/][1/*012*/][1/*013*/][1/*014*/][1/*015*/]
+                [1/*016*/][1/*017*/][1/*018*/][1/*019*/][1/*020*/]
+                [1/*021*/][1/*022*/][1/*023*/][1/*024*/][1/*025*/]
+                [1/*026*/][1/*027*/][1/*028*/][1/*029*/][1/*030*/]
+                [1/*031*/][1/*032*/][1/*033*/][1/*034*/][1/*035*/]
+                [1/*036*/][1/*037*/][1/*038*/][1/*039*/][1/*040*/]
+                [1/*041*/][1/*042*/][1/*043*/][1/*044*/][1/*045*/]
+                [1/*046*/][1/*047*/][1/*048*/][1/*049*/][1/*050*/]
+                [1/*051*/][1/*052*/][1/*053*/][1/*054*/][1/*055*/]
+                [1/*056*/][1/*057*/][1/*058*/][1/*059*/][1/*060*/]
+                [1/*061*/][1/*062*/][1/*063*/][1/*064*/][1/*065*/]
+                [1/*066*/][1/*067*/][1/*068*/][1/*069*/][1/*070*/]
+                [1/*071*/][1/*072*/][1/*073*/][1/*074*/][1/*075*/]
+                [1/*076*/][1/*077*/][1/*078*/][1/*079*/][1/*080*/]
+                [1/*081*/][1/*082*/][1/*083*/][1/*084*/][1/*085*/]
+                [1/*086*/][1/*087*/][1/*088*/][1/*089*/][1/*090*/]
+                [1/*091*/][1/*092*/][1/*093*/][1/*094*/][1/*095*/]
+                [1/*096*/][1/*097*/][1/*098*/][1/*099*/][1/*100*/]
+
+                [1/*101*/][1/*102*/][1/*103*/][1/*104*/][1/*105*/]
+                [1/*106*/][1/*107*/][1/*108*/][1/*109*/][1/*110*/]
+                [1/*111*/][1/*112*/][1/*113*/][1/*114*/][1/*115*/]
+                [1/*116*/][1/*117*/][1/*118*/][1/*119*/][1/*120*/]
+                [1/*121*/][1/*122*/][1/*123*/][1/*124*/][1/*125*/]
+                [1/*126*/][1/*127*/][1/*128*/][1/*129*/][1/*130*/]
+                [1/*131*/][1/*132*/][1/*133*/][1/*134*/][1/*135*/]
+                [1/*136*/][1/*137*/][1/*138*/][1/*139*/][1/*140*/]
+                [1/*141*/][1/*142*/][1/*143*/][1/*144*/][1/*145*/]
+                [1/*146*/][1/*147*/][1/*148*/][1/*149*/][1/*150*/]
+                [1/*151*/][1/*152*/][1/*153*/][1/*154*/][1/*155*/]
+                [1/*156*/][1/*157*/][1/*158*/][1/*159*/][1/*160*/]
+                [1/*161*/][1/*162*/][1/*163*/][1/*164*/][1/*165*/]
+                [1/*166*/][1/*167*/][1/*168*/][1/*169*/][1/*170*/]
+                [1/*171*/][1/*172*/][1/*173*/][1/*174*/][1/*175*/]
+                [1/*176*/][1/*177*/][1/*178*/][1/*179*/][1/*180*/]
+                [1/*181*/][1/*182*/][1/*183*/][1/*184*/][1/*185*/]
+                [1/*186*/][1/*187*/][1/*188*/][1/*189*/][1/*190*/]
+                [1/*191*/][1/*192*/][1/*193*/][1/*194*/][1/*195*/]
+                [1/*196*/][1/*197*/][1/*198*/][1/*199*/][1/*200*/]
+
+                [1/*201*/][1/*202*/][1/*203*/][1/*204*/][1/*205*/]
+                [1/*206*/][1/*207*/][1/*208*/][1/*209*/][1/*210*/]
+                [1/*211*/][1/*212*/][1/*213*/][1/*214*/][1/*215*/]
+                [1/*216*/][1/*217*/][1/*218*/][1/*219*/][1/*220*/]
+                [1/*221*/][1/*222*/][1/*223*/][1/*224*/][1/*225*/]
+                [1/*226*/][1/*227*/][1/*228*/][1/*229*/][1/*230*/]
+                [1/*231*/][1/*232*/][1/*233*/][1/*234*/][1/*235*/]
+                [1/*236*/][1/*237*/][1/*238*/][1/*239*/][1/*240*/]
+                [1/*241*/][1/*242*/][1/*243*/][1/*244*/][1/*245*/]
+                [1/*246*/][1/*247*/][1/*248*/][1/*249*/][1/*250*/]
+                [1/*251*/][1/*252*/][1/*253*/][1/*254*/][1/*255*/]
+                [1/*256*/];
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/4917091/Test256a.out	Mon Dec 20 21:10:57 2010 -0800
@@ -0,0 +1,2 @@
+Test256a.java:33:46: compiler.err.limit.dimensions
+1 error
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/4917091/Test256b.java	Mon Dec 20 21:10:57 2010 -0800
@@ -0,0 +1,91 @@
+/*
+ * Copyright 2010 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute 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 4917091
+ * @summary javac rejects array over 128 in length
+ * @compile/fail/ref=Test256b.out -XDrawDiagnostics Test256b.java
+ */
+
+public class Test256b {
+            // allocating an array with 255 dimensions whose component
+            // type provides additional dimensions is not allowed,
+            // since the type descriptor for any array is limited to
+            // 255 dimensions: JVMS3, section 4.3.2.
+            static Object expected = (Object)new Object
+                [1/*001*/][1/*002*/][1/*003*/][1/*004*/][1/*005*/]
+                [1/*006*/][1/*007*/][1/*008*/][1/*009*/][1/*010*/]
+                [1/*011*/][1/*012*/][1/*013*/][1/*014*/][1/*015*/]
+                [1/*016*/][1/*017*/][1/*018*/][1/*019*/][1/*020*/]
+                [1/*021*/][1/*022*/][1/*023*/][1/*024*/][1/*025*/]
+                [1/*026*/][1/*027*/][1/*028*/][1/*029*/][1/*030*/]
+                [1/*031*/][1/*032*/][1/*033*/][1/*034*/][1/*035*/]
+                [1/*036*/][1/*037*/][1/*038*/][1/*039*/][1/*040*/]
+                [1/*041*/][1/*042*/][1/*043*/][1/*044*/][1/*045*/]
+                [1/*046*/][1/*047*/][1/*048*/][1/*049*/][1/*050*/]
+                [1/*051*/][1/*052*/][1/*053*/][1/*054*/][1/*055*/]
+                [1/*056*/][1/*057*/][1/*058*/][1/*059*/][1/*060*/]
+                [1/*061*/][1/*062*/][1/*063*/][1/*064*/][1/*065*/]
+                [1/*066*/][1/*067*/][1/*068*/][1/*069*/][1/*070*/]
+                [1/*071*/][1/*072*/][1/*073*/][1/*074*/][1/*075*/]
+                [1/*076*/][1/*077*/][1/*078*/][1/*079*/][1/*080*/]
+                [1/*081*/][1/*082*/][1/*083*/][1/*084*/][1/*085*/]
+                [1/*086*/][1/*087*/][1/*088*/][1/*089*/][1/*090*/]
+                [1/*091*/][1/*092*/][1/*093*/][1/*094*/][1/*095*/]
+                [1/*096*/][1/*097*/][1/*098*/][1/*099*/][1/*100*/]
+
+                [1/*101*/][1/*102*/][1/*103*/][1/*104*/][1/*105*/]
+                [1/*106*/][1/*107*/][1/*108*/][1/*109*/][1/*110*/]
+                [1/*111*/][1/*112*/][1/*113*/][1/*114*/][1/*115*/]
+                [1/*116*/][1/*117*/][1/*118*/][1/*119*/][1/*120*/]
+                [1/*121*/][1/*122*/][1/*123*/][1/*124*/][1/*125*/]
+                [1/*126*/][1/*127*/][1/*128*/][1/*129*/][1/*130*/]
+                [1/*131*/][1/*132*/][1/*133*/][1/*134*/][1/*135*/]
+                [1/*136*/][1/*137*/][1/*138*/][1/*139*/][1/*140*/]
+                [1/*141*/][1/*142*/][1/*143*/][1/*144*/][1/*145*/]
+                [1/*146*/][1/*147*/][1/*148*/][1/*149*/][1/*150*/]
+                [1/*151*/][1/*152*/][1/*153*/][1/*154*/][1/*155*/]
+                [1/*156*/][1/*157*/][1/*158*/][1/*159*/][1/*160*/]
+                [1/*161*/][1/*162*/][1/*163*/][1/*164*/][1/*165*/]
+                [1/*166*/][1/*167*/][1/*168*/][1/*169*/][1/*170*/]
+                [1/*171*/][1/*172*/][1/*173*/][1/*174*/][1/*175*/]
+                [1/*176*/][1/*177*/][1/*178*/][1/*179*/][1/*180*/]
+                [1/*181*/][1/*182*/][1/*183*/][1/*184*/][1/*185*/]
+                [1/*186*/][1/*187*/][1/*188*/][1/*189*/][1/*190*/]
+                [1/*191*/][1/*192*/][1/*193*/][1/*194*/][1/*195*/]
+                [1/*196*/][1/*197*/][1/*198*/][1/*199*/][1/*200*/]
+
+                [1/*201*/][1/*202*/][1/*203*/][1/*204*/][1/*205*/]
+                [1/*206*/][1/*207*/][1/*208*/][1/*209*/][1/*210*/]
+                [1/*211*/][1/*212*/][1/*213*/][1/*214*/][1/*215*/]
+                [1/*216*/][1/*217*/][1/*218*/][1/*219*/][1/*220*/]
+                [1/*221*/][1/*222*/][1/*223*/][1/*224*/][1/*225*/]
+                [1/*226*/][1/*227*/][1/*228*/][1/*229*/][1/*230*/]
+                [1/*231*/][1/*232*/][1/*233*/][1/*234*/][1/*235*/]
+                [1/*236*/][1/*237*/][1/*238*/][1/*239*/][1/*240*/]
+                [1/*241*/][1/*242*/][1/*243*/][1/*244*/][1/*245*/]
+                [1/*246*/][1/*247*/][1/*248*/][1/*249*/][1/*250*/]
+                [1/*251*/][1/*252*/][1/*253*/][1/*254*/][1/*255*/]
+                [];
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/4917091/Test256b.out	Mon Dec 20 21:10:57 2010 -0800
@@ -0,0 +1,2 @@
+Test256b.java:36:46: compiler.err.limit.dimensions
+1 error
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/DefiniteAssignment/7003744/T7003744a.java	Mon Dec 20 21:10:57 2010 -0800
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 7003744 6999622
+ * @summary Compiler error concerning final variables
+ * @author mcimadamore
+ *
+ * @compile T7003744a.java
+ */
+
+class T7003744a {
+    final Object x;
+
+    T7003744a() {
+        {
+            int inx = 0;
+            for(int i = 0; i < 5; i++) { }
+        }
+        for(String am: new String[1]) {
+            final String mode = am;
+        }
+
+        x = null;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/DefiniteAssignment/7003744/T7003744b.java	Mon Dec 20 21:10:57 2010 -0800
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 7003744 6999622
+ * @summary Compiler error concerning final variables
+ * @author mcimadamore
+ *
+ * @compile T7003744b.java
+ */
+
+class T7003744b {
+    void test() {
+        final int bogus;
+
+        for (int i1 = 0, i2 = 2; i1 < i2; i1++) {
+         final int i_1 = 2;
+        }
+        for (Object o : new Object[] { null }) {
+         final int i_2 = 2;
+        }
+
+        bogus = 4;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/T6999210.java	Mon Dec 20 21:10:57 2010 -0800
@@ -0,0 +1,124 @@
+/*
+ * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 6999210
+ * @summary javac should be able to warn of anomalous conditions in classfiles
+ */
+
+import java.io.*;
+import java.util.*;
+
+public class T6999210 {
+    public static void main(String... args) throws Exception {
+        new T6999210().run();
+    }
+
+    void run() throws Exception {
+        File srcDir = new File("src");
+        File classesDir = new File("classes");
+        classesDir.mkdirs();
+
+        File c_java = writeFile(srcDir, "C.java", "class C<T> { }");
+        compile("-d", classesDir.getPath(), c_java.getPath());
+        File c_class = new File(classesDir, "C.class");
+        setMajorVersion(c_class, 48);
+        File d_java = writeFile(srcDir, "D.java", "class D { C c; }");
+
+        // verify no warning if -Xlint:classfile not enabled
+        String out1 = compile(
+            "-d", classesDir.getPath(),
+            "-classpath", classesDir.getPath(),
+            d_java.getPath());
+        if (out1.length() > 0)
+            error("unexpected output from javac");
+
+        // sanity check of warning when -XDrawDiagnostics not used
+        String out2 = compile(
+            "-d", classesDir.getPath(),
+            "-classpath", classesDir.getPath(),
+            "-Xlint:classfile",
+            d_java.getPath());
+        if (!out2.contains("[classfile]"))
+            error("expected output \"[classfile]\" not found");
+
+        // check specific details, using -XDrawDiagnostics
+        String out3 = compile(
+            "-d", classesDir.getPath(),
+            "-classpath", classesDir.getPath(),
+            "-Xlint:classfile", "-XDrawDiagnostics",
+            d_java.getPath());
+        String expect = "C.class:-:-: compiler.warn.future.attr: Signature, 49, 0, 48, 0";
+        if (!out3.contains(expect))
+            error("expected output \"" + expect + "\" not found");
+
+        if (errors > 0)
+            throw new Exception(errors + " errors occurred");
+    }
+
+    String compile(String... args) throws Exception {
+        System.err.println("compile: " + Arrays.asList(args));
+        StringWriter sw = new StringWriter();
+        PrintWriter pw = new PrintWriter(sw);
+        int rc = com.sun.tools.javac.Main.compile(args, pw);
+        pw.close();
+        String out = sw.toString();
+        if (out.length() > 0)
+            System.err.println(out);
+        if (rc != 0)
+            throw new Exception("compilation failed, rc=" + rc);
+        return out;
+    }
+
+    void setMajorVersion(File f, int major) throws IOException {
+        int len = (int) f.length();
+        byte[] data = new byte[len];
+        try (DataInputStream in = new DataInputStream(new FileInputStream(f))) {
+            in.readFully(data);
+        }
+        // u4 magic
+        // u2 minor
+        data[6] = (byte) (major >> 8);
+        data[7] = (byte) (major & 0xff);
+        try (FileOutputStream out = new FileOutputStream(f)) {
+            out.write(data);
+        }
+    }
+
+    File writeFile(File dir, String path, String body) throws IOException {
+        File f = new File(dir, path);
+        f.getParentFile().mkdirs();
+        try (FileWriter out = new FileWriter(f)) {
+            out.write(body);
+        }
+        return f;
+    }
+
+    void error(String msg) {
+        System.err.println("Error: " + msg);
+        errors++;
+    }
+
+    int errors;
+}
--- a/langtools/test/tools/javac/annotations/6214965/T6214965.out	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/test/tools/javac/annotations/6214965/T6214965.out	Mon Dec 20 21:10:57 2010 -0800
@@ -1,2 +1,2 @@
-- compiler.warn.annotation.method.not.found: CompilerAnnotationTest2, name2
+CompilerAnnotationTest.class:-:-: compiler.warn.annotation.method.not.found: CompilerAnnotationTest2, name2
 1 warning
--- a/langtools/test/tools/javac/annotations/6365854/test1.out	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/test/tools/javac/annotations/6365854/test1.out	Mon Dec 20 21:10:57 2010 -0800
@@ -1,2 +1,2 @@
-- compiler.warn.annotation.method.not.found.reason: test.annotation.TestAnnotation, test, (compiler.misc.class.file.not.found: test.annotation.TestAnnotation)
+TestCore.class:-:-: compiler.warn.annotation.method.not.found.reason: test.annotation.TestAnnotation, test, (compiler.misc.class.file.not.found: test.annotation.TestAnnotation)
 1 warning
--- a/langtools/test/tools/javac/annotations/6365854/test2.out	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/test/tools/javac/annotations/6365854/test2.out	Mon Dec 20 21:10:57 2010 -0800
@@ -1,2 +1,2 @@
-- compiler.warn.annotation.method.not.found: test.annotation.TestAnnotation, test
+TestCore.class:-:-: compiler.warn.annotation.method.not.found: test.annotation.TestAnnotation, test
 1 warning
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/api/TestDocComments.java	Mon Dec 20 21:10:57 2010 -0800
@@ -0,0 +1,157 @@
+/*
+ * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/* @test
+ * @bug 6985202
+ * @summary no access to doc comments from Tree API
+ */
+
+import java.io.*;
+import java.util.*;
+import javax.tools.*;
+import com.sun.source.tree.*;
+import com.sun.source.util.*;
+import com.sun.tools.javac.api.JavacTool;
+
+/**
+ * class-TestDocComments.
+ */
+public class TestDocComments {
+    /**
+     * method-main.
+     */
+    public static void main(String... args) throws Exception {
+        new TestDocComments().run();
+    }
+
+    /**
+     * method-run.
+     */
+    void run() throws Exception {
+        File testSrc = new File(System.getProperty("test.src"));
+        File file = new File(testSrc, "TestDocComments.java");
+
+        JavacTool tool = JavacTool.create();
+        StandardJavaFileManager fm = tool.getStandardFileManager(null, null, null);
+
+        StringWriter sw = new StringWriter();
+        PrintWriter pw = new PrintWriter(sw);
+        Iterable<? extends JavaFileObject> fileObjects = fm.getJavaFileObjects(file);
+        JavacTask task = tool.getTask(pw, fm, null, null, null, fileObjects);
+        Iterable<? extends CompilationUnitTree> units = task.parse();
+        Trees trees = Trees.instance(task);
+
+        CommentScanner s = new CommentScanner();
+        int n = s.scan(units, trees);
+
+        if (n != 12)
+            error("Unexpected number of doc comments found: " + n);
+
+        if (errors > 0)
+            throw new Exception(errors + " errors occurred");
+    }
+
+    /**
+     * class-CommentScanner.
+     */
+    class CommentScanner extends TreePathScanner<Integer,Trees> {
+
+        /**
+         * method-visitClass.
+         */
+        @Override
+        public Integer visitClass(ClassTree t, Trees trees) {
+            return reduce(super.visitClass(t, trees),
+                    check(trees, "class-" + t.getSimpleName() + "."));
+        }
+
+        /**
+         * method-visitMethod.
+         */
+        @Override
+        public Integer visitMethod(MethodTree t, Trees trees) {
+            return reduce(super.visitMethod(t, trees),
+                    check(trees, "method-" + t.getName() + "."));
+        }
+
+        /**
+         * method-visitVariable.
+         */
+        @Override
+        public Integer visitVariable(VariableTree t, Trees trees) {
+            // for simplicity, only check fields, not parameters or local decls
+            int n = (getCurrentPath().getParentPath().getLeaf().getKind() == Tree.Kind.CLASS)
+                    ? check(trees, "field-" + t.getName() + ".")
+                    : 0;
+            return reduce(super.visitVariable(t, trees), n);
+        }
+
+        /**
+         * method-reduce.
+         */
+        @Override
+        public Integer reduce(Integer i1, Integer i2) {
+            return (i1 == null) ? i2 : (i2 == null) ? i1 : Integer.valueOf(i1 + i2);
+        }
+
+        /**
+         * method-check.
+         */
+        int check(Trees trees, String expect) {
+            TreePath p = getCurrentPath();
+            String dc = trees.getDocComment(p);
+
+            if (dc != null && dc.trim().equals(expect))
+                return 1;
+
+            Tree.Kind k = p.getLeaf().getKind();
+            if (dc == null)
+                error("no doc comment for " + k);
+            else
+                error("unexpected doc comment for " + k + "\nexpect: " + expect + "\nfound:  " + dc);
+
+            return 0;
+        }
+    }
+
+    /**
+     * method-nullCheck.
+     */
+    int nullCheck(Integer i) {
+        return (i == null) ? 0 : i;
+    }
+
+    /**
+     * method-error.
+     */
+    void error(String msg) {
+        System.err.println("Error: " + msg);
+        errors++;
+    }
+
+    /**
+     * field-errors.
+     */
+    int errors;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/cast/7005095/T7005095neg.java	Mon Dec 20 21:10:57 2010 -0800
@@ -0,0 +1,14 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug     7005095
+ * @summary Cast: compile reject sensible cast from final class to interface
+ * @compile/fail/ref=T7005095neg.out -XDrawDiagnostics T7005095neg.java
+ */
+
+class T7005095pos<T extends Integer> {
+    interface Foo<T> {}
+
+    static final class FooImpl implements Foo<String> {}
+
+    Object o = (Foo<T>) new FooImpl();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/cast/7005095/T7005095neg.out	Mon Dec 20 21:10:57 2010 -0800
@@ -0,0 +1,2 @@
+T7005095neg.java:13:25: compiler.err.prob.found.req: (compiler.misc.inconvertible.types), T7005095pos.FooImpl, T7005095pos.Foo<T>
+1 error
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/cast/7005095/T7005095pos.java	Mon Dec 20 21:10:57 2010 -0800
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug     7005095
+ * @summary Cast: compile reject sensible cast from final class to interface
+ * @compile T7005095pos.java
+ */
+
+class T7005095pos<T extends CharSequence> {
+    interface Foo<T> {}
+
+    static final class FooImpl implements Foo<String> {}
+
+    Object o = (Foo<T>) new FooImpl();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/cast/7005671/T7005671.java	Mon Dec 20 21:10:57 2010 -0800
@@ -0,0 +1,32 @@
+/*
+ * @test /nodynamiccopyright/
+ * @author mcimadamore
+ * @bug     7005671
+ * @summary Regression: compiler accepts invalid cast from X[] to primitive array
+ * @compile/fail/ref=T7005671.out -XDrawDiagnostics T7005671.java
+ */
+
+class T7005671<X> {
+
+    void test1() {
+        Object o1 = (X[])(byte[])null;
+        Object o2 = (X[])(short[])null;
+        Object o3 = (X[])(int[])null;
+        Object o4 = (X[])(long[])null;
+        Object o5 = (X[])(float[])null;
+        Object o6 = (X[])(double[])null;
+        Object o7 = (X[])(char[])null;
+        Object o8 = (X[])(boolean[])null;
+    }
+
+    void test2() {
+        Object o1 = (byte[])(X[])null;
+        Object o2 = (short[])(X[])null;
+        Object o3 = (int[])(X[])null;
+        Object o4 = (long[])(X[])null;
+        Object o5 = (float[])(X[])null;
+        Object o6 = (double[])(X[])null;
+        Object o7 = (char[])(X[])null;
+        Object o8 = (boolean[])(X[])null;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/cast/7005671/T7005671.out	Mon Dec 20 21:10:57 2010 -0800
@@ -0,0 +1,17 @@
+T7005671.java:12:26: compiler.err.prob.found.req: (compiler.misc.inconvertible.types), byte[], X[]
+T7005671.java:13:26: compiler.err.prob.found.req: (compiler.misc.inconvertible.types), short[], X[]
+T7005671.java:14:26: compiler.err.prob.found.req: (compiler.misc.inconvertible.types), int[], X[]
+T7005671.java:15:26: compiler.err.prob.found.req: (compiler.misc.inconvertible.types), long[], X[]
+T7005671.java:16:26: compiler.err.prob.found.req: (compiler.misc.inconvertible.types), float[], X[]
+T7005671.java:17:26: compiler.err.prob.found.req: (compiler.misc.inconvertible.types), double[], X[]
+T7005671.java:18:26: compiler.err.prob.found.req: (compiler.misc.inconvertible.types), char[], X[]
+T7005671.java:19:26: compiler.err.prob.found.req: (compiler.misc.inconvertible.types), boolean[], X[]
+T7005671.java:23:29: compiler.err.prob.found.req: (compiler.misc.inconvertible.types), X[], byte[]
+T7005671.java:24:30: compiler.err.prob.found.req: (compiler.misc.inconvertible.types), X[], short[]
+T7005671.java:25:28: compiler.err.prob.found.req: (compiler.misc.inconvertible.types), X[], int[]
+T7005671.java:26:29: compiler.err.prob.found.req: (compiler.misc.inconvertible.types), X[], long[]
+T7005671.java:27:30: compiler.err.prob.found.req: (compiler.misc.inconvertible.types), X[], float[]
+T7005671.java:28:31: compiler.err.prob.found.req: (compiler.misc.inconvertible.types), X[], double[]
+T7005671.java:29:29: compiler.err.prob.found.req: (compiler.misc.inconvertible.types), X[], char[]
+T7005671.java:30:32: compiler.err.prob.found.req: (compiler.misc.inconvertible.types), X[], boolean[]
+16 errors
--- a/langtools/test/tools/javac/diags/CheckExamples.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/test/tools/javac/diags/CheckExamples.java	Mon Dec 20 21:10:57 2010 -0800
@@ -129,12 +129,17 @@
         File testSrc = new File(System.getProperty("test.src"));
         File examples = new File(testSrc, "examples");
         for (File f: examples.listFiles()) {
-            if (f.isDirectory() || f.isFile() && f.getName().endsWith(".java"))
+            if (isValidExample(f))
                 results.add(new Example(f));
         }
         return results;
     }
 
+    boolean isValidExample(File f) {
+        return (f.isDirectory() && f.list().length > 0) ||
+                (f.isFile() && f.getName().endsWith(".java"));
+    }
+
     /**
      * Get the contents of the "not-yet" list.
      */
--- a/langtools/test/tools/javac/diags/RunExamples.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/test/tools/javac/diags/RunExamples.java	Mon Dec 20 21:10:57 2010 -0800
@@ -52,7 +52,7 @@
  */
 public class RunExamples {
     public static void main(String... args) throws Exception {
-        boolean jtreg = (System.getProperty("test.src") != null);
+        jtreg = (System.getProperty("test.src") != null);
         File tmpDir;
         if (jtreg) {
             // use standard jtreg scratch directory: the current directory
@@ -166,12 +166,17 @@
     Set<Example> getExamples(File examplesDir) {
         Set<Example> results = new TreeSet<Example>();
         for (File f: examplesDir.listFiles()) {
-            if (f.isDirectory() || f.isFile() && f.getName().endsWith(".java"))
+            if (isValidExample(f))
                 results.add(new Example(f));
         }
         return results;
     }
 
+    boolean isValidExample(File f) {
+        return (f.isDirectory() && (!jtreg || f.list().length > 0)) ||
+                (f.isFile() && f.getName().endsWith(".java"));
+    }
+
     /**
      * Report an error.
      */
@@ -180,6 +185,8 @@
         errors++;
     }
 
+    static boolean jtreg;
+
     int errors;
 
     /**
--- a/langtools/test/tools/javac/diags/examples.not-yet.txt	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/test/tools/javac/diags/examples.not-yet.txt	Mon Dec 20 21:10:57 2010 -0800
@@ -104,6 +104,7 @@
 compiler.warn.annotation.method.not.found               # ClassReader
 compiler.warn.annotation.method.not.found.reason        # ClassReader
 compiler.warn.big.major.version                         # ClassReader
+compiler.warn.future.attr                               # ClassReader
 compiler.warn.illegal.char.for.encoding
 compiler.warn.invalid.archive.file
 compiler.warn.override.bridge
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/diags/examples/TrustMeOnNonVarargsMeth.java	Mon Dec 20 21:10:57 2010 -0800
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+// key: compiler.err.varargs.invalid.trustme.anno
+// key: compiler.misc.varargs.trustme.on.non.varargs.meth
+// options: -Xlint:varargs
+
+class TrustMeOnNonVarargsMeth {
+    @SafeVarargs static void m(String[] args) { }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/diags/examples/TrustMeOnReifiableVarargsParam.java	Mon Dec 20 21:10:57 2010 -0800
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+// key: compiler.warn.varargs.redundant.trustme.anno
+// key: compiler.misc.varargs.trustme.on.reifiable.varargs
+// options: -Xlint:varargs
+
+class TrustMeOnReifiableVarargsParam {
+    @SafeVarargs static void m(String... args) { }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/diags/examples/TrustMeOnVirtualMethod.java	Mon Dec 20 21:10:57 2010 -0800
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+// key: compiler.err.varargs.invalid.trustme.anno
+// key: compiler.misc.varargs.trustme.on.virtual.varargs
+// options: -Xlint:varargs,unchecked
+
+import java.util.List;
+
+class TrustMeOnVirtualMethod {
+    @SafeVarargs void m(List<String>... args) { }
+}
--- a/langtools/test/tools/javac/diags/examples/UncheckedGenericArrayCreation.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/test/tools/javac/diags/examples/UncheckedGenericArrayCreation.java	Mon Dec 20 21:10:57 2010 -0800
@@ -22,10 +22,8 @@
  */
 
 // key: compiler.warn.unchecked.generic.array.creation
-// key: compiler.warn.varargs.non.reifiable.type
-// options: -Xlint:unchecked,varargs
-
-import java.util.*;
+// key: compiler.warn.unchecked.varargs.non.reifiable.type
+// options: -Xlint:unchecked
 
 class UncheckedGenericArrayCreation<T> {
     void m(T t1, T t2, T t3) {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/diags/examples/UnsafeUseOfVarargsParam.java	Mon Dec 20 21:10:57 2010 -0800
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+// key: compiler.warn.varargs.unsafe.use.varargs.param
+// options: -Xlint:varargs
+
+class UnsafeUseOfVarargsParam {
+    @SafeVarargs static <X> void m(X... x) {
+        Object[] o = x;
+    }
+}
--- a/langtools/test/tools/javac/diags/examples/VarargsFilename.java	Thu Dec 16 19:57:01 2010 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +0,0 @@
-/*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-// key: compiler.note.varargs.filename
-// key: compiler.note.varargs.recompile
-
-class VarargsFilename<T> {
-    void m(T... items) { }
-}
--- a/langtools/test/tools/javac/diags/examples/VarargsFilenameAdditional.java	Thu Dec 16 19:57:01 2010 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,31 +0,0 @@
-/*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-// key: compiler.note.varargs.filename.additional
-// key: compiler.warn.varargs.non.reifiable.type
-// options: -Xlint:varargs -Xmaxwarns 1
-
-class VarargsFilenameAdditional<T> {
-    void m1(T... items) { }
-    void m2(T... items) { }
-}
--- a/langtools/test/tools/javac/diags/examples/VarargsNonReifiableType.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/test/tools/javac/diags/examples/VarargsNonReifiableType.java	Mon Dec 20 21:10:57 2010 -0800
@@ -21,10 +21,8 @@
  * questions.
  */
 
-// key: compiler.warn.varargs.non.reifiable.type
-// options: -Xlint:varargs
-
-import java.util.*;
+// key: compiler.warn.unchecked.varargs.non.reifiable.type
+// options: -Xlint:unchecked
 
 class VarargsNonReifiableType<T> {
     void m(T... items) {
--- a/langtools/test/tools/javac/diags/examples/VarargsPlural/VarargsFilename.java	Thu Dec 16 19:57:01 2010 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,26 +0,0 @@
-/*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-class VarargsFilename<T> {
-    void m(T... items) { }
-}
--- a/langtools/test/tools/javac/diags/examples/VarargsPlural/VarargsPlural.java	Thu Dec 16 19:57:01 2010 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +0,0 @@
-/*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-// key: compiler.note.varargs.plural
-// key: compiler.note.varargs.recompile
-
-class VarargsPlural<T> {
-    void m(T... items) { }
-}
--- a/langtools/test/tools/javac/diags/examples/VarargsPluralAdditional/VarargsFilename.java	Thu Dec 16 19:57:01 2010 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,26 +0,0 @@
-/*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-class VarargsFilename<T> {
-    void m(T... items) { }
-}
--- a/langtools/test/tools/javac/diags/examples/VarargsPluralAdditional/VarargsPlural.java	Thu Dec 16 19:57:01 2010 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,26 +0,0 @@
-/*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-class VarargsPlural<T> {
-    void m(T... items) { }
-}
--- a/langtools/test/tools/javac/diags/examples/VarargsPluralAdditional/VarargsPluralAdditional.java	Thu Dec 16 19:57:01 2010 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +0,0 @@
-/*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-// key: compiler.note.varargs.plural.additional
-// key: compiler.warn.varargs.non.reifiable.type
-// options: -Xlint:varargs -Xmaxwarns 1
-
-class VarargsPluralAdditional<T> {
-    void m(T... items) { }
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/generics/6476118/T6476118a.java	Mon Dec 20 21:10:57 2010 -0800
@@ -0,0 +1,16 @@
+/**
+ * @test  /nodynamiccopyright/
+ * @bug 6476118
+ * @summary compiler bug causes runtime ClassCastException for generics overloading
+ * @compile/fail/ref=T6476118a.out -XDrawDiagnostics T6476118a.java
+ */
+
+class T6476118a {
+    static class A {
+        public int compareTo(Object o) { return 0; }
+    }
+
+    static class B extends A implements Comparable<B>{
+        public int compareTo(B b){ return 0; }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/generics/6476118/T6476118a.out	Mon Dec 20 21:10:57 2010 -0800
@@ -0,0 +1,2 @@
+T6476118a.java:14:20: compiler.err.name.clash.same.erasure.no.override: compareTo(T), java.lang.Comparable, compareTo(java.lang.Object), T6476118a.A
+1 error
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/generics/6476118/T6476118b.java	Mon Dec 20 21:10:57 2010 -0800
@@ -0,0 +1,14 @@
+/**
+ * @test  /nodynamiccopyright/
+ * @bug 6476118 6533652
+ * @summary compiler bug causes runtime ClassCastException for generics overloading
+ * @compile/fail/ref=T6476118b.out -XDrawDiagnostics T6476118b.java
+ */
+
+class T6476118b {
+    public final int compareTo(Object o) { return 0; }
+
+    static class B extends T6476118b implements Comparable<B> {
+        public int compareTo(B b){ return 0; }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/generics/6476118/T6476118b.out	Mon Dec 20 21:10:57 2010 -0800
@@ -0,0 +1,2 @@
+T6476118b.java:12:20: compiler.err.name.clash.same.erasure.no.override: compareTo(T), java.lang.Comparable, compareTo(java.lang.Object), T6476118b
+1 error
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/generics/6476118/T6476118c.java	Mon Dec 20 21:10:57 2010 -0800
@@ -0,0 +1,23 @@
+/**
+ * @test  /nodynamiccopyright/
+ * @bug 6476118
+ * @summary compiler bug causes runtime ClassCastException for generics overloading
+ * @compile/fail/ref=T6476118c.out -XDrawDiagnostics T6476118c.java
+ */
+
+class T6476118b {
+    static class A<T> {
+        public void foo(T t) { }
+    }
+
+    static class B<T extends Number> extends A<T> {
+        public void foo(T t) { }
+    }
+
+    static class C extends B<Integer> {
+        public void foo(Object o) { }
+        public void foo(Number o) { }
+    }
+
+    static class D extends C {} //check that no spurious diags generated here!
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/generics/6476118/T6476118c.out	Mon Dec 20 21:10:57 2010 -0800
@@ -0,0 +1,3 @@
+T6476118c.java:18:21: compiler.err.name.clash.same.erasure.no.override: foo(java.lang.Object), T6476118b.C, foo(T), T6476118b.A
+T6476118c.java:19:21: compiler.err.name.clash.same.erasure.no.override: foo(java.lang.Number), T6476118b.C, foo(T), T6476118b.B
+2 errors
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/generics/6476118/T6476118d.java	Mon Dec 20 21:10:57 2010 -0800
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 6476118
+ * @summary compiler bug causes runtime ClassCastException for generics overloading
+ * @compile T6476118d.java
+ */
+
+class T6476118d {
+    int m = 3;
+
+    interface m { }
+
+    int m () {
+        return m;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/generics/6956758/T6956758neg.java	Mon Dec 20 21:10:57 2010 -0800
@@ -0,0 +1,20 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug 6956758
+ *
+ * @summary  NPE in com.sun.tools.javac.code.Symbol - isSubClass
+ * @author Maurizio Cimadamore
+ * @compile/fail/ref=T6956758neg.out -XDrawDiagnostics T6956758neg.java
+ *
+ */
+
+class T6956758neg {
+
+    interface I {}
+
+    static class C {
+        <T extends Object & I> T cloneObject(T object) throws Exception {
+            return (T)object.clone();
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/generics/6956758/T6956758neg.out	Mon Dec 20 21:10:57 2010 -0800
@@ -0,0 +1,4 @@
+T6956758neg.java:17:29: compiler.err.report.access: clone(), protected, java.lang.Object
+- compiler.note.unchecked.filename: T6956758neg.java
+- compiler.note.unchecked.recompile
+1 error
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/generics/6956758/T6956758pos.java	Mon Dec 20 21:10:57 2010 -0800
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 6956758
+ *
+ * @summary  NPE in com.sun.tools.javac.code.Symbol - isSubClass
+ * @author Maurizio Cimadamore
+ * @compile T6956758pos.java
+ *
+ */
+
+class T6956758pos {
+
+    interface I {}
+
+    static class C {
+        <T extends C & I> T cloneObject(T object) throws Exception {
+            return (T)object.clone();
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/generics/diamond/7002837/T7002837.java	Mon Dec 20 21:10:57 2010 -0800
@@ -0,0 +1,14 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug 7002837
+ *
+ * @summary  Diamond: javac generates diamond inference errors when in 'finder' mode
+ * @author mcimadamore
+ * @compile -Werror -XDfindDiamond T7002837.java
+ *
+ */
+
+class T7002837<X extends java.io.Serializable & Comparable<?>> {
+    T7002837() {}
+    { new T7002837<Integer>(); }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/multicatch/7005371/SubTest.java	Mon Dec 20 21:10:57 2010 -0800
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.util.*;
+
+class SubTest {
+
+    interface Foo {}
+    static class X1 extends Exception implements Foo {}
+    static class X2 extends Exception implements Foo {}
+
+    void test(boolean cond, List<String> ls) {
+        try {
+            if (cond)
+                throw new X1();
+            else
+                throw new X2();
+        }
+        catch (X1 | X2 ex) {}
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/multicatch/7005371/T7005371.java	Mon Dec 20 21:10:57 2010 -0800
@@ -0,0 +1,100 @@
+/*
+ * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 7005371
+ * @summary  Multicatch: assertion error while generating LocalVariableTypeTable attribute
+ * @compile -g SubTest.java
+ * @run main T7005371
+ */
+
+import com.sun.tools.classfile.Attribute;
+import com.sun.tools.classfile.ClassFile;
+import com.sun.tools.classfile.Code_attribute;
+import com.sun.tools.classfile.LocalVariableTypeTable_attribute;
+import com.sun.tools.classfile.Method;
+
+import java.io.*;
+
+public class T7005371 {
+
+    static final String SUBTEST_NAME = SubTest.class.getName() + ".class";
+    static final String TEST_METHOD_NAME = "test";
+    static final int LVT_LENGTH = 1;
+    static final String LVT_SIG_TYPE = "Ljava/util/List<Ljava/lang/String;>;";
+
+
+    public static void main(String... args) throws Exception {
+        new T7005371().run();
+    }
+
+    public void run() throws Exception {
+        String workDir = System.getProperty("test.classes");
+        System.out.println(workDir);
+        File compiledTest = new File(workDir, SUBTEST_NAME);
+        verifyLocalVariableTypeTableAttr(compiledTest);
+    }
+
+    void verifyLocalVariableTypeTableAttr(File f) {
+        System.err.println("verify: " + f);
+        try {
+            ClassFile cf = ClassFile.read(f);
+            Method testMethod = null;
+            for (Method m : cf.methods) {
+                if (m.getName(cf.constant_pool).equals(TEST_METHOD_NAME)) {
+                    testMethod = m;
+                    break;
+                }
+            }
+            if (testMethod == null) {
+                throw new Error("Missing method: " + TEST_METHOD_NAME);
+            }
+            Code_attribute code = (Code_attribute)testMethod.attributes.get(Attribute.Code);
+            if (code == null) {
+                throw new Error("Missing Code attribute for method: " + TEST_METHOD_NAME);
+            }
+            LocalVariableTypeTable_attribute lvt_table =
+                    (LocalVariableTypeTable_attribute)code.attributes.get(Attribute.LocalVariableTypeTable);
+            if (lvt_table == null) {
+                throw new Error("Missing LocalVariableTypeTable attribute for method: " + TEST_METHOD_NAME);
+            }
+            if (lvt_table.local_variable_table_length != LVT_LENGTH) {
+                throw new Error("LocalVariableTypeTable has wrong size" +
+                        "\nfound: " + lvt_table.local_variable_table_length +
+                        "\nrequired: " + LVT_LENGTH);
+            }
+            String sig =
+                    cf.constant_pool.getUTF8Value(lvt_table.local_variable_table[0].signature_index);
+
+            if (sig == null || !sig.equals(LVT_SIG_TYPE)) {
+                throw new Error("LocalVariableTypeTable has wrong signature" +
+                        "\nfound: " + sig +
+                        "\nrequired: " + LVT_SIG_TYPE);
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+            throw new Error("error reading " + f +": " + e);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/multicatch/Neg06.java	Mon Dec 20 21:10:57 2010 -0800
@@ -0,0 +1,16 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug 7002070
+ *
+ * @summary If catch clause has an incompatible type, error pointer points to first exception type in list
+ * @author mcimadamore
+ * @compile/fail/ref=Neg06.out -XDrawDiagnostics Neg06.java
+ *
+ */
+
+class Neg06 {
+    void test() {
+        try { }
+        catch (String | Integer s) {}
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/multicatch/Neg06.out	Mon Dec 20 21:10:57 2010 -0800
@@ -0,0 +1,3 @@
+Neg06.java:14:16: compiler.err.prob.found.req: (compiler.misc.incompatible.types), java.lang.String, java.lang.Throwable
+Neg06.java:14:25: compiler.err.prob.found.req: (compiler.misc.incompatible.types), java.lang.Integer, java.lang.Throwable
+2 errors
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/scope/HashCollisionTest.java	Mon Dec 20 21:10:57 2010 -0800
@@ -0,0 +1,251 @@
+/*
+ * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 7004029
+ * @summary Ensure Scope impl can cope with hash collisions
+ */
+
+import java.lang.reflect.*;
+import java.io.*;
+import com.sun.tools.javac.util.*;
+import com.sun.tools.javac.code.*;
+import com.sun.tools.javac.code.Scope.*;
+import com.sun.tools.javac.code.Symbol.*;
+import com.sun.tools.javac.file.JavacFileManager;
+import static com.sun.tools.javac.code.Kinds.*;
+
+public class HashCollisionTest {
+    public static void main(String... args) throws Exception {
+        new HashCollisionTest().run();
+    }
+
+    void run() throws Exception {
+        // set up basic environment for test
+        Context context = new Context();
+        JavacFileManager.preRegister(context); // required by ClassReader which is required by Symtab
+        names = Names.instance(context);       // Name.Table impls tied to an instance of Names
+        symtab = Symtab.instance(context);
+        scopeCounter = ScopeCounter.instance(context);
+
+        // determine hashMask for an empty scope
+        Scope emptyScope = new Scope(symtab.unnamedPackage); // any owner will do
+        Field sHashMask = Scope.class.getDeclaredField("hashMask");
+        sHashMask.setAccessible(true);
+        scopeHashMask = sHashMask.getInt(emptyScope);
+        log("scopeHashMask: " + scopeHashMask);
+
+        // 1. determine the Name.hashCode of "Entry", and therefore the index of
+        // Entry in an empty scope.  i.e. name.hashCode() & Scope.hashMask
+        Name entry = names.fromString("Entry");
+
+        // 2. create names of the form *$Entry until we find a name with a
+        // hashcode which yields the same index as Entry in an empty scope.
+        // Since Name.hashCode is a function of position (and not content) it
+        // should work to create successively longer names until one with the
+        // desired characteristics is found.
+        Name outerName;
+        Name innerName;
+        StringBuilder sb = new StringBuilder("C");
+        int i = 0;
+        do {
+            sb.append(Integer.toString(i % 10));
+            innerName = names.fromString(sb + "$Entry");
+        } while (!clash(entry, innerName) && (++i) < MAX_TRIES);
+
+        if (clash(entry, innerName)) {
+            log("Detected expected hash collision for " + entry + " and " + innerName
+                    + " after " + i + " tries");
+        } else {
+            throw new Exception("No potential collision found after " + i + " tries");
+        }
+
+        outerName = names.fromString(sb.toString());
+
+        /*
+         * Now we can set up the scenario.
+         */
+
+        // 3. Create a nested class named Entry
+        ClassSymbol cc = createClass(names.fromString("C"), symtab.unnamedPackage);
+        ClassSymbol ce = createClass(entry, cc);
+
+        // 4. Create a package containing a nested class using the name from 2
+        PackageSymbol p = new PackageSymbol(names.fromString("p"), symtab.rootPackage);
+        p.members_field = new Scope(p);
+        ClassSymbol inner = createClass(innerName, p);
+        // we'll need this later when we "rename" cn
+        ClassSymbol outer = createClass(outerName, p);
+
+        // 5. Create a star-import scope
+        log ("createStarImportScope");
+
+        // if StarImportScope exists, use it, otherwise, for testing legacy code,
+        // fall back on ImportScope
+        Scope starImportScope;
+        Method importAll;
+        PackageSymbol pkg = new PackageSymbol(names.fromString("pkg"), symtab.rootPackage);
+        try {
+            Class<?> c = Class.forName("com.sun.tools.javac.code.Scope$StarImportScope");
+            Constructor ctor = c.getDeclaredConstructor(new Class[] { Symbol.class });
+            importAll = c.getDeclaredMethod("importAll", new Class[] { Scope.class });
+            starImportScope = (Scope) ctor.newInstance(new Object[] { pkg });
+        } catch (ClassNotFoundException e) {
+            starImportScope = new ImportScope(pkg);
+            importAll = null;
+        }
+
+        dump("initial", starImportScope);
+
+        // 6. Insert the contents of the package from 4.
+        Scope p_members = p.members();
+        if (importAll != null) {
+            importAll.invoke(starImportScope, p_members);
+        } else {
+            Scope fromScope = p_members;
+            Scope toScope = starImportScope;
+            // The following lines are taken from MemberEnter.importAll,
+            // before the use of StarImportScope.importAll.
+            for (Scope.Entry e = fromScope.elems; e != null; e = e.sibling) {
+                if (e.sym.kind == TYP && !toScope.includes(e.sym))
+                    toScope.enter(e.sym, fromScope);
+            }
+        }
+
+        dump("imported p", starImportScope);
+
+        // 7. Insert the class from 3.
+        starImportScope.enter(ce, cc.members_field);
+        dump("imported ce", starImportScope);
+
+        /*
+         * Set the trap.
+         */
+
+        // 8. Rename the nested class to Entry. so that there is a bogus entry in the star-import scope
+        p.members_field.remove(inner);
+        inner.name = entry;
+        inner.owner = outer;
+        outer.members_field.enter(inner);
+
+        // 9. Lookup Entry
+        Scope.Entry e = starImportScope.lookup(entry);
+        dump("final", starImportScope);
+
+        if (e.sym == null)
+            throw new Exception("symbol not found: " + entry);
+    }
+
+    /*
+     * Check for a (probable) hash collision in an empty scope.
+     */
+    boolean clash(Name n1, Name n2) {
+        log(n1 + " hc:" + n1.hashCode() + " v:" + (n1.hashCode() & scopeHashMask) + ", " +
+                n2 + " hc:" + n2.hashCode() + " v:" + (n2.hashCode() & scopeHashMask));
+        return (n1.hashCode() & scopeHashMask) == (n2.hashCode() & scopeHashMask);
+    }
+
+    /**
+     * Create a class symbol, init the members scope, and add it to owner's scope.
+     */
+    ClassSymbol createClass(Name name, Symbol owner) {
+        ClassSymbol sym = new ClassSymbol(0, name, owner);
+        sym.members_field = new ClassScope(sym, scopeCounter);
+        if (owner != symtab.unnamedPackage)
+            owner.members().enter(sym);
+        return sym;
+    }
+
+    /**
+     * Dump the contents of a scope to System.err.
+     */
+    void dump(String label, Scope s) throws Exception {
+        dump(label, s, System.err);
+    }
+
+    /**
+     * Dump the contents of a scope to a stream.
+     */
+    void dump(String label, Scope s, PrintStream out) throws Exception {
+        out.println(label);
+        Field sTable = Scope.class.getDeclaredField("table");
+        sTable.setAccessible(true);
+
+        out.println("owner:" + s.owner);
+        Scope.Entry[] table = (Scope.Entry[]) sTable.get(s);
+        for (int i = 0; i < table.length; i++) {
+            if (i > 0)
+                out.print(", ");
+            out.print(i + ":" + toString(table[i], table, false));
+        }
+        out.println();
+    }
+
+    /**
+     * Create a string showing the contents of an entry, using the table
+     * to help identify cross-references to other entries in the table.
+     * @param e the entry to be shown
+     * @param table the table containing the other entries
+     */
+    String toString(Scope.Entry e, Scope.Entry[] table, boolean ref) {
+        if (e == null)
+            return "null";
+        if (e.sym == null)
+            return "sent"; // sentinel
+        if (ref) {
+            int index = indexOf(table, e);
+            if (index != -1)
+                return String.valueOf(index);
+        }
+        return "(" + e.sym.name + ":" + e.sym
+                + ",shdw:" + toString(e.next(), table, true)
+                + ",sibl:" + toString(e.sibling, table, true)
+                + ((e.sym.owner != e.scope.owner)
+                    ? (",BOGUS[" + e.sym.owner + "," + e.scope.owner + "]")
+                    : "")
+                + ")";
+    }
+
+    <T> int indexOf(T[] array, T item) {
+        for (int i = 0; i < array.length; i++) {
+            if (array[i] == item)
+                return i;
+        }
+        return -1;
+    }
+
+    /**
+     * Write a message to stderr.
+     */
+    void log(String msg) {
+        System.err.println(msg);
+    }
+
+    int MAX_TRIES = 100; // max tries to find a hash clash before giving up.
+    int scopeHashMask;
+
+    Names names;
+    Symtab symtab;
+    ScopeCounter scopeCounter;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/scope/StarImportTest.java	Mon Dec 20 21:10:57 2010 -0800
@@ -0,0 +1,402 @@
+/*
+ * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 7004029
+ * @summary Basher for star-import scopes
+ */
+
+import java.lang.reflect.*;
+import java.util.*;
+import java.util.List;
+import com.sun.tools.javac.util.*;
+import com.sun.tools.javac.code.*;
+import com.sun.tools.javac.code.Scope.*;
+import com.sun.tools.javac.code.Symbol.*;
+import com.sun.tools.javac.file.JavacFileManager;
+import static com.sun.tools.javac.code.Kinds.*;
+
+public class StarImportTest {
+    public static void main(String... args) throws Exception {
+        new StarImportTest().run(args);
+    }
+
+    void run(String... args) throws Exception {
+        int count = 1;
+
+        for (int i = 0; i < args.length; i++) {
+            String arg = args[i];
+            if (arg.equals("-seed") && (i + 1 < args.length))
+                seed = Long.parseLong(args[++i]);
+            else if(arg.equals("-tests") && (i + 1 < args.length))
+                count = Integer.parseInt(args[++i]);
+            else
+                throw new Exception("unknown arg: " + arg);
+        }
+
+        rgen = new Random(seed);
+
+        for (int i = 0; i < count; i++) {
+            Test t = new Test();
+            t.run();
+        }
+
+        if (errors > 0)
+            throw new Exception(errors + " errors found");
+    }
+
+    /**
+     * Select a random element from an array of choices.
+     */
+    <T> T random(T... choices) {
+        return choices[rgen.nextInt(choices.length)];
+    }
+
+    /**
+     * Write a message to stderr.
+     */
+    void log(String msg) {
+        System.err.println(msg);
+    }
+
+    /**
+     * Write a message to stderr, and dump a scope.
+     */
+    void log(String msg, Scope s) {
+        System.err.print(msg);
+        System.err.print(": ");
+        String sep = "(";
+        for (Scope.Entry se = s.elems; se != null; se = se.sibling) {
+            for (Scope.Entry e = se; e.sym != null; e = e.next()) {
+                System.err.print(sep + e.sym.name + ":" + e.sym);
+                sep = ",";
+            }
+            System.err.print(")");
+            sep = ", (";
+        }
+        System.err.println();
+    }
+
+    /**
+     * Write an error message to stderr.
+     */
+    void error(String msg) {
+        System.err.println("Error: " + msg);
+        errors++;
+    }
+
+    Random rgen;
+    long seed = 0;
+
+    int errors;
+
+    enum SetupKind { NAMES, PACKAGE, CLASS };
+    static final int MAX_SETUP_COUNT = 50;
+    static final int MAX_SETUP_NAME_COUNT = 20;
+    static final int MAX_SETUP_PACKAGE_COUNT = 20;
+    static final int MAX_SETUP_CLASS_COUNT = 20;
+
+    /** Class to encapsulate a test run. */
+    class Test {
+        /** Run the test. */
+        void run() throws Exception {
+            log ("starting test");
+            setup();
+            createStarImportScope();
+            test();
+        }
+
+        /**
+         * Setup env by creating pseudo-random collection of names, packages and classes.
+         */
+        void setup() {
+            log ("setup");
+            context = new Context();
+            JavacFileManager.preRegister(context); // required by ClassReader which is required by Symtab
+            names = Names.instance(context);       // Name.Table impls tied to an instance of Names
+            symtab = Symtab.instance(context);
+            scopeCounter = ScopeCounter.instance(context);
+            int setupCount = rgen.nextInt(MAX_SETUP_COUNT);
+            for (int i = 0; i < setupCount; i++) {
+                switch (random(SetupKind.values())) {
+                    case NAMES:
+                        setupNames();
+                        break;
+                    case PACKAGE:
+                        setupPackage();
+                        break;
+                    case CLASS:
+                        setupClass();
+                        break;
+                }
+            }
+        }
+
+        /**
+         * Set up a random number of names.
+         */
+        void setupNames() {
+            int count = rgen.nextInt(MAX_SETUP_NAME_COUNT);
+            log("setup: creating " + count + " new names");
+            for (int i = 0; i < count; i++) {
+                names.fromString("n" + (++nextNameSerial));
+            }
+        }
+
+        /**
+         * Set up a package containing a random number of member elements.
+         */
+        void setupPackage() {
+            Name name = names.fromString("p" + (++nextPackageSerial));
+            int count = rgen.nextInt(MAX_SETUP_PACKAGE_COUNT);
+            log("setup: creating package " + name + " with " + count + " entries");
+            PackageSymbol p = new PackageSymbol(name, symtab.rootPackage);
+            p.members_field = new Scope(p);
+            for (int i = 0; i < count; i++) {
+                String outer = name + "c" + i;
+                String suffix = random(null, "$Entry", "$Entry2");
+                ClassSymbol c1 = createClass(names.fromString(outer), p);
+//                log("setup: created " + c1);
+                if (suffix != null) {
+                    ClassSymbol c2 = createClass(names.fromString(outer + suffix), p);
+//                    log("setup: created " + c2);
+                }
+            }
+//            log("package " + p, p.members_field);
+            packages.add(p);
+            imports.add(p);
+        }
+
+        /**
+         * Set up a class containing a random number of member elements.
+         */
+        void setupClass() {
+            Name name = names.fromString("c" + (++nextClassSerial));
+            int count = rgen.nextInt(MAX_SETUP_CLASS_COUNT);
+            log("setup: creating class " + name + " with " + count + " entries");
+            ClassSymbol c = createClass(name, symtab.unnamedPackage);
+//            log("setup: created " + c);
+            for (int i = 0; i < count; i++) {
+                ClassSymbol ic = createClass(names.fromString("Entry" + i), c);
+//                log("setup: created " + ic);
+            }
+            classes.add(c);
+            imports.add(c);
+        }
+
+        /**
+         * Create a star-import scope and a model therof, from the packages and
+         * classes created by setupPackages and setupClasses.
+         * @throws Exception for fatal errors, such as from reflection
+         */
+        void createStarImportScope() throws Exception {
+            log ("createStarImportScope");
+            PackageSymbol pkg = new PackageSymbol(names.fromString("pkg"), symtab.rootPackage);
+
+            // if StarImportScope exists, use it, otherwise, for testing legacy code,
+            // fall back on ImportScope
+            Method importAll;
+            try {
+                Class<?> c = Class.forName("com.sun.tools.javac.code.Scope$StarImportScope");
+                Constructor ctor = c.getDeclaredConstructor(new Class[] { Symbol.class });
+                importAll = c.getDeclaredMethod("importAll", new Class[] { Scope.class });
+                starImportScope = (Scope) ctor.newInstance(new Object[] { pkg });
+            } catch (ClassNotFoundException e) {
+                starImportScope = new ImportScope(pkg);
+                importAll = null;
+            }
+            starImportModel = new Model();
+
+            for (Symbol imp: imports) {
+                Scope members = imp.members();
+                if (importAll != null) {
+//                    log("importAll", members);
+                    importAll.invoke(starImportScope, members);
+                } else {
+                    Scope fromScope = members;
+                    Scope toScope = starImportScope;
+                    // The following lines are taken from MemberEnter.importAll,
+                    // before the use of StarImportScope.importAll.
+                    for (Scope.Entry e = fromScope.elems; e != null; e = e.sibling) {
+                        if (e.sym.kind == TYP && !toScope.includes(e.sym))
+                            toScope.enter(e.sym, fromScope);
+                    }
+                }
+
+                for (Scope.Entry e = members.elems; e != null; e = e.sibling) {
+                    starImportModel.enter(e.sym);
+                }
+            }
+
+//            log("star-import scope", starImportScope);
+            starImportModel.check(starImportScope);
+        }
+
+        /**
+         * The core of the test. In a random order, move nested classes from
+         * the package in which they created to the class which should own them.
+         */
+        void test() {
+            log ("test");
+            List<ClassSymbol> nestedClasses = new LinkedList<ClassSymbol>();
+            for (PackageSymbol p: packages) {
+                for (Scope.Entry se = p.members_field.elems; se != null; se = se.sibling) {
+                    if (se.sym.name.toString().contains("$"))
+                        nestedClasses.add((ClassSymbol) se.sym);
+                }
+            }
+
+            for (int i = nestedClasses.size(); i > 0; i--) {
+                // select a random nested class to move from package to class
+                ClassSymbol sym = nestedClasses.remove(rgen.nextInt(i));
+                log("adjusting class " + sym);
+
+                // remove from star import model
+                starImportModel.remove(sym);
+
+                String s = sym.name.toString();
+                int dollar = s.indexOf("$");
+
+                // owner should be a package
+                assert (sym.owner.kind == PCK);
+
+                // determine new owner
+                Name outerName = names.fromString(s.substring(0, dollar));
+//                log(sym + " owner: " + sym.owner, sym.owner.members());
+                Scope.Entry outerEntry = sym.owner.members().lookup(outerName);
+                ClassSymbol outer = (ClassSymbol) outerEntry.sym;
+//                log("outer: " + outerName + " " + outer);
+
+                // remove from package
+                sym.owner.members().remove(sym);
+
+                // rename and insert into class
+                sym.name = names.fromString(s.substring(dollar + 1));
+                outer.members().enter(sym);
+                sym.owner = outer;
+
+                // verify
+                starImportModel.check(starImportScope);
+            }
+        }
+
+        ClassSymbol createClass(Name name, Symbol owner) {
+            ClassSymbol sym = new ClassSymbol(0, name, owner);
+            sym.members_field = new ClassScope(sym, scopeCounter);
+            if (owner != symtab.unnamedPackage)
+                owner.members().enter(sym);
+            return sym;
+        }
+
+        Context context;
+        Symtab symtab;
+        ScopeCounter scopeCounter;
+        Names names;
+        int nextNameSerial;
+        List<PackageSymbol> packages = new ArrayList<PackageSymbol>();
+        int nextPackageSerial;
+        List<ClassSymbol> classes = new ArrayList<ClassSymbol>();
+        List<Symbol> imports = new ArrayList<Symbol>();
+        int nextClassSerial;
+
+        Scope starImportScope;
+        Model starImportModel;
+    }
+
+    class Model {
+        private Map<Name, Set<Symbol>> map = new HashMap<Name, Set<Symbol>>();
+        private Set<Symbol> bogus = new HashSet<Symbol>();
+
+        void enter(Symbol sym) {
+            Set<Symbol> syms = map.get(sym.name);
+            if (syms == null)
+                map.put(sym.name, syms = new LinkedHashSet<Symbol>());
+            syms.add(sym);
+        }
+
+        void remove(Symbol sym) {
+            Set<Symbol> syms = map.get(sym.name);
+            if (syms == null)
+                error("no entries for " + sym.name + " found in reference model");
+            else {
+                boolean ok = syms.remove(sym);
+                if (ok) {
+//                        log(sym.name + "(" + sym + ") removed from reference model");
+                } else {
+                    error(sym.name + " not found in reference model");
+                }
+                if (syms.isEmpty())
+                    map.remove(sym.name);
+            }
+        }
+
+        /**
+         * Check the contents of a scope
+         */
+        void check(Scope scope) {
+            // First, check all entries in scope are in map
+            int bogusCount = 0;
+            for (Scope.Entry se = scope.elems; se != null; se = se.sibling) {
+                Symbol sym = se.sym;
+                if (sym.owner != se.scope.owner) {
+                    if (bogus.contains(sym)) {
+                        bogusCount++;
+                    } else {
+                        log("Warning: " + sym.name + ":" + sym + " appears to be bogus");
+                        bogus.add(sym);
+                    }
+                } else {
+                    Set<Symbol> syms = map.get(sym.name);
+                    if (syms == null) {
+                        error("check: no entries found for " + sym.name + ":" + sym + " in reference map");
+                    } else  if (!syms.contains(sym)) {
+                        error("check: symbol " + sym.name + ":" + sym + " not found in reference map");
+                    }
+                }
+            }
+            if (bogusCount > 0) {
+                log("Warning: " + bogusCount + " other bogus entries previously reported");
+            }
+
+            // Second, check all entries in map are in scope
+            for (Map.Entry<Name,Set<Symbol>> me: map.entrySet()) {
+                Name name = me.getKey();
+                Scope.Entry se = scope.lookup(name);
+                assert (se != null);
+                if (se.sym == null) {
+                    error("check: no entries found for " + name + " in scope");
+                    continue;
+                }
+            nextSym:
+                for (Symbol sym: me.getValue()) {
+                    for (Scope.Entry e = se; e.sym != null; e = e.next()) {
+                        if (sym == e.sym)
+                            continue nextSym;
+                    }
+                    error("check: symbol " + sym + " not found in scope");
+                }
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/tree/MakeLiteralTest.java	Mon Dec 20 21:10:57 2010 -0800
@@ -0,0 +1,90 @@
+
+
+/*
+ * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 6504896
+ * @summary TreeMaker.Literal(Object) does not support Booleans
+ */
+
+import com.sun.tools.javac.code.Type;
+import com.sun.tools.javac.code.Symtab;
+import com.sun.tools.javac.code.Types;
+import com.sun.tools.javac.file.JavacFileManager;
+import com.sun.tools.javac.tree.JCTree.JCLiteral;
+import com.sun.tools.javac.util.Context;
+import com.sun.tools.javac.tree.TreeMaker;
+import static com.sun.tools.javac.code.TypeTags.*;
+
+public class MakeLiteralTest {
+    public static void main(String... args) throws Exception {
+        new MakeLiteralTest().run();
+    }
+
+    void run() throws Exception {
+        Context context = new Context();
+        JavacFileManager.preRegister(context);
+        Symtab syms = Symtab.instance(context);
+        maker = TreeMaker.instance(context);
+        types = Types.instance(context);
+
+        test("abc",                     CLASS,      syms.stringType,    "abc");
+        test(Boolean.FALSE,             BOOLEAN,    syms.booleanType,   Integer.valueOf(0));
+        test(Boolean.TRUE,              BOOLEAN,    syms.booleanType,   Integer.valueOf(1));
+        test(Byte.valueOf((byte) 1),    BYTE,       syms.byteType,      Byte.valueOf((byte) 1));
+        test(Character.valueOf('a'),    CHAR,       syms.charType,      Integer.valueOf('a'));
+        test(Double.valueOf(1d),        DOUBLE,     syms.doubleType,    Double.valueOf(1d));
+        test(Float.valueOf(1f),         FLOAT,      syms.floatType,     Float.valueOf(1f));
+        test(Integer.valueOf(1),        INT,        syms.intType,       Integer.valueOf(1));
+        test(Long.valueOf(1),           LONG,       syms.longType,      Long.valueOf(1));
+        test(Short.valueOf((short) 1),  SHORT,      syms.shortType,     Short.valueOf((short) 1));
+
+        if (errors > 0)
+            throw new Exception(errors + " errors found");
+    }
+
+    void test(Object value, int tag, Type type, Object constValue) {
+        JCLiteral l = maker.Literal(value);
+        if (l.type.tag != tag)
+            error("unexpected tag: " + l.getTag() + ": expected: " + tag);
+        if (!types.isSameType(l.type, type))
+            error("unexpected type: " + l.type + ": expected: " + type);
+        if (l.type.constValue().getClass() != constValue.getClass()
+                || !constValue.equals(l.type.constValue()))  {
+            error("unexpected const value: "
+                    + l.type.constValue().getClass() + " " + l.type.constValue()
+                    + ": expected:" + constValue.getClass() + " " + constValue);
+        }
+    }
+
+    void error(String msg) {
+        System.err.println("Error: " + msg);
+        errors++;
+    }
+
+    TreeMaker maker;
+    Types types;
+    int errors;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/types/BoxingConversionTest.java	Mon Dec 20 21:10:57 2010 -0800
@@ -0,0 +1,254 @@
+/*
+ * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 7006109
+ * @summary Add test library to simplify the task of writing automated type-system tests
+ * @author mcimadamore
+ * @library .
+ * @run main BoxingConversionTest
+ */
+
+import com.sun.tools.javac.code.Type;
+import com.sun.tools.javac.code.Type.*;
+import com.sun.tools.javac.code.Symbol.*;
+import java.lang.reflect.Array;
+import java.util.EnumSet;
+
+/**
+ * Check invariants in assignment/method conversion involving boxing conversions
+ */
+public class BoxingConversionTest extends TypeHarness {
+
+    Type[] types1;
+    Type[] types2;
+    Type[] types3;
+
+    enum Result {
+        OK_BOTH(true),
+        FAIL_BOTH(false),
+        OK_ASSIGN_ONLY(true);
+
+        boolean value;
+
+        Result(boolean value) {
+            this.value = value;
+        }
+    }
+
+    enum ConversionKind {
+        ASSIGNMENT_CONVERSION(EnumSet.of(Result.OK_BOTH, Result.OK_ASSIGN_ONLY)) {
+            @Override
+            void check(TypeHarness harness, Type from, Type to, Result expected) {
+                harness.assertAssignable(from, to, resSet.contains(expected));
+            }
+        },
+        METHOD_CONVERSION(EnumSet.of(Result.OK_BOTH)) {
+            @Override
+            void check(TypeHarness harness, Type from, Type to, Result expected) {
+                harness.assertConvertible(from, to, resSet.contains(expected));
+            }
+        };
+
+        EnumSet<Result> resSet;
+
+        private ConversionKind(EnumSet<Result> resSet) {
+            this.resSet = resSet;
+        }
+
+        abstract void check(TypeHarness harness, Type from, Type to, Result expected);
+    }
+
+    enum TestKind {
+        SIMPLE {
+            @Override
+            Type[] getFromTypes(BoxingConversionTest harness) {
+                return harness.types1;
+            }
+            @Override
+            Type[] getToTypes(BoxingConversionTest harness) {
+                return harness.types1;
+            }
+            @Override
+            Result[][] getResults(BoxingConversionTest harness) {
+                return harness.results1;
+            }
+        },
+        CONSTANT_TYPES {
+            @Override
+            Type[] getFromTypes(BoxingConversionTest harness) {
+                return harness.types2;
+            }
+            @Override
+            Type[] getToTypes(BoxingConversionTest harness) {
+                return harness.types3;
+            }
+            @Override
+            Result[][] getResults(BoxingConversionTest harness) {
+                return harness.results2;
+            }
+        };
+
+        abstract Type[] getFromTypes(BoxingConversionTest harness);
+        abstract Type[] getToTypes(BoxingConversionTest harness);
+        abstract Result[][] getResults(BoxingConversionTest harness);
+    }
+
+    static final Result T = Result.OK_BOTH;
+    static final Result F = Result.FAIL_BOTH;
+    static final Result A = Result.OK_ASSIGN_ONLY;
+    static final Result X = Result.FAIL_BOTH.FAIL_BOTH;
+
+    Result[][] results1 = {
+                   //byte, short, int, long, float, double, char, bool, Byte, Short, Integer, Long, Float, Double, Character, Boolean
+    /*byte*/       { T   , T    , T  , T   , T    , T     , F   , F   , T   , F    , F      , F   , F    , F     , F        , F },
+    /*short*/      { F   , T    , T  , T   , T    , T     , F   , F   , F   , T    , F      , F   , F    , F     , F        , F },
+    /*int*/        { F   , F    , T  , T   , T    , T     , F   , F   , F   , F    , T      , F   , F    , F     , F        , F },
+    /*long*/       { F   , F    , F  , T   , T    , T     , F   , F   , F   , F    , F      , T   , F    , F     , F        , F },
+    /*float*/      { F   , F    , F  , F   , T    , T     , F   , F   , F   , F    , F      , F   , T    , F     , F        , F },
+    /*double*/     { F   , F    , F  , F   , F    , T     , F   , F   , F   , F    , F      , F   , F    , T     , F        , F },
+    /*char*/       { F   , F    , T  , T   , T    , T     , T   , F   , F   , F    , F      , F   , F    , F     , T        , F },
+    /*bool*/       { F   , F    , F  , F   , F    , F     , F   , T   , F   , F    , F      , F   , F    , F     , F        , T },
+    /*Byte*/       { T   , T    , T  , T   , T    , T     , F   , F   , T   , F    , F      , F   , F    , F     , F        , F },
+    /*Short*/      { F   , T    , T  , T   , T    , T     , F   , F   , F   , T    , F      , F   , F    , F     , F        , F },
+    /*Integer*/    { F   , F    , T  , T   , T    , T     , F   , F   , F   , F    , T      , F   , F    , F     , F        , F },
+    /*Long*/       { F   , F    , F  , T   , T    , T     , F   , F   , F   , F    , F      , T   , F    , F     , F        , F },
+    /*Float*/      { F   , F    , F  , F   , T    , T     , F   , F   , F   , F    , F      , F   , T    , F     , F        , F },
+    /*Double*/     { F   , F    , F  , F   , F    , T     , F   , F   , F   , F    , F      , F   , F    , T     , F        , F },
+    /*Character*/  { F   , F    , T  , T   , T    , T     , T   , F   , F   , F    , F      , F   , F    , F     , T        , F },
+    /*Boolean*/    { F   , F    , F  , F   , F    , F     , F   , T   , F   , F    , F      , F   , F    , F     , F        , T }};
+
+    Result[][] results2 = {
+                //Byte, Short, Integer, Long, Float, Double, Chararacter, Boolean
+    /*byte*/    { T   , F    , F      , F   , F    , F     , F          , F },
+    /*short*/   { F   , T    , F      , F   , F    , F     , F          , F },
+    /*short1*/  { A   , T    , F      , F   , F    , F     , A          , F },
+    /*short2*/  { F   , T    , F      , F   , F    , F     , A          , F },
+    /*int*/     { F   , F    , T      , F   , F    , F     , F          , F },
+    /*int1*/    { A   , A    , T      , F   , F    , F     , A          , F },
+    /*int2*/    { F   , A    , T      , F   , F    , F     , A          , F },
+    /*int4*/    { F   , F    , T      , F   , F    , F     , F          , F },
+    /*long*/    { F   , F    , F      , T   , F    , F     , F          , F },
+    /*long1*/   { F   , F    , F      , T   , F    , F     , F          , F },
+    /*long2*/   { F   , F    , F      , T   , F    , F     , F          , F },
+    /*long4*/   { F   , F    , F      , T   , F    , F     , F          , F },
+    /*long8*/   { F   , F    , F      , T   , F    , F     , F          , F },
+    /*float*/   { F   , F    , F      , F   , T    , F     , F          , F },
+    /*float1*/  { F   , F    , F      , F   , T    , F     , F          , F },
+    /*float2*/  { F   , F    , F      , F   , T    , F     , F          , F },
+    /*float4*/  { F   , F    , F      , F   , T    , F     , F          , F },
+    /*double*/  { F   , F    , F      , F   , F    , T     , F          , F },
+    /*double1*/ { F   , F    , F      , F   , F    , T     , F          , F },
+    /*double2*/ { F   , F    , F      , F   , F    , T     , F          , F },
+    /*double4*/ { F   , F    , F      , F   , F    , T     , F          , F },
+    /*double8*/ { F   , F    , F      , F   , F    , T     , F          , F },
+    /*char*/    { F   , F    , F      , F   , F    , F     , T          , F },
+    /*char1*/   { A   , A    , F      , F   , F    , F     , T          , F },
+    /*char2*/   { F   , A    , F      , F   , F    , F     , T          , F },
+    /*bool*/    { F   , F    , F      , F   , F    , F     , F          , T }};
+
+    BoxingConversionTest() {
+        Type[] primitiveTypes = new Type[] {
+            predef.byteType,
+            predef.shortType,
+            predef.intType,
+            predef.longType,
+            predef.floatType,
+            predef.doubleType,
+            predef.charType,
+            predef.booleanType };
+
+        Type[] boxedTypes = new Type[primitiveTypes.length];
+        for (int i = 0 ; i < primitiveTypes.length ; i++) {
+            boxedTypes[i] = box(primitiveTypes[i]);
+        }
+
+        types1 = join(Type.class, primitiveTypes, boxedTypes);
+
+        types2 = new Type[] {
+            predef.byteType,
+            predef.shortType,
+            fac.Constant((short)0x0001),
+            fac.Constant((short)0x0100),
+            predef.intType,
+            fac.Constant((int)0x0000_0001),
+            fac.Constant((int)0x0000_0100),
+            fac.Constant((int)0x0001_0000),
+            predef.longType,
+            fac.Constant((long)0x0000_0000_0000_0001L),
+            fac.Constant((long)0x0000_0000_0000_0100L),
+            fac.Constant((long)0x0000_0000_0001_0000L),
+            fac.Constant((long)0x0001_0000_0000_0000L),
+            predef.floatType,
+            fac.Constant((float)0x0000_0001),
+            fac.Constant((float)0x0000_0100),
+            fac.Constant((float)0x0001_0000),
+            predef.doubleType,
+            fac.Constant((double)0x0000_0000_0000_0001L),
+            fac.Constant((double)0x0000_0000_0000_0100L),
+            fac.Constant((double)0x0000_0000_0001_0000L),
+            fac.Constant((double)0x0001_0000_0000_0000L),
+            predef.charType,
+            fac.Constant((char)0x0001),
+            fac.Constant((char)0x0100),
+            predef.booleanType
+        };
+
+        types3 = boxedTypes;
+    }
+
+    void testConversion(ConversionKind convKind, TestKind testKind) {
+        Type[] rows = testKind.getFromTypes(this);
+        Type[] cols = testKind.getToTypes(this);
+        for (int i = 0; i < rows.length ; i++) {
+            for (int j = 0; j < cols.length ; j++) {
+                convKind.check(this, rows[i], cols[j], testKind.getResults(this)[i][j]);
+            }
+        }
+    }
+
+    @SuppressWarnings("unchecked")
+    <T> T[] join(Class<T> type, T[]... args) {
+        int totalLength = 0;
+        for (T[] arr : args) {
+            totalLength += arr.length;
+        }
+        T[] new_arr = (T[])Array.newInstance(type, totalLength);
+        int idx = 0;
+        for (T[] arr : args) {
+            System.arraycopy(arr, 0, new_arr, idx, arr.length);
+            idx += arr.length;
+        }
+        return new_arr;
+    }
+
+    public static void main(String[] args) {
+        BoxingConversionTest harness = new BoxingConversionTest();
+        for (ConversionKind convKind : ConversionKind.values()) {
+            for (TestKind testKind : TestKind.values()) {
+                harness.testConversion(convKind, testKind);
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/types/CastTest.java	Mon Dec 20 21:10:57 2010 -0800
@@ -0,0 +1,129 @@
+/*
+ * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 7006109
+ * @summary Add test library to simplify the task of writing automated type-system tests
+ * @author mcimadamore
+ * @library .
+ * @run main CastTest
+ */
+
+import com.sun.tools.javac.code.Type;
+import com.sun.tools.javac.code.Type.*;
+import com.sun.tools.javac.code.Symbol.*;
+import java.lang.reflect.Array;
+
+import static com.sun.tools.javac.code.Flags.*;
+
+/**
+ * Check invariants in cast conversion involving primitive types and arrays
+ */
+public class CastTest extends TypeHarness {
+
+    Type[] allTypes;
+
+    static final boolean T = true;
+    static final boolean F = false;
+
+    boolean[][] cast_result = {
+                //byte, short, int, long, float, double, char, bool, C, +C, I, T, byte[], short[], int[], long[], float[], double[], char[], bool[], C[], +C[], I[], T[]
+    /*byte*/    { T   , T    , T  , T   , T    , T     , T   , F   , F, F , F, F, F     , F      , F    , F     , F      , F       , F     , F     , F  , F   , F  , F },
+    /*short*/   { T   , T    , T  , T   , T    , T     , T   , F   , F, F , F, F, F     , F      , F    , F     , F      , F       , F     , F     , F  , F   , F  , F },
+    /*int*/     { T   , T    , T  , T   , T    , T     , T   , F   , F, F , F, F, F     , F      , F    , F     , F      , F       , F     , F     , F  , F   , F  , F },
+    /*long*/    { T   , T    , T  , T   , T    , T     , T   , F   , F, F , F, F, F     , F      , F    , F     , F      , F       , F     , F     , F  , F   , F  , F },
+    /*float*/   { T   , T    , T  , T   , T    , T     , T   , F   , F, F , F, F, F     , F      , F    , F     , F      , F       , F     , F     , F  , F   , F  , F },
+    /*double*/  { T   , T    , T  , T   , T    , T     , T   , F   , F, F , F, F, F     , F      , F    , F     , F      , F       , F     , F     , F  , F   , F  , F },
+    /*char*/    { T   , T    , T  , T   , T    , T     , T   , F   , F, F , F, F, F     , F      , F    , F     , F      , F       , F     , F     , F  , F   , F  , F },
+    /*bool*/    { F   , F    , F  , F   , F    , F     , F   , T   , F, F , F, F, F     , F      , F    , F     , F      , F       , F     , F     , F  , F   , F  , F },
+    /*C*/       { F   , F    , F  , F   , F    , F     , F   , F   , T, F , T, T, F     , F      , F    , F     , F      , F       , F     , F     , F  , F   , F  , F },
+    /*+C*/      { F   , F    , F  , F   , F    , F     , F   , F   , F, T , F, T, F     , F      , F    , F     , F      , F       , F     , F     , F  , F   , F  , F },
+    /*I*/       { F   , F    , F  , F   , F    , F     , F   , F   , T, F , T, T, F     , F      , F    , F     , F      , F       , F     , F     , F  , F   , F  , F },
+    /*T*/       { F   , F    , F  , F   , F    , F     , F   , F   , T, T , T, T, T     , T      , T    , T     , T      , T       , T     , T     , T  , T   , T  , T },
+    /*byte[]*/  { F   , F    , F  , F   , F    , F     , F   , F   , F, F , F, T, T     , F      , F    , F     , F      , F       , F     , F     , F  , F   , F  , F },
+    /*short[]*/ { F   , F    , F  , F   , F    , F     , F   , F   , F, F , F, T, F     , T      , F    , F     , F      , F       , F     , F     , F  , F   , F  , F },
+    /*int[]*/   { F   , F    , F  , F   , F    , F     , F   , F   , F, F , F, T, F     , F      , T    , F     , F      , F       , F     , F     , F  , F   , F  , F },
+    /*long[]*/  { F   , F    , F  , F   , F    , F     , F   , F   , F, F , F, T, F     , F      , F    , T     , F      , F       , F     , F     , F  , F   , F  , F },
+    /*float[]*/ { F   , F    , F  , F   , F    , F     , F   , F   , F, F , F, T, F     , F      , F    , F     , T      , F       , F     , F     , F  , F   , F  , F },
+    /*double[]*/{ F   , F    , F  , F   , F    , F     , F   , F   , F, F , F, T, F     , F      , F    , F     , F      , T       , F     , F     , F  , F   , F  , F },
+    /*char[]*/  { F   , F    , F  , F   , F    , F     , F   , F   , F, F , F, T, F     , F      , F    , F     , F      , F       , T     , F     , F  , F   , F  , F },
+    /*bool[]*/  { F   , F    , F  , F   , F    , F     , F   , F   , F, F , F, T, F     , F      , F    , F     , F      , F       , F     , T     , F  , F   , F  , F },
+    /*C[]*/     { F   , F    , F  , F   , F    , F     , F   , F   , F, F , F, T, F     , F      , F    , F     , F      , F       , F     , F     , T  , F   , T  , T },
+    /*+C[]*/    { F   , F    , F  , F   , F    , F     , F   , F   , F, F , F, T, F     , F      , F    , F     , F      , F       , F     , F     , F  , T   , F  , T },
+    /*I[]*/     { F   , F    , F  , F   , F    , F     , F   , F   , F, F , F, T, F     , F      , F    , F     , F      , F       , F     , F     , T  , F   , T  , T },
+    /*T[]*/     { F   , F    , F  , F   , F    , F     , F   , F   , F, F , F, T, F     , F      , F    , F     , F      , F       , F     , F     , T  , T   , T  , T }};
+
+    CastTest() {
+        Type[] primitiveTypes = {
+            predef.byteType,
+            predef.shortType,
+            predef.intType,
+            predef.longType,
+            predef.floatType,
+            predef.doubleType,
+            predef.charType,
+            predef.booleanType };
+
+        Type[] referenceTypes = {
+            fac.Class(),
+            fac.Class(FINAL),
+            fac.Interface(),
+            fac.TypeVariable() };
+
+        Type[] arrayTypes = new Type[primitiveTypes.length + referenceTypes.length];
+        int idx = 0;
+        for (Type t : join(Type.class, primitiveTypes, referenceTypes)) {
+            arrayTypes[idx++] = fac.Array(t);
+        }
+
+        allTypes = join(Type.class, primitiveTypes, referenceTypes, arrayTypes);
+    }
+
+    void test() {
+        for (int i = 0; i < allTypes.length ; i++) {
+            for (int j = 0; j < allTypes.length ; j++) {
+                assertCastable(allTypes[i], allTypes[j], cast_result[i][j]);
+            }
+        }
+    }
+
+    @SuppressWarnings("unchecked")
+    <T> T[] join(Class<T> type, T[]... args) {
+        int totalLength = 0;
+        for (T[] arr : args) {
+            totalLength += arr.length;
+        }
+        T[] new_arr = (T[])Array.newInstance(type, totalLength);
+        int idx = 0;
+        for (T[] arr : args) {
+            System.arraycopy(arr, 0, new_arr, idx, arr.length);
+            idx += arr.length;
+        }
+        return new_arr;
+    }
+
+    public static void main(String[] args) {
+        new CastTest().test();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/types/PrimitiveConversionTest.java	Mon Dec 20 21:10:57 2010 -0800
@@ -0,0 +1,275 @@
+/*
+ * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 7006109
+ * @summary Add test library to simplify the task of writing automated type-system tests
+ * @author mcimadamore
+ * @library .
+ * @run main PrimitiveConversionTest
+ */
+
+import com.sun.tools.javac.code.Type;
+import com.sun.tools.javac.code.Type.*;
+import com.sun.tools.javac.code.Symbol.*;
+import java.lang.reflect.Array;
+import java.util.EnumSet;
+
+/**
+ * Check invariants in assignment/method conversion involving primitive types and arrays
+ */
+public class PrimitiveConversionTest extends TypeHarness {
+
+    Type[] types1;
+    Type[] types2;
+    Type[] types3;
+
+    enum Result {
+        OK_BOTH(true),
+        FAIL_BOTH(false),
+        OK_ASSIGN_ONLY(true);
+
+        boolean value;
+
+        Result(boolean value) {
+            this.value = value;
+        }
+    }
+
+    enum ConversionKind {
+        ASSIGNMENT_CONVERSION(EnumSet.of(Result.OK_BOTH, Result.OK_ASSIGN_ONLY)) {
+            @Override
+            void check(TypeHarness harness, Type from, Type to, Result expected) {
+                harness.assertAssignable(from, to, resSet.contains(expected));
+            }
+        },
+        METHOD_CONVERSION(EnumSet.of(Result.OK_BOTH)) {
+            @Override
+            void check(TypeHarness harness, Type from, Type to, Result expected) {
+                harness.assertConvertible(from, to, resSet.contains(expected));
+            }
+        };
+
+        EnumSet<Result> resSet;
+
+        private ConversionKind(EnumSet<Result> resSet) {
+            this.resSet = resSet;
+        }
+
+        abstract void check(TypeHarness harness, Type from, Type to, Result expected);
+    }
+
+    enum TestKind {
+        SIMPLE {
+            @Override
+            Type[] getFromTypes(PrimitiveConversionTest harness) {
+                return harness.types1;
+            }
+            @Override
+            Type[] getToTypes(PrimitiveConversionTest harness) {
+                return harness.types1;
+            }
+            @Override
+            Result[][] getResults(PrimitiveConversionTest harness) {
+                return harness.results1;
+            }
+        },
+        CONSTANT_TYPES {
+            @Override
+            Type[] getFromTypes(PrimitiveConversionTest harness) {
+                return harness.types2;
+            }
+            @Override
+            Type[] getToTypes(PrimitiveConversionTest harness) {
+                return harness.types3;
+            }
+            @Override
+            Result[][] getResults(PrimitiveConversionTest harness) {
+                return harness.results2;
+            }
+        };
+
+        abstract Type[] getFromTypes(PrimitiveConversionTest harness);
+        abstract Type[] getToTypes(PrimitiveConversionTest harness);
+        abstract Result[][] getResults(PrimitiveConversionTest harness);
+    }
+
+    static final Result T = Result.OK_BOTH;
+    static final Result F = Result.FAIL_BOTH;
+    static final Result A = Result.OK_ASSIGN_ONLY;
+
+    Result[][] results1 = {
+                //byte, short, int, long, float, double, char, bool, C1, C2, C3, T , byte[], short[], int[], long[], float[], double[], char[], bool[], C1[], C2[], C3[], T[]
+    /*byte*/    { T   , T    , T  , T   , T    , T     , F   , F   , F , F , F , F , F     , F      , F    , F     , F      , F       , F     , F     , F   , F   , F   , F },
+    /*short*/   { F   , T    , T  , T   , T    , T     , F   , F   , F , F , F , F , F     , F      , F    , F     , F      , F       , F     , F     , F   , F   , F   , F },
+    /*int*/     { F   , F    , T  , T   , T    , T     , F   , F   , F , F , F , F , F     , F      , F    , F     , F      , F       , F     , F     , F   , F   , F   , F },
+    /*long*/    { F   , F    , F  , T   , T    , T     , F   , F   , F , F , F , F , F     , F      , F    , F     , F      , F       , F     , F     , F   , F   , F   , F },
+    /*float*/   { F   , F    , F  , F   , T    , T     , F   , F   , F , F , F , F , F     , F      , F    , F     , F      , F       , F     , F     , F   , F   , F   , F },
+    /*double*/  { F   , F    , F  , F   , F    , T     , F   , F   , F , F , F , F , F     , F      , F    , F     , F      , F       , F     , F     , F   , F   , F   , F },
+    /*char*/    { F   , F    , T  , T   , T    , T     , T   , F   , F , F , F , F , F     , F      , F    , F     , F      , F       , F     , F     , F   , F   , F   , F },
+    /*bool*/    { F   , F    , F  , F   , F    , F     , F   , T   , F , F , F , F , F     , F      , F    , F     , F      , F       , F     , F     , F   , F   , F   , F },
+    /*C1*/      { F   , F    , F  , F   , F    , F     , F   , F   , T , F , T , F , F     , F      , F    , F     , F      , F       , F     , F     , F   , F   , F   , F },
+    /*C2*/      { F   , F    , F  , F   , F    , F     , F   , F   , T , T , T , F , F     , F      , F    , F     , F      , F       , F     , F     , F   , F   , F   , F },
+    /*C3*/      { F   , F    , F  , F   , F    , F     , F   , F   , T , F , T , F , F     , F      , F    , F     , F      , F       , F     , F     , F   , F   , F   , F },
+    /*T*/       { F   , F    , F  , F   , F    , F     , F   , F   , F , F , F , T , F     , F      , F    , F     , F      , F       , F     , F     , F   , F   , F   , F },
+    /*byte[]*/  { F   , F    , F  , F   , F    , F     , F   , F   , F , F , F , F , T     , F      , F    , F     , F      , F       , F     , F     , F   , F   , F   , F },
+    /*short[]*/ { F   , F    , F  , F   , F    , F     , F   , F   , F , F , F , F , F     , T      , F    , F     , F      , F       , F     , F     , F   , F   , F   , F },
+    /*int[]*/   { F   , F    , F  , F   , F    , F     , F   , F   , F , F , F , F , F     , F      , T    , F     , F      , F       , F     , F     , F   , F   , F   , F },
+    /*long[]*/  { F   , F    , F  , F   , F    , F     , F   , F   , F , F , F , F , F     , F      , F    , T     , F      , F       , F     , F     , F   , F   , F   , F },
+    /*float[]*/ { F   , F    , F  , F   , F    , F     , F   , F   , F , F , F , F , F     , F      , F    , F     , T      , F       , F     , F     , F   , F   , F   , F },
+    /*double[]*/{ F   , F    , F  , F   , F    , F     , F   , F   , F , F , F , F , F     , F      , F    , F     , F      , T       , F     , F     , F   , F   , F   , F },
+    /*char[]*/  { F   , F    , F  , F   , F    , F     , F   , F   , F , F , F , F , F     , F      , F    , F     , F      , F       , T     , F     , F   , F   , F   , F },
+    /*bool[]*/  { F   , F    , F  , F   , F    , F     , F   , F   , F , F , F , F , F     , F      , F    , F     , F      , F       , F     , T     , F   , F   , F   , F },
+    /*C1[]*/    { F   , F    , F  , F   , F    , F     , F   , F   , F , F , F , F , F     , F      , F    , F     , F      , F       , F     , F     , T   , F   , T   , F },
+    /*C2[]*/    { F   , F    , F  , F   , F    , F     , F   , F   , F , F , F , F , F     , F      , F    , F     , F      , F       , F     , F     , T   , T   , T   , F },
+    /*C3[]*/    { F   , F    , F  , F   , F    , F     , F   , F   , F , F , F , F , F     , F      , F    , F     , F      , F       , F     , F     , T   , F   , T   , F },
+    /*T[]*/     { F   , F    , F  , F   , F    , F     , F   , F   , F , F , F , F , F     , F      , F    , F     , F      , F       , F     , F     , F   , F   , F   , T }};
+
+    Result[][] results2 = {
+                //byte, short, int, long, float, double, char, bool
+    /*byte*/    { T   , T    , T  , T   , T    , T     , F   , F },
+    /*short*/   { F   , T    , T  , T   , T    , T     , F   , F },
+    /*short1*/  { A   , T    , T  , T   , T    , T     , A   , F },
+    /*short2*/  { F   , T    , T  , T   , T    , T     , A   , F },
+    /*int*/     { F   , F    , T  , T   , T    , T     , F   , F },
+    /*int1*/    { A   , A    , T  , T   , T    , T     , A   , F },
+    /*int2*/    { F   , A    , T  , T   , T    , T     , A   , F },
+    /*int4*/    { F   , F    , T  , T   , T    , T     , F   , F },
+    /*long*/    { F   , F    , F  , T   , T    , T     , F   , F },
+    /*long1*/   { F   , F    , F  , T   , T    , T     , F   , F },
+    /*long2*/   { F   , F    , F  , T   , T    , T     , F   , F },
+    /*long4*/   { F   , F    , F  , T   , T    , T     , F   , F },
+    /*long8*/   { F   , F    , F  , T   , T    , T     , F   , F },
+    /*float*/   { F   , F    , F  , F   , T    , T     , F   , F },
+    /*float1*/  { F   , F    , F  , F   , T    , T     , F   , F },
+    /*float2*/  { F   , F    , F  , F   , T    , T     , F   , F },
+    /*float4*/  { F   , F    , F  , F   , T    , T     , F   , F },
+    /*double*/  { F   , F    , F  , F   , F    , T     , F   , F },
+    /*double1*/ { F   , F    , F  , F   , F    , T     , F   , F },
+    /*double2*/ { F   , F    , F  , F   , F    , T     , F   , F },
+    /*double4*/ { F   , F    , F  , F   , F    , T     , F   , F },
+    /*double8*/ { F   , F    , F  , F   , F    , T     , F   , F },
+    /*char*/    { F   , F    , T  , T   , T    , T     , T   , F },
+    /*char1*/   { A   , A    , T  , T   , T    , T     , T   , F },
+    /*char2*/   { F   , A    , T  , T   , T    , T     , T   , F },
+    /*bool*/    { F   , F    , F  , F   , F    , F     , F   , T }};
+
+    PrimitiveConversionTest() {
+        Type[] primitiveTypes = new Type[] {
+            predef.byteType,
+            predef.shortType,
+            predef.intType,
+            predef.longType,
+            predef.floatType,
+            predef.doubleType,
+            predef.charType,
+            predef.booleanType };
+
+        ClassType c1 = fac.Class(fac.TypeVariable());
+        ClassType c2 = fac.Class();
+        c2.supertype_field = subst(c1,
+                Mapping(c1.getTypeArguments().head, predef.stringType));
+        Type c3 = erasure(c1);
+
+        Type[] referenceTypes = {
+            subst(c1,
+                    Mapping(c1.getTypeArguments().head, predef.stringType)),
+            c2,
+            c3,
+            fac.TypeVariable() };
+
+        Type[] arrayTypes = new Type[primitiveTypes.length + referenceTypes.length];
+        int idx = 0;
+        for (Type t : join(Type.class, primitiveTypes, referenceTypes)) {
+            arrayTypes[idx++] = fac.Array(t);
+        }
+
+        types1 = join(Type.class, primitiveTypes, referenceTypes, arrayTypes);
+
+        types2 = new Type[] {
+            predef.byteType,
+            predef.shortType,
+            fac.Constant((short)0x0001),
+            fac.Constant((short)0x0100),
+            predef.intType,
+            fac.Constant((int)0x0000_0001),
+            fac.Constant((int)0x0000_0100),
+            fac.Constant((int)0x0001_0000),
+            predef.longType,
+            fac.Constant((long)0x0000_0000_0000_0001L),
+            fac.Constant((long)0x0000_0000_0000_0100L),
+            fac.Constant((long)0x0000_0000_0001_0000L),
+            fac.Constant((long)0x0001_0000_0000_0000L),
+            predef.floatType,
+            fac.Constant((float)0x0000_0001),
+            fac.Constant((float)0x0000_0100),
+            fac.Constant((float)0x0001_0000),
+            predef.doubleType,
+            fac.Constant((double)0x0000_0000_0000_0001L),
+            fac.Constant((double)0x0000_0000_0000_0100L),
+            fac.Constant((double)0x0000_0000_0001_0000L),
+            fac.Constant((double)0x0001_0000_0000_0000L),
+            predef.charType,
+            fac.Constant((char)0x0001),
+            fac.Constant((char)0x0100),
+            predef.booleanType
+        };
+
+        types3 = primitiveTypes;
+    }
+
+    void testConversion(ConversionKind convKind, TestKind testKind) {
+        Type[] rows = testKind.getFromTypes(this);
+        Type[] cols = testKind.getToTypes(this);
+        for (int i = 0; i < rows.length ; i++) {
+            for (int j = 0; j < cols.length ; j++) {
+                convKind.check(this, rows[i], cols[j], testKind.getResults(this)[i][j]);
+            }
+        }
+    }
+
+    @SuppressWarnings("unchecked")
+    <T> T[] join(Class<T> type, T[]... args) {
+        int totalLength = 0;
+        for (T[] arr : args) {
+            totalLength += arr.length;
+        }
+        T[] new_arr = (T[])Array.newInstance(type, totalLength);
+        int idx = 0;
+        for (T[] arr : args) {
+            System.arraycopy(arr, 0, new_arr, idx, arr.length);
+            idx += arr.length;
+        }
+        return new_arr;
+    }
+
+    public static void main(String[] args) {
+        PrimitiveConversionTest harness = new PrimitiveConversionTest();
+        for (ConversionKind convKind : ConversionKind.values()) {
+            for (TestKind testKind : TestKind.values()) {
+                harness.testConversion(convKind, testKind);
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/types/TypeHarness.java	Mon Dec 20 21:10:57 2010 -0800
@@ -0,0 +1,315 @@
+/*
+ * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import com.sun.tools.javac.code.BoundKind;
+import com.sun.tools.javac.code.Flags;
+import com.sun.tools.javac.util.Context;
+import com.sun.tools.javac.code.Types;
+import com.sun.tools.javac.code.Symtab;
+import com.sun.tools.javac.code.Type;
+import com.sun.tools.javac.code.Type.*;
+import com.sun.tools.javac.code.Symbol.*;
+import com.sun.tools.javac.util.List;
+import com.sun.tools.javac.util.ListBuffer;
+import com.sun.tools.javac.util.Name;
+import com.sun.tools.javac.util.Names;
+import com.sun.tools.javac.file.JavacFileManager;
+
+/**
+ * Test harness whose goal is to simplify the task of writing type-system
+ * regression test. It provides functionalities to build custom types as well
+ * as to access the underlying javac's symbol table in order to retrieve
+ * predefined types. Among the features supported by the harness are: type
+ * substitution, type containment, subtyping, cast-conversion, assigment
+ * conversion.
+ *
+ * This class is meant to be a common super class for all concrete type test
+ * classes. A subclass can access the type-factory and the test methods so as
+ * to write compact tests. An example is reported below:
+ *
+ * <pre>
+ * Type X = fac.TypeVariable();
+ * Type Y = fac.TypeVariable();
+ * Type A_X_Y = fac.Class(0, X, Y);
+ * Type A_Obj_Obj = fac.Class(0,
+ *           predef.objectType,
+ *           predef.objectType);
+ * checkSameType(A_Obj_Obj, subst(A_X_Y,
+ *           Mapping(X, predef.objectType),
+ *           Mapping(Y, predef.objectType)));
+ * </pre>
+ *
+ * The above code is used to create two class types, namely {@code A<X,Y>} and
+ * {@code A<Object,Object>} where both {@code X} and {@code Y} are type-variables.
+ * The code then verifies that {@code [X:=Object,Y:=Object]A<X,Y> == A<Object,Object>}.
+ *
+ * @author mcimadamore
+ */
+public class TypeHarness {
+
+    protected Types types;
+    protected Symtab predef;
+    protected Names names;
+    protected Factory fac;
+
+    protected TypeHarness() {
+        Context ctx = new Context();
+        JavacFileManager.preRegister(ctx);
+        types = Types.instance(ctx);
+        predef = Symtab.instance(ctx);
+        names = Names.instance(ctx);
+        fac = new Factory();
+    }
+
+    // <editor-fold defaultstate="collapsed" desc="type assertions">
+
+    /** assert that 's' is a subtype of 't' */
+    public void assertSubtype(Type s, Type t) {
+        assertSubtype(s, t, true);
+    }
+
+    /** assert that 's' is/is not a subtype of 't' */
+    public void assertSubtype(Type s, Type t, boolean expected) {
+        if (types.isSubtype(s, t) != expected) {
+            String msg = expected ?
+                " is not a subtype of " :
+                " is a subtype of ";
+            error(s + msg + t);
+        }
+    }
+
+    /** assert that 's' is the same type as 't' */
+    public void assertSameType(Type s, Type t) {
+        assertSameType(s, t, true);
+    }
+
+    /** assert that 's' is/is not the same type as 't' */
+    public void assertSameType(Type s, Type t, boolean expected) {
+        if (types.isSameType(s, t) != expected) {
+            String msg = expected ?
+                " is not the same type as " :
+                " is the same type as ";
+            error(s + msg + t);
+        }
+    }
+
+    /** assert that 's' is castable to 't' */
+    public void assertCastable(Type s, Type t) {
+        assertCastable(s, t, true);
+    }
+
+    /** assert that 's' is/is not castable to 't' */
+    public void assertCastable(Type s, Type t, boolean expected) {
+        if (types.isCastable(s, t) != expected) {
+            String msg = expected ?
+                " is not castable to " :
+                " is castable to ";
+            error(s + msg + t);
+        }
+    }
+
+    /** assert that 's' is convertible (method invocation conversion) to 't' */
+    public void assertConvertible(Type s, Type t) {
+        assertCastable(s, t, true);
+    }
+
+    /** assert that 's' is/is not convertible (method invocation conversion) to 't' */
+    public void assertConvertible(Type s, Type t, boolean expected) {
+        if (types.isConvertible(s, t) != expected) {
+            String msg = expected ?
+                " is not convertible to " :
+                " is convertible to ";
+            error(s + msg + t);
+        }
+    }
+
+    /** assert that 's' is assignable to 't' */
+    public void assertAssignable(Type s, Type t) {
+        assertCastable(s, t, true);
+    }
+
+    /** assert that 's' is/is not assignable to 't' */
+    public void assertAssignable(Type s, Type t, boolean expected) {
+        if (types.isAssignable(s, t) != expected) {
+            String msg = expected ?
+                " is not assignable to " :
+                " is assignable to ";
+            error(s + msg + t);
+        }
+    }
+    // </editor-fold>
+
+    private void error(String msg) {
+        throw new AssertionError("Unexpected result: " + msg);
+    }
+
+    // <editor-fold defaultstate="collapsed" desc="type functions">
+
+    /** compute the erasure of a type 't' */
+    public Type erasure(Type t) {
+        return types.erasure(t);
+    }
+
+    /** compute the capture of a type 't' */
+    public Type capture(Type t) {
+        return types.capture(t);
+    }
+
+    /** compute the boxed type associated with 't' */
+    public Type box(Type t) {
+        if (!t.isPrimitive()) {
+            throw new AssertionError("Cannot box non-primitive type: " + t);
+        }
+        return types.boxedClass(t).type;
+    }
+
+    /** compute the unboxed type associated with 't' */
+    public Type unbox(Type t) {
+        Type u = types.unboxedType(t);
+        if (t == null) {
+            throw new AssertionError("Cannot unbox reference type: " + t);
+        } else {
+            return u;
+        }
+    }
+
+    /** compute a type substitution on 't' given a list of type mappings */
+    public Type subst(Type t, Mapping... maps) {
+        ListBuffer<Type> from = ListBuffer.lb();
+        ListBuffer<Type> to = ListBuffer.lb();
+        for (Mapping tm : maps) {
+            from.append(tm.from);
+            to.append(tm.to);
+        }
+        return types.subst(t, from.toList(), to.toList());
+    }
+
+    /** create a fresh type mapping from a type to another */
+    public Mapping Mapping(Type from, Type to) {
+        return new Mapping(from, to);
+    }
+
+    public static class Mapping {
+        Type from;
+        Type to;
+        private Mapping(Type from, Type to) {
+            this.from = from;
+            this.to = to;
+        }
+    }
+    // </editor-fold>
+
+    // <editor-fold defaultstate="collapsed" desc="type factory">
+
+    /**
+     * This class is used to create Java types in a simple way. All main
+     * kinds of type are supported: primitive, reference, non-denotable. The
+     * factory also supports creation of constant types (used by the compiler
+     * to represent the type of a literal).
+     */
+    public class Factory {
+
+        private int synthNameCount = 0;
+
+        private Name syntheticName() {
+            return names.fromString("A$" + synthNameCount++);
+        }
+
+        public ClassType Class(long flags, Type... typeArgs) {
+            ClassSymbol csym = new ClassSymbol(flags, syntheticName(), predef.noSymbol);
+            csym.type = new ClassType(Type.noType, List.from(typeArgs), csym);
+            ((ClassType)csym.type).supertype_field = predef.objectType;
+            return (ClassType)csym.type;
+        }
+
+        public ClassType Class(Type... typeArgs) {
+            return Class(0, typeArgs);
+        }
+
+        public ClassType Interface(Type... typeArgs) {
+            return Class(Flags.INTERFACE, typeArgs);
+        }
+
+        public ClassType Interface(long flags, Type... typeArgs) {
+            return Class(Flags.INTERFACE | flags, typeArgs);
+        }
+
+        public Type Constant(byte b) {
+            return predef.byteType.constType(b);
+        }
+
+        public Type Constant(short s) {
+            return predef.shortType.constType(s);
+        }
+
+        public Type Constant(int i) {
+            return predef.intType.constType(i);
+        }
+
+        public Type Constant(long l) {
+            return predef.longType.constType(l);
+        }
+
+        public Type Constant(float f) {
+            return predef.floatType.constType(f);
+        }
+
+        public Type Constant(double d) {
+            return predef.doubleType.constType(d);
+        }
+
+        public Type Constant(char c) {
+            return predef.charType.constType(c + 0);
+        }
+
+        public ArrayType Array(Type elemType) {
+            return new ArrayType(elemType, predef.arrayClass);
+        }
+
+        public TypeVar TypeVariable() {
+            return TypeVariable(predef.objectType);
+        }
+
+        public TypeVar TypeVariable(Type bound) {
+            TypeSymbol tvsym = new TypeSymbol(0, syntheticName(), null, predef.noSymbol);
+            tvsym.type = new TypeVar(tvsym, bound, null);
+            return (TypeVar)tvsym.type;
+        }
+
+        public WildcardType Wildcard(BoundKind bk, Type bound) {
+            return new WildcardType(bound, bk, predef.boundClass);
+        }
+
+        public CapturedType CapturedVariable(Type upper, Type lower) {
+            return new CapturedType(syntheticName(), predef.noSymbol, upper, lower, null);
+        }
+
+        public ClassType Intersection(Type classBound, Type... intfBounds) {
+            ClassType ct = Class(Flags.COMPOUND);
+            ct.supertype_field = classBound;
+            ct.interfaces_field = List.from(intfBounds);
+            return ct;
+        }
+    }
+    // </editor-fold>
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/varargs/5088429/T5088429Neg01.java	Mon Dec 20 21:10:57 2010 -0800
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 5088429
+ *
+ * @summary varargs overloading problem
+ * @author mcimadamore
+ * @compile/fail/ref=T5088429Neg01.out -XDrawDiagnostics T5088429Neg01.java
+ *
+ */
+
+class T5088429Neg01 {
+    interface A {}
+    interface B extends A {}
+
+    T5088429Neg01(A... args) {}
+    T5088429Neg01(A a, A... args) {}
+
+    void test(B b) {
+        new T5088429Neg01(b);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/varargs/5088429/T5088429Neg01.out	Mon Dec 20 21:10:57 2010 -0800
@@ -0,0 +1,2 @@
+T5088429Neg01.java:42:9: compiler.err.ref.ambiguous: T5088429Neg01, kindname.constructor, T5088429Neg01(T5088429Neg01.A...), T5088429Neg01, kindname.constructor, T5088429Neg01(T5088429Neg01.A,T5088429Neg01.A...), T5088429Neg01
+1 error
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/varargs/5088429/T5088429Neg02.java	Mon Dec 20 21:10:57 2010 -0800
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 5088429
+ *
+ * @summary varargs overloading problem
+ * @author mcimadamore
+ * @compile/fail/ref=T5088429Neg02.out -XDrawDiagnostics T5088429Neg02.java
+ *
+ */
+
+class T5088429Neg02 {
+    interface A {}
+    interface B extends A {}
+
+    void m(A... args) {}
+    void m(A a, A... args) {}
+
+    void test(B b) {
+        m(b);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/varargs/5088429/T5088429Neg02.out	Mon Dec 20 21:10:57 2010 -0800
@@ -0,0 +1,2 @@
+T5088429Neg02.java:42:9: compiler.err.ref.ambiguous: m, kindname.method, m(T5088429Neg02.A...), T5088429Neg02, kindname.method, m(T5088429Neg02.A,T5088429Neg02.A...), T5088429Neg02
+1 error
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/varargs/5088429/T5088429Pos01.java	Mon Dec 20 21:10:57 2010 -0800
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 5088429
+ *
+ * @summary varargs overloading problem
+ * @author mcimadamore
+ * @compile T5088429Pos01.java
+ *
+ */
+
+class T5088429Pos01 {
+    interface A {}
+    interface B extends A {}
+
+    T5088429Pos01(A... args) {}
+    T5088429Pos01(B b, A... args) {}
+
+    void test(B b) {
+        new T5088429Pos01(b);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/varargs/5088429/T5088429Pos02.java	Mon Dec 20 21:10:57 2010 -0800
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 5088429
+ *
+ * @summary varargs overloading problem
+ * @author mcimadamore
+ * @compile T5088429Pos02.java
+ *
+ */
+
+class T5088429Pos02 {
+    interface A {}
+    interface B extends A {}
+
+    void m(A... args) {}
+    void m(B b, A... args) {}
+
+    void test(B b) {
+        m(b);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/varargs/6199075/T6199075.java	Mon Dec 20 21:10:57 2010 -0800
@@ -0,0 +1,284 @@
+/*
+ * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 6199075
+ *
+ * @summary Unambiguous varargs method calls flagged as ambiguous
+ * @author mcimadamore
+ *
+ */
+
+import com.sun.source.util.JavacTask;
+import com.sun.tools.classfile.Instruction;
+import com.sun.tools.classfile.Attribute;
+import com.sun.tools.classfile.ClassFile;
+import com.sun.tools.classfile.Code_attribute;
+import com.sun.tools.classfile.ConstantPool.*;
+import com.sun.tools.classfile.Method;
+import com.sun.tools.javac.util.List;
+
+import java.io.File;
+import java.net.URI;
+import java.util.Arrays;
+import java.util.Locale;
+import javax.tools.Diagnostic;
+import javax.tools.JavaCompiler;
+import javax.tools.JavaFileObject;
+import javax.tools.SimpleJavaFileObject;
+import javax.tools.ToolProvider;
+
+public class T6199075 {
+
+    int checkCount = 0;
+    int bytecodeCheckCount = 0;
+
+    enum TypeKind {
+        BYTE("byte", "(byte)1", "[B", 0),
+        CHAR("char", "'c'", "[C", 1),
+        SHORT("short", "(short)1", "[S", 2),
+        INT("int", "1", "[I", 3),
+        LONG("long", "1L", "[J", 4),
+        FLOAT("float", "1.0F", "[F", 5),
+        DOUBLE("double", "1.0D", "[D", 6),
+        BOOLEAN("boolean", "true", "[Z", -1);
+
+        String typeString;
+        String valueString;
+        String bytecodeString;
+        private int subtypeTag;
+
+        TypeKind(String typeString, String valueString, String bytecodeString, int subtypeTag) {
+            this.typeString = typeString;
+            this.valueString = valueString;
+            this.bytecodeString = bytecodeString;
+            this.subtypeTag = subtypeTag;
+        }
+
+        boolean isSubtypeOf(TypeKind that) {
+            switch (this) {
+                case BOOLEAN:
+                    return that == BOOLEAN;
+                case BYTE:
+                case CHAR:
+                    return this.subtypeTag == that.subtypeTag ||
+                            this.subtypeTag + 2 <= that.subtypeTag;
+                default:
+                    return this.subtypeTag <= that.subtypeTag;
+            }
+        }
+    }
+
+    enum ArgumentsArity {
+        ZERO(0),
+        ONE(1),
+        TWO(2),
+        THREE(3);
+
+        int arity;
+
+        ArgumentsArity(int arity) {
+            this.arity = arity;
+        }
+
+        String asExpressionList(TypeKind type) {
+            StringBuilder buf = new StringBuilder();
+            String sep = "";
+            for (int i = 0; i < arity; i++) {
+                buf.append(sep);
+                buf.append(type.valueString);
+                sep = ",";
+            }
+            return buf.toString();
+        }
+    }
+
+    static class VarargsMethod {
+        TypeKind varargsElement;
+
+        VarargsMethod(TypeKind varargsElement) {
+            this.varargsElement = varargsElement;
+        }
+
+        @Override
+        public String toString() {
+            return "void m("+ varargsElement.typeString+ "... args) {}";
+        }
+
+        boolean isApplicable(TypeKind actual, ArgumentsArity argsArity) {
+            return argsArity == ArgumentsArity.ZERO ||
+                    actual.isSubtypeOf(varargsElement);
+        }
+
+        boolean isMoreSpecificThan(VarargsMethod that) {
+            return varargsElement.isSubtypeOf(that.varargsElement);
+        }
+    }
+
+    public static void main(String... args) throws Exception {
+        new T6199075().test();
+    }
+
+    void test() throws Exception {
+        for (TypeKind formal1 : TypeKind.values()) {
+            VarargsMethod m1 = new VarargsMethod(formal1);
+            for (TypeKind formal2 : TypeKind.values()) {
+                VarargsMethod m2 = new VarargsMethod(formal2);
+                for (TypeKind actual : TypeKind.values()) {
+                    for (ArgumentsArity argsArity : ArgumentsArity.values()) {
+                        compileAndCheck(m1, m2, actual, argsArity);
+                    }
+                }
+            }
+        }
+
+        System.out.println("Total checks made: " + checkCount);
+        System.out.println("Bytecode checks made: " + bytecodeCheckCount);
+    }
+
+    void compileAndCheck(VarargsMethod m1, VarargsMethod m2, TypeKind actual, ArgumentsArity argsArity) throws Exception {
+        final JavaCompiler tool = ToolProvider.getSystemJavaCompiler();
+        JavaSource source = new JavaSource(m1, m2, actual, argsArity);
+        ErrorChecker ec = new ErrorChecker();
+        JavacTask ct = (JavacTask)tool.getTask(null, null, ec,
+                null, null, Arrays.asList(source));
+        ct.generate();
+        check(source, ec, m1, m2, actual, argsArity);
+    }
+
+    void check(JavaSource source, ErrorChecker ec, VarargsMethod m1, VarargsMethod m2, TypeKind actual, ArgumentsArity argsArity) {
+        checkCount++;
+        boolean resolutionError = false;
+        VarargsMethod selectedMethod = null;
+
+        boolean m1_applicable = m1.isApplicable(actual, argsArity);
+        boolean m2_applicable = m2.isApplicable(actual, argsArity);
+
+        if (!m1_applicable && !m2_applicable) {
+            resolutionError = true;
+        } else if (m1_applicable && m2_applicable) {
+            //most specific
+            boolean m1_moreSpecific = m1.isMoreSpecificThan(m2);
+            boolean m2_moreSpecific = m2.isMoreSpecificThan(m1);
+            resolutionError = m1_moreSpecific == m2_moreSpecific;
+            selectedMethod = m1_moreSpecific ? m1 : m2;
+        } else {
+            selectedMethod = m1_applicable ?
+                m1 : m2;
+        }
+
+        if (ec.errorFound != resolutionError) {
+            throw new Error("invalid diagnostics for source:\n" +
+                    source.getCharContent(true) +
+                    "\nExpected resolution error: " + resolutionError +
+                    "\nFound error: " + ec.errorFound +
+                    "\nCompiler diagnostics:\n" + ec.printDiags());
+        } else if (!resolutionError) {
+            verifyBytecode(selectedMethod);
+        }
+    }
+
+    void verifyBytecode(VarargsMethod selected) {
+        bytecodeCheckCount++;
+        File compiledTest = new File("Test.class");
+        try {
+            ClassFile cf = ClassFile.read(compiledTest);
+            Method testMethod = null;
+            for (Method m : cf.methods) {
+                if (m.getName(cf.constant_pool).equals("test")) {
+                    testMethod = m;
+                    break;
+                }
+            }
+            if (testMethod == null) {
+                throw new Error("Test method not found");
+            }
+            Code_attribute ea = (Code_attribute)testMethod.attributes.get(Attribute.Code);
+            if (testMethod == null) {
+                throw new Error("Code attribute for test() method not found");
+            }
+
+            for (Instruction i : ea.getInstructions()) {
+                if (i.getMnemonic().equals("invokevirtual")) {
+                    int cp_entry = i.getUnsignedShort(1);
+                    CONSTANT_Methodref_info methRef =
+                            (CONSTANT_Methodref_info)cf.constant_pool.get(cp_entry);
+                    String type = methRef.getNameAndTypeInfo().getType();
+                    if (!type.contains(selected.varargsElement.bytecodeString)) {
+                        throw new Error("Unexpected type method call: " + type);
+                    }
+                    break;
+                }
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+            throw new Error("error reading " + compiledTest +": " + e);
+        }
+    }
+
+    static class JavaSource extends SimpleJavaFileObject {
+
+        static final String source_template = "class Test {\n" +
+                "   #V1\n" +
+                "   #V2\n" +
+                "   void test() { m(#E); }\n" +
+                "}";
+
+        String source;
+
+        public JavaSource(VarargsMethod m1, VarargsMethod m2, TypeKind actual, ArgumentsArity argsArity) {
+            super(URI.create("myfo:/Test.java"), JavaFileObject.Kind.SOURCE);
+            source = source_template.replaceAll("#V1", m1.toString()).
+                    replaceAll("#V2", m2.toString()).
+                    replaceAll("#E", argsArity.asExpressionList(actual));
+        }
+
+        @Override
+        public CharSequence getCharContent(boolean ignoreEncodingErrors) {
+            return source;
+        }
+    }
+
+    static class ErrorChecker implements javax.tools.DiagnosticListener<JavaFileObject> {
+
+        boolean errorFound;
+        List<String> errDiags = List.nil();
+
+        public void report(Diagnostic<? extends JavaFileObject> diagnostic) {
+            if (diagnostic.getKind() == Diagnostic.Kind.ERROR) {
+                errDiags = errDiags.append(diagnostic.getMessage(Locale.getDefault()));
+                errorFound = true;
+            }
+        }
+
+        String printDiags() {
+            StringBuilder buf = new StringBuilder();
+            for (String s : errDiags) {
+                buf.append(s);
+                buf.append("\n");
+            }
+            return buf.toString();
+        }
+    }
+}
--- a/langtools/test/tools/javac/varargs/6730476/T6730476a.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/test/tools/javac/varargs/6730476/T6730476a.java	Mon Dec 20 21:10:57 2010 -0800
@@ -32,6 +32,7 @@
  */
 
 class T6730476a {
+    @SuppressWarnings("unchecked")
     <T> void f(int i, T ... x) {}
     void g() {
       f(1);
--- a/langtools/test/tools/javac/varargs/6806876/T6806876.out	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/test/tools/javac/varargs/6806876/T6806876.out	Mon Dec 20 21:10:57 2010 -0800
@@ -1,6 +1,5 @@
 T6806876.java:11:32: compiler.warn.unchecked.generic.array.creation: java.lang.Number&java.lang.Comparable<? extends java.lang.Number&java.lang.Comparable<?>>[]
+T6806876.java:14:19: compiler.warn.unchecked.varargs.non.reifiable.type: T
 - compiler.err.warnings.and.werror
-- compiler.note.varargs.filename: T6806876.java
-- compiler.note.varargs.recompile
 1 error
-1 warning
+2 warnings
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/varargs/6993978/T6993978neg.java	Mon Dec 20 21:10:57 2010 -0800
@@ -0,0 +1,17 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug     6993978
+ * @author mcimadamore
+ * @summary  ClassCastException occurs in assignment expressions without any heap pollutions
+ * @compile/fail/ref=T6993978neg.out -Xlint:unchecked -Werror -XDrawDiagnostics T6993978neg.java
+ */
+
+import java.util.List;
+
+class T6993978neg {
+   @SuppressWarnings({"varargs","unchecked"})
+   static <X> void m(X... x) {  }
+   static void test(List<String> ls) {
+       m(ls); //compiler should still give unchecked here
+   }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/varargs/6993978/T6993978neg.out	Mon Dec 20 21:10:57 2010 -0800
@@ -0,0 +1,4 @@
+T6993978neg.java:15:9: compiler.warn.unchecked.generic.array.creation: java.util.List<java.lang.String>[]
+- compiler.err.warnings.and.werror
+1 error
+1 warning
--- a/langtools/test/tools/javac/varargs/warning/Warn4.java	Thu Dec 16 19:57:01 2010 -0800
+++ b/langtools/test/tools/javac/varargs/warning/Warn4.java	Mon Dec 20 21:10:57 2010 -0800
@@ -23,7 +23,7 @@
 
 /**
  * @test
- * @bug     6945418
+ * @bug     6945418 6993978
  * @summary Project Coin: Simplified Varargs Method Invocation
  * @author  mcimadamore
  * @run main Warn4
@@ -48,96 +48,95 @@
     final static Warning[] both = new Warning[] { Warning.VARARGS, Warning.UNCHECKED };
 
     enum Warning {
-        UNCHECKED("unchecked"),
-        VARARGS("varargs");
+        UNCHECKED("generic.array.creation"),
+        VARARGS("varargs.non.reifiable.type");
 
-        String category;
+        String key;
 
-        Warning(String category) {
-            this.category = category;
+        Warning(String key) {
+            this.key = key;
         }
 
-        boolean isEnabled(XlintOption xlint, SuppressLevel suppressLevel) {
-            return Arrays.asList(xlint.enabledWarnings).contains(this);
-        }
+        boolean isSuppressed(TrustMe trustMe, SourceLevel source, SuppressLevel suppressLevelClient,
+                SuppressLevel suppressLevelDecl, ModifierKind modKind) {
+            switch(this) {
+                case VARARGS:
+                    return source == SourceLevel.JDK_6 ||
+                            suppressLevelDecl == SuppressLevel.UNCHECKED ||
+                            trustMe == TrustMe.TRUST;
+                case UNCHECKED:
+                    return suppressLevelClient == SuppressLevel.UNCHECKED ||
+                        (trustMe == TrustMe.TRUST && modKind != ModifierKind.NONE && source == SourceLevel.JDK_7);
+            }
 
-        boolean isSuppressed(SuppressLevel suppressLevel) {
-            return Arrays.asList(suppressLevel.suppressedWarnings).contains(VARARGS);
+            SuppressLevel supLev = this == VARARGS ?
+                suppressLevelDecl :
+                suppressLevelClient;
+            return supLev == SuppressLevel.UNCHECKED ||
+                    (trustMe == TrustMe.TRUST && modKind != ModifierKind.NONE);
         }
     }
 
-    enum XlintOption {
-        NONE(),
-        UNCHECKED(Warning.UNCHECKED),
-        VARARGS(Warning.VARARGS),
-        ALL(Warning.UNCHECKED, Warning.VARARGS);
+    enum SourceLevel {
+        JDK_6("6"),
+        JDK_7("7");
 
-        Warning[] enabledWarnings;
+        String sourceKey;
 
-        XlintOption(Warning... enabledWarnings) {
-            this.enabledWarnings = enabledWarnings;
+        SourceLevel(String sourceKey) {
+            this.sourceKey = sourceKey;
         }
+    }
 
-        String getXlintOption() {
-            StringBuilder buf = new StringBuilder();
-            String sep = "";
-            for (Warning w : enabledWarnings) {
-                buf.append(sep);
-                buf.append(w.category);
-                sep=",";
-            }
-            return "-Xlint:" +
-                    (this == NONE ? "none" : buf.toString());
+    enum TrustMe {
+        DONT_TRUST(""),
+        TRUST("@java.lang.SafeVarargs");
+
+        String anno;
+
+        TrustMe(String anno) {
+            this.anno = anno;
+        }
+    }
+
+    enum ModifierKind {
+        NONE(" "),
+        FINAL("final "),
+        STATIC("static ");
+
+        String mod;
+
+        ModifierKind(String mod) {
+            this.mod = mod;
         }
     }
 
     enum SuppressLevel {
-        NONE(),
-        UNCHECKED(Warning.UNCHECKED),
-        VARARGS(Warning.VARARGS),
-        ALL(Warning.UNCHECKED, Warning.VARARGS);
+        NONE(""),
+        UNCHECKED("unchecked");
 
-        Warning[] suppressedWarnings;
+        String lint;
 
-        SuppressLevel(Warning... suppressedWarnings) {
-            this.suppressedWarnings = suppressedWarnings;
+        SuppressLevel(String lint) {
+            this.lint = lint;
         }
 
-        String getSuppressAnnotation() {
-            StringBuilder buf = new StringBuilder();
-            String sep = "";
-            for (Warning w : suppressedWarnings) {
-                buf.append(sep);
-                buf.append("\"");
-                buf.append(w.category);
-                buf.append("\"");
-                sep=",";
-            }
-            return this == NONE ? "" :
-                "@SuppressWarnings({" + buf.toString() + "})";
+        String getSuppressAnno() {
+            return "@SuppressWarnings(\"" + lint + "\")";
         }
     }
 
     enum Signature {
-
-        EXTENDS_TVAR("<Z> void #name(List<? extends Z>#arity arg) { #body }",
-            new Warning[][] {both, both, both, both, error, both, both, both, error}),
-        SUPER_TVAR("<Z> void #name(List<? super Z>#arity arg) { #body }",
-            new Warning[][] {error, both, error, both, error, error, both, both, error}),
         UNBOUND("void #name(List<?>#arity arg) { #body }",
-            new Warning[][] {none, none, none, none, none, none, none, none, error}),
+            new Warning[][] {none, none, none, none, error}),
         INVARIANT_TVAR("<Z> void #name(List<Z>#arity arg) { #body }",
-            new Warning[][] {both, both, both, both, error, both, both, both, error}),
+            new Warning[][] {both, both, error, both, error}),
         TVAR("<Z> void #name(Z#arity arg) { #body }",
-            new Warning[][] {both, both, both, both, both, both, both, both, vararg}),
-        EXTENDS("void #name(List<? extends String>#arity arg) { #body }",
-            new Warning[][] {error, error, error, error, error, both, error, both, error}),
-        SUPER("void #name(List<? super String>#arity arg) { #body }",
-            new Warning[][] {error, error, error, error, error, error, both, both, error}),
+            new Warning[][] {both, both, both, both, vararg}),
         INVARIANT("void #name(List<String>#arity arg) { #body }",
-            new Warning[][] {error, error, error, error, error, error, error, both, error}),
+            new Warning[][] {error, error, error, both, error}),
         UNPARAMETERIZED("void #name(String#arity arg) { #body }",
-            new Warning[][] {error, error, error, error, error, error, error, error, none});
+            new Warning[][] {error, error, error, error, none});
 
         String template;
         Warning[][] warnings;
@@ -163,15 +162,24 @@
     }
 
     public static void main(String... args) throws Exception {
-        for (XlintOption xlint : XlintOption.values()) {
-            for (SuppressLevel suppressLevel : SuppressLevel.values()) {
-                for (Signature vararg_meth : Signature.values()) {
-                    for (Signature client_meth : Signature.values()) {
-                        if (vararg_meth.isApplicableTo(client_meth)) {
-                            test(xlint,
-                                    suppressLevel,
-                                    vararg_meth,
-                                    client_meth);
+        for (SourceLevel sourceLevel : SourceLevel.values()) {
+            for (TrustMe trustMe : TrustMe.values()) {
+                for (SuppressLevel suppressLevelClient : SuppressLevel.values()) {
+                    for (SuppressLevel suppressLevelDecl : SuppressLevel.values()) {
+                        for (ModifierKind modKind : ModifierKind.values()) {
+                            for (Signature vararg_meth : Signature.values()) {
+                                for (Signature client_meth : Signature.values()) {
+                                    if (vararg_meth.isApplicableTo(client_meth)) {
+                                        test(sourceLevel,
+                                                trustMe,
+                                                suppressLevelClient,
+                                                suppressLevelDecl,
+                                                modKind,
+                                                vararg_meth,
+                                                client_meth);
+                                    }
+                                }
+                            }
                         }
                     }
                 }
@@ -179,37 +187,37 @@
         }
     }
 
-    static void test(XlintOption xlint, SuppressLevel suppressLevel,
-            Signature vararg_meth, Signature client_meth) throws Exception {
+    static void test(SourceLevel sourceLevel, TrustMe trustMe, SuppressLevel suppressLevelClient,
+            SuppressLevel suppressLevelDecl, ModifierKind modKind, Signature vararg_meth, Signature client_meth) throws Exception {
         final JavaCompiler tool = ToolProvider.getSystemJavaCompiler();
-        JavaSource source = new JavaSource(suppressLevel, vararg_meth, client_meth);
+        JavaSource source = new JavaSource(trustMe, suppressLevelClient, suppressLevelDecl, modKind, vararg_meth, client_meth);
         DiagnosticChecker dc = new DiagnosticChecker();
         JavacTask ct = (JavacTask)tool.getTask(null, null, dc,
-                Arrays.asList(xlint.getXlintOption()), null, Arrays.asList(source));
+                Arrays.asList("-Xlint:unchecked", "-source", sourceLevel.sourceKey),
+                null, Arrays.asList(source));
         ct.generate(); //to get mandatory notes
-        check(dc.warnings,
-                dc.notes,
+        check(dc.warnings, sourceLevel,
                 new boolean[] {vararg_meth.giveUnchecked(client_meth),
                                vararg_meth.giveVarargs(client_meth)},
-                source, xlint, suppressLevel);
+                source, trustMe, suppressLevelClient, suppressLevelDecl, modKind);
     }
 
-    static void check(Set<Warning> warnings, Set<Warning> notes, boolean[] warnArr, JavaSource source, XlintOption xlint, SuppressLevel suppressLevel) {
+    static void check(Set<Warning> warnings, SourceLevel sourceLevel, boolean[] warnArr, JavaSource source,
+            TrustMe trustMe, SuppressLevel suppressLevelClient, SuppressLevel suppressLevelDecl, ModifierKind modKind) {
         boolean badOutput = false;
         for (Warning wkind : Warning.values()) {
-            badOutput |= (warnArr[wkind.ordinal()] && !wkind.isSuppressed(suppressLevel)) !=
-                    (wkind.isEnabled(xlint, suppressLevel) ?
-                        warnings.contains(wkind) :
-                        notes.contains(wkind));
+            boolean isSuppressed = wkind.isSuppressed(trustMe, sourceLevel,
+                    suppressLevelClient, suppressLevelDecl, modKind);
+            System.out.println("SUPPRESSED = " + isSuppressed);
+            badOutput |= (warnArr[wkind.ordinal()] && !isSuppressed) != warnings.contains(wkind);
         }
         if (badOutput) {
             throw new Error("invalid diagnostics for source:\n" +
                     source.getCharContent(true) +
-                    "\nOptions: " + xlint.getXlintOption() +
                     "\nExpected unchecked warning: " + warnArr[0] +
                     "\nExpected unsafe vararg warning: " + warnArr[1] +
                     "\nWarnings: " + warnings +
-                    "\nNotes: " + notes);
+                    "\nSource level: " + sourceLevel);
         }
     }
 
@@ -217,18 +225,20 @@
 
         String source;
 
-        public JavaSource(SuppressLevel suppressLevel, Signature vararg_meth, Signature client_meth) {
+        public JavaSource(TrustMe trustMe, SuppressLevel suppressLevelClient, SuppressLevel suppressLevelDecl,
+                ModifierKind modKind, Signature vararg_meth, Signature client_meth) {
             super(URI.create("myfo:/Test.java"), JavaFileObject.Kind.SOURCE);
             String meth1 = vararg_meth.template.replace("#arity", "...");
             meth1 = meth1.replace("#name", "m");
             meth1 = meth1.replace("#body", "");
-            meth1 = suppressLevel.getSuppressAnnotation() + meth1;
+            meth1 = trustMe.anno + "\n" + suppressLevelDecl.getSuppressAnno() + modKind.mod + meth1;
             String meth2 = client_meth.template.replace("#arity", "");
             meth2 = meth2.replace("#name", "test");
             meth2 = meth2.replace("#body", "m(arg);");
+            meth2 = suppressLevelClient.getSuppressAnno() + meth2;
             source = "import java.util.List;\n" +
-               "class Test {\n" + meth1 +
-               "\n" + meth2 + "\n}\n";
+                     "class Test {\n" + meth1 +
+                     "\n" + meth2 + "\n}\n";
         }
 
         @Override
@@ -240,19 +250,15 @@
     static class DiagnosticChecker implements javax.tools.DiagnosticListener<JavaFileObject> {
 
         Set<Warning> warnings = new HashSet<>();
-        Set<Warning> notes = new HashSet<>();
 
         public void report(Diagnostic<? extends JavaFileObject> diagnostic) {
             if (diagnostic.getKind() == Diagnostic.Kind.MANDATORY_WARNING ||
                     diagnostic.getKind() == Diagnostic.Kind.WARNING) {
-                warnings.add(diagnostic.getCode().contains("varargs") ?
-                    Warning.VARARGS :
-                    Warning.UNCHECKED);
-            }
-            else if (diagnostic.getKind() == Diagnostic.Kind.NOTE) {
-                notes.add(diagnostic.getCode().contains("varargs") ?
-                    Warning.VARARGS :
-                    Warning.UNCHECKED);
+                if (diagnostic.getCode().contains(Warning.VARARGS.key)) {
+                    warnings.add(Warning.VARARGS);
+                } else if(diagnostic.getCode().contains(Warning.UNCHECKED.key)) {
+                    warnings.add(Warning.UNCHECKED);
+                }
             }
         }
     }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/varargs/warning/Warn5.java	Mon Dec 20 21:10:57 2010 -0800
@@ -0,0 +1,293 @@
+/*
+ * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * @test
+ * @bug     6993978
+ * @summary Project Coin: Annotation to reduce varargs warnings
+ * @author  mcimadamore
+ * @run main Warn5
+ */
+import com.sun.source.util.JavacTask;
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.Arrays;
+import javax.tools.Diagnostic;
+import javax.tools.JavaCompiler;
+import javax.tools.JavaFileObject;
+import javax.tools.SimpleJavaFileObject;
+import javax.tools.ToolProvider;
+
+public class Warn5 {
+
+    enum XlintOption {
+        NONE("none"),
+        ALL("all");
+
+        String opt;
+
+        XlintOption(String opt) {
+            this.opt = opt;
+        }
+
+        String getXlintOption() {
+            return "-Xlint:" + opt;
+        }
+    }
+
+    enum TrustMe {
+        DONT_TRUST(""),
+        TRUST("@java.lang.SafeVarargs");
+
+        String anno;
+
+        TrustMe(String anno) {
+            this.anno = anno;
+        }
+    }
+
+    enum SuppressLevel {
+        NONE,
+        VARARGS;
+
+        String getSuppressAnno() {
+            return this == VARARGS ?
+                "@SuppressWarnings(\"varargs\")" :
+                "";
+        }
+    }
+
+    enum ModifierKind {
+        NONE(""),
+        FINAL("final"),
+        STATIC("static");
+
+        String mod;
+
+        ModifierKind(String mod) {
+            this.mod = mod;
+        }
+    }
+
+    enum MethodKind {
+        METHOD("void m"),
+        CONSTRUCTOR("Test");
+
+
+        String name;
+
+        MethodKind(String name) {
+            this.name = name;
+        }
+    }
+
+    enum SourceLevel {
+        JDK_6("6"),
+        JDK_7("7");
+
+        String sourceKey;
+
+        SourceLevel(String sourceKey) {
+            this.sourceKey = sourceKey;
+        }
+    }
+
+    enum SignatureKind {
+        VARARGS_X("#K <X>#N(X... x)", false, true),
+        VARARGS_STRING("#K #N(String... x)", true, true),
+        ARRAY_X("#K <X>#N(X[] x)", false, false),
+        ARRAY_STRING("#K #N(String[] x)", true, false);
+
+        String stub;
+        boolean isReifiableArg;
+        boolean isVarargs;
+
+        SignatureKind(String stub, boolean isReifiableArg, boolean isVarargs) {
+            this.stub = stub;
+            this.isReifiableArg = isReifiableArg;
+            this.isVarargs = isVarargs;
+        }
+
+        String getSignature(ModifierKind modKind, MethodKind methKind) {
+            return methKind != MethodKind.CONSTRUCTOR ?
+                stub.replace("#K", modKind.mod).replace("#N", methKind.name) :
+                stub.replace("#K", "").replace("#N", methKind.name);
+        }
+    }
+
+    enum BodyKind {
+        ASSIGN("Object o = x;", true),
+        CAST("Object o = (Object)x;", true),
+        METH("test(x);", true),
+        PRINT("System.out.println(x.toString());", false),
+        ARRAY_ASSIGN("Object[] o = x;", true),
+        ARRAY_CAST("Object[] o = (Object[])x;", true),
+        ARRAY_METH("testArr(x);", true);
+
+        String body;
+        boolean hasAliasing;
+
+        BodyKind(String body, boolean hasAliasing) {
+            this.body = body;
+            this.hasAliasing = hasAliasing;
+        }
+    }
+
+    static class JavaSource extends SimpleJavaFileObject {
+
+        String template = "import com.sun.tools.javac.api.*;\n" +
+                          "import java.util.List;\n" +
+                          "class Test {\n" +
+                          "   static void test(Object o) {}\n" +
+                          "   static void testArr(Object[] o) {}\n" +
+                          "   #T \n #S #M { #B }\n" +
+                          "}\n";
+
+        String source;
+
+        public JavaSource(TrustMe trustMe, SuppressLevel suppressLevel, ModifierKind modKind,
+                MethodKind methKind, SignatureKind meth, BodyKind body) {
+            super(URI.create("myfo:/Test.java"), JavaFileObject.Kind.SOURCE);
+            source = template.replace("#T", trustMe.anno).
+                    replace("#S", suppressLevel.getSuppressAnno()).
+                    replace("#M", meth.getSignature(modKind, methKind)).
+                    replace("#B", body.body);
+        }
+
+        @Override
+        public CharSequence getCharContent(boolean ignoreEncodingErrors) {
+            return source;
+        }
+    }
+
+    public static void main(String... args) throws Exception {
+        for (SourceLevel sourceLevel : SourceLevel.values()) {
+            for (XlintOption xlint : XlintOption.values()) {
+                for (TrustMe trustMe : TrustMe.values()) {
+                    for (SuppressLevel suppressLevel : SuppressLevel.values()) {
+                        for (ModifierKind modKind : ModifierKind.values()) {
+                            for (MethodKind methKind : MethodKind.values()) {
+                                for (SignatureKind sig : SignatureKind.values()) {
+                                    for (BodyKind body : BodyKind.values()) {
+                                        test(sourceLevel,
+                                                xlint,
+                                                trustMe,
+                                                suppressLevel,
+                                                modKind,
+                                                methKind,
+                                                sig,
+                                                body);
+                                    }
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+        }
+    }
+
+    static void test(SourceLevel sourceLevel, XlintOption xlint, TrustMe trustMe, SuppressLevel suppressLevel,
+            ModifierKind modKind, MethodKind methKind, SignatureKind sig, BodyKind body) throws Exception {
+        final JavaCompiler tool = ToolProvider.getSystemJavaCompiler();
+        JavaSource source = new JavaSource(trustMe, suppressLevel, modKind, methKind, sig, body);
+        DiagnosticChecker dc = new DiagnosticChecker();
+        JavacTask ct = (JavacTask)tool.getTask(null, null, dc,
+                Arrays.asList(xlint.getXlintOption(), "-source", sourceLevel.sourceKey), null, Arrays.asList(source));
+        ct.analyze();
+        check(sourceLevel, dc, source, xlint, trustMe,
+                suppressLevel, modKind, methKind, sig, body);
+    }
+
+    static void check(SourceLevel sourceLevel, DiagnosticChecker dc, JavaSource source,
+            XlintOption xlint, TrustMe trustMe, SuppressLevel suppressLevel, ModifierKind modKind,
+            MethodKind methKind, SignatureKind meth, BodyKind body) {
+
+        boolean hasPotentiallyUnsafeBody = sourceLevel == SourceLevel.JDK_7 &&
+                trustMe == TrustMe.TRUST &&
+                suppressLevel != SuppressLevel.VARARGS &&
+                xlint != XlintOption.NONE &&
+                meth.isVarargs && !meth.isReifiableArg && body.hasAliasing &&
+                (methKind == MethodKind.CONSTRUCTOR || (methKind == MethodKind.METHOD && modKind != ModifierKind.NONE));
+
+        boolean hasPotentiallyPollutingDecl = sourceLevel == SourceLevel.JDK_7 &&
+                trustMe == TrustMe.DONT_TRUST &&
+                meth.isVarargs &&
+                !meth.isReifiableArg &&
+                xlint == XlintOption.ALL;
+
+        boolean hasMalformedAnnoInDecl = sourceLevel == SourceLevel.JDK_7 &&
+                trustMe == TrustMe.TRUST &&
+                (!meth.isVarargs ||
+                (modKind == ModifierKind.NONE && methKind == MethodKind.METHOD));
+
+        boolean hasRedundantAnnoInDecl = sourceLevel == SourceLevel.JDK_7 &&
+                trustMe == TrustMe.TRUST &&
+                xlint != XlintOption.NONE &&
+                suppressLevel != SuppressLevel.VARARGS &&
+                (modKind != ModifierKind.NONE || methKind == MethodKind.CONSTRUCTOR) &&
+                meth.isVarargs &&
+                meth.isReifiableArg;
+
+        if (hasPotentiallyUnsafeBody != dc.hasPotentiallyUnsafeBody ||
+                hasPotentiallyPollutingDecl != dc.hasPotentiallyPollutingDecl ||
+                hasMalformedAnnoInDecl != dc.hasMalformedAnnoInDecl ||
+                hasRedundantAnnoInDecl != dc.hasRedundantAnnoInDecl) {
+            throw new Error("invalid diagnostics for source:\n" +
+                    source.getCharContent(true) +
+                    "\nOptions: " + xlint.getXlintOption() +
+                    "\nExpected potentially unsafe body warning: " + hasPotentiallyUnsafeBody +
+                    "\nExpected potentially polluting decl warning: " + hasPotentiallyPollutingDecl +
+                    "\nExpected malformed anno error: " + hasMalformedAnnoInDecl +
+                    "\nExpected redundant anno warning: " + hasRedundantAnnoInDecl +
+                    "\nFound potentially unsafe body warning: " + dc.hasPotentiallyUnsafeBody +
+                    "\nFound potentially polluting decl warning: " + dc.hasPotentiallyPollutingDecl +
+                    "\nFound malformed anno error: " + dc.hasMalformedAnnoInDecl +
+                    "\nFound redundant anno warning: " + dc.hasRedundantAnnoInDecl);
+        }
+    }
+
+    static class DiagnosticChecker implements javax.tools.DiagnosticListener<JavaFileObject> {
+
+        boolean hasPotentiallyUnsafeBody = false;
+        boolean hasPotentiallyPollutingDecl = false;
+        boolean hasMalformedAnnoInDecl = false;
+        boolean hasRedundantAnnoInDecl = false;
+
+        public void report(Diagnostic<? extends JavaFileObject> diagnostic) {
+            if (diagnostic.getKind() == Diagnostic.Kind.WARNING) {
+                    if (diagnostic.getCode().contains("unsafe.use.varargs.param")) {
+                        hasPotentiallyUnsafeBody = true;
+                    } else if (diagnostic.getCode().contains("redundant.trustme")) {
+                        hasRedundantAnnoInDecl = true;
+                    }
+            } else if (diagnostic.getKind() == Diagnostic.Kind.MANDATORY_WARNING &&
+                    diagnostic.getCode().contains("varargs.non.reifiable.type")) {
+                hasPotentiallyPollutingDecl = true;
+            } else if (diagnostic.getKind() == Diagnostic.Kind.ERROR &&
+                    diagnostic.getCode().contains("invalid.trustme")) {
+                hasMalformedAnnoInDecl = true;
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javap/T7004698.java	Mon Dec 20 21:10:57 2010 -0800
@@ -0,0 +1,98 @@
+/*
+ * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 7004698
+ * @summary javap does not output CharacterRangeTable attributes correctly
+ */
+
+import java.io.*;
+import java.util.*;
+import java.util.regex.*;
+
+public class T7004698 {
+    public static void main(String... args) throws Exception {
+        new T7004698().run();
+    }
+
+    void run() throws Exception {
+        File srcDir = new File(System.getProperty("test.src"));
+        File srcFile = new File(srcDir, T7004698.class.getSimpleName() + ".java");
+        File classesDir = new File(".");
+        compile("-Xjcov", "-d", classesDir.getPath(), srcFile.getPath());
+
+        File classFile = new File(classesDir, T7004698.class.getSimpleName() + ".class");
+        String out = javap("-v", classFile.getPath());
+
+        Pattern attrBody = Pattern.compile("[0-9a-f, ]+//[-0-9a-z:, ]+");
+        Pattern endOfAttr = Pattern.compile("(^$|[A-Z][A-Za-z0-9_]+:.*|})");
+        boolean inAttr = false;
+        int count = 0;
+        int errors = 0;
+        for (String line: out.split(System.getProperty("line.separator"))) {
+            line = line.trim();
+            if (line.equals("CharacterRangeTable:")) {
+                inAttr = true;
+                count++;
+            } else if (inAttr) {
+                if (endOfAttr.matcher(line).matches()) {
+                    inAttr = false;
+                } else if (!attrBody.matcher(line).matches()) {
+                    System.err.println("unexpected line found: " + line);
+                    errors++;
+                }
+            }
+        }
+        if (count == 0)
+            throw new Exception("no attribute instances found");
+
+        if (errors > 0)
+            throw new Exception(errors + " errors found");
+    }
+
+    void compile(String... args) throws Exception {
+        StringWriter sw = new StringWriter();
+        PrintWriter pw = new PrintWriter(sw);
+        int rc = com.sun.tools.javac.Main.compile(args, pw);
+        pw.close();
+        String out = sw.toString();
+        if (!out.isEmpty())
+            System.err.println(out);
+        if (rc != 0)
+            throw new Exception("javac failed unexpectedly; rc=" + rc);
+    }
+
+    String javap(String... args) throws Exception {
+        StringWriter sw = new StringWriter();
+        PrintWriter pw = new PrintWriter(sw);
+        int rc = com.sun.tools.javap.Main.run(args, pw);
+        pw.close();
+        String out = sw.toString();
+        if (!out.isEmpty())
+            System.err.println(out);
+        if (rc != 0)
+            throw new Exception("javap failed unexpectedly; rc=" + rc);
+        return out;
+    }
+}