changeset 400:7780be72c042

. Merge from main OpenJDK repository.
author glewis@misty.eyesbeyond.com
date Mon, 07 Sep 2009 22:42:05 -0700
parents 41a366b862a2 d434aa041b52
children be4c695c22cf
files src/share/classes/com/sun/mirror/apt/package.html src/share/classes/com/sun/mirror/declaration/package.html src/share/classes/com/sun/mirror/type/package.html src/share/classes/com/sun/mirror/util/package.html
diffstat 245 files changed, 4354 insertions(+), 876 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags	Sat Jul 25 20:57:05 2009 -0700
+++ b/.hgtags	Mon Sep 07 22:42:05 2009 -0700
@@ -41,3 +41,8 @@
 d8f23a81d46f47a4186f1044dd9e44841bbeab84 jdk7-b64
 7e0056ded28c802609d2bd79bfcda551d72a3fec jdk7-b65
 634f519d6f9a602b16bba1c7cd4a17242a8f6889 jdk7-b66
+14b1a8ede95493fc53c37ff2626f1f98ce94d108 jdk7-b67
+95c1212b07e33b1b8c689b1d279d82ffd5a56e43 jdk7-b68
+ce9bcdcb7859bb7ef10afd078ad59ba7847f208d jdk7-b69
+97d06f3e87873e310aa2f3fbca58fc8872d86b9f jdk7-b70
+33c8c38e1757006c17d80499fb3347102501fae5 jdk7-b71
--- a/THIRD_PARTY_README	Sat Jul 25 20:57:05 2009 -0700
+++ b/THIRD_PARTY_README	Mon Sep 07 22:42:05 2009 -0700
@@ -32,7 +32,7 @@
 
 --- end of LICENSE file ---
 %% This notice is provided with respect to ASM, which may be included with this software: 
-Copyright (c) 2000-2005 INRIA, France Telecom
+Copyright (c) 2000-2007 INRIA, France Telecom
 All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
--- a/make/build.properties	Sat Jul 25 20:57:05 2009 -0700
+++ b/make/build.properties	Mon Sep 07 22:42:05 2009 -0700
@@ -26,10 +26,10 @@
 # This is the JDK used to build and run the bootstrap version of javac.
 # The bootstrap javac is used to compile both boostrap versions of the
 # other tools, and product versions of all the tools.
-# Override this path as needed, either on the command line or in 
+# Override this path as needed, either on the command line or in
 # one of the standard user build.properties files (see build.xml)
 
-# boot.java.home = /opt/jdk/1.5.0 
+# boot.java.home = /opt/jdk/1.6.0
 boot.java = ${boot.java.home}/bin/java
 boot.javac = ${boot.java.home}/bin/javac
 boot.javac.source = 6
@@ -37,10 +37,10 @@
 
 # This is the JDK used to run the product version of the tools,
 # for example, for testing. If you're building a complete JDK, specify that.
-# Override this path as needed, either on the command line or in 
+# Override this path as needed, either on the command line or in
 # one of the standard user build.properties files (see build.xml)
 
-# target.java.home = /opt/jdk/1.6.0
+# target.java.home = /opt/jdk/1.7.0
 target.java = ${target.java.home}/bin/java
 
 # Version info -- override as needed
@@ -60,29 +60,29 @@
 bootstrap.full.version = ${bootstrap.release}-${build.number}
 
 # options for the <javac> tasks used to compile the tools
-javac.source = 5
-javac.target = 5
+javac.source = 7
+javac.target = 7
 javac.debug = true
 javac.debuglevel = source,lines
 javac.no.jdk.warnings = -XDignore.symbol.file=true
 # set the following to -version to verify the versions of javac being used
-javac.version.opt = 
+javac.version.opt =
 # in time, there should be no exceptions to -Xlint:all
-javac.lint.opts = -Xlint:all -Werror
+javac.lint.opts = -Xlint:all,-deprecation -Werror
 
 # options for the <javadoc> task for javac
 javadoc.jls3.url=http://java.sun.com/docs/books/jls/
-javadoc.jls3.cite=&lt;a href=&quot;${javadoc.jls3.url}&quot;&gt;The Java Language Specification, Third Edition&lt;/a&gt;    
+javadoc.jls3.cite=&lt;a href=&quot;${javadoc.jls3.url}&quot;&gt;The Java Language Specification, Third Edition&lt;/a&gt;
 javadoc.jls3.option=-tag "jls3:a:See &lt;cite&gt;${javadoc.jls3.cite}&lt;/cite&gt;:"
 
 # jtreg, used to run the JDK regression tests
-# Override this path as needed, either on the command line or in 
+# Override this path as needed, either on the command line or in
 # one of the standard user build.properties files (see build.xml)
 
 # jtreg.home = /opt/jtreg/3.2.2_02
 
 # findbugs
-# Override this path as needed, either on the command line or in 
+# Override this path as needed, either on the command line or in
 # one of the standard user build.properties files (see build.xml)
 
 # findbugs.home = /opt/findbugs/1.2.1
@@ -94,46 +94,61 @@
 # parameter of Ant filesets. In particular, note the trailing '/'.
 
 javac.includes = \
-	javax/annotation/processing/ \
-	javax/lang/model/ \
-	javax/tools/ \
-	com/sun/source/ com/sun/tools/javac/
+        javax/annotation/processing/ \
+        javax/lang/model/ \
+        javax/tools/ \
+        com/sun/source/ com/sun/tools/javac/
 
 javac.tests = \
-	tools/javac
-    
+        tools/javac
+
+#
+
 javadoc.includes = \
-	com/sun/javadoc/ \
-	com/sun/tools/javadoc/
+        com/sun/javadoc/ \
+        com/sun/tools/javadoc/
 
 javadoc.tests = \
-	tools/javadoc/ 
-    
+        tools/javadoc/
+
+#
+
 doclets.includes = \
-	com/sun/tools/doclets/
+        com/sun/tools/doclets/
 
 doclets.tests = \
-	com/sun/javadoc/
+        com/sun/javadoc/
+
+#
 
 javah.includes = \
-	com/sun/tools/javah/
+        com/sun/tools/javah/
 
 javah.tests = \
-	tools/javah/
+        tools/javah/
+
+#
 
 javap.includes = \
-	com/sun/tools/classfile/ \
-	com/sun/tools/javap/ \
-	sun/tools/javap/
+        com/sun/tools/classfile/ \
+        com/sun/tools/javap/ \
+        sun/tools/javap/
 
 javap.tests = \
-	tools/javap/
+        tools/javap/
+
+#
 
 apt.includes = \
-	com/sun/mirror/ \
-	com/sun/tools/apt/
+        com/sun/mirror/ \
+        com/sun/tools/apt/
 
 apt.tests = \
-	tools/apt/
-    
+        tools/apt/
 
+#
+
+# The following value is used by the main jtreg target.
+# An empty value means all tests
+# Override as desired to run a specific set of tests
+jtreg.tests =
--- a/make/build.xml	Sat Jul 25 20:57:05 2009 -0700
+++ b/make/build.xml	Mon Sep 07 22:42:05 2009 -0700
@@ -31,7 +31,7 @@
  -->
 
 <project name="langtools" default="build" basedir="..">
-    
+
     <!-- Force full debuginfo for javac if the debug.classfiles
     property is set.  This must be BEFORE the include of
     build.properties because it sets javac.debuglevel.  -->
@@ -49,8 +49,8 @@
 
     <!-- Use this location for customizations common to all OpenJDK workspaces -->
     <property file="${user.home}/.openjdk/build.properties"/>
-    
-    <!-- Convenient shorthands for standard locations within the workspace. -->    
+
+    <!-- Convenient shorthands for standard locations within the workspace. -->
     <property name="build.dir" location="build"/>
     <property name="build.bootstrap.dir" location="${build.dir}/bootstrap"/>
     <property name="build.coverage.dir" location="${build.dir}/coverage"/>
@@ -75,15 +75,25 @@
          The best file to check for across Solaris/Linux/Windows/MacOS is one of the
          executables; regrettably, that is OS-specific. -->
     <condition property="java.marker" value="bin/java">
-	<os family="unix"/>
+        <os family="unix"/>
     </condition>
     <condition property="java.marker" value="bin/java.exe">
-	<os family="windows"/>
+        <os family="windows"/>
     </condition>
-    
+
     <!-- Standard property values, if not overriden by earlier settings. -->
-    <property file="${make.dir}/build.properties"/> 
-    
+    <property file="${make.dir}/build.properties"/>
+
+    <!-- launcher.java is used in the launcher scripts provided to run
+        the tools' jar files.  If it has not already been set, then
+        default it to use ${target.java.home}, if available, otherwise
+        quietly default to simply use "java". -->
+    <condition property="launcher.java"
+        value="${target.java.home}/bin/java" else="java">
+        <isset property="target.java.home"/>
+    </condition>
+
+
     <!-- Standard target to build deliverables for JDK build. -->
 
     <target name="build" depends="build-bootstrap-tools,build-all-classes">
@@ -97,13 +107,13 @@
         <jar file="${dist.lib.dir}/classes.jar" basedir="${build.classes.dir}"/>
         <zip file="${dist.lib.dir}/src.zip" basedir="${src.classes.dir}"/>
     </target>
-    
+
     <target name="build-bootstrap-tools" depends="build-bootstrap-javac,build-bootstrap-javadoc,build-bootstrap-doclets,build-bootstrap-javah"/>
-    
+
     <target name="build-all-tools" depends="build-javac,build-javadoc,build-doclets,build-javah,build-javap,build-apt"/>
-    
+
     <target name="build-all-classes" depends="build-classes-javac,build-classes-javadoc,build-classes-doclets,build-classes-javah,build-classes-javap,build-classes-apt"/>
-  
+
     <!-- clean -->
 
     <target name="clean" description="Delete all generated files">
@@ -112,13 +122,11 @@
     </target>
 
     <!-- Additional targets for running tools on the build -->
-    
-    <!-- An alternative for the following would be to do a single jtreg run for all tests.
-         However, that would currently be slower, since we would have to run all the tests
-         with samevm="false", since not all test directories currently support samevm="true". -->
 
-    <target name="jtreg" depends="jtreg-javac,jtreg-javadoc,jtreg-doclets,jtreg-javah,jtreg-javap,jtreg-apt"/>
-    
+    <target name="jtreg" depends="build-all-tools,-def-jtreg">
+        <jtreg-tool name="all" tests="${jtreg.tests}"/>
+    </target>
+
     <target name="findbugs" depends="-def-findbugs,build-all-tools">
         <property name="findbugs.reportLevel" value="medium"/>
         <mkdir dir="${dist.findbugs.dir}"/>
@@ -160,52 +168,52 @@
         <delete file="${build.coverage.dir}/cobertura.ser"/>
         <cobertura-instrument todir="${build.coverage.dir}/classes"
             datafile="${build.coverage.dir}/cobertura.ser">
-            <fileset dir="${build.classes.dir}" 
+            <fileset dir="${build.classes.dir}"
                includes="**/*.class" excludes="**/resources/*.class"/>
         </cobertura-instrument>
-    </target>  
+    </target>
 
     <target name="coverage-report" depends="-def-cobertura">
         <mkdir dir="${dist.coverage.dir}"/>
-        <cobertura-report 
+        <cobertura-report
             srcdir="${src.classes.dir}"
             destdir="${dist.coverage.dir}"
             datafile="${build.coverage.dir}/cobertura.ser"/>
-        <cobertura-report 
-            format="xml" 
-            srcdir="${src.classes.dir}" 
+        <cobertura-report
+            format="xml"
+            srcdir="${src.classes.dir}"
             destdir="${dist.coverage.dir}"
             datafile="${build.coverage.dir}/cobertura.ser"/>
     </target>
-    
+
     <!-- javac targets -->
 
     <target name="build-bootstrap-javac" depends="-def-build-bootstrap-tool">
         <build-bootstrap-tool name="javac" includes="${javac.includes}"/>
     </target>
-    
+
     <target name="build-classes-javac" depends="build-bootstrap-javac">
         <build-classes name="javac" includes="${javac.includes}"/>
     </target>
-    
+
     <target name="build-javac" depends="build-bootstrap-javac">
         <build-tool name="javac" includes="${javac.includes}"/>
     </target>
-    
+
     <target name="javadoc-javac" depends="build-javac,-def-javadoc-tool">
         <javadoc-tool name="javac" includes="${javac.includes}" options="${javadoc.jls3.option}"/>
     </target>
-    
+
     <target name="jtreg-javac" depends="build-javac,-def-jtreg">
-        <jtreg-tool name="javac" samevm="true" tests="${javac.tests}"/>
+        <jtreg-tool name="javac" tests="${javac.tests}"/>
     </target>
-    
+
     <target name="findbugs-javac" depends="build-javac,-def-findbugs">
         <findbugs-tool name="javac"/>
     </target>
-    
+
     <target name="javac" depends="build-javac,jtreg-javac,findbugs-javac"/>
-    
+
     <!-- javadoc targets -->
 
     <target name="build-bootstrap-javadoc" depends="build-bootstrap-javac">
@@ -213,31 +221,31 @@
                               includes="${javadoc.includes}"
                               jarclasspath="javac.jar doclets.jar"/>
     </target>
-    
+
     <target name="build-classes-javadoc" depends="build-classes-javac">
         <build-classes name="javadoc" includes="${javadoc.includes}"/>
     </target>
-    
+
     <target name="build-javadoc" depends="build-javac">
         <build-tool name="javadoc"
                     includes="${javadoc.includes}"
                     jarclasspath="javac.jar doclets.jar"/>
     </target>
-    
+
     <target name="javadoc-javadoc" depends="build-javadoc,-def-javadoc-tool">
         <javadoc-tool name="javadoc" includes="${javadoc.includes}"/>
     </target>
-    
+
     <target name="jtreg-javadoc" depends="build-javadoc,-def-jtreg">
-        <jtreg-tool name="javadoc" samevm="false" tests="${javadoc.tests}"/>
+        <jtreg-tool name="javadoc" tests="${javadoc.tests}"/>
     </target>
-    
+
     <target name="findbugs-javadoc" depends="build-javadoc,-def-findbugs">
         <findbugs-tool name="javadoc"/>
     </target>
-    
+
     <target name="javadoc" depends="build-javadoc,jtreg-javadoc,findbugs-javadoc"/>
-    
+
     <!-- doclets targets -->
 
     <target name="build-bootstrap-doclets" depends="build-bootstrap-javadoc,-def-build-bootstrap-jar">
@@ -246,11 +254,11 @@
                               jarmainclass="com.sun.tools.javadoc.Main"
                               jarclasspath="javadoc.jar"/>
     </target>
-    
+
     <target name="build-classes-doclets" depends="build-classes-javadoc">
         <build-classes name="doclets" includes="${doclets.includes}"/>
     </target>
-    
+
     <target name="build-doclets" depends="build-javadoc">
         <!-- just jar, no bin for doclets -->
         <build-jar name="doclets"
@@ -259,17 +267,17 @@
     </target>
 
     <!-- (no javadoc for doclets) -->
-    
+
     <target name="jtreg-doclets" depends="build-doclets,-def-jtreg">
-        <jtreg-tool name="doclets" samevm="false" tests="${doclets.tests}"/>
+        <jtreg-tool name="doclets" tests="${doclets.tests}"/>
     </target>
-    
+
     <target name="findbugs-doclets" depends="build-doclets,-def-findbugs">
         <findbugs-tool name="doclets"/>
     </target>
-    
+
     <target name="doclets" depends="build-doclets,jtreg-doclets,findbugs-doclets"/>
-    
+
     <!-- javah targets -->
 
     <target name="build-bootstrap-javah" depends="build-bootstrap-javadoc">
@@ -277,29 +285,29 @@
                               includes="${javah.includes}"
                               jarclasspath="javadoc.jar doclets.jar javac.jar"/>
     </target>
-    
+
     <target name="build-javah" depends="build-javadoc">
         <build-tool name="javah"
                     includes="${javah.includes}"
                     jarclasspath="javadoc.jar doclets.jar javac.jar"/>
     </target>
-    
+
     <target name="build-classes-javah" depends="build-classes-javadoc">
         <build-classes name="javah" includes="${javah.includes}"/>
     </target>
-    
+
     <!-- (no javadoc for javah) -->
 
     <target name="jtreg-javah" depends="build-javah,-def-jtreg">
-        <jtreg-tool name="javah" samevm="true" tests="${javah.tests}"/>
+        <jtreg-tool name="javah" tests="${javah.tests}"/>
     </target>
-    
+
     <target name="findbugs-javah" depends="build-javah,-def-findbugs">
         <findbugs-tool name="javah"/>
     </target>
-    
+
     <target name="javah" depends="build-javah,jtreg-javah,findbugs-javah"/>
-    
+
     <!-- javap targets -->
 
     <target name="build-bootstrap-javap" depends="-def-build-bootstrap-tool">
@@ -307,85 +315,85 @@
                               includes="${javap.includes}"
                               jarmainclass="sun.tools.javap.Main"/>
     </target>
-    
+
     <target name="build-classes-javap" depends="build-classes-javac">
         <build-classes name="javap" includes="${javap.includes}"/>
     </target>
-    
+
     <target name="build-javap" depends="build-javac">
         <build-tool name="javap"
                     includes="${javap.includes}"
                     jarmainclass="com.sun.tools.javap.Main"
                     jarclasspath="javac.jar"/>
     </target>
-    
+
     <!-- (no javadoc for javap) -->
 
     <target name="jtreg-javap" depends="build-javap,-def-jtreg">
-        <jtreg-tool name="javap" samevm="true" tests="${javap.tests}"/>
+        <jtreg-tool name="javap" tests="${javap.tests}"/>
     </target>
-    
+
     <target name="findbugs-javap" depends="build-javap,-def-findbugs">
         <findbugs-tool name="javap"/>
     </target>
-    
+
     <target name="javap" depends="build-javap,jtreg-javap,findbugs-javap"/>
-    
+
     <!-- apt targets -->
-    
+
     <target name="build-bootstrap-apt" depends="build-bootstrap-javac">
         <build-bootstrap-tool name="apt"
                               includes="${apt.includes}"
                               jarclasspath="javac.jar"/>
     </target>
-    
+
     <target name="build-apt" depends="build-javac">
         <build-tool name="apt"
                     includes="${apt.includes}"
                     jarclasspath="javac.jar"/>
     </target>
-    
+
     <target name="build-classes-apt" depends="build-classes-javac">
         <build-classes name="apt" includes="${apt.includes}"/>
     </target>
-    
+
     <target name="javadoc-apt" depends="build-apt,-def-javadoc-tool">
         <javadoc-tool name="apt" includes="${apt.includes}"/>
     </target>
-    
-    
+
+
     <target name="jtreg-apt" depends="build-apt,-def-jtreg">
-        <jtreg-tool name="apt" samevm="true" tests="${apt.tests}"/>
+        <jtreg-tool name="apt" tests="${apt.tests}"/>
     </target>
-    
+
     <target name="findbugs-apt" depends="build-apt,-def-findbugs">
         <findbugs-tool name="apt"/>
     </target>
-    
+
     <target name="apt" depends="build-apt,jtreg-apt,findbugs-apt"/>
 
     <!-- Check targets -->
-    
+
     <target name="-check-boot.java.home" depends="-def-check">
         <check name="bootstrap java" property="boot.java.home" marker="${java.marker}"/>
     </target>
-    
+
     <target name="-check-target.java.home" depends="-def-check">
         <check name="target java" property="target.java.home" marker="${java.marker}"/>
     </target>
-    
+
     <target name="-check-cobertura.home" depends="-def-check">
         <check name="cobertura" property="cobertura.home" marker="cobertura.jar"/>
     </target>
-    
+
     <target name="-check-findbugs.home" depends="-def-check">
         <check name="findbugs" property="findbugs.home" marker="lib/findbugs.jar"/>
     </target>
-    
+
     <target name="-check-jtreg.home" depends="-def-check">
         <check name="jtreg" property="jtreg.home" marker="lib/jtreg.jar"/>
     </target>
-    
+
     <!-- Ant macro and preset defs -->
 
     <target name="-def-build-tool" depends="-def-build-jar">
@@ -397,8 +405,8 @@
             <attribute name="classes.dir" default="${build.classes.dir}"/>
             <attribute name="gensrc.dir" default="${build.gensrc.dir}"/>
             <attribute name="lib.dir" default="${dist.lib.dir}"/>
-            <attribute name="java" default="java"/>
-            <attribute name="javac.bootclasspath" default="-J-Xbootclasspath/p:${build.bootstrap.dir}/classes"/>
+            <attribute name="java" default="${launcher.java}"/>
+            <attribute name="javac.bootclasspath" default="${build.bootstrap.dir}/classes"/>
             <attribute name="javac.java.home" default="${boot.java.home}"/>
             <attribute name="javac.source" default="${javac.source}"/>
             <attribute name="javac.target" default="${javac.target}"/>
@@ -425,8 +433,8 @@
                 <mkdir dir="@{bin.dir}"/>
                 <copy file="${src.bin.dir}/launcher.sh-template" tofile="@{bin.dir}/@{name}">
                     <filterset begintoken="#" endtoken="#">
-                        <filter token="PROGRAM" value="@{name}"/> 
-                        <filter token="TARGET_JAVA" value="@{java}"/> 
+                        <filter token="PROGRAM" value="@{name}"/>
+                        <filter token="TARGET_JAVA" value="@{java}"/>
                     </filterset>
                 </copy>
                 <chmod file="@{bin.dir}/@{name}" perm="ugo+rx"/>
@@ -442,7 +450,7 @@
             <attribute name="classes.dir" default="${build.classes.dir}"/>
             <attribute name="gensrc.dir" default="${build.gensrc.dir}"/>
             <attribute name="lib.dir" default="${dist.lib.dir}"/>
-            <attribute name="javac.bootclasspath" default="-J-Xbootclasspath/p:${build.bootstrap.dir}/classes"/>
+            <attribute name="javac.bootclasspath" default="${build.bootstrap.dir}/classes"/>
             <attribute name="javac.java.home" default="${boot.java.home}"/>
             <attribute name="javac.source" default="${javac.source}"/>
             <attribute name="javac.target" default="${javac.target}"/>
@@ -467,7 +475,7 @@
                 <jar destfile="@{lib.dir}/@{name}.jar"
                      basedir="@{classes.dir}"
                      includes="@{includes}">
-                    <manifest>    
+                    <manifest>
                         <attribute name="Main-Class" value="@{jarmainclass}"/>
                         <attribute name="Class-Path" value="@{jarclasspath}"/>
                     </manifest>
@@ -530,7 +538,7 @@
                        includeAntRuntime="no"
                        source="@{javac.source}"
                        target="@{javac.target}"
-                       debug="${javac.debug}" 
+                       debug="${javac.debug}"
                        debuglevel="${javac.debuglevel}">
                     <compilerarg value="-J-Xbootclasspath/p:@{javac.bootclasspath}"/>
                     <compilerarg value="-Xbootclasspath/p:@{classes.dir}"/>
@@ -539,7 +547,7 @@
                     <compilerarg line="${javac.lint.opts}"/>
                 </javac>
                 <copy todir="@{classes.dir}">
-                    <fileset dir="${src.classes.dir}"> 
+                    <fileset dir="${src.classes.dir}">
                         <include name="@{includes}"/>
                         <exclude name="**/*.java"/>
                         <exclude name="**/*.properties"/>
@@ -550,7 +558,7 @@
             </sequential>
         </macrodef>
     </target>
-    
+
     <target name="-def-build-bootstrap-tool" depends="-check-boot.java.home,-def-build-tool">
         <presetdef name="build-bootstrap-tool">
             <build-tool
@@ -566,7 +574,7 @@
                 full.version="${bootstrap.full.version}"/>
         </presetdef>
     </target>
-    
+
     <target name="-def-build-bootstrap-jar" depends="-def-build-jar">
         <presetdef name="build-bootstrap-jar">
             <build-jar
@@ -580,19 +588,21 @@
                 full.version="${bootstrap.full.version}"/>
         </presetdef>
     </target>
-    
+
     <target name="-def-pcompile">
         <mkdir dir="${build.toolclasses.dir}"/>
         <javac fork="true"
+               source="${boot.javac.source}"
+               target="${boot.javac.target}"
                executable="${boot.java.home}/bin/javac"
                srcdir="${make.tools.dir}/CompileProperties"
                destdir="${build.toolclasses.dir}/"
                classpath="${ant.home}/lib/ant.jar"/>
         <taskdef name="pcompile"
-                 classname="CompilePropertiesTask" 
+                 classname="CompilePropertiesTask"
                  classpath="${build.toolclasses.dir}/"/>
     </target>
-    
+
     <target name="-def-javadoc-tool" depends="-check-target.java.home">
         <macrodef name="javadoc-tool">
             <attribute name="name"/>
@@ -604,14 +614,14 @@
                 <!-- Note: even with this default value, includes
          from src.classes.dir get javadoc'd; see packageset below -->
                 <property name="javadoc.packagenames" value="none"/> <!-- default, can be overridden per user or per project -->
-                <javadoc 
+                <javadoc
                     executable="${target.java.home}/bin/javadoc"
-                    destdir="${build.javadoc.dir}/@{name}" 
+                    destdir="${build.javadoc.dir}/@{name}"
                     source="@{source}"
-                    windowtitle="UNOFFICIAL" 
-                    failonerror="true" 
+                    windowtitle="UNOFFICIAL"
+                    failonerror="true"
                     use="true"
-                    author="false" 
+                    author="false"
                     version="false"
                     packagenames="${javadoc.packagenames}" >
                     <header><![CDATA[<strong>Unofficial Javadoc</strong> generated from developer sources for preview purposes only]]></header>
@@ -640,8 +650,8 @@
             </sequential>
         </macrodef>
     </target>
-    
-    <target name="-def-jtreg" unless="jtreg.defined" depends="-check-jtreg.home">
+
+    <target name="-def-jtreg" unless="jtreg.defined" depends="-check-jtreg.home,-check-target.java.home">
         <taskdef name="jtreg" classname="com.sun.javatest.regtest.Main$$Ant">
             <classpath>
                 <pathelement location="${jtreg.home}/lib/jtreg.jar"/>
@@ -652,7 +662,7 @@
             <attribute name="name"/>
             <attribute name="tests"/>
             <attribute name="jdk" default="${target.java.home}"/>
-            <attribute name="samevm" default="false"/>
+            <attribute name="samevm" default="true"/>
             <attribute name="verbose" default="summary"/>
             <attribute name="options" default=""/>
             <attribute name="keywords" default="-keywords:!ignore"/>
@@ -660,9 +670,9 @@
             <sequential>
                 <property name="coverage.options" value=""/>    <!-- default -->
                 <property name="coverage.classpath" value=""/>    <!-- default -->
-                <jtreg 
+                <jtreg
                     dir="${test.dir}"
-                    workDir="${build.jtreg.dir}/@{name}/work" 
+                    workDir="${build.jtreg.dir}/@{name}/work"
                     reportDir="${build.jtreg.dir}/@{name}/report"
                     jdk="@{jdk}"
                     samevm="@{samevm}" verbose="@{verbose}"
@@ -673,7 +683,7 @@
                     <arg line="@{options}"/>
                     <arg line="@{tests}"/>
                 </jtreg>
-                <!-- the next two properties are for convenience, when only 
+                <!-- the next two properties are for convenience, when only
                      a single instance of jtreg will be invoked. -->
                 <condition property="jtreg.passed">
                     <equals arg1="${jtreg.@{name}.result}" arg2="0"/>
@@ -691,9 +701,9 @@
                 <include name="lib/**/*.jar"/>
             </fileset>
         </path>
-	<taskdef classpathref="cobertura.classpath" resource="tasks.properties"/>
+        <taskdef classpathref="cobertura.classpath" resource="tasks.properties"/>
     </target>
-    
+
     <target name="-def-findbugs" unless="findbugs.defined" depends="-check-findbugs.home">
         <taskdef name="findbugs" classname="edu.umd.cs.findbugs.anttask.FindBugsTask">
             <classpath>
@@ -706,7 +716,7 @@
             <attribute name="outputFile" default=""/>
             <attribute name="reportLevel" default="high"/>
             <sequential>
-                <findbugs 
+                <findbugs
                     home="${findbugs.home}"
                     output="@{output}"
                     outputFile="@{outputFile}"
@@ -727,7 +737,7 @@
         </macrodef>
         <property name="findbugs.defined" value="true"/>
     </target>
-    
+
     <target name="-def-check">
         <macrodef name="check">
             <attribute name="name"/>
@@ -753,7 +763,7 @@
     </target>
 
     <!-- standard JDK target -->
-    <target name="sanity" 
+    <target name="sanity"
         description="display settings of congiguration values">
         <echo level="info">ant.home = ${ant.home}</echo>
         <echo level="info">boot.java.home = ${boot.java.home}</echo>
@@ -769,15 +779,15 @@
 
     <target name="post-sanity" depends="-def-jtreg,sanity,build"
         description="perform basic validation after a standard build">
-        <jtreg 
+        <jtreg
             dir="make/test"
-            workDir="${build.jtreg.dir}/post-sanity/work" 
+            workDir="${build.jtreg.dir}/post-sanity/work"
             reportDir="${build.jtreg.dir}/post-sanity/report"
             jdk="${target.java.home}"
             verbose="summary"
             failonerror="false" resultproperty="jtreg.post-sanity.result">
         </jtreg>
-        
+
     </target>
 </project>
 
--- a/src/share/bin/launcher.sh-template	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/bin/launcher.sh-template	Mon Sep 07 22:42:05 2009 -0700
@@ -45,7 +45,7 @@
 fi
 
 # tools currently assumes that assertions are enabled in the launcher
-ea=-ea:com.sun.tools
+ea=-ea:com.sun.tools...
 
 # Any parameters starting with -J are passed to the JVM.
 # All other parameters become parameters of #PROGRAM#.
--- a/src/share/classes/com/sun/mirror/apt/AnnotationProcessor.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/mirror/apt/AnnotationProcessor.java	Mon Sep 07 22:42:05 2009 -0700
@@ -50,11 +50,17 @@
  * annotations of those types.  It may freely examine any other program
  * elements in the course of its processing.
  *
+ * @deprecated All components of this API have been superseded by the
+ * standardized annotation processing API.  The replacement for the
+ * functionality of this interface is {@link
+ * javax.annotation.processing.Processor}.
+ *
  * @author Joseph D. Darcy
  * @author Scott Seligman
  * @since 1.5
  */
-
+@Deprecated
+@SuppressWarnings("deprecation")
 public interface AnnotationProcessor {
 
     /**
--- a/src/share/classes/com/sun/mirror/apt/AnnotationProcessorEnvironment.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/mirror/apt/AnnotationProcessorEnvironment.java	Mon Sep 07 22:42:05 2009 -0700
@@ -48,11 +48,17 @@
  * provides a simple way to select just the items of interest
  * when a method returns a collection of declarations.
  *
+ * @deprecated All components of this API have been superseded by the
+ * standardized annotation processing API.  The replacement for the
+ * functionality of this interface is {@link
+ * javax.annotation.processing.ProcessingEnvironment}.
+ *
  * @author Joseph D. Darcy
  * @author Scott Seligman
  * @since 1.5
  */
-
+@Deprecated
+@SuppressWarnings("deprecation")
 public interface AnnotationProcessorEnvironment {
 
     /**
@@ -87,7 +93,6 @@
     Filer getFiler();
 
 
-
     /**
      * Returns the declarations of the types specified when the
      * annotation processing tool was invoked.
--- a/src/share/classes/com/sun/mirror/apt/AnnotationProcessorFactory.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/mirror/apt/AnnotationProcessorFactory.java	Mon Sep 07 22:42:05 2009 -0700
@@ -42,11 +42,17 @@
  * must provide a public no-argument constructor to be used by tools to
  * instantiate the factory.
  *
+ * @deprecated All components of this API have been superseded by the
+ * standardized annotation processing API.  The replacement for the
+ * functionality of this interface is {@link
+ * javax.annotation.processing.Processor}.
+ *
  * @author Joseph D. Darcy
  * @author Scott Seligman
  * @since 1.5
  */
-
+@Deprecated
+@SuppressWarnings("deprecation")
 public interface AnnotationProcessorFactory {
 
     /**
--- a/src/share/classes/com/sun/mirror/apt/AnnotationProcessorListener.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/mirror/apt/AnnotationProcessorListener.java	Mon Sep 07 22:42:05 2009 -0700
@@ -28,8 +28,15 @@
 /**
  * Superinterface for all annotation processor event listeners.
  *
+ * @deprecated All components of this API have been superseded by the
+ * standardized annotation processing API.  This interface has no
+ * direct analog in the standardized API because the different round
+ * model renders it unnecessary.
+ *
  * @author Joseph D. Darcy
  * @author Scott Seligman
  * @since 1.5
  */
+@Deprecated
+@SuppressWarnings("deprecation")
 public interface AnnotationProcessorListener extends java.util.EventListener {}
--- a/src/share/classes/com/sun/mirror/apt/AnnotationProcessors.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/mirror/apt/AnnotationProcessors.java	Mon Sep 07 22:42:05 2009 -0700
@@ -31,10 +31,16 @@
 /**
  * Utilities to create specialized annotation processors.
  *
+ * @deprecated All components of this API have been superseded by the
+ * standardized annotation processing API.  There is no direct analog
+ * of the functionality of this class in the standardized API.
+ *
  * @since 1.5
  * @author Joseph D. Darcy
  * @author Scott Seligman
  */
+@Deprecated
+@SuppressWarnings("deprecation")
 public class AnnotationProcessors {
     static class NoOpAP implements AnnotationProcessor {
         NoOpAP() {}
--- a/src/share/classes/com/sun/mirror/apt/Filer.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/mirror/apt/Filer.java	Mon Sep 07 22:42:05 2009 -0700
@@ -51,11 +51,17 @@
  * be deleted.  Any subsequent attempt to create the same file during
  * a run will fail.
  *
+ * @deprecated All components of this API have been superseded by the
+ * standardized annotation processing API.  The replacement for the
+ * functionality of this interface is {@link
+ * javax.annotation.processing.Filer}.
+ *
  * @author Joseph D. Darcy
  * @author Scott Seligman
  * @since 1.5
  */
-
+@Deprecated
+@SuppressWarnings("deprecation")
 public interface Filer {
 
     /**
@@ -140,7 +146,13 @@
 
     /**
      * Locations (subtrees within the file system) where new files are created.
+     *
+     * @deprecated All components of this API have been superseded by
+     * the standardized annotation processing API.  The replacement
+     * for the functionality of this enum is {@link
+     * javax.tools.StandardLocation}.
      */
+    @Deprecated
     enum Location {
         /** The location of new source files. */
         SOURCE_TREE,
--- a/src/share/classes/com/sun/mirror/apt/Messager.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/mirror/apt/Messager.java	Mon Sep 07 22:42:05 2009 -0700
@@ -25,20 +25,24 @@
 
 package com.sun.mirror.apt;
 
-
 import com.sun.mirror.util.SourcePosition;
 
-
 /**
  * A <tt>Messager</tt> provides the way for
  * an annotation processor to report error messages, warnings, and
  * other notices.
  *
+ * @deprecated All components of this API have been superseded by the
+ * standardized annotation processing API.  The replacement for the
+ * functionality of this interface is {@link
+ * javax.annotation.processing.Messager}.
+ *
  * @author Joseph D. Darcy
  * @author Scott Seligman
  * @since 1.5
  */
-
+@Deprecated
+@SuppressWarnings("deprecation")
 public interface Messager {
 
     /**
--- a/src/share/classes/com/sun/mirror/apt/RoundCompleteEvent.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/mirror/apt/RoundCompleteEvent.java	Mon Sep 07 22:42:05 2009 -0700
@@ -32,10 +32,17 @@
  * cannot meaningfully be serialized because all of the annotation
  * processing tool's internal state would potentially be needed.
  *
+ * @deprecated All components of this API have been superseded by the
+ * standardized annotation processing API.  This class has no direct
+ * analog in the standardized API because the different round model
+ * renders it unnecessary.
+ *
  * @author Joseph D. Darcy
  * @author Scott Seligman
  * @since 1.5
  */
+@Deprecated
+@SuppressWarnings("deprecation")
 public abstract class RoundCompleteEvent extends java.util.EventObject {
     private RoundState rs;
 
--- a/src/share/classes/com/sun/mirror/apt/RoundCompleteListener.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/mirror/apt/RoundCompleteListener.java	Mon Sep 07 22:42:05 2009 -0700
@@ -28,10 +28,17 @@
 /**
  * Listener for the completion of a round of annotation processing.
  *
+ * @deprecated All components of this API have been superseded by the
+ * standardized annotation processing API.  This interface has no
+ * direct analog in the standardized API because the different round
+ * model renders it unnecessary.
+ *
  * @author Joseph D. Darcy
  * @author Scott Seligman
  * @since 1.5
  */
+@Deprecated
+@SuppressWarnings("deprecation")
 public interface RoundCompleteListener extends AnnotationProcessorListener {
     /**
      * Invoked after all processors for a round have run to completion.
--- a/src/share/classes/com/sun/mirror/apt/RoundState.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/mirror/apt/RoundState.java	Mon Sep 07 22:42:05 2009 -0700
@@ -28,10 +28,17 @@
 /**
  * Represents the status of a completed round of annotation processing.
  *
+ * @deprecated All components of this API have been superseded by the
+ * standardized annotation processing API.  The replacement for the
+ * functionality of this interface is {@link
+ * javax.annotation.processing.RoundEnvironment}.
+ *
  * @author Joseph D. Darcy
  * @author Scott Seligman
  * @since 1.5
  */
+@Deprecated
+@SuppressWarnings("deprecation")
 public interface RoundState {
     /**
      * Returns <tt>true</tt> if this was the last round of annotation
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/com/sun/mirror/apt/package-info.java	Mon Sep 07 22:42:05 2009 -0700
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2004 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+/**
+ * Classes used to communicate information between {@linkplain
+ * com.sun.mirror.apt.AnnotationProcessor annotation processors} and
+ * an annotation processing tool.
+ *
+ * <p>The {@code apt} tool and its associated API have been superseded
+ * by the standardized annotation processing API.  The replacement for
+ * the functionality in this package is {@link
+ * javax.annotation.processing}.
+ *
+ * @since 1.5
+ */
+package com.sun.mirror.apt;
--- a/src/share/classes/com/sun/mirror/apt/package.html	Sat Jul 25 20:57:05 2009 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
-<head>
-<!--
-
-Copyright 2004 Sun Microsystems, Inc.  All Rights Reserved.
-DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
-This code is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License version 2 only, as
-published by the Free Software Foundation.  Sun designates this
-particular file as subject to the "Classpath" exception as provided
-by Sun in the LICENSE file that accompanied this code.
-
-This code is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-version 2 for more details (a copy is included in the LICENSE file that
-accompanied this code).
-
-You should have received a copy of the GNU General Public License version
-2 along with this work; if not, write to the Free Software Foundation,
-Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
-CA 95054 USA or visit www.sun.com if you need additional information or
-have any questions.
--->
-
-</head>
-<body bgcolor="white">
-
-Classes used to communicate information between
-{@linkplain com.sun.mirror.apt.AnnotationProcessor annotation processors}
-and an annotation processing tool.
-
-<p>Note that the <code>apt</code> tool and its associated APIs may be
-changed or superseded in future j2se releases.
-
-@since 1.5
-</body>
-</html>
--- a/src/share/classes/com/sun/mirror/declaration/AnnotationMirror.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/mirror/declaration/AnnotationMirror.java	Mon Sep 07 22:42:05 2009 -0700
@@ -38,11 +38,17 @@
  * ("<tt>==</tt>").  There is no guarantee that any particular
  * annotation will always be represented by the same object.
  *
+ * @deprecated All components of this API have been superseded by the
+ * standardized annotation processing API.  The replacement for the
+ * functionality of this interface is {@link
+ * javax.lang.model.element.AnnotationMirror}.
+ *
  * @author Joseph D. Darcy
  * @author Scott Seligman
  * @since 1.5
  */
-
+@Deprecated
+@SuppressWarnings("deprecation")
 public interface AnnotationMirror {
 
     /**
--- a/src/share/classes/com/sun/mirror/declaration/AnnotationTypeDeclaration.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/mirror/declaration/AnnotationTypeDeclaration.java	Mon Sep 07 22:42:05 2009 -0700
@@ -32,11 +32,17 @@
 /**
  * Represents the declaration of an annotation type.
  *
+ * @deprecated All components of this API have been superseded by the
+ * standardized annotation processing API.  The replacement for the
+ * functionality of this interface is included in {@link
+ * javax.lang.model.element.TypeElement}.
+ *
  * @author Joseph D. Darcy
  * @author Scott Seligman
  * @since 1.5
  */
-
+@Deprecated
+@SuppressWarnings("deprecation")
 public interface AnnotationTypeDeclaration extends InterfaceDeclaration {
 
     /**
--- a/src/share/classes/com/sun/mirror/declaration/AnnotationTypeElementDeclaration.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/mirror/declaration/AnnotationTypeElementDeclaration.java	Mon Sep 07 22:42:05 2009 -0700
@@ -29,11 +29,17 @@
 /**
  * Represents an element of an annotation type.
  *
+ * @deprecated All components of this API have been superseded by the
+ * standardized annotation processing API.  The replacement for the
+ * functionality of this interface is included in {@link
+ * javax.lang.model.element.ExecutableElement}.
+ *
  * @author Joe Darcy
  * @author Scott Seligman
  * @since 1.5
  */
-
+@Deprecated
+@SuppressWarnings("deprecation")
 public interface AnnotationTypeElementDeclaration extends MethodDeclaration {
 
     /**
--- a/src/share/classes/com/sun/mirror/declaration/AnnotationValue.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/mirror/declaration/AnnotationValue.java	Mon Sep 07 22:42:05 2009 -0700
@@ -30,11 +30,17 @@
 /**
  * Represents a value of an annotation type element.
  *
+ * @deprecated All components of this API have been superseded by the
+ * standardized annotation processing API.  The replacement for the
+ * functionality of this interface is {@link
+ * javax.lang.model.element.AnnotationValue}.
+ *
  * @author Joseph D. Darcy
  * @author Scott Seligman
  * @since 1.5
  */
-
+@Deprecated
+@SuppressWarnings("deprecation")
 public interface AnnotationValue {
 
     /**
--- a/src/share/classes/com/sun/mirror/declaration/ClassDeclaration.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/mirror/declaration/ClassDeclaration.java	Mon Sep 07 22:42:05 2009 -0700
@@ -46,13 +46,19 @@
  * provides a simple way to select just the items of interest
  * when a method returns a collection of declarations.
  *
+ * @deprecated All components of this API have been superseded by the
+ * standardized annotation processing API.  The replacement for the
+ * functionality of this interface is included in {@link
+ * javax.lang.model.element.TypeElement}.
+ *
  * @author Joseph D. Darcy
  * @author Scott Seligman
  *
  * @see ClassType
  * @since 1.5
  */
-
+@Deprecated
+@SuppressWarnings("deprecation")
 public interface ClassDeclaration extends TypeDeclaration {
 
     /**
--- a/src/share/classes/com/sun/mirror/declaration/ConstructorDeclaration.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/mirror/declaration/ConstructorDeclaration.java	Mon Sep 07 22:42:05 2009 -0700
@@ -29,10 +29,16 @@
 /**
  * Represents a constructor of a class or interface.
  *
+ * @deprecated All components of this API have been superseded by the
+ * standardized annotation processing API.  The replacement for the
+ * functionality of this interface is included in {@link
+ * javax.lang.model.element.ExecutableElement}.
+ *
  * @author Joe Darcy
  * @author Scott Seligman
  * @since 1.5
  */
-
+@Deprecated
+@SuppressWarnings("deprecation")
 public interface ConstructorDeclaration extends ExecutableDeclaration {
 }
--- a/src/share/classes/com/sun/mirror/declaration/Declaration.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/mirror/declaration/Declaration.java	Mon Sep 07 22:42:05 2009 -0700
@@ -44,6 +44,11 @@
  * method.  There is no guarantee that any particular declaration will
  * always be represented by the same object.
  *
+ * @deprecated All components of this API have been superseded by the
+ * standardized annotation processing API.  The replacement for the
+ * functionality of this interface is {@link
+ * javax.lang.model.element.Element}.
+ *
  * @author Joseph D. Darcy
  * @author Scott Seligman
  *
@@ -51,7 +56,8 @@
  * @see TypeMirror
  * @since 1.5
  */
-
+@Deprecated
+@SuppressWarnings("deprecation")
 public interface Declaration {
 
     /**
--- a/src/share/classes/com/sun/mirror/declaration/EnumConstantDeclaration.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/mirror/declaration/EnumConstantDeclaration.java	Mon Sep 07 22:42:05 2009 -0700
@@ -29,11 +29,17 @@
 /**
  * Represents an enum constant declaration.
  *
+ * @deprecated All components of this API have been superseded by the
+ * standardized annotation processing API.  The replacement for the
+ * functionality of this interface is included in {@link
+ * javax.lang.model.element.VariableElement}.
+ *
  * @author Joseph D. Darcy
  * @author Scott Seligman
  * @since 1.5
  */
-
+@Deprecated
+@SuppressWarnings("deprecation")
 public interface EnumConstantDeclaration extends FieldDeclaration {
     /**
      * {@inheritDoc}
--- a/src/share/classes/com/sun/mirror/declaration/EnumDeclaration.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/mirror/declaration/EnumDeclaration.java	Mon Sep 07 22:42:05 2009 -0700
@@ -32,11 +32,17 @@
 /**
  * Represents the declaration of an enum type.
  *
+ * @deprecated All components of this API have been superseded by the
+ * standardized annotation processing API.  The replacement for the
+ * functionality of this interface is included in {@link
+ * javax.lang.model.element.TypeElement}.
+ *
  * @author Joseph D. Darcy
  * @author Scott Seligman
  * @since 1.5
  */
-
+@Deprecated
+@SuppressWarnings("deprecation")
 public interface EnumDeclaration extends ClassDeclaration {
 
     /**
--- a/src/share/classes/com/sun/mirror/declaration/ExecutableDeclaration.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/mirror/declaration/ExecutableDeclaration.java	Mon Sep 07 22:42:05 2009 -0700
@@ -34,11 +34,17 @@
 /**
  * Represents a method or constructor of a class or interface.
  *
+ * @deprecated All components of this API have been superseded by the
+ * standardized annotation processing API.  The replacement for the
+ * functionality of this interface is {@link
+ * javax.lang.model.element.ExecutableElement}.
+ *
  * @author Joseph D. Darcy
  * @author Scott Seligman
  * @since 1.5
  */
-
+@Deprecated
+@SuppressWarnings("deprecation")
 public interface ExecutableDeclaration extends MemberDeclaration {
 
     /**
--- a/src/share/classes/com/sun/mirror/declaration/FieldDeclaration.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/mirror/declaration/FieldDeclaration.java	Mon Sep 07 22:42:05 2009 -0700
@@ -32,11 +32,17 @@
 /**
  * Represents a field of a type declaration.
  *
+ * @deprecated All components of this API have been superseded by the
+ * standardized annotation processing API.  The replacement for the
+ * functionality of this interface is included in {@link
+ * javax.lang.model.element.VariableElement}.
+ *
  * @author Joseph D. Darcy
  * @author Scott Seligman
  * @since 1.5
  */
-
+@Deprecated
+@SuppressWarnings("deprecation")
 public interface FieldDeclaration extends MemberDeclaration {
 
     /**
--- a/src/share/classes/com/sun/mirror/declaration/InterfaceDeclaration.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/mirror/declaration/InterfaceDeclaration.java	Mon Sep 07 22:42:05 2009 -0700
@@ -40,12 +40,18 @@
  * represents an interface <i>type</i>.
  * See {@link TypeDeclaration} for more on this distinction.
  *
+ * @deprecated All components of this API have been superseded by the
+ * standardized annotation processing API.  The replacement for the
+ * functionality of this interface is included in {@link
+ * javax.lang.model.element.TypeElement}.
+ *
  * @author Joseph D. Darcy
  * @author Scott Seligman
  *
  * @see InterfaceType
  * @since 1.5
  */
-
+@Deprecated
+@SuppressWarnings("deprecation")
 public interface InterfaceDeclaration extends TypeDeclaration {
 }
--- a/src/share/classes/com/sun/mirror/declaration/MemberDeclaration.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/mirror/declaration/MemberDeclaration.java	Mon Sep 07 22:42:05 2009 -0700
@@ -31,11 +31,17 @@
  * type.  This includes fields, constructors, methods, and (since they
  * may be nested) declared types themselves.
  *
+ * @deprecated All components of this API have been superseded by the
+ * standardized annotation processing API.  The replacement for the
+ * functionality of this interface is {@link
+ * javax.lang.model.element.Element}.
+ *
  * @author Joseph D. Darcy
  * @author Scott Seligman
  * @since 1.5
  */
-
+@Deprecated
+@SuppressWarnings("deprecation")
 public interface MemberDeclaration extends Declaration {
 
     /**
--- a/src/share/classes/com/sun/mirror/declaration/MethodDeclaration.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/mirror/declaration/MethodDeclaration.java	Mon Sep 07 22:42:05 2009 -0700
@@ -36,11 +36,17 @@
  * {@linkplain AnnotationTypeElementDeclaration annotation type element}
  * is a kind of method.
  *
+ * @deprecated All components of this API have been superseded by the
+ * standardized annotation processing API.  The replacement for the
+ * functionality of this interface is included in {@link
+ * javax.lang.model.element.ExecutableElement}.
+ *
  * @author Joseph D. Darcy
  * @author Scott Seligman
  * @since 1.5
  */
-
+@Deprecated
+@SuppressWarnings("deprecation")
 public interface MethodDeclaration extends ExecutableDeclaration {
 
     /**
--- a/src/share/classes/com/sun/mirror/declaration/Modifier.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/mirror/declaration/Modifier.java	Mon Sep 07 22:42:05 2009 -0700
@@ -35,11 +35,16 @@
  * then it is customary, though not required, that they appear in the same
  * order as the constants listed in the detail section below.
  *
+ * @deprecated All components of this API have been superseded by the
+ * standardized annotation processing API.  The replacement for the
+ * functionality of this enum is {@link javax.lang.model.element.Modifier}.
+ *
  * @author Joseph D. Darcy
  * @author Scott Seligman
  * @since 1.5
  */
-
+@Deprecated
+@SuppressWarnings("deprecation")
 public enum Modifier {
 
     // See JLS2 sections 8.1.1, 8.3.1, 8.4.3, 8.8.3, and 9.1.1.
--- a/src/share/classes/com/sun/mirror/declaration/PackageDeclaration.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/mirror/declaration/PackageDeclaration.java	Mon Sep 07 22:42:05 2009 -0700
@@ -37,11 +37,17 @@
  * provides a simple way to select just the items of interest
  * when a method returns a collection of declarations.
  *
+ * @deprecated All components of this API have been superseded by the
+ * standardized annotation processing API.  The replacement for the
+ * functionality of this interface is {@link
+ * javax.lang.model.element.PackageElement}.
+ *
  * @author Joseph D. Darcy
  * @author Scott Seligman
  * @since 1.5
  */
-
+@Deprecated
+@SuppressWarnings("deprecation")
 public interface PackageDeclaration extends Declaration {
 
     /**
--- a/src/share/classes/com/sun/mirror/declaration/ParameterDeclaration.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/mirror/declaration/ParameterDeclaration.java	Mon Sep 07 22:42:05 2009 -0700
@@ -32,11 +32,17 @@
 /**
  * Represents a formal parameter of a method or constructor.
  *
+ * @deprecated All components of this API have been superseded by the
+ * standardized annotation processing API.  The replacement for the
+ * functionality of this interface is included in {@link
+ * javax.lang.model.element.VariableElement}.
+ *
  * @author Joseph D. Darcy
  * @author Scott Seligman
  * @since 1.5
  */
-
+@Deprecated
+@SuppressWarnings("deprecation")
 public interface ParameterDeclaration extends Declaration {
 
     /**
--- a/src/share/classes/com/sun/mirror/declaration/TypeDeclaration.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/mirror/declaration/TypeDeclaration.java	Mon Sep 07 22:42:05 2009 -0700
@@ -54,13 +54,19 @@
  * provides a simple way to select just the items of interest
  * when a method returns a collection of declarations.
  *
+ * @deprecated All components of this API have been superseded by the
+ * standardized annotation processing API.  The replacement for the
+ * functionality of this interface is included in {@link
+ * javax.lang.model.element.TypeElement}.
+ *
  * @author Joseph D. Darcy
  * @author Scott Seligman
  *
  * @see DeclaredType
  * @since 1.5
  */
-
+@Deprecated
+@SuppressWarnings("deprecation")
 public interface TypeDeclaration extends MemberDeclaration {
 
     /**
--- a/src/share/classes/com/sun/mirror/declaration/TypeParameterDeclaration.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/mirror/declaration/TypeParameterDeclaration.java	Mon Sep 07 22:42:05 2009 -0700
@@ -36,11 +36,17 @@
  * or constructor declaration.
  * A type parameter declares a {@link TypeVariable}.
  *
+ * @deprecated All components of this API have been superseded by the
+ * standardized annotation processing API.  The replacement for the
+ * functionality of this interface is {@link
+ * javax.lang.model.element.TypeParameterElement}.
+ *
  * @author Joseph D. Darcy
  * @author Scott Seligman
  * @since 1.5
  */
-
+@Deprecated
+@SuppressWarnings("deprecation")
 public interface TypeParameterDeclaration extends Declaration {
 
     /**
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/com/sun/mirror/declaration/package-info.java	Mon Sep 07 22:42:05 2009 -0700
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2004 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+/**
+ * Interfaces used to model program element declarations.  A
+ * declaration is represented by the appropriate subinterface of
+ * {@link com.sun.mirror.declaration.Declaration}, and an annotation
+ * is represented as an {@link
+ * com.sun.mirror.declaration.AnnotationMirror}.
+ *
+ * <p>The {@code apt} tool and its associated API have been superseded
+ * by the standardized annotation processing API.  The replacement for
+ * the functionality in this package is {@link
+ * javax.lang.model.element}.
+ *
+ * @since 1.5
+ */
+package com.sun.mirror.declaration;
--- a/src/share/classes/com/sun/mirror/declaration/package.html	Sat Jul 25 20:57:05 2009 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
-<head>
-<!--
-
-Copyright 2004 Sun Microsystems, Inc.  All Rights Reserved.
-DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
-This code is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License version 2 only, as
-published by the Free Software Foundation.  Sun designates this
-particular file as subject to the "Classpath" exception as provided
-by Sun in the LICENSE file that accompanied this code.
-
-This code is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-version 2 for more details (a copy is included in the LICENSE file that
-accompanied this code).
-
-You should have received a copy of the GNU General Public License version
-2 along with this work; if not, write to the Free Software Foundation,
-Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
-CA 95054 USA or visit www.sun.com if you need additional information or
-have any questions.
--->
-
-</head>
-<body bgcolor="white">
-
-Interfaces used to model program element declarations.
-A declaration is represented by the appropriate subinterface of
-{@link com.sun.mirror.declaration.Declaration},
-and an annotation is represented as an
-{@link com.sun.mirror.declaration.AnnotationMirror}.
-
-<p>Note that the <code>apt</code> tool and its associated APIs may be
-changed or superseded in future j2se releases.
-
-@since 1.5
-</body>
-</html>
--- a/src/share/classes/com/sun/mirror/type/AnnotationType.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/mirror/type/AnnotationType.java	Mon Sep 07 22:42:05 2009 -0700
@@ -32,11 +32,17 @@
 /**
  * Represents an annotation type.
  *
+ * @deprecated All components of this API have been superseded by the
+ * standardized annotation processing API.  The replacement for the
+ * functionality of this interface is included in {@link
+ * javax.lang.model.type.DeclaredType}.
+ *
  * @author Joseph D. Darcy
  * @author Scott Seligman
  * @since 1.5
  */
-
+@Deprecated
+@SuppressWarnings("deprecation")
 public interface AnnotationType extends InterfaceType {
 
     /**
--- a/src/share/classes/com/sun/mirror/type/ArrayType.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/mirror/type/ArrayType.java	Mon Sep 07 22:42:05 2009 -0700
@@ -31,11 +31,17 @@
  * A multidimensional array type is represented as an array type
  * whose component type is also an array type.
  *
+ * @deprecated All components of this API have been superseded by the
+ * standardized annotation processing API.  The replacement for the
+ * functionality of this interface is {@link
+ * javax.lang.model.type.ArrayType}.
+ *
  * @author Joseph D. Darcy
  * @author Scott Seligman
  * @since 1.5
  */
-
+@Deprecated
+@SuppressWarnings("deprecation")
 public interface ArrayType extends ReferenceType {
 
     /**
--- a/src/share/classes/com/sun/mirror/type/ClassType.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/mirror/type/ClassType.java	Mon Sep 07 22:42:05 2009 -0700
@@ -38,11 +38,17 @@
  * of a class, a <tt>ClassType</tt> represents a class <i>type</i>.
  * See {@link TypeDeclaration} for more on this distinction.
  *
+ * @deprecated All components of this API have been superseded by the
+ * standardized annotation processing API.  The replacement for the
+ * functionality of this interface is included in {@link
+ * javax.lang.model.type.DeclaredType}.
+ *
  * @author Joseph D. Darcy
  * @author Scott Seligman
  * @since 1.5
  */
-
+@Deprecated
+@SuppressWarnings("deprecation")
 public interface ClassType extends DeclaredType {
 
     /**
--- a/src/share/classes/com/sun/mirror/type/DeclaredType.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/mirror/type/DeclaredType.java	Mon Sep 07 22:42:05 2009 -0700
@@ -48,11 +48,17 @@
  * Other method invocations on such an unknown type will not, in general,
  * return meaningful results.
  *
+ * @deprecated All components of this API have been superseded by the
+ * standardized annotation processing API.  The replacement for the
+ * functionality of this interface is included in {@link
+ * javax.lang.model.type.DeclaredType}.
+ *
  * @author Joseph D. Darcy
  * @author Scott Seligman
  * @since 1.5
  */
-
+@Deprecated
+@SuppressWarnings("deprecation")
 public interface DeclaredType extends ReferenceType {
 
     /**
--- a/src/share/classes/com/sun/mirror/type/EnumType.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/mirror/type/EnumType.java	Mon Sep 07 22:42:05 2009 -0700
@@ -32,11 +32,17 @@
 /**
  * Represents an enum type.
  *
+ * @deprecated All components of this API have been superseded by the
+ * standardized annotation processing API.  The replacement for the
+ * functionality of this interface is included in {@link
+ * javax.lang.model.type.DeclaredType}.
+ *
  * @author Joseph D. Darcy
  * @author Scott Seligman
  * @since 1.5
  */
-
+@Deprecated
+@SuppressWarnings("deprecation")
 public interface EnumType extends ClassType {
 
     /**
--- a/src/share/classes/com/sun/mirror/type/InterfaceType.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/mirror/type/InterfaceType.java	Mon Sep 07 22:42:05 2009 -0700
@@ -39,11 +39,17 @@
  * represents an interface <i>type</i>.
  * See {@link TypeDeclaration} for more on this distinction.
  *
+ * @deprecated All components of this API have been superseded by the
+ * standardized annotation processing API.  The replacement for the
+ * functionality of this interface is included in {@link
+ * javax.lang.model.type.DeclaredType}.
+ *
  * @author Joseph D. Darcy
  * @author Scott Seligman
  * @since 1.5
  */
-
+@Deprecated
+@SuppressWarnings("deprecation")
 public interface InterfaceType extends DeclaredType {
 
     /**
--- a/src/share/classes/com/sun/mirror/type/MirroredTypeException.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/mirror/type/MirroredTypeException.java	Mon Sep 07 22:42:05 2009 -0700
@@ -35,9 +35,16 @@
  * Thrown when an application attempts to access the {@link Class} object
  * corresponding to a {@link TypeMirror}.
  *
+ * @deprecated All components of this API have been superseded by the
+ * standardized annotation processing API.  The replacement for the
+ * functionality of this exception is {@link
+ * javax.lang.model.type.MirroredTypeException}.
+ *
  * @see MirroredTypesException
  * @see Declaration#getAnnotation(Class)
  */
+@Deprecated
+@SuppressWarnings("deprecation")
 public class MirroredTypeException extends RuntimeException {
 
     private static final long serialVersionUID = 1;
--- a/src/share/classes/com/sun/mirror/type/MirroredTypesException.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/mirror/type/MirroredTypesException.java	Mon Sep 07 22:42:05 2009 -0700
@@ -38,9 +38,16 @@
  * Thrown when an application attempts to access a sequence of {@link Class}
  * objects each corresponding to a {@link TypeMirror}.
  *
+ * @deprecated All components of this API have been superseded by the
+ * standardized annotation processing API.  The replacement for the
+ * functionality of this exception is {@link
+ * javax.lang.model.type.MirroredTypesException}.
+ *
  * @see MirroredTypeException
  * @see Declaration#getAnnotation(Class)
  */
+@Deprecated
+@SuppressWarnings("deprecation")
 public class MirroredTypesException extends RuntimeException {
 
     private static final long serialVersionUID = 1;
--- a/src/share/classes/com/sun/mirror/type/PrimitiveType.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/mirror/type/PrimitiveType.java	Mon Sep 07 22:42:05 2009 -0700
@@ -31,11 +31,17 @@
  * <tt>boolean</tt>, <tt>byte</tt>, <tt>short</tt>, <tt>int</tt>,
  * <tt>long</tt>, <tt>char</tt>, <tt>float</tt>, and <tt>double</tt>.
  *
+ * @deprecated All components of this API have been superseded by the
+ * standardized annotation processing API.  The replacement for the
+ * functionality of this interface is {@link
+ * javax.lang.model.type.PrimitiveType}.
+ *
  * @author Joseph D. Darcy
  * @author Scott Seligman
  * @since 1.5
  */
-
+@Deprecated
+@SuppressWarnings("deprecation")
 public interface PrimitiveType extends TypeMirror {
 
     /**
@@ -47,7 +53,13 @@
 
     /**
      * An enumeration of the different kinds of primitive types.
+     *
+     * @deprecated All components of this API have been superseded by
+     * the standardized annotation processing API.  The replacement
+     * for the functionality of this enum is {@link
+     * javax.lang.model.type.TypeKind}.
      */
+    @Deprecated
     enum Kind {
         /** The primitive type <tt>boolean</tt> */      BOOLEAN,
         /** The primitive type <tt>byte</tt> */         BYTE,
--- a/src/share/classes/com/sun/mirror/type/ReferenceType.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/mirror/type/ReferenceType.java	Mon Sep 07 22:42:05 2009 -0700
@@ -30,10 +30,16 @@
  * Represents a reference type.
  * These include class and interface types, array types, and type variables.
  *
+ * @deprecated All components of this API have been superseded by the
+ * standardized annotation processing API.  The replacement for the
+ * functionality of this interface is {@link
+ * javax.lang.model.type.ReferenceType}.
+ *
  * @author Joseph D. Darcy
  * @author Scott Seligman
  * @since 1.5
  */
-
+@Deprecated
+@SuppressWarnings("deprecation")
 public interface ReferenceType extends TypeMirror {
 }
--- a/src/share/classes/com/sun/mirror/type/TypeMirror.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/mirror/type/TypeMirror.java	Mon Sep 07 22:42:05 2009 -0700
@@ -43,6 +43,11 @@
  * There is no guarantee that any particular type will
  * always be represented by the same object.
  *
+ * @deprecated All components of this API have been superseded by the
+ * standardized annotation processing API.  The replacement for the
+ * functionality of this interface is {@link
+ * javax.lang.model.type.TypeMirror}.
+ *
  * @author Joseph D. Darcy
  * @author Scott Seligman
  *
@@ -50,7 +55,8 @@
  * @see Types
  * @since 1.5
  */
-
+@Deprecated
+@SuppressWarnings("deprecation")
 public interface TypeMirror {
 
     /**
--- a/src/share/classes/com/sun/mirror/type/TypeVariable.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/mirror/type/TypeVariable.java	Mon Sep 07 22:42:05 2009 -0700
@@ -35,11 +35,17 @@
  * {@linkplain TypeParameterDeclaration type parameter} of a
  * type, method, or constructor.
  *
+ * @deprecated All components of this API have been superseded by the
+ * standardized annotation processing API.  The replacement for the
+ * functionality of this interface is {@link
+ * javax.lang.model.type.TypeVariable}.
+ *
  * @author Joe Darcy
  * @author Scott Seligman
  * @since 1.5
  */
-
+@Deprecated
+@SuppressWarnings("deprecation")
 public interface TypeVariable extends ReferenceType {
 
     /**
--- a/src/share/classes/com/sun/mirror/type/VoidType.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/mirror/type/VoidType.java	Mon Sep 07 22:42:05 2009 -0700
@@ -35,9 +35,15 @@
  * @author Joseph D. Darcy
  * @author Scott Seligman
  *
+ * @deprecated All components of this API have been superseded by the
+ * standardized annotation processing API.  The replacement for the
+ * functionality of this interface is included in {@link
+ * javax.lang.model.type.NoType}.
+ *
  * @see MethodDeclaration#getReturnType()
  * @since 1.5
  */
-
+@Deprecated
+@SuppressWarnings("deprecation")
 public interface VoidType extends TypeMirror {
 }
--- a/src/share/classes/com/sun/mirror/type/WildcardType.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/mirror/type/WildcardType.java	Mon Sep 07 22:42:05 2009 -0700
@@ -41,11 +41,17 @@
  * <tt>extends</tt> clause, its lower bound explicitly set by a
  * <tt>super</tt> clause, or neither (but not both).
  *
+ * @deprecated All components of this API have been superseded by the
+ * standardized annotation processing API.  The replacement for the
+ * functionality of this interface is {@link
+ * javax.lang.model.type.WildcardType}.
+ *
  * @author Joseph D. Darcy
  * @author Scott Seligman
  * @since 1.5
  */
-
+@Deprecated
+@SuppressWarnings("deprecation")
 public interface WildcardType extends TypeMirror {
 
     /**
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/com/sun/mirror/type/package-info.java	Mon Sep 07 22:42:05 2009 -0700
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2004 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+/**
+ * Interfaces used to model types.  A type is represented by the
+ * appropriate subinterface of {@link com.sun.mirror.type.TypeMirror}.
+ *
+ * <p>The {@code apt} tool and its associated API have been
+ * superseded by the standardized annotation processing API.  The
+ * replacement for the functionality in this package is {@link
+ * javax.lang.model.type}.
+ *
+ * @since 1.5
+ */
+package com.sun.mirror.type;
--- a/src/share/classes/com/sun/mirror/type/package.html	Sat Jul 25 20:57:05 2009 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
-<head>
-<!--
-
-Copyright 2004 Sun Microsystems, Inc.  All Rights Reserved.
-DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
-This code is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License version 2 only, as
-published by the Free Software Foundation.  Sun designates this
-particular file as subject to the "Classpath" exception as provided
-by Sun in the LICENSE file that accompanied this code.
-
-This code is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-version 2 for more details (a copy is included in the LICENSE file that
-accompanied this code).
-
-You should have received a copy of the GNU General Public License version
-2 along with this work; if not, write to the Free Software Foundation,
-Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
-CA 95054 USA or visit www.sun.com if you need additional information or
-have any questions.
--->
-
-</head>
-<body bgcolor="white">
-
-Interfaces used to model types.
-A type is represented by the appropriate subinterface of
-{@link com.sun.mirror.type.TypeMirror}.
-
-<p>Note that the <code>apt</code> tool and its associated APIs may be
-changed or superseded in future j2se releases.
-
-@since 1.5
-</body>
-</html>
--- a/src/share/classes/com/sun/mirror/util/DeclarationFilter.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/mirror/util/DeclarationFilter.java	Mon Sep 07 22:42:05 2009 -0700
@@ -69,11 +69,17 @@
  *                  };
  *     result = nameFilter.filter(decls);               </pre></blockquote>
  *
+ * @deprecated All components of this API have been superseded by the
+ * standardized annotation processing API.  The replacement for the
+ * functionality of this class is {@link
+ * javax.lang.model.util.ElementFilter}.
+ *
  * @author Joseph D. Darcy
  * @author Scott Seligman
  * @since 1.5
  */
-
+@Deprecated
+@SuppressWarnings("deprecation")
 public class DeclarationFilter {
 
     // Predefined filters for convenience.
--- a/src/share/classes/com/sun/mirror/util/DeclarationScanner.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/mirror/util/DeclarationScanner.java	Mon Sep 07 22:42:05 2009 -0700
@@ -39,11 +39,17 @@
  * are scanned; the postprocessing visitor is called after the
  * contained declarations are scanned.
  *
+ * @deprecated All components of this API have been superseded by the
+ * standardized annotation processing API.  The replacement for the
+ * functionality of this class is {@link
+ * javax.lang.model.util.ElementScanner6}.
+ *
  * @author Joseph D. Darcy
  * @author Scott Seligman
  * @since 1.5
  */
-
+@Deprecated
+@SuppressWarnings("deprecation")
 class DeclarationScanner implements DeclarationVisitor {
     protected DeclarationVisitor pre;
     protected DeclarationVisitor post;
--- a/src/share/classes/com/sun/mirror/util/DeclarationVisitor.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/mirror/util/DeclarationVisitor.java	Mon Sep 07 22:42:05 2009 -0700
@@ -37,11 +37,17 @@
  * <tt>visit<i>Xxx</i></tt> method applicable to that declaration is
  * invoked.
  *
+ * @deprecated All components of this API have been superseded by the
+ * standardized annotation processing API.  The replacement for the
+ * functionality of this interface is {@link
+ * javax.lang.model.element.ElementVisitor}.
+ *
  * @author Joseph D. Darcy
  * @author Scott Seligman
  * @since 1.5
  */
-
+@Deprecated
+@SuppressWarnings("deprecation")
 public interface DeclarationVisitor {
 
     /**
--- a/src/share/classes/com/sun/mirror/util/DeclarationVisitors.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/mirror/util/DeclarationVisitors.java	Mon Sep 07 22:42:05 2009 -0700
@@ -28,10 +28,17 @@
 /**
  * Utilities to create specialized <tt>DeclarationVisitor</tt> instances.
  *
+ * @deprecated All components of this API have been superseded by the
+ * standardized annotation processing API.  There is no direct
+ * replacement for the functionality of this class in the standardized
+ * API due to that API's different visitor structure.
+ *
  * @author Joseph D. Darcy
  * @author Scott Seligman
  * @since 1.5
  */
+@Deprecated
+@SuppressWarnings("deprecation")
 public class DeclarationVisitors {
     private DeclarationVisitors(){} // do not instantiate.
 
--- a/src/share/classes/com/sun/mirror/util/Declarations.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/mirror/util/Declarations.java	Mon Sep 07 22:42:05 2009 -0700
@@ -32,11 +32,17 @@
 /**
  * Utility methods for operating on declarations.
  *
+ * @deprecated All components of this API have been superseded by the
+ * standardized annotation processing API.  The replacement for the
+ * functionality of this interface is {@link
+ * javax.lang.model.util.Elements}.
+ *
  * @author Joseph D. Darcy
  * @author Scott Seligman
  * @since 1.5
  */
-
+@Deprecated
+@SuppressWarnings("deprecation")
 public interface Declarations {
 
     /**
--- a/src/share/classes/com/sun/mirror/util/SimpleDeclarationVisitor.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/mirror/util/SimpleDeclarationVisitor.java	Mon Sep 07 22:42:05 2009 -0700
@@ -37,11 +37,17 @@
  * methods that correspond to the kinds of declarations on which it
  * will operate.
  *
+ * @deprecated All components of this API have been superseded by the
+ * standardized annotation processing API.  The replacement for the
+ * functionality of this class is {@link
+ * javax.lang.model.util.SimpleElementVisitor6}.
+ *
  * @author Joseph D. Darcy
  * @author Scott Seligman
  * @since 1.5
  */
-
+@Deprecated
+@SuppressWarnings("deprecation")
 public class SimpleDeclarationVisitor implements DeclarationVisitor {
 
     /**
--- a/src/share/classes/com/sun/mirror/util/SimpleTypeVisitor.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/mirror/util/SimpleTypeVisitor.java	Mon Sep 07 22:42:05 2009 -0700
@@ -37,11 +37,17 @@
  * methods that correspond to the kinds of types on which it will
  * operate.
  *
+ * @deprecated All components of this API have been superseded by the
+ * standardized annotation processing API.  The replacement for the
+ * functionality of this class is {@link
+ * javax.lang.model.util.SimpleTypeVisitor6}.
+ *
  * @author Joseph D. Darcy
  * @author Scott Seligman
  * @since 1.5
  */
-
+@Deprecated
+@SuppressWarnings("deprecation")
 public class SimpleTypeVisitor implements TypeVisitor {
 
     /**
--- a/src/share/classes/com/sun/mirror/util/SourceOrderDeclScanner.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/mirror/util/SourceOrderDeclScanner.java	Mon Sep 07 22:42:05 2009 -0700
@@ -42,10 +42,17 @@
  * are scanned; the postprocessing visitor is called after the
  * contained declarations are scanned.
  *
+ * @deprecated All components of this API have been superseded by the
+ * standardized annotation processing API.  The replacement for the
+ * functionality of this class is {@link
+ * javax.lang.model.util.SimpleElementVisitor6}.
+ *
  * @author Joseph D. Darcy
  * @author Scott Seligman
  * @since 1.5
  */
+@Deprecated
+@SuppressWarnings("deprecation")
 class SourceOrderDeclScanner extends DeclarationScanner {
     static class SourceOrderComparator implements java.util.Comparator<Declaration> {
         SourceOrderComparator(){}
--- a/src/share/classes/com/sun/mirror/util/SourcePosition.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/mirror/util/SourcePosition.java	Mon Sep 07 22:42:05 2009 -0700
@@ -32,11 +32,20 @@
 /**
  * Represents a position in a source file.
  *
+ * @deprecated All components of this API have been superseded by the
+ * standardized annotation processing API.  There is no direct
+ * replacement for the functionality of this interface since the
+ * standardized {@link javax.annotation.processing.Messager Messager}
+ * API implicitly takes a source position argument via any element,
+ * annotation mirror, or annotation value passed along with the
+ * message.
+ *
  * @author Joseph D. Darcy
  * @author Scott Seligman
  * @since 1.5
  */
-
+@Deprecated
+@SuppressWarnings("deprecation")
 public interface SourcePosition {
 
     /**
--- a/src/share/classes/com/sun/mirror/util/TypeVisitor.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/mirror/util/TypeVisitor.java	Mon Sep 07 22:42:05 2009 -0700
@@ -38,11 +38,17 @@
  * the most specific <tt>visit<i>Xxx</i></tt> method applicable to
  * that type is invoked.
  *
+ * @deprecated All components of this API have been superseded by the
+ * standardized annotation processing API.  The replacement for the
+ * functionality of this interface is {@link
+ * javax.lang.model.element.TypeVisitor}.
+ *
  * @author Joseph D. Darcy
  * @author Scott Seligman
  * @since 1.5
  */
-
+@Deprecated
+@SuppressWarnings("deprecation")
 public interface TypeVisitor {
 
     /**
--- a/src/share/classes/com/sun/mirror/util/Types.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/mirror/util/Types.java	Mon Sep 07 22:42:05 2009 -0700
@@ -35,11 +35,17 @@
 /**
  * Utility methods for operating on types.
  *
+ * @deprecated All components of this API have been superseded by the
+ * standardized annotation processing API.  The replacement for the
+ * functionality of this interface is {@link
+ * javax.lang.model.util.Types}.
+ *
  * @author Joseph D. Darcy
  * @author Scott Seligman
  * @since 1.5
  */
-
+@Deprecated
+@SuppressWarnings("deprecation")
 public interface Types {
 
     /**
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/com/sun/mirror/util/package-info.java	Mon Sep 07 22:42:05 2009 -0700
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2004 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+/**
+ * Utilities to assist in the processing of {@linkplain
+ * com.sun.mirror.declaration declarations} and {@linkplain
+ * com.sun.mirror.type types}.
+ *
+ * <p>The {@code apt} tool and its associated API have been superseded
+ * by the standardized annotation processing API.  The replacement for
+ * the functionality in this package is {@link javax.lang.model.util}.
+ *
+ * @since 1.5
+ */
+package com.sun.mirror.util;
--- a/src/share/classes/com/sun/mirror/util/package.html	Sat Jul 25 20:57:05 2009 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
-<head>
-<!--
-
-Copyright 2004 Sun Microsystems, Inc.  All Rights Reserved.
-DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
-This code is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License version 2 only, as
-published by the Free Software Foundation.  Sun designates this
-particular file as subject to the "Classpath" exception as provided
-by Sun in the LICENSE file that accompanied this code.
-
-This code is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-version 2 for more details (a copy is included in the LICENSE file that
-accompanied this code).
-
-You should have received a copy of the GNU General Public License version
-2 along with this work; if not, write to the Free Software Foundation,
-Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
-CA 95054 USA or visit www.sun.com if you need additional information or
-have any questions.
--->
-
-</head>
-<body bgcolor="white">
-
-Utilities to assist in the processing of {@linkplain
-com.sun.mirror.declaration declarations} and {@linkplain
-com.sun.mirror.type types}.
-
-<p>Note that the <code>apt</code> tool and its associated APIs may be
-changed or superseded in future j2se releases.
-
-@since 1.5
-</body>
-</html>
--- a/src/share/classes/com/sun/tools/apt/comp/Apt.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/apt/comp/Apt.java	Mon Sep 07 22:42:05 2009 -0700
@@ -65,6 +65,7 @@
  *  risk.  This code and its internal interfaces are subject to change
  *  or deletion without notice.</b>
  */
+@SuppressWarnings("deprecation")
 public class Apt extends ListBuffer<Env<AttrContext>> {
     java.util.Set<String> genSourceFileNames = new java.util.LinkedHashSet<String>();
     public java.util.Set<String> getSourceFileNames() {
--- a/src/share/classes/com/sun/tools/apt/comp/BootstrapAPF.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/apt/comp/BootstrapAPF.java	Mon Sep 07 22:42:05 2009 -0700
@@ -29,6 +29,7 @@
 import com.sun.mirror.apt.*;
 import com.sun.mirror.declaration.AnnotationTypeDeclaration;
 
+@SuppressWarnings("deprecation")
 public class BootstrapAPF implements AnnotationProcessorFactory {
 
     static final Collection<String> supportedOptions =
--- a/src/share/classes/com/sun/tools/apt/comp/PrintAP.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/apt/comp/PrintAP.java	Mon Sep 07 22:42:05 2009 -0700
@@ -36,6 +36,7 @@
 /**
  * Class used to implement "-print" option.
  */
+@SuppressWarnings("deprecation")
 public class PrintAP implements AnnotationProcessor {
 
 
--- a/src/share/classes/com/sun/tools/apt/main/JavaCompiler.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/apt/main/JavaCompiler.java	Mon Sep 07 22:42:05 2009 -0700
@@ -50,6 +50,7 @@
  *  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 =
--- a/src/share/classes/com/sun/tools/apt/main/Main.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/apt/main/Main.java	Mon Sep 07 22:42:05 2009 -0700
@@ -64,6 +64,7 @@
  *  risk.  This code and its internal interfaces are subject to change
  *  or deletion without notice.</b>
  */
+@SuppressWarnings("deprecation")
 public class Main {
 
     /** For testing: enter any options you want to be set implicitly
@@ -780,7 +781,6 @@
         // prefixed to command line arguments.
         processArgs(forcedOpts);
 
-
         /*
          * A run of apt only gets passed the most recently generated
          * files; the initial run of apt gets passed the files from
@@ -792,6 +792,11 @@
             // assign args the result of parse to capture results of
             // '@file' expansion
             origFilenames = processArgs((args=CommandLine.parse(args)));
+
+            if (options.get("suppress-tool-api-removal-message") == null) {
+                Bark.printLines(out, getLocalizedString("misc.Deprecation"));
+            }
+
             if (origFilenames == null) {
                 return EXIT_CMDERR;
             } else if (origFilenames.size() == 0) {
--- a/src/share/classes/com/sun/tools/apt/mirror/AptEnv.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/apt/mirror/AptEnv.java	Mon Sep 07 22:42:05 2009 -0700
@@ -39,7 +39,7 @@
 /**
  * The environment for a run of apt.
  */
-
+@SuppressWarnings("deprecation")
 public class AptEnv {
 
     public Names names;                 // javac's name table
--- a/src/share/classes/com/sun/tools/apt/mirror/apt/AnnotationProcessorEnvironmentImpl.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/apt/mirror/apt/AnnotationProcessorEnvironmentImpl.java	Mon Sep 07 22:42:05 2009 -0700
@@ -47,6 +47,7 @@
 /*
  * Annotation Processor Environment implementation.
  */
+@SuppressWarnings("deprecation")
 public class AnnotationProcessorEnvironmentImpl implements AnnotationProcessorEnvironment {
 
     Collection<TypeDeclaration> spectypedecls;
--- a/src/share/classes/com/sun/tools/apt/mirror/apt/FilerImpl.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/apt/mirror/apt/FilerImpl.java	Mon Sep 07 22:42:05 2009 -0700
@@ -45,7 +45,7 @@
 /**
  * Implementation of Filer.
  */
-
+@SuppressWarnings("deprecation")
 public class FilerImpl implements Filer {
     /*
      * The Filer class must maintain a number of constraints.  First,
--- a/src/share/classes/com/sun/tools/apt/mirror/apt/MessagerImpl.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/apt/mirror/apt/MessagerImpl.java	Mon Sep 07 22:42:05 2009 -0700
@@ -38,7 +38,7 @@
 /**
  * Implementation of Messager.
  */
-
+@SuppressWarnings("deprecation")
 public class MessagerImpl implements Messager {
     private final Bark bark;
 
--- a/src/share/classes/com/sun/tools/apt/mirror/apt/RoundCompleteEventImpl.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/apt/mirror/apt/RoundCompleteEventImpl.java	Mon Sep 07 22:42:05 2009 -0700
@@ -29,6 +29,7 @@
 import com.sun.mirror.apt.RoundCompleteEvent;
 import com.sun.mirror.apt.RoundState;
 
+@SuppressWarnings("deprecation")
 public class RoundCompleteEventImpl extends RoundCompleteEvent {
     private static final long serialVersionUID = 7067621446720784300L;
 
--- a/src/share/classes/com/sun/tools/apt/mirror/apt/RoundStateImpl.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/apt/mirror/apt/RoundStateImpl.java	Mon Sep 07 22:42:05 2009 -0700
@@ -28,6 +28,7 @@
 import com.sun.mirror.apt.RoundState;
 import java.util.Map;
 
+@SuppressWarnings("deprecation")
 public class RoundStateImpl implements RoundState {
     private final boolean finalRound;
     private final boolean errorRaised;
--- a/src/share/classes/com/sun/tools/apt/mirror/declaration/AnnotationMirrorImpl.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/apt/mirror/declaration/AnnotationMirrorImpl.java	Mon Sep 07 22:42:05 2009 -0700
@@ -42,7 +42,7 @@
 /**
  * Implementation of AnnotationMirror
  */
-
+@SuppressWarnings("deprecation")
 public class AnnotationMirrorImpl implements AnnotationMirror {
 
     protected final AptEnv env;
--- a/src/share/classes/com/sun/tools/apt/mirror/declaration/AnnotationProxyMaker.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/apt/mirror/declaration/AnnotationProxyMaker.java	Mon Sep 07 22:42:05 2009 -0700
@@ -49,7 +49,7 @@
  * <p> The "dynamic proxy return form" of an attribute element value is
  * the form used by sun.reflect.annotation.AnnotationInvocationHandler.
  */
-
+@SuppressWarnings("deprecation")
 class AnnotationProxyMaker {
 
     private final AptEnv env;
--- a/src/share/classes/com/sun/tools/apt/mirror/declaration/AnnotationTypeDeclarationImpl.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/apt/mirror/declaration/AnnotationTypeDeclarationImpl.java	Mon Sep 07 22:42:05 2009 -0700
@@ -37,7 +37,7 @@
 /**
  * Implementation of AnnotationTypeDeclaration
  */
-
+@SuppressWarnings("deprecation")
 public class AnnotationTypeDeclarationImpl extends InterfaceDeclarationImpl
                                            implements AnnotationTypeDeclaration
 {
--- a/src/share/classes/com/sun/tools/apt/mirror/declaration/AnnotationTypeElementDeclarationImpl.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/apt/mirror/declaration/AnnotationTypeElementDeclarationImpl.java	Mon Sep 07 22:42:05 2009 -0700
@@ -35,7 +35,7 @@
 /**
  * Implementation of AnnotationTypeElementDeclaration
  */
-
+@SuppressWarnings("deprecation")
 public class AnnotationTypeElementDeclarationImpl extends MethodDeclarationImpl
                                   implements AnnotationTypeElementDeclaration {
 
--- a/src/share/classes/com/sun/tools/apt/mirror/declaration/AnnotationValueImpl.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/apt/mirror/declaration/AnnotationValueImpl.java	Mon Sep 07 22:42:05 2009 -0700
@@ -40,7 +40,7 @@
 /**
  * Implementation of AnnotationValue
  */
-
+@SuppressWarnings("deprecation")
 public class AnnotationValueImpl implements AnnotationValue {
 
     protected final AptEnv env;
--- a/src/share/classes/com/sun/tools/apt/mirror/declaration/ClassDeclarationImpl.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/apt/mirror/declaration/ClassDeclarationImpl.java	Mon Sep 07 22:42:05 2009 -0700
@@ -42,7 +42,7 @@
 /**
  * Implementation of ClassDeclaration
  */
-
+@SuppressWarnings("deprecation")
 public class ClassDeclarationImpl extends TypeDeclarationImpl
                                   implements ClassDeclaration {
 
--- a/src/share/classes/com/sun/tools/apt/mirror/declaration/Constants.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/apt/mirror/declaration/Constants.java	Mon Sep 07 22:42:05 2009 -0700
@@ -39,6 +39,7 @@
 /**
  * Utility class for operating on constant expressions.
  */
+@SuppressWarnings("deprecation")
 class Constants {
 
     /**
--- a/src/share/classes/com/sun/tools/apt/mirror/declaration/ConstructorDeclarationImpl.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/apt/mirror/declaration/ConstructorDeclarationImpl.java	Mon Sep 07 22:42:05 2009 -0700
@@ -39,7 +39,7 @@
 /**
  * Implementation of ConstructorDeclaration
  */
-
+@SuppressWarnings("deprecation")
 public class ConstructorDeclarationImpl extends ExecutableDeclarationImpl
                                         implements ConstructorDeclaration {
 
--- a/src/share/classes/com/sun/tools/apt/mirror/declaration/DeclarationImpl.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/apt/mirror/declaration/DeclarationImpl.java	Mon Sep 07 22:42:05 2009 -0700
@@ -52,7 +52,7 @@
 /**
  * Implementation of Declaration
  */
-
+@SuppressWarnings("deprecation")
 public abstract class DeclarationImpl implements Declaration {
 
     protected final AptEnv env;
--- a/src/share/classes/com/sun/tools/apt/mirror/declaration/DeclarationMaker.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/apt/mirror/declaration/DeclarationMaker.java	Mon Sep 07 22:42:05 2009 -0700
@@ -40,7 +40,7 @@
 /**
  * Utilities for constructing and caching declarations.
  */
-
+@SuppressWarnings("deprecation")
 public class DeclarationMaker {
 
     private AptEnv env;
--- a/src/share/classes/com/sun/tools/apt/mirror/declaration/EnumConstantDeclarationImpl.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/apt/mirror/declaration/EnumConstantDeclarationImpl.java	Mon Sep 07 22:42:05 2009 -0700
@@ -35,7 +35,7 @@
 /**
  * Implementation of EnumConstantDeclaration
  */
-
+@SuppressWarnings("deprecation")
 public class EnumConstantDeclarationImpl extends FieldDeclarationImpl
                                          implements EnumConstantDeclaration {
 
--- a/src/share/classes/com/sun/tools/apt/mirror/declaration/EnumDeclarationImpl.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/apt/mirror/declaration/EnumDeclarationImpl.java	Mon Sep 07 22:42:05 2009 -0700
@@ -37,7 +37,7 @@
 /**
  * Implementation of EnumDeclaration
  */
-
+@SuppressWarnings("deprecation")
 public class EnumDeclarationImpl extends ClassDeclarationImpl
                                  implements EnumDeclaration {
 
--- a/src/share/classes/com/sun/tools/apt/mirror/declaration/ExecutableDeclarationImpl.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/apt/mirror/declaration/ExecutableDeclarationImpl.java	Mon Sep 07 22:42:05 2009 -0700
@@ -39,7 +39,7 @@
 /**
  * Implementation of ExecutableDeclaration
  */
-
+@SuppressWarnings("deprecation")
 public abstract class ExecutableDeclarationImpl extends MemberDeclarationImpl
                                              implements ExecutableDeclaration {
     public MethodSymbol sym;
--- a/src/share/classes/com/sun/tools/apt/mirror/declaration/FieldDeclarationImpl.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/apt/mirror/declaration/FieldDeclarationImpl.java	Mon Sep 07 22:42:05 2009 -0700
@@ -40,7 +40,7 @@
 /**
  * Implementation of FieldDeclaration
  */
-
+@SuppressWarnings("deprecation")
 class FieldDeclarationImpl extends MemberDeclarationImpl
                                   implements FieldDeclaration {
 
--- a/src/share/classes/com/sun/tools/apt/mirror/declaration/InterfaceDeclarationImpl.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/apt/mirror/declaration/InterfaceDeclarationImpl.java	Mon Sep 07 22:42:05 2009 -0700
@@ -35,7 +35,7 @@
 /**
  * Implementation of InterfaceDeclaration
  */
-
+@SuppressWarnings("deprecation")
 public class InterfaceDeclarationImpl extends TypeDeclarationImpl
                                       implements InterfaceDeclaration {
 
--- a/src/share/classes/com/sun/tools/apt/mirror/declaration/MemberDeclarationImpl.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/apt/mirror/declaration/MemberDeclarationImpl.java	Mon Sep 07 22:42:05 2009 -0700
@@ -40,7 +40,7 @@
 /**
  * Implementation of MemberDeclaration
  */
-
+@SuppressWarnings("deprecation")
 public abstract class MemberDeclarationImpl extends DeclarationImpl
                                             implements MemberDeclaration {
 
--- a/src/share/classes/com/sun/tools/apt/mirror/declaration/MethodDeclarationImpl.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/apt/mirror/declaration/MethodDeclarationImpl.java	Mon Sep 07 22:42:05 2009 -0700
@@ -36,7 +36,7 @@
 /**
  * Implementation of MethodDeclaration
  */
-
+@SuppressWarnings("deprecation")
 public class MethodDeclarationImpl extends ExecutableDeclarationImpl
                                    implements MethodDeclaration {
 
--- a/src/share/classes/com/sun/tools/apt/mirror/declaration/PackageDeclarationImpl.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/apt/mirror/declaration/PackageDeclarationImpl.java	Mon Sep 07 22:42:05 2009 -0700
@@ -39,7 +39,7 @@
 /**
  * Implementation of PackageDeclaration.
  */
-
+@SuppressWarnings("deprecation")
 public class PackageDeclarationImpl extends DeclarationImpl
                                     implements PackageDeclaration {
 
--- a/src/share/classes/com/sun/tools/apt/mirror/declaration/ParameterDeclarationImpl.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/apt/mirror/declaration/ParameterDeclarationImpl.java	Mon Sep 07 22:42:05 2009 -0700
@@ -39,7 +39,7 @@
 /**
  * Implementation of ParameterDeclaration
  */
-
+@SuppressWarnings("deprecation")
 public class ParameterDeclarationImpl extends DeclarationImpl
                                       implements ParameterDeclaration
 {
--- a/src/share/classes/com/sun/tools/apt/mirror/declaration/TypeDeclarationImpl.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/apt/mirror/declaration/TypeDeclarationImpl.java	Mon Sep 07 22:42:05 2009 -0700
@@ -40,7 +40,7 @@
 /**
  * Implementation of TypeDeclaration
  */
-
+@SuppressWarnings("deprecation")
 public class TypeDeclarationImpl extends MemberDeclarationImpl
                                  implements TypeDeclaration {
 
--- a/src/share/classes/com/sun/tools/apt/mirror/declaration/TypeParameterDeclarationImpl.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/apt/mirror/declaration/TypeParameterDeclarationImpl.java	Mon Sep 07 22:42:05 2009 -0700
@@ -40,7 +40,7 @@
 /**
  * Implementation of TypeParameterDeclaration
  */
-
+@SuppressWarnings("deprecation")
 public class TypeParameterDeclarationImpl extends DeclarationImpl
                                           implements TypeParameterDeclaration
 {
--- a/src/share/classes/com/sun/tools/apt/mirror/type/AnnotationTypeImpl.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/apt/mirror/type/AnnotationTypeImpl.java	Mon Sep 07 22:42:05 2009 -0700
@@ -36,7 +36,7 @@
 /**
  * Implementation of AnnotationType
  */
-
+@SuppressWarnings("deprecation")
 public class AnnotationTypeImpl extends InterfaceTypeImpl
                                 implements AnnotationType {
 
--- a/src/share/classes/com/sun/tools/apt/mirror/type/ArrayTypeImpl.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/apt/mirror/type/ArrayTypeImpl.java	Mon Sep 07 22:42:05 2009 -0700
@@ -35,7 +35,7 @@
 /**
  * Implementation of ArrayType
  */
-
+@SuppressWarnings("deprecation")
 public class ArrayTypeImpl extends TypeMirrorImpl implements ArrayType {
 
     protected Type.ArrayType type;
--- a/src/share/classes/com/sun/tools/apt/mirror/type/ClassTypeImpl.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/apt/mirror/type/ClassTypeImpl.java	Mon Sep 07 22:42:05 2009 -0700
@@ -36,7 +36,7 @@
 /**
  * Implementation of ClassType
  */
-
+@SuppressWarnings("deprecation")
 public class ClassTypeImpl extends DeclaredTypeImpl implements ClassType {
 
     ClassTypeImpl(AptEnv env, Type.ClassType type) {
--- a/src/share/classes/com/sun/tools/apt/mirror/type/DeclaredTypeImpl.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/apt/mirror/type/DeclaredTypeImpl.java	Mon Sep 07 22:42:05 2009 -0700
@@ -38,7 +38,7 @@
 /**
  * Implementation of DeclaredType
  */
-
+@SuppressWarnings("deprecation")
 abstract class DeclaredTypeImpl extends TypeMirrorImpl
                                 implements DeclaredType {
 
--- a/src/share/classes/com/sun/tools/apt/mirror/type/EnumTypeImpl.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/apt/mirror/type/EnumTypeImpl.java	Mon Sep 07 22:42:05 2009 -0700
@@ -36,7 +36,7 @@
 /**
  * Implementation of EnumType
  */
-
+@SuppressWarnings("deprecation")
 public class EnumTypeImpl extends ClassTypeImpl implements EnumType {
 
     EnumTypeImpl(AptEnv env, Type.ClassType type) {
--- a/src/share/classes/com/sun/tools/apt/mirror/type/InterfaceTypeImpl.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/apt/mirror/type/InterfaceTypeImpl.java	Mon Sep 07 22:42:05 2009 -0700
@@ -36,7 +36,7 @@
 /**
  * Implementation of InterfaceType
  */
-
+@SuppressWarnings("deprecation")
 public class InterfaceTypeImpl extends DeclaredTypeImpl
                                implements InterfaceType {
 
--- a/src/share/classes/com/sun/tools/apt/mirror/type/PrimitiveTypeImpl.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/apt/mirror/type/PrimitiveTypeImpl.java	Mon Sep 07 22:42:05 2009 -0700
@@ -38,7 +38,7 @@
 /**
  * Implementation of PrimitiveType.
  */
-
+@SuppressWarnings("deprecation")
 class PrimitiveTypeImpl extends TypeMirrorImpl implements PrimitiveType {
 
     private final Kind kind;    // the kind of primitive
--- a/src/share/classes/com/sun/tools/apt/mirror/type/TypeMaker.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/apt/mirror/type/TypeMaker.java	Mon Sep 07 22:42:05 2009 -0700
@@ -41,7 +41,7 @@
 /**
  * Utilities for constructing type objects.
  */
-
+@SuppressWarnings("deprecation")
 public class TypeMaker {
 
     private final AptEnv env;
--- a/src/share/classes/com/sun/tools/apt/mirror/type/TypeMirrorImpl.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/apt/mirror/type/TypeMirrorImpl.java	Mon Sep 07 22:42:05 2009 -0700
@@ -35,7 +35,7 @@
 /**
  * Implementation of TypeMirror
  */
-
+@SuppressWarnings("deprecation")
 public abstract class TypeMirrorImpl implements TypeMirror {
 
     protected final AptEnv env;
--- a/src/share/classes/com/sun/tools/apt/mirror/type/TypeVariableImpl.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/apt/mirror/type/TypeVariableImpl.java	Mon Sep 07 22:42:05 2009 -0700
@@ -40,7 +40,7 @@
 /**
  * Implementation of TypeVariable
  */
-
+@SuppressWarnings("deprecation")
 public class TypeVariableImpl extends TypeMirrorImpl implements TypeVariable {
 
     protected Type.TypeVar type;
--- a/src/share/classes/com/sun/tools/apt/mirror/type/VoidTypeImpl.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/apt/mirror/type/VoidTypeImpl.java	Mon Sep 07 22:42:05 2009 -0700
@@ -34,7 +34,7 @@
 /**
  * Implementation of VoidType.
  */
-
+@SuppressWarnings("deprecation")
 class VoidTypeImpl extends TypeMirrorImpl implements VoidType {
 
     VoidTypeImpl(AptEnv env) {
--- a/src/share/classes/com/sun/tools/apt/mirror/type/WildcardTypeImpl.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/apt/mirror/type/WildcardTypeImpl.java	Mon Sep 07 22:42:05 2009 -0700
@@ -41,7 +41,7 @@
 /**
  * Implementation of WildcardType
  */
-
+@SuppressWarnings("deprecation")
 public class WildcardTypeImpl extends TypeMirrorImpl implements WildcardType {
 
     protected Type.WildcardType type;
--- a/src/share/classes/com/sun/tools/apt/mirror/util/DeclarationsImpl.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/apt/mirror/util/DeclarationsImpl.java	Mon Sep 07 22:42:05 2009 -0700
@@ -42,7 +42,7 @@
 /**
  * Implementation of Declarations utility methods for annotation processors
  */
-
+@SuppressWarnings("deprecation")
 public class DeclarationsImpl implements Declarations {
 
     private final AptEnv env;
--- a/src/share/classes/com/sun/tools/apt/mirror/util/SourcePositionImpl.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/apt/mirror/util/SourcePositionImpl.java	Mon Sep 07 22:42:05 2009 -0700
@@ -36,7 +36,7 @@
 /**
  * Implementation of SourcePosition
  */
-
+@SuppressWarnings("deprecation")
 public class SourcePositionImpl implements SourcePosition {
 
     private JavaFileObject sourcefile;
--- a/src/share/classes/com/sun/tools/apt/mirror/util/TypesImpl.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/apt/mirror/util/TypesImpl.java	Mon Sep 07 22:42:05 2009 -0700
@@ -44,7 +44,7 @@
 /**
  * Implementation of Types utility methods for annotation processors
  */
-
+@SuppressWarnings("deprecation")
 public class TypesImpl implements Types {
 
     private final AptEnv env;
--- a/src/share/classes/com/sun/tools/apt/resources/apt.properties	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/apt/resources/apt.properties	Mon Sep 07 22:42:05 2009 -0700
@@ -111,6 +111,14 @@
 ## miscellaneous strings
 ##
 
+apt.misc.Deprecation=\
+    \nwarning:\u0020The apt tool and its associated API are planned to be\n\
+    removed in the next major JDK release.  These features have been\n\
+    superseded by javac and the standardized annotation processing API,\n\
+    javax.annotation.processing and javax.lang.model.  Users are\n\
+    recommended to migrate to the annotation processing features of\n\
+    javac; see the javac man page for more information.\n
+
 apt.misc.Problem=\
     Problem encountered during annotation processing; \nsee stacktrace below for more information.
 
--- a/src/share/classes/com/sun/tools/classfile/AccessFlags.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/classfile/AccessFlags.java	Mon Sep 07 22:42:05 2009 -0700
@@ -76,6 +76,10 @@
         return (flags & mask) != 0;
     }
 
+    public int byteLength() {
+        return 2;
+    }
+
     private static final int[] classModifiers = {
         ACC_PUBLIC, ACC_FINAL, ACC_ABSTRACT, ACC_MODULE
     };
--- a/src/share/classes/com/sun/tools/classfile/Attribute.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/classfile/Attribute.java	Mon Sep 07 22:42:05 2009 -0700
@@ -166,6 +166,10 @@
 
     public abstract <R,D> R accept(Attribute.Visitor<R,D> visitor, D data);
 
+    public int byteLength() {
+        return 6 + attribute_length;
+    }
+
     public final int attribute_name_index;
     public final int attribute_length;
 
--- a/src/share/classes/com/sun/tools/classfile/Attributes.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/classfile/Attributes.java	Mon Sep 07 22:42:05 2009 -0700
@@ -95,6 +95,13 @@
         return attrs.length;
     }
 
+    public int byteLength() {
+        int length = 2;
+        for (Attribute a: attrs)
+            length += a.byteLength();
+        return length;
+    }
+
     public final Attribute[] attrs;
     public final Map<String, Attribute> map;
 }
--- a/src/share/classes/com/sun/tools/classfile/CharacterRangeTable_attribute.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/classfile/CharacterRangeTable_attribute.java	Mon Sep 07 22:42:05 2009 -0700
@@ -58,7 +58,7 @@
     }
 
     public CharacterRangeTable_attribute(int name_index, Entry[] character_range_table) {
-        super(name_index, character_range_table.length * Entry.length());
+        super(name_index, 2 + character_range_table.length * Entry.length());
         this.character_range_table = character_range_table;
     }
 
--- a/src/share/classes/com/sun/tools/classfile/ClassFile.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/classfile/ClassFile.java	Mon Sep 07 22:42:05 2009 -0700
@@ -139,6 +139,38 @@
         return access_flags.is(ACC_INTERFACE);
     }
 
+    public int byteLength() {
+        return  4 +     // magic
+                2 +     // minor
+                2 +     // major
+                constant_pool.byteLength() +
+                2 +     // access flags
+                2 +     // this_class
+                2 +     // super_class
+                byteLength(interfaces) +
+                byteLength(fields) +
+                byteLength(methods) +
+                attributes.byteLength();
+    }
+
+    private int byteLength(int[] indices) {
+        return 2 + 2 * indices.length;
+    }
+
+    private int byteLength(Field[] fields) {
+        int length = 2;
+        for (Field f: fields)
+            length += f.byteLength();
+        return length;
+    }
+
+    private int byteLength(Method[] methods) {
+        int length = 2;
+        for (Method m: methods)
+            length += m.byteLength();
+        return length;
+    }
+
     public final int magic;
     public final int minor_version;
     public final int major_version;
--- a/src/share/classes/com/sun/tools/classfile/ClassWriter.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/classfile/ClassWriter.java	Mon Sep 07 22:42:05 2009 -0700
@@ -435,7 +435,7 @@
         }
 
         public Void visitLocalVariableTypeTable(LocalVariableTypeTable_attribute attr, ClassOutputStream out) {
-            out.writeByte(attr.local_variable_table.length);
+            out.writeShort(attr.local_variable_table.length);
             for (LocalVariableTypeTable_attribute.Entry e: attr.local_variable_table)
                 writeLocalVariableTypeTableEntry(e, out);
             return null;
--- a/src/share/classes/com/sun/tools/classfile/ConstantPool.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/classfile/ConstantPool.java	Mon Sep 07 22:42:05 2009 -0700
@@ -25,7 +25,9 @@
 
 package com.sun.tools.classfile;
 
+import java.io.DataOutputStream;
 import java.io.IOException;
+import java.io.OutputStream;
 import java.util.Iterator;
 
 /**
@@ -179,6 +181,16 @@
         return pool.length;
     }
 
+    public int byteLength() {
+        int length = 2;
+        for (int i = 1; i < size(); ) {
+            CPInfo cpInfo = pool[i];
+            length += cpInfo.byteLength();
+            i += cpInfo.size();
+        }
+        return length;
+    }
+
     public CPInfo get(int index) throws InvalidIndex {
         if (index <= 0 || index >= pool.length)
             throw new InvalidIndex(index);
@@ -291,6 +303,8 @@
             return 1;
         }
 
+        public abstract int byteLength();
+
         public abstract <R,D> R accept(Visitor<R,D> visitor, D data);
 
         protected final ConstantPool cp;
@@ -315,6 +329,10 @@
             return tag;
         }
 
+        public int byteLength() {
+            return 5;
+        }
+
         public CONSTANT_Class_info getClassInfo() throws ConstantPoolException {
             return cp.getClassInfo(class_index);
         }
@@ -347,6 +365,10 @@
             return CONSTANT_Class;
         }
 
+        public int  byteLength() {
+            return 3;
+        }
+
         public String getName() throws ConstantPoolException {
             return cp.getUTF8Value(name_index);
         }
@@ -390,6 +412,10 @@
             return CONSTANT_Double;
         }
 
+        public int  byteLength() {
+            return 9;
+        }
+
         @Override
         public int size() {
             return 2;
@@ -439,6 +465,10 @@
             return CONSTANT_Float;
         }
 
+        public int byteLength() {
+            return 5;
+        }
+
         @Override
         public String toString() {
             return "CONSTANT_Float_info[value: " + value + "]";
@@ -464,6 +494,10 @@
             return CONSTANT_Integer;
         }
 
+        public int byteLength() {
+            return 5;
+        }
+
         @Override
         public String toString() {
             return "CONSTANT_Integer_info[value: " + value + "]";
@@ -513,6 +547,10 @@
             return 2;
         }
 
+        public int byteLength() {
+            return 9;
+        }
+
         @Override
         public String toString() {
             return "CONSTANT_Long_info[value: " + value + "]";
@@ -561,6 +599,10 @@
             return CONSTANT_NameAndType;
         }
 
+        public int byteLength() {
+            return 5;
+        }
+
         public String getName() throws ConstantPoolException {
             return cp.getUTF8Value(name_index);
         }
@@ -597,6 +639,10 @@
             return CONSTANT_String;
         }
 
+        public int byteLength() {
+            return 3;
+        }
+
         public String getString() throws ConstantPoolException {
             return cp.getUTF8Value(string_index);
         }
@@ -626,6 +672,20 @@
             return CONSTANT_Utf8;
         }
 
+        public int byteLength() {
+            class SizeOutputStream extends OutputStream {
+                @Override
+                public void write(int b) throws IOException {
+                    size++;
+                }
+                int size;
+            }
+            SizeOutputStream sizeOut = new SizeOutputStream();
+            DataOutputStream out = new DataOutputStream(sizeOut);
+            try { out.writeUTF(value); } catch (IOException ignore) { }
+            return 1 + sizeOut.size;
+        }
+
         @Override
         public String toString() {
             if (value.length() < 32 && isPrintableAscii(value))
--- a/src/share/classes/com/sun/tools/classfile/ExtendedAnnotation.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/classfile/ExtendedAnnotation.java	Mon Sep 07 22:42:05 2009 -0700
@@ -260,9 +260,6 @@
         // For generic/array types.
         public List<Integer> location = new ArrayList<Integer>();
 
-        // Tree position.
-        public int pos = -1;
-
         // For typecasts, type tests, new (and locals, as start_pc).
         public int offset = -1;
 
@@ -357,6 +354,7 @@
                 sb.append(type_index);
                 break;
             case CLASS_LITERAL:
+            case CLASS_LITERAL_GENERIC_OR_ARRAY:
                 sb.append(", offset = ");
                 sb.append(offset);
                 break;
@@ -390,9 +388,6 @@
                 sb.append(")");
             }
 
-            sb.append(", pos = ");
-            sb.append(pos);
-
             sb.append(']');
             return sb.toString();
         }
--- a/src/share/classes/com/sun/tools/classfile/Field.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/classfile/Field.java	Mon Sep 07 22:42:05 2009 -0700
@@ -50,6 +50,10 @@
         this.attributes = attributes;
     }
 
+    public int byteLength() {
+        return 6 + attributes.byteLength();
+    }
+
     public String getName(ConstantPool constant_pool) throws ConstantPoolException {
         return constant_pool.getUTF8Value(name_index);
     }
--- a/src/share/classes/com/sun/tools/classfile/LineNumberTable_attribute.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/classfile/LineNumberTable_attribute.java	Mon Sep 07 22:42:05 2009 -0700
@@ -50,7 +50,7 @@
     }
 
     public LineNumberTable_attribute(int name_index, Entry[] line_number_table) {
-        super(name_index, line_number_table.length * Entry.length());
+        super(name_index, 2 + line_number_table.length * Entry.length());
         this.line_number_table_length = line_number_table.length;
         this.line_number_table = line_number_table;
     }
--- a/src/share/classes/com/sun/tools/classfile/LocalVariableTable_attribute.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/classfile/LocalVariableTable_attribute.java	Mon Sep 07 22:42:05 2009 -0700
@@ -50,7 +50,7 @@
     }
 
     public LocalVariableTable_attribute(int name_index, Entry[] local_variable_table) {
-        super(name_index, local_variable_table.length * Entry.length());
+        super(name_index, 2 + local_variable_table.length * Entry.length());
         this.local_variable_table_length = local_variable_table.length;
         this.local_variable_table = local_variable_table;
     }
--- a/src/share/classes/com/sun/tools/classfile/LocalVariableTypeTable_attribute.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/classfile/LocalVariableTypeTable_attribute.java	Mon Sep 07 22:42:05 2009 -0700
@@ -50,7 +50,7 @@
     }
 
     public LocalVariableTypeTable_attribute(int name_index, Entry[] local_variable_table) {
-        super(name_index, local_variable_table.length * Entry.length());
+        super(name_index, 2 + local_variable_table.length * Entry.length());
         this.local_variable_table_length = local_variable_table.length;
         this.local_variable_table = local_variable_table;
     }
--- a/src/share/classes/com/sun/tools/classfile/Method.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/classfile/Method.java	Mon Sep 07 22:42:05 2009 -0700
@@ -50,6 +50,10 @@
         this.attributes = attributes;
     }
 
+    public int byteLength() {
+        return 6 + attributes.byteLength();
+    }
+
     public String getName(ConstantPool constant_pool) throws ConstantPoolException {
         return constant_pool.getUTF8Value(name_index);
     }
--- a/src/share/classes/com/sun/tools/classfile/ModuleExportTable_attribute.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/classfile/ModuleExportTable_attribute.java	Mon Sep 07 22:42:05 2009 -0700
@@ -50,7 +50,7 @@
     }
 
     public ModuleExportTable_attribute(int name_index, int[] export_type_table) {
-        super(name_index, 2 * export_type_table.length);
+        super(name_index, 2 + 2 * export_type_table.length);
         this.export_type_table = export_type_table;
     }
 
--- a/src/share/classes/com/sun/tools/classfile/ModuleMemberTable_attribute.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/classfile/ModuleMemberTable_attribute.java	Mon Sep 07 22:42:05 2009 -0700
@@ -49,7 +49,7 @@
     }
 
     public ModuleMemberTable_attribute(int name_index, int[] package_member_table) {
-        super(name_index, 2 * package_member_table.length);
+        super(name_index, 2 + 2 * package_member_table.length);
         this.package_member_table = package_member_table;
     }
 
--- a/src/share/classes/com/sun/tools/javac/api/DiagnosticFormatter.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/javac/api/DiagnosticFormatter.java	Mon Sep 07 22:42:05 2009 -0700
@@ -32,6 +32,11 @@
 /**
  * Provides simple functionalities for javac diagnostic formatting.
  * @param <D> type of diagnostic handled by this formatter
+ *
+ * <p><b>This is NOT part of any API supported by Sun Microsystems.
+ * 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>
  */
 public interface DiagnosticFormatter<D extends Diagnostic<?>> {
 
--- a/src/share/classes/com/sun/tools/javac/api/Formattable.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/javac/api/Formattable.java	Mon Sep 07 22:42:05 2009 -0700
@@ -31,6 +31,11 @@
  * This interface must be implemented by any javac class that has non-trivial
  * formatting needs (e.g. where toString() does not apply because of localization).
  *
+ * <p><b>This is NOT part of any API supported by Sun Microsystems.
+ * 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>
+ *
  * @author Maurizio Cimadamore
  */
 public interface Formattable {
--- a/src/share/classes/com/sun/tools/javac/api/Messages.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/javac/api/Messages.java	Mon Sep 07 22:42:05 2009 -0700
@@ -32,6 +32,11 @@
  * This interface defines the minimum requirements in order to provide support
  * for localized formatted strings.
  *
+ * <p><b>This is NOT part of any API supported by Sun Microsystems.
+ * 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>
+ *
  * @author Maurizio Cimadamore
  */
 public interface Messages {
--- a/src/share/classes/com/sun/tools/javac/code/BoundKind.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/javac/code/BoundKind.java	Mon Sep 07 22:42:05 2009 -0700
@@ -25,7 +25,13 @@
 
 package com.sun.tools.javac.code;
 
-
+/**
+ *
+ * <p><b>This is NOT part of any API supported by Sun Microsystems.
+ * 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>
+ */
 public enum BoundKind {
     EXTENDS("? extends "),
     SUPER("? super "),
--- a/src/share/classes/com/sun/tools/javac/code/Lint.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/javac/code/Lint.java	Mon Sep 07 22:42:05 2009 -0700
@@ -193,10 +193,20 @@
         /**
          * Warn about unchecked operations on raw types.
          */
-        RAW("rawtypes");
+        RAW("rawtypes"),
+
+        /**
+         * Warn about Sun proprietary API that may be removed in a future release.
+         */
+        SUNAPI("sunapi", true);
 
         LintCategory(String option) {
+            this(option, false);
+        }
+
+        LintCategory(String option, boolean hidden) {
             this.option = option;
+            this.hidden = hidden;
             map.put(option, this);
         }
 
@@ -205,6 +215,7 @@
         }
 
         public final String option;
+        public final boolean hidden;
     };
 
     /**
--- a/src/share/classes/com/sun/tools/javac/code/Printer.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/javac/code/Printer.java	Mon Sep 07 22:42:05 2009 -0700
@@ -40,6 +40,11 @@
 /**
  * A combined type/symbol visitor for generating non-trivial localized string
  * representation of types and symbols.
+ *
+ * <p><b>This is NOT part of any API supported by Sun Microsystems.
+ * 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>
  */
 public abstract class Printer implements Type.Visitor<String, Locale>, Symbol.Visitor<String, Locale> {
 
--- a/src/share/classes/com/sun/tools/javac/code/Symbol.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/javac/code/Symbol.java	Mon Sep 07 22:42:05 2009 -0700
@@ -1197,21 +1197,9 @@
          *  as possible implementations.
          */
         public MethodSymbol implementation(TypeSymbol origin, Types types, boolean checkResult) {
-            for (Type t = origin.type; t.tag == CLASS || t.tag == TYPEVAR; t = types.supertype(t)) {
-                while (t.tag == TYPEVAR)
-                    t = t.getUpperBound();
-                TypeSymbol c = t.tsym;
-                for (Scope.Entry e = c.members().lookup(name);
-                     e.scope != null;
-                     e = e.next()) {
-                    if (e.sym.kind == MTH) {
-                        MethodSymbol m = (MethodSymbol) e.sym;
-                        if (m.overrides(this, origin, types, checkResult) &&
-                            (m.flags() & SYNTHETIC) == 0)
-                            return m;
-                    }
-                }
-            }
+            MethodSymbol res = types.implementation(this, origin, types, checkResult);
+            if (res != null)
+                return res;
             // if origin is derived from a raw type, we might have missed
             // an implementation because we do not know enough about instantiations.
             // in this case continue with the supertype as origin.
--- a/src/share/classes/com/sun/tools/javac/code/Symtab.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/javac/code/Symtab.java	Mon Sep 07 22:42:05 2009 -0700
@@ -193,7 +193,7 @@
 
     public void initType(Type type, String name, String bname) {
         initType(type, name);
-        boxedName[type.tag] = names.fromString("java.lang." + bname);
+            boxedName[type.tag] = names.fromString("java.lang." + bname);
     }
 
     /** The class symbol that owns all predefined symbols.
@@ -467,6 +467,7 @@
         synthesizeMHTypeIfMissing(invokeDynamicType);
         synthesizeBoxTypeIfMissing(doubleType);
         synthesizeBoxTypeIfMissing(floatType);
+        synthesizeBoxTypeIfMissing(voidType);
 
         // Enter a synthetic class that is used to mark Sun
         // proprietary classes in ct.sym.  This class does not have a
--- a/src/share/classes/com/sun/tools/javac/code/TypeAnnotationPosition.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/javac/code/TypeAnnotationPosition.java	Mon Sep 07 22:42:05 2009 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2003-2008 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2003-2009 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
--- a/src/share/classes/com/sun/tools/javac/code/Types.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/javac/code/Types.java	Mon Sep 07 22:42:05 2009 -0700
@@ -25,10 +25,9 @@
 
 package com.sun.tools.javac.code;
 
+import java.lang.ref.SoftReference;
 import java.util.*;
 
-import com.sun.tools.javac.api.Messages;
-
 import com.sun.tools.javac.util.*;
 import com.sun.tools.javac.util.List;
 
@@ -1248,14 +1247,18 @@
 
             @Override
             public Boolean visitClassType(ClassType t, Void ignored) {
-                if (!t.isParameterized())
+                if (t.isCompound())
+                    return false;
+                else {
+                    if (!t.isParameterized())
+                        return true;
+
+                    for (Type param : t.allparams()) {
+                        if (!param.isUnbound())
+                            return false;
+                    }
                     return true;
-
-                for (Type param : t.allparams()) {
-                    if (!param.isUnbound())
-                        return false;
                 }
-                return true;
             }
 
             @Override
@@ -1442,7 +1445,7 @@
         return (sym.flags() & STATIC) != 0
             ? sym.type
             : memberType.visit(t, sym);
-    }
+        }
     // where
         private SimpleVisitor<Type,Symbol> memberType = new SimpleVisitor<Type,Symbol>() {
 
@@ -1552,7 +1555,7 @@
             return t; /* fast special case */
         else
             return erasure.visit(t, recurse);
-    }
+        }
     // where
         private SimpleVisitor<Type, Boolean> erasure = new SimpleVisitor<Type, Boolean>() {
             public Type visitType(Type t, Boolean recurse) {
@@ -1946,6 +1949,45 @@
             hasSameArgs(t, erasure(s)) || hasSameArgs(erasure(t), s);
     }
 
+    private WeakHashMap<MethodSymbol, SoftReference<Map<TypeSymbol, MethodSymbol>>> implCache_check =
+            new WeakHashMap<MethodSymbol, SoftReference<Map<TypeSymbol, MethodSymbol>>>();
+
+    private WeakHashMap<MethodSymbol, SoftReference<Map<TypeSymbol, MethodSymbol>>> implCache_nocheck =
+            new WeakHashMap<MethodSymbol, SoftReference<Map<TypeSymbol, MethodSymbol>>>();
+
+    public MethodSymbol implementation(MethodSymbol ms, TypeSymbol origin, Types types, boolean checkResult) {
+        Map<MethodSymbol, SoftReference<Map<TypeSymbol, MethodSymbol>>> implCache = checkResult ?
+            implCache_check : implCache_nocheck;
+        SoftReference<Map<TypeSymbol, MethodSymbol>> ref_cache = implCache.get(ms);
+        Map<TypeSymbol, MethodSymbol> cache = ref_cache != null ? ref_cache.get() : null;
+        if (cache == null) {
+            cache = new HashMap<TypeSymbol, MethodSymbol>();
+            implCache.put(ms, new SoftReference<Map<TypeSymbol, MethodSymbol>>(cache));
+        }
+        MethodSymbol impl = cache.get(origin);
+        if (impl == null) {
+            for (Type t = origin.type; t.tag == CLASS || t.tag == TYPEVAR; t = types.supertype(t)) {
+                while (t.tag == TYPEVAR)
+                    t = t.getUpperBound();
+                TypeSymbol c = t.tsym;
+                for (Scope.Entry e = c.members().lookup(ms.name);
+                     e.scope != null;
+                     e = e.next()) {
+                    if (e.sym.kind == Kinds.MTH) {
+                        MethodSymbol m = (MethodSymbol) e.sym;
+                        if (m.overrides(ms, origin, types, checkResult) &&
+                            (m.flags() & SYNTHETIC) == 0) {
+                            impl = m;
+                            cache.put(origin, m);
+                            return impl;
+                        }
+                    }
+                }
+            }
+        }
+        return impl;
+    }
+
     /**
      * Does t have the same arguments as s?  It is assumed that both
      * types are (possibly polymorphic) method types.  Monomorphic
--- a/src/share/classes/com/sun/tools/javac/comp/Attr.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/javac/comp/Attr.java	Mon Sep 07 22:42:05 2009 -0700
@@ -119,6 +119,7 @@
                  options.get("-relax") != null);
         useBeforeDeclarationWarning = options.get("useBeforeDeclarationWarning") != null;
         allowInvokedynamic = options.get("invokedynamic") != null;
+        enableSunApiLintControl = options.get("enableSunApiLintControl") != null;
     }
 
     /** Switch: relax some constraints for retrofit mode.
@@ -160,6 +161,12 @@
      */
     boolean useBeforeDeclarationWarning;
 
+    /**
+     * Switch: allow lint infrastructure to control Sun proprietary
+     * API warnings.
+     */
+    boolean enableSunApiLintControl;
+
     /** Check kind and type of given tree against protokind and prototype.
      *  If check succeeds, store type in tree and return it.
      *  If check fails, store errType in tree and return it.
@@ -1239,7 +1246,10 @@
                 }
 
                 if (site.tag == CLASS) {
-                    if (site.getEnclosingType().tag == CLASS) {
+                    Type encl = site.getEnclosingType();
+                    while (encl != null && encl.tag == TYPEVAR)
+                        encl = encl.getUpperBound();
+                    if (encl.tag == CLASS) {
                         // we are calling a nested class
 
                         if (tree.meth.getTag() == JCTree.SELECT) {
@@ -1251,7 +1261,7 @@
                             // to the outer instance type of the class.
                             chk.checkRefType(qualifier.pos(),
                                              attribExpr(qualifier, localEnv,
-                                                        site.getEnclosingType()));
+                                                        encl));
                         } else if (methName == names._super) {
                             // qualifier omitted; check for existence
                             // of an appropriate implicit qualifier.
@@ -1554,13 +1564,18 @@
                     typeargtypes, true, tree.varargsElement != null);
                 assert sym.kind < AMBIGUOUS || tree.constructor.type.isErroneous();
                 tree.constructor = sym;
-                tree.constructorType = checkMethod(clazztype,
-                                            tree.constructor,
-                                            localEnv,
-                                            tree.args,
-                                            argtypes,
-                                            typeargtypes,
-                                            localEnv.info.varArgs);
+                if (tree.constructor.kind > ERRONEOUS) {
+                    tree.constructorType =  syms.errType;
+                }
+                else {
+                    tree.constructorType = checkMethod(clazztype,
+                            tree.constructor,
+                            localEnv,
+                            tree.args,
+                            argtypes,
+                            typeargtypes,
+                            localEnv.info.varArgs);
+                }
             }
 
             if (tree.constructor != null && tree.constructor.kind == MTH)
@@ -2037,7 +2052,7 @@
                 Symbol sym = (site.getUpperBound() != null)
                     ? selectSym(tree, capture(site.getUpperBound()), env, pt, pkind)
                     : null;
-                if (sym == null || isType(sym)) {
+                if (sym == null) {
                     log.error(pos, "type.var.cant.be.deref");
                     return syms.errSymbol;
                 } else {
@@ -2207,8 +2222,12 @@
                 sym.outermostClass() != env.info.scope.owner.outermostClass())
                 chk.warnDeprecated(tree.pos(), sym);
 
-            if ((sym.flags() & PROPRIETARY) != 0)
-                log.strictWarning(tree.pos(), "sun.proprietary", sym);
+            if ((sym.flags() & PROPRIETARY) != 0) {
+                if (enableSunApiLintControl)
+                  chk.warnSunApi(tree.pos(), "sun.proprietary", sym);
+                else
+                  log.strictWarning(tree.pos(), "sun.proprietary", sym);
+            }
 
             // Test (3): if symbol is a variable, check that its type and
             // kind are compatible with the prototype and protokind.
--- a/src/share/classes/com/sun/tools/javac/comp/Check.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/javac/comp/Check.java	Mon Sep 07 22:42:05 2009 -0700
@@ -65,6 +65,7 @@
     private final Types types;
     private final JCDiagnostic.Factory diags;
     private final boolean skipAnnotations;
+    private boolean warnOnSyntheticConflicts;
     private final TreeInfo treeinfo;
 
     // The set of lint options currently in effect. It is initialized
@@ -99,15 +100,19 @@
         allowAnnotations = source.allowAnnotations();
         complexInference = options.get("-complexinference") != null;
         skipAnnotations = options.get("skipAnnotations") != null;
+        warnOnSyntheticConflicts = options.get("warnOnSyntheticConflicts") != null;
 
         boolean verboseDeprecated = lint.isEnabled(LintCategory.DEPRECATION);
         boolean verboseUnchecked = lint.isEnabled(LintCategory.UNCHECKED);
+        boolean verboseSunApi = lint.isEnabled(LintCategory.SUNAPI);
         boolean enforceMandatoryWarnings = source.enforceMandatoryWarnings();
 
         deprecationHandler = new MandatoryWarningHandler(log, verboseDeprecated,
                 enforceMandatoryWarnings, "deprecated");
         uncheckedHandler = new MandatoryWarningHandler(log, verboseUnchecked,
                 enforceMandatoryWarnings, "unchecked");
+        sunApiHandler = new MandatoryWarningHandler(log, verboseSunApi,
+                enforceMandatoryWarnings, "sunapi");
     }
 
     /** Switch: generics enabled?
@@ -135,6 +140,9 @@
      */
     private MandatoryWarningHandler uncheckedHandler;
 
+    /** A handler for messages about using Sun proprietary API.
+     */
+    private MandatoryWarningHandler sunApiHandler;
 
 /* *************************************************************************
  * Errors and Warnings
@@ -164,12 +172,22 @@
             uncheckedHandler.report(pos, msg, args);
     }
 
+    /** Warn about using Sun proprietary API.
+     *  @param pos        Position to be used for error reporting.
+     *  @param msg        A string describing the problem.
+     */
+    public void warnSunApi(DiagnosticPosition pos, String msg, Object... args) {
+        if (!lint.isSuppressed(LintCategory.SUNAPI))
+            sunApiHandler.report(pos, msg, args);
+    }
+
     /**
      * Report any deferred diagnostics.
      */
     public void reportDeferredDiagnostics() {
         deprecationHandler.reportDeferredDiagnostic();
         uncheckedHandler.reportDeferredDiagnostic();
+        sunApiHandler.reportDeferredDiagnostic();
     }
 
 
@@ -1041,7 +1059,7 @@
      *  @param thrown     The list of thrown exceptions.
      *  @param handled    The list of handled exceptions.
      */
-    List<Type> unHandled(List<Type> thrown, List<Type> handled) {
+    List<Type> unhandled(List<Type> thrown, List<Type> handled) {
         List<Type> unhandled = List.nil();
         for (List<Type> l = thrown; l.nonEmpty(); l = l.tail)
             if (!isHandled(l.head, handled)) unhandled = unhandled.prepend(l.head);
@@ -1198,29 +1216,36 @@
                 m.owner.isSubClass(other.owner, types)) {
                 // allow limited interoperability with covariant returns
             } else {
-                typeError(TreeInfo.diagnosticPositionFor(m, tree),
-                          diags.fragment("override.incompatible.ret",
-                                         cannotOverride(m, other)),
+                log.error(TreeInfo.diagnosticPositionFor(m, tree),
+                          "override.incompatible.ret",
+                          cannotOverride(m, other),
                           mtres, otres);
                 return;
             }
         } else if (overrideWarner.warned) {
             warnUnchecked(TreeInfo.diagnosticPositionFor(m, tree),
-                          "prob.found.req",
-                          diags.fragment("override.unchecked.ret",
-                                              uncheckedOverrides(m, other)),
-                          mtres, otres);
+                    "override.unchecked.ret",
+                    uncheckedOverrides(m, other),
+                    mtres, otres);
         }
 
         // Error if overriding method throws an exception not reported
         // by overridden method.
         List<Type> otthrown = types.subst(ot.getThrownTypes(), otvars, mtvars);
-        List<Type> unhandled = unHandled(mt.getThrownTypes(), otthrown);
-        if (unhandled.nonEmpty()) {
+        List<Type> unhandledErased = unhandled(mt.getThrownTypes(), types.erasure(otthrown));
+        List<Type> unhandledUnerased = unhandled(mt.getThrownTypes(), otthrown);
+        if (unhandledErased.nonEmpty()) {
             log.error(TreeInfo.diagnosticPositionFor(m, tree),
                       "override.meth.doesnt.throw",
                       cannotOverride(m, other),
-                      unhandled.head);
+                      unhandledUnerased.head);
+            return;
+        }
+        else if (unhandledUnerased.nonEmpty()) {
+            warnUnchecked(TreeInfo.diagnosticPositionFor(m, tree),
+                          "override.unchecked.thrown",
+                         cannotOverride(m, other),
+                         unhandledUnerased.head);
             return;
         }
 
@@ -1709,6 +1734,35 @@
         checkCompatibleConcretes(pos, c);
     }
 
+    void checkConflicts(DiagnosticPosition pos, Symbol sym, TypeSymbol c) {
+        for (Type ct = c.type; ct != Type.noType ; ct = types.supertype(ct)) {
+            for (Scope.Entry e = ct.tsym.members().lookup(sym.name); e.scope == ct.tsym.members(); e = e.next()) {
+                // VM allows methods and variables with differing types
+                if (sym.kind == e.sym.kind &&
+                    types.isSameType(types.erasure(sym.type), types.erasure(e.sym.type)) &&
+                    sym != e.sym &&
+                    (sym.flags() & Flags.SYNTHETIC) != (e.sym.flags() & Flags.SYNTHETIC) &&
+                    (sym.flags() & BRIDGE) == 0 && (e.sym.flags() & BRIDGE) == 0) {
+                    syntheticError(pos, (e.sym.flags() & SYNTHETIC) == 0 ? e.sym : sym);
+                    return;
+                }
+            }
+        }
+    }
+
+    /** Report a conflict between a user symbol and a synthetic symbol.
+     */
+    private void syntheticError(DiagnosticPosition pos, Symbol sym) {
+        if (!sym.type.isErroneous()) {
+            if (warnOnSyntheticConflicts) {
+                log.warning(pos, "synthetic.name.conflict", sym, sym.location());
+            }
+            else {
+                log.error(pos, "synthetic.name.conflict", sym, sym.location());
+            }
+        }
+    }
+
     /** Check that class c does not implement directly or indirectly
      *  the same parameterized interface with two different argument lists.
      *  @param pos          Position to be used for error reporting.
--- a/src/share/classes/com/sun/tools/javac/comp/Lower.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/javac/comp/Lower.java	Mon Sep 07 22:42:05 2009 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 1999-2008 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1999-2009 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -596,34 +596,56 @@
  * Symbol manipulation utilities
  *************************************************************************/
 
-    /** Report a conflict between a user symbol and a synthetic symbol.
-     */
-    private void duplicateError(DiagnosticPosition pos, Symbol sym) {
-        if (!sym.type.isErroneous()) {
-            log.error(pos, "synthetic.name.conflict", sym, sym.location());
-        }
-    }
-
     /** Enter a synthetic symbol in a given scope, but complain if there was already one there.
      *  @param pos           Position for error reporting.
      *  @param sym           The symbol.
      *  @param s             The scope.
      */
     private void enterSynthetic(DiagnosticPosition pos, Symbol sym, Scope s) {
-        if (sym.name != names.error && sym.name != names.empty) {
-            for (Scope.Entry e = s.lookup(sym.name); e.scope == s; e = e.next()) {
-                if (sym != e.sym && sym.kind == e.sym.kind) {
-                    // VM allows methods and variables with differing types
-                    if ((sym.kind & (MTH|VAR)) != 0 &&
-                        !types.erasure(sym.type).equals(types.erasure(e.sym.type)))
-                        continue;
-                    duplicateError(pos, e.sym);
-                    break;
-                }
+        s.enter(sym);
+    }
+
+    /** Check whether synthetic symbols generated during lowering conflict
+     *  with user-defined symbols.
+     *
+     *  @param translatedTrees lowered class trees
+     */
+    void checkConflicts(List<JCTree> translatedTrees) {
+        for (JCTree t : translatedTrees) {
+            t.accept(conflictsChecker);
+        }
+    }
+
+    JCTree.Visitor conflictsChecker = new TreeScanner() {
+
+        TypeSymbol currentClass;
+
+        @Override
+        public void visitMethodDef(JCMethodDecl that) {
+            chk.checkConflicts(that.pos(), that.sym, currentClass);
+            super.visitMethodDef(that);
+        }
+
+        @Override
+        public void visitVarDef(JCVariableDecl that) {
+            if (that.sym.owner.kind == TYP) {
+                chk.checkConflicts(that.pos(), that.sym, currentClass);
+            }
+            super.visitVarDef(that);
+        }
+
+        @Override
+        public void visitClassDef(JCClassDecl that) {
+            TypeSymbol prevCurrentClass = currentClass;
+            currentClass = that.sym;
+            try {
+                super.visitClassDef(that);
+            }
+            finally {
+                currentClass = prevCurrentClass;
             }
         }
-        s.enter(sym);
-    }
+    };
 
     /** Look up a synthetic name in a given scope.
      *  @param scope        The scope.
@@ -3192,6 +3214,7 @@
                 makeAccessible(l.head);
             for (EnumMapping map : enumSwitchMap.values())
                 map.translate();
+            checkConflicts(this.translated.toList());
             translated = this.translated;
         } finally {
             // note that recursive invocations of this method fail hard
--- a/src/share/classes/com/sun/tools/javac/comp/MemberEnter.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/javac/comp/MemberEnter.java	Mon Sep 07 22:42:05 2009 -0700
@@ -1040,15 +1040,6 @@
                     JavaFileObject prev = log.useSource(env.toplevel.sourcefile);
                     try {
                         enterTypeAnnotations(annotations);
-
-                        // enrich type parameter symbols... easier for annotation processors
-                        if (tree instanceof JCTypeParameter) {
-                            JCTypeParameter typeparam = (JCTypeParameter)tree;
-                            ListBuffer<Attribute.Compound> buf = ListBuffer.lb();
-                            for (JCTypeAnnotation anno : annotations)
-                                buf.add(anno.attribute_field);
-                            typeparam.type.tsym.attributes_field = buf.toList();
-                        }
                     } finally {
                         log.useSource(prev);
                     }
--- a/src/share/classes/com/sun/tools/javac/comp/Resolve.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/javac/comp/Resolve.java	Mon Sep 07 22:42:05 2009 -0700
@@ -251,7 +251,8 @@
             return true;
         else {
             Symbol s2 = ((MethodSymbol)sym).implementation(site.tsym, types, true);
-            return (s2 == null || s2 == sym);
+            return (s2 == null || s2 == sym ||
+                    !types.isSubSignature(types.memberType(site, s2), types.memberType(site, sym)));
         }
     }
     //where
--- a/src/share/classes/com/sun/tools/javac/comp/TransTypes.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/javac/comp/TransTypes.java	Mon Sep 07 22:42:05 2009 -0700
@@ -631,7 +631,7 @@
     }
 
     public void visitAssignop(JCAssignOp tree) {
-        tree.lhs = translate(tree.lhs, tree.operator.type.getParameterTypes().head);
+        tree.lhs = translate(tree.lhs, null);
         tree.rhs = translate(tree.rhs, tree.operator.type.getParameterTypes().tail.head);
         tree.type = erasure(tree.type);
         result = tree;
@@ -817,6 +817,23 @@
             pop();
         }
 
+        private boolean inClass = false;
+
+        @Override
+        public void visitClassDef(JCClassDecl tree) {
+           if (!inClass) {
+               // Do not recurse into nested and inner classes since
+               // TransTypes.visitClassDef makes an invocation for each class
+               // separately.
+               inClass = true;
+               try {
+                   super.visitClassDef(tree);
+               } finally {
+                   inClass = false;
+               }
+           }
+        }
+
         private TypeAnnotationPosition resolveFrame(JCTree tree, JCTree frame,
                 List<JCTree> path, TypeAnnotationPosition p) {
             switch (frame.getKind()) {
--- a/src/share/classes/com/sun/tools/javac/file/BaseFileObject.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/javac/file/BaseFileObject.java	Mon Sep 07 22:42:05 2009 -0700
@@ -36,6 +36,12 @@
 
 import static javax.tools.JavaFileObject.Kind.*;
 
+/**
+ * <p><b>This is NOT part of any API supported by Sun Microsystems.
+ * 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>
+*/
 public abstract class BaseFileObject implements JavaFileObject {
     protected BaseFileObject(JavacFileManager fileManager) {
         this.fileManager = fileManager;
--- a/src/share/classes/com/sun/tools/javac/file/CacheFSInfo.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/javac/file/CacheFSInfo.java	Mon Sep 07 22:42:05 2009 -0700
@@ -34,7 +34,12 @@
 import java.util.concurrent.ConcurrentHashMap;
 
 /**
- * Caching implementation of FSInfo
+ * Caching implementation of FSInfo.
+ *
+ * <p><b>This is NOT part of any API supported by Sun Microsystems.
+ * 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>
  */
 public class CacheFSInfo extends FSInfo {
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/com/sun/tools/javac/file/CloseableURLClassLoader.java	Mon Sep 07 22:42:05 2009 -0700
@@ -0,0 +1,105 @@
+/*
+ * Copyright 2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package com.sun.tools.javac.file;
+
+import java.io.Closeable;
+import java.io.IOException;
+import java.lang.reflect.Field;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.util.ArrayList;
+import java.util.jar.JarFile;
+
+/**
+ * A URLClassLoader that also implements Closeable.
+ * Reflection is used to access internal data structures in the URLClassLoader,
+ * since no public API exists for this purpose. Therefore this code is somewhat
+ * fragile. Caveat emptor.
+ * @throws Error if the internal data structures are not as expected.
+ *
+ *  <p><b>This is NOT part of any API supported by Sun Microsystems.  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>
+ */
+class CloseableURLClassLoader
+        extends URLClassLoader implements Closeable {
+    CloseableURLClassLoader(URL[] urls, ClassLoader parent) throws Error {
+        super(urls, parent);
+        try {
+            getLoaders(); //proactive check that URLClassLoader is as expected
+        } catch (Throwable t) {
+            throw new Error("cannot create CloseableURLClassLoader", t);
+        }
+    }
+
+    /**
+     * Close any jar files that may have been opened by the class loader.
+     * Reflection is used to access the jar files in the URLClassLoader's
+     * internal data structures.
+     * @throws java.io.IOException if the jar files cannot be found for any
+     * reson, or if closing the jar file itself causes an IOException.
+     */
+    public void close() throws IOException {
+        try {
+            for (Object l: getLoaders()) {
+                if (l.getClass().getName().equals("sun.misc.URLClassPath$JarLoader")) {
+                    Field jarField = l.getClass().getDeclaredField("jar");
+                    JarFile jar = (JarFile) getField(l, jarField);
+                    //System.err.println("CloseableURLClassLoader: closing " + jar);
+                    jar.close();
+                }
+            }
+        } catch (Throwable t) {
+            IOException e = new IOException("cannot close class loader");
+            e.initCause(t);
+            throw e;
+        }
+    }
+
+    private ArrayList<?> getLoaders()
+            throws NoSuchFieldException, IllegalArgumentException, IllegalAccessException
+    {
+        Field ucpField = URLClassLoader.class.getDeclaredField("ucp");
+        Object urlClassPath = getField(this, ucpField);
+        if (urlClassPath == null)
+            throw new AssertionError("urlClassPath not set in URLClassLoader");
+        Field loadersField = urlClassPath.getClass().getDeclaredField("loaders");
+        return (ArrayList<?>) getField(urlClassPath, loadersField);
+    }
+
+    private Object getField(Object o, Field f)
+            throws IllegalArgumentException, IllegalAccessException {
+        boolean prev = f.isAccessible();
+        try {
+            f.setAccessible(true);
+            return f.get(o);
+        } finally {
+            f.setAccessible(prev);
+        }
+    }
+
+}
--- a/src/share/classes/com/sun/tools/javac/file/FSInfo.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/javac/file/FSInfo.java	Mon Sep 07 22:42:05 2009 -0700
@@ -16,6 +16,11 @@
 /**
  * Get meta-info about files. Default direct (non-caching) implementation.
  * @see CacheFSInfo
+ *
+ * <p><b>This is NOT part of any API supported by Sun Microsystems.
+ * 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>
  */
 public class FSInfo {
 
--- a/src/share/classes/com/sun/tools/javac/file/JavacFileManager.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/javac/file/JavacFileManager.java	Mon Sep 07 22:42:05 2009 -0700
@@ -33,6 +33,7 @@
 import java.io.InputStream;
 import java.io.OutputStreamWriter;
 import java.lang.ref.SoftReference;
+import java.lang.reflect.Constructor;
 import java.net.MalformedURLException;
 import java.net.URI;
 import java.net.URL;
@@ -76,12 +77,18 @@
 import com.sun.tools.javac.util.Log;
 import com.sun.tools.javac.util.Options;
 
+import java.io.Closeable;
 import static javax.tools.StandardLocation.*;
 import static com.sun.tools.javac.main.OptionName.*;
 
 /**
  * This class provides access to the source, class and other files
  * used by the compiler and related tools.
+ *
+ * <p><b>This is NOT part of any API supported by Sun Microsystems.
+ * 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>
  */
 public class JavacFileManager implements StandardJavaFileManager {
 
@@ -126,6 +133,7 @@
 
     protected boolean mmappedIO;
     protected boolean ignoreSymbolFile;
+    protected String classLoaderClass;
 
     /**
      * User provided charset (through javax.tools).
@@ -175,6 +183,7 @@
 
         mmappedIO = options.get("mmappedIO") != null;
         ignoreSymbolFile = options.get("ignore.symbol.file") != null;
+        classLoaderClass = options.get("procloader");
     }
 
     public JavaFileObject getFileForInput(String name) {
@@ -742,8 +751,40 @@
                 throw new AssertionError(e);
             }
         }
-        return new URLClassLoader(lb.toArray(new URL[lb.size()]),
-            getClass().getClassLoader());
+
+        URL[] urls = lb.toArray(new URL[lb.size()]);
+        ClassLoader thisClassLoader = getClass().getClassLoader();
+
+        // Bug: 6558476
+        // Ideally, ClassLoader should be Closeable, but before JDK7 it is not.
+        // On older versions, try the following, to get a closeable classloader.
+
+        // 1: Allow client to specify the class to use via hidden option
+        if (classLoaderClass != null) {
+            try {
+                Class<? extends ClassLoader> loader =
+                        Class.forName(classLoaderClass).asSubclass(ClassLoader.class);
+                Class<?>[] constrArgTypes = { URL[].class, ClassLoader.class };
+                Constructor<? extends ClassLoader> constr = loader.getConstructor(constrArgTypes);
+                return constr.newInstance(new Object[] { urls, thisClassLoader });
+            } catch (Throwable t) {
+                // ignore errors loading user-provided class loader, fall through
+            }
+        }
+
+        // 2: If URLClassLoader implements Closeable, use that.
+        if (Closeable.class.isAssignableFrom(URLClassLoader.class))
+            return new URLClassLoader(urls, thisClassLoader);
+
+        // 3: Try using private reflection-based CloseableURLClassLoader
+        try {
+            return new CloseableURLClassLoader(urls, thisClassLoader);
+        } catch (Throwable t) {
+            // ignore errors loading workaround class loader, fall through
+        }
+
+        // 4: If all else fails, use plain old standard URLClassLoader
+        return new URLClassLoader(urls, thisClassLoader);
     }
 
     public Iterable<JavaFileObject> list(Location location,
--- a/src/share/classes/com/sun/tools/javac/file/RegularFileObject.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/javac/file/RegularFileObject.java	Mon Sep 07 22:42:05 2009 -0700
@@ -42,6 +42,11 @@
 
 /**
  * A subclass of JavaFileObject representing regular files.
+ *
+ * <p><b>This is NOT part of any API supported by Sun Microsystems.
+ * 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>
  */
 class RegularFileObject extends BaseFileObject {
 
--- a/src/share/classes/com/sun/tools/javac/file/RelativePath.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/javac/file/RelativePath.java	Mon Sep 07 22:42:05 2009 -0700
@@ -34,6 +34,11 @@
  * Used to represent a platform-neutral path within a platform-specific
  * container, such as a directory or zip file.
  * Internally, the file separator is always '/'.
+ *
+ * <p><b>This is NOT part of any API supported by Sun Microsystems.
+ * 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>
  */
 public abstract class RelativePath implements Comparable<RelativePath> {
     /**
--- a/src/share/classes/com/sun/tools/javac/file/SymbolArchive.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/javac/file/SymbolArchive.java	Mon Sep 07 22:42:05 2009 -0700
@@ -35,6 +35,12 @@
 import com.sun.tools.javac.file.RelativePath.RelativeFile;
 import com.sun.tools.javac.util.List;
 
+/**
+ * <p><b>This is NOT part of any API supported by Sun Microsystems.
+ * 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>
+*/
 public class SymbolArchive extends ZipArchive {
 
     final File origFile;
--- a/src/share/classes/com/sun/tools/javac/file/ZipArchive.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/javac/file/ZipArchive.java	Mon Sep 07 22:42:05 2009 -0700
@@ -48,6 +48,12 @@
 import com.sun.tools.javac.file.RelativePath.RelativeFile;
 import com.sun.tools.javac.util.List;
 
+/**
+ * <p><b>This is NOT part of any API supported by Sun Microsystems.
+ * 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>
+ */
 public class ZipArchive implements Archive {
 
     public ZipArchive(JavacFileManager fm, ZipFile zdir) throws IOException {
--- a/src/share/classes/com/sun/tools/javac/file/ZipFileIndex.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/javac/file/ZipFileIndex.java	Mon Sep 07 22:42:05 2009 -0700
@@ -67,6 +67,11 @@
  * If nonBatchMode option is specified (-XDnonBatchMode) the compiler will use timestamp
  * checking to reindex the zip files if it is needed. In batch mode the timestamps are not checked
  * and the compiler uses the cached indexes.
+ *
+ * <p><b>This is NOT part of any API supported by Sun Microsystems.
+ * 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>
  */
 public class ZipFileIndex {
     private static final String MIN_CHAR = String.valueOf(Character.MIN_VALUE);
--- a/src/share/classes/com/sun/tools/javac/file/ZipFileIndexArchive.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/javac/file/ZipFileIndexArchive.java	Mon Sep 07 22:42:05 2009 -0700
@@ -44,6 +44,12 @@
 import com.sun.tools.javac.file.RelativePath.RelativeFile;
 import com.sun.tools.javac.util.List;
 
+/**
+ * <p><b>This is NOT part of any API supported by Sun Microsystems.
+ * 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>
+ */
 public class ZipFileIndexArchive implements Archive {
 
     private final ZipFileIndex zfIndex;
--- a/src/share/classes/com/sun/tools/javac/jvm/ClassWriter.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/javac/jvm/ClassWriter.java	Mon Sep 07 22:42:05 2009 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 1999-2008 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1999-2009 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
--- a/src/share/classes/com/sun/tools/javac/jvm/Code.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/javac/jvm/Code.java	Mon Sep 07 22:42:05 2009 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 1999-2008 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1999-2009 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
--- a/src/share/classes/com/sun/tools/javac/jvm/Gen.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/javac/jvm/Gen.java	Mon Sep 07 22:42:05 2009 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 1999-2008 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1999-2009 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
--- a/src/share/classes/com/sun/tools/javac/main/JavaCompiler.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/javac/main/JavaCompiler.java	Mon Sep 07 22:42:05 2009 -0700
@@ -813,6 +813,9 @@
         } catch (Abort ex) {
             if (devVerbose)
                 ex.printStackTrace();
+        } finally {
+            if (procEnvImpl != null)
+                procEnvImpl.close();
         }
     }
 
@@ -936,7 +939,7 @@
     /**
      * Object to handle annotation processing.
      */
-    JavacProcessingEnvironment procEnvImpl = null;
+    private JavacProcessingEnvironment procEnvImpl = null;
 
     /**
      * Check if we should process annotations.
@@ -947,7 +950,8 @@
      * @param processors user provided annotation processors to bypass
      * discovery, {@code null} means that no processors were provided
      */
-    public void initProcessAnnotations(Iterable<? extends Processor> processors) {
+    public void initProcessAnnotations(Iterable<? extends Processor> processors)
+                throws IOException {
         // Process annotations if processing is not disabled and there
         // is at least one Processor available.
         Options options = Options.instance(context);
@@ -974,7 +978,8 @@
     }
 
     // TODO: called by JavacTaskImpl
-    public JavaCompiler processAnnotations(List<JCCompilationUnit> roots) throws IOException {
+    public JavaCompiler processAnnotations(List<JCCompilationUnit> roots)
+            throws IOException {
         return processAnnotations(roots, List.<String>nil());
     }
 
@@ -1061,10 +1066,14 @@
                         return this;
                 }
             }
-            JavaCompiler c = procEnvImpl.doProcessing(context, roots, classSymbols, pckSymbols);
-            if (c != this)
-                annotationProcessingOccurred = c.annotationProcessingOccurred = true;
-            return c;
+            try {
+                JavaCompiler c = procEnvImpl.doProcessing(context, roots, classSymbols, pckSymbols);
+                if (c != this)
+                    annotationProcessingOccurred = c.annotationProcessingOccurred = true;
+                return c;
+            } finally {
+                procEnvImpl.close();
+            }
         } catch (CompletionFailure ex) {
             log.error("cant.access", ex.sym, ex.getDetailValue());
             return this;
@@ -1207,6 +1216,9 @@
         return stopIfError(CompileState.FLOW, results);
     }
 
+    HashMap<Env<AttrContext>, Queue<Pair<Env<AttrContext>, JCClassDecl>>> desugaredEnvs =
+            new HashMap<Env<AttrContext>, Queue<Pair<Env<AttrContext>, JCClassDecl>>>();
+
     /**
      * Prepare attributed parse trees, in conjunction with their attribution contexts,
      * for source or code generation. If the file was not listed on the command line,
@@ -1222,10 +1234,17 @@
             return;
         }
 
+        if (compileStates.isDone(env, CompileState.LOWER)) {
+            results.addAll(desugaredEnvs.get(env));
+            return;
+        }
+
         /**
-         * As erasure (TransTypes) destroys information needed in flow analysis,
-         * including information in supertypes, we need to ensure that supertypes
-         * are processed through attribute and flow before subtypes are translated.
+         * Ensure that superclasses of C are desugared before C itself. This is
+         * required for two reasons: (i) as erasure (TransTypes) destroys
+         * information needed in flow analysis and (ii) as some checks carried
+         * out during lowering require that all synthetic fields/methods have
+         * already been added to C and its superclasses.
          */
         class ScanNested extends TreeScanner {
             Set<Env<AttrContext>> dependencies = new LinkedHashSet<Env<AttrContext>>();
@@ -1246,8 +1265,8 @@
         ScanNested scanner = new ScanNested();
         scanner.scan(env.tree);
         for (Env<AttrContext> dep: scanner.dependencies) {
-            if (!compileStates.isDone(dep, CompileState.FLOW))
-                flow(attribute(dep));
+        if (!compileStates.isDone(dep, CompileState.FLOW))
+            desugaredEnvs.put(dep, desugar(flow(attribute(dep))));
         }
 
         //We need to check for error another time as more classes might
@@ -1298,6 +1317,7 @@
                 return;
 
             env.tree = transTypes.translateTopLevelClass(env.tree, localMake);
+            compileStates.put(env, CompileState.TRANSTYPES);
 
             if (shouldStop(CompileState.LOWER))
                 return;
@@ -1315,6 +1335,7 @@
 
             //translate out inner classes
             List<JCTree> cdefs = lower.translateTopLevelClass(env, env.tree, localMake);
+            compileStates.put(env, CompileState.LOWER);
 
             if (shouldStop(CompileState.LOWER))
                 return;
--- a/src/share/classes/com/sun/tools/javac/main/JavacOption.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/javac/main/JavacOption.java	Mon Sep 07 22:42:05 2009 -0700
@@ -25,11 +25,11 @@
 
 package com.sun.tools.javac.main;
 
+import java.io.PrintWriter;
+import java.util.LinkedHashMap;
+import java.util.Map;
 import com.sun.tools.javac.util.Log;
 import com.sun.tools.javac.util.Options;
-import java.io.PrintWriter;
-import java.util.Arrays;
-import java.util.Collection;
 
 /**
  * TODO: describe com.sun.tools.javac.main.JavacOption
@@ -106,9 +106,10 @@
          */
         ChoiceKind choiceKind;
 
-        /** The choices for this option, if any.
+        /** The choices for this option, if any, and whether or not the choices
+         *  are hidden
          */
-        Collection<String> choices;
+        Map<String,Boolean> choices;
 
         Option(OptionName name, String argsNameKey, String descrKey) {
             this.name = name;
@@ -123,10 +124,18 @@
         }
 
         Option(OptionName name, String descrKey, ChoiceKind choiceKind, String... choices) {
-            this(name, descrKey, choiceKind, Arrays.asList(choices));
+            this(name, descrKey, choiceKind, createChoices(choices));
         }
 
-        Option(OptionName name, String descrKey, ChoiceKind choiceKind, Collection<String> choices) {
+        private static Map<String,Boolean> createChoices(String... choices) {
+            Map<String,Boolean> map = new LinkedHashMap<String,Boolean>();
+            for (String c: choices)
+                map.put(c, true);
+            return map;
+        }
+
+        Option(OptionName name, String descrKey, ChoiceKind choiceKind,
+                Map<String,Boolean> choices) {
             this(name, null, descrKey);
             if (choiceKind == null || choices == null)
                 throw new NullPointerException();
@@ -153,10 +162,10 @@
             if (choices != null) {
                 String arg = option.substring(name.optionName.length());
                 if (choiceKind == ChoiceKind.ONEOF)
-                    return choices.contains(arg);
+                    return choices.keySet().contains(arg);
                 else {
                     for (String a: arg.split(",+")) {
-                        if (!choices.contains(a))
+                        if (!choices.keySet().contains(a))
                             return false;
                     }
                 }
@@ -181,10 +190,12 @@
             if (argsNameKey == null) {
                 if (choices != null) {
                     String sep = "{";
-                    for (String c: choices) {
-                        sb.append(sep);
-                        sb.append(c);
-                        sep = ",";
+                    for (Map.Entry<String,Boolean> e: choices.entrySet()) {
+                        if (!e.getValue()) {
+                            sb.append(sep);
+                            sb.append(e.getKey());
+                            sep = ",";
+                        }
                     }
                     sb.append("}");
                 }
@@ -209,8 +220,8 @@
                 if (choices != null) {
                     if (choiceKind == ChoiceKind.ONEOF) {
                         // some clients like to see just one of option+choice set
-                        for (String c: choices)
-                            options.remove(option + c);
+                        for (String s: choices.keySet())
+                            options.remove(option + s);
                         String opt = option + arg;
                         options.put(opt, opt);
                         // some clients like to see option (without trailing ":")
@@ -256,7 +267,7 @@
         XOption(OptionName name, String descrKey, ChoiceKind kind, String... choices) {
             super(name, descrKey, kind, choices);
         }
-        XOption(OptionName name, String descrKey, ChoiceKind kind, Collection<String> choices) {
+        XOption(OptionName name, String descrKey, ChoiceKind kind, Map<String,Boolean> choices) {
             super(name, descrKey, kind, choices);
         }
         @Override
--- a/src/share/classes/com/sun/tools/javac/main/RecognizedOptions.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/javac/main/RecognizedOptions.java	Mon Sep 07 22:42:05 2009 -0700
@@ -38,9 +38,9 @@
 import java.io.File;
 import java.io.FileWriter;
 import java.io.PrintWriter;
-import java.util.Collection;
 import java.util.EnumSet;
-import java.util.LinkedHashSet;
+import java.util.LinkedHashMap;
+import java.util.Map;
 import java.util.Set;
 import javax.lang.model.SourceVersion;
 
@@ -598,14 +598,14 @@
     };
     }
 
-    private static Collection<String> getXLintChoices() {
-        Collection<String> choices = new LinkedHashSet<String>();
-        choices.add("all");
+    private static Map<String,Boolean> getXLintChoices() {
+        Map<String,Boolean> choices = new LinkedHashMap<String,Boolean>();
+        choices.put("all", false);
         for (Lint.LintCategory c : Lint.LintCategory.values())
-            choices.add(c.option);
+            choices.put(c.option, c.hidden);
         for (Lint.LintCategory c : Lint.LintCategory.values())
-            choices.add("-" + c.option);
-        choices.add("none");
+            choices.put("-" + c.option, c.hidden);
+        choices.put("none", false);
         return choices;
     }
 
--- a/src/share/classes/com/sun/tools/javac/parser/ParserFactory.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/javac/parser/ParserFactory.java	Mon Sep 07 22:42:05 2009 -0700
@@ -34,6 +34,11 @@
 
 /**
  * A factory for creating parsers.
+ *
+ * <p><b>This is NOT part of any API supported by Sun Microsystems.
+ * 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>
  */
 public class ParserFactory {
 
--- a/src/share/classes/com/sun/tools/javac/processing/JavacProcessingEnvironment.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/javac/processing/JavacProcessingEnvironment.java	Mon Sep 07 22:42:05 2009 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005-2008 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2009 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -136,6 +136,8 @@
      */
     Source source;
 
+    private ClassLoader processorClassLoader;
+
     /**
      * JavacMessages object used for localization
      */
@@ -203,7 +205,7 @@
             JavaFileManager fileManager = context.get(JavaFileManager.class);
             try {
                 // If processorpath is not explicitly set, use the classpath.
-                ClassLoader processorCL = fileManager.hasLocation(ANNOTATION_PROCESSOR_PATH)
+                processorClassLoader = fileManager.hasLocation(ANNOTATION_PROCESSOR_PATH)
                     ? fileManager.getClassLoader(ANNOTATION_PROCESSOR_PATH)
                     : fileManager.getClassLoader(CLASS_PATH);
 
@@ -213,9 +215,9 @@
                  * provider mechanism to create the processor iterator.
                  */
                 if (processorNames != null) {
-                    processorIterator = new NameProcessIterator(processorNames, processorCL, log);
+                    processorIterator = new NameProcessIterator(processorNames, processorClassLoader, log);
                 } else {
-                    processorIterator = new ServiceIterator(processorCL, log);
+                    processorIterator = new ServiceIterator(processorClassLoader, log);
                 }
             } catch (SecurityException e) {
                 /*
@@ -1019,9 +1021,11 @@
     /**
      * Free resources related to annotation processing.
      */
-    public void close() {
+    public void close() throws IOException {
         filer.close();
         discoveredProcs = null;
+        if (processorClassLoader != null && processorClassLoader instanceof Closeable)
+            ((Closeable) processorClassLoader).close();
     }
 
     private List<ClassSymbol> getTopLevelClasses(List<? extends JCCompilationUnit> units) {
--- a/src/share/classes/com/sun/tools/javac/resources/compiler.properties	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/javac/resources/compiler.properties	Mon Sep 07 22:42:05 2009 -0700
@@ -431,6 +431,8 @@
     static import only from classes and interfaces
 compiler.err.synthetic.name.conflict=\
     the symbol {0} conflicts with a compiler-synthesized symbol in {1}
+compiler.warn.synthetic.name.conflict=\
+    the symbol {0} conflicts with a compiler-synthesized symbol in {1}
 
 compiler.err.throws.not.allowed.in.intf.annotation=\
     throws clause not allowed in @interface members
@@ -562,12 +564,6 @@
 compiler.note.deprecated.plural.additional=\
     Some input files additionally use or override a deprecated API.
 
-# Notes related to annotation processing
-
-# Print a client-generated note; assumed to be localized, no translation required
-compiler.note.proc.messager=\
-    {0}
-
 compiler.note.unchecked.filename=\
     {0} uses unchecked or unsafe operations.
 compiler.note.unchecked.plural=\
@@ -582,6 +578,25 @@
 compiler.note.unchecked.plural.additional=\
     Some input files additionally use unchecked or unsafe operations.
 
+compiler.note.sunapi.filename=\
+    {0} uses Sun proprietary API that may be removed in a future release.
+compiler.note.sunapi.plural=\
+    Some input files use Sun proprietary API that may be removed in a future release.
+# The following string may appear after one of the above sunapi messages.
+compiler.note.sunapi.recompile=\
+    Recompile with -Xlint:sunapi for details.
+
+compiler.note.sunapi.filename.additional=\
+    {0} uses additional Sun proprietary API that may be removed in a future release.
+compiler.note.sunapi.plural.additional=\
+    Some input files additionally use Sun proprietary API that may be removed in a future release.
+
+# Notes related to annotation processing
+
+# Print a client-generated note; assumed to be localized, no translation required
+compiler.note.proc.messager=\
+    {0}
+
 #####
 
 compiler.misc.count.error=\
@@ -761,7 +776,7 @@
     found: {3}
 
 compiler.warn.unchecked.generic.array.creation=\
-    [unchecked] unchecked generic array creation of type {0} for varargs parameter
+    [unchecked] unchecked generic array creation for varargs parameter of type {0}
 
 compiler.warn.missing.deprecated.annotation=\
     [dep-ann] deprecated item is not annotated with @Deprecated
@@ -1003,7 +1018,7 @@
     inferred: {0}\n\
     bound(s): {1}
 compiler.misc.inferred.do.not.conform.to.params=\
-    actual arguments do not conforms to inferred formal arguments\n\
+    actual arguments do not conform to inferred formal arguments\n\
     required: {0}\n\
     found: {1}
 
@@ -1091,23 +1106,33 @@
     no arguments
 
 compiler.err.override.static=\
-    {0}; overriding method is static
+    {0}\n\
+    overriding method is static
 compiler.err.override.meth=\
-    {0}; overridden method is {1}
+    {0}\n\
+    overridden method is {1}
 
 compiler.err.override.meth.doesnt.throw=\
-    {0}; overridden method does not throw {1}
+    {0}\n\
+    overridden method does not throw {1}
 
 # In the following string {1} is a space separated list of Java Keywords, as
 # they would have been declared in the source code
 compiler.err.override.weaker.access=\
-    {0}; attempting to assign weaker access privileges; was {1}
+    {0}\n\
+    attempting to assign weaker access privileges; was {1}
 
-compiler.misc.override.incompatible.ret=\
-    {0}; attempting to use incompatible return type
+compiler.err.override.incompatible.ret=\
+    {0}\n\
+    return type {1} is not compatible with {2}
 
-compiler.misc.override.unchecked.ret=\
-    {0}; return type requires unchecked conversion
+compiler.warn.override.unchecked.ret=\
+    [unchecked] {0}\n\
+    return type requires unchecked conversion from {1} to {2}
+
+compiler.warn.override.unchecked.thrown=\
+    [unchecked] {0}\n\
+    overridden method does not throw {1}
 
 ## The following are all possible strings for the first argument ({0}) of the
 ## above strings.
--- a/src/share/classes/com/sun/tools/javac/resources/legacy.properties	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/javac/resources/legacy.properties	Mon Sep 07 22:42:05 2009 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright 2006-2007 Sun Microsystems, Inc.  All Rights Reserved.
+# Copyright 2006-2009 Sun Microsystems, Inc.  All Rights Reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
--- a/src/share/classes/com/sun/tools/javac/util/AbstractDiagnosticFormatter.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/javac/util/AbstractDiagnosticFormatter.java	Mon Sep 07 22:42:05 2009 -0700
@@ -57,6 +57,10 @@
  *  <li> Provides the formatting logic for rendering the arguments of a JCDiagnostic object.
  * <ul>
  *
+ * <p><b>This is NOT part of any API supported by Sun Microsystems.
+ * 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>
  */
 public abstract class AbstractDiagnosticFormatter implements DiagnosticFormatter<JCDiagnostic> {
 
--- a/src/share/classes/com/sun/tools/javac/util/BasicDiagnosticFormatter.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/javac/util/BasicDiagnosticFormatter.java	Mon Sep 07 22:42:05 2009 -0700
@@ -57,6 +57,11 @@
  * <li>%m: the text or the diagnostic, including any appropriate arguments
  * <li>%_: space delimiter, useful for formatting purposes
  * </ul>
+ *
+ * <p><b>This is NOT part of any API supported by Sun Microsystems.
+ * 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>
  */
 public class BasicDiagnosticFormatter extends AbstractDiagnosticFormatter {
 
--- a/src/share/classes/com/sun/tools/javac/util/ForwardingDiagnosticFormatter.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/javac/util/ForwardingDiagnosticFormatter.java	Mon Sep 07 22:42:05 2009 -0700
@@ -37,6 +37,11 @@
 /**
  * A delegated diagnostic formatter delegates all formatting
  * actions to an underlying formatter (aka the delegated formatter).
+ *
+ * <p><b>This is NOT part of any API supported by Sun Microsystems.
+ * 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>
  */
 public class ForwardingDiagnosticFormatter<D extends Diagnostic<?>, F extends DiagnosticFormatter<D>>
         implements DiagnosticFormatter<D> {
--- a/src/share/classes/com/sun/tools/javac/util/Log.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/javac/util/Log.java	Mon Sep 07 22:42:05 2009 -0700
@@ -78,6 +78,10 @@
      */
     public boolean emitWarnings;
 
+    /** Switch: suppress note messages.
+     */
+    public boolean suppressNotes;
+
     /** Print stack trace on errors?
      */
     public boolean dumpOnError;
@@ -121,6 +125,7 @@
         this.dumpOnError = options.get("-doe") != null;
         this.promptOnError = options.get("-prompt") != null;
         this.emitWarnings = options.get("-Xlint:none") == null;
+        this.suppressNotes = options.get("suppressNotes") != null;
         this.MaxErrors = getIntOption(options, "-Xmaxerrs", 100);
         this.MaxWarnings = getIntOption(options, "-Xmaxwarns", 100);
 
@@ -324,7 +329,7 @@
             // Print out notes only when we are permitted to report warnings
             // Notes are only generated at the end of a compilation, so should be small
             // in number.
-            if (emitWarnings || diagnostic.isMandatory()) {
+            if ((emitWarnings || diagnostic.isMandatory()) && !suppressNotes) {
                 writeDiagnostic(diagnostic);
             }
             break;
--- a/src/share/classes/com/sun/tools/javac/util/RawDiagnosticFormatter.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/javac/util/RawDiagnosticFormatter.java	Mon Sep 07 22:42:05 2009 -0700
@@ -39,6 +39,11 @@
  * The raw formatter will format a diagnostic according to one of two format patterns, depending on whether
  * or not the source name and position are set. This formatter provides a standardized, localize-independent
  * implementation of a diagnostic formatter; as such, this formatter is best suited for testing purposes.
+ *
+ * <p><b>This is NOT part of any API supported by Sun Microsystems.
+ * 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>
  */
 public final class RawDiagnosticFormatter extends AbstractDiagnosticFormatter {
 
--- a/src/share/classes/com/sun/tools/javac/util/RichDiagnosticFormatter.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/javac/util/RichDiagnosticFormatter.java	Mon Sep 07 22:42:05 2009 -0700
@@ -58,6 +58,11 @@
  * formatted and (iii) type-variable disambiguation - when the diagnostic refers
  * to two different type-variables with the same name, their representation is
  * disambiguated by appending an index to the type variable name.
+ *
+ * <p><b>This is NOT part of any API supported by Sun Microsystems.
+ * 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>
  */
 public class RichDiagnosticFormatter extends
         ForwardingDiagnosticFormatter<JCDiagnostic, AbstractDiagnosticFormatter> {
@@ -203,6 +208,32 @@
         }
         return clauses.reverse();
     }
+
+    private int indexOf(Type type, WhereClauseKind kind) {
+        int index = 1;
+        for (Type t : whereClauses.get(kind).keySet()) {
+            if (t.tsym == type.tsym) {
+                return index;
+            }
+            if (kind != WhereClauseKind.TYPEVAR ||
+                    t.toString().equals(type.toString())) {
+                index++;
+            }
+        }
+        return -1;
+    }
+
+    private boolean unique(TypeVar typevar) {
+        int found = 0;
+        for (Type t : whereClauses.get(WhereClauseKind.TYPEVAR).keySet()) {
+            if (t.toString().equals(typevar.toString())) {
+                found++;
+            }
+        }
+        if (found < 1)
+            throw new AssertionError("Missing type variable in where clause " + typevar);
+        return found == 1;
+    }
     //where
     /**
      * This enum defines all posssible kinds of where clauses that can be
@@ -361,33 +392,6 @@
             }
         }
 
-        private int indexOf(Type type, WhereClauseKind kind) {
-            int index = 0;
-            boolean found = false;
-            for (Type t : whereClauses.get(kind).keySet()) {
-                if (t == type) {
-                    found = true;
-                    break;
-                }
-                index++;
-            }
-            if (!found)
-                throw new AssertionError("Missing symbol in where clause " + type);
-            return index + 1;
-        }
-
-        private boolean unique(TypeVar typevar) {
-            int found = 0;
-            for (Type t : whereClauses.get(WhereClauseKind.TYPEVAR).keySet()) {
-                if (t.toString().equals(typevar.toString())) {
-                    found++;
-                }
-            }
-            if (found < 1)
-                throw new AssertionError("Missing type variable in where clause " + typevar);
-            return found == 1;
-        }
-
         @Override
         protected String printMethodArgs(List<Type> args, boolean varArgs, Locale locale) {
             return super.printMethodArgs(args, varArgs, locale);
@@ -487,7 +491,7 @@
 
         @Override
         public Void visitCapturedType(CapturedType t, Void ignored) {
-            if (!whereClauses.get(WhereClauseKind.CAPTURED).containsKey(t)) {
+            if (indexOf(t, WhereClauseKind.CAPTURED) == -1) {
                 String suffix = t.lower == syms.botType ? ".1" : "";
                 JCDiagnostic d = diags.fragment("where.captured"+ suffix, t, t.bound, t.lower, t.wildcard);
                 whereClauses.get(WhereClauseKind.CAPTURED).put(t, d);
@@ -501,7 +505,7 @@
         @Override
         public Void visitClassType(ClassType t, Void ignored) {
             if (t.isCompound()) {
-                if (!whereClauses.get(WhereClauseKind.INTERSECTION).containsKey(t)) {
+                if (indexOf(t, WhereClauseKind.INTERSECTION) == -1) {
                     Type supertype = types.supertype(t);
                     List<Type> interfaces = types.interfaces(t);
                     JCDiagnostic d = diags.fragment("where.intersection", t, interfaces.prepend(supertype));
@@ -519,11 +523,17 @@
 
         @Override
         public Void visitTypeVar(TypeVar t, Void ignored) {
-            if (!whereClauses.get(WhereClauseKind.TYPEVAR).containsKey(t)) {
+            if (indexOf(t, WhereClauseKind.TYPEVAR) == -1) {
+                //access the bound type and skip error types
                 Type bound = t.bound;
                 while ((bound instanceof ErrorType))
                     bound = ((ErrorType)bound).getOriginalType();
-                List<Type> bounds  = types.getBounds(t);
+                //retrieve the bound list - if the type variable
+                //has not been attributed the bound is not set
+                List<Type> bounds = bound != null ?
+                    types.getBounds(t) :
+                    List.<Type>nil();
+
                 nameSimplifier.addUsage(t.tsym);
 
                 boolean boundErroneous = bounds.head == null ||
@@ -569,7 +579,8 @@
         @Override
         public Void visitMethodSymbol(MethodSymbol s, Void ignored) {
             visit(s.owner, null);
-            typePreprocessor.visit(s.type);
+            if (s.type != null)
+                typePreprocessor.visit(s.type);
             return null;
         }
     };
--- a/src/share/classes/com/sun/tools/javac/util/Warner.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/javac/util/Warner.java	Mon Sep 07 22:42:05 2009 -0700
@@ -31,10 +31,10 @@
  * An interface to support optional warnings, needed for support of
  * unchecked conversions and unchecked casts.
  *
- * <p>Nothing described in this source file is 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.
+ * <p><b>This is NOT part of any API supported by Sun Microsystems.
+ * 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>
  */
 public class Warner {
     public static final Warner noWarnings = new Warner();
--- a/src/share/classes/com/sun/tools/javap/AnnotationWriter.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/javap/AnnotationWriter.java	Mon Sep 07 22:42:05 2009 -0700
@@ -32,6 +32,10 @@
 import com.sun.tools.classfile.Annotation.Class_element_value;
 import com.sun.tools.classfile.Annotation.Enum_element_value;
 import com.sun.tools.classfile.Annotation.Primitive_element_value;
+import com.sun.tools.classfile.ConstantPool;
+import com.sun.tools.classfile.ConstantPoolException;
+import com.sun.tools.classfile.Descriptor;
+import com.sun.tools.classfile.Descriptor.InvalidDescriptor;
 
 /**
  *  A writer for writing annotations as text.
@@ -51,71 +55,243 @@
 
     protected AnnotationWriter(Context context) {
         super(context);
+        classWriter = ClassWriter.instance(context);
+        constantWriter = ConstantWriter.instance(context);
     }
 
     public void write(Annotation annot) {
-        print("#" + annot.type_index + "(");
+        write(annot, false);
+    }
+
+    public void write(Annotation annot, boolean resolveIndices) {
+        writeDescriptor(annot.type_index, resolveIndices);
+        boolean showParens = annot.num_element_value_pairs > 0 || !resolveIndices;
+        if (showParens)
+            print("(");
         for (int i = 0; i < annot.num_element_value_pairs; i++) {
             if (i > 0)
                 print(",");
-            write(annot.element_value_pairs[i]);
+            write(annot.element_value_pairs[i], resolveIndices);
         }
-        print(")");
+        if (showParens)
+            print(")");
     }
 
     public void write(ExtendedAnnotation annot) {
-        write(annot.annotation);
-        print('@');
-        print(annot.position.toString());
+        write(annot, true, false);
+    }
+
+    public void write(ExtendedAnnotation annot, boolean showOffsets, boolean resolveIndices) {
+        write(annot.annotation, resolveIndices);
+        print(": ");
+        write(annot.position, showOffsets);
+    }
+
+    public void write(ExtendedAnnotation.Position pos, boolean showOffsets) {
+        print(pos.type);
+
+        switch (pos.type) {
+        // type case
+        case TYPECAST:
+        case TYPECAST_GENERIC_OR_ARRAY:
+        // object creation
+        case INSTANCEOF:
+        case INSTANCEOF_GENERIC_OR_ARRAY:
+        // new expression
+        case NEW:
+        case NEW_GENERIC_OR_ARRAY:
+        case NEW_TYPE_ARGUMENT:
+        case NEW_TYPE_ARGUMENT_GENERIC_OR_ARRAY:
+            if (showOffsets) {
+                print(", offset=");
+                print(pos.offset);
+            }
+            break;
+         // local variable
+        case LOCAL_VARIABLE:
+        case LOCAL_VARIABLE_GENERIC_OR_ARRAY:
+            print(", {");
+            for (int i = 0; i < pos.lvarOffset.length; ++i) {
+                if (i != 0) print("; ");
+                if (showOffsets) {
+                    print(", start_pc=");
+                    print(pos.lvarOffset[i]);
+                }
+                print(", length=");
+                print(pos.lvarLength[i]);
+                print(", index=");
+                print(pos.lvarIndex[i]);
+            }
+            print("}");
+            break;
+         // method receiver
+        case METHOD_RECEIVER:
+            // Do nothing
+            break;
+        // type parameters
+        case CLASS_TYPE_PARAMETER:
+        case METHOD_TYPE_PARAMETER:
+            print(", param_index=");
+            print(pos.parameter_index);
+            break;
+        // type parameters bound
+        case CLASS_TYPE_PARAMETER_BOUND:
+        case CLASS_TYPE_PARAMETER_BOUND_GENERIC_OR_ARRAY:
+        case METHOD_TYPE_PARAMETER_BOUND:
+        case METHOD_TYPE_PARAMETER_BOUND_GENERIC_OR_ARRAY:
+            print(", param_index=");
+            print(pos.parameter_index);
+            print(", bound_index=");
+            print(pos.bound_index);
+            break;
+         // wildcard
+        case WILDCARD_BOUND:
+        case WILDCARD_BOUND_GENERIC_OR_ARRAY:
+            print(", wild_card=");
+            print(pos.wildcard_position);
+            break;
+         // Class extends and implements clauses
+        case CLASS_EXTENDS:
+        case CLASS_EXTENDS_GENERIC_OR_ARRAY:
+            print(", type_index=");
+            print(pos.type_index);
+            break;
+        // throws
+        case THROWS:
+            print(", type_index=");
+            print(pos.type_index);
+            break;
+        case CLASS_LITERAL:
+            if (showOffsets) {
+                print(", offset=");
+                print(pos.offset);
+            }
+            break;
+        // method parameter: not specified
+        case METHOD_PARAMETER_GENERIC_OR_ARRAY:
+            print(", param_index=");
+            print(pos.parameter_index);
+            break;
+        // method type argument: wasn't specified
+        case METHOD_TYPE_ARGUMENT:
+        case METHOD_TYPE_ARGUMENT_GENERIC_OR_ARRAY:
+            if (showOffsets) {
+                print(", offset=");
+                print(pos.offset);
+            }
+            print(", type_index=");
+            print(pos.type_index);
+            break;
+        // We don't need to worry abut these
+        case METHOD_RETURN_GENERIC_OR_ARRAY:
+        case FIELD_GENERIC_OR_ARRAY:
+            break;
+        case UNKNOWN:
+            break;
+        default:
+            throw new AssertionError("unknown type: " + pos.type);
+        }
+
+        // Append location data for generics/arrays.
+        if (pos.type.hasLocation()) {
+            print(", location=");
+            print(pos.location);
+        }
     }
 
     public void write(Annotation.element_value_pair pair) {
-        print("#" + pair.element_name_index + ":");
-        write(pair.value);
+        write(pair, false);
+    }
+
+    public void write(Annotation.element_value_pair pair, boolean resolveIndices) {
+        writeIndex(pair.element_name_index, resolveIndices);
+        print("=");
+        write(pair.value, resolveIndices);
     }
 
     public void write(Annotation.element_value value) {
-        ev_writer.write(value);
+        write(value, false);
+    }
+
+    public void write(Annotation.element_value value, boolean resolveIndices) {
+        ev_writer.write(value, resolveIndices);
+    }
+
+    private void writeDescriptor(int index, boolean resolveIndices) {
+        if (resolveIndices) {
+            try {
+                ConstantPool constant_pool = classWriter.getClassFile().constant_pool;
+                Descriptor d = new Descriptor(index);
+                print(d.getFieldType(constant_pool));
+                return;
+            } catch (ConstantPoolException ignore) {
+            } catch (InvalidDescriptor ignore) {
+            }
+        }
+
+        print("#" + index);
+    }
+
+    private void writeIndex(int index, boolean resolveIndices) {
+        if (resolveIndices) {
+            print(constantWriter.stringValue(index));
+        } else
+            print("#" + index);
     }
 
     element_value_Writer ev_writer = new element_value_Writer();
 
-    class element_value_Writer implements Annotation.element_value.Visitor<Void,Void> {
-        public void write(Annotation.element_value value) {
-            value.accept(this, null);
+    class element_value_Writer implements Annotation.element_value.Visitor<Void,Boolean> {
+        public void write(Annotation.element_value value, boolean resolveIndices) {
+            value.accept(this, resolveIndices);
         }
 
-        public Void visitPrimitive(Primitive_element_value ev, Void p) {
-            print(((char) ev.tag) + "#" + ev.const_value_index);
+        public Void visitPrimitive(Primitive_element_value ev, Boolean resolveIndices) {
+            if (resolveIndices)
+                writeIndex(ev.const_value_index, resolveIndices);
+            else
+                print(((char) ev.tag) + "#" + ev.const_value_index);
             return null;
         }
 
-        public Void visitEnum(Enum_element_value ev, Void p) {
-            print(((char) ev.tag) + "#" + ev.type_name_index + ".#" + ev.const_name_index);
+        public Void visitEnum(Enum_element_value ev, Boolean resolveIndices) {
+            if (resolveIndices) {
+                writeIndex(ev.type_name_index, resolveIndices);
+                print(".");
+                writeIndex(ev.const_name_index, resolveIndices);
+            } else
+                print(((char) ev.tag) + "#" + ev.type_name_index + ".#" + ev.const_name_index);
             return null;
         }
 
-        public Void visitClass(Class_element_value ev, Void p) {
-            print(((char) ev.tag) + "#" + ev.class_info_index);
+        public Void visitClass(Class_element_value ev, Boolean resolveIndices) {
+            if (resolveIndices) {
+                writeIndex(ev.class_info_index, resolveIndices);
+                print(".class");
+            } else
+                print(((char) ev.tag) + "#" + ev.class_info_index);
             return null;
         }
 
-        public Void visitAnnotation(Annotation_element_value ev, Void p) {
+        public Void visitAnnotation(Annotation_element_value ev, Boolean resolveIndices) {
             print((char) ev.tag);
-            AnnotationWriter.this.write(ev.annotation_value);
+            AnnotationWriter.this.write(ev.annotation_value, resolveIndices);
             return null;
         }
 
-        public Void visitArray(Array_element_value ev, Void p) {
+        public Void visitArray(Array_element_value ev, Boolean resolveIndices) {
             print("[");
             for (int i = 0; i < ev.num_values; i++) {
                 if (i > 0)
                     print(",");
-                write(ev.values[i]);
+                write(ev.values[i], resolveIndices);
             }
             print("]");
             return null;
         }
 
     }
+
+    private ClassWriter classWriter;
+    private ConstantWriter constantWriter;
 }
--- a/src/share/classes/com/sun/tools/javap/AttributeWriter.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/javap/AttributeWriter.java	Mon Sep 07 22:42:05 2009 -0700
@@ -41,7 +41,6 @@
 import com.sun.tools.classfile.Deprecated_attribute;
 import com.sun.tools.classfile.EnclosingMethod_attribute;
 import com.sun.tools.classfile.Exceptions_attribute;
-import com.sun.tools.classfile.Field;
 import com.sun.tools.classfile.InnerClasses_attribute;
 import com.sun.tools.classfile.LineNumberTable_attribute;
 import com.sun.tools.classfile.LocalVariableTable_attribute;
@@ -149,22 +148,26 @@
     }
 
     public Void visitAnnotationDefault(AnnotationDefault_attribute attr, Void ignore) {
-        println("  AnnotationDefault: ");
-        print("    default_value: ");
+        println("AnnotationDefault:");
+        indent(+1);
+        print("default_value: ");
         annotationWriter.write(attr.default_value);
+        indent(-1);
         return null;
     }
 
     public Void visitCharacterRangeTable(CharacterRangeTable_attribute attr, Void ignore) {
-        print("  CharacterRangeTable: ");
+        println("CharacterRangeTable:");
+        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) +
-                    "\t// ");
+                    Integer.toHexString(e.flags));
+            tab();
+            print("// ");
             print(e.start_pc + ", " +
                     e.end_pc + ", " +
                     (e.character_range_start >> 10) + ":" + (e.character_range_start & 0x3ff) + ", " +
@@ -187,16 +190,13 @@
                 print(", branch-true");
             if ((e.flags & CharacterRangeTable_attribute.CRT_BRANCH_FALSE) != 0)
                 print(", branch-false");
-
-
-
         }
+        indent(-1);
         return null;
     }
 
     public Void visitCode(Code_attribute attr, Void ignore) {
         codeWriter.write(attr, constant_pool);
-        println();
         return null;
     }
 
@@ -207,25 +207,23 @@
 
     public Void visitConstantValue(ConstantValue_attribute attr, Void ignore) {
         if (options.compat) // BUG 6622216 javap names some attributes incorrectly
-            print("  Constant value: ");
+            print("Constant value: ");
         else
-            print("  ConstantValue: ");
+            print("ConstantValue: ");
         constantWriter.write(attr.constantvalue_index);
-        if (!options.compat) // BUG 6622232 javap gets whitespace confused
-            println();
+        println();
         return null;
     }
 
     public Void visitDeprecated(Deprecated_attribute attr, Void ignore) {
-        if (!(options.compat && owner instanceof Field)) // BUG 6622232 javap gets whitespace confused
-            print("  ");
         println("Deprecated: true");
         return null;
     }
 
     public Void visitEnclosingMethod(EnclosingMethod_attribute attr, Void ignore) {
-        print("  EnclosingMethod: #" + attr.class_index + ".#" + attr.method_index
-                + "\t// " + getJavaClassName(attr));
+        print("EnclosingMethod: #" + attr.class_index + ".#" + attr.method_index);
+        tab();
+        print("// " + getJavaClassName(attr));
         if (attr.method_index != 0)
             print("." + getMethodName(attr));
         println();
@@ -249,15 +247,16 @@
     }
 
     public Void visitExceptions(Exceptions_attribute attr, Void ignore) {
-        println("  Exceptions: ");
-        print("   throws ");
+        println("Exceptions:");
+        indent(+1);
+        print("throws ");
         for (int i = 0; i < attr.number_of_exceptions; i++) {
             if (i > 0)
                 print(", ");
             print(getJavaException(attr, i));
         }
-        if (!options.compat) // BUG 6622232 javap gets whitespace confused
-            println();
+        println();
+        indent(-1);
         return null;
     }
 
@@ -290,8 +289,7 @@
                     writeInnerClassHeader();
                     first = false;
                 }
-                if (!options.compat) // BUG 6622232: javap gets whitespace confused
-                    print("   ");
+                print("   ");
                 for (String name: access_flags.getInnerClassModifiers())
                     print(name + " ");
                 if (info.inner_name_index!=0) {
@@ -313,6 +311,8 @@
                 println();
             }
         }
+        if (!first)
+            indent(-1);
         return null;
     }
 
@@ -325,26 +325,28 @@
     }
 
     private void writeInnerClassHeader() {
-        print("  ");
         if (options.compat) // BUG 6622216: javap names some attributes incorrectly
             print("InnerClass");
         else
             print("InnerClasses");
-        println(": ");
+        println(":");
+        indent(+1);
     }
 
     public Void visitLineNumberTable(LineNumberTable_attribute attr, Void ignore) {
-        println("  LineNumberTable: ");
+        println("LineNumberTable:");
+        indent(+1);
         for (LineNumberTable_attribute.Entry entry: attr.line_number_table) {
-            println("   line " + entry.line_number + ": " + entry.start_pc);
+            println("line " + entry.line_number + ": " + entry.start_pc);
         }
+        indent(-1);
         return null;
     }
 
     public Void visitLocalVariableTable(LocalVariableTable_attribute attr, Void ignore) {
-        println("  LocalVariableTable: ");
-        println("   Start  Length  Slot  Name   Signature");
-
+        println("LocalVariableTable:");
+        indent(+1);
+        println("Start  Length  Slot  Name   Signature");
         for (LocalVariableTable_attribute.Entry entry : attr.local_variable_table) {
             Formatter formatter = new Formatter();
             println(formatter.format("%8d %7d %5d %5s   %s",
@@ -352,25 +354,28 @@
                     constantWriter.stringValue(entry.name_index),
                     constantWriter.stringValue(entry.descriptor_index)));
         }
+        indent(-1);
         return null;
     }
 
     public Void visitLocalVariableTypeTable(LocalVariableTypeTable_attribute attr, Void ignore) {
-        println("  LocalVariableTypeTable: ");
-        println("   Start  Length  Slot  Name   Signature");
-
+        println("LocalVariableTypeTable:");
+        indent(+1);
+        println("Start  Length  Slot  Name   Signature");
         for (LocalVariableTypeTable_attribute.Entry entry : attr.local_variable_table) {
-            Formatter formatter = new Formatter();
-            println(formatter.format("%8d %7d %5d %5s   %s",
+            println(String.format("%5d %7d %5d %5s   %s",
                     entry.start_pc, entry.length, entry.index,
                     constantWriter.stringValue(entry.name_index),
                     constantWriter.stringValue(entry.signature_index)));
         }
+        indent(-1);
         return null;
     }
 
     public Void visitModule(Module_attribute attr, Void ignore) {
-        println("  Module: #" + attr.module_name + "\t// " + getModuleName(attr));
+        print("Module: #" + attr.module_name);
+        tab();
+        println("// " + getModuleName(attr));
         return null;
     }
 
@@ -383,11 +388,15 @@
     }
 
     public Void visitModuleExportTable(ModuleExportTable_attribute attr, Void ignore) {
-        println("  ModuleExportTable:");
-        println("    Types: (" + attr.export_type_table.length + ")");
+        println("ModuleExportTable:");
+        indent(+1);
+        println("Types: (" + attr.export_type_table.length + ")");
         for (int i = 0; i < attr.export_type_table.length; i++) {
-            println("      #" + attr.export_type_table[i] + "\t// " + getExportTypeName(attr, i));
+            print("#" + attr.export_type_table[i]);
+            tab();
+            println("// " + getExportTypeName(attr, i));
         }
+        indent(-1);
         return null;
     }
 
@@ -400,11 +409,15 @@
     }
 
     public Void visitModuleMemberTable(ModuleMemberTable_attribute attr, Void ignore) {
-        println("  ModuleMemberTable:");
-        println("    Packages: (" + attr.package_member_table.length + ")");
+        println("ModuleMemberTable:");
+        indent(+1);
+        println("Packages: (" + attr.package_member_table.length + ")");
         for (int i = 0; i < attr.package_member_table.length; i++) {
-            println("      #" + attr.package_member_table[i] + "\t// " + getPackageMemberName(attr, i));
+            print("#" + attr.package_member_table[i]);
+            tab();
+            println("// " + getPackageMemberName(attr, i));
         }
+        indent(-1);
         return null;
     }
 
@@ -417,73 +430,91 @@
     }
 
     public Void visitRuntimeVisibleAnnotations(RuntimeVisibleAnnotations_attribute attr, Void ignore) {
-        println("  RuntimeVisibleAnnotations: ");
+        println("RuntimeVisibleAnnotations:");
+        indent(+1);
         for (int i = 0; i < attr.annotations.length; i++) {
-            print("    " + i + ": ");
+            print(i + ": ");
             annotationWriter.write(attr.annotations[i]);
             println();
         }
+        indent(-1);
         return null;
     }
 
     public Void visitRuntimeInvisibleAnnotations(RuntimeInvisibleAnnotations_attribute attr, Void ignore) {
-        println("  RuntimeInvisibleAnnotations: ");
+        println("RuntimeInvisibleAnnotations:");
+        indent(+1);
         for (int i = 0; i < attr.annotations.length; i++) {
-            print("    " + i + ": ");
+            print(i + ": ");
             annotationWriter.write(attr.annotations[i]);
             println();
         }
+        indent(-1);
         return null;
     }
 
     public Void visitRuntimeVisibleTypeAnnotations(RuntimeVisibleTypeAnnotations_attribute attr, Void ignore) {
-        println("  RuntimeVisibleTypeAnnotations: ");
+        println("RuntimeVisibleTypeAnnotations:");
+        indent(+1);
         for (int i = 0; i < attr.annotations.length; i++) {
-            print("    " + i + ": ");
+            print(i + ": ");
             annotationWriter.write(attr.annotations[i]);
             println();
         }
+        indent(-1);
         return null;
     }
 
     public Void visitRuntimeInvisibleTypeAnnotations(RuntimeInvisibleTypeAnnotations_attribute attr, Void ignore) {
-        println("  RuntimeInvisibleTypeAnnotations: ");
+        println("RuntimeInvisibleTypeAnnotations:");
+        indent(+1);
         for (int i = 0; i < attr.annotations.length; i++) {
-            print("    " + i + ": ");
+            print(i + ": ");
             annotationWriter.write(attr.annotations[i]);
             println();
         }
+        indent(-1);
         return null;
     }
 
     public Void visitRuntimeVisibleParameterAnnotations(RuntimeVisibleParameterAnnotations_attribute attr, Void ignore) {
-        println("  RuntimeVisibleParameterAnnotations: ");
+        println("RuntimeVisibleParameterAnnotations:");
+        indent(+1);
         for (int param = 0; param < attr.parameter_annotations.length; param++) {
-            println("    parameter " + param + ": ");
+            println("parameter " + param + ": ");
+            indent(+1);
             for (int i = 0; i < attr.parameter_annotations[param].length; i++) {
-                print("    " + i + ": ");
+                print(i + ": ");
                 annotationWriter.write(attr.parameter_annotations[param][i]);
                 println();
             }
+            indent(-1);
         }
+        indent(-1);
         return null;
     }
 
     public Void visitRuntimeInvisibleParameterAnnotations(RuntimeInvisibleParameterAnnotations_attribute attr, Void ignore) {
-        println("  RuntimeInvisibleParameterAnnotations: ");
+        println("RuntimeInvisibleParameterAnnotations:");
+        indent(+1);
         for (int param = 0; param < attr.parameter_annotations.length; param++) {
-            println("    " + param + ": ");
+            println(param + ": ");
+            indent(+1);
             for (int i = 0; i < attr.parameter_annotations[param].length; i++) {
-                print("    " + i + ": ");
+                print(i + ": ");
                 annotationWriter.write(attr.parameter_annotations[param][i]);
                 println();
             }
+            indent(-1);
         }
+        indent(-1);
         return null;
     }
 
     public Void visitSignature(Signature_attribute attr, Void ignore) {
-        println("  Signature: #" + attr.signature_index + "\t// " + getSignature(attr));
+        print("Signature: #" + attr.signature_index);
+        tab();
+        println("// " + getSignature(attr));
         return null;
     }
 
@@ -496,12 +527,12 @@
     }
 
     public Void visitSourceDebugExtension(SourceDebugExtension_attribute attr, Void ignore) {
-        println("  SourceDebugExtension: " + attr.getValue());
+        println("SourceDebugExtension: " + attr.getValue());
         return null;
     }
 
     public Void visitSourceFile(SourceFile_attribute attr, Void ignore) {
-        println("  SourceFile: \"" + getSourceFile(attr) + "\"");
+        println("SourceFile: \"" + getSourceFile(attr) + "\"");
         return null;
     }
 
@@ -519,24 +550,26 @@
     }
 
     public Void visitStackMap(StackMap_attribute attr, Void ignore) {
-        println("  StackMap: number_of_entries = " + attr.number_of_entries);
-
+        println("StackMap: number_of_entries = " + attr.number_of_entries);
+        indent(+1);
         StackMapTableWriter w = new StackMapTableWriter();
         for (StackMapTable_attribute.stack_map_frame entry : attr.entries) {
             w.write(entry);
         }
         println();
+        indent(-1);
         return null;
     }
 
     public Void visitStackMapTable(StackMapTable_attribute attr, Void ignore) {
-        println("  StackMapTable: number_of_entries = " + attr.number_of_entries);
-
+        println("StackMapTable: number_of_entries = " + attr.number_of_entries);
+        indent(+1);
         StackMapTableWriter w = new StackMapTableWriter();
         for (StackMapTable_attribute.stack_map_frame entry : attr.entries) {
             w.write(entry);
         }
         println();
+        indent(-1);
         return null;
     }
 
@@ -555,29 +588,37 @@
         public Void visit_same_locals_1_stack_item_frame(StackMapTable_attribute.same_locals_1_stack_item_frame frame, Void p) {
             printHeader(frame);
             println(" /* same_locals_1_stack_item */");
+            indent(+1);
             printMap("stack", frame.stack);
+            indent(-1);
             return null;
         }
 
         public Void visit_same_locals_1_stack_item_frame_extended(StackMapTable_attribute.same_locals_1_stack_item_frame_extended frame, Void p) {
             printHeader(frame);
             println(" /* same_locals_1_stack_item_frame_extended */");
-            println("     offset_delta = " + frame.offset_delta);
+            indent(+1);
+            println("offset_delta = " + frame.offset_delta);
             printMap("stack", frame.stack);
+            indent(-1);
             return null;
         }
 
         public Void visit_chop_frame(StackMapTable_attribute.chop_frame frame, Void p) {
             printHeader(frame);
             println(" /* chop */");
-            println("     offset_delta = " + frame.offset_delta);
+            indent(+1);
+            println("offset_delta = " + frame.offset_delta);
+            indent(-1);
             return null;
         }
 
         public Void visit_same_frame_extended(StackMapTable_attribute.same_frame_extended frame, Void p) {
             printHeader(frame);
             println(" /* same_frame_extended */");
-            println("     offset_delta = " + frame.offset_delta);
+            indent(+1);
+            println("offset_delta = " + frame.offset_delta);
+            indent(-1);
             return null;
         }
 
@@ -592,13 +633,16 @@
         public Void visit_full_frame(StackMapTable_attribute.full_frame frame, Void p) {
             printHeader(frame);
             if (frame instanceof StackMap_attribute.stack_map_frame) {
-                println("     offset = " + frame.offset_delta);
+                indent(+1);
+                println(" offset = " + frame.offset_delta);
             } else {
                 println(" /* full_frame */");
-                println("     offset_delta = " + frame.offset_delta);
+                indent(+1);
+                println("offset_delta = " + frame.offset_delta);
             }
             printMap("locals", frame.locals);
             printMap("stack", frame.stack);
+            indent(-1);
             return null;
         }
 
@@ -607,7 +651,7 @@
         }
 
         void printMap(String name, StackMapTable_attribute.verification_type_info[] map) {
-            print("     " + name + " = [");
+            print(name + " = [");
             for (int i = 0; i < map.length; i++) {
                 StackMapTable_attribute.verification_type_info info = map[i];
                 int tag = info.tag;
--- a/src/share/classes/com/sun/tools/javap/BasicWriter.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/javap/BasicWriter.java	Mon Sep 07 22:42:05 2009 -0700
@@ -71,6 +71,18 @@
         lineWriter.println();
     }
 
+    protected void indent(int delta) {
+        lineWriter.indent(delta);
+    }
+
+    protected void tab() {
+        lineWriter.tab();
+    }
+
+    protected void setPendingNewline(boolean b) {
+        lineWriter.pendingNewline = b;
+    }
+
     protected String report(AttributeException e) {
         out.println("Error: " + e.getMessage()); // i18n?
         return "???";
@@ -122,19 +134,30 @@
 
         protected LineWriter(Context context) {
             context.put(LineWriter.class, this);
+            Options options = Options.instance(context);
+            indentWidth = options.indentWidth;
+            tabColumn = options.tabColumn;
             out = context.get(PrintWriter.class);
             buffer = new StringBuilder();
         }
 
         protected void print(String s) {
+            if (pendingNewline) {
+                println();
+                pendingNewline = false;
+            }
             if (s == null)
                 s = "null";
             for (int i = 0; i < s.length(); i++) {
                 char c = s.charAt(i);
-                if (c == '\n') {
-                    println();
-                } else {
-                    buffer.append(c);
+                switch (c) {
+                    case '\n':
+                        println();
+                        break;
+                    default:
+                        if (buffer.length() == 0)
+                            indent();
+                        buffer.append(c);
                 }
             }
 
@@ -145,8 +168,31 @@
             buffer.setLength(0);
         }
 
+        protected void indent(int delta) {
+            indentCount += delta;
+        }
+
+        protected void tab() {
+            if (buffer.length() == 0)
+                indent();
+            space(indentCount * indentWidth + tabColumn - buffer.length());
+        }
+
+        private void indent() {
+            space(indentCount * indentWidth);
+        }
+
+        private void space(int n) {
+            for (int i = 0; i < n; i++)
+                buffer.append(' ');
+        }
+
         private PrintWriter out;
         private StringBuilder buffer;
+        private int indentCount;
+        private int indentWidth;
+        private int tabColumn;
+        private boolean pendingNewline;
     }
 }
 
--- a/src/share/classes/com/sun/tools/javap/ClassWriter.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/javap/ClassWriter.java	Mon Sep 07 22:42:05 2009 -0700
@@ -120,6 +120,7 @@
                 else
                     println("Classfile " + uri);
             }
+            indent(+1);
             if (lastModified != -1) {
                 Date lm = new Date(lastModified);
                 DateFormat df = DateFormat.getDateInstance();
@@ -144,6 +145,10 @@
             println("Compiled from \"" + getSourceFile((SourceFile_attribute) sfa) + "\"");
         }
 
+        if ((options.sysInfo || options.verbose) && !options.compat) {
+            indent(-1);
+        }
+
         String name = getJavaName(classFile);
         AccessFlags flags = cf.access_flags;
 
@@ -186,23 +191,24 @@
 
         if (options.verbose) {
             println();
+            indent(+1);
             attrWriter.write(cf, cf.attributes, constant_pool);
-            println("  minor version: " + cf.minor_version);
-            println("  major version: " + cf.major_version);
+            println("minor version: " + cf.minor_version);
+            println("major version: " + cf.major_version);
             if (!options.compat)
-              writeList("  flags: ", flags.getClassFlags(), NEWLINE);
+              writeList("flags: ", flags.getClassFlags(), NEWLINE);
+            indent(-1);
             constantWriter.writeConstantPool();
-            println();
         } else {
-            if (!options.compat)
-                print(" ");
+            print(" ");
         }
 
         println("{");
+        indent(+1);
         writeFields();
         writeMethods();
+        indent(-1);
         println("}");
-        println();
     }
 
     protected void writeFields() {
@@ -215,14 +221,6 @@
         if (!options.checkAccess(f.access_flags))
             return;
 
-        if (!(options.showLineAndLocalVariableTables
-                || options.showDisassembled
-                || options.verbose
-                || options.showInternalSignatures
-                || options.showAllAttrs)) {
-            print("    ");
-        }
-
         AccessFlags flags = f.access_flags;
         writeModifiers(flags.getFieldModifiers());
         Signature_attribute sigAttr = getSignature(f.attributes);
@@ -251,11 +249,13 @@
         print(";");
         println();
 
+        indent(+1);
+
         if (options.showInternalSignatures)
-            println("  Signature: " + getValue(f.descriptor));
+            println("Signature: " + getValue(f.descriptor));
 
         if (options.verbose && !options.compat)
-            writeList("  flags: ", flags.getFieldFlags(), NEWLINE);
+            writeList("flags: ", flags.getFieldFlags(), NEWLINE);
 
         if (options.showAllAttrs) {
             for (Attribute attr: f.attributes)
@@ -263,6 +263,8 @@
             println();
         }
 
+        indent(-1);
+
         if (options.showDisassembled || options.showLineAndLocalVariableTables)
             println();
     }
@@ -270,6 +272,7 @@
     protected void writeMethods() {
         for (Method m: classFile.methods)
             writeMethod(m);
+        setPendingNewline(false);
     }
 
     protected void writeMethod(Method m) {
@@ -278,14 +281,6 @@
 
         method = m;
 
-        if (!(options.showLineAndLocalVariableTables
-                || options.showDisassembled
-                || options.verbose
-                || options.showInternalSignatures
-                || options.showAllAttrs)) {
-            print("    ");
-        }
-
         AccessFlags flags = m.access_flags;
 
         Descriptor d;
@@ -333,16 +328,6 @@
         if (e_attr != null) { // if there are generic exceptions, there must be erased exceptions
             if (e_attr instanceof Exceptions_attribute) {
                 Exceptions_attribute exceptions = (Exceptions_attribute) e_attr;
-                if (options.compat) { // Bug XXXXXXX whitespace
-                    if (!(options.showLineAndLocalVariableTables
-                            || options.showDisassembled
-                            || options.verbose
-                            || options.showInternalSignatures
-                            || options.showAllAttrs)) {
-                        print("    ");
-                    }
-                    print("  ");
-                }
                 print(" throws ");
                 if (methodExceptions != null) { // use generic list if available
                     writeList("", methodExceptions, "");
@@ -358,14 +343,17 @@
             }
         }
 
-        print(";");
-        println();
+        println(";");
 
-        if (options.showInternalSignatures)
-            println("  Signature: " + getValue(m.descriptor));
+        indent(+1);
 
-        if (options.verbose && !options.compat)
-            writeList("  flags: ", flags.getMethodFlags(), NEWLINE);
+        if (options.showInternalSignatures) {
+            println("Signature: " + getValue(m.descriptor));
+        }
+
+        if (options.verbose && !options.compat) {
+            writeList("flags: ", flags.getMethodFlags(), NEWLINE);
+        }
 
         Code_attribute code = null;
         Attribute c_attr = m.attributes.get(Attribute.Code);
@@ -378,33 +366,35 @@
 
         if (options.showDisassembled && !options.showAllAttrs) {
             if (code != null) {
-                println("  Code:");
+                println("Code:");
                 codeWriter.writeInstrs(code);
                 codeWriter.writeExceptionTable(code);
             }
-            println();
         }
 
         if (options.showLineAndLocalVariableTables) {
-            if (code != null)
+            if (code != null) {
                 attrWriter.write(code, code.attributes.get(Attribute.LineNumberTable), constant_pool);
-            println();
-            if (code != null)
                 attrWriter.write(code, code.attributes.get(Attribute.LocalVariableTable), constant_pool);
-            println();
-            println();
+            }
         }
 
         if (options.showAllAttrs) {
             Attribute[] attrs = m.attributes.attrs;
             for (Attribute attr: attrs)
                 attrWriter.write(m, attr, constant_pool);
+        }
 
-//            // the following condition is to mimic old javap
-//            if (!(attrs.length > 0 &&
-//                    attrs[attrs.length - 1] instanceof Exceptions_attribute))
-            println();
-        }
+        indent(-1);
+
+        // set pendingNewline to write a newline before the next method (if any)
+        // if a separator is desired
+        setPendingNewline(
+                options.showDisassembled ||
+                options.showAllAttrs ||
+                options.showInternalSignatures ||
+                options.showLineAndLocalVariableTables ||
+                options.verbose);
     }
 
     void writeModifiers(Collection<String> items) {
--- a/src/share/classes/com/sun/tools/javap/CodeWriter.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/javap/CodeWriter.java	Mon Sep 07 22:42:05 2009 -0700
@@ -64,15 +64,18 @@
         stackMapWriter = StackMapWriter.instance(context);
         localVariableTableWriter = LocalVariableTableWriter.instance(context);
         localVariableTypeTableWriter = LocalVariableTypeTableWriter.instance(context);
+        typeAnnotationWriter = TypeAnnotationWriter.instance(context);
         options = Options.instance(context);
     }
 
     void write(Code_attribute attr, ConstantPool constant_pool) {
-        println("  Code:");
+        println("Code:");
+        indent(+1);
         writeVerboseHeader(attr, constant_pool);
         writeInstrs(attr);
         writeExceptionTable(attr);
         attrWriter.write(attr, attr.attributes, constant_pool);
+        indent(-1);
     }
 
     public void writeVerboseHeader(Code_attribute attr, ConstantPool constant_pool) {
@@ -89,9 +92,9 @@
             argCount = report(e);
         }
 
-        println("   Stack=" + attr.max_stack +
-                ", Locals=" + attr.max_locals +
-                ", Args_size=" + argCount);
+        println("stack=" + attr.max_stack +
+                ", locals=" + attr.max_locals +
+                ", args_size=" + argCount);
 
     }
 
@@ -114,8 +117,7 @@
     }
 
     public void writeInstr(Instruction instr) {
-        print("   " + instr.getPC() + ":\t");
-        print(instr.getMnemonic());
+        print(String.format("%4d: %-13s ", instr.getPC(), instr.getMnemonic()));
         instr.accept(instructionPrinter, null);
         println();
     }
@@ -133,54 +135,62 @@
         }
 
         public Void visitBranch(Instruction instr, int offset, Void p) {
-            print("\t" + (instr.getPC() + offset));
+            print((instr.getPC() + offset));
             return null;
         }
 
         public Void visitConstantPoolRef(Instruction instr, int index, Void p) {
-            print("\t#" + index + "; //");
+            print("#" + index);
+            tab();
+            print("// ");
             printConstant(index);
             return null;
         }
 
         public Void visitConstantPoolRefAndValue(Instruction instr, int index, int value, Void p) {
-            print("\t#" + index + ",  " + value + "; //");
+            print("#" + index + ",  " + value);
+            tab();
+            print("// ");
             printConstant(index);
             return null;
         }
 
         public Void visitLocal(Instruction instr, int index, Void p) {
-            print("\t" + index);
+            print(index);
             return null;
         }
 
         public Void visitLocalAndValue(Instruction instr, int index, int value, Void p) {
-            print("\t" + index + ", " + value);
+            print(index + ", " + value);
             return null;
         }
 
         public Void visitLookupSwitch(Instruction instr, int default_, int npairs, int[] matches, int[] offsets) {
             int pc = instr.getPC();
-            print("{ //" + npairs);
+            print("{ // " + npairs);
+            indent(+1);
             for (int i = 0; i < npairs; i++) {
-                print("\n\t\t" + matches[i] + ": " + (pc + offsets[i]) + ";");
+                print("\n" + matches[i] + ": " + (pc + offsets[i]));
             }
-            print("\n\t\tdefault: " + (pc + default_) + " }");
+            print("\ndefault: " + (pc + default_) + " }");
+            indent(-1);
             return null;
         }
 
         public Void visitTableSwitch(Instruction instr, int default_, int low, int high, int[] offsets) {
             int pc = instr.getPC();
             print("{ //" + low + " to " + high);
+            indent(+1);
             for (int i = 0; i < offsets.length; i++) {
-                print("\n\t\t" + (low + i) + ": " + (pc + offsets[i]) + ";");
+                print("\n" + (low + i) + ": " + (pc + offsets[i]));
             }
-            print("\n\t\tdefault: " + (pc + default_) + " }");
+            print("\ndefault: " + (pc + default_) + " }");
+            indent(-1);
             return null;
         }
 
         public Void visitValue(Instruction instr, int value, Void p) {
-            print("\t" + value);
+            print(value);
             return null;
         }
 
@@ -192,13 +202,13 @@
 
     public void writeExceptionTable(Code_attribute attr) {
         if (attr.exception_table_langth > 0) {
-            println("  Exception table:");
-            println("   from   to  target type");
+            println("Exception table:");
+            indent(+1);
+            println(" from    to  target type");
             for (int i = 0; i < attr.exception_table.length; i++) {
                 Code_attribute.Exception_data handler = attr.exception_table[i];
-                printFixedWidthInt(handler.start_pc, 6);
-                printFixedWidthInt(handler.end_pc, 6);
-                printFixedWidthInt(handler.handler_pc, 6);
+                print(String.format(" %5d %5d %5d",
+                        handler.start_pc, handler.end_pc, handler.handler_pc));
                 print("   ");
                 int catch_type = handler.catch_type;
                 if (catch_type == 0) {
@@ -206,9 +216,9 @@
                 } else {
                     print("Class ");
                     println(constantWriter.stringValue(catch_type));
-                    println("");
                 }
             }
+            indent(-1);
         }
 
     }
@@ -217,13 +227,6 @@
         constantWriter.write(index);
     }
 
-    private void printFixedWidthInt(int n, int width) {
-        String s = String.valueOf(n);
-        for (int i = s.length(); i < width; i++)
-            print(" ");
-        print(s);
-    }
-
     private List<InstructionDetailWriter> getDetailWriters(Code_attribute attr) {
         List<InstructionDetailWriter> detailWriters =
                 new ArrayList<InstructionDetailWriter>();
@@ -253,6 +256,11 @@
             detailWriters.add(tryBlockWriter);
         }
 
+        if (options.details.contains(InstructionDetailWriter.Kind.TYPE_ANNOS)) {
+            typeAnnotationWriter.reset(attr);
+            detailWriters.add(typeAnnotationWriter);
+        }
+
         return detailWriters;
     }
 
@@ -261,6 +269,7 @@
     private ConstantWriter constantWriter;
     private LocalVariableTableWriter localVariableTableWriter;
     private LocalVariableTypeTableWriter localVariableTypeTableWriter;
+    private TypeAnnotationWriter typeAnnotationWriter;
     private SourceWriter sourceWriter;
     private StackMapWriter stackMapWriter;
     private TryBlockWriter tryBlockWriter;
--- a/src/share/classes/com/sun/tools/javap/ConstantWriter.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/javap/ConstantWriter.java	Mon Sep 07 22:42:05 2009 -0700
@@ -62,73 +62,88 @@
     protected void writeConstantPool(ConstantPool constant_pool) {
         ConstantPool.Visitor<Integer, Void> v = new ConstantPool.Visitor<Integer,Void>() {
             public Integer visitClass(CONSTANT_Class_info info, Void p) {
-                println("#" + info.name_index + ";\t//  " + stringValue(info));
+                print("#" + info.name_index);
+                tab();
+                println("//  " + stringValue(info));
                 return 1;
             }
 
             public Integer visitDouble(CONSTANT_Double_info info, Void p) {
-                println(stringValue(info) + ";");
+                println(stringValue(info));
                 return 2;
             }
 
             public Integer visitFieldref(CONSTANT_Fieldref_info info, Void p) {
-                println("#" + info.class_index + ".#" + info.name_and_type_index + ";\t//  " + stringValue(info));
+                print("#" + info.class_index + ".#" + info.name_and_type_index);
+                tab();
+                println("//  " + stringValue(info));
                 return 1;
             }
 
             public Integer visitFloat(CONSTANT_Float_info info, Void p) {
-                println(stringValue(info) + ";");
+                println(stringValue(info));
                 return 1;
             }
 
             public Integer visitInteger(CONSTANT_Integer_info info, Void p) {
-                println(stringValue(info) + ";");
+                println(stringValue(info));
                 return 1;
             }
 
             public Integer visitInterfaceMethodref(CONSTANT_InterfaceMethodref_info info, Void p) {
-                println("#" + info.class_index + ".#" + info.name_and_type_index + ";\t//  " + stringValue(info));
+                print("#" + info.class_index + ".#" + info.name_and_type_index);
+                tab();
+                println("//  " + stringValue(info));
                 return 1;
             }
 
             public Integer visitLong(CONSTANT_Long_info info, Void p) {
-                println(stringValue(info) + ";");
+                println(stringValue(info));
                 return 2;
             }
 
             public Integer visitNameAndType(CONSTANT_NameAndType_info info, Void p) {
-                String tab = (options.compat ? "" : "\t"); // BUG 6622232 javap gets whitespace confused
-                println("#" + info.name_index + ":#" + info.type_index + ";" + tab + "//  " + stringValue(info));
+                print("#" + info.name_index + ":#" + info.type_index);
+                tab();
+                println("//  " + stringValue(info));
                 return 1;
             }
 
             public Integer visitMethodref(CONSTANT_Methodref_info info, Void p) {
-                println("#" + info.class_index + ".#" + info.name_and_type_index + ";\t//  " + stringValue(info));
+                print("#" + info.class_index + ".#" + info.name_and_type_index);
+                tab();
+                println("//  " + stringValue(info));
                 return 1;
             }
 
             public Integer visitString(CONSTANT_String_info info, Void p) {
-                println("#" + info.string_index + ";\t//  " + stringValue(info));
+                print("#" + info.string_index);
+                tab();
+                println("//  " + stringValue(info));
                 return 1;
             }
 
             public Integer visitUtf8(CONSTANT_Utf8_info info, Void p) {
-                println(stringValue(info) + ";");
+                println(stringValue(info));
                 return 1;
             }
 
         };
-        println("  Constant pool:");
+        println("Constant pool:");
+        indent(+1);
+        int width = String.valueOf(constant_pool.size()).length() + 1;
         int cpx = 1;
         while (cpx < constant_pool.size()) {
+            print(String.format("%" + width + "s", ("#" + cpx)));
             try {
                 CPInfo cpInfo = constant_pool.get(cpx);
-                print("const #" + cpx + " = " + tagName(cpInfo.getTag()) + "\t");
+                print(String.format(" = %-18s ", cpTagName(cpInfo)));
                 cpx += cpInfo.accept(v, null);
             } catch (ConstantPool.InvalidIndex ex) {
-                print("const #" + cpx); // should not happen
+                // should not happen
             }
         }
+        indent(-1);
     }
 
     protected void write(int cpx) {
@@ -163,10 +178,15 @@
         print(tagName(tag) + " " + stringValue(cpInfo));
     }
 
+    String cpTagName(CPInfo cpInfo) {
+        String n = cpInfo.getClass().getSimpleName();
+        return n.replace("CONSTANT_", "").replace("_info", "");
+    }
+
     String tagName(int tag) {
         switch (tag) {
             case CONSTANT_Utf8:
-                return "Asciz";
+                return "Utf8";
             case CONSTANT_Integer:
                 return "int";
             case CONSTANT_Float:
@@ -188,7 +208,7 @@
             case CONSTANT_NameAndType:
                 return "NameAndType";
             default:
-                return "unknown tag";
+                return "(unknown tag)";
         }
     }
 
--- a/src/share/classes/com/sun/tools/javap/InstructionDetailWriter.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/javap/InstructionDetailWriter.java	Mon Sep 07 22:42:05 2009 -0700
@@ -42,7 +42,8 @@
         LOCAL_VAR_TYPES("localVariableTypes"),
         SOURCE("source"),
         STACKMAPS("stackMaps"),
-        TRY_BLOCKS("tryBlocks");
+        TRY_BLOCKS("tryBlocks"),
+        TYPE_ANNOS("typeAnnotations");
         Kind(String option) {
             this.option = option;
         }
--- a/src/share/classes/com/sun/tools/javap/JavapFileManager.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/javap/JavapFileManager.java	Mon Sep 07 22:42:05 2009 -0700
@@ -41,12 +41,13 @@
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
-class JavapFileManager extends JavacFileManager {
+public class JavapFileManager extends JavacFileManager {
     private JavapFileManager(Context context, Charset charset) {
         super(context, true, charset);
+        setIgnoreSymbolFile(true);
     }
 
-    static JavapFileManager create(final DiagnosticListener<? super JavaFileObject> dl, PrintWriter log, Options options) {
+    public static JavapFileManager create(final DiagnosticListener<? super JavaFileObject> dl, PrintWriter log) {
         Context javac_context = new Context();
 
         if (dl != null)
--- a/src/share/classes/com/sun/tools/javap/JavapTask.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/javap/JavapTask.java	Mon Sep 07 22:42:05 2009 -0700
@@ -32,8 +32,10 @@
 import java.io.IOException;
 import java.io.OutputStream;
 import java.io.PrintWriter;
+import java.io.Reader;
 import java.io.StringWriter;
 import java.io.Writer;
+import java.net.URI;
 import java.security.DigestInputStream;
 import java.security.MessageDigest;
 import java.security.NoSuchAlgorithmException;
@@ -49,6 +51,8 @@
 import java.util.MissingResourceException;
 import java.util.ResourceBundle;
 
+import javax.lang.model.element.Modifier;
+import javax.lang.model.element.NestingKind;
 import javax.tools.Diagnostic;
 import javax.tools.DiagnosticListener;
 import javax.tools.JavaFileManager;
@@ -57,6 +61,9 @@
 import javax.tools.StandardLocation;
 
 import com.sun.tools.classfile.*;
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.net.URLConnection;
 
 /**
  *  "Main" class for javap, normally accessed from the command line
@@ -235,12 +242,6 @@
             }
         },
 
-        new Option(false, "-XDignore.symbol.file") {
-            void process(JavapTask task, String opt, String arg) {
-                task.options.ignoreSymbolFile = true;
-            }
-        },
-
         new Option(false, "-XDdetails") {
             void process(JavapTask task, String opt, String arg) {
                 task.options.details = EnumSet.allOf(InstructionDetailWriter.Kind.class);
@@ -295,6 +296,44 @@
             void process(JavapTask task, String opt, String arg) {
                 task.options.showConstants = true;
             }
+        },
+
+        new Option(false, "-XDinner") {
+            void process(JavapTask task, String opt, String arg) {
+                task.options.showInnerClasses = true;
+            }
+        },
+
+        new Option(false, "-XDindent:") {
+            @Override
+            boolean matches(String opt) {
+                int sep = opt.indexOf(":");
+                return sep != -1 && super.matches(opt.substring(0, sep + 1));
+            }
+
+            void process(JavapTask task, String opt, String arg) throws BadArgs {
+                int sep = opt.indexOf(":");
+                try {
+                    task.options.indentWidth = Integer.valueOf(opt.substring(sep + 1));
+                } catch (NumberFormatException e) {
+                }
+            }
+        },
+
+        new Option(false, "-XDtab:") {
+            @Override
+            boolean matches(String opt) {
+                int sep = opt.indexOf(":");
+                return sep != -1 && super.matches(opt.substring(0, sep + 1));
+            }
+
+            void process(JavapTask task, String opt, String arg) throws BadArgs {
+                int sep = opt.indexOf(":");
+                try {
+                    task.options.tabColumn = Integer.valueOf(opt.substring(sep + 1));
+                } catch (NumberFormatException e) {
+                }
+            }
         }
 
     };
@@ -322,17 +361,17 @@
             Iterable<String> classes) {
         this(out, fileManager, diagnosticListener);
 
+        this.classes = new ArrayList<String>();
+        for (String classname: classes) {
+            classname.getClass(); // null-check
+            this.classes.add(classname);
+        }
+
         try {
             handleOptions(options, false);
         } catch (BadArgs e) {
             throw new IllegalArgumentException(e.getMessage());
         }
-
-        this.classes = new ArrayList<String>();
-        for (String classname: classes) {
-            classname.getClass(); // null-check
-            this.classes.add(classname);
-        }
     }
 
     public void setLocale(Locale locale) {
@@ -378,10 +417,18 @@
         final PrintWriter pw = getPrintWriterForWriter(w);
         return new DiagnosticListener<JavaFileObject> () {
             public void report(Diagnostic<? extends JavaFileObject> diagnostic) {
-                if (diagnostic.getKind() == Diagnostic.Kind.ERROR) {
+                switch (diagnostic.getKind()) {
+                    case ERROR:
                         pw.print(getMessage("err.prefix"));
-                    pw.print(" ");
+                        break;
+                    case WARNING:
+                        pw.print(getMessage("warn.prefix"));
+                        break;
+                    case NOTE:
+                        pw.print(getMessage("note.prefix"));
+                        break;
                 }
+                pw.print(" ");
                 pw.println(diagnostic.getMessage(null));
             }
         };
@@ -411,7 +458,7 @@
             boolean ok = run();
             return ok ? EXIT_OK : EXIT_ERROR;
         } catch (BadArgs e) {
-            diagnosticListener.report(createDiagnostic(e.key, e.args));
+            reportError(e.key, e.args);
             if (e.showUsage) {
                 log.println(getMessage("main.usage.summary", progname));
             }
@@ -425,7 +472,7 @@
                 e_args[0] = e.getCause();
                 System.arraycopy(e.args, 0, e_args, 1, e.args.length);
             }
-            diagnosticListener.report(createDiagnostic("err.internal.error", e_args));
+            reportError("err.internal.error", e_args);
             return EXIT_ABNORMAL;
         } finally {
             log.flush();
@@ -477,9 +524,6 @@
             throw new BadArgs("err.incompatible.options", sb);
         }
 
-        if (options.ignoreSymbolFile && fileManager instanceof JavapFileManager)
-            ((JavapFileManager) fileManager).setIgnoreSymbolFile(true);
-
         if ((classes == null || classes.size() == 0) &&
                 !(noArgs || options.help || options.version || options.fullVersion)) {
             throw new BadArgs("err.no.classes.specified");
@@ -530,64 +574,37 @@
         SourceWriter sourceWriter = SourceWriter.instance(context);
         sourceWriter.setFileManager(fileManager);
 
+        attributeFactory.setCompat(options.compat);
+        attributeFactory.setJSR277(options.jsr277);
+
         boolean ok = true;
 
         for (String className: classes) {
             JavaFileObject fo;
             try {
-                if (className.endsWith(".class")) {
-                    if (fileManager instanceof StandardJavaFileManager) {
-                        StandardJavaFileManager sfm = (StandardJavaFileManager) fileManager;
-                        fo = sfm.getJavaFileObjects(className).iterator().next();
-                    } else {
-                       diagnosticListener.report(createDiagnostic("err.not.standard.file.manager", className));
-                       ok = false;
-                       continue;
-                    }
-                } else {
-                    fo = getClassFileObject(className);
-                    if (fo == null) {
-                        // see if it is an inner class, by replacing dots to $, starting from the right
-                        String cn = className;
-                        int lastDot;
-                        while (fo == null && (lastDot = cn.lastIndexOf(".")) != -1) {
-                            cn = cn.substring(0, lastDot) + "$" + cn.substring(lastDot + 1);
-                            fo = getClassFileObject(cn);
-                        }
-                    }
-                    if (fo == null) {
-                       diagnosticListener.report(createDiagnostic("err.class.not.found", className));
-                       ok = false;
-                       continue;
-                    }
-                }
-                attributeFactory.setCompat(options.compat);
-                attributeFactory.setJSR277(options.jsr277);
-
-                write(read(fo));
-
+                writeClass(classWriter, className);
             } catch (ConstantPoolException e) {
-                diagnosticListener.report(createDiagnostic("err.bad.constant.pool", className, e.getLocalizedMessage()));
+                reportError("err.bad.constant.pool", className, e.getLocalizedMessage());
                 ok = false;
             } catch (EOFException e) {
-                diagnosticListener.report(createDiagnostic("err.end.of.file", className));
+                reportError("err.end.of.file", className);
                 ok = false;
             } catch (FileNotFoundException e) {
-                diagnosticListener.report(createDiagnostic("err.file.not.found", e.getLocalizedMessage()));
+                reportError("err.file.not.found", e.getLocalizedMessage());
                 ok = false;
             } catch (IOException e) {
                 //e.printStackTrace();
                 Object msg = e.getLocalizedMessage();
                 if (msg == null)
                     msg = e;
-                diagnosticListener.report(createDiagnostic("err.ioerror", className, msg));
+                reportError("err.ioerror", className, msg);
                 ok = false;
             } catch (Throwable t) {
                 StringWriter sw = new StringWriter();
                 PrintWriter pw = new PrintWriter(sw);
                 t.printStackTrace(pw);
                 pw.close();
-                diagnosticListener.report(createDiagnostic("err.crash", t.toString(), sw.toString()));
+                reportError("err.crash", t.toString(), sw.toString());
                 ok = false;
             }
         }
@@ -595,6 +612,152 @@
         return ok;
     }
 
+    protected boolean writeClass(ClassWriter classWriter, String className)
+            throws IOException, ConstantPoolException {
+        JavaFileObject fo = open(className);
+        if (fo == null) {
+            reportError("err.class.not.found", className);
+            return false;
+        }
+
+        ClassFileInfo cfInfo = read(fo);
+        if (!className.endsWith(".class")) {
+            String cfName = cfInfo.cf.getName();
+            if (!cfName.replaceAll("[/$]", ".").equals(className.replaceAll("[/$]", ".")))
+                reportWarning("warn.unexpected.class", className, cfName.replace('/', '.'));
+        }
+        write(cfInfo);
+
+        if (options.showInnerClasses) {
+            ClassFile cf = cfInfo.cf;
+            Attribute a = cf.getAttribute(Attribute.InnerClasses);
+            if (a instanceof InnerClasses_attribute) {
+                InnerClasses_attribute inners = (InnerClasses_attribute) a;
+                try {
+                    boolean ok = true;
+                    for (int i = 0; i < inners.classes.length; i++) {
+                        int outerIndex = inners.classes[i].outer_class_info_index;
+                        ConstantPool.CONSTANT_Class_info outerClassInfo = cf.constant_pool.getClassInfo(outerIndex);
+                        String outerClassName = outerClassInfo.getName();
+                        if (outerClassName.equals(cf.getName())) {
+                            int innerIndex = inners.classes[i].inner_class_info_index;
+                            ConstantPool.CONSTANT_Class_info innerClassInfo = cf.constant_pool.getClassInfo(innerIndex);
+                            String innerClassName = innerClassInfo.getName();
+                            classWriter.println("// inner class " + innerClassName.replaceAll("[/$]", "."));
+                            classWriter.println();
+                            ok = ok & writeClass(classWriter, innerClassName);
+                        }
+                    }
+                    return ok;
+                } catch (ConstantPoolException e) {
+                    reportError("err.bad.innerclasses.attribute", className);
+                    return false;
+                }
+            } else if (a != null) {
+                reportError("err.bad.innerclasses.attribute", className);
+                return false;
+            }
+        }
+
+        return true;
+    }
+
+    protected JavaFileObject open(String className) throws IOException {
+        // for compatibility, first see if it is a class name
+        JavaFileObject fo = getClassFileObject(className);
+        if (fo != null)
+            return fo;
+
+        // see if it is an inner class, by replacing dots to $, starting from the right
+        String cn = className;
+        int lastDot;
+        while ((lastDot = cn.lastIndexOf(".")) != -1) {
+            cn = cn.substring(0, lastDot) + "$" + cn.substring(lastDot + 1);
+            fo = getClassFileObject(cn);
+            if (fo != null)
+                return fo;
+        }
+
+        if (!className.endsWith(".class"))
+            return null;
+
+        if (fileManager instanceof StandardJavaFileManager) {
+            StandardJavaFileManager sfm = (StandardJavaFileManager) fileManager;
+            fo = sfm.getJavaFileObjects(className).iterator().next();
+            if (fo != null && fo.getLastModified() != 0) {
+                return fo;
+            }
+        }
+
+        // see if it is a URL, and if so, wrap it in just enough of a JavaFileObject
+        // to suit javap's needs
+        if (className.matches("^[A-Za-z]+:.*")) {
+            try {
+                final URI uri = new URI(className);
+                final URL url = uri.toURL();
+                final URLConnection conn = url.openConnection();
+                return new JavaFileObject() {
+                    public Kind getKind() {
+                        return JavaFileObject.Kind.CLASS;
+                    }
+
+                    public boolean isNameCompatible(String simpleName, Kind kind) {
+                        throw new UnsupportedOperationException();
+                    }
+
+                    public NestingKind getNestingKind() {
+                        throw new UnsupportedOperationException();
+                    }
+
+                    public Modifier getAccessLevel() {
+                        throw new UnsupportedOperationException();
+                    }
+
+                    public URI toUri() {
+                        return uri;
+                    }
+
+                    public String getName() {
+                        return url.toString();
+                    }
+
+                    public InputStream openInputStream() throws IOException {
+                        return conn.getInputStream();
+                    }
+
+                    public OutputStream openOutputStream() throws IOException {
+                        throw new UnsupportedOperationException();
+                    }
+
+                    public Reader openReader(boolean ignoreEncodingErrors) throws IOException {
+                        throw new UnsupportedOperationException();
+                    }
+
+                    public CharSequence getCharContent(boolean ignoreEncodingErrors) throws IOException {
+                        throw new UnsupportedOperationException();
+                    }
+
+                    public Writer openWriter() throws IOException {
+                        throw new UnsupportedOperationException();
+                    }
+
+                    public long getLastModified() {
+                        return conn.getLastModified();
+                    }
+
+                    public boolean delete() {
+                        throw new UnsupportedOperationException();
+                    }
+
+                };
+            } catch (URISyntaxException ignore) {
+            } catch (IOException ignore) {
+            }
+        }
+
+        return null;
+    }
+
     public static class ClassFileInfo {
         ClassFileInfo(JavaFileObject fo, ClassFile cf, byte[] digest, int size) {
             this.fo = fo;
@@ -693,7 +856,7 @@
     }
 
     private JavaFileManager getDefaultFileManager(final DiagnosticListener<? super JavaFileObject> dl, PrintWriter log) {
-        return JavapFileManager.create(dl, log, options);
+        return JavapFileManager.create(dl, log);
     }
 
     private JavaFileObject getClassFileObject(String className) throws IOException {
@@ -747,10 +910,23 @@
         }
     }
 
-    private Diagnostic<JavaFileObject> createDiagnostic(final String key, final Object... args) {
+    private void reportError(String key, Object... args) {
+        diagnosticListener.report(createDiagnostic(Diagnostic.Kind.ERROR, key, args));
+    }
+
+    private void reportNote(String key, Object... args) {
+        diagnosticListener.report(createDiagnostic(Diagnostic.Kind.NOTE, key, args));
+    }
+
+    private void reportWarning(String key, Object... args) {
+        diagnosticListener.report(createDiagnostic(Diagnostic.Kind.WARNING, key, args));
+    }
+
+    private Diagnostic<JavaFileObject> createDiagnostic(
+            final Diagnostic.Kind kind, final String key, final Object... args) {
         return new Diagnostic<JavaFileObject>() {
             public Kind getKind() {
-                return Diagnostic.Kind.ERROR;
+                return kind;
             }
 
             public JavaFileObject getSource() {
@@ -785,6 +961,11 @@
                 return JavapTask.this.getMessage(locale, key, args);
             }
 
+            @Override
+            public String toString() {
+                return getClass().getName() + "[key=" + key + ",args=" + Arrays.asList(args) + "]";
+            }
+
         };
 
     }
--- a/src/share/classes/com/sun/tools/javap/Options.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/javap/Options.java	Mon Sep 07 22:42:05 2009 -0700
@@ -85,8 +85,10 @@
     public boolean showAllAttrs;
     public boolean showConstants;
     public boolean sysInfo;
+    public boolean showInnerClasses;
+    public int indentWidth = 2;   // #spaces per indentWidth level
+    public int tabColumn = 40;    // column number for comments
 
     public boolean compat;             // bug-for-bug compatibility mode with old javap
     public boolean jsr277;
-    public boolean ignoreSymbolFile;   // file manager should ignore ct.sym
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/com/sun/tools/javap/TypeAnnotationWriter.java	Mon Sep 07 22:42:05 2009 -0700
@@ -0,0 +1,126 @@
+/*
+ * Copyright 2009 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+package com.sun.tools.javap;
+
+import com.sun.tools.classfile.Attribute;
+import com.sun.tools.classfile.Code_attribute;
+import com.sun.tools.classfile.ExtendedAnnotation;
+import com.sun.tools.classfile.ExtendedAnnotation.Position;
+import com.sun.tools.classfile.Instruction;
+import com.sun.tools.classfile.Method;
+import com.sun.tools.classfile.RuntimeInvisibleTypeAnnotations_attribute;
+import com.sun.tools.classfile.RuntimeTypeAnnotations_attribute;
+import com.sun.tools.classfile.RuntimeVisibleTypeAnnotations_attribute;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Annotate instructions with details about type annotations.
+ *
+ *  <p><b>This is NOT part of any API supported by Sun Microsystems.  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>
+ */
+public class TypeAnnotationWriter extends InstructionDetailWriter {
+    public enum NoteKind { VISIBLE, INVISIBLE };
+    public static class Note {
+        Note(NoteKind kind, ExtendedAnnotation anno) {
+            this.kind = kind;
+            this.anno = anno;
+        }
+        public final NoteKind kind;
+        public final ExtendedAnnotation anno;
+    }
+
+    static TypeAnnotationWriter instance(Context context) {
+        TypeAnnotationWriter instance = context.get(TypeAnnotationWriter.class);
+        if (instance == null)
+            instance = new TypeAnnotationWriter(context);
+        return instance;
+    }
+
+    protected TypeAnnotationWriter(Context context) {
+        super(context);
+        context.put(TypeAnnotationWriter.class, this);
+        annotationWriter = AnnotationWriter.instance(context);
+        classWriter = ClassWriter.instance(context);
+    }
+
+    public void reset(Code_attribute attr) {
+        Method m = classWriter.getMethod();
+        pcMap = new HashMap<Integer, List<Note>>();
+        check(NoteKind.VISIBLE, (RuntimeVisibleTypeAnnotations_attribute) m.attributes.get(Attribute.RuntimeVisibleTypeAnnotations));
+        check(NoteKind.INVISIBLE, (RuntimeInvisibleTypeAnnotations_attribute) m.attributes.get(Attribute.RuntimeInvisibleTypeAnnotations));
+    }
+
+    private void check(NoteKind kind, RuntimeTypeAnnotations_attribute attr) {
+        if (attr == null)
+            return;
+
+        for (ExtendedAnnotation anno: attr.annotations) {
+            Position p = anno.position;
+            Note note = null;
+            if (p.offset != -1)
+                addNote(p.offset, note = new Note(kind, anno));
+            if (p.lvarOffset != null) {
+                for (int i = 0; i < p.lvarOffset.length; i++) {
+                    if (note == null)
+                        note = new Note(kind, anno);
+                    addNote(p.lvarOffset[i], note);
+                }
+            }
+        }
+    }
+
+    private void addNote(int pc, Note note) {
+        List<Note> list = pcMap.get(pc);
+        if (list == null)
+            pcMap.put(pc, list = new ArrayList<Note>());
+        list.add(note);
+    }
+
+    @Override
+    void writeDetails(Instruction instr) {
+        String indent = space(2); // get from Options?
+        int pc = instr.getPC();
+        List<Note> notes = pcMap.get(pc);
+        if (notes != null) {
+            for (Note n: notes) {
+                print(indent);
+                print("@");
+                annotationWriter.write(n.anno, false, true);
+                print(", ");
+                println(n.kind.toString().toLowerCase());
+            }
+        }
+    }
+
+    private AnnotationWriter annotationWriter;
+    private ClassWriter classWriter;
+    private Map<Integer, List<Note>> pcMap;
+}
--- a/src/share/classes/com/sun/tools/javap/resources/javap.properties	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/com/sun/tools/javap/resources/javap.properties	Mon Sep 07 22:42:05 2009 -0700
@@ -18,12 +18,22 @@
 err.verify.not.supported=-verify not supported
 err.no.SourceFile.attribute=no SourceFile attribute
 err.source.file.not.found=source file not found
+err.bad.innerclasses.attribute=bad InnerClasses attribute for {0}
 warn.Xold.not.supported=-Xold is no longer available
 
 main.usage.summary=\
 Usage: {0} <options> <classes>\n\
 use -help for a list of possible options
 
+warn.prefix=Warning:
+warn.unexpected.class=Binary file {0} contains {1}
+
+note.prefix=Note:
+
+main.usage.summary=\
+Usage: {0} <options> <classes>\n\
+use -help for a list of possible options
+
 main.usage=\
 Usage: {0} <options> <classes>\n\
 where possible options include:
--- a/src/share/classes/javax/tools/JavaCompiler.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/src/share/classes/javax/tools/JavaCompiler.java	Mon Sep 07 22:42:05 2009 -0700
@@ -228,6 +228,12 @@
      * <p>If a file manager is provided, it must be able to handle all
      * locations defined in {@link StandardLocation}.
      *
+     * <p>Note that annotation processing can process both the
+     * compilation units of source code to be compiled, passed with
+     * the {@code compilationUnits} parameter, as well as class
+     * files, whose names are passed with the {@code classes}
+     * parameter.
+     *
      * @param out a Writer for additional output from the compiler;
      * use {@code System.err} if {@code null}
      * @param fileManager a file manager; if {@code null} use the
@@ -236,8 +242,8 @@
      * null} use the compiler's default method for reporting
      * diagnostics
      * @param options compiler options, {@code null} means no options
-     * @param classes class names (for annotation processing), {@code
-     * null} means no class names
+     * @param classes names of classes to be processed by annotation
+     * processing, {@code null} means no class names
      * @param compilationUnits the compilation units to compile, {@code
      * null} means no compilation units
      * @return an object representing the compilation
--- a/test/tools/apt/Basics/apt.sh	Sat Jul 25 20:57:05 2009 -0700
+++ b/test/tools/apt/Basics/apt.sh	Mon Sep 07 22:42:05 2009 -0700
@@ -43,7 +43,7 @@
 esac
 
 # Construct path to apt executable
-APT="${TESTJAVA}/bin/apt ${TESTTOOLVMOPTS}"
+APT="${TESTJAVA}/bin/apt ${TESTTOOLVMOPTS} -XDsuppress-tool-api-removal-message "
 
 printf "%s\n" "-classpath ${TESTCLASSES}"                    > options
 printf "%s\n" "-factorypath ./nullap.jar"                   >> options
@@ -58,6 +58,7 @@
 printf "%s\n" "-XListAnnotationTypes"                       >> options1
 printf "%s\n" "-XclassesAsDecls"                            >> options1
 
+
 # Construct path to javac executable
 JAVAC="${TESTJAVA}/bin/javac ${TESTTOOLVMOPTS} -source 1.5 -sourcepath ${TESTSRC} -classpath ${TESTJAVA}/lib/tools.jar -d . "
 JAR="${TESTJAVA}/bin/jar "
--- a/test/tools/apt/Compile/compile.sh	Sat Jul 25 20:57:05 2009 -0700
+++ b/test/tools/apt/Compile/compile.sh	Mon Sep 07 22:42:05 2009 -0700
@@ -67,7 +67,7 @@
 esac
 
 
-APT="${TESTJAVA}/bin/apt ${TESTTOOLVMOPTS} "
+APT="${TESTJAVA}/bin/apt ${TESTTOOLVMOPTS} -XDsuppress-tool-api-removal-message "
 JAVA="${TESTJAVA}/bin/java ${TESTVMOPTS} "
 JAVAC="${TESTJAVA}/bin/javac ${TESTTOOLVMOPTS} "
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/6390045/T6390045a.java	Mon Sep 07 22:42:05 2009 -0700
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2009 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+/*
+ * @test
+ * @bug 6390045
+ * @summary Unexpected error "cannot access java.lang.Void" with '-target cldc1.0' with -source >=1.5
+ *
+ * @author mcimadamore
+ * @compile -XDfailcomplete=java.lang.Void T6390045a.java
+ */
+
+class T6390045a {
+    boolean b;
+    short s;
+    Object o;
+    Object p = b ? o : s;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/6390045/T6390045b.java	Mon Sep 07 22:42:05 2009 -0700
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2009 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+/*
+ * @test
+ * @bug 6390045
+ * @summary Unexpected error "cannot access java.lang.Void" with '-target cldc1.0' with -source >=1.5
+ *
+ * @author mcimadamore
+ * @compile -XDfailcomplete=java.lang.Void T6390045b.java
+ */
+
+class T6390045b {
+    short s;
+    Object o;
+    Object p = choose(o, s);
+    <T> T choose(T t1, T t2) { return t1; }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/6521805/T6521805a.java	Mon Sep 07 22:42:05 2009 -0700
@@ -0,0 +1,45 @@
+/*
+ * Copyright 2009 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+/*
+ * @test
+ * @bug 6521805
+ * @summary Regression: JDK5/JDK6 javac allows write access to outer class reference
+ * @author mcimadamore
+ *
+ * @compile/fail/ref=T6521805a_1.out T6521805a.java -XDrawDiagnostics
+ * @compile/ref=T6521805a_2.out T6521805a.java -XDwarnOnSyntheticConflicts -XDrawDiagnostics
+ */
+
+class T6521805a {
+
+    static class Outer {
+        T6521805a this$0 = null;
+    }
+
+    public class Inner extends Outer {
+        public void foo() {
+            this$0 = new T6521805a();
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/6521805/T6521805a_1.out	Mon Sep 07 22:42:05 2009 -0700
@@ -0,0 +1,2 @@
+T6521805a.java:40:12: compiler.err.synthetic.name.conflict: this$0, T6521805a.Outer
+1 error
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/6521805/T6521805a_2.out	Mon Sep 07 22:42:05 2009 -0700
@@ -0,0 +1,2 @@
+T6521805a.java:40:12: compiler.warn.synthetic.name.conflict: this$0, T6521805a.Outer
+1 warning
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/6521805/T6521805b.java	Mon Sep 07 22:42:05 2009 -0700
@@ -0,0 +1,44 @@
+/*
+ * Copyright 2009 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+/*
+ * @test
+ * @bug 6521805
+ * @summary Regression: JDK5/JDK6 javac allows write access to outer class reference
+ * @author mcimadamore
+ *
+ * @compile T6521805b.java
+ */
+
+class T6521805b {
+
+    static class Outer {
+        String this$0 = null;
+    }
+
+    public class Inner extends Outer {
+        public void foo() {
+            this$0 = "Hello!";
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/6521805/T6521805c.java	Mon Sep 07 22:42:05 2009 -0700
@@ -0,0 +1,44 @@
+/*
+ * Copyright 2009 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+/*
+ * @test
+ * @bug 6521805
+ * @summary Regression: JDK5/JDK6 javac allows write access to outer class reference
+ * @author mcimadamore
+ *
+ * @compile T6521805c.java
+ */
+
+class T6521805c {
+
+    static class Outer {
+         T6521805c this$0() { return null;}
+    }
+
+    public class Inner extends Outer {
+        public void foo() {
+            this$0();
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/6521805/T6521805d.java	Mon Sep 07 22:42:05 2009 -0700
@@ -0,0 +1,50 @@
+/*
+ * Copyright 2009 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+/*
+ * @test
+ * @bug 6521805
+ * @summary Regression: JDK5/JDK6 javac allows write access to outer class reference
+ * @author mcimadamore
+ *
+ * @compile/fail/ref=T6521805d.out T6521805d.java -XDrawDiagnostics
+ */
+
+class T6521805 {
+
+    static class Inner extends T6521805.Outer {
+
+        Inner(T6521805 t) {
+            t.super();
+        }
+
+        T6521805 this$0 = null;
+
+        public void foo() {
+            this$0 = new T6521805();
+        }
+    }
+
+    class Outer {}
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/6521805/T6521805d.out	Mon Sep 07 22:42:05 2009 -0700
@@ -0,0 +1,2 @@
+T6521805d.java:41:18: compiler.err.synthetic.name.conflict: this$0, T6521805.Inner
+1 error
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/6521805/T6521805e.java	Mon Sep 07 22:42:05 2009 -0700
@@ -0,0 +1,32 @@
+/*
+ * Copyright 2009 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+/*
+ * @test
+ * @bug 6521805
+ * @summary Regression: JDK5/JDK6 javac allows write access to outer class reference
+ * @author mcimadamore
+ *
+ * @compile/fail/ref=T6521805e.out p/Outer.java p/Sub.java -XDrawDiagnostics
+ * @compile/fail/ref=T6521805e.out p/Sub.java p/Outer.java -XDrawDiagnostics
+ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/6521805/T6521805e.out	Mon Sep 07 22:42:05 2009 -0700
@@ -0,0 +1,2 @@
+Sub.java:8:11: compiler.err.synthetic.name.conflict: this$0, p.Inner
+1 error
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/6521805/p/Outer.java	Mon Sep 07 22:42:05 2009 -0700
@@ -0,0 +1,5 @@
+package p;
+
+class Outer {
+    class Super {}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/6521805/p/Sub.java	Mon Sep 07 22:42:05 2009 -0700
@@ -0,0 +1,13 @@
+package p;
+
+class Inner extends Outer.Super {
+    Inner(Outer t) {
+        t.super();
+    }
+
+    Outer this$0 = null;
+
+    public void foo() {
+        this$0 = new Outer();
+    }
+}
--- a/test/tools/javac/6734819/T6734819a.out	Sat Jul 25 20:57:05 2009 -0700
+++ b/test/tools/javac/6734819/T6734819a.out	Mon Sep 07 22:42:05 2009 -0700
@@ -4,9 +4,9 @@
 [flow W]
 [attribute Z]
 [flow Z]
+[desugar Z]
+[desugar W]
 [desugar Y]
 [generate code Y]
-[desugar W]
 [generate code W]
-[desugar Z]
 [generate code Z]
--- a/test/tools/javac/6734819/T6734819b.out	Sat Jul 25 20:57:05 2009 -0700
+++ b/test/tools/javac/6734819/T6734819b.out	Mon Sep 07 22:42:05 2009 -0700
@@ -2,8 +2,8 @@
 [flow A]
 [attribute B]
 [flow B]
+[desugar B]
 [desugar A]
 [generate code A]
-[desugar B]
 [generate code B.C]
 [generate code B]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/6840059/T6840059.java	Mon Sep 07 22:42:05 2009 -0700
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2009 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * 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 6840059
+ * @summary 6758789: Some method resolution diagnostic should be improved
+ * @author Maurizio Cimadamore
+ *
+ * @compile/fail/ref=T6840059.out -XDrawDiagnostics T6840059.java
+ */
+
+class T6840059 {
+
+    T6840059(Integer x) {}
+
+    void test() {
+        new T6840059(""){};
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/6840059/T6840059.out	Mon Sep 07 22:42:05 2009 -0700
@@ -0,0 +1,3 @@
+T6840059.java:38:9: compiler.err.cant.resolve.location.args: kindname.constructor, T6840059, , java.lang.String, kindname.class, T6840059
+T6840059.java:38:25: compiler.err.cant.resolve.location.args: kindname.constructor, T6840059, , , kindname.class, T6840059
+2 errors
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/Diagnostics/6860795/T6860795.java	Mon Sep 07 22:42:05 2009 -0700
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2009 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+/**
+ * @test
+ * @bug     6860795
+ * @summary NullPointerException when compiling a negative java source
+ * @author  mcimadamore
+ * @compile/fail/ref=T6860795.out -XDrawDiagnostics  T6860795.java
+ */
+
+class Test {
+    void foo(float x, int x) {}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/Diagnostics/6860795/T6860795.out	Mon Sep 07 22:42:05 2009 -0700
@@ -0,0 +1,2 @@
+T6860795.java:33:27: compiler.err.already.defined: x, foo
+1 error
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/Diagnostics/6862608/T6862608a.java	Mon Sep 07 22:42:05 2009 -0700
@@ -0,0 +1,44 @@
+/*
+ * Copyright 2009 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+/**
+ * @test
+ * @bug     6862608
+ * @summary rich diagnostic sometimes contain wrong type variable numbering
+ * @author  mcimadamore
+ * @compile/fail/ref=T6862608a.out -XDrawDiagnostics -XDdiags=disambiguateTvars,where T6862608a.java
+ */
+
+
+import java.util.*;
+
+class T6862608a {
+
+    <T> Comparator<T> compound(Iterable<? extends Comparator<? super T>> it) {
+        return null;
+    }
+
+    public void test(List<Comparator<?>> x) {
+        Comparator<String> c3 = compound(x);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/Diagnostics/6862608/T6862608a.out	Mon Sep 07 22:42:05 2009 -0700
@@ -0,0 +1,3 @@
+T6862608a.java:42:41: compiler.err.invalid.inferred.types: T, (compiler.misc.inferred.do.not.conform.to.params: java.lang.Iterable<? extends java.util.Comparator<? super java.lang.String>>, java.util.List<java.util.Comparator<?>>)
+- compiler.misc.where.description.typevar: T,{(compiler.misc.where.typevar: T, java.lang.Object, kindname.method, <T>compound(java.lang.Iterable<? extends java.util.Comparator<? super T>>))}
+1 error
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/Diagnostics/6862608/T6862608b.java	Mon Sep 07 22:42:05 2009 -0700
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2009 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+/**
+ * @test
+ * @bug     6862608
+ * @summary rich diagnostic sometimes contain wrong type variable numbering
+ * @author  mcimadamore
+ * @compile/fail/ref=T6862608b.out -XDrawDiagnostics -XDdiags=disambiguateTvars,where T6862608b.java
+ */
+
+class T66862608b<T extends String, S> {
+   <S, T extends S> void foo(T t) {
+      test(t);
+   }
+
+   void test(T t) {}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/Diagnostics/6862608/T6862608b.out	Mon Sep 07 22:42:05 2009 -0700
@@ -0,0 +1,3 @@
+T6862608b.java:34:7: compiler.err.cant.apply.symbol: kindname.method, test, compiler.misc.type.var: T, 1, compiler.misc.type.var: T, 2, kindname.class, T66862608b<compiler.misc.type.var: T, 1,compiler.misc.type.var: S, 2>, null
+- compiler.misc.where.description.typevar.1: compiler.misc.type.var: T, 1,compiler.misc.type.var: T, 2,compiler.misc.type.var: S, 1,compiler.misc.type.var: S, 2,{(compiler.misc.where.typevar: compiler.misc.type.var: T, 1, java.lang.String, kindname.class, T66862608b),(compiler.misc.where.typevar: compiler.misc.type.var: T, 2, compiler.misc.type.var: S, 1, kindname.method, <compiler.misc.type.var: S, 1,compiler.misc.type.var: T, 2>foo(compiler.misc.type.var: T, 2)),(compiler.misc.where.typevar: compiler.misc.type.var: S, 1, java.lang.Object, kindname.method, <compiler.misc.type.var: S, 1,compiler.misc.type.var: T, 2>foo(compiler.misc.type.var: T, 2)),(compiler.misc.where.typevar: compiler.misc.type.var: S, 2, java.lang.Object, kindname.class, T66862608b)}
+1 error
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/Diagnostics/6864382/T6864382.java	Mon Sep 07 22:42:05 2009 -0700
@@ -0,0 +1,32 @@
+/*
+ * Copyright 2009 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+/**
+ * @test
+ * @bug     6864382
+ * @summary NullPointerException when compiling a negative java source
+ * @author  mcimadamore
+ * @compile/fail/ref=T6864382.out -XDrawDiagnostics  T6864382.java
+ */
+
+class T6864382<T> extends T {}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/Diagnostics/6864382/T6864382.out	Mon Sep 07 22:42:05 2009 -0700
@@ -0,0 +1,2 @@
+T6864382.java:32:27: compiler.err.type.found.req: (compiler.misc.type.parameter: T), (compiler.misc.type.req.class)
+1 error
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/OverrideChecks/6199153/T6199153.java	Mon Sep 07 22:42:05 2009 -0700
@@ -0,0 +1,44 @@
+/*
+ * Copyright 2009 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+/**
+ * @test
+ * @bug 6199153
+ * @summary Generic throws and overriding
+ * @author  mcimadamore
+ * @compile/fail/ref=T6199153.out -Xlint -Werror -XDrawDiagnostics T6199153.java
+ */
+
+import java.io.IOException;
+
+class T6199153 {
+
+    static class A {
+        public <T extends IOException> void m() throws T {}
+    }
+
+    static class B extends A {
+        public void m() throws IOException {}
+    }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/OverrideChecks/6199153/T6199153.out	Mon Sep 07 22:42:05 2009 -0700
@@ -0,0 +1,4 @@
+T6199153.java:41:21: compiler.warn.override.unchecked.thrown: (compiler.misc.cant.override: m(), T6199153.B, <T>m(), T6199153.A), java.io.IOException
+- compiler.err.warnings.and.werror
+1 error
+1 warning
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/T6558476.java	Mon Sep 07 22:42:05 2009 -0700
@@ -0,0 +1,101 @@
+/*
+ * Copyright 2008 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+/*
+ * @test
+ * @run main/othervm -Xmx512m -Xms512m  T6558476
+ */
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.util.Random;
+
+import com.sun.tools.javac.Main;
+
+public class T6558476 {
+    private static File copyFileTo(File file, File directory) throws IOException {
+        File newFile = new File(directory, file.getName());
+        FileInputStream fis = null;
+        FileOutputStream fos = null;
+        try {
+            fis = new FileInputStream(file);
+            fos = new FileOutputStream(newFile);
+            byte buff[] = new byte[1024];
+            int val;
+            while ((val = fis.read(buff)) > 0)
+                fos.write(buff, 0, val);
+        } finally {
+            if (fis != null)
+                fis.close();
+            if (fos != null)
+                fos.close();
+        }
+        return newFile;
+    }
+
+    private static String generateJavaClass(String className) {
+        StringBuffer sb = new StringBuffer();
+        sb.append("import sun.net.spi.nameservice.dns.DNSNameService;\n");
+        sb.append("public class ");
+        sb.append(className);
+        sb.append(" {\n");
+        sb.append("  public void doStuff() {\n");
+        sb.append("    DNSNameService dns = null;\n");
+        sb.append("  }\n");
+        sb.append("}\n");
+        return sb.toString();
+    }
+
+    public static void main(String[] args) throws IOException {
+        File javaHomeDir = new File(System.getProperty("java.home"));
+        File tmpDir = new File(System.getProperty("java.io.tmpdir"));
+        File outputDir = new File(tmpDir, "outputDir" + new Random().nextInt(65536));
+        outputDir.mkdir();
+        outputDir.deleteOnExit();
+
+        File dnsjarfile = new File(javaHomeDir, "lib" + File.separator + "ext" + File.separator + "dnsns.jar");
+        File tmpJar = copyFileTo(dnsjarfile, outputDir);
+        String className = "TheJavaFile";
+        File javaFile = new File(outputDir, className + ".java");
+        javaFile.deleteOnExit();
+        FileOutputStream fos = new FileOutputStream(javaFile);
+        fos.write(generateJavaClass(className).getBytes());
+        fos.close();
+
+        int rc = Main.compile(new String[]{"-d", outputDir.getPath(),
+                    "-classpath",
+                    tmpJar.getPath(),
+                    javaFile.getAbsolutePath()});
+        if (rc != 0) {
+            throw new Error("Couldn't compile the file (exit code=" + rc + ")");
+        }
+
+        if (tmpJar.delete()) {
+            System.out.println("jar file successfully deleted");
+        } else {
+            throw new Error("Error deleting file \"" + tmpJar.getPath() + "\"");
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/T6873845.java	Mon Sep 07 22:42:05 2009 -0700
@@ -0,0 +1,84 @@
+import java.io.*;
+import java.util.*;
+
+import sun.misc.*;
+
+/*
+ * @test /nodynamiccopyright/
+ * @bug 6873845
+ * @summary refine access to symbol file
+ */
+
+public class T6873845 {
+    public static void main(String... args) throws Exception {
+        new T6873845().run();
+    }
+
+    public void run() throws Exception {
+        String out = compile(Arrays.asList("-XDrawDiagnostics", "-X"));
+        if (out.contains("sunapi"))
+            throw new Exception("unexpected output for -X");
+
+        String warn1 = "T6873845.java:72:9: compiler.warn.sun.proprietary: sun.misc.Unsafe" + newline;
+        String warn2 = "T6873845.java:77:9: compiler.warn.sun.proprietary: sun.misc.Unsafe" + newline;
+        String note1 = "- compiler.note.sunapi.filename: T6873845.java" + newline;
+        String note2 = "- compiler.note.sunapi.recompile" + newline;
+
+        test(opts(),
+                warn1 + warn2 + "2 warnings" + newline);
+        test(opts("-XDenableSunApiLintControl"),
+                note1 + note2);
+        test(opts("-XDenableSunApiLintControl", "-XDsuppressNotes"),
+                "");
+        test(opts("-XDenableSunApiLintControl", "-Xlint:sunapi"),
+                warn1 + "1 warning" + newline);
+        test(opts("-XDenableSunApiLintControl", "-Xlint:all"),
+                warn1 + "1 warning" + newline);
+        test(opts("-XDenableSunApiLintControl", "-Xlint:all,-sunapi"),
+                note1 + note2);
+    }
+
+    List<String> opts(String... opts) {
+        return Arrays.asList(opts);
+    }
+
+    void test(List<String> opts, String expect) throws Exception {
+        List<String> args = new ArrayList<String>();
+        args.addAll(opts);
+        args.add("-d");
+        args.add(testClasses.getPath());
+        args.add(new File(testSrc, "T6873845.java").getPath());
+        compile(args); // to verify resource strings exist
+        args.add(0, "-XDrawDiagnostics");
+        String out = compile(args);
+        if (!out.equals(expect))
+            throw new Exception("unexpected output from compiler");
+    }
+
+    String compile(List<String> args) throws Exception{
+        StringWriter sw = new StringWriter();
+        PrintWriter pw = new PrintWriter(sw);
+        System.out.println("compile: " + args);
+        int rc = com.sun.tools.javac.Main.compile(args.toArray(new String[args.size()]), pw);
+        pw.close();
+        String out = sw.toString();
+        System.out.println(out);
+        if (rc != 0)
+            throw new Exception("compilation failed unexpectedly");
+        return out;
+    }
+
+    void m1() {
+        Unsafe.getUnsafe();
+    }
+
+    @SuppressWarnings("sunapi")
+    void m2() {
+        Unsafe.getUnsafe();
+    }
+
+    private File testSrc = new File(System.getProperty("test.src", "."));
+    private File testClasses = new File(System.getProperty("test.classes", "."));
+    private String newline = System.getProperty("line.separator");
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/T6873849.java	Mon Sep 07 22:42:05 2009 -0700
@@ -0,0 +1,76 @@
+/*
+ * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+import java.io.File;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.util.ArrayList;
+import java.util.List;
+
+/*
+ * @test
+ * @bug 6873849
+ * @summary suppress notes generated by javac
+ */
+
+public class T6873849 {
+    public static void main(String... args) throws Exception {
+        new T6873849().run();
+    }
+
+    public void run() throws Exception {
+        test(null, "- compiler.note.unchecked.filename: T6873849.java" + newline +
+                    "- compiler.note.unchecked.recompile" + newline);
+        test("-XDsuppressNotes", "");
+    }
+
+    void test(String opt, String expect) throws Exception {
+        List<String> args = new ArrayList<String>();
+        if (opt != null)
+            args.add(opt);
+        args.add("-d");
+        args.add(testClasses.getPath());
+        args.add("-XDrawDiagnostics");
+        args.add(new File(testSrc, "T6873849.java").getPath());
+        StringWriter sw = new StringWriter();
+        PrintWriter pw = new PrintWriter(sw);
+        System.err.println("compile: " + args);
+        int rc = com.sun.tools.javac.Main.compile(args.toArray(new String[args.size()]), pw);
+        pw.close();
+        String out = sw.toString();
+        System.out.println(out);
+        if (rc != 0)
+            throw new Exception("compilation failed unexpectedly");
+        if (!out.equals(expect))
+            throw new Exception("unexpected output from compiler");
+    }
+
+    void m(List t) {
+        // force a note about unchecked usage
+        t.add(new Object());
+    }
+
+    private File testSrc = new File(System.getProperty("test.src", "."));
+    private File testClasses = new File(System.getProperty("test.classes", "."));
+    private String newline = System.getProperty("line.separator");
+}
--- a/test/tools/javac/code/ArrayClone.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/test/tools/javac/code/ArrayClone.java	Mon Sep 07 22:42:05 2009 -0700
@@ -48,7 +48,7 @@
         System.out.println(out);
 
         for (String line: out.split("\n")) {
-            String match = "[ \t]+[0-9]+:[ \t]+invokevirtual[ \t]+#[0-9]+; //Method \"\\[Ljava/lang/String;\".clone:\\(\\)Ljava/lang/Object;";
+            String match = "[ \t]+[0-9]+:[ \t]+invokevirtual[ \t]+#[0-9]+[ \t]+// Method \"\\[Ljava/lang/String;\".clone:\\(\\)Ljava/lang/Object;";
             if (line.matches(match))
                 return;
         }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/generics/T6869075.java	Mon Sep 07 22:42:05 2009 -0700
@@ -0,0 +1,67 @@
+/*
+ * Copyright 2009 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+/*
+ * @test
+ * @bug     6869075
+ * @summary regression: javac crashes when compiling compound string assignment with generics
+ * @author mcimadamore
+ */
+
+public class T6869075 {
+
+    static class Foo<X> {
+        X x;
+        Foo (X x) {
+            this.x = x;
+        }
+    }
+
+    static void test1(Foo<String> foo) {
+        String start = foo.x;
+        equals(foo.x += "foo", start + "foo");
+    }
+
+    static void test2(Foo<String> foo) {
+        String start = foo.x;
+        equals((foo.x += "foo"), (start + "foo"));
+    }
+
+    static void test3(Foo<String> foo) {
+        String start = foo.x;
+        equals(((foo.x += "foo")), ((start + "foo")));
+    }
+
+    public static void main(String[] args) {
+        test1(new Foo<String>("Hello!"));
+        test2(new Foo<String>("Hello!"));
+        test3(new Foo<String>("Hello!"));
+    }
+
+    static void equals(String found, String req) {
+        if (!found.equals(req)) {
+            throw new AssertionError("Error (expected: "+ req +
+                                     " - found: " + found + ")");
+        }
+    }
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/generics/rawOverride/T6846972.java	Mon Sep 07 22:42:05 2009 -0700
@@ -0,0 +1,49 @@
+/*
+ * Copyright 2009 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+/*
+ * @test
+ * @bug 6846972
+ * @summary cannot access member of raw type when erasure change overriding into overloading
+ * @author mcimadamore
+ * @compile T6846972.java
+ */
+
+import java.util.EnumMap;
+
+public class T6846972 {
+
+    enum Suit {
+        CLUBS, DIAMONDS;
+    }
+
+    static Object [] array = {
+        Suit.CLUBS, "value1",
+        Suit.DIAMONDS, "value2"
+    };
+
+    static void test() {
+        EnumMap map = new EnumMap(Suit.class);
+        map.put(array[0], array[1]);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/generics/typevars/6569404/T6569404a.java	Mon Sep 07 22:42:05 2009 -0700
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2009 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+/*
+ * @test
+ * @bug     6569404
+ * @summary Regression: Cannot instantiate an inner class of a type variable
+ * @author  mcimadamore
+ */
+
+public class T6569404a {
+
+    static class Outer {
+      public class Inner {}
+    }
+
+    static class Test<T extends Outer> {
+       public Test(T t) {
+          Outer.Inner inner = t.new Inner();
+       }
+    }
+
+    public static void main(String[] args) {
+       new Test<Outer>(new Outer());
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/generics/typevars/6569404/T6569404b.java	Mon Sep 07 22:42:05 2009 -0700
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2009 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+/*
+ * @test
+ * @bug     6569404
+ * @summary Regression: Cannot instantiate an inner class of a type variable
+ * @author  mcimadamore
+ * @compile/fail/ref=T6569404b.out T6569404b.java -XDrawDiagnostics
+ */
+
+class T6569404b {
+
+    static class A<X> {}
+
+    static class B<T extends Outer> extends A<T.Inner> {}
+
+    static class Outer {
+        public class Inner {}
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/generics/typevars/6569404/T6569404b.out	Mon Sep 07 22:42:05 2009 -0700
@@ -0,0 +1,2 @@
+T6569404b.java:36:48: compiler.err.type.var.cant.be.deref
+1 error
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/generics/typevars/6569404/T6569404c.java	Mon Sep 07 22:42:05 2009 -0700
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2009 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+/*
+ * @test
+ * @bug     6569404
+ * @summary Regression: Cannot instantiate an inner class of a type variable
+ * @author  mcimadamore
+ */
+
+public class T6569404c {
+    static class Outer {
+      class Inner {}
+    }
+
+    static class Test<X extends Outer>  {
+       class InnerTest extends X.Inner { InnerTest(Outer o) {o.super();} }
+    }
+
+    public static void main(String[] args) {
+       new Test<Outer>().new InnerTest(new Outer());
+    }
+}
--- a/test/tools/javac/policy/test2/byfile.AB.out	Sat Jul 25 20:57:05 2009 -0700
+++ b/test/tools/javac/policy/test2/byfile.AB.out	Mon Sep 07 22:42:05 2009 -0700
@@ -2,6 +2,7 @@
 [flow A]
 [attribute B]
 [flow B]
+[desugar B]
 [desugar A]
 [generate code A.A1]
 [generate code A.A2]
@@ -10,6 +11,5 @@
 [generate code <anonymous A$A4$1>]
 [generate code A.A4]
 [generate code A]
-[desugar B]
 [generate code B.Inner]
 [generate code B]
--- a/test/tools/javac/policy/test2/bytodo.AB.out	Sat Jul 25 20:57:05 2009 -0700
+++ b/test/tools/javac/policy/test2/bytodo.AB.out	Mon Sep 07 22:42:05 2009 -0700
@@ -2,6 +2,7 @@
 [flow A]
 [attribute B]
 [flow B]
+[desugar B]
 [desugar A]
 [generate code A.A1]
 [generate code A.A2]
@@ -10,6 +11,5 @@
 [generate code <anonymous A$A4$1>]
 [generate code A.A4]
 [generate code A]
-[desugar B]
 [generate code B.Inner]
 [generate code B]
--- a/test/tools/javac/processing/model/testgetallmembers/Main.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/test/tools/javac/processing/model/testgetallmembers/Main.java	Mon Sep 07 22:42:05 2009 -0700
@@ -95,7 +95,7 @@
         javac = null;
         elements = null;
 
-        javac = (JavacTask)tool.getTask(null, null, null, null, null, null);
+        javac = (JavacTask)tool.getTask(null, fm, null, null, null, null);
         elements = javac.getElements();
 
         for (String name : packages) {
--- a/test/tools/javac/typeAnnotations/InnerClass.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/test/tools/javac/typeAnnotations/InnerClass.java	Mon Sep 07 22:42:05 2009 -0700
@@ -30,9 +30,30 @@
  */
 
 class InnerClass {
+
+    InnerClass() {}
+    InnerClass(Object o) {}
+
     private void a() {
         new Object() {
             public <R> void method() { }
         };
     }
+
+    Object f1 = new InnerClass() {
+            <R> void method() { }
+        };
+
+    Object f2 = new InnerClass() {
+            <@A R> void method() { }
+        };
+
+    Object f3 = new InnerClass(null) {
+            <R> void method() { }
+        };
+
+    Object f4 = new InnerClass(null) {
+            <@A R> void method() { }
+        };
+    @interface A { }
 }
--- a/test/tools/javac/typeAnnotations/failures/OldArray.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/test/tools/javac/typeAnnotations/failures/OldArray.java	Mon Sep 07 22:42:05 2009 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright 2008 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2008-2009 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/varargs/6806876/T6806876.java	Mon Sep 07 22:42:05 2009 -0700
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2009 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * 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     6806876
+ * @author mcimadamore
+ * @summary  ClassCastException occurs in assignment expressions without any heap pollutions
+ * @compile/fail/ref=T6806876.out -Xlint:unchecked -Werror -XDrawDiagnostics T6806876.java
+ */
+
+class T6806876 {
+    void test(Integer i, Long l) {
+        Comparable<?>[] res = m(i, l);
+    }
+
+    <T> T[] m(T...a) {
+        return null;
+    }
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/varargs/6806876/T6806876.out	Mon Sep 07 22:42:05 2009 -0700
@@ -0,0 +1,4 @@
+T6806876.java:34:32: compiler.warn.unchecked.generic.array.creation: java.lang.Number&java.lang.Comparable<? extends java.lang.Number&java.lang.Comparable<?>>[]
+- compiler.err.warnings.and.werror
+1 error
+1 warning
--- a/test/tools/javap/4111861/T4111861.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/test/tools/javap/4111861/T4111861.java	Mon Sep 07 22:42:05 2009 -0700
@@ -89,7 +89,7 @@
             String line;
             while ((line = in.readLine()) != null) {
                 if (line.indexOf("public static final") > 0) {
-                    sb.append(line);
+                    sb.append(line.trim());
                     sb.append('\n');
                 }
             }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javap/T4777949.java	Mon Sep 07 22:42:05 2009 -0700
@@ -0,0 +1,111 @@
+/*
+ * Copyright 2008 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+import java.io.*;
+import java.util.*;
+import javax.tools.*;
+import com.sun.tools.javap.*;
+
+/*
+ * @test
+ * @bug 4777949
+ * @summary Warn javap usage on package with simple name
+ */
+public class T4777949 {
+    public static void main(String... args) throws Exception {
+        new T4777949().run();
+    }
+
+    void run() throws Exception {
+        File javaFile = writeTestFile();
+        File classFile = compileTestFile(javaFile);
+
+        test(".", "p.q.r.Test", false);
+        test("p", "q.r.Test", true);
+        test("p/q", "r.Test", true);
+        test("p/q/r", "Test", true);
+        test(".", "p.q.r.Test.Inner", false);
+        test(".", "p.q.r.Test$Inner", false);
+        test("p", "q.r.Test.Inner", true);
+        test("p", "q.r.Test$Inner", true);
+
+        if (errors > 0)
+            throw new Exception(errors + " errors found");
+    }
+
+    void test(String classPath, String className, boolean expectWarnings) {
+        List<Diagnostic<? extends JavaFileObject>> diags =
+            javap(Arrays.asList("-classpath", classPath), Arrays.asList(className));
+        boolean foundWarnings = false;
+        for (Diagnostic<? extends JavaFileObject> d: diags) {
+            if (d.getKind() == Diagnostic.Kind.WARNING)
+                foundWarnings = true;
+        }
+    }
+
+
+    File writeTestFile() throws IOException {
+        File f = new File("Test.java");
+        PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter(f)));
+        out.println("package p.q.r;");
+        out.println("class Test { class Inner { } }");
+        out.close();
+        return f;
+    }
+
+    File compileTestFile(File f) {
+        int rc = com.sun.tools.javac.Main.compile(new String[] { "-d", ".", f.getPath() });
+        if (rc != 0)
+            throw new Error("compilation failed. rc=" + rc);
+        String path = f.getPath();
+        return new File(path.substring(0, path.length() - 5) + ".class");
+    }
+
+    List<Diagnostic<? extends JavaFileObject>> javap(List<String> args, List<String> classes) {
+        DiagnosticCollector<JavaFileObject> dc = new DiagnosticCollector<JavaFileObject>();
+        StringWriter sw = new StringWriter();
+        PrintWriter pw = new PrintWriter(sw);
+        JavaFileManager fm = JavapFileManager.create(dc, pw);
+        JavapTask t = new JavapTask(pw, fm, dc, args, classes);
+        boolean ok = t.run();
+
+        List<Diagnostic<? extends JavaFileObject>> diags = dc.getDiagnostics();
+
+        if (!ok)
+            error("javap failed unexpectedly");
+
+        System.err.println("args=" + args + " classes=" + classes + "\n"
+                           + diags + "\n"
+                           + sw);
+
+        return diags;
+    }
+
+    void error(String msg) {
+        System.err.println("error: " + msg);
+        errors++;
+    }
+
+    int errors;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javap/T4880672.java	Mon Sep 07 22:42:05 2009 -0700
@@ -0,0 +1,86 @@
+/*
+ * Copyright 2009 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+
+/*
+ * @test
+ * @bug 4880672
+ * @summary javap does not output inner interfaces of an interface
+ */
+
+import java.io.*;
+import java.util.*;
+
+public class T4880672
+{
+    public static void main(String... args) {
+        new T4880672().run();
+    }
+
+    void run() {
+        verify("java.util.Map", "public interface java.util.Map$Entry");
+        verify("T4880672", "class T4880672$A$B extends java.lang.Object");
+        verify("C", ""); // must not give error if no InnerClasses attribute
+        if (errors > 0)
+            throw new Error(errors + " found.");
+    }
+
+    void verify(String className, String... expects) {
+        String output = javap(className);
+        for (String expect: expects) {
+            if (output.indexOf(expect)< 0)
+                error(expect + " not found");
+        }
+    }
+
+    void error(String msg) {
+        System.err.println(msg);
+        errors++;
+    }
+
+    int errors;
+
+    String javap(String className) {
+        String testClasses = System.getProperty("test.classes", ".");
+        StringWriter sw = new StringWriter();
+        PrintWriter out = new PrintWriter(sw);
+        String[] args = { "-XDinner", "-classpath", testClasses, className };
+        int rc = com.sun.tools.javap.Main.run(args, out);
+        out.close();
+        String output = sw.toString();
+        System.out.println("class " + className);
+        System.out.println(output);
+        if (rc != 0)
+            throw new Error("javap failed. rc=" + rc);
+        if (output.indexOf("Error:") != -1)
+            throw new Error("javap reported error.");
+        return output;
+    }
+
+    class A {
+        class B { }
+    }
+}
+
+class C { }
+
--- a/test/tools/javap/T4884240.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/test/tools/javap/T4884240.java	Mon Sep 07 22:42:05 2009 -0700
@@ -46,9 +46,9 @@
         pw.close();
         String[] lines = sw.toString().split("\n");
         if (lines.length < 3
-            || !lines[0].startsWith("Classfile")
-            || !lines[1].startsWith("Last modified")
-            || !lines[2].startsWith("MD5")) {
+            || !lines[0].trim().startsWith("Classfile")
+            || !lines[1].trim().startsWith("Last modified")
+            || !lines[2].trim().startsWith("MD5")) {
             System.out.println(sw);
             throw new Exception("unexpected output");
         }
--- a/test/tools/javap/T4975569.java	Sat Jul 25 20:57:05 2009 -0700
+++ b/test/tools/javap/T4975569.java	Mon Sep 07 22:42:05 2009 -0700
@@ -40,10 +40,10 @@
         verify("T4975569$Anno", "flags: ACC_INTERFACE, ACC_ABSTRACT, ACC_ANNOTATION");
         verify("T4975569$E",    "flags: ACC_FINAL, ACC_SUPER, ACC_ENUM");
         verify("T4975569$S",    "flags: ACC_BRIDGE, ACC_SYNTHETIC",
-                                "InnerClasses: \n   static");
+                                "InnerClasses:\n       static");
         verify("T4975569$V",    "void m(java.lang.String...)",
                                 "flags: ACC_VARARGS");
-        verify("T4975569$Prot", "InnerClasses: \n   protected");
+        verify("T4975569$Prot", "InnerClasses:\n       protected");
         //verify("T4975569$Priv", "InnerClasses");
         if (errors > 0)
             throw new Error(errors + " found.");
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javap/T6729471.java	Mon Sep 07 22:42:05 2009 -0700
@@ -0,0 +1,109 @@
+/*
+ * Copyright 2009 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+
+/*
+ * @test
+ * @bug 6729471
+ * @summary javap does not output inner interfaces of an interface
+ */
+
+import java.io.*;
+import java.util.*;
+
+public class T6729471
+{
+    public static void main(String... args) {
+        new T6729471().run();
+    }
+
+    void run() {
+        // simple class
+        verify("java.util.Map",
+                "public abstract boolean containsKey(java.lang.Object)");
+
+        // inner class
+        verify("java.util.Map.Entry",
+                "public abstract K getKey()");
+
+        // file name
+        verify("../classes/tools/javap/T6729471.class",
+                "public static void main(java.lang.String...)");
+
+        // file url
+        verify("file:../classes/tools/javap/T6729471.class",
+                "public static void main(java.lang.String...)");
+
+        // jar url: rt.jar
+        File java_home = new File(System.getProperty("java.home"));
+        if (java_home.getName().equals("jre"))
+            java_home = java_home.getParentFile();
+        File rt_jar = new File(new File(new File(java_home, "jre"), "lib"), "rt.jar");
+        verify("jar:file:" + rt_jar + "!/java/util/Map.class",
+                "public abstract boolean containsKey(java.lang.Object)");
+
+        // jar url: ct.sym, if it exists
+        File ct_sym = new File(new File(java_home, "lib"), "ct.sym");
+        if (ct_sym.exists()) {
+            verify("jar:file:" + ct_sym + "!/META-INF/sym/rt.jar/java/util/Map.class",
+                "public abstract boolean containsKey(java.lang.Object)");
+        } else
+            System.err.println("warning: ct.sym not found");
+
+        if (errors > 0)
+            throw new Error(errors + " found.");
+    }
+
+    void verify(String className, String... expects) {
+        String output = javap(className);
+        for (String expect: expects) {
+            if (output.indexOf(expect)< 0)
+                error(expect + " not found");
+        }
+    }
+
+    void error(String msg) {
+        System.err.println(msg);
+        errors++;
+    }
+
+    int errors;
+
+    String javap(String className) {
+        String testClasses = System.getProperty("test.classes", ".");
+        StringWriter sw = new StringWriter();
+        PrintWriter out = new PrintWriter(sw);
+        String[] args = { "-classpath", testClasses, className };
+        int rc = com.sun.tools.javap.Main.run(args, out);
+        out.close();
+        String output = sw.toString();
+        System.out.println("class " + className);
+        System.out.println(output);
+        if (rc != 0)
+            throw new Error("javap failed. rc=" + rc);
+        if (output.indexOf("Error:") != -1)
+            throw new Error("javap reported error.");
+        return output;
+    }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javap/T6863746.java	Mon Sep 07 22:42:05 2009 -0700
@@ -0,0 +1,52 @@
+/*
+ * Copyright 2009 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+import java.io.*;
+
+/*
+ * @test
+ * @bug 6863746
+ * @summary javap should not scan ct.sym by default
+ */
+
+public class T6863746 {
+    public static void main(String... args) throws Exception{
+        new T6863746().run();
+    }
+
+    public void run() throws Exception {
+        String[] args = { "-c", "java.lang.Object" };
+        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();
+        System.out.println(out);
+        String[] lines = out.split("\n");
+        // If ct.sym is being read, the output does not include
+        // Code attributes, so check for Code attributes as a
+        // way of detecting that ct.sym is not being used.
+        if (lines.length < 50 || out.indexOf("Code:") == -1)
+            throw new Exception("unexpected output from javap");
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javap/T6866657.java	Mon Sep 07 22:42:05 2009 -0700
@@ -0,0 +1,82 @@
+/*
+ * Copyright 2009 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+
+/*
+ * @test
+ * @bug 6866657
+ * @summary add byteLength() method to primary classfile types
+ */
+
+import java.io.*;
+import java.util.*;
+import javax.tools.*;
+import com.sun.tools.javap.*;
+
+public class T6866657
+{
+    public static void main(String... args) {
+        new T6866657().run();
+    }
+
+    void run() {
+        verify("java.lang.Object");
+        verify("java.lang.String");
+        verify("java.util.List");
+        verify("java.util.ArrayList");
+        if (errors > 0)
+            throw new Error(errors + " found.");
+    }
+
+    void verify(String className) {
+        try {
+            PrintWriter log = new PrintWriter(System.out);
+            JavaFileManager fileManager = JavapFileManager.create(null, log);
+            JavaFileObject fo = fileManager.getJavaFileForInput(StandardLocation.PLATFORM_CLASS_PATH, className, JavaFileObject.Kind.CLASS);
+            if (fo == null) {
+                error("Can't find " + className);
+            } else {
+                JavapTask t = new JavapTask(log, fileManager, null);
+                t.handleOptions(new String[] { "-sysinfo", className });
+                JavapTask.ClassFileInfo cfInfo = t.read(fo);
+                expectEqual(cfInfo.cf.byteLength(), cfInfo.size);
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+            error("Exception: " + e);
+        }
+    }
+
+    void expectEqual(int found, int expected) {
+        if (found != expected)
+            error("bad value found: " + found + " expected: " + expected);
+    }
+
+    void error(String msg) {
+        System.err.println(msg);
+        errors++;
+    }
+
+    int errors;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javap/T6868539.java	Mon Sep 07 22:42:05 2009 -0700
@@ -0,0 +1,96 @@
+/*
+ * Copyright 2009 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+/*
+ * @test
+ * @bug 6868539 6868548
+ * @summary javap should use current names for constant pool entries,
+ *              remove spurious ';' from constant pool entries
+ */
+
+import java.io.*;
+import java.util.*;
+
+public class T6868539
+
+{
+    public static void main(String... args) {
+        new T6868539().run();
+    }
+
+    void run() {
+        verify("T6868539", "Utf8 +java/lang/String");                                   // 1: Utf8
+                                                                                        // 2: currently unused
+        verify("T6868539", "Integer +123456");                                          // 3: Integer
+        verify("T6868539", "Float +123456.0f");                                         // 4: Float
+        verify("T6868539", "Long +123456l");                                            // 5: Long
+        verify("T6868539", "Double +123456.0d");                                        // 6: Double
+        verify("T6868539", "Class +#[0-9]+ +// + T6868539");                            // 7: Class
+        verify("T6868539", "String +#[0-9]+ +// + not found");                          // 8: String
+        verify("T6868539", "Fieldref +#[0-9]+\\.#[0-9]+ +// +T6868539.errors:I");       // 9: Fieldref
+        verify("T6868539", "Methodref +#[0-9]+\\.#[0-9]+ +// +T6868539.run:\\(\\)V");   // 10: Methodref
+        verify("T6868539", "InterfaceMethodref +#[0-9]+\\.#[0-9]+ +// +java/lang/Runnable\\.run:\\(\\)V");
+                                                                                        // 11: InterfaceMethodref
+        verify("T6868539", "NameAndType +#[0-9]+:#[0-9]+ +// +run:\\(\\)V");            // 12: NameAndType
+        if (errors > 0)
+            throw new Error(errors + " found.");
+    }
+
+    void verify(String className, String... expects) {
+        String output = javap(className);
+        for (String expect: expects) {
+            if (!output.matches("(?s).*" + expect + ".*"))
+                error(expect + " not found");
+        }
+    }
+
+    void error(String msg) {
+        System.err.println(msg);
+        errors++;
+    }
+
+    int errors;
+
+    String javap(String className) {
+        String testClasses = System.getProperty("test.classes", ".");
+        StringWriter sw = new StringWriter();
+        PrintWriter out = new PrintWriter(sw);
+        String[] args = { "-v", "-classpath", testClasses, className };
+        int rc = com.sun.tools.javap.Main.run(args, out);
+        if (rc != 0)
+            throw new Error("javap failed. rc=" + rc);
+        out.close();
+        String output = sw.toString();
+        System.out.println("class " + className);
+        System.out.println(output);
+        return output;
+    }
+
+    int i = 123456;
+    float f = 123456.f;
+    double d = 123456.;
+    long l = 123456L;
+
+    void m(Runnable r) { r.run(); }
+}
+
--- a/test/tools/javap/stackmap/T6271292.sh	Sat Jul 25 20:57:05 2009 -0700
+++ b/test/tools/javap/stackmap/T6271292.sh	Mon Sep 07 22:42:05 2009 -0700
@@ -75,7 +75,7 @@
 grep "offset_delta" "${JAVAPFILE}" >> "${OUTFILE}"
 grep "stack = " "${JAVAPFILE}" >> "${OUTFILE}"
 grep "locals = " "${JAVAPFILE}" >> "${OUTFILE}"
-diff "${OUTFILE}" "${TESTSRC}${FS}T6271292.out"
+diff -w "${OUTFILE}" "${TESTSRC}${FS}T6271292.out"
 result="$?"
 if [ "$result" -eq 0 ]
 then
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javap/typeAnnotations/ArrayClassLiterals.java	Mon Sep 07 22:42:05 2009 -0700
@@ -0,0 +1,183 @@
+/*
+ * Copyright 2009 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+import java.io.*;
+import com.sun.tools.classfile.*;
+
+/*
+ * @test ArrayClassLiterals
+ * @bug 6863814
+ * @summary test that class literals array doesn't crash javap
+ */
+
+public class ArrayClassLiterals {
+    public static void main(String[] args) throws Exception {
+        new ArrayClassLiterals().run();
+    }
+
+    public void run() throws Exception {
+        File javaFile = writeTestFile();
+        File classFile = compileTestFile(javaFile);
+
+        ClassFile cf = ClassFile.read(classFile);
+        test(cf);
+        for (Field f : cf.fields) {
+            test(cf, f);
+        }
+        for (Method m: cf.methods) {
+            test(cf, m);
+        }
+
+        countAnnotations();
+
+        if (errors > 0)
+            throw new Exception(errors + " errors found");
+        System.out.println("PASSED");
+    }
+
+    void test(ClassFile cf) {
+        test(cf, Attribute.RuntimeVisibleTypeAnnotations, true);
+        test(cf, Attribute.RuntimeInvisibleTypeAnnotations, false);
+    }
+
+    void test(ClassFile cf, Method m) {
+        test(cf, m, Attribute.RuntimeVisibleTypeAnnotations, true);
+        test(cf, m, Attribute.RuntimeInvisibleTypeAnnotations, false);
+    }
+
+    void test(ClassFile cf, Field m) {
+        test(cf, m, Attribute.RuntimeVisibleTypeAnnotations, true);
+        test(cf, m, Attribute.RuntimeInvisibleTypeAnnotations, false);
+    }
+
+    // test the result of Attributes.getIndex according to expectations
+    // encoded in the method's name
+    void test(ClassFile cf, String name, boolean visible) {
+        int index = cf.attributes.getIndex(cf.constant_pool, name);
+        if (index != -1) {
+            Attribute attr = cf.attributes.get(index);
+            assert attr instanceof RuntimeTypeAnnotations_attribute;
+            RuntimeTypeAnnotations_attribute tAttr = (RuntimeTypeAnnotations_attribute)attr;
+            all += tAttr.annotations.length;
+            if (visible)
+                visibles += tAttr.annotations.length;
+            else
+                invisibles += tAttr.annotations.length;
+
+            for (ExtendedAnnotation anno : tAttr.annotations)
+                anno.position.toString();
+        }
+    }
+
+    // test the result of Attributes.getIndex according to expectations
+    // encoded in the method's name
+    void test(ClassFile cf, Method m, String name, boolean visible) {
+        int index = m.attributes.getIndex(cf.constant_pool, name);
+        if (index != -1) {
+            Attribute attr = m.attributes.get(index);
+            assert attr instanceof RuntimeTypeAnnotations_attribute;
+            RuntimeTypeAnnotations_attribute tAttr = (RuntimeTypeAnnotations_attribute)attr;
+            all += tAttr.annotations.length;
+            if (visible)
+                visibles += tAttr.annotations.length;
+            else
+                invisibles += tAttr.annotations.length;
+
+            for (ExtendedAnnotation anno : tAttr.annotations)
+                anno.position.toString();
+        }
+    }
+
+    // test the result of Attributes.getIndex according to expectations
+    // encoded in the method's name
+    void test(ClassFile cf, Field m, String name, boolean visible) {
+        int index = m.attributes.getIndex(cf.constant_pool, name);
+        if (index != -1) {
+            Attribute attr = m.attributes.get(index);
+            assert attr instanceof RuntimeTypeAnnotations_attribute;
+            RuntimeTypeAnnotations_attribute tAttr = (RuntimeTypeAnnotations_attribute)attr;
+            all += tAttr.annotations.length;
+            if (visible)
+                visibles += tAttr.annotations.length;
+            else
+                invisibles += tAttr.annotations.length;
+
+            for (ExtendedAnnotation anno : tAttr.annotations)
+                anno.position.toString();
+        }
+    }
+
+    File writeTestFile() throws IOException {
+      File f = new File("Testa.java");
+        PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter(f)));
+        out.println("import java.util.*;");
+        out.println("class Testa { ");
+        out.println("  @interface A { }");
+
+        out.println(" void test() {");
+        out.println("  Object a = @A String.class;");
+        out.println("  Object b = @A String @A [] @A [].class;");
+        out.println(" }");
+        out.println("}");
+
+        out.close();
+        return f;
+    }
+
+    File compileTestFile(File f) {
+      int rc = com.sun.tools.javac.Main.compile(new String[] { "-source", "1.7", "-g", f.getPath() });
+        if (rc != 0)
+            throw new Error("compilation failed. rc=" + rc);
+        String path = f.getPath();
+        return new File(path.substring(0, path.length() - 5) + ".class");
+    }
+
+    void countAnnotations() {
+        int expected_visibles = 0, expected_invisibles = 4;
+        int expected_all = expected_visibles + expected_invisibles;
+
+        if (expected_all != all) {
+            errors++;
+            System.err.println("expected " + expected_all
+                    + " annotations but found " + all);
+        }
+
+        if (expected_visibles != visibles) {
+            errors++;
+            System.err.println("expected " + expected_visibles
+                    + " visibles annotations but found " + visibles);
+        }
+
+        if (expected_invisibles != invisibles) {
+            errors++;
+            System.err.println("expected " + expected_invisibles
+                    + " invisibles annotations but found " + invisibles);
+        }
+
+    }
+
+    int errors;
+    int all;
+    int visibles;
+    int invisibles;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javap/typeAnnotations/T6855990.java	Mon Sep 07 22:42:05 2009 -0700
@@ -0,0 +1,51 @@
+/*
+ * Copyright 2009 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+import java.io.*;
+
+/*
+ * @test
+ * @bug 6855990
+ * @summary InstructionDetailWriter should support new 308 annotations attribute
+ */
+
+public class T6855990 {
+    public static void main(String[] args) throws Exception {
+        new T6855990().run();
+    }
+
+    public void run() throws Exception {
+        @Simple String[] args = { "-c", "-XDdetails:typeAnnotations", "T6855990" };
+        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();
+        System.out.println(out);
+        if (out.indexOf("@Simple: LOCAL_VARIABLE") == -1)
+            throw new Exception("expected output not found");
+    }
+}
+
+@interface Simple { }
+