Merge
authordholmes
Tue, 15 Mar 2011 20:00:45 -0400
changeset 8793 a25480ff1a6b
parent 8792 cd1dceb2d665 (current diff)
parent 8588 36e3e74be5ae (diff)
child 8794 6d09670300ce
Merge
jdk/make/common/Defs.gmk
jdk/make/common/Modules.gmk
jdk/make/common/shared/Sanity.gmk
jdk/make/java/jli/Makefile
jdk/make/java/jvm/Makefile
jdk/make/java/nio/mxbean/Makefile
jdk/make/java/redist/Makefile
jdk/make/modules/Makefile
jdk/make/modules/bootmodule.roots
jdk/make/modules/jdk7.depconfig
jdk/make/modules/modules.config
jdk/make/modules/modules.group
jdk/make/modules/optional.depconfig
jdk/make/modules/tools/Makefile
jdk/make/modules/tools/build.xml
jdk/make/modules/tools/nbproject/project.properties
jdk/make/modules/tools/nbproject/project.xml
jdk/make/modules/tools/src/com/sun/classanalyzer/AnnotatedDependency.java
jdk/make/modules/tools/src/com/sun/classanalyzer/AnnotationParser.java
jdk/make/modules/tools/src/com/sun/classanalyzer/BootAnalyzer.java
jdk/make/modules/tools/src/com/sun/classanalyzer/CheckDeps.java
jdk/make/modules/tools/src/com/sun/classanalyzer/ClassAnalyzer.java
jdk/make/modules/tools/src/com/sun/classanalyzer/ClassFileParser.java
jdk/make/modules/tools/src/com/sun/classanalyzer/ClassPath.java
jdk/make/modules/tools/src/com/sun/classanalyzer/CodeAttributeParser.java
jdk/make/modules/tools/src/com/sun/classanalyzer/ConstantPoolAnalyzer.java
jdk/make/modules/tools/src/com/sun/classanalyzer/ConstantPoolParser.java
jdk/make/modules/tools/src/com/sun/classanalyzer/DependencyConfig.java
jdk/make/modules/tools/src/com/sun/classanalyzer/Klass.java
jdk/make/modules/tools/src/com/sun/classanalyzer/Module.java
jdk/make/modules/tools/src/com/sun/classanalyzer/ModuleConfig.java
jdk/make/modules/tools/src/com/sun/classanalyzer/ResolutionInfo.java
jdk/make/modules/tools/src/com/sun/classanalyzer/ResourceFile.java
jdk/make/modules/tools/src/com/sun/classanalyzer/ShowDeps.java
--- a/.hgtags	Tue Mar 15 19:52:42 2011 -0400
+++ b/.hgtags	Tue Mar 15 20:00:45 2011 -0400
@@ -106,3 +106,4 @@
 6823ea7eb8eb6fab405d7edb7a5c2f690887a2fa jdk7-b129
 a36beda9b9de91231d92a2c529f21cc218fcf8d5 jdk7-b130
 d8af56da89bc0fc02a6b6ad78f51157a46d665ab jdk7-b131
+d61280d36755d1941fb487f554e8b7a6d0bca6a1 jdk7-b132
--- a/.hgtags-top-repo	Tue Mar 15 19:52:42 2011 -0400
+++ b/.hgtags-top-repo	Tue Mar 15 20:00:45 2011 -0400
@@ -106,3 +106,4 @@
 a6b015b59fbc2518762c17ccc35702f03ef7713a jdk7-b129
 cc58c11af15411042719e9c82707fdbef60a9e0f jdk7-b130
 5d86d951426aaf340b1ba84ae2d5ab5da65a71e2 jdk7-b131
+0f62a65fb666b337caa585015ab6ea2e60e709ca jdk7-b132
--- a/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ b/Makefile	Tue Mar 15 20:00:45 2011 -0400
@@ -36,12 +36,6 @@
   JDK_MAKE_SHARED_DIR=$(JDK_TOPDIR)/make/common/shared
 endif
 
-# For start and finish echo lines
-TITLE_TEXT = Control $(PLATFORM) $(ARCH) $(RELEASE)
-DATE_STAMP = `$(DATE) '+%y-%m-%d %H:%M'`
-START_ECHO  = echo "$(TITLE_TEXT) $@ build started: $(DATE_STAMP)"
-FINISH_ECHO = echo "$(TITLE_TEXT) $@ build finished: $(DATE_STAMP)"
-
 default: all
 
 include $(JDK_MAKE_SHARED_DIR)/Defs-control.gmk
@@ -57,10 +51,6 @@
 include ./make/sponsors-rules.gmk
 include ./make/deploy-rules.gmk
 
-# What "all" means
-all::
-	@$(START_ECHO)
-
 all:: sanity
 
 ifeq ($(SKIP_FASTDEBUG_BUILD), false)
@@ -73,40 +63,44 @@
 
 all:: all_product_build 
 
-all:: 
-	@$(FINISH_ECHO)
+all_product_build::
 
 # Everything for a full product build
-all_product_build::
-	@$(START_ECHO)
+ifeq ($(SKIP_PRODUCT_BUILD), false)
 
-ifeq ($(SKIP_PRODUCT_BUILD), false)
-  
   all_product_build:: product_build
 
   ifeq ($(BUILD_INSTALL), true)
     all_product_build:: $(INSTALL)
     clobber:: install-clobber
   endif
-  
+
   ifeq ($(BUILD_SPONSORS), true)
     all_product_build:: $(SPONSORS)
     clobber:: sponsors-clobber
   endif
-  
+
   ifneq ($(SKIP_COMPARE_IMAGES), true)
     all_product_build:: compare-image
   endif
 
 endif
 
-all_product_build:: 
-	@$(FINISH_ECHO)
+define StartTimer
+	$(MKDIR) -p $(BUILDTIMESDIR)
+	$(RM) $(BUILDTIMESDIR)/build_time_*
+	$(call RecordStartTime,TOTAL)
+endef
+
+define StopTimer
+	$(if $(REPORT_BUILD_TIMES),$(call RecordEndTime,TOTAL) && $(call ReportBuildTimes,$1),)
+endef
 
 # Generic build of basic repo series
 generic_build_repo_series::
 	$(MKDIR) -p $(OUTPUTDIR)
 	$(MKDIR) -p $(OUTPUTDIR)/j2sdk-image
+	@$(call StartTimer)
 
 ifeq ($(BUILD_LANGTOOLS), true)
   generic_build_repo_series:: langtools
@@ -143,6 +137,9 @@
   clobber:: deploy-clobber
 endif
 
+generic_build_repo_series::
+	@$(call StopTimer,$(if $(DEBUG_NAME),$(DEBUG_NAME)_build,all_product_build))
+
 # The debug build, fastdebug or debug. Needs special handling.
 #  Note that debug builds do NOT do INSTALL steps, but must be done
 #  after the product build and before the INSTALL step of the product build.
@@ -167,28 +164,22 @@
 FRESH_DEBUG_BOOTDIR=$(ABS_BOOTDIR_OUTPUTDIR)/../$(PLATFORM)-$(ARCH)-$(DEBUG_NAME)/j2sdk-image
   
 create_fresh_product_bootdir: FRC
-	@$(START_ECHO)
 	$(MAKE) ALT_OUTPUTDIR=$(ABS_BOOTDIR_OUTPUTDIR) \
 		GENERATE_DOCS=false \
 		BOOT_CYCLE_SETTINGS= \
 		build_product_image
-	@$(FINISH_ECHO)
 
 create_fresh_debug_bootdir: FRC
-	@$(START_ECHO)
 	$(MAKE) ALT_OUTPUTDIR=$(ABS_BOOTDIR_OUTPUTDIR) \
 		GENERATE_DOCS=false \
 		BOOT_CYCLE_DEBUG_SETTINGS= \
 		build_debug_image
-	@$(FINISH_ECHO)
 
 create_fresh_fastdebug_bootdir: FRC
-	@$(START_ECHO)
 	$(MAKE) ALT_OUTPUTDIR=$(ABS_BOOTDIR_OUTPUTDIR) \
 		GENERATE_DOCS=false \
 		BOOT_CYCLE_DEBUG_SETTINGS= \
 		build_fastdebug_image
-	@$(FINISH_ECHO)
 
 # Create boot image?
 ifeq ($(SKIP_BOOT_CYCLE),false)
@@ -197,6 +188,8 @@
   endif
 endif
 
+
+
 ifeq ($(DO_BOOT_CYCLE),true)
   
   # Create the bootdir to use in the build
@@ -221,27 +214,23 @@
 endif
 
 build_product_image:
-	@$(START_ECHO)
 	$(MAKE) \
 	        SKIP_FASTDEBUG_BUILD=true \
 	        SKIP_DEBUG_BUILD=true \
 	        $(BOOT_CYCLE_SETTINGS) \
 	        generic_build_repo_series
-	@$(FINISH_ECHO)
 
 #   NOTE: On windows, do not use $(ABS_OUTPUTDIR)-$(DEBUG_NAME).
 #         Due to the use of short paths in $(ABS_OUTPUTDIR), this may 
 #         not be the same location.
 
 generic_debug_build:
-	@$(START_ECHO)
 	$(MAKE) \
 		ALT_OUTPUTDIR=$(ABS_OUTPUTDIR)/../$(PLATFORM)-$(ARCH)-$(DEBUG_NAME) \
 	        DEBUG_NAME=$(DEBUG_NAME) \
 		GENERATE_DOCS=false \
 	        $(BOOT_CYCLE_DEBUG_SETTINGS) \
 		generic_build_repo_series
-	@$(FINISH_ECHO)
 
 build_debug_image:
 	$(MAKE) DEBUG_NAME=debug generic_debug_build
@@ -254,7 +243,8 @@
 debug_build:: build_debug_image
 fastdebug_build:: build_fastdebug_image
 
-clobber::
+clobber:: REPORT_BUILD_TIMES=
+clobber:: 
 	$(RM) -r $(OUTPUTDIR)/*
 	$(RM) -r $(OUTPUTDIR)/../$(PLATFORM)-$(ARCH)-debug/*
 	$(RM) -r $(OUTPUTDIR)/../$(PLATFORM)-$(ARCH)-fastdebug/*
--- a/corba/.hgtags	Tue Mar 15 19:52:42 2011 -0400
+++ b/corba/.hgtags	Tue Mar 15 20:00:45 2011 -0400
@@ -106,3 +106,4 @@
 66fa0fcc779296c99746b09efce6109944f82f30 jdk7-b129
 563a8f8b5be3940e9346cffac4eff9ed02b3c69f jdk7-b130
 9d6dd2cdfcb92612dbd836ecded87770d52b49db jdk7-b131
+1b1e75e8f476e5c07f0d2b035993895e2603e1f0 jdk7-b132
--- a/hotspot/.hgtags	Tue Mar 15 19:52:42 2011 -0400
+++ b/hotspot/.hgtags	Tue Mar 15 20:00:45 2011 -0400
@@ -151,3 +151,5 @@
 e9aa2ca89ad6c53420623d579765f9706ec523d7 jdk7-b130
 0aa3b49089112d5faa77902ad680c582ab53f651 jdk7-b131
 e9aa2ca89ad6c53420623d579765f9706ec523d7 hs21-b02
+0e531ab5ba04967a0e9aa6aef65e6eb3a0dcf632 jdk7-b132
+a8d643a4db47c7b58e0bcb49c77b5c3610de86a8 hs21-b03
--- a/jaxp/.hgtags	Tue Mar 15 19:52:42 2011 -0400
+++ b/jaxp/.hgtags	Tue Mar 15 20:00:45 2011 -0400
@@ -106,3 +106,4 @@
 f5b60c5a310f992c6ca627d17ca3e042f0e0b2c3 jdk7-b129
 ab107c1bc4b918404b191838c455e9b2892389f3 jdk7-b130
 eab6f27131e4e2f0af0016b35b18ae65cdd249d9 jdk7-b131
+abe04c59a556a3821c30bd8839e3c74f5d4281d1 jdk7-b132
--- a/jaxws/.hgtags	Tue Mar 15 19:52:42 2011 -0400
+++ b/jaxws/.hgtags	Tue Mar 15 20:00:45 2011 -0400
@@ -106,3 +106,4 @@
 0f7b39ad902424e949e3d2dca8411b884888a76f jdk7-b129
 ba1fac1c2083196422a12130db174334179a4d44 jdk7-b130
 438abc0356cd97d91b25f67cd1abc9883e22f6ed jdk7-b131
+0e57c3272d377eee04cc32c898e9a558051516b0 jdk7-b132
--- a/jdk/.hgtags	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/.hgtags	Tue Mar 15 20:00:45 2011 -0400
@@ -107,3 +107,4 @@
 bdc069d3f9101f89ec3f81c2950ee2d68fa846d3 jdk7-b130
 8ac52c85f9e91336dc00b52ef90b42eecf3230b3 jdk7-b131
 6bbc7a4734952ae7604578f270e1566639fa8752 jdk7-b132
+5e5f68a01d12a4432172f384d5201f3a05254493 jdk7-b133
--- a/jdk/make/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/Makefile	Tue Mar 15 20:00:45 2011 -0400
@@ -74,7 +74,6 @@
 import_product    -- copy in the product components \n\
 import_fastdebug  -- copy in the fastdebug components \n\
 import_debug      -- copy in the debug components \n\
-modules           -- build the jdk and jre module images (experimental) \n\
 create_links      -- create softlinks in Solaris 32bit build to 64bit dirs \n\
 "
 
@@ -261,7 +260,6 @@
 # Release engineering targets.
 #
 include $(BUILDDIR)/common/Release.gmk
-include $(BUILDDIR)/common/Modules.gmk
 
 #
 # Cscope targets.
--- a/jdk/make/com/sun/crypto/provider/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/com/sun/crypto/provider/Makefile	Tue Mar 15 20:00:45 2011 -0400
@@ -249,7 +249,7 @@
 else
 $(JAR_DESTFILE): $(SIGNED_DIR)/sunjce_provider.jar
 endif
-	$(install-non-module-file)
+	$(install-file)
 
 ifndef OPENJDK
 install-prebuilt:
--- a/jdk/make/com/sun/java/pack/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/com/sun/java/pack/Makefile	Tue Mar 15 20:00:45 2011 -0400
@@ -28,7 +28,6 @@
 #
 
 BUILDDIR = ../../../..
-MODULE  = pack200
 PACKAGE = com.sun.java.util.jar.pack
 LIBRARY = unpack
 PRODUCT = sun
@@ -156,7 +155,6 @@
 endif
 	$(CP) $(TEMPDIR)/unpack200$(EXE_SUFFIX) $(UNPACK_EXE)
 	@$(call binary_file_verification,$@)
-	$(install-module-file)
 
 ifeq ($(PLATFORM), windows) 
 $(RES):: $(VERSIONINFO_RESOURCE)
--- a/jdk/make/com/sun/java/pack/prop/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/com/sun/java/pack/prop/Makefile	Tue Mar 15 20:00:45 2011 -0400
@@ -29,7 +29,6 @@
 # to a collision of rules with Classes.gmk and Library.gmk
 
 BUILDDIR = ../../../../..
-MODULE  = pack200
 PACKAGE = com.sun.java.util.jar.pack
 PRODUCT = sun
 include $(BUILDDIR)/common/Defs.gmk
--- a/jdk/make/com/sun/jndi/cosnaming/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/com/sun/jndi/cosnaming/Makefile	Tue Mar 15 20:00:45 2011 -0400
@@ -28,7 +28,6 @@
 #
 
 BUILDDIR = ../../../..
-MODULE  = jndi-cosnaming
 PACKAGE = com.sun.jndi.cosnaming
 PRODUCT = sun
 include $(BUILDDIR)/common/Defs.gmk
--- a/jdk/make/com/sun/jndi/dns/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/com/sun/jndi/dns/Makefile	Tue Mar 15 20:00:45 2011 -0400
@@ -28,7 +28,6 @@
 #
 
 BUILDDIR = ../../../..
-MODULE  = jndi-dns
 PACKAGE = com.sun.jndi.dns
 PRODUCT = sun
 include $(BUILDDIR)/common/Defs.gmk
--- a/jdk/make/com/sun/jndi/ldap/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/com/sun/jndi/ldap/Makefile	Tue Mar 15 20:00:45 2011 -0400
@@ -28,7 +28,6 @@
 #
 
 BUILDDIR = ../../../..
-MODULE  = jndi-ldap
 PACKAGE = com.sun.jndi.ldap
 PRODUCT = sun
 include $(BUILDDIR)/common/Defs.gmk
--- a/jdk/make/com/sun/jndi/rmi/registry/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/com/sun/jndi/rmi/registry/Makefile	Tue Mar 15 20:00:45 2011 -0400
@@ -28,7 +28,6 @@
 #
 
 BUILDDIR = ../../../../..
-MODULE  = jndi-rmiregistry
 PACKAGE = com.sun.jndi.rmi.registry
 PRODUCT = sun
 include $(BUILDDIR)/common/Defs.gmk
--- a/jdk/make/com/sun/nio/sctp/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/com/sun/nio/sctp/Makefile	Tue Mar 15 20:00:45 2011 -0400
@@ -28,7 +28,6 @@
 #
 
 BUILDDIR = ../../../..
-MODULE  = sctp
 PACKAGE = com.sun.nio.sctp
 LIBRARY = sctp
 PRODUCT = sun
--- a/jdk/make/com/sun/org/apache/xml/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/com/sun/org/apache/xml/Makefile	Tue Mar 15 20:00:45 2011 -0400
@@ -28,7 +28,6 @@
 #
 
 BUILDDIR = ../../../../..
-MODULE  = security-xmldsig
 PACKAGE = com.sun.org.apache.xml
 PRODUCT = xml
 include $(BUILDDIR)/common/Defs.gmk
--- a/jdk/make/com/sun/rowset/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/com/sun/rowset/Makefile	Tue Mar 15 20:00:45 2011 -0400
@@ -28,7 +28,6 @@
 #
 
 BUILDDIR = ../../..
-MODULE  = jdbc-enterprise
 PACKAGE = com.sun.rowset
 PRODUCT = sun
 include $(BUILDDIR)/common/Defs.gmk
--- a/jdk/make/com/sun/script/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/com/sun/script/Makefile	Tue Mar 15 20:00:45 2011 -0400
@@ -25,7 +25,6 @@
 
 
 BUILDDIR = ../../..
-MODULE  = scripting-rhino
 PACKAGE = com.sun.script
 PRODUCT = sun
 include $(BUILDDIR)/common/Defs.gmk
--- a/jdk/make/com/sun/security/auth/module/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/com/sun/security/auth/module/Makefile	Tue Mar 15 20:00:45 2011 -0400
@@ -26,7 +26,6 @@
 # Makefile for building auth modules.
 
 BUILDDIR = ../../../../..
-MODULE  = security-auth
 PACKAGE = com.sun.security.auth.module
 PRODUCT = sun
 
--- a/jdk/make/com/sun/servicetag/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/com/sun/servicetag/Makefile	Tue Mar 15 20:00:45 2011 -0400
@@ -22,7 +22,6 @@
 # questions.
 
 BUILDDIR = ../../..
-MODULE  = servicetag
 PACKAGE = com.sun.servicetag
 PRODUCT = sun
 include $(BUILDDIR)/common/Defs.gmk
--- a/jdk/make/com/sun/tools/attach/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/com/sun/tools/attach/Makefile	Tue Mar 15 20:00:45 2011 -0400
@@ -25,7 +25,6 @@
 
 
 BUILDDIR = ../../../..
-MODULE  = attach
 PACKAGE = com.sun.tools.attach
 LIBRARY = attach
 PRODUCT = sun
@@ -66,8 +65,7 @@
 	@$(MKDIR) -p $(@D)
 	@$(RM) $@
 	@$(CAT) $< | $(SED) -e "s/^#\[$(PLATFORM)\]//" > $@
-	@$(install-module-file)
-                                                                                                
+
 .PHONY: copy-files
 
 
--- a/jdk/make/common/Defs.gmk	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/common/Defs.gmk	Tue Mar 15 20:00:45 2011 -0400
@@ -229,9 +229,6 @@
 # for generated class files
 CLASSBINDIR         = $(OUTPUTDIR)/classes
 DEMOCLASSDIR        = $(OUTPUTDIR)/democlasses
-# for modules
-MODULES_DIR         = $(OUTPUTDIR)/modules
-ABS_MODULES_DIR     = $(ABS_OUTPUTDIR)/modules
 # for generated tool class files
 BUILDTOOLCLASSDIR   = $(OUTPUTDIR)/btclasses
 # for build tool jar files
@@ -302,22 +299,6 @@
   endif
 endif
 
-#
-# Build units may or may not define MODULE.  Default to "other".
-#
-# MODULE variable defines the lowest-level module name that
-# might or might not be the name of the modules created in
-# the modules build (see make/modules/modules.config and
-# modules.group).
-#
-MODULES_TEMPDIR     = $(OUTPUTDIR)/tmp/modules
-ABS_MODULES_TEMPDIR = $(ABS_OUTPUTDIR)/tmp/modules
-
-ifndef MODULE
-  MODULE = other
-endif
-override MODULE_DEST_DIR = $(MODULES_TEMPDIR)/$(MODULE)
-
 # the use of += above makes a space separated list which we need to 
 # remove for filespecs.
 #
@@ -427,52 +408,13 @@
 #
 include $(JDK_MAKE_SHARED_DIR)/Defs-java.gmk
 
-#
-# Macros to find the module that $@ belongs to
-#
-
 UNIQUE_PATH_PATTERN = $(subst /,.,$(UNIQUE_PATH))
-MODULE_PATH_PATTERN = -e 's%.*\/classes\/%classes\/%' \
-		      -e 's%.*\/$(UNIQUE_PATH_PATTERN)\/%classes\/%' \
-		      -e 's%.*\/lib\/%lib\/%' \
-	              -e 's%.*\/bin\/%bin\/%' \
-	              -e 's%.*\/include\/%include\/%' \
-		      -e 's%.*\/demo\/%demo\/%' \
-		      -e 's%.*\/sample\/%sample\/%'
-
-# Install a file to its module
-define install-module-file
-dest=`echo $(@D)/ | $(SED) $(MODULE_PATH_PATTERN)` ; \
-$(MKDIR) -p $(MODULE_DEST_DIR)/$$dest; \
-$(CP) -f $@ $(MODULE_DEST_DIR)/$$dest
-endef
-
-# Install all files from the directory to its module
-define install-module-dir
-dest=`echo $(@D)/ | $(SED) $(MODULE_PATH_PATTERN)` ; \
-$(MKDIR) -p $(MODULE_DEST_DIR)/$$dest; \
-$(CP) -rf $(@D)/* $(MODULE_DEST_DIR)/$$dest
-endef
-
-# chmod the file in its module
-define chmod-module-file
-dest=`echo $@ | $(SED) $(MODULE_PATH_PATTERN)` ; \
-$(CHMOD) $1 $(MODULE_DEST_DIR)/$$dest
-endef
-
-# install a sym link in its module
-define install-module-sym-link
-dest=`echo $@ | $(SED) $(MODULE_PATH_PATTERN)` ; \
-$(LN) -sf $1 $(MODULE_DEST_DIR)/$$dest
-endef
-
 
 # Run MAKE $@ for a launcher:
 #   $(call make-launcher, name, mainclass, java-args, main-args)
 define make-launcher
 $(CD) $(BUILDDIR)/launchers && \
 $(MAKE) -f Makefile.launcher \
-        MODULE=$(MODULE) \
         PROGRAM=$(strip $1) \
         MAIN_CLASS=$(strip $2) \
         MAIN_JAVA_ARGS="$(strip $3)" \
@@ -493,28 +435,18 @@
 define install-file
 $(prep-target)
 $(CP) $< $@
-@$(install-module-file)
 endef
 
 define chmod-file
 $(CHMOD) $1 $@
-@$(call chmod-module-file, $1)
 endef
 
 define install-sym-link
 $(LN) -s $1 $@
-@$(call install-module-sym-link, $1)
-endef
-
-#
-# Marcos for files not belonging to any module 
-define install-non-module-file
-$(prep-target)
-$(CP) $< $@
 endef
 
 define install-manifest-file
-$(install-non-module-file)
+$(install-file)
 endef
 
 # Cleanup rule for after debug java run (hotspot.log file is left around)
@@ -582,7 +514,6 @@
 
 define install-import-file
 $(install-importonly-file)
-@$(install-module-file)
 endef
 
 .PHONY: all build clean clobber
--- a/jdk/make/common/Demo.gmk	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/common/Demo.gmk	Tue Mar 15 20:00:45 2011 -0400
@@ -25,8 +25,6 @@
 
 # JDK Demo building jar file.
   
-MODULE = demos
-
 # Some names are defined with LIBRARY inside the Defs.gmk file
 LIBRARY=$(DEMONAME)
 OBJDIR=$(TEMPDIR)/$(DEMONAME)
--- a/jdk/make/common/Library.gmk	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/common/Library.gmk	Tue Mar 15 20:00:45 2011 -0400
@@ -168,18 +168,9 @@
 	  $(OTHER_LCF) $(JAVALIB) $(LDLIBS)
 	$(CP) $(OBJDIR)/$(@F) $@
 	@$(call binary_file_verification,$@)
-	$(install-module-file)
 	$(CP) $(OBJDIR)/$(LIBRARY).map $(@D)
 	$(CP) $(OBJDIR)/$(LIBRARY).pdb $(@D)
 
-$(ACTUAL_LIBRARY):: $(ACTUAL_LIBRARY_DIR)/$(LIBRARY).map $(ACTUAL_LIBRARY_DIR)/$(LIBRARY).pdb
-
-$(ACTUAL_LIBRARY_DIR)/%.map: FORCE
-	$(install-module-file)
-
-$(ACTUAL_LIBRARY_DIR)/%.pdb: FORCE
-	$(install-module-file)
-
 endif # LIBRARY
 
 $(OBJDIR)/$(LIBRARY).lcf: $(OBJDIR)/$(LIBRARY).res $(COMPILE_FILES_o) $(FILES_m)
@@ -235,7 +226,6 @@
 else # LIBRARY
 	$(LINKER) $(SHARED_LIBRARY_FLAG) -o $@ $(FILES_o) $(LDLIBS)
 	@$(call binary_file_verification,$@)
-	$(install-module-file)
 ifeq ($(WRITE_LIBVERSION),true)
 	$(MCS) -d -a "$(FULL_VERSION)" $@
 endif # WRITE_LIBVERSION
--- a/jdk/make/common/Modules.gmk	Tue Mar 15 19:52:42 2011 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,454 +0,0 @@
-#
-# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.  Oracle designates this
-# particular file as subject to the "Classpath" exception as provided
-# by Oracle in the LICENSE file that accompanied this code.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-
-JDK_MODULE_IMAGE_DIR = $(ABS_OUTPUTDIR)/jdk-module-image
-JRE_MODULE_IMAGE_DIR = $(ABS_OUTPUTDIR)/jre-module-image
-
-#
-# modules   Target to build jdk and jre module image
-#
-#           There is one jar file per module containing classes only.
-#           All module jars are currently placed under jre/lib directory.
-#
-# Open issues that need further investigation:
-# 1. Classes in jre/lib/ext/dnsns.jar are currently put in jre/lib/jndi-dns
-#    module.  META-INF/services file is not installed.
-# 2. Signed jars
-#    For JDK build, signed jars are copied to the build.
-#    All jars in the module image are unsigned.
-
-MODULE_IMAGEBINDIR = bin
-
-#
-# Targets.
-#
-INITIAL_MODULE_IMAGE_JRE=initial-module-image-jre
-INITIAL_MODULE_IMAGE_JDK=initial-module-image-jdk
-ifeq ($(PLATFORM), solaris)
-  ifeq ($(ARCH_DATA_MODEL), 64)
-    INITIAL_MODULE_IMAGE_JRE=initial-module-image-jre-sol64
-    INITIAL_MODULE_IMAGE_JDK=initial-module-image-jdk-sol64
-  endif
-endif
-
-modules modules-clobber \
-initial-module-image-jre initial-module-image-jdk \
-initial-module-image-jre-sol64 initial-module-image-jdk-sol64 \
-trim-module-image-jre trim-module-image-jdk \
-process-module-image-jre process-module-image-jdk ::
-	@$(ECHO) ">>>Making "$@" @ `$(DATE)` ..."
-
-# Order is important here, trim jre after jdk image is created
-modules:: gen-modules \
-	 sanity-module-images post-sanity-module-images  \
-	 $(INITIAL_MODULE_IMAGE_JRE) $(INITIAL_MODULE_IMAGE_JDK) \
-	 trim-module-image-jre trim-module-image-jdk \
-	 process-module-image-jre process-module-image-jdk
-
-# Don't use these
-module-image-jre:: initial-module-image-jre trim-module-image-jre process-module-image-jre
-module-image-jdk:: initial-module-image-jdk trim-module-image-jdk process-module-image-jdk
-
-#
-# Paths to these files we need
-JDK_MODULE_DOCFILES   = $(IMAGE_DOCLIST_JDK:%=$(JDK_MODULE_IMAGE_DIR)/%)
-JRE_MODULE_DOCFILES   = $(IMAGE_DOCLIST_JRE:%=$(JRE_MODULE_IMAGE_DIR)/%)
-
-###### RULES
-
-# JDK files
-$(JDK_MODULE_IMAGE_DIR)/%: $(SHARE_JDK_DOC_SRC)/%
-	$(process-doc-file)
-
-# JRE files 
-$(JRE_MODULE_IMAGE_DIR)/%: $(SHARE_JRE_DOC_SRC)/%
-	$(process-doc-file)
-ifeq ($(PLATFORM), windows)
-$(JRE_MODULE_IMAGE_DIR)/README.txt: $(SHARE_JRE_DOC_SRC)/README
-	$(process-doc-file)
-endif
-
-######################################################
-# JRE Image
-######################################################
-
-MODULES_LIST = $(MODULES_TEMPDIR)/classlist/modules.list
-
-# Modules in the jre/lib/security directory
-POLICY_MODULES = US_export_policy local_policy
-
-# Modules in the modules/ext directory
-EXT_MODULES = localedata security-sunec security-sunjce
-
-# Build PKCS#11 on all platforms except 64-bit Windows.
-PKCS11 = security-sunpkcs11
-ifeq ($(ARCH_DATA_MODEL), 64)
-  ifeq ($(PLATFORM), windows)
-    PKCS11 =
-  endif
-endif
-
-EXT_MODULES += $(PKCS11)
-
-# Build Microsoft CryptoAPI provider only on (non-64-bit) Windows platform.
-ifeq ($(PLATFORM), windows)
-  ifneq ($(ARCH_DATA_MODEL), 64)
-    EXT_MODULES += security-sunmscapi
-  endif
-endif
-
-# Modules for JDK only
-JDK_MODULES = tools
-
-gen-modules:
-	$(CD) modules; $(MAKE) all
-
-initial-module-image-jre-setup:
-	$(RM) -r $(JRE_MODULE_IMAGE_DIR)
-	$(MKDIR) -p $(JRE_MODULE_IMAGE_DIR)
-
-# 64-bit solaris jre image contains only the 64-bit add-on files.
-initial-module-image-jre-sol64:: initial-module-image-jre-setup
-	@# Use tar instead of cp to preserve the symbolic links
-	for dir in bin lib ; do \
-	  ( $(CD) $(OUTPUTDIR) && \
-		$(TAR) cf - `$(FIND) $$dir -name '$(ARCH)' -print` | \
-		($(CD) $(JRE_MODULE_IMAGE_DIR) && $(TAR) xf -) ) ; \
-	done
-	@# Remove some files from the jre area
-	for t in $(NOTJRETOOLS) ; do \
-	    $(RM) $(JRE_MODULE_IMAGE_DIR)/bin$(ISA_DIR)/$$t ; \
-	done
-	$(RM) `$(FIND) $(JRE_MODULE_IMAGE_DIR)/lib -name 'orb.idl'`
-	$(RM) `$(FIND) $(JRE_MODULE_IMAGE_DIR)/lib -name 'ir.idl'`
-
-# Construct an initial jre image (initial jdk jre) no trimming or stripping
-initial-module-image-jre:: initial-module-image-jre-setup \
-		    $(JRE_MODULE_DOCFILES) \
-		    $(BUILDMETAINDEX_JARFILE)
-	@# Copy in bin directory
-	$(CD) $(OUTPUTDIR) && $(FIND) bin -depth | $(CPIO) -pdum $(JRE_MODULE_IMAGE_DIR)
-	@# CTE plugin security change require new empty directory lib/applet
-	$(MKDIR) -p $(JRE_MODULE_IMAGE_DIR)/lib/applet
-	@# Copy files but not .jar in lib directory 
-	$(CD) $(OUTPUTDIR) && $(FIND) lib -depth | $(EGREP) -v ".jar$$" | $(CPIO) -pdum $(JRE_MODULE_IMAGE_DIR)
-	@#
-	@# copy modules to jre/lib
-	@#
-	for m in `$(NAWK) '{print $$1}' $(MODULES_LIST)` ; do \
-	    $(CP) $(MODULES_DIR)/$$m/lib/$$m.jar $(JRE_MODULE_IMAGE_DIR)/lib ; \
-	done
-	$(MKDIR) -p $(JRE_MODULE_IMAGE_DIR)/lib/ext
-	for m in $(EXT_MODULES) ; do \
-           $(MV) $(JRE_MODULE_IMAGE_DIR)/lib/$$m.jar $(JRE_MODULE_IMAGE_DIR)/lib/ext ; \
-        done
-	for m in $(POLICY_MODULES) ; do \
-           $(MV) $(JRE_MODULE_IMAGE_DIR)/lib/$$m.jar $(JRE_MODULE_IMAGE_DIR)/lib/security; \
-        done
-	@# Remove jdk modules
-	for m in $(JDK_MODULES) ; do \
-           $(RM) $(JRE_MODULE_IMAGE_DIR)/lib/$$m.jar ; \
-        done
-
-	@# Make sure all directories are read/execute for everyone
-	$(CHMOD) a+rx `$(FIND) $(JRE_MODULE_IMAGE_DIR) -type d`
-	@# Remove some files from the jre area
-	for t in $(NOTJRETOOLS) ; do \
-	    $(RM) $(JRE_MODULE_IMAGE_DIR)/bin$(ISA_DIR)/$$t ; \
-	done
-	@# Remove orb.idl and ir.idl from jre
-	$(FIND) $(JRE_MODULE_IMAGE_DIR)/lib -name 'orb.idl' -exec $(RM) \{} \;
-	$(FIND) $(JRE_MODULE_IMAGE_DIR)/lib -name 'ir.idl' -exec $(RM) \{} \;
-	@# Generate meta-index to make boot and extension class loaders lazier
-	$(CD) $(JRE_MODULE_IMAGE_DIR)/lib && \
-	    $(BOOT_JAVA_CMD) -jar $(BUILDMETAINDEX_JARFILE) \
-		-o meta-index *.jar
-	@$(CD) $(JRE_MODULE_IMAGE_DIR)/lib && $(java-vm-cleanup)
-	$(CD) $(JRE_MODULE_IMAGE_DIR)/lib/ext && \
-	    $(BOOT_JAVA_CMD) -jar $(BUILDMETAINDEX_JARFILE) \
-		-o meta-index *.jar
-	@$(CD) $(JRE_MODULE_IMAGE_DIR)/lib/ext && $(java-vm-cleanup)
-ifeq ($(PLATFORM), windows)
-	@# Remove certain *.lib files
-	$(CD) $(JRE_MODULE_IMAGE_DIR)/lib && \
-            $(RM) java.$(LIB_SUFFIX) jvm.$(LIB_SUFFIX) \
-                  awt.$(LIB_SUFFIX) jawt.$(LIB_SUFFIX)
-  ifeq ($(ARCH_DATA_MODEL), 32)
-	@# The Java Kernel JRE image ships with a special VM.  It is not included
-	@# in the full JRE image, so remove it.  Also, is it only for 32-bit windows.
-	$(CD) $(JRE_MODULE_IMAGE_DIR)/bin && $(RM) -r kernel
-  endif
-endif # Windows
-ifneq ($(PLATFORM), windows)
-	$(call copy-man-pages,$(JRE_MODULE_IMAGE_DIR),$(JRE_MAN_PAGES))
-endif # !windows
-
-# Trim out any extra files not for the jre shipment but wanted in the jdk jre.
-#   (Note the jdk WILL want the jre image before this trimming)
-#   Removes server VM on Windows 32bit.
-#   Remove certain shared libraries that should not be in the jre image
-#      but should be in the jdk jre image.
-trim-module-image-jre::
-ifeq ($(PLATFORM), windows)
-  ifeq ($(ARCH_DATA_MODEL), 32)
-	$(RM) -r $(JRE_MODULE_IMAGE_DIR)/bin/server
-  endif
-  ifdef NOTJRE_SHARED_LIBS
-	for l in $(NOTJRE_SHARED_LIBS) ; do \
-	    $(RM) $(JRE_MODULE_IMAGE_DIR)/bin/$$l ; \
-	done ;
-  endif
-else # PLATFORM
-  ifdef NOTJRE_SHARED_LIBS
-	for l in $(NOTJRE_SHARED_LIBS) ; do \
-	    $(RM) $(JRE_MODULE_IMAGE_DIR)/lib/$(LIBARCH)/$$l ; \
-	done ;
-  endif
-endif # PLATFORM
-
-# Get list of all Elf files in the jre
-JRE_MODULE_ELF_LIST=$(MODULES_TEMPDIR)/jre-elf-files.list
-$(JRE_MODULE_ELF_LIST):
-	@$(prep-target)
-ifneq ($(PLATFORM), windows)
-	$(RM) $@
-	$(FIND) $(JRE_MODULE_IMAGE_DIR)/lib -type f -name \*.$(LIB_SUFFIX) >> $@
-	$(FILE) `$(FIND) $(JRE_MODULE_IMAGE_DIR)/bin -type f -name \*$(EXE_SUFFIX)` \
-	    | $(EGREP) 'ELF' | $(CUT) -d':' -f1 >> $@
-endif
-
-# Post process the image (strips and mcs on Elf files we are shipping)
-#   (Note the jdk WILL want the jre image before this processing)
-process-module-image-jre:: $(JRE_MODULE_ELF_LIST)
-ifneq ($(POST_STRIP_PROCESS), )
-	for f in `$(CAT) $(JRE_MODULE_ELF_LIST)`; do \
-	  $(CHMOD) u+w $${f}; \
-	  $(ECHO) $(POST_STRIP_PROCESS) $${f}; \
-	  $(POST_STRIP_PROCESS) $${f}; \
-	  $(CHMOD) go-w $${f}; \
-	done
-endif
-ifneq ($(POST_MCS_PROCESS), )
-	for f in `$(CAT) $(JRE_MODULE_ELF_LIST)`; do \
-	  $(CHMOD) u+w $${f}; \
-	  $(ECHO) $(POST_MCS_PROCESS) $${f}; \
-	  $(POST_MCS_PROCESS) $${f}; \
-	  $(CHMOD) go-w $${f}; \
-	done
-endif
-	$(RM) $(JRE_MODULE_ELF_LIST)
-
-######################################################
-# JDK Image
-######################################################
-# Note: cpio ($(CPIO)) sometimes leaves directories without rx access.
-
-initial-module-image-jdk-setup:
-	$(RM) -r $(JDK_MODULE_IMAGE_DIR)
-	$(MKDIR) -p $(JDK_MODULE_IMAGE_DIR)/jre
-	($(CD) $(JRE_MODULE_IMAGE_DIR) && $(FIND) . -depth -print \
-	      | $(CPIO) -pdum $(JDK_MODULE_IMAGE_DIR)/jre )
-	$(RM) -rf $(JDK_MODULE_IMAGE_DIR)/jre/man
-	$(CHMOD) a+rx `$(FIND) $(JDK_MODULE_IMAGE_DIR) -type d`
-
-initial-module-image-jdk64-bindemos:
-	for dir in bin demo ; do \
-	  ( $(CD) $(OUTPUTDIR) && \
-		$(TAR) cf - `$(FIND) $$dir -name '$(LIBARCH)' -print` | \
-		($(CD) $(JDK_MODULE_IMAGE_DIR) && $(TAR) xf -) ) ; \
-        done
-
-# Solaris 64 bit image is special
-initial-module-image-jdk-sol64:: initial-module-image-jdk-setup \
-			  initial-module-image-jdk64-bindemos
-
-# DB files to add
-ifeq ($(OPENJDK),true)
-
-initial-module-image-jdk-db:
-
-else
-
-# Create the list of db *.zip files to bundle with jdk
-ABS_DB_PATH  :=$(call FullPath,$(CLOSED_SHARE_SRC)/db)
-DB_ZIP_LIST = $(shell $(LS) $(ABS_DB_PATH)/*.zip 2>/dev/null)
-
-initial-module-image-jdk-db: $(DB_ZIP_LIST)
-	$(MKDIR) -p $(JDK_MODULE_IMAGE_DIR)/db
-	for d in $(DB_ZIP_LIST); do \
-          ($(CD) $(JDK_MODULE_IMAGE_DIR)/db && $(UNZIP) -o $$d); \
-	done
-
-endif
-
-# Standard jdk image
-initial-module-image-jdk:: initial-module-image-jdk-setup \
-		    initial-module-image-jdk-db \
-		    $(JDK_MODULE_DOCFILES)
-	$(MKDIR) $(JDK_MODULE_IMAGE_DIR)/lib
-	@#
-	@# copy jdk modules to jdk/lib
-	@#
-	$(MKDIR) -p $(JDK_MODULE_IMAGE_DIR)/lib
-	for m in $(JDK_MODULES) ; do \
-	    $(CP) $(MODULES_DIR)/$$m/lib/$$m.jar $(JDK_MODULE_IMAGE_DIR)/lib ; \
-        done
-  ifeq ($(PLATFORM), windows)
-	@#
-	@# lib/
-	@#
-	$(CP) $(LIBDIR)/$(LIB_PREFIX)jvm.$(LIB_SUFFIX) $(JDK_MODULE_IMAGE_DIR)/lib
-	$(CP) $(LIBDIR)/$(LIB_PREFIX)jawt.$(LIB_SUFFIX) $(JDK_MODULE_IMAGE_DIR)/lib
-	@#
-	@# bin/
-	@#
-	@# copy all EXE files and only certain DLL files from BINDIR
-	$(MKDIR) -p $(JDK_MODULE_IMAGE_DIR)/bin
-	$(CP) $(BINDIR)/*$(EXE_SUFFIX) $(JDK_MODULE_IMAGE_DIR)/bin
-	$(CP) $(BINDIR)/jli.$(LIBRARY_SUFFIX) $(JDK_MODULE_IMAGE_DIR)/bin
-    ifeq ($(COMPILER_VERSION), VS2010)
-	$(CP) $(BINDIR)/msvc*100.$(LIBRARY_SUFFIX) $(JDK_MODULE_IMAGE_DIR)/bin
-    endif
-    ifeq ($(ARCH_DATA_MODEL), 32)
-      ifeq ($(COMPILER_VERSION), VS2003)
-	$(CP) $(BINDIR)/msvc*71.$(LIBRARY_SUFFIX) $(JDK_MODULE_IMAGE_DIR)/bin
-      endif
-    endif
-  else # PLATFORM
-	@#
-	@# bin/
-	@#
-	($(CD) $(BINDIR)/.. && $(TAR) cf - \
-	    `$(FIND) bin \( -type f -o -type l \) -print `) | \
-	    ($(CD) $(JDK_MODULE_IMAGE_DIR) && $(TAR) xf -)
-  endif # PLATFORM
-	@#
-	@# lib/ct.sym
-	@#
-	$(MKDIR) -p $(OUTPUTDIR)/symbols/META-INF/sym
-	$(JAVAC_CMD) -XDprocess.packages -proc:only \
-	    -processor com.sun.tools.javac.sym.CreateSymbols \
-	    -Acom.sun.tools.javac.sym.Jar=$(RT_JAR) \
-	    -Acom.sun.tools.javac.sym.Dest=$(OUTPUTDIR)/symbols/META-INF/sym/rt.jar \
-	    $(CORE_PKGS) $(NON_CORE_PKGS) $(EXCLUDE_PROPWARN_PKGS)
-	$(BOOT_JAR_CMD) c0f $(LIBDIR)/ct.sym \
-	    -C $(OUTPUTDIR)/symbols META-INF $(BOOT_JAR_JFLAGS)
-	@$(java-vm-cleanup)
-	$(CP) $(LIBDIR)/ct.sym $(JDK_MODULE_IMAGE_DIR)/lib/ct.sym
-	@#
-	@# CORBA supported orb.idl and ir.idl should be copied to lib
-	@#
-	$(CP) $(LIBDIR)/orb.idl $(JDK_MODULE_IMAGE_DIR)/lib/orb.idl
-	$(CP) $(LIBDIR)/ir.idl $(JDK_MODULE_IMAGE_DIR)/lib/ir.idl
-  ifeq ($(PLATFORM), linux)
-	@#
-	@# on Linux copy jexec from jre/lib to /lib
-	@#
-	$(CP) $(LIBDIR)/jexec $(JDK_MODULE_IMAGE_DIR)/lib/jexec
-  endif # PLATFORM
-	@#
-	@# demo, include
-	@#
-	$(CP) -r -f $(DEMODIR) $(JDK_MODULE_IMAGE_DIR)
-	$(CP) -r -f $(SAMPLEDIR) $(JDK_MODULE_IMAGE_DIR)
-	$(CP) -r $(INCLUDEDIR) $(JDK_MODULE_IMAGE_DIR)
-	@#
-	@# Swing BeanInfo generation
-	@#
-	$(CD) javax/swing/beaninfo && $(MAKE) JDK_IMAGE_DIR=$(JDK_MODULE_IMAGE_DIR) swing-1.2-beans
-ifneq ($(PLATFORM), windows)
-	$(call copy-man-pages,$(JDK_MODULE_IMAGE_DIR),$(JDK_MAN_PAGES))
-endif # !windows
-
-# Trim out files we don't want to ship
-trim-module-image-jdk::
-	@# Remove tools that should not be part of SDK.
-	for t in $(NOTJDKTOOLS); do \
-	    $(RM) $(JDK_MODULE_IMAGE_DIR)/bin/$${t}$(EXE_SUFFIX); \
-	done
-
-# Get list of Elf files in the jdk
-JDK_MODULE_ELF_LIST=$(MODULES_TEMPDIR)/jdk-elf-files.list
-$(JDK_MODULE_ELF_LIST):
-	@$(prep-target)
-ifneq ($(PLATFORM), windows)
-	$(RM) $@
-	$(FIND) $(JDK_MODULE_IMAGE_DIR)/jre/lib -type f -name \*.$(LIB_SUFFIX) >> $@
-	$(FILE) `$(FIND) $(JDK_MODULE_IMAGE_DIR)/jre/bin -type f -name \*$(EXE_SUFFIX)` \
-	    | $(EGREP) 'ELF' | $(CUT) -d':' -f1 >> $@
-	file `$(FIND) $(JDK_MODULE_IMAGE_DIR)/bin -type f -name \*$(EXE_SUFFIX)` \
-	    | $(EGREP) 'ELF' | $(CUT) -d':' -f1 >> $@
-endif
-
-# Post process the image (strips and mcs on files we are shipping)
-process-module-image-jdk:: $(JDK_MODULE_ELF_LIST)
-ifneq ($(POST_STRIP_PROCESS), )
-	for f in `$(CAT) $(JDK_MODULE_ELF_LIST)`; do \
-	  $(CHMOD) u+w $${f}; \
-	  $(ECHO) $(POST_STRIP_PROCESS) $${f}; \
-	  $(POST_STRIP_PROCESS) $${f}; \
-	  $(CHMOD) go-w $${f}; \
-	done
-endif
-ifneq ($(POST_MCS_PROCESS), )
-	for f in `$(CAT) $(JDK_MODULE_ELF_LIST)`; do \
-	  $(CHMOD) u+w $${f}; \
-	  $(ECHO) $(POST_MCS_PROCESS) $${f}; \
-	  $(POST_MCS_PROCESS) $${f}; \
-	  $(CHMOD) go-w $${f}; \
-	done
-endif
-	$(RM) $(JDK_MODULE_ELF_LIST)
-
-######################################################
-# clobber
-######################################################
-modules-clobber::
-	$(RM) -r $(JDK_MODULE_IMAGE_DIR)
-	$(RM) -r $(JRE_MODULE_IMAGE_DIR)
-
-#
-# TODO - nop for now
-sanity-module-images post-sanity-module-images:
-
-modules modules-clobber::
-	@$(ECHO) ">>>Finished making "$@" @ `$(DATE)` ..."
-	@$(java-vm-cleanup)
-
-.PHONY: modules module-image-jre module-image-jdk \
-	initial-module-image-jre initial-module-image-jdk \
-	initial-module-image-jre-sol64 initial-module-image-jdk-sol64 \
-        initial-module-image-jdk-setup \
-	initial-module-image-jdk-db \
-        initial-module-image-jdk64-bindemos \
-        initial-module-image-jre-setup \
-	trim-module-image-jre trim-module-image-jdk \
-	process-module-image-jre process-module-image-jdk \
-	install-previous-jre install-previous-jdk \
-	modules-clobber
-
-# Force rule
-FRC:
-
--- a/jdk/make/common/Program.gmk	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/common/Program.gmk	Tue Mar 15 20:00:45 2011 -0400
@@ -186,7 +186,6 @@
 	$(LINK_PRE_CMD) $(CC) $(CC_OBJECT_OUTPUT_FLAG)$@ $(LDFLAGS) \
 	    $(FILES_o) $(THREADLIBS) $(LDLIBS)
 	@$(call binary_file_verification,$@)
-	$(install-module-file)
 
 endif # PLATFORM
 
--- a/jdk/make/common/Release.gmk	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/common/Release.gmk	Tue Mar 15 20:00:45 2011 -0400
@@ -60,7 +60,7 @@
 #
 # Include the exported private packages in ct.sym.
 # This is an interim solution until the ct.sym is replaced
-# with a new module system (being discussed for JDK 7).
+# with a new module system (being discussed for JDK 8).
 #
 EXPORTED_PRIVATE_PKGS = com.sun.servicetag \
                         com.oracle.net
@@ -87,8 +87,14 @@
   IMAGE_DOCLIST_JRE = LICENSE ASSEMBLY_EXCEPTION THIRD_PARTY_README
 else
   # Where to find these files
-  SHARE_JDK_DOC_SRC = $(CLOSED_SHARE_SRC)/doc/jdk
-  SHARE_JRE_DOC_SRC = $(CLOSED_SHARE_SRC)/doc/jre
+  ifeq ($(J4B), true)
+      SHARE_JDK_DOC_SRC = $(CLOSED_SHARE_SRC)/doc/jdkfb
+      SHARE_JRE_DOC_SRC = $(CLOSED_SHARE_SRC)/doc/jrefb
+  else
+      SHARE_JDK_DOC_SRC = $(CLOSED_SHARE_SRC)/doc/jdk
+      SHARE_JRE_DOC_SRC = $(CLOSED_SHARE_SRC)/doc/jre
+  endif
+
   IMAGE_DOCLIST_JDK = COPYRIGHT README.html  THIRDPARTYLICENSEREADME.txt
   IMAGE_DOCLIST_JRE = COPYRIGHT Welcome.html THIRDPARTYLICENSEREADME.txt
   ifeq ($(PLATFORM), windows)
@@ -126,10 +132,8 @@
 	unpack200.1
 
 ifndef OPENJDK
-ifeq ($(ARCH_DATA_MODEL),32)
   JRE_MAN_PAGES += javaws.1
 endif
-endif
 
 JDK_MAN_PAGES =            \
 	$(JRE_MAN_PAGES)   \
@@ -1101,7 +1105,7 @@
 
 # Common way to emit a line into the release or info file
 define info-file-item # name value
-$(PRINTF) "%s=\"%s\"\n" $1 $2 >> $@
+$(PRINTF) '%s="%s"\n' $1 $2 >> $@
 endef
 
 # Values to emit
--- a/jdk/make/common/Sanity.gmk	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/common/Sanity.gmk	Tue Mar 15 20:00:45 2011 -0400
@@ -71,8 +71,7 @@
     sane-cacerts \
     sane-ant_version \
     sane-zip_version \
-    sane-msvcrt_path \
-    sane-build_modules
+    sane-msvcrt_path
 
 # The rules sanity-* have a one-to-one correspondence with the major targets
 # Each sanity-* rule should have no body to ensure that the post-sanity-* is the
--- a/jdk/make/common/Subdirs.gmk	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/common/Subdirs.gmk	Tue Mar 15 20:00:45 2011 -0400
@@ -40,9 +40,6 @@
 #
 # By default, subdirs specified in the SUBDIRS and all SUBDIRS_* 
 # variables will be built.
-# 
-# BUILD_MODULES variable can be used to specify one or more groups
-# to be built (BUILD_MODULES=all will build all groups).
 #
 # Variables of the currently supported groups are:
 #  SUBDIRS_desktop    
@@ -53,15 +50,12 @@
 # 
 # Change to the above list also need to update 
 # make/common/shared/Sanity.gmk.  NOTE: this list is subject
-# to change till the JDK 7 SE profiles/modules are finalized.
+# to change.
 # 
 # Eventually we want to restructure the make directory
 # according to these grouping (e.g. make/desktop/...) and
 # the SUBDIRS_<group> variables would not be needed.
 # 
-# To build the desktop and tools groups only, you can do:
-# gnumake BUILD_MODULES="desktop tools" ...
-# 
 
 # Iterate the subdirectories specified in $1.
 # - cd into each subdir and make them
@@ -96,77 +90,51 @@
 
 #
 # Iterate the list specified in SUBDIRS_<group> only if
-# SUBDIRS_<group> is set and <group> or "all" is specified
-# in the BUILD_MODULES variable
+# SUBDIRS_<group> is set.
 #
 ifdef SUBDIRS_desktop 
-  ifneq (,$(findstring desktop, $(BUILD_MODULES)))
-      define subdirs-desktop-loop
-         @$(call subdirs-group-loop,SUBDIRS_desktop)
-      endef
-  else
-    define subdirs-desktop-loop
-    endef
-  endif
+  define subdirs-desktop-loop
+      @$(call subdirs-group-loop,SUBDIRS_desktop)
+  endef
 else   
   define subdirs-desktop-loop
   endef
 endif   # SUBDIRS_desktop 
 
 ifdef SUBDIRS_enterprise 
-  ifneq (,$(findstring enterprise, $(BUILD_MODULES)))
-      define subdirs-enterprise-loop
-         @$(call subdirs-group-loop,SUBDIRS_enterprise)
-      endef
-  else
-    define subdirs-enterprise-loop
-    endef
-  endif
+  define subdirs-enterprise-loop
+      @$(call subdirs-group-loop,SUBDIRS_enterprise)
+  endef
 else   
 define subdirs-enterprise-loop
 endef
 endif   # SUBDIRS_enterprise 
 
 ifdef SUBDIRS_management 
-  ifneq (,$(findstring management, $(BUILD_MODULES)))
-      define subdirs-management-loop
-         @$(call subdirs-group-loop,SUBDIRS_management)
-      endef
-  else
-    define subdirs-management-loop
-    endef
-  endif
+  define subdirs-management-loop
+      @$(call subdirs-group-loop,SUBDIRS_management)
+  endef
 else   
-define subdirs-management-loop
-endef
+  define subdirs-management-loop
+  endef
 endif   # SUBDIRS_management 
 
 ifdef SUBDIRS_misc 
-  ifneq (,$(findstring misc, $(BUILD_MODULES)))
-      define subdirs-misc-loop
-         @$(call subdirs-group-loop,SUBDIRS_misc)
-      endef
-  else
-    define subdirs-misc-loop
-    endef
-  endif
+  define subdirs-misc-loop
+      @$(call subdirs-group-loop,SUBDIRS_misc)
+  endef
 else   
-define subdirs-misc-loop
-endef
+  define subdirs-misc-loop
+  endef
 endif   # SUBDIRS_misc 
 
 ifdef SUBDIRS_tools 
-  ifneq (,$(findstring tools, $(BUILD_MODULES)))
-      define subdirs-tools-loop
-         @$(call subdirs-group-loop,SUBDIRS_tools)
-      endef
-  else
-    define subdirs-tools-loop
-    endef
-  endif
+  define subdirs-tools-loop
+      @$(call subdirs-group-loop,SUBDIRS_tools)
+  endef
 else   
-define subdirs-tools-loop
-endef
+  define subdirs-tools-loop
+  endef
 endif   # SUBDIRS_tools 
 
 #
@@ -175,30 +143,6 @@
 SUBDIRS_all = $(SUBDIRS) $(SUBDIRS_desktop) $(SUBDIRS_enterprise) \
 	      $(SUBDIRS_management) $(SUBDIRS_misc) $(SUBDIRS_tools)
 
-ifndef BUILD_MODULES
-define SUBDIRS-loop
-  @$(call subdirs-group-loop,SUBDIRS_all)
-endef
-
-else
-
-ifneq (,$(findstring all, $(BUILD_MODULES)))
 define SUBDIRS-loop
   @$(call subdirs-group-loop,SUBDIRS_all)
 endef
-
-else # BUILD_MODULES set 
-#
-# Iterate SUBDIRS and the groups specified in BUILD_MODULES
-#
-define SUBDIRS-loop
-  @$(call subdirs-group-loop,SUBDIRS)
-  @$(subdirs-desktop-loop)
-  @$(subdirs-enterprise-loop)
-  @$(subdirs-management-loop)
-  @$(subdirs-misc-loop)
-  @$(subdirs-tools-loop)
-endef
-
-endif
-endif # BUILD_MODULES
--- a/jdk/make/common/shared/Defs-javadoc.gmk	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/common/shared/Defs-javadoc.gmk	Tue Mar 15 20:00:45 2011 -0400
@@ -61,33 +61,11 @@
 EMPTY:=
 SPACE:=$(EMPTY) $(EMPTY)
 COPYRIGHT_SYMBOL = &\#x00a9;
-# Macros to handle the optional empty args.
+# Macro to construct the copyright line
 #   (The GNU make 3.78.1 "if" conditional is broken, fixed in GNU make 3.81)
-define OptionalCopyrightUrl # url
-$(shell \
-  if [ "$1" != "" ] ; then \
-    printf "<a href=\"%s\">Copyright</a>" "$1"; \
-  else \
-    printf "Copyright"; \
-  fi)
-endef
-define OptionalCopyrightFirstYear # year
-$(shell \
-  if [ "$1" != "" ] ; then \
-    printf "%s," "$1";\
-  fi)
-endef
-define OptionalCompanyAddress # address
-$(shell \
-  if [ "$1" != "" ] ; then \
-    printf "%s" "$1";\
-  fi)
-endef
 define CopyrightLine # optionalurl optionalfirstyear optionaladdress
-$(call OptionalCopyrightUrl,$1) $(COPYRIGHT_SYMBOL)\
-$(call OptionalCopyrightFirstYear,$2) $(COPYRIGHT_YEAR),\
-$(COMPANY_NAME).\
-$(call OptionalCompanyAddress,$3)\
-All rights reserved.
+$(if $(strip $1),<a href="$(strip $1)">Copyright</a>,Copyright) \
+$(COPYRIGHT_SYMBOL) $(if $2,$2${COMMA},) $(COPYRIGHT_YEAR),\
+$(FULL_COMPANY_NAME). $3 All rights reserved.
 endef
 
--- a/jdk/make/common/shared/Defs-utils.gmk	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/common/shared/Defs-utils.gmk	Tue Mar 15 20:00:45 2011 -0400
@@ -115,7 +115,6 @@
 PKGMK          = $(UTILS_COMMAND_PATH)pkgmk
 PRINTF         = $(UTILS_USR_BIN_PATH)printf
 PWD            = $(UTILS_COMMAND_PATH)pwd
-RC             = $(UTILS_COMMAND_PATH)rc
 READELF        = $(UTILS_USR_BIN_PATH)readelf
 RMDIR          = $(UTILS_COMMAND_PATH)rmdir
 RPM            = $(UTILS_COMMAND_PATH)rpm
@@ -135,6 +134,7 @@
 UNIQ           = $(UTILS_USR_BIN_PATH)uniq
 UNZIP          = $(UTILS_USR_BIN_PATH)unzip
 UNZIPSFX       = $(UTILS_DEVTOOL_PATH)unzipsfx
+XARGS          = $(UTILS_USR_BIN_PATH)xargs
 WC             = $(UTILS_USR_BIN_PATH)wc
 WHICH          = $(UTILS_USR_BIN_PATH)which
 YACC           = $(UTILS_CCS_BIN_PATH)yacc
--- a/jdk/make/common/shared/Defs.gmk	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/common/shared/Defs.gmk	Tue Mar 15 20:00:45 2011 -0400
@@ -218,7 +218,11 @@
 else
   LAUNCHER_NAME = java
   PRODUCT_NAME = Java(TM)
-  PRODUCT_SUFFIX = SE Runtime Environment
+  ifeq ($(J4B), true)
+    PRODUCT_SUFFIX = SE Runtime Environment for Business
+  else
+    PRODUCT_SUFFIX = SE Runtime Environment
+  endif
   JDK_RC_PLATFORM_NAME = Platform SE
   COMPANY_NAME = Oracle Corporation
 endif
--- a/jdk/make/common/shared/Sanity.gmk	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/common/shared/Sanity.gmk	Tue Mar 15 20:00:45 2011 -0400
@@ -113,7 +113,7 @@
   ALSA_INCLUDE=/usr/include/alsa/version.h
   ALSA_LIBRARY=/usr/lib/libasound.so
   _ALSA_VERSION := $(shell $(EGREP) SND_LIB_VERSION_STR $(ALSA_INCLUDE) | \
-           $(SED) -e 's@.*\"\(.*\)\".*@\1@' )
+           $(SED) -e 's@.*"\(.*\)".*@\1@' )
   ALSA_VERSION := $(call GetVersion,$(_ALSA_VERSION))
 endif
 
@@ -221,8 +221,7 @@
 	sane-zip_version \
 	sane-unzip_version \
 	sane-msvcrt_path \
-        sane-freetype \
-        sane-build_modules
+        sane-freetype
 
 ######################################################
 # check for COPYRIGHT_YEAR variable
@@ -340,12 +339,12 @@
 ifneq ($(PLATFORM), windows)
 	@if [ "$(LC_ALL)" != "" -a "$(LC_ALL)" != "C" ]; then \
 	  $(ECHO) "WARNING: LC_ALL has been set to $(LC_ALL), this can cause build failures. \n" \
-	    "        Try setting LC_ALL to \"C\". \n" \
+	    "        Try setting LC_ALL to 'C'. \n" \
 	    "" >> $(WARNING_FILE) ; \
         fi
 	@if [ "$(LANG)" != "" -a "$(LANG)" != "C" ]; then \
 	  $(ECHO) "WARNING: LANG has been set to $(LANG), this can cause build failures. \n" \
-	    "        Try setting LANG to \"C\". \n" \
+	    "        Try setting LANG to 'C'. \n" \
 	    "" >> $(WARNING_FILE) ; \
         fi
 endif
@@ -838,21 +837,6 @@
 endif
 
 ######################################################
-# if specified, BUILD_MODULES must contain valid values.
-######################################################
-MODULES_REGEX="all|base|desktop|management|enterprise|misc|tools"
-sane-build_modules:
-ifdef BUILD_MODULES
-	@for m in $(BUILD_MODULES) ; do \
-            valid=`$(ECHO) $$m | $(EGREP) $(MODULES_REGEX)`; \
-            if [ "x$$valid" = "x" ] ; then \
-                $(ECHO) "ERROR: $$m set in the BUILD_MODULES variable is invalid.\n" \
-                "" >> $(ERROR_FILE); \
-            fi \
-	done
-endif
-
-######################################################
 # CUPS_HEADERS_PATH must be valid
 ######################################################
 sane-cups:
@@ -1018,11 +1002,6 @@
 	    "" >> $(ERROR_FILE) ; \
 	fi
   else
-    ifeq ($(wildcard $(REBASE)),)
-	@$(ECHO) "ERROR: Cannot find the REBASE utility from path: $(REBASE)\n" \
-	    "      This is normally obtained from the WINDOWSSDKDIR." \
-	    "" >> $(ERROR_FILE)
-    endif
     ifeq ($(wildcard $(RC)),)
 	@$(ECHO) "ERROR: Cannot find the RC utility from path: $(RC)\n" \
 	    "      This is normally obtained from the WINDOWSSDKDIR." \
@@ -1030,7 +1009,7 @@
     endif
     ifeq ($(wildcard $(DUMPBIN)),)
 	@$(ECHO) "ERROR: Cannot find the DUMPBIN utility from path: $(DUMPBIN)\n" \
-	    "      This is normally obtained from the WINDOWSSDKDIR." \
+	    "      This is normally obtained from the COMPILER_PATH." \
 	    "" >> $(ERROR_FILE)
     endif
   endif
@@ -1137,7 +1116,7 @@
 #    be checked when this represents a full control build (i.e. the
 #    HOTSPOT_IMPORT_PATH includes these files in it's 'include' directory).
 $(TEMPDIR)/%.h: $(SHARE_SRC)/javavm/export/%.h
-	@$(install-non-module-file)
+	@$(install-file)
 	@$(RM) $@.IMPORT
 	@if [ -r $(HOTSPOT_IMPORT_PATH)/include/$(@F) ]; then \
 	  $(CP) $(HOTSPOT_IMPORT_PATH)/include/$(@F) $@.IMPORT ; \
@@ -1151,7 +1130,7 @@
 	fi
 
 $(TEMPDIR)/%.h: $(PLATFORM_SRC)/javavm/export/%.h
-	@$(install-non-module-file)
+	@$(install-file)
 	@$(RM) $@.IMPORT
 	@if [ -r $(HOTSPOT_IMPORT_PATH)/include/$(PLATFORM_INCLUDE_NAME)/$(@F) ]; then \
 	  $(CP) $(HOTSPOT_IMPORT_PATH)/include/$(PLATFORM_INCLUDE_NAME)/$(@F) $@.IMPORT ; \
@@ -1354,9 +1333,9 @@
 	fi
 	@if [ "$(LINK_CHECK)" != "same" ]; then \
 	  $(ECHO) "WARNING: To build Java 2 SDK $(JDK_VERSION) you need : \n" \
-	    "      $(REQUIRED_COMPILER_VERSION) - link.exe version \"$(REQUIRED_LINK_VER)\" \n" \
+	    "      $(REQUIRED_COMPILER_VERSION) - link.exe version '$(REQUIRED_LINK_VER)' \n" \
 	      "      Specifically the $(REQUIRED_COMPILER_NAME) link.exe. \n " \
-	    "      $(YOU_ARE_USING) Linker version \"$(LINK_VER)\" \n" \
+	    "      $(YOU_ARE_USING) Linker version '$(LINK_VER)' \n" \
 	    "" >> $(WARNING_FILE) ; \
 	fi
 endif
--- a/jdk/make/docs/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/docs/Makefile	Tue Mar 15 20:00:45 2011 -0400
@@ -43,7 +43,7 @@
 BUG_SUBMIT_URL = http://bugs.sun.com/services/bugreport/index.jsp
 
 # Common line for how to submit a bug or rfe
-BUG_SUBMIT_LINE = <a href=\"$(BUG_SUBMIT_URL)\">Submit a bug or feature</a>
+BUG_SUBMIT_LINE = <a href="$(BUG_SUBMIT_URL)">Submit a bug or feature</a>
 
 # Url to devdocs page
 #   Was: http://java.sun.com/javase/6/webnotes/devdocs-vs-specs.html
@@ -166,24 +166,35 @@
 
 # Common bottom argument
 define CommonBottom # year
-<font size=\"-1\"><p> $(call CopyrightLine,,$1,)</font>
+<font size="-1"><br> $(call CopyrightLine,,$1,)</font>
 endef
 
 # Common trademark bottom argument (Not sure why this is used sometimes)
 define CommonTrademarkBottom # year
-<font size=\"-1\">\
+<font size="-1">\
 $(BUG_SUBMIT_LINE)<br>$(JAVA_TRADEMARK_LINE)<br>\
 $(call CopyrightLine,,$1,$(COMPANY_ADDRESS))\
 </font>
 endef
 
+# Common echo of option
+define OptionOnly # opt
+$(PRINTF) "%s\n" "$1"
+endef
+define OptionPair # opt arg
+$(PRINTF) "%s '%s'\n" "$1" '$2'
+endef
+define OptionTrip # opt arg arg
+$(PRINTF) "%s '%s' '%s'\n" "$1" '$2' '$3'
+endef
+
 # Core api bottom argument (with special sauce)
-COREAPI_BOTTOM = <font size=\"-1\"> $(BUG_SUBMIT_LINE)\
+COREAPI_BOTTOM = <font size="-1"> $(BUG_SUBMIT_LINE)\
 <br>For further API reference and developer documentation, \
-see <a href=\"$(DEV_DOCS_URL)\" target=\"_blank\">Java SE Documentation</a>. \
+see <a href="$(DEV_DOCS_URL)" target="_blank">Java SE Documentation</a>. \
 That documentation contains more detailed, developer-targeted descriptions, \
 with conceptual overviews, definitions of terms, workarounds, \
-and working code examples.<p>\
+and working code examples.<br>\
 $(call CopyrightLine,$(COPYRIGHT_URL),$(FIRST_COPYRIGHT_YEAR),)\
 </font>
 
@@ -212,11 +223,11 @@
     DRAFT_WINTITLE = $(BUILD_NUMBER)
     # Early access top text (not used in FCS releases)
     COREAPI_TOP_EARLYACCESS = \
-<div style=\"background-color: \#EEEEEE\"> \
-<div style=\"padding: 6px; margin-top: 2px; margin-bottom: 6px; \
+<div style="background-color: \#EEEEEE"> \
+<div style="padding: 6px; margin-top: 2px; margin-bottom: 6px; \
 margin-left: 6px; margin-right: 6px; text-align: justify; \
 font-size: 80%; font-family: Helvetica, Arial, sans-serif; \
-font-weight: normal;\"> \
+font-weight: normal;"> \
 Please note that the specifications and other information \
 contained herein are not final and are subject to change. \
 The information is being made available to you solely for purpose of \
@@ -281,15 +292,9 @@
 COREAPI_HEADER = \
 <strong>Java$(TRADEMARK)&nbsp;Platform<br>Standard&nbsp;Ed.&nbsp;$(JDK_MINOR_VERSION)</strong>
 
-# Ignored tags
-IGNORED_TAGS =	beaninfo revised since.unbundled spec specdefault Note ToDo
-
 # Java language specification cite
-JLS3_CITE = <a href=\"$(JLS3_URL)\"> \
-		The Java Language Specification, Third Edition</a>
-TAG_JLS3 = -tag 'jls3:a:See <cite>$(JLS3_CITE)</cite>:'
-
-TAGS = $(IGNORED_TAGS:%=-tag %:X) $(TAG_JLS3)
+TAG_JLS3 = jls3:a:See <cite><a href="$(JLS3_URL)"> \
+The Java Language Specification, Third Edition</a></cite>:
 
 # Overview file for core apis
 COREAPI_OVERVIEW = $(SHARE_SRC)/classes/overview-core.html
@@ -314,19 +319,26 @@
 # Create file with javadoc options in it
 $(COREAPI_OPTIONS_FILE): $(COREAPI_OVERVIEW)
 	$(prep-target)
-	@($(ECHO) "$(COMMON_JAVADOCFLAGS)"				; \
-	  $(ECHO) "-sourcepath \"$(RELEASEDOCS_SOURCEPATH)\""		; \
-	  $(ECHO) "$(TAGS)"						; \
-	  $(ECHO) "-encoding ISO-8859-1"				; \
-	  $(ECHO) "-splitIndex"						; \
-	  $(ECHO) "-overview $(COREAPI_OVERVIEW)" 			; \
-	  $(ECHO) "-doctitle '$(COREAPI_DOCTITLE)'"			; \
-	  $(ECHO) "-windowtitle '$(COREAPI_WINDOWTITLE) $(DRAFT_WINTITLE)'";\
-	  $(ECHO) "-header '$(COREAPI_HEADER)$(DRAFT_HEADER)'"		; \
-	  $(ECHO) "-bottom '$(COREAPI_BOTTOM)$(DRAFT_BOTTOM)'"		; \
+	@($(call OptionOnly,$(COMMON_JAVADOCFLAGS))			; \
+	  $(call OptionPair,-sourcepath,$(RELEASEDOCS_SOURCEPATH))	; \
+	  $(call OptionPair,-encoding,ISO-8859-1)			; \
+	  $(call OptionPair,-tag,beaninfo:X)				; \
+	  $(call OptionPair,-tag,revised:X)				; \
+	  $(call OptionPair,-tag,since.unbundled:X)			; \
+	  $(call OptionPair,-tag,spec:X)				; \
+	  $(call OptionPair,-tag,specdefault:X)				; \
+	  $(call OptionPair,-tag,Note:X)				; \
+	  $(call OptionPair,-tag,ToDo:X)				; \
+          $(call OptionPair,-tag,$(TAG_JLS3)) 				; \
+	  $(call OptionOnly,-splitIndex)				; \
+	  $(call OptionPair,-overview,$(COREAPI_OVERVIEW))		; \
+	  $(call OptionPair,-doctitle,$(COREAPI_DOCTITLE))		; \
+	  $(call OptionPair,-windowtitle,$(COREAPI_WINDOWTITLE) $(DRAFT_WINTITLE)) ;\
+	  $(call OptionPair,-header,$(COREAPI_HEADER)$(DRAFT_HEADER))	; \
+	  $(call OptionPair,-bottom,$(COREAPI_BOTTOM)$(DRAFT_BOTTOM))	; \
         ) >> $@
 ifdef COREAPI_TOP_EARLYACCESS
-	@$(ECHO) "-top '$(COREAPI_TOP_EARLYACCESS)'" >> $@
+	@$(call OptionPair,-top,$(COREAPI_TOP_EARLYACCESS)) >> $@
 endif
 
 # Create a file with the package names in it
@@ -375,16 +387,16 @@
 # Create file with javadoc options in it
 $(MIRROR_OPTIONS_FILE): $(MIRROR_OVERVIEW)
 	$(prep-target)
-	@($(ECHO) "$(COMMON_JAVADOCFLAGS)"				; \
-	  $(ECHO) "-sourcepath \"$(RELEASEDOCS_SOURCEPATH)\""		; \
-	  $(ECHO) "-encoding ascii"					; \
-	  $(ECHO) "-overview $(MIRROR_OVERVIEW)" 			; \
-	  $(ECHO) "-doctitle '$(MIRROR_DOCTITLE)'"			; \
-	  $(ECHO) "-windowtitle '$(MIRROR_WINDOWTITLE) $(DRAFT_WINTITLE)'";\
-	  $(ECHO) "-header '$(MIRROR_HEADER)$(DRAFT_HEADER)'"		; \
-	  $(ECHO) "-bottom '$(MIRROR_BOTTOM)$(DRAFT_BOTTOM)'"		; \
-	  $(ECHO) "-group $(MIRROR_GROUPNAME) $(MIRROR_REGEXP)"		; \
-	  $(ECHO) "-linkoffline $(MIRROR2COREAPI) $(COREAPI_DOCSDIR)/"; \
+	@($(call OptionOnly,$(COMMON_JAVADOCFLAGS))			; \
+	  $(call OptionPair,-sourcepath,$(RELEASEDOCS_SOURCEPATH))	; \
+	  $(call OptionPair,-encoding,ascii)				; \
+	  $(call OptionPair,-overview,$(MIRROR_OVERVIEW))		; \
+	  $(call OptionPair,-doctitle,$(MIRROR_DOCTITLE))		; \
+	  $(call OptionPair,-windowtitle,$(MIRROR_WINDOWTITLE) $(DRAFT_WINTITLE));\
+	  $(call OptionPair,-header,$(MIRROR_HEADER)$(DRAFT_HEADER))	; \
+	  $(call OptionPair,-bottom,$(MIRROR_BOTTOM)$(DRAFT_BOTTOM)) 	; \
+	  $(call OptionTrip,-group,$(MIRROR_GROUPNAME),$(MIRROR_REGEXP)); \
+	  $(call OptionTrip,-linkoffline,$(MIRROR2COREAPI),$(COREAPI_DOCSDIR)); \
         ) >> $@
 
 # Create a file with the package names in it
@@ -432,16 +444,16 @@
 # Create file with javadoc options in it
 $(DOCLETAPI_OPTIONS_FILE):
 	$(prep-target)
-	@($(ECHO) "$(COMMON_JAVADOCFLAGS)"				; \
-	  $(ECHO) "-sourcepath \"$(RELEASEDOCS_SOURCEPATH)\""		; \
-	  $(ECHO) "-breakiterator"					; \
-	  $(ECHO) "-encoding ascii"					; \
-	  $(ECHO) "-doctitle '$(DOCLETAPI_DOCTITLE)'"			; \
-	  $(ECHO) "-windowtitle '$(DOCLETAPI_WINDOWTITLE) $(DRAFT_WINTITLE)'";\
-	  $(ECHO) "-header '$(DOCLETAPI_HEADER)$(DRAFT_HEADER)'"	; \
-	  $(ECHO) "-bottom '$(DOCLETAPI_BOTTOM)$(DRAFT_BOTTOM)'"	; \
-	  $(ECHO) "-group $(DOCLETAPI_GROUPNAME) $(DOCLETAPI_REGEXP)"	; \
-	  $(ECHO) "-linkoffline $(DOCLETAPI2COREAPI) $(COREAPI_DOCSDIR)/"; \
+	@($(call OptionOnly,$(COMMON_JAVADOCFLAGS))			; \
+	  $(call OptionPair,-sourcepath,$(RELEASEDOCS_SOURCEPATH))	; \
+	  $(call OptionPair,-encoding,ascii)				; \
+	  $(call OptionOnly,-breakiterator)				; \
+	  $(call OptionPair,-doctitle,$(DOCLETAPI_DOCTITLE))		; \
+	  $(call OptionPair,-windowtitle,$(DOCLETAPI_WINDOWTITLE) $(DRAFT_WINTITLE));\
+	  $(call OptionPair,-header,$(DOCLETAPI_HEADER)$(DRAFT_HEADER))	; \
+	  $(call OptionPair,-bottom,$(DOCLETAPI_BOTTOM)$(DRAFT_BOTTOM))	; \
+	  $(call OptionTrip,-group,$(DOCLETAPI_GROUPNAME),$(DOCLETAPI_REGEXP)); \
+	  $(call OptionTrip,-linkoffline,$(DOCLETAPI2COREAPI),$(COREAPI_DOCSDIR)/); \
         ) >> $@
 
 # Create a file with the package names in it
@@ -492,13 +504,13 @@
 # Create file with javadoc options in it
 $(TAGLETAPI_OPTIONS_FILE):
 	$(prep-target)
-	@($(ECHO) "$(COMMON_JAVADOCFLAGS)"				; \
-	  $(ECHO) "-sourcepath \"$(RELEASEDOCS_SOURCEPATH)\""		; \
-	  $(ECHO) "-encoding ascii"					; \
-	  $(ECHO) "-nonavbar"						; \
-	  $(ECHO) "-noindex"						; \
-	  $(ECHO) "-bottom '$(TAGLETAPI_BOTTOM)$(DRAFT_BOTTOM)'"			; \
-	  $(ECHO) "-linkoffline $(TAGLETAPI2COREAPI) $(COREAPI_DOCSDIR)/"; \
+	@($(call OptionOnly,$(COMMON_JAVADOCFLAGS))			; \
+	  $(call OptionPair,-sourcepath,$(RELEASEDOCS_SOURCEPATH))	; \
+	  $(call OptionPair,-encoding,ascii)				; \
+	  $(call OptionOnly,-nonavbar)					; \
+	  $(call OptionOnly,-noindex)					; \
+	  $(call OptionPair,-bottom,$(TAGLETAPI_BOTTOM)$(DRAFT_BOTTOM))	; \
+	  $(call OptionTrip,-linkoffline,$(TAGLETAPI2COREAPI),$(COREAPI_DOCSDIR)/); \
         ) >> $@
 
 # Create a file with the package names in it
@@ -543,16 +555,16 @@
 # Create file with javadoc options in it
 $(DOMAPI_OPTIONS_FILE):
 	$(prep-target)
-	@($(ECHO) "$(COMMON_JAVADOCFLAGS)"				; \
-	  $(ECHO) "-sourcepath \"$(RELEASEDOCS_SOURCEPATH)\""		; \
-	  $(ECHO) "-encoding ascii"					; \
-	  $(ECHO) "-splitIndex"						; \
-	  $(ECHO) "-doctitle '$(DOMAPI_DOCTITLE)'"			; \
-	  $(ECHO) "-windowtitle '$(DOMAPI_WINDOWTITLE) $(DRAFT_WINTITLE)'";\
-	  $(ECHO) "-header '$(DOMAPI_HEADER)$(DRAFT_HEADER)'"		; \
-	  $(ECHO) "-bottom '$(DOMAPI_BOTTOM)$(DRAFT_BOTTOM)'"		; \
-	  $(ECHO) "-group $(DOMAPI_GROUPNAME) $(DOMAPI_REGEXP)"		; \
-	  $(ECHO) "-linkoffline $(DOMAPI2COREAPI) $(COREAPI_DOCSDIR)/" 	; \
+	@($(call OptionOnly,$(COMMON_JAVADOCFLAGS))			; \
+	  $(call OptionPair,-sourcepath,$(RELEASEDOCS_SOURCEPATH))	; \
+	  $(call OptionPair,-encoding,ascii)				; \
+	  $(call OptionOnly,-splitIndex)				; \
+	  $(call OptionPair,-doctitle,$(DOMAPI_DOCTITLE))		; \
+	  $(call OptionPair,-windowtitle,$(DOMAPI_WINDOWTITLE) $(DRAFT_WINTITLE));\
+	  $(call OptionPair,-header,$(DOMAPI_HEADER)$(DRAFT_HEADER))	; \
+	  $(call OptionPair,-bottom,$(DOMAPI_BOTTOM)$(DRAFT_BOTTOM))	; \
+	  $(call OptionTrip,-group,$(DOMAPI_GROUPNAME),$(DOMAPI_REGEXP)); \
+	  $(call OptionTrip,-linkoffline,$(DOMAPI2COREAPI),$(COREAPI_DOCSDIR)/); \
         ) >> $@
 
 # Create a file with the package names in it
@@ -605,15 +617,15 @@
 # Create file with javadoc options in it
 $(JDI_OPTIONS_FILE): $(JDI_OVERVIEW)
 	$(prep-target)
-	@($(ECHO) "$(COMMON_JAVADOCFLAGS)"				; \
-	  $(ECHO) "-sourcepath \"$(RELEASEDOCS_SOURCEPATH)\""		; \
-	  $(ECHO) "-encoding ascii"					; \
-	  $(ECHO) "-overview $(JDI_OVERVIEW)" 				; \
-	  $(ECHO) "-doctitle '$(JDI_DOCTITLE)'"				; \
-	  $(ECHO) "-windowtitle '$(JDI_WINDOWTITLE) $(DRAFT_WINTITLE)'"	; \
-	  $(ECHO) "-header '$(JDI_HEADER)$(DRAFT_HEADER)'"		; \
-	  $(ECHO) "-bottom '$(JDI_BOTTOM)$(DRAFT_BOTTOM)'"		; \
-	  $(ECHO) "-linkoffline $(JDI2COREAPI) $(COREAPI_DOCSDIR)/" 	; \
+	@($(call OptionOnly,$(COMMON_JAVADOCFLAGS))			; \
+	  $(call OptionPair,-sourcepath,$(RELEASEDOCS_SOURCEPATH))	; \
+	  $(call OptionPair,-encoding,ascii)				; \
+	  $(call OptionPair,-overview,$(JDI_OVERVIEW))			; \
+	  $(call OptionPair,-doctitle,$(JDI_DOCTITLE))			; \
+	  $(call OptionPair,-windowtitle,$(JDI_WINDOWTITLE) $(DRAFT_WINTITLE)); \
+	  $(call OptionPair,-header,$(JDI_HEADER)$(DRAFT_HEADER))	; \
+	  $(call OptionPair,-bottom,$(JDI_BOTTOM)$(DRAFT_BOTTOM))	; \
+	  $(call OptionTrip,-linkoffline,$(JDI2COREAPI),$(COREAPI_DOCSDIR)/); \
         ) >> $@
 
 # Create a file with the package names in it
@@ -693,15 +705,15 @@
 # Create file with javadoc options in it
 $(JAAS_OPTIONS_FILE): $(JAAS_OVERVIEW)
 	$(prep-target)
-	@($(ECHO) "$(COMMON_JAVADOCFLAGS)"				; \
-	  $(ECHO) "-sourcepath \"$(RELEASEDOCS_SOURCEPATH)\""		; \
-	  $(ECHO) "-encoding ascii"					; \
-	  $(ECHO) "-overview $(JAAS_OVERVIEW)" 				; \
-	  $(ECHO) "-doctitle '$(JAAS_DOCTITLE)'"			; \
-	  $(ECHO) "-windowtitle '$(JAAS_WINDOWTITLE) $(DRAFT_WINTITLE)'"; \
-	  $(ECHO) "-header '$(JAAS_HEADER)$(DRAFT_HEADER)'"		; \
-	  $(ECHO) "-bottom '$(JAAS_BOTTOM)$(DRAFT_BOTTOM)'"		; \
-	  $(ECHO) "-linkoffline $(JAAS2COREAPI) $(COREAPI_DOCSDIR)/" 	; \
+	@($(call OptionOnly,$(COMMON_JAVADOCFLAGS))			; \
+	  $(call OptionPair,-sourcepath,$(RELEASEDOCS_SOURCEPATH))	; \
+	  $(call OptionPair,-encoding,ascii)				; \
+	  $(call OptionPair,-overview,$(JAAS_OVERVIEW))			; \
+	  $(call OptionPair,-doctitle,$(JAAS_DOCTITLE))			; \
+	  $(call OptionPair,-windowtitle,$(JAAS_WINDOWTITLE) $(DRAFT_WINTITLE)); \
+	  $(call OptionPair,-header,$(JAAS_HEADER)$(DRAFT_HEADER))	; \
+	  $(call OptionPair,-bottom,$(JAAS_BOTTOM)$(DRAFT_BOTTOM))	; \
+	  $(call OptionTrip,-linkoffline,$(JAAS2COREAPI),$(COREAPI_DOCSDIR)/); \
         ) >> $@
 
 # Create a file with the package names in it
@@ -745,16 +757,16 @@
 # Create file with javadoc options in it
 $(JGSS_OPTIONS_FILE): $(JGSS_OVERVIEW)
 	$(prep-target)
-	@($(ECHO) "$(COMMON_JAVADOCFLAGS)"				; \
-	  $(ECHO) "-sourcepath \"$(RELEASEDOCS_SOURCEPATH)\""		; \
-	  $(ECHO) "-encoding ascii"					; \
-	  $(ECHO) "-nodeprecatedlist"					; \
-	  $(ECHO) "-overview $(JGSS_OVERVIEW)" 				; \
-	  $(ECHO) "-doctitle '$(JGSS_DOCTITLE)'"			; \
-	  $(ECHO) "-windowtitle '$(JGSS_WINDOWTITLE) $(DRAFT_WINTITLE)'"; \
-	  $(ECHO) "-header '$(JGSS_HEADER)$(DRAFT_HEADER)'"		; \
-	  $(ECHO) "-bottom '$(JGSS_BOTTOM)$(DRAFT_BOTTOM)'"		; \
-	  $(ECHO) "-linkoffline $(JGSS2COREAPI) $(COREAPI_DOCSDIR)/" 	; \
+	@($(call OptionOnly,$(COMMON_JAVADOCFLAGS))			; \
+	  $(call OptionPair,-sourcepath,$(RELEASEDOCS_SOURCEPATH))	; \
+	  $(call OptionPair,-encoding,ascii)				; \
+	  $(call OptionOnly,-nodeprecatedlist)				; \
+	  $(call OptionPair,-overview,$(JGSS_OVERVIEW))			; \
+	  $(call OptionPair,-doctitle,$(JGSS_DOCTITLE))			; \
+	  $(call OptionPair,-windowtitle,$(JGSS_WINDOWTITLE) $(DRAFT_WINTITLE)); \
+	  $(call OptionPair,-header,$(JGSS_HEADER)$(DRAFT_HEADER))	; \
+	  $(call OptionPair,-bottom,$(JGSS_BOTTOM)$(DRAFT_BOTTOM))	; \
+	  $(call OptionTrip,-linkoffline,$(JGSS2COREAPI),$(COREAPI_DOCSDIR)/); \
         ) >> $@
 
 # Create a file with the package names in it
@@ -797,15 +809,15 @@
 # Create file with javadoc options in it
 $(SMARTCARDIO_OPTIONS_FILE):
 	$(prep-target)
-	@($(ECHO) "$(COMMON_JAVADOCFLAGS)"				; \
-	  $(ECHO) "-sourcepath \"$(RELEASEDOCS_SOURCEPATH)\""		; \
-	  $(ECHO) "-encoding ascii"					; \
-	  $(ECHO) "-nodeprecatedlist"					; \
-	  $(ECHO) "-doctitle '$(SMARTCARDIO_DOCTITLE)'"			; \
-	  $(ECHO) "-windowtitle '$(SMARTCARDIO_WINDOWTITLE) $(DRAFT_WINTITLE)'";\
-	  $(ECHO) "-header '$(SMARTCARDIO_HEADER)$(DRAFT_HEADER)'"	; \
-	  $(ECHO) "-bottom '$(SMARTCARDIO_BOTTOM)$(DRAFT_BOTTOM)'"	; \
-	  $(ECHO) "-linkoffline $(SMARTCARDIO2COREAPI) $(COREAPI_DOCSDIR)/"; \
+	@($(call OptionOnly,$(COMMON_JAVADOCFLAGS))			; \
+	  $(call OptionPair,-sourcepath,$(RELEASEDOCS_SOURCEPATH))	; \
+	  $(call OptionPair,-encoding,ascii)				; \
+	  $(call OptionOnly,-nodeprecatedlist)				; \
+	  $(call OptionPair,-doctitle,$(SMARTCARDIO_DOCTITLE))		; \
+	  $(call OptionPair,-windowtitle,$(SMARTCARDIO_WINDOWTITLE) $(DRAFT_WINTITLE));\
+	  $(call OptionPair,-header,$(SMARTCARDIO_HEADER)$(DRAFT_HEADER)); \
+	  $(call OptionPair,-bottom,$(SMARTCARDIO_BOTTOM)$(DRAFT_BOTTOM)); \
+	  $(call OptionTrip,-linkoffline,$(SMARTCARDIO2COREAPI),$(COREAPI_DOCSDIR)/); \
         ) >> $@
 
 # Create a file with the package names in it
@@ -847,15 +859,15 @@
 # Create file with javadoc options in it
 $(HTTPSERVER_OPTIONS_FILE):
 	$(prep-target)
-	@($(ECHO) "$(COMMON_JAVADOCFLAGS)"				; \
-	  $(ECHO) "-sourcepath \"$(RELEASEDOCS_SOURCEPATH)\""		; \
-	  $(ECHO) "-encoding ascii"					; \
-	  $(ECHO) "-nodeprecatedlist"					; \
-	  $(ECHO) "-doctitle '$(HTTPSERVER_DOCTITLE)'"			; \
-	  $(ECHO) "-windowtitle '$(HTTPSERVER_WINDOWTITLE) $(DRAFT_WINTITLE)'";\
-	  $(ECHO) "-header '$(HTTPSERVER_HEADER)$(DRAFT_HEADER)'"	; \
-	  $(ECHO) "-bottom '$(HTTPSERVER_BOTTOM)$(DRAFT_BOTTOM)'"	; \
-	  $(ECHO) "-linkoffline $(HTTPSERVER2COREAPI) $(COREAPI_DOCSDIR)/"; \
+	@($(call OptionOnly,$(COMMON_JAVADOCFLAGS))			; \
+	  $(call OptionPair,-sourcepath,$(RELEASEDOCS_SOURCEPATH))	; \
+	  $(call OptionPair,-encoding,ascii)				; \
+	  $(call OptionOnly,-nodeprecatedlist)				; \
+	  $(call OptionPair,-doctitle,$(HTTPSERVER_DOCTITLE))		; \
+	  $(call OptionPair,-windowtitle,$(HTTPSERVER_WINDOWTITLE) $(DRAFT_WINTITLE));\
+	  $(call OptionPair,-header,$(HTTPSERVER_HEADER)$(DRAFT_HEADER)); \
+	  $(call OptionPair,-bottom,$(HTTPSERVER_BOTTOM)$(DRAFT_BOTTOM)); \
+	  $(call OptionTrip,-linkoffline,$(HTTPSERVER2COREAPI),$(COREAPI_DOCSDIR)/); \
         ) >> $@
 
 # Create a file with the package names in it
@@ -907,16 +919,16 @@
 # Create file with javadoc options in it
 $(MGMT_OPTIONS_FILE): $(MGMT_OVERVIEW)
 	$(prep-target)
-	@($(ECHO) "$(COMMON_JAVADOCFLAGS)"				; \
-	  $(ECHO) "-sourcepath \"$(RELEASEDOCS_SOURCEPATH)\""		; \
-	  $(ECHO) "-encoding ascii"					; \
-	  $(ECHO) "-nodeprecatedlist"					; \
-	  $(ECHO) "-overview $(MGMT_OVERVIEW)" 				; \
-	  $(ECHO) "-doctitle '$(MGMT_DOCTITLE)'"			; \
-	  $(ECHO) "-windowtitle '$(MGMT_WINDOWTITLE) $(DRAFT_WINTITLE)'"; \
-	  $(ECHO) "-header '$(MGMT_HEADER)$(DRAFT_HEADER)'"		; \
-	  $(ECHO) "-bottom '$(MGMT_BOTTOM)$(DRAFT_BOTTOM)'"		; \
-	  $(ECHO) "-linkoffline $(MGMT2COREAPI) $(COREAPI_DOCSDIR)/" 	; \
+	@($(call OptionOnly,$(COMMON_JAVADOCFLAGS))			; \
+	  $(call OptionPair,-sourcepath,$(RELEASEDOCS_SOURCEPATH))	; \
+	  $(call OptionPair,-encoding,ascii)				; \
+	  $(call OptionOnly,-nodeprecatedlist)				; \
+	  $(call OptionPair,-overview,$(MGMT_OVERVIEW))			; \
+	  $(call OptionPair,-doctitle,$(MGMT_DOCTITLE))			; \
+	  $(call OptionPair,-windowtitle,$(MGMT_WINDOWTITLE) $(DRAFT_WINTITLE)); \
+	  $(call OptionPair,-header,$(MGMT_HEADER)$(DRAFT_HEADER))	; \
+	  $(call OptionPair,-bottom,$(MGMT_BOTTOM)$(DRAFT_BOTTOM))	; \
+	  $(call OptionTrip,-linkoffline,$(MGMT2COREAPI),$(COREAPI_DOCSDIR)/); \
         ) >> $@
 
 # Create a file with the package names in it
@@ -958,15 +970,15 @@
 # Create file with javadoc options in it
 $(ATTACH_OPTIONS_FILE):
 	$(prep-target)
-	@($(ECHO) "$(COMMON_JAVADOCFLAGS)"				; \
-	  $(ECHO) "-sourcepath \"$(RELEASEDOCS_SOURCEPATH)\""		; \
-	  $(ECHO) "-encoding ascii"					; \
-	  $(ECHO) "-nodeprecatedlist"					; \
-	  $(ECHO) "-doctitle '$(ATTACH_DOCTITLE)'"			; \
-	  $(ECHO) "-windowtitle '$(ATTACH_WINDOWTITLE) $(DRAFT_WINTITLE)'";\
-	  $(ECHO) "-header '$(ATTACH_HEADER)$(DRAFT_HEADER)'"		; \
-	  $(ECHO) "-bottom '$(ATTACH_BOTTOM)$(DRAFT_BOTTOM)'"		; \
-	  $(ECHO) "-linkoffline $(ATTACH2COREAPI) $(COREAPI_DOCSDIR)/"	; \
+	@($(call OptionOnly,$(COMMON_JAVADOCFLAGS))			; \
+	  $(call OptionPair,-sourcepath,$(RELEASEDOCS_SOURCEPATH))	; \
+	  $(call OptionPair,-encoding,ascii)				; \
+	  $(call OptionOnly,-nodeprecatedlist)				; \
+	  $(call OptionPair,-doctitle,$(ATTACH_DOCTITLE))		; \
+	  $(call OptionPair,-windowtitle,$(ATTACH_WINDOWTITLE) $(DRAFT_WINTITLE));\
+	  $(call OptionPair,-header,$(ATTACH_HEADER)$(DRAFT_HEADER))	; \
+	  $(call OptionPair,-bottom,$(ATTACH_BOTTOM)$(DRAFT_BOTTOM))	; \
+	  $(call OptionTrip,-linkoffline,$(ATTACH2COREAPI),$(COREAPI_DOCSDIR)/); \
         ) >> $@
 
 # Create a file with the package names in it
@@ -1008,15 +1020,15 @@
 # Create file with javadoc options in it
 $(JCONSOLE_OPTIONS_FILE):
 	$(prep-target)
-	@($(ECHO) "$(COMMON_JAVADOCFLAGS)"				; \
-	  $(ECHO) "-sourcepath \"$(RELEASEDOCS_SOURCEPATH)\""		; \
-	  $(ECHO) "-encoding ascii"					; \
-	  $(ECHO) "-nodeprecatedlist"					; \
-	  $(ECHO) "-doctitle '$(JCONSOLE_DOCTITLE)'"			; \
-	  $(ECHO) "-windowtitle '$(JCONSOLE_WINDOWTITLE) $(DRAFT_WINTITLE)'";\
-	  $(ECHO) "-header '$(JCONSOLE_HEADER)$(DRAFT_HEADER)'"		; \
-	  $(ECHO) "-bottom '$(JCONSOLE_BOTTOM)$(DRAFT_BOTTOM)'"		; \
-	  $(ECHO) "-linkoffline $(JCONSOLE2COREAPI) $(COREAPI_DOCSDIR)/"; \
+	@($(call OptionOnly,$(COMMON_JAVADOCFLAGS))			; \
+	  $(call OptionPair,-sourcepath,$(RELEASEDOCS_SOURCEPATH))	; \
+	  $(call OptionPair,-encoding,ascii)				; \
+	  $(call OptionOnly,-nodeprecatedlist)				; \
+	  $(call OptionPair,-doctitle,$(JCONSOLE_DOCTITLE))		; \
+	  $(call OptionPair,-windowtitle,$(JCONSOLE_WINDOWTITLE) $(DRAFT_WINTITLE));\
+	  $(call OptionPair,-header,$(JCONSOLE_HEADER)$(DRAFT_HEADER))	; \
+	  $(call OptionPair,-bottom,$(JCONSOLE_BOTTOM)$(DRAFT_BOTTOM))	; \
+	  $(call OptionTrip,-linkoffline,$(JCONSOLE2COREAPI),$(COREAPI_DOCSDIR)/); \
         ) >> $@
 
 # Create a file with the package names in it
@@ -1063,15 +1075,15 @@
 # Create file with javadoc options in it
 $(TREEAPI_OPTIONS_FILE):
 	$(prep-target)
-	@($(ECHO) "$(COMMON_JAVADOCFLAGS)"				; \
-	  $(ECHO) "-sourcepath \"$(RELEASEDOCS_SOURCEPATH)\""		; \
-	  $(ECHO) "-encoding ascii"					; \
-	  $(ECHO) "-doctitle '$(TREEAPI_DOCTITLE)'"			; \
-	  $(ECHO) "-windowtitle '$(TREEAPI_WINDOWTITLE) $(DRAFT_WINTITLE)'";\
-	  $(ECHO) "-header '$(TREEAPI_HEADER)$(DRAFT_HEADER)'"		; \
-	  $(ECHO) "-bottom '$(TREEAPI_BOTTOM)$(DRAFT_BOTTOM)'"		; \
-	  $(ECHO) "-group $(TREEAPI_GROUPNAME) $(TREEAPI_REGEXP)"	; \
-	  $(ECHO) "-linkoffline $(TREEAPI2COREAPI) $(COREAPI_DOCSDIR)/"	; \
+	@($(call OptionOnly,$(COMMON_JAVADOCFLAGS))			; \
+	  $(call OptionPair,-sourcepath,$(RELEASEDOCS_SOURCEPATH))	; \
+	  $(call OptionPair,-encoding,ascii)				; \
+	  $(call OptionPair,-doctitle,$(TREEAPI_DOCTITLE))		; \
+	  $(call OptionPair,-windowtitle,$(TREEAPI_WINDOWTITLE) $(DRAFT_WINTITLE));\
+	  $(call OptionPair,-header,$(TREEAPI_HEADER)$(DRAFT_HEADER))	; \
+	  $(call OptionPair,-bottom,$(TREEAPI_BOTTOM)$(DRAFT_BOTTOM))	; \
+	  $(call OptionTrip,-group,$(TREEAPI_GROUPNAME),$(TREEAPI_REGEXP)); \
+	  $(call OptionTrip,-linkoffline,$(TREEAPI2COREAPI),$(COREAPI_DOCSDIR)/); \
         ) >> $@
 
 # Create a file with the package names in it
@@ -1113,15 +1125,15 @@
 # Create file with javadoc options in it
 $(SCTPAPI_OPTIONS_FILE):
 	$(prep-target)
-	@($(ECHO) "$(COMMON_JAVADOCFLAGS)"				; \
-	  $(ECHO) "-sourcepath \"$(RELEASEDOCS_SOURCEPATH)\""		; \
-	  $(ECHO) "-encoding ascii"					; \
-	  $(ECHO) "-nodeprecatedlist"					; \
-	  $(ECHO) "-doctitle '$(SCTPAPI_DOCTITLE)'"			; \
-	  $(ECHO) "-windowtitle '$(SCTPAPI_WINDOWTITLE) $(DRAFT_WINTITLE)'";\
-	  $(ECHO) "-header '$(SCTPAPI_HEADER)$(DRAFT_HEADER)'"		; \
-	  $(ECHO) "-bottom '$(SCTPAPI_BOTTOM)$(DRAFT_BOTTOM)'"		; \
-	  $(ECHO) "-linkoffline $(SCTPAPI2COREAPI) $(COREAPI_DOCSDIR)/"	; \
+	@($(call OptionOnly,$(COMMON_JAVADOCFLAGS))			; \
+	  $(call OptionPair,-sourcepath,$(RELEASEDOCS_SOURCEPATH))	; \
+	  $(call OptionPair,-encoding,ascii)				; \
+	  $(call OptionOnly,-nodeprecatedlist)				; \
+	  $(call OptionPair,-doctitle,$(SCTPAPI_DOCTITLE))		; \
+	  $(call OptionPair,-windowtitle,$(SCTPAPI_WINDOWTITLE) $(DRAFT_WINTITLE));\
+	  $(call OptionPair,-header,$(SCTPAPI_HEADER)$(DRAFT_HEADER))	; \
+	  $(call OptionPair,-bottom,$(SCTPAPI_BOTTOM)$(DRAFT_BOTTOM))	; \
+	  $(call OptionTrip,-linkoffline,$(SCTPAPI2COREAPI),$(COREAPI_DOCSDIR)/); \
         ) >> $@
 
 # Create a file with the package names in it
@@ -1163,15 +1175,15 @@
 # Create file with javadoc options in it
 $(TRACING_OPTIONS_FILE):
 	$(prep-target)
-	@($(ECHO) "$(COMMON_JAVADOCFLAGS)"				; \
-	  $(ECHO) "-sourcepath \"$(RELEASEDOCS_SOURCEPATH)\""		; \
-	  $(ECHO) "-encoding ascii"					; \
-	  $(ECHO) "-nodeprecatedlist"					; \
-	  $(ECHO) "-doctitle '$(TRACING_DOCTITLE)'"			; \
-	  $(ECHO) "-windowtitle '$(TRACING_WINDOWTITLE) $(DRAFT_WINTITLE)'";\
-	  $(ECHO) "-header '$(TRACING_HEADER)$(DRAFT_HEADER)'"		; \
-	  $(ECHO) "-bottom '$(TRACING_BOTTOM)$(DRAFT_BOTTOM)'"		; \
-	  $(ECHO) "-linkoffline $(TRACING2COREAPI) $(COREAPI_DOCSDIR)/"	; \
+	@($(call OptionOnly,$(COMMON_JAVADOCFLAGS))			; \
+	  $(call OptionPair,-sourcepath,$(RELEASEDOCS_SOURCEPATH))	; \
+	  $(call OptionPair,-encoding,ascii)				; \
+	  $(call OptionOnly,-nodeprecatedlist)				; \
+	  $(call OptionPair,-doctitle,$(TRACING_DOCTITLE))		; \
+	  $(call OptionPair,-windowtitle,$(TRACING_WINDOWTITLE) $(DRAFT_WINTITLE));\
+	  $(call OptionPair,-header,$(TRACING_HEADER)$(DRAFT_HEADER))	; \
+	  $(call OptionPair,-bottom,$(TRACING_BOTTOM)$(DRAFT_BOTTOM))	; \
+	  $(call OptionTrip,-linkoffline,$(TRACING2COREAPI),$(COREAPI_DOCSDIR)/); \
         ) >> $@
 
 # Create a file with the package names in it
--- a/jdk/make/java/awt/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/java/awt/Makefile	Tue Mar 15 20:00:45 2011 -0400
@@ -24,7 +24,6 @@
 #
 
 BUILDDIR = ../..
-MODULE  = awt
 PACKAGE = java.awt
 PRODUCT = sun
 include $(BUILDDIR)/common/Defs.gmk
--- a/jdk/make/java/fdlibm/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/java/fdlibm/Makefile	Tue Mar 15 20:00:45 2011 -0400
@@ -31,7 +31,6 @@
 #
 
 BUILDDIR     = ../..
-MODULE       = base
 LIBRARY      = fdlibm
 PRODUCT      = java
 
--- a/jdk/make/java/instrument/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/java/instrument/Makefile	Tue Mar 15 20:00:45 2011 -0400
@@ -27,7 +27,6 @@
 # agent, supporting java.lang.instrument
 
 BUILDDIR = ../..
-MODULE  = instrument
 PACKAGE = sun.instrument
 LIBRARY = instrument
 PRODUCT = sun
--- a/jdk/make/java/java/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/java/java/Makefile	Tue Mar 15 20:00:45 2011 -0400
@@ -29,7 +29,6 @@
 #
 
 BUILDDIR = ../..
-MODULE  = base
 PACKAGE = java.lang
 LIBRARY = java
 PRODUCT = java
@@ -244,7 +243,7 @@
 
 $(GENSRCDIR)/java/lang/UNIXProcess.java: \
     $(PLATFORM_SRC)/classes/java/lang/UNIXProcess.java.$(PLATFORM)
-	$(install-non-module-file)
+	$(install-file)
 
 clean:: 
 	$(RM) $(GENSRCDIR)/java/lang/UNIXProcess.java
@@ -318,7 +317,6 @@
 	$(BOOT_JAVA_CMD) -jar $(GENERATECURRENCYDATA_JARFILE) -o $@.temp \
 		< $(SHARE_SRC)/classes/java/util/CurrencyData.properties
 	$(MV) $@.temp $@
-	$(install-module-file)
 	$(call chmod-file, 444)
 
 clean:: 
@@ -373,7 +371,7 @@
 		-usecharforbyte 11 4 1
 
 $(GENSRCDIR)/java/lang/%.java : $(CHARACTERDATA)/%.java.template
-	$(install-non-module-file)
+	$(install-file)
 
 clean::
 	$(RM) $(GENSRCDIR)/java/lang/CharacterDataLatin1.java 
--- a/jdk/make/java/java_crw_demo/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/java/java_crw_demo/Makefile	Tue Mar 15 20:00:45 2011 -0400
@@ -25,7 +25,6 @@
 
 BUILDDIR = ../..
 
-MODULE  = demos
 LIBRARY = java_crw_demo
 PRODUCT = sun
 LIBRARY_OUTPUT = java_crw_demo
--- a/jdk/make/java/java_hprof_demo/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/java/java_hprof_demo/Makefile	Tue Mar 15 20:00:45 2011 -0400
@@ -24,7 +24,6 @@
 #
 
 BUILDDIR = ../..
-MODULE  = instrument
 LIBRARY = hprof
 PRODUCT = sun
 LIBRARY_OUTPUT = hprof_jvmti
--- a/jdk/make/java/jli/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/java/jli/Makefile	Tue Mar 15 20:00:45 2011 -0400
@@ -30,7 +30,6 @@
 # its manifestations (java, javaw, javac, ...).
 #
 BUILDDIR = ../..
-MODULE  = base
 LIBRARY = jli
 PRODUCT = java
 
--- a/jdk/make/java/jvm/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/java/jvm/Makefile	Tue Mar 15 20:00:45 2011 -0400
@@ -24,7 +24,6 @@
 #
 
 BUILDDIR = ../..
-MODULE   = base
 
 include $(BUILDDIR)/common/Defs.gmk
 
@@ -39,10 +38,10 @@
 	  $(INCLUDEDIR)/classfile_constants.h
 
 $(INCLUDEDIR)/%.h: $(SHARE_SRC)/javavm/export/%.h
-	$(install-non-module-file)
+	$(install-file)
 
 $(PLATFORM_INCLUDE)/%.h: $(PLATFORM_SRC)/javavm/export/%.h
-	$(install-non-module-file)
+	$(install-file)
 
 JVMCFG_DIR = $(LIBDIR)/$(LIBARCH)
 JVMCFG = $(JVMCFG_DIR)/jvm.cfg
--- a/jdk/make/java/logging/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/java/logging/Makefile	Tue Mar 15 20:00:45 2011 -0400
@@ -24,7 +24,6 @@
 #
 
 BUILDDIR = ../..
-MODULE  = logging
 PACKAGE = java.util.logging
 PRODUCT = java
 include $(BUILDDIR)/common/Defs.gmk
--- a/jdk/make/java/main/java/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/java/main/java/Makefile	Tue Mar 15 20:00:45 2011 -0400
@@ -24,7 +24,6 @@
 #
 
 BUILDDIR = ../../..
-MODULE  = base
 PROGRAM = java
 PRODUCT = java
 
--- a/jdk/make/java/main/javaw/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/java/main/javaw/Makefile	Tue Mar 15 20:00:45 2011 -0400
@@ -28,7 +28,6 @@
 #
 
 BUILDDIR = ../../..
-MODULE  = base
 PROGRAM = javaw
 PRODUCT = java
 
--- a/jdk/make/java/management/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/java/management/Makefile	Tue Mar 15 20:00:45 2011 -0400
@@ -24,7 +24,6 @@
 #
 
 BUILDDIR = ../..
-MODULE  = management
 PACKAGE = java.lang.management
 LIBRARY = management
 PRODUCT = java
--- a/jdk/make/java/net/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/java/net/Makefile	Tue Mar 15 20:00:45 2011 -0400
@@ -24,7 +24,6 @@
 #
 
 BUILDDIR = ../..
-MODULE  = base
 PACKAGE = java.net
 LIBRARY = net
 PRODUCT = sun
--- a/jdk/make/java/nio/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/java/nio/Makefile	Tue Mar 15 20:00:45 2011 -0400
@@ -28,7 +28,6 @@
 #
 
 BUILDDIR = ../..
-MODULE  = nio
 PACKAGE = java.nio
 LIBRARY = nio
 PRODUCT = java
@@ -304,11 +303,7 @@
 # Rules
 #
 
-SUBDIRS_management = mxbean
-include $(BUILDDIR)/common/Subdirs.gmk
-
 build: sources
-	$(SUBDIRS-loop)
 
 clean clobber::
 	$(RM) -r $(NIO_GEN) $(SNIO_GEN)
@@ -821,7 +816,7 @@
 	$(NAWK) '/^.*Copyright.*Oracle/ { printf "%s %s",$$4,$$5 }') 
 
 $(TEMPDIR)/$(GENSOR_SRC) : $(GENSOR_SRC)
-	$(install-non-module-file)
+	$(install-file)
 
 $(GENSOR_EXE) : $(TEMPDIR)/$(GENSOR_SRC)
 	$(prep-target)
--- a/jdk/make/java/nio/mxbean/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,34 +0,0 @@
-#
-# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.  Oracle designates this
-# particular file as subject to the "Classpath" exception as provided
-# by Oracle in the LICENSE file that accompanied this code.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-
-BUILDDIR = ../../..
-MODULE   = management
-PACKAGE  = java.nio
-PRODUCT  = java
-include $(BUILDDIR)/common/Defs.gmk
-
-FILES_java = java/nio/BufferPoolMXBean.java
-
-include $(BUILDDIR)/common/Classes.gmk
--- a/jdk/make/java/npt/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/java/npt/Makefile	Tue Mar 15 20:00:45 2011 -0400
@@ -26,7 +26,6 @@
 BUILDDIR = ../..
 
 # It's currently used by jpda and hprof.  Put it in base module for now.
-MODULE  = base
 LIBRARY = npt
 PRODUCT = sun
 LIBRARY_OUTPUT = npt
--- a/jdk/make/java/redist/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/java/redist/Makefile	Tue Mar 15 20:00:45 2011 -0400
@@ -35,7 +35,6 @@
 # 
 
 BUILDDIR = ../..
-MODULE   = base
 PRODUCT  = java
 include $(BUILDDIR)/common/Defs.gmk
 
@@ -128,35 +127,29 @@
 $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVMMAP_NAME):
 	@$(prep-target)
 	-$(CP) $(HOTSPOT_CLIENT_PATH)/$(JVMMAP_NAME)  $@
-	@$(install-module-file)
 
 $(LIB_LOCATION)/$(KERNEL_LOCATION)/$(JVMMAP_NAME):
 	@$(prep-target)
 	-$(CP) $(HOTSPOT_KERNEL_PATH)/$(JVMMAP_NAME)  $@
-	@$(install-module-file)
 
 ifndef BUILD_CLIENT_ONLY
 $(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMMAP_NAME):
 	@$(prep-target)
 	-$(CP) $(HOTSPOT_SERVER_PATH)/$(JVMMAP_NAME) $@
-	@$(install-module-file)
 endif
 
 $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVMPDB_NAME):
 	@$(prep-target)
 	-$(CP) $(HOTSPOT_CLIENT_PATH)/$(JVMPDB_NAME)  $@
-	@$(install-module-file)
 
 $(LIB_LOCATION)/$(KERNEL_LOCATION)/$(JVMPDB_NAME):
 	@$(prep-target)
 	-$(CP) $(HOTSPOT_KERNEL_PATH)/$(JVMPDB_NAME)  $@
-	@$(install-module-file)
 
 ifndef BUILD_CLIENT_ONLY
 $(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMPDB_NAME): 
 	@$(prep-target)
 	-$(CP) $(HOTSPOT_SERVER_PATH)/$(JVMPDB_NAME) $@
-	@$(install-module-file)
 endif
 
 #  Windows     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  Windows
@@ -316,7 +309,7 @@
 
 $(LIBDIR)/jce.jar: \
 	    $(BUILDDIR)/closed/tools/crypto/jce/jce.jar
-	$(install-non-module-file)
+	$(install-file)
 $(LIBDIR)/security/US_export_policy.jar: \
 	    $(BUILDDIR)/closed/tools/crypto/jce/US_export_policy.jar
 	$(install-file)
--- a/jdk/make/java/redist/fonts/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/java/redist/fonts/Makefile	Tue Mar 15 20:00:45 2011 -0400
@@ -24,7 +24,6 @@
 #
 
 BUILDDIR = ../../..
-MODULE   = font
 PRODUCT  = java
 include $(BUILDDIR)/common/Defs.gmk
 
--- a/jdk/make/java/redist/sajdi/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/java/redist/sajdi/Makefile	Tue Mar 15 20:00:45 2011 -0400
@@ -24,7 +24,6 @@
 #
 
 BUILDDIR = ../../..
-MODULE   = sajdi
 PRODUCT  = java
 include $(BUILDDIR)/common/Defs.gmk
 
--- a/jdk/make/java/security/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/java/security/Makefile	Tue Mar 15 20:00:45 2011 -0400
@@ -24,7 +24,6 @@
 #
 
 BUILDDIR = ../..
-MODULE  = base
 PACKAGE = java.security
 PRODUCT = sun
 include $(BUILDDIR)/common/Defs.gmk
--- a/jdk/make/java/sql/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/java/sql/Makefile	Tue Mar 15 20:00:45 2011 -0400
@@ -28,7 +28,6 @@
 #
 
 BUILDDIR = ../..
-MODULE  = jdbc-base
 PACKAGE = java.sql
 PRODUCT = sun
 include $(BUILDDIR)/common/Defs.gmk
--- a/jdk/make/java/text/base/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/java/text/base/Makefile	Tue Mar 15 20:00:45 2011 -0400
@@ -24,7 +24,6 @@
 #
 
 BUILDDIR = ../../..
-MODULE  = base
 PACKAGE = java.text
 PRODUCT = sun
 
--- a/jdk/make/java/verify/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/java/verify/Makefile	Tue Mar 15 20:00:45 2011 -0400
@@ -28,7 +28,6 @@
 #
 
 BUILDDIR = ../..
-MODULE  = base
 PRODUCT = java
 LIBRARY = verify
 include $(BUILDDIR)/common/Defs.gmk
--- a/jdk/make/java/zip/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/java/zip/Makefile	Tue Mar 15 20:00:45 2011 -0400
@@ -25,7 +25,6 @@
 
 
 BUILDDIR = ../..
-MODULE  = base
 PACKAGE = java.util.zip
 LIBRARY = zip
 PRODUCT = sun
--- a/jdk/make/javax/crypto/Defs-jce.gmk	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/javax/crypto/Defs-jce.gmk	Tue Mar 15 20:00:45 2011 -0400
@@ -83,7 +83,7 @@
 
 define release-warning
 	@$(ECHO) \
-	    "\n***The jar files built by the \"release\" target must***" \
+	    "\n***The jar files built by the 'release' target must***" \
 	    "\n***still be checked into the closed workspace!     ***" \
 	    $(README-MAKEFILE_WARNING)
 endef
--- a/jdk/make/javax/crypto/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/javax/crypto/Makefile	Tue Mar 15 20:00:45 2011 -0400
@@ -108,7 +108,6 @@
 #
 
 BUILDDIR = ../..
-MODULE  = base
 PACKAGE = javax.crypto
 PRODUCT = sun
 
@@ -294,7 +293,7 @@
 
 $(UNSIGNED_POLICY_BUILDDIR)/limited/US_export_policy.jar:		\
 	    $(UNSIGNED_POLICY_BUILDDIR)/unlimited/US_export_policy.jar
-	$(install-non-module-file)
+	$(install-file)
 
 $(UNSIGNED_POLICY_BUILDDIR)/limited/local_policy.jar:			\
 	    policy/limited/default_local.policy				\
@@ -415,7 +414,7 @@
 else
 $(JAR_DESTFILE): $(SIGNED_DIR)/jce.jar
 endif
-	$(install-non-module-file)
+	$(install-file)
 
 #
 # Install the appropriate policy file, depending on the type of build.
@@ -435,7 +434,7 @@
 	    $(POLICY_DESTDIR)/local_policy.jar
 	$(CP) $^ $(POLICY_DESTDIR)
 
-install-limited: install-limited-jars install-module-files
+install-limited: install-limited-jars
 ifndef OPENJDK
 	$(release-warning)
 endif
@@ -449,7 +448,7 @@
 	    $(POLICY_DESTDIR)/local_policy.jar
 	$(CP) $^ $(POLICY_DESTDIR)
 
-install-unlimited: install-unlimited-jars install-module-files
+install-unlimited: install-unlimited-jars
 ifndef OPENJDK
 	$(release-warning)
 endif
@@ -466,16 +465,9 @@
 	    $(PREBUILT_DIR)/jce/local_policy.jar \
 	    $(POLICY_DESTDIR)
 
-install-prebuilt: install-prebuilt-jars install-module-files
+install-prebuilt: install-prebuilt-jars
 endif
 
-install-module-files: \
-	   $(POLICY_DESTDIR)/US_export_policy.jar \
-	   $(POLICY_DESTDIR)/local_policy.jar
-
-$(POLICY_DESTDIR)/%.jar :
-	$(install-module-file)
-
 # =====================================================
 # Support routines.
 #
--- a/jdk/make/javax/imageio/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/javax/imageio/Makefile	Tue Mar 15 20:00:45 2011 -0400
@@ -28,7 +28,6 @@
 #
 
 BUILDDIR = ../..
-MODULE  = imageio
 PACKAGE = javax.imageio
 PRODUCT = jiio
 include $(BUILDDIR)/common/Defs.gmk
--- a/jdk/make/javax/print/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/javax/print/Makefile	Tue Mar 15 20:00:45 2011 -0400
@@ -28,7 +28,6 @@
 #
 
 BUILDDIR = ../..
-MODULE  = print
 PACKAGE = javax.print
 PRODUCT = sun
 include $(BUILDDIR)/common/Defs.gmk
--- a/jdk/make/javax/sound/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/javax/sound/Makefile	Tue Mar 15 20:00:45 2011 -0400
@@ -24,7 +24,6 @@
 #
 
 BUILDDIR = ../..
-MODULE  = sound
 PACKAGE = javax.sound
 LIBRARY = jsound
 PRODUCT = sun
--- a/jdk/make/javax/sound/jsoundalsa/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/javax/sound/jsoundalsa/Makefile	Tue Mar 15 20:00:45 2011 -0400
@@ -24,7 +24,6 @@
 #
 
 BUILDDIR = ../../..
-MODULE  = sound
 PACKAGE = javax.sound
 LIBRARY = jsoundalsa
 PRODUCT = sun
--- a/jdk/make/javax/sound/jsoundds/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/javax/sound/jsoundds/Makefile	Tue Mar 15 20:00:45 2011 -0400
@@ -24,7 +24,6 @@
 #
 
 BUILDDIR = ../../..
-MODULE  = sound
 PACKAGE = javax.sound
 LIBRARY = jsoundds
 PRODUCT = sun
--- a/jdk/make/javax/sql/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/javax/sql/Makefile	Tue Mar 15 20:00:45 2011 -0400
@@ -28,7 +28,6 @@
 #
 
 BUILDDIR = ../..
-MODULE  = jdbc-enterprise
 PACKAGE = javax.sql
 PRODUCT = sun
 include $(BUILDDIR)/common/Defs.gmk
--- a/jdk/make/javax/swing/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/javax/swing/Makefile	Tue Mar 15 20:00:45 2011 -0400
@@ -24,7 +24,6 @@
 #
 
 BUILDDIR  = ../..
-MODULE    = swing
 PACKAGE   = javax.swing
 PRODUCT   = com
 SWING_SRC = $(SHARE_SRC)/classes/javax/swing
--- a/jdk/make/javax/swing/plaf/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/javax/swing/plaf/Makefile	Tue Mar 15 20:00:45 2011 -0400
@@ -24,7 +24,6 @@
 #
 
 BUILDDIR  = ../../..
-MODULE    = swing
 PACKAGE   = javax.swing.plaf
 PRODUCT   = com
 SWING_SRC = $(SHARE_SRC)/classes/javax/swing
--- a/jdk/make/jpda/back/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/jpda/back/Makefile	Tue Mar 15 20:00:45 2011 -0400
@@ -28,7 +28,6 @@
 #
 
 BUILDDIR = ../..
-MODULE  = debugging
 LIBRARY = jdwp
 PRODUCT = jpda
 
--- a/jdk/make/jpda/transport/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/jpda/transport/Makefile	Tue Mar 15 20:00:45 2011 -0400
@@ -28,7 +28,6 @@
 #
 
 BUILDDIR = ../..
-MODULE  = debugging
 PRODUCT = jpda
 include $(BUILDDIR)/common/Defs.gmk
 
--- a/jdk/make/jpda/transport/shmem/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/jpda/transport/shmem/Makefile	Tue Mar 15 20:00:45 2011 -0400
@@ -28,7 +28,6 @@
 #
 
 BUILDDIR = ../../..
-MODULE   = debugging
 LIBRARY  = dt_shmem
 PRODUCT = jbug
 
--- a/jdk/make/jpda/transport/socket/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/jpda/transport/socket/Makefile	Tue Mar 15 20:00:45 2011 -0400
@@ -28,7 +28,6 @@
 #
 
 BUILDDIR = ../../..
-MODULE  = debugging
 LIBRARY = dt_socket
 PRODUCT = jbug
 
--- a/jdk/make/jpda/tty/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/jpda/tty/Makefile	Tue Mar 15 20:00:45 2011 -0400
@@ -28,7 +28,6 @@
 #
 
 BUILDDIR = ../..
-MODULE  = jdb
 PACKAGE = com.sun.tools.example.debug.tty
 PRODUCT = jpda
 PROGRAM = jdb
--- a/jdk/make/launchers/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/launchers/Makefile	Tue Mar 15 20:00:45 2011 -0400
@@ -28,7 +28,6 @@
 #
 
 BUILDDIR = ..
-MODULE  = tools
 PACKAGE = launchers
 PRODUCT = sun
 include $(BUILDDIR)/common/Defs.gmk
@@ -38,7 +37,6 @@
 define make-corba-launcher
 $(CD) $(BUILDDIR)/launchers && \
 $(MAKE) -f Makefile.launcher \
-        MODULE=corba \
         PROGRAM=$(strip $1) \
         MAIN_CLASS=$(strip $2) \
         MAIN_JAVA_ARGS="$(strip $3)" \
--- a/jdk/make/mkdemo/jvmti/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/mkdemo/jvmti/Makefile	Tue Mar 15 20:00:45 2011 -0400
@@ -28,7 +28,6 @@
 #
 
 BUILDDIR = ../..
-MODULE  = demos
 PRODUCT = demos
 include $(BUILDDIR)/common/Defs.gmk
 
--- a/jdk/make/mkdemo/management/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/mkdemo/management/Makefile	Tue Mar 15 20:00:45 2011 -0400
@@ -28,7 +28,6 @@
 #
 
 BUILDDIR = ../..
-MODULE  = demos
 PRODUCT = demos
 include $(BUILDDIR)/common/Defs.gmk
 
--- a/jdk/make/mksample/dtrace/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/mksample/dtrace/Makefile	Tue Mar 15 20:00:45 2011 -0400
@@ -29,7 +29,6 @@
 
 BUILDDIR = ../..
 
-MODULE  = samples
 PRODUCT = java
 
 include $(BUILDDIR)/common/Defs.gmk
--- a/jdk/make/mksample/jmx/jmx-scandir/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/mksample/jmx/jmx-scandir/Makefile	Tue Mar 15 20:00:45 2011 -0400
@@ -29,7 +29,6 @@
 
 BUILDDIR = ../../..
 
-MODULE  = samples
 PRODUCT = java
 
 include $(BUILDDIR)/common/Defs.gmk
--- a/jdk/make/mksample/nbproject/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/mksample/nbproject/Makefile	Tue Mar 15 20:00:45 2011 -0400
@@ -29,7 +29,6 @@
 
 BUILDDIR = ../..
 
-MODULE  = samples
 PRODUCT = java
 
 include $(BUILDDIR)/common/Defs.gmk
--- a/jdk/make/mksample/nio/file/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/mksample/nio/file/Makefile	Tue Mar 15 20:00:45 2011 -0400
@@ -29,7 +29,6 @@
 
 BUILDDIR = ../../..
 
-MODULE  = samples
 PRODUCT = java
 
 include $(BUILDDIR)/common/Defs.gmk
--- a/jdk/make/mksample/nio/multicast/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/mksample/nio/multicast/Makefile	Tue Mar 15 20:00:45 2011 -0400
@@ -29,7 +29,6 @@
 
 BUILDDIR = ../../..
 
-MODULE  = samples
 PRODUCT = java
 
 include $(BUILDDIR)/common/Defs.gmk
--- a/jdk/make/mksample/nio/server/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/mksample/nio/server/Makefile	Tue Mar 15 20:00:45 2011 -0400
@@ -29,7 +29,6 @@
 
 BUILDDIR = ../../..
 
-MODULE  = samples
 PRODUCT = java
 
 include $(BUILDDIR)/common/Defs.gmk
--- a/jdk/make/mksample/scripting/scriptpad/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/mksample/scripting/scriptpad/Makefile	Tue Mar 15 20:00:45 2011 -0400
@@ -29,7 +29,6 @@
 
 BUILDDIR = ../../..
 
-MODULE  = samples
 PRODUCT = java
 
 include $(BUILDDIR)/common/Defs.gmk
--- a/jdk/make/mksample/webservices/EbayClient/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/mksample/webservices/EbayClient/Makefile	Tue Mar 15 20:00:45 2011 -0400
@@ -29,7 +29,6 @@
 
 BUILDDIR = ../../..
 
-MODULE  = samples
 PRODUCT = java
 
 include $(BUILDDIR)/common/Defs.gmk
--- a/jdk/make/mksample/webservices/EbayServer/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/mksample/webservices/EbayServer/Makefile	Tue Mar 15 20:00:45 2011 -0400
@@ -29,7 +29,6 @@
 
 BUILDDIR = ../../..
 
-MODULE  = samples
 PRODUCT = java
 
 include $(BUILDDIR)/common/Defs.gmk
--- a/jdk/make/modules/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,134 +0,0 @@
-#
-# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.  Oracle designates this
-# particular file as subject to the "Classpath" exception as provided
-# by Oracle in the LICENSE file that accompanied this code.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-
-BUILDDIR = ..
-include $(BUILDDIR)/common/Defs.gmk
-
-#
-# Modularizing the JDK
-# - Post jdk build process until the source tree is restructured
-#   for modules build
-# - <outputdir>/modules/<module> will be created for each module.
-#
-# Steps:
-# 0. During jdk build before this makefile is invoked, classes, 
-#    resource files, and other non-class files such as native libraries,
-#    properties file, images, etc are created.
-#
-#    Non-class files are copied to <outputdir>/tmp/modules/<MODULE>
-#    directory in this step to prepare for the post-build modularization. 
-#
-#    The MODULE variable defined in other makefiles specifies 
-#    the lowest-level module that the non-class files belong to.
-#    The name might or might not be the same as the name of the modules 
-#    in the resulting <outputdir>/modules directory.
-#    
-# 1. Unpack all jars in the <builddir>/lib directory to a temporary 
-#    location (<outputdir>/tmp/modules/classes) to prepare for modules
-#    creation.
-#
-# 2. Run ClassAnalyzer tool to analyze all jdk classes and generate
-#    class list for all modules and also perform dependency analysis. 
-#
-#    Input configuration files :-
-#
-#    modules.config : defines the low-level modules and specifies 
-#       what classes and resource files each module includes.
-#    modules.group  : defines the module groups and its members.
-#    jdk7.depconfig : lists the dynamic dependencies including
-#       use of reflection Class.forName and JNI FindClass and
-#       service provider.
-#    optional.depconfig : lists the optional dependencies
-#
-# 3. Create one directory for each module (<outputdir>/modules/<module>)
-#    based on the output files from (2).
-#       
-#    modules.list lists the modules to be created for the modules
-#    build and its members. For each module (m) in modules.list,
-#    a. create $m/lib/$m.jar with all classes and resource files
-#       listed in $m.classlist and $m.resources respectively.
-#    b. copy all non-class files from its members to 
-#       <outputdir>/modules/$m.
-
-
-MAINMANIFEST=$(JDK_TOPDIR)/make/tools/manifest.mf
-MODULE_JAR_MANIFEST_FILE=$(ABS_TEMPDIR)/manifest.tmp
-
-TMP = $(ABS_MODULES_TEMPDIR)
-MODULE_CLASSLIST = $(ABS_MODULES_TEMPDIR)/classlist
-MODULE_CLASSES = $(ABS_MODULES_TEMPDIR)/classes
-MODULES_LIST = $(MODULE_CLASSLIST)/modules.list
-
-all:: unpack-jars gen-classlist modularize
-
-JAR_LIST := $(shell $(FIND) $(ABS_OUTPUTDIR)/lib -name \*.jar -print) 
-unpack-jars:
-	@$(ECHO) ">>>Making "$@" @ `$(DATE)` ..."
-	$(RM) -rf $(MODULE_CLASSES)
-	$(MKDIR) -p $(MODULE_CLASSES)
-	$(CP) -rf $(CLASSBINDIR)/* $(MODULE_CLASSES)
-	@for jf in  $(JAR_LIST) ; do \
-	   $(CD) $(MODULE_CLASSES) && $(BOOT_JAR_CMD) xf $$jf $(BOOT_JAR_JFLAGS);\
-	done
-	@$(ECHO) ">>>Finished making "$@" @ `$(DATE)` ..."
-
-gen-classlist:
-	$(CD) tools && $(MAKE) all
-
-modularize: $(MODULE_JAR_MANIFEST_FILE)
-	@$(ECHO) ">>>Making "$@" @ `$(DATE)` ..."
-	@$(RM) -rf $(MODULES_DIR)
-
-	@# create jar file for modules and
-	@# copy other files from all members of this module 
-	for m in `$(NAWK) '{print $$1}' $(MODULES_LIST)` ; do \
-   	   $(ECHO) "Creating module $$m" ; \
-   	   $(SED) -e 's%\\%\/%g' < $(MODULE_CLASSLIST)/$$m.classlist > $(TMP)/tmp.cf ; \
-	   if [ -f $(MODULE_CLASSLIST)/$$m.resources ] ; then \
-   	       $(SED) -e 's%\\%\/%g' < $(MODULE_CLASSLIST)/$$m.resources >> $(TMP)/tmp.cf ; \
-           fi ; \
-           $(MKDIR) -p $(ABS_MODULES_DIR)/$$m/lib; \
-	   $(CD) $(MODULE_CLASSES) && \
-               $(BOOT_JAR_CMD) c0mf $(MODULE_JAR_MANIFEST_FILE) \
-		   $(ABS_MODULES_DIR)/$$m/lib/$$m.jar \
-	           @$(TMP)/tmp.cf \
-                   $(BOOT_JAR_JFLAGS); \
-	   for s in `$(GREP) "^$$m" $(MODULES_LIST)` ; do \
-               if [ -d $(TMP)/$$s ] ; then \
-               	   $(CP) -rf $(TMP)/$$s/*  $(ABS_MODULES_DIR)/$$m; \
-		   $(RM) -rf $(ABS_MODULES_DIR)/$$m/classes; \
-	       fi \
-	   done \
-        done
-	@$(CD) $(MODULE_CLASSES) && $(java-vm-cleanup)
-	@$(ECHO) ">>>Finished making "$@" @ `$(DATE)` ..."
-
-$(MODULE_JAR_MANIFEST_FILE):
-	$(SED) -e "s/@@RELEASE@@/$(RELEASE)/" $(MAINMANIFEST) > $@
-
-clean clobber::
-	$(RM) -rf $(MODULE_CLASSLIST)
-	$(RM) -rf $(MODULES_DIR)
-	$(RM) $(MODULE_JAR_MANIFEST_FILE)
--- a/jdk/make/modules/bootmodule.roots	Tue Mar 15 19:52:42 2011 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,199 +0,0 @@
-#
-# Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-
-#
-# List of root classes/methods, each line of the following syntax:
-# <class name> 
-# <method name> <signature>|*
-# exclude <class>|<method> 
-
-# The boot module generated based on this rootset does not support
-# - security permission check
-# - non-standard charset
-# - logging output
-# - resource bundles
-#   including error output from the launcher 
-
-# VM preloaded classes
-java.lang.Object
-java.lang.String
-java.lang.Class
-java.lang.Cloneable
-java.lang.ClassLoader
-java.lang.System
-java.lang.Throwable
-java.lang.Error
-java.lang.ThreadDeath
-java.lang.Exception
-java.lang.RuntimeException
-java.security.ProtectionDomain
-java.security.AccessControlContext
-java.lang.ClassNotFoundException
-java.lang.NoClassDefFoundError
-java.lang.ClassCastException
-java.lang.ArrayStoreException
-java.lang.VirtualMachineError
-java.lang.OutOfMemoryError
-java.lang.StackOverflowError
-java.lang.IllegalMonitorStateException
-java.lang.ref.Reference
-java.lang.ref.SoftReference
-java.lang.ref.WeakReference
-java.lang.ref.FinalReference
-java.lang.ref.PhantomReference
-java.lang.ref.Finalizer
-java.lang.Runnable
-java.lang.Thread
-java.lang.ThreadGroup
-java.util.Properties
-java.lang.reflect.AccessibleObject
-java.lang.reflect.Member
-java.lang.reflect.Field
-java.lang.reflect.Method
-java.lang.reflect.Constructor
-java.lang.reflect.Type
-sun.reflect.MagicAccessorImpl
-sun.reflect.MethodAccessorImpl
-sun.reflect.ConstructorAccessorImpl
-sun.reflect.DelegatingClassLoader
-sun.reflect.ConstantPool
-sun.reflect.UnsafeStaticFieldAccessorImpl
-java.util.Vector
-java.lang.StringBuffer
-java.lang.StackTraceElement
-java.nio.Buffer
-java.lang.Boolean
-java.lang.Character
-java.lang.Float
-java.lang.Double
-java.lang.Byte
-java.lang.Short
-java.lang.Integer
-java.lang.Long
-java.lang.NullPointerException
-java.lang.ArithmeticException
-java.lang.Compiler
-
-
-# Root methods
-java.lang.ClassLoader.getSystemClassLoader ()Ljava/lang/ClassLoader;
-java.lang.System.initializeSystemClass ()V
-sun.launcher.LauncherHelper.checkAndLoadMain (ZZLjava/lang/String;)Ljava/lang/Object;
-
-# The tool doesn't automatically find superclasses and parse the method
-# if overridden as it tries to reduce unnecessary classes being pulled in.
-# The following forces the dependency to be included the result.
-sun.net.www.protocol.file.Handler.<init> ()V
-sun.net.www.protocol.jar.Handler.<init> ()V
-sun.net.www.protocol.file.Handler.openConnection *
-sun.net.www.protocol.jar.Handler.openConnection *
-sun.misc.URLClassPath$JarLoader.<init>  (Ljava/net/URL;Ljava/net/URLStreamHandler;Ljava/util/HashMap;)V
-sun.misc.URLClassPath$FileLoader.<init> (Ljava/net/URL;)V
-sun.misc.URLClassPath$FileLoader.getClassPath *
-sun.misc.URLClassPath$FileLoader.getResource *
-sun.misc.URLClassPath$JarLoader.getResource *
-sun.misc.URLClassPath$JarLoader.getClassPath *
-
-# permission collections
-java.io.FilePermission.newPermissionCollection ()Ljava/security/PermissionCollection;
-java.security.BasicPermission.newPermissionCollection ()Ljava/security/PermissionCollection;
-
-# native
-java.io.UnixFileSystem
-java.io.UnixFileSystem.<init> ()V
-java.io.UnixFileSystem.canonicalize *
-java.io.Win32FileSystem
-java.io.Win32FileSystem.<init> ()V
-java.io.Win32FileSystem.canonicalize *
-java.io.WinNTFileSystem
-java.io.WinNTFileSystem.<init> ()V
-java.io.WinNTFileSystem.canonicalize *
-
-# missing
-java.util.HashMap.<init> ()V
-java.util.HashMap$EntrySet.iterator *
-
-# Called from native GetStringPlatformChars (jni_util.c)
-java.lang.String.getBytes *
-
-# charset
-sun.nio.cs.US_ASCII.newEncoder ()Ljava/nio/charset/CharsetEncoder;
-sun.nio.cs.UTF_8.newEncoder ()Ljava/nio/charset/CharsetEncoder;
-sun.nio.cs.UTF_8.newDecoder  *
-sun.nio.cs.UTF_16.newEncoder ()Ljava/nio/charset/CharsetEncoder;
-sun.nio.cs.UTF_16.newDecoder  *
-sun.nio.cs.UTF_32.newEncoder ()Ljava/nio/charset/CharsetEncoder;
-sun.nio.cs.UTF_32.newDecoder  *
-
-# hashcode
-java.util.jar.Attributes$Name.hashCode *
-
-# nio
-sun.nio.ByteBuffered
-sun.nio.ch.DirectBuffer
-java.nio.DirectByteBuffer
-java.nio.MappedByteBuffer
-java.nio.DirectLongBufferU
-
-# resource files
-sun.launcher.resources.launcher
-
-sun.misc.Launcher$AppClassLoader.getPermissions *
-sun.misc.Launcher$AppClassLoader.loadClass  (Ljava/lang/String;)Ljava/lang/Class;
-sun.misc.Launcher$AppClassLoader.findClass  (Ljava/lang/String;)Ljava/lang/Class;
-sun.misc.Launcher$ExtClassLoader.getPermissions *
-sun.misc.Launcher$ExtClassLoader.loadClass  (Ljava/lang/String;)Ljava/lang/Class;
-sun.misc.Launcher$ExtClassLoader.findClass  (Ljava/lang/String;)Ljava/lang/Class;
-java.lang.ClassLoader.checkPackageAccess *
-java.lang.ClassLoader.findClass *
-java.lang.ClassLoader.defineClass *
-java.net.URLClassLoader.getPermissions *
-java.net.URLClassLoader.findClass *
-java.net.URLClassLoader.defineClass *
-java.security.SecureClassLoader.defineClass *
-# need to parse superclasses <init>
-java.security.SecureClassLoader.<init> ()V
-
-exclude sun.security.provider.PolicyFile.<init>
-exclude java.lang.ClassLoader.compareCerts
-exclude java.security.cert.Certificate.equals
-# unsigned jars - no verifier
-exclude java.util.jar.JarFile.initializeVerifier
-exclude java.util.jar.JarVerifier 
-exclude sun.security.util.SignatureFileVerifier.<init>
-
-
-# what about other charset
-exclude sun.misc.Service
-exclude java.util.ServiceLoader
-
-# exclude support for localized messages
-exclude java.util.ResourceBundle.getBundle
-exclude java.text.MessageFormat
-exclude sun.util.logging.PlatformLogger$LoggerProxy.format *
-
-# exclude nio and miscellaneous classes
-exclude java.nio.channels.**
-exclude sun.misc.FloatingDecimal
-exclude sun.misc.FormattedFloatingDecimal
-exclude sun.misc.FDBigInt 
--- a/jdk/make/modules/jdk7.depconfig	Tue Mar 15 19:52:42 2011 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,473 +0,0 @@
-#
-# Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-
-# private java.lang.Object createInetSocketAddress(java.lang.String, int)
-@ClassForName
-  com.sun.jndi.ldap.Connection -> java.net.InetSocketAddress
-  com.sun.jndi.ldap.Connection -> java.net.SocketAddress
-
-# com.sun.jndi.ldap.VersionHelper
-@ClassForName(optional)
-  com.sun.jndi.ldap.VersionHelper -> com.sun.jndi.ldap.VersionHelper*
-
-# private static void initMethodHandles()
-@ClassForName
-  com.sun.jndi.toolkit.corba.CorbaUtils -> javax.rmi.CORBA.Stub
-  com.sun.jndi.toolkit.corba.CorbaUtils -> javax.rmi.PortableRemoteObject
-
-# com.sun.naming.internal.ResourceManager$AppletParameter
-@ClassForName(optional)
-  com.sun.naming.internal.ResourceManager$AppletParameter -> java.applet.Applet
-
-# private static boolean loadProviderAsService()
-@Provider
-  com.sun.net.httpserver.spi.HttpServerProvider -> META-INF/services/com.sun.net.httpserver.spi.HttpServerProvider
-
-# com.sun.org.apache.xml.internal.security.transforms.implementations.TransformXSLT
-@ClassForName
-  com.sun.org.apache.xml.internal.security.transforms.implementations.TransformXSLT -> javax.xml.XMLConstants
-
-# public static java.beans.PersistenceDelegate getPersistenceDelegate(java.lang.Class)
-@ClassForName
-  java.beans.MetaData -> java.beans.*_PersistenceDelegate
-
-# private static java.lang.reflect.Method getNanosMethod()
-@ClassForName(optional)
-  java.beans.java_sql_Timestamp_PersistenceDelegate -> java.sql.Timestamp
-
-# java.beans.java_util_Collections$CheckedCollection_PersistenceDelegate
-@ClassForName
-  java.beans.java_util_Collections$CheckedCollection_PersistenceDelegate -> java.util.Collections$CheckedCollection
-
-# java.beans.java_util_Collections$CheckedMap_PersistenceDelegate
-@ClassForName
-  java.beans.java_util_Collections$CheckedMap_PersistenceDelegate -> java.util.Collections$CheckedMap
-
-# private static java.lang.Object getType(java.lang.Object)
-@ClassForName
-  java.beans.java_util_EnumMap_PersistenceDelegate -> java.util.EnumMap
-
-# private java.lang.Integer getAxis(java.lang.Object)
-@ClassForName
-  java.beans.javax_swing_Box_PersistenceDelegate -> javax.swing.BoxLayout
-
-# java.lang.Double
-@Inline
-  java.lang.Double -> sun.misc.FloatConsts
-  java.lang.Double -> sun.misc.DoubleConsts
-
-# java.lang.Float
-@Inline
-  java.lang.Float -> sun.misc.FloatConsts
-  java.lang.Float -> sun.misc.DoubleConsts
-
-# java.net.DefaultDatagramSocketImplFactory
-@ClassForName(optional)
-  java.net.DefaultDatagramSocketImplFactory -> java.net.*DatagramSocketImpl
-
-# private static sun.net.spi.nameservice.NameService createNSProvider(java.lang.String)
-@Provider
-  java.net.InetAddress -> META-INF/services/sun.net.spi.nameservice.NameServiceDescriptor
-
-# static java.net.InetAddressImpl create()
-@ClassForName
-  java.net.InetAddressImplFactory -> java.net.*Inet[46]AddressImpl
-
-# private static void init()
-@NativeFindClass
-  java.net.PlainDatagramSocketImpl -> java.io.FileDescriptor
-
-# java.net.ProxySelector
-@ClassForName
-  java.net.ProxySelector -> sun.net.spi.DefaultProxySelector
-
-# static java.net.URLStreamHandler getURLStreamHandler(java.lang.String)
-@ClassForName(optional)
-  java.net.URL -> sun.net.www.protocol.*.Handler
-
-# private java.net.ContentHandler lookupContentHandlerClassFor(java.lang.String)
-@ClassForName
-  java.net.URLConnection -> sun.net.www.content.*
-
-# private static java.nio.channels.spi.AsynchronousChannelProvider loadProviderAsService()
-@Provider
-  java.nio.channels.spi.AsynchronousChannelProvider$ProviderHolder -> META-INF/services/java.nio.channels.spi.AsynchronousChannelProvider
-
-# private static boolean loadProviderFromProperty()
-@ClassForName
-  java.nio.channels.spi.SelectorProvider -> sun.nio.ch.DefaultSelectorProvider
-
-# private static boolean loadProviderAsService()
-@Provider
-  java.nio.channels.spi.SelectorProvider -> META-INF/services/java.nio.channels.spi.SelectorProvider
-
-# private static java.util.Iterator providers()
-@Provider
-  java.nio.charset.Charset -> META-INF/services/java.nio.charset.spi.CharsetProvider
-
-# private static void probeExtendedProvider()
-@ClassForName(optional)
-  java.nio.charset.Charset -> sun.nio.cs.ext.ExtendedCharsets
-
-# public static java.nio.file.FileSystem newFileSystem(java.net.URI, java.util.Map<java.lang.String, ?>, java.lang.ClassLoader)
-@Provider
-  java.nio.file.FileSystems -> META-INF/services/java.nio.file.FileSystemProvider
-
-# private static java.util.List<java.nio.file.spi.FileTypeDetector> loadInstalledDetectors()
-@Provider
-  java.nio.file.Files$DefaultFileTypeDetectorHolder -> META-INF/services/java.nio.file.spi.FileTypeDetector
-
-# public static java.util.List<java.nio.file.spi.FileSystemProvider> installedProviders()
-@Provider
-  java.nio.file.spi.FileSystemProvider -> META-INF/services/java.nio.file.FileSystemProvider
-
-# private static java.rmi.server.RMIClassLoaderSpi initializeProvider()
-@Provider
-  java.rmi.server.RMIClassLoader -> META-INF/services/java.rmi.server.RMIClassLoaderSpi
-
-# private static void initializeSystemScope()
-@ClassForName(optional)
-  java.security.IdentityScope -> sun.security.provider.IdentityDatabase
-
-# static java.security.Policy getPolicyNoCheck()
-@ClassForName
-  java.security.Policy -> sun.security.provider.PolicyFile
-
-# private static java.lang.Class getSpiClass(java.lang.String)
-@ClassForName
-  java.security.Security -> java.security.*Spi
-
-# private static void invalidateSMCache(java.lang.String)
-@ClassForName
-  java.security.Security -> java.lang.SecurityManager
-
-# private static void loadInitialDrivers()
-@Provider
-  java.sql.DriverManager -> META-INF/services/java.sql.Driver
-
-# private static java.text.BreakIterator createBreakInstance(java.util.Locale, int, java.lang.String, java.lang.String)
-@Provider
-  java.text.BreakIterator -> META-INF/services/java.util.spi.BreakIteratorProvider
-
-# public static java.text.Collator getInstance(java.util.Locale)
-@Provider
-  java.text.Collator -> META-INF/services/java.util.spi.CollatorProvider
-
-# private static java.text.DateFormat get(int, int, int, java.util.Locale)
-@Provider
-  java.text.DateFormat -> META-INF/services/java.util.spi.DateNameProvider
-
-# public static java.util.Locale[] getAvailableLocales()
-@Provider
-  java.text.DateFormatSymbols -> META-INF/services/java.util.spi.DateFormatSymbolsProvider
-
-# public static java.util.Locale[] getAvailableLocales()
-@Provider
-  java.text.DecimalFormatSymbols -> META-INF/services/java.util.spi.DecimalFormatSymbolsProvider
-
-# public static java.util.Locale[] getAvailableLocales()
-@Provider
-  java.text.NumberFormat -> META-INF/services/java.util.spi.NumberFormatProvider
-
-# public java.lang.String getDisplayName(java.util.Locale)
-@Provider
-  java.util.Currency -> META-INF/services/java.util.spi.CurrencyNameProvider
-
-# java.util.Formatter
-@Inline
-  java.util.Formatter -> sun.misc.DoubleConsts
-
-# java.util.Locale
-@Inline
-  java.util.Locale -> java.util.LocaleISOData
-
-# private java.lang.String getDisplayString(java.lang.String, java.util.Locale, int)
-@Provider
-  java.util.Locale -> META-INF/services/java.util.spi.LocaleNameProvider
-
-# private static java.util.prefs.PreferencesFactory factory1()
-@ClassForName
-  java.util.prefs.Preferences -> java.util.prefs.WindowsPreferencesFactory
-  java.util.prefs.Preferences -> java.util.prefs.FileSystemPreferencesFactory
-
-# private static java.util.prefs.PreferencesFactory factory1()
-@Provider
-  java.util.prefs.Preferences -> META-INF/services/java.util.prefs.PreferencesFactory
-
-# public void registerApplicationClasspathSpis()
-@Provider
-  javax.imageio.spi.IIORegistry -> META-INF/services/javax.imageio.spi.IIOServiceProvider
-
-# private void registerInstalledProviders()
-@Provider
-  javax.imageio.spi.IIORegistry -> META-INF/services/javax.imageio.spi.ImageReaderSpi
-  javax.imageio.spi.IIORegistry -> META-INF/services/javax.imageio.spi.ImageWriterSpi
-  javax.imageio.spi.IIORegistry -> META-INF/services/javax.imageio.spi.ImageReaderWriterSpi
-  javax.imageio.spi.IIORegistry -> META-INF/services/javax.imageio.spi.ImageTranscoderSpi
-  javax.imageio.spi.IIORegistry -> META-INF/services/javax.imageio.spi.ImageInputStreamSpi
-  javax.imageio.spi.IIORegistry -> META-INF/services/javax.imageio.spi.ImageOutputStreamSpi
-
-# public javax.naming.ldap.ExtendedResponse createExtendedResponse(java.lang.String, byte[], int, int)
-@Provider
-  javax.naming.ldap.StartTlsRequest -> META-INF/services/javax.naming.ldap.StartTlsResponse
-
-# private static java.util.ArrayList getAllLookupServices()
-@Provider
-  javax.print.PrintServiceLookup -> META-INF/services/javax.print.PrintServiceLookup
-
-# private static java.util.ArrayList getAllFactories()
-@Provider
-  javax.print.StreamPrintServiceFactory -> META-INF/services/javax.print.StreamPrintServiceFactory
-
-# private void initEngines(java.lang.ClassLoader)
-@Provider
-  javax.script.ScriptEngineManager -> META-INF/services/javax.script.ScriptEngineFactory
-
-# private void initializeInputMethodLocatorList()
-@Provider
-  sun.awt.im.ExecutableInputMethodManager -> META-INF/services/java.awt.im.spi.InputMethodDescriptor
-
-# private static java.lang.Class getConverterClass(int, java.lang.String)
-@ClassForName(optional)
-  sun.io.Converters -> sun.io.*
-
-# public static sun.java2d.cmm.PCMM getModule()
-@Provider
-  sun.java2d.cmm.CMSManager -> META-INF/services/sun.java2d.cmm.PCMM
-
-# public static sun.java2d.pipe.RenderingEngine getInstance()
-@Provider
-  sun.java2d.pipe.RenderingEngine -> META-INF/services/sun.java2d.pipe.RenderingEngine
-
-# public static sun.java2d.pipe.RenderingEngine getInstance()
-@ClassForName(optional)
-  sun.java2d.pipe.RenderingEngine -> sun.dc.DuctusRenderingEngine
-
-# sun.misc.FloatingDecimal
-@Inline
-  sun.misc.FloatingDecimal -> sun.misc.FloatConsts
-  sun.misc.FloatingDecimal -> sun.misc.DoubleConsts
-
-# sun.misc.FormattedFloatingDecimal
-@Inline
-  sun.misc.FormattedFloatingDecimal -> sun.misc.FloatConsts
-  sun.misc.FormattedFloatingDecimal -> sun.misc.DoubleConsts
-
-# sun.misc.FpUtils
-@Inline
-  sun.misc.FpUtils -> sun.misc.FloatConsts
-  sun.misc.FpUtils -> sun.misc.DoubleConsts
-
-# public java.net.URLStreamHandler createURLStreamHandler(java.lang.String)
-@ClassForName(optional)
-  sun.misc.Launcher$Factory -> sun.net.www.protocol.*.Handler
-
-# private static sun.net.NetHooks$Provider loadProvider(java.lang.String)
-@ClassForName(optional)
-  sun.net.NetHooks -> sun.net.spi.SdpProvider
-
-# sun.net.idn.StringPrep
-@Inline
-  sun.net.idn.StringPrep -> sun.net.idn.UCharacterDirection
-
-# private static boolean init()
-@NativeFindClass
-  sun.net.spi.DefaultProxySelector -> java.net.Proxy
-  sun.net.spi.DefaultProxySelector -> java.net.Proxy$Type
-  sun.net.spi.DefaultProxySelector -> java.net.InetSocketAddress
-
-# private static java.nio.channels.Channel createChannel()
-@ClassForName
-  sun.nio.ch.InheritedChannel -> java.io.FileDescriptor
-
-# private static void initDBBConstructor()
-@ClassForName
-  sun.nio.ch.Util -> java.nio.DirectByteBuffer
-
-# private static void initDBBRConstructor()
-@ClassForName
-  sun.nio.ch.Util -> java.nio.DirectByteBufferR
-
-# private java.nio.charset.Charset lookup(java.lang.String)
-@ClassForName(optional)
-  sun.nio.cs.FastCharsetProvider -> sun.nio.cs.*
-
-# sun.nio.cs.ext.ExtendedCharsets
-@ClassForName(optional)
-  sun.nio.cs.ext.ExtendedCharsets -> sun.nio.cs.ext.*
-
-# sun.nio.cs.ext.ExtendedCharsets
-@ClassForName(optional)
-  sun.nio.cs.ext.ExtendedCharsets -> sun.nio.cs.ext.*
-
-# public static java.nio.file.spi.FileSystemProvider create()
-@ClassForName
-  sun.nio.fs.DefaultFileSystemProvider -> sun.nio.fs.SolarisFileSystemProvider
-  sun.nio.fs.DefaultFileSystemProvider -> sun.nio.fs.LinuxFileSystemProvider
-
-# sun.rmi.server.MarshalInputStream
-@ClassForName
-  sun.rmi.server.MarshalInputStream -> sun.rmi.server.Activation$ActivationSystemImpl_Stub
-  sun.rmi.server.MarshalInputStream -> sun.rmi.registry.RegistryImpl_Stub
-
-# private java.security.Provider doLoadProvider()
-@ClassForName(optional)
-  sun.security.jca.ProviderConfig -> sun.security.pkcs11.SunPKCS11
-  sun.security.jca.ProviderConfig -> sun.security.provider.Sun
-  sun.security.jca.ProviderConfig -> sun.security.rsa.SunRsaSign
-  sun.security.jca.ProviderConfig -> sun.security.ec.SunEC
-  sun.security.jca.ProviderConfig -> com.sun.net.ssl.internal.ssl.Provider
-  sun.security.jca.ProviderConfig -> com.sun.crypto.provider.SunJCE
-  sun.security.jca.ProviderConfig -> sun.security.jgss.SunProvider
-  sun.security.jca.ProviderConfig -> com.sun.security.sasl.Provider
-  sun.security.jca.ProviderConfig -> org.jcp.xml.dsig.internal.dom.XMLDSigRI
-  sun.security.jca.ProviderConfig -> sun.security.smartcardio.SunPCSC
-  sun.security.jca.ProviderConfig -> sun.security.mscapi.SunMSCAPI
-
-# public static java.security.Provider getSunProvider()
-@ClassForName
-  sun.security.jca.Providers -> sun.security.provider.Sun
-  sun.security.jca.Providers -> sun.security.provider.VerificationProvider
-
-# private static sun.security.jgss.spi.MechanismFactory getMechFactoryImpl(java.security.Provider, java.lang.String, org.ietf.jgss.Oid, sun.security.jgss.GSSCaller)
-@ClassForName
-  sun.security.jgss.ProviderList -> sun.security.jgss.spi.MechanismFactory
-
-# sun.security.jgss.wrapper.SunNativeProvider
-@NativeFindClass
-  sun.security.jgss.wrapper.SunNativeProvider -> org.ietf.jgss.Oid
-  sun.security.jgss.wrapper.SunNativeProvider -> org.ietf.jgss.GSSException
-  sun.security.jgss.wrapper.SunNativeProvider -> sun.security.jgss.wrapper.GSSNameElement
-  sun.security.jgss.wrapper.SunNativeProvider -> sun.security.jgss.wrapper.GSSCredElement
-  sun.security.jgss.wrapper.SunNativeProvider -> sun.security.jgss.wrapper.NativeGSSContext
-  sun.security.jgss.wrapper.SunNativeProvider -> sun.security.jgss.wrapper.SunNativeProvider
-  sun.security.jgss.wrapper.SunNativeProvider -> org.ietf.jgss.MessageProp
-  sun.security.jgss.wrapper.SunNativeProvider -> org.ietf.jgss.ChannelBinding
-  sun.security.jgss.wrapper.SunNativeProvider -> java.net.InetAddress
-  sun.security.jgss.wrapper.SunNativeProvider -> sun.security.jgss.wrapper.GSSLibStub
-
-# static void ensureLoaded()
-@NativeFindClass
-  sun.security.krb5.Credentials -> sun.security.krb5.internal.Krb5
-  sun.security.krb5.Credentials -> sun.security.krb5.internal.Ticket
-  sun.security.krb5.Credentials -> sun.security.krb5.PrincipalName
-  sun.security.krb5.Credentials -> sun.security.util.DerValue
-  sun.security.krb5.Credentials -> sun.security.krb5.EncryptionKey
-  sun.security.krb5.Credentials -> sun.security.krb5.internal.TicketFlags
-  sun.security.krb5.Credentials -> sun.security.krb5.internal.KerberosTime
-
-# public static java.lang.String getDefaultCacheName()
-@ClassForName(optional)
-  sun.security.krb5.internal.ccache.FileCredentialsCache -> com.sun.security.auth.module.UnixSystem
-
-# sun.security.pkcs.PKCS9Attribute
-@ClassForName
-  sun.security.pkcs.PKCS9Attribute -> sun.security.util.ObjectIdentifier
-  sun.security.pkcs.PKCS9Attribute -> java.util.Date
-  sun.security.pkcs.PKCS9Attribute -> sun.security.pkcs.SignerInfo
-  sun.security.pkcs.PKCS9Attribute -> sun.security.x509.CertificateExtensions
-
-# protected T engineGetKeySpec(java.security.Key, java.lang.Class<T>)
-@ClassForName
-  sun.security.provider.DSAKeyFactory -> java.security.spec.DSAPublicKeySpec
-  sun.security.provider.DSAKeyFactory -> java.security.spec.X509EncodedKeySpec
-  sun.security.provider.DSAKeyFactory -> java.security.spec.DSAPrivateKeySpec
-  sun.security.provider.DSAKeyFactory -> java.security.spec.PKCS8EncodedKeySpec
-
-# protected T engineGetParameterSpec(java.lang.Class<T>)
-@ClassForName
-  sun.security.provider.DSAParameters -> java.security.spec.DSAParameterSpec
-
-# sun.security.provider.VerificationProvider
-@ClassForName(optional)
-  sun.security.provider.VerificationProvider -> sun.security.provider.Sun
-  sun.security.provider.VerificationProvider -> sun.security.rsa.SunRsaSign
-
-# sun.security.provider.certpath.URICertStore$LDAP
-@ClassForName(optional)
-  sun.security.provider.certpath.URICertStore$LDAP -> sun.security.provider.certpath.ldap.LDAPCertStoreHelper
-
-# sun.security.smartcardio.PCSC
-@NativeFindClass
-  sun.security.smartcardio.PCSC -> sun.security.smartcardio.PCSCException
-
-# sun.security.ssl.HandshakeMessage
-@ClassForName
-  sun.security.ssl.HandshakeMessage -> java.security.MessageDigest$Delegate
-
-# sun.security.ssl.JsseJce
-@ClassForName(optional)
-  sun.security.ssl.JsseJce -> sun.security.krb5.PrincipalName
-
-# sun.security.x509.OIDMap$OIDInfo
-@ClassForName
-  sun.security.x509.OIDMap$OIDInfo -> sun.security.x509.SubjectKeyIdentifierExtension
-  sun.security.x509.OIDMap$OIDInfo -> sun.security.x509.KeyUsageExtension
-  sun.security.x509.OIDMap$OIDInfo -> sun.security.x509.PrivateKeyUsageExtension
-  sun.security.x509.OIDMap$OIDInfo -> sun.security.x509.SubjectAlternativeNameExtension
-  sun.security.x509.OIDMap$OIDInfo -> sun.security.x509.IssuerAlternativeNameExtension
-  sun.security.x509.OIDMap$OIDInfo -> sun.security.x509.BasicConstraintsExtension
-  sun.security.x509.OIDMap$OIDInfo -> sun.security.x509.CRLNumberExtension
-  sun.security.x509.OIDMap$OIDInfo -> sun.security.x509.CRLReasonCodeExtension
-  sun.security.x509.OIDMap$OIDInfo -> sun.security.x509.NameConstraintsExtension
-  sun.security.x509.OIDMap$OIDInfo -> sun.security.x509.PolicyMappingsExtension
-  sun.security.x509.OIDMap$OIDInfo -> sun.security.x509.AuthorityKeyIdentifierExtension
-  sun.security.x509.OIDMap$OIDInfo -> sun.security.x509.PolicyConstraintsExtension
-  sun.security.x509.OIDMap$OIDInfo -> sun.security.x509.NetscapeCertTypeExtension
-  sun.security.x509.OIDMap$OIDInfo -> sun.security.x509.CertificatePoliciesExtension
-  sun.security.x509.OIDMap$OIDInfo -> sun.security.x509.ExtendedKeyUsageExtension
-  sun.security.x509.OIDMap$OIDInfo -> sun.security.x509.InhibitAnyPolicyExtension
-  sun.security.x509.OIDMap$OIDInfo -> sun.security.x509.CRLDistributionPointsExtension
-  sun.security.x509.OIDMap$OIDInfo -> sun.security.x509.CertificateIssuerExtension
-  sun.security.x509.OIDMap$OIDInfo -> sun.security.x509.SubjectInfoAccessExtension
-  sun.security.x509.OIDMap$OIDInfo -> sun.security.x509.AuthorityInfoAccessExtension
-  sun.security.x509.OIDMap$OIDInfo -> sun.security.x509.IssuingDistributionPointExtension
-  sun.security.x509.OIDMap$OIDInfo -> sun.security.x509.DeltaCRLIndicatorExtension
-  sun.security.x509.OIDMap$OIDInfo -> sun.security.x509.FreshestCRLExtension
-  sun.security.x509.OIDMap$OIDInfo -> sun.security.x509.OCSPNoCheckExtension
-
-# sun.util.LocaleServiceProviderPool$AllAvailableLocales
-@Provider
-  sun.util.LocaleServiceProviderPool$AllAvailableLocales -> META-INF/services/java.text.spi.BreakIteratorProvider
-  sun.util.LocaleServiceProviderPool$AllAvailableLocales -> META-INF/services/java.text.spi.CollatorProvider
-  sun.util.LocaleServiceProviderPool$AllAvailableLocales -> META-INF/services/java.text.spi.DateFormatProvider
-  sun.util.LocaleServiceProviderPool$AllAvailableLocales -> META-INF/services/java.text.spi.DateFormatSymbolsProvider
-  sun.util.LocaleServiceProviderPool$AllAvailableLocales -> META-INF/services/java.text.spi.DecimalFormatSymbolsProvider
-  sun.util.LocaleServiceProviderPool$AllAvailableLocales -> META-INF/services/java.text.spi.NumberFormatProvider
-  sun.util.LocaleServiceProviderPool$AllAvailableLocales -> META-INF/services/java.util.spi.CurrencyNameProvider
-  sun.util.LocaleServiceProviderPool$AllAvailableLocales -> META-INF/services/java.util.spi.LocaleNameProvider
-  sun.util.LocaleServiceProviderPool$AllAvailableLocales -> META-INF/services/java.util.spi.TimeZoneNameProvider
-
-# private static final java.lang.String[] retrieveDisplayNames(sun.util.resources.OpenListResourceBundle, java.lang.String, java.util.Locale)
-@Provider
-  sun.util.TimeZoneNameUtility -> META-INF/services/java.util.spi.TimeZoneNamePProvider
-
-# public static sun.util.calendar.CalendarSystem forName(java.lang.String)
-@ClassForName
-  sun.util.calendar.CalendarSystem -> sun.util.calendar.Gregorian
-  sun.util.calendar.CalendarSystem -> sun.util.calendar.LocalGregorianCalendar
-  sun.util.calendar.CalendarSystem -> sun.util.calendar.JulianCalendar
-
-# sun.util.logging.LoggingSupport
-@ClassForName(optional)
-  sun.util.logging.LoggingSupport -> java.util.logging.LoggingProxyImpl
--- a/jdk/make/modules/modules.config	Tue Mar 15 19:52:42 2011 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,928 +0,0 @@
-/*
- * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-// These classes are not referenced in the JDK but we can't
-// remove them for compatibility reason.  Define this module
-// first so that other modules don't need to exclude these clases
-module private-legacy {
-    include sun.misc.Cache*,
-            sun.misc.ClassLoaderUtil,
-            sun.misc.Compare,
-            sun.misc.ConditionLock,
-            sun.misc.CRC16,
-            sun.misc.Lock,
-            sun.misc.Regexp,
-            sun.misc.RequestProcessor,
-            sun.misc.Sort,
-            sun.misc.Request,
-            sun.misc.Timeable,
-            sun.misc.Timer,
-            sun.misc.TimerThread,
-            sun.misc.TimerTickThread,
-            sun.misc.UCDecoder,
-            sun.misc.UCEncoder,
-            sun.misc.UUDecoder,
-            sun.misc.UUEncoder,
-            com.sun.net.ssl.SSLContext,
-            sun.net.NetworkServer,
-            sun.net.URLCanonicalizer,
-            sun.reflect.misc.ConstructorUtil,
-            sun.reflect.FieldInfo,
-            sun.reflect.SignatureIterator,
-            sun.reflect.generics.reflectiveObjects.NotImplementedException,
-            sunw.io.Serializable,
-            sunw.util.EventListener,
-            sunw.util.EventObject;
-}
-
-// Deprecated classes that aren't referenced/used go here.
-module deprecated {
-    // add deprecated security classes once b78 is promoted
-}
-
-/**************************************************************************/
-
-module base {
-    // core classes
-    include java.lang.*,
-            java.lang.annotation.*,
-            java.lang.ref.*,
-            java.lang.reflect.*,
-            java.math.*,
-            java.net.*,
-            java.util.*,
-            java.util.concurrent.**,
-            java.util.jar.*,
-            java.util.regex.*,
-            java.util.spi.*,
-            java.util.zip.*,
-            java.text.**;
-
-    exclude java.util.jar.Pack200*,
-            java.util.XMLUtils,
-            java.text.Bidi;
-
-    include java.io.*, java.nio.*, java.nio.charset.**;
-    exclude java.io.TempFileHelper, java.nio.BufferPoolMXBean;
-
-    // security APIs
-    // javax.crypto and javax.security.auth are included to avoid inconsistent
-    // spliting of JCA and JAAS. This adds about 85k. Also note that some deprecated
-    // classes must be included for now (see 6876158, 6876170)
-    include java.security.*,
-            java.security.cert.*,
-            java.security.interfaces.*,
-            java.security.spec.*,
-            javax.security.auth.**,
-            javax.crypto.**;
-
-    // Sun and RSA security providers (except LDAP CertStore)
-    // roots sun.security.provider.* sun.security.provider.certpath.* sun.security.rsa.*
-    include com.sun.security.auth.PrincipalComparator,
-            com.sun.security.auth.SubjectCodeSource,
-            com.sun.security.auth.login.**,
-            com.sun.security.auth.Policy*,
-            sun.security.action.*,
-            sun.security.ec.*,
-            sun.security.jca.*,
-            sun.security.pkcs.*,
-            sun.security.provider.*,
-            sun.security.provider.certpath.*,
-            sun.security.rsa.*,
-            sun.security.util.*,
-            sun.security.validator.*,
-            sun.security.x509.*,
-            sun.security.timestamp.*;
-
-    // this list is based on the classlist generated from the rootset
-    // need investigation
-    exclude sun.security.ec.ECD*,
-            sun.security.ec.ECKeyPairGenerator,
-            sun.security.ec.SunEC*,
-            sun.security.pkcs.PKCS10*,
-            sun.security.pkcs.EncodingException,
-            sun.security.util.AuthResources_*,
-            sun.security.util.Resources_*,
-            sun.security.util.BigInt,
-            sun.security.util.HostnameChecker,
-            sun.security.x509.CertAndKeyGen,
-            sun.security.util.PathList;
-
-    // Kerberos not needed
-    exclude javax.security.auth.kerberos.**,
-            sun.security.jgss.**,
-            sun.security.krb5.**,
-            sun.security.ssl.Kerberos*,
-            org.ietf.jgss.**;
-
-   // property events and annotations
-   include java.beans.ChangeListenerMap,
-           java.beans.IndexedPropertyChangeEvent,
-           java.beans.PropertyChange*,
-           java.beans.PropertyVetoException,
-           java.beans.VetoableChange*,
-           java.beans.ConstructorProperties;
-
-    // mandatory charsets
-    include sun.nio.cs.*;
-
-    exclude sun.nio.cs.AbstractCharsetProvider,
-            sun.nio.cs.CharsetMapping,
-            sun.nio.cs.IBM*,
-            sun.nio.cs.ISO*,
-            sun.nio.cs.KOI8_*,
-            sun.nio.cs.MS125*,
-            sun.nio.cs.UTF_32*,
-            sun.nio.cs.SingleByteDecoder,
-            sun.nio.cs.SingleByteEncoder;
-
-    allow   sun.nio.cs.ISO_8859_1,
-            sun.nio.cs.ISO_8859_15,
-            sun.nio.cs.MS1252;
-
-    include sun.text.*,
-            sun.text.normalizer.*;
-
-    // resource files
-    include sun/text/resources/*.icu;
-
-    exclude sun.text.bidi.*,
-            sun.text.CharArrayCodePointIterator,
-            sun.text.CharSequenceCodePointIterator,
-            sun.text.CharacterIteratorCodePointIterator,
-            sun.text.CodePointIterator;
-
-    include sun.util.*,
-            sun.util.calendar.*,
-            sun.util.logging.*,
-            sun.util.resources.LocaleData,
-            sun.util.resources.LocaleNamesBundle,
-            sun.util.resources.OpenListResourceBundle;
-
-    // US_en locale
-    include sun.text.resources.BreakIteratorInfo,
-            sun.text.resources.FormatData,
-            sun.text.resources.FormatData_en_US,
-            sun.util.resources.CalendarData,
-            sun.util.resources.CalendarData_en,
-            sun.util.resources.TimeZoneNames,
-            sun.util.resources.TimeZoneNames_en,
-            sun.util.resources.TimeZoneNamesBundle,
-            sun.util.resources.LocaleNames,
-            sun.util.resources.LocaleNames_en,
-            sun.util.resources.LocalenamesBundles,
-            sun.util.resources.CurrencyNames,
-            sun.util.resources.CurrencyNames_en_US,
-            sun.util.EmptyListResourceBundle;
-
-    // resources file needed by
-    // - sun.misc.ExtensionInfo
-    // - sun.security.provider.PolicyFile
-    // - com.sun.security.auth.PolicyFile
-    include sun.misc.resources.Messages,
-            sun.security.util.Resources,
-            sun.security.util.AuthResources;
-
-    // java.nio.channels and java.nio.file not in base
-    include sun.nio.ch.Interruptible,
-            sun.nio.ch.DirectBuffer,
-            sun.nio.ByteBuffered;
-
-    include sun.reflect.**;
-
-    // protocol handlers
-    include sun.net.www.protocol.file.*,
-            sun.net.www.protocol.jar.*,
-            sun.net.www.protocol.http.*;
-
-    include sun.net.*,
-            sun.net.spi.*,
-            sun.net.idn.*,
-            sun.net.util.*,
-            sun.net.www.*,
-            sun.net.www.http.*,
-            sun.net.spi.nameservice.*;
-
-    // resource file for sun.net.idn
-    include sun/net/idn/*;
-
-    // classes in net-compat
-    exclude sun.net.Telnet*, sun.net.TransferProtocolClient;
-
-    // classes in deploy
-    exclude sun.net.www.protocol.http.AuthCacheBridge;
-
-    // classes in security-jsse
-    exclude java.net.SecureCacheResponse;
-
-    // launcher
-    include sun.launcher.LauncherHelper, sun.launcher.resources.launcher;
-
-    include sun.misc.*;
-    exclude sun.misc.FIFOQueueEnumerator,
-            sun.misc.LIFOQueueEnumerator,
-            sun.misc.GC,
-            sun.misc.PerformanceLogger,
-            sun.misc.Queue,
-            sun.misc.QueueElement,
-            sun.misc.Ref,
-            sun.misc.VMSupport;
-
-    // On Windows, OSEnvironment dependency
-    include sun.io.Win32ErrorMode;
-}
-
-/**************************************************************************/
-
-module charsets {
-    include sun.nio.cs.ext.**;
-
-    include sun.nio.cs.AbstractCharsetProvider,
-            sun.nio.cs.CharsetMapping,
-            sun.nio.cs.IBM*,
-            sun.nio.cs.ISO*,
-            sun.nio.cs.KOI8_*,
-            sun.nio.cs.MS125*,
-            sun.nio.cs.SingleByte*,
-            sun.nio.cs.UTF_32*;
-
-    exclude sun.nio.cs.ISO_8859_1,
-            sun.nio.cs.MS1252;
-
-    // legacy sun.io converters
-    include sun.io.*;
-}
-
-/**************************************************************************/
-
-// For now, retains the current JRE extensions where localedata.jar in jre/lib/ext 
-module localedata {
-    include sun.util.resources.*_ar,
-            sun.util.resources.*_ar_*,
-            sun.util.resources.*_hi,
-            sun.util.resources.*_hi_*,
-            sun.util.resources.*_iw,
-            sun.util.resources.*_iw_*,
-            sun.util.resources.*_ja,
-            sun.util.resources.*_ja_*,
-            sun.util.resources.*_ko,
-            sun.util.resources.*_ko_*,
-            sun.util.resources.*_th,
-            sun.util.resources.*_th_*,
-            sun.util.resources.*_vi,
-            sun.util.resources.*_vi_*,
-            sun.util.resources.*_zh,
-            sun.util.resources.*_zh_*;
-    include sun.text.resources.*_ar,
-            sun.text.resources.*_ar_*,
-            sun.text.resources.*_hi,
-            sun.text.resources.*_hi_*,
-            sun.text.resources.*_iw,
-            sun.text.resources.*_iw_*,
-            sun.text.resources.*_ja,
-            sun.text.resources.*_ja_*,
-            sun.text.resources.*_ko,
-            sun.text.resources.*_ko_*,
-            sun.text.resources.*_th,
-            sun.text.resources.*_th_*,
-            sun.text.resources.*_vi,
-            sun.text.resources.*_vi_*,
-            sun.text.resources.*_zh,
-            sun.text.resources.*_zh_*;
-}
-
-module resources {
-    include sun.text.resources.*, sun.util.resources.*, sun.misc.resources.*;
-}
-
-/**************************************************************************/
-
-module nio {
-    include java.nio.channels.**, java.nio.file.**, com.sun.nio.file.**;
-
-    // this is excluded from base
-    include java.io.TempFileHelper;
-
-    // provider implementations and their dependencies
-    include sun.nio.ch.*, sun.nio.fs.**;
-    exclude sun.nio.ch.Sctp*;
-}
-
-/**************************************************************************/
-
-module pack200 {
-    include java.util.jar.Pack200*, com.sun.java.util.jar.pack.**;
-}
-
-/**************************************************************************/
-
-module logging {
-    include java.util.logging.*, sun.util.logging.**;
-    exclude java.util.logging.PlatformLoggingMXBean;
-
-    // Formatter for HTTP messages
-    include sun.net.www.protocol.http.logging.*;
-}
-
-/**************************************************************************/
-
-module management-snmp {
-    include com.sun.jmx.snmp.**, sun.management.snmp.**;
-}
-
-module management-iiop {
-    include com.sun.jmx.remote.protocol.iiop.*;
-
-    // stubs and ties
-    include javax.management.remote.rmi._*,
-            org.omg.stub.javax.management.remote.rmi.**;
-}
-
-module management {
-    include java.lang.management.*, com.sun.management.**, sun.management.**;
-    include javax.management.**, com.sun.jmx.**;
-
-    // other management interfaces
-    include java.nio.BufferPoolMXBean;
-    include java.util.logging.PlatformLoggingMXBean;
-
-    // supporting classes in sun.misc
-    include sun.misc.VMSupport;
-}
-
-/**************************************************************************/
-
-module tracing {
-    // tracing
-    include com.sun.tracing.**, sun.tracing.**;
-}
-
-module instrument {
-    // java.lang.instrument
-    include java.lang.instrument.*, sun.instrument.*;
-
-    // HPROF support
-    include com.sun.demo.jvmti.hprof.*;
-
-    include tracing;
-}
-
-/**************************************************************************/
-
-module rmi-activation {
-    include java.rmi.activation.**,
-            sun.rmi.server.Act*,
-            sun.rmi.server.InactiveGroupException;
-}
-
-module rmic {
-    // rmic is included in tools
-    include sun.rmi.rmic.**;
-}
-
-module rmi {
-    include java.rmi.**, sun.rmi.**, com.sun.rmi.**;
-
-    // SSL factories are in rmi
-    include javax.rmi.ssl.**;
-
-    // supporting classes in sun.misc and dependencies
-    include sun.misc.GC;
-}
-
-/**************************************************************************/
-
-module prefs {
-    include java.util.prefs.*;
-}
-
-/**************************************************************************/
-
-module security-jsse {
-    include javax.net.**,
-            javax.security.cert.*,
-            java.net.SecureCacheResponse,
-            com.sun.net.ssl.**,
-            com.sun.security.cert.internal.x509.*,
-            sun.security.ssl.*,
-            sun.net.www.protocol.https.**,
-            sun.security.internal.interfaces.Tls*,
-            sun.security.internal.spec.Tls*,
-            sun.security.util.HostnameChecker;
-}
-
-module security-sunpkcs11 {
-    include sun.security.pkcs11.**;
-}
-
-module security-sunjce {
-    include com.sun.crypto.provider.*;
-}
-
-module security-sunec {
-    include sun.security.ec.*;
-}
-
-module security-sunmscapi {
-    include sun.security.mscapi.*;
-}
-
-module security-kerberos {
-    include javax.security.auth.kerberos.*,
-            com.sun.security.jgss.**,
-            com.sun.security.auth.module.Krb5LoginModule,
-            com.sun.security.sasl.gsskerb.**,             // GSSAPI SASL mechanism
-            sun.security.jgss.**,
-            sun.security.ssl.krb5.**,
-            sun.security.krb5.**,
-            org.ietf.jgss.**,
-            sun.net.www.protocol.http.spnego.*;
-}
-
-module security-sasl {
-    include javax.security.sasl.**,
-            com.sun.security.sasl.**;
-}
-
-module security-xmldsig {
-    include javax.xml.crypto.**,
-            org.jcp.xml.dsig.**,
-            com.sun.org.apache.xml.internal.security.**;
-}
-
-module security-smartcardio {
-    include javax.smartcardio.**, sun.security.smartcardio.**;
-}
-
-module security-auth {
-    include com.sun.security.auth.**, sun.security.util.AuthResources_*;
-}
-
-module security-misc {
-    include security-auth;
-
-    include sun.security.pkcs.*,
-            sun.security.pkcs12.*;
-
-    // this class is a candidate to be removed.
-    include sun.security.util.BigInt;
-}
-
-module security-resources {
-    include sun.security.util.Resources_*;
-}
-
-module security-compat {
-    include java.security.acl.*, sun.security.acl.*;
-}
-
-/**************************************************************************/
-
-module jndi-ldap {
-    include javax.naming.ldap.**,
-            com.sun.jndi.ldap.**,
-            com.sun.jndi.url.ldap.*,
-            com.sun.jndi.url.ldaps.*,
-            sun.security.provider.certpath.ldap.**;
-}
-
-module jndi-rmiregistry {
-    include com.sun.jndi.rmi.**, com.sun.jndi.url.rmi.**;
-}
-
-module jndi-dns {
-    include net-dns;
-    include com.sun.jndi.dns.**, com.sun.jndi.url.dns.**;
-}
-
-module jndi-cosnaming {
-    include com.sun.jndi.cosnaming.**,
-            com.sun.jndi.toolkit.corba.**,
-            com.sun.jndi.url.corbaname.**,
-            com.sun.jndi.url.iiop.**,
-            com.sun.jndi.url.iiopname.**;
-}
-
-// framework/API and classes used by providers
-module jndi {
-    include javax.naming.**,
-            com.sun.naming.**,
-            com.sun.jndi.toolkit.ctx.**,
-            com.sun.jndi.toolkit.dir.**,
-            com.sun.jndi.toolkit.url.**;
-}
-
-/**************************************************************************/
-
-module jdbc-base {
-    include java.sql.**, javax.sql.*;
-    exclude javax.sql.XA*;
-}
-
-module jdbc-enterprise {
-    include javax.sql.**, com.sun.rowset.**;
-}
-
-module jdbc-odbc {
-    include sun.jdbc.odbc.**;
-}
-
-/**************************************************************************/
-
-module scripting {
-    include javax.script.**;
-
-    // supporting classes for scripting engines
-    include com.sun.script.util.**;
-}
-
-module scripting-rhino {
-    include com.sun.script.javascript.**, sun.org.mozilla.javascript.**;
-}
-
-/**************************************************************************/
-
-module httpserver {
-    include com.sun.net.httpserver.**, sun.net.httpserver.**;
-}
-
-/**************************************************************************/
-
-module sctp {
-    // API and dependencies
-    include com.sun.nio.sctp.**, sun.nio.ch.Sctp*;
-}
-
-/**************************************************************************/
-
-module langtools {
-    include javax.tools.**, javax.lang.model.**, javax.annotation.processing.**;
-
-    // include mirror API for now
-    include com.sun.mirror.**;
-
-    // include the JSR292 APIs for now
-    include java.dyn.**, sun.dyn.**;
-}
-
-/**************************************************************************/
-
-module beans {
-    include java.beans.**, com.sun.beans.**, sun.beans.**;
-}
-
-/**************************************************************************/
-
-module jaxp-parsers-api {
-    include javax.xml.*, javax.xml.parsers.**,
-            org.w3c.dom.**, org.w3c.sax.**, org.xml.sax.**;
-}
-
-module jaxp-api {
-    include javax.xml.**;
-    exclude javax.xml.crypto.**,   // XML-DSIG
-            javax.xml.bind.**,     // JAX-WS
-            javax.xml.soap.**,
-            javax.xml.ws.**;
-}
-
-module jaxp-xerces-impl {
-    include com.sun.org.apache.xerces.internal.**;
-
-    // include in xerces-impl due to circular dependencies
-    include com.sun.org.apache.xml.internal.serialize.**,
-            com.sun.xml.internal.stream.**;
-    exclude com.sun.xml.internal.stream.buffer.**;  // JAX-WS
-}
-
-// required by Xerces and JAX-WS
-module jaxp-xerces-resolver {
-    include com.sun.org.apache.xml.internal.resolver.**;
-}
-
-module jaxp-xalan {
-    include com.sun.org.apache.xalan.internal.**,
-            com.sun.org.apache.xpath.internal.**,
-            com.sun.org.apache.xml.internal.dtm.**,
-            com.sun.org.apache.xml.internal.res.**,
-            com.sun.org.apache.xml.internal.serializer.**,
-            com.sun.org.apache.xml.internal.utils.**,
-            com.sun.org.apache.bcel.internal.**,
-            com.sun.org.apache.regexp.internal.**,
-            com.sun.java_cup.internal.**;
-}
-
-/**************************************************************************/
-
-module jaxws-tools {
-    include com.sun.codemodel.**,
-            com.sun.xml.internal.dtdparser.**,
-            com.sun.xml.internal.rngom.**,
-            com.sun.xml.internal.xsom.**,
-            com.sun.istack.internal.tools.**,
-            com.sun.istack.internal.ws.**,
-            com.sun.tools.internal.xjc.**,
-            com.sun.tools.internal.ws.**,
-            com.sun.tools.internal.jxc.**,
-            org.relaxng.datatype.**;
-}
-
-module jaxws {
-    include javax.jws.**,
-            javax.xml.bind.**,
-            javax.xml.soap.**,
-            javax.xml.ws.**,
-            org.relaxng.**,
-            com.sun.istack.internal.*,
-            com.sun.istack.internal.localization.*,
-            com.sun.xml.internal.**;
-
-    // include JAF in this module
-    include javax.activation.**, com.sun.activation.**;
-
-    include META-INF/mailcap.default,
-            META-INF/mimetypes.default;
-}
-
-/**************************************************************************/
-module enterprise-base {
-    include javax.transaction.**,  // JTA
-            javax.annotation.*;    // Common annotations (JSR-250)
-}
-
-/**************************************************************************/
-module corba {
-    include javax.activity.**,
-            javax.rmi.*,
-            javax.rmi.CORBA.*,
-            javax.transaction.**,
-            com.sun.corba.**,
-            com.sun.org.omg.**,
-            org.omg.**,
-            sun.corba.**;
-
-    // JMX remote API
-    exclude org.omg.stub.javax.management.**;
-}
-
-/**************************************************************************/
-
-module applet {
-    include java.applet.**,
-            sun.applet.**;
-}
-
-module awt {
-    include java.awt.**,
-            sun.awt.**,
-            com.sun.awt.**;
-}
-
-module font {
-    include sun.font.**;
-}
-
-module imageio {
-    include javax.imageio.**,
-            com.sun.imageio.**;
-}
-
-module java2d {
-    include sun.dc.**,
-            sun.java2d.**,
-            com.sun.image.**;
-}
-
-module media {
-    include com.sun.media.**;
-}
-
-module print {
-    include javax.print.**,
-            sun.print.**;
-}
-
-module sound {
-    include javax.sound.**;
-}
-
-module swing {
-    include javax.swing.**,
-            sun.swing.**,
-            // sajdi also contains classes in subpackages of com.sun.java.swing;
-            // so use '*' instead of '**' 
-            com.sun.java.swing.*,
-            com.sun.java.swing.plaf.**,
-            com.sun.swing.**;
-}
-
-module client {
-    include applet,
-            awt,
-            font,
-            imageio,
-            java2d,
-            media,
-            print,
-            sound,
-            swing;
-
-    include javax.accessibility.*,
-            sun.audio.**,
-            com.sun.accessibility.**;
-
-    // Bidi class in client module for now
-    include java.text.Bidi, sun.text.bidi.*;
-
-    // PerformanceLogger and dependencies
-    include sun.misc.Ref, sun.misc.PerformanceLogger;
-
-    // misc. dependencies that we need to examine
-    include sun.text.CodePointIterator,
-            sun.text.Char*,
-            sun.misc.Queue*,
-            sun.misc.FIFOQueueEnumerator,
-            sun.misc.LIFOQueueEnumerator;
-
-    // content handlers
-    include sun.net.www.content.audio.**,
-            sun.net.www.content.image.**;
-}
-
-/**************************************************************************/
-
-module deploy {
-
-    // For now, all plugin and JNLP
-    include com.sun.java.browser.**,
-            netscape.**,
-            sun.plugin.**,
-            sun.plugin2.**,,
-            com.sun.deploy.**,
-            com.sun.javaws.**,
-            javax.jnlp.*,
-            com.sun.jnlp.*;
-
-    // Hook for http authentication
-    include sun.net.www.protocol.http.AuthCacheBridge;
-}
-
-/**************************************************************************/
-
-module net-dns {
-    include sun.net.dns.**;                 // to access DNS config.
-    include sun.net.spi.nameservice.dns.**; // for DNS-only name service.
-}
-
-module net-compat {
-    // NTLM authentication support
-    include sun.net.www.protocol.http.ntlm.*;
-
-    // ftp and mail clients
-    include sun.net.ftp.**, sun.net.smtp.**;
-
-    // Legacy protocol handlers
-    include sun.net.www.protocol.**;
-
-    // Legacy content handlers
-    include sun.net.www.content.**;
-
-    include sun.net.Telnet*,
-            sun.net.TransferProtocolClient;
-}
-
-/**************************************************************************/
-
-// jar-tool and security-tools are JRE tools
-module jar-tool {
-    include sun.tools.jar.**;
-}
-
-module policytool {
-    include sun.security.tools.policytool.*;
-}
-
-module security-tools {
-    include sun.security.tools.**;
-
-    // Used by security tools
-    include sun.security.util.PathList, sun.security.x509.CertAndKeyGen;
-
-    exclude sun.security.tools.JarBASE64Encoder,
-            sun.security.tools.JarSigner,
-            sun.security.tools.JarSignerParameters,
-            sun.security.tools.JarSignerResources*,
-            sun.security.tools.SignatureFile,
-            sun.security.tools.TimestampedSigner;
-}
-
-module jconsole {
-    include sun.tools.jconsole.**,
-            com.sun.tools.jconsole.*;
-}
-
-module serialver {
-    include sun.tools.serialver.**;
-}
-
-module gui-tools {
-    include jconsole,
-            serialver;
-
-    include com.sun.tools.example.debug.bdi.**,
-            com.sun.tools.example.debug.gui.**,
-            com.sun.tools.internal.xjc.**;
-}
-
-module attach {
-    include com.sun.tools.attach.**,
-            sun.tools.attach.**;
-}
-
-module debugging {
-    include com.sun.jdi.**, com.sun.tools.jdi.**;
-}
-
-module jdb {
-    include com.sun.tools.example.debug.**;
-}
-
-module sajdi {
-    include sun.jvm.hotspot.**,
-            com.sun.java.swing.ui.**,
-            com.sun.java.swing.action.**;
-
-    include toolbarButtonGraphics/**;
-    include sa.properties;
-}
-
-module tools {
-    include attach,
-            debugging,
-            jaxws-tools,
-            jdb,
-            rmic,
-            sajdi;
-
-    // include gui-tools in tools module unless the tool binaries
-    // are modified to load the new gui-tools.jar
-    include gui-tools;
-
-    include com.sun.tools.**, sun.tools.**, sun.security.tools.**,
-            com.sun.jarsigner.**,
-            com.sun.javac.**,
-            com.sun.javadoc.**, com.sun.source.**,
-            sun.jvmstat.**;
-}
-
-/**************************************************************************/
-
-module servicetag {
-    include com.sun.servicetag.**;
-}
-
-/**************************************************************************/
-
-// these classes will be removed from JRE - see 6909002
-module inputmethods-ext {
-    include com.sun.inputmethods.internal.**;
-}
-
-/**************************************************************************/
-
-// Workaround for US export and local policy files 
-// They are currently in signed jars under the jre/lib/security directory
-module US_export_policy {
-    include default_US_export.policy;
-}
-
-module local_policy {
-    include default_local.policy,
-            exempt_local.policy;
-}
-
-/**************************************************************************/
-
-module other {
-    include **;
-}
--- a/jdk/make/modules/modules.group	Tue Mar 15 19:52:42 2011 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +0,0 @@
-/*
- * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * Example:
- *    module jdbc {
- *        include jdbc-base, jdbc-enterprise, jdbc-odbc;
- *    }
- */
--- a/jdk/make/modules/optional.depconfig	Tue Mar 15 19:52:42 2011 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,149 +0,0 @@
-#
-# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.  Oracle designates this
-# particular file as subject to the "Classpath" exception as provided
-# by Oracle in the LICENSE file that accompanied this code.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-
-# public final java.nio.channels.SocketChannel getChannel()
-@Optional
-  sun.security.ssl.BaseSSLSocketImpl -> java.nio.channels.SocketChannel
-
-# public XMLDecoder(java.io.InputStream)
-# public XMLDecoder(java.io.InputStream, java.lang.Object)
-# public XMLDecoder(java.io.InputStream, java.lang.Object, java.beans.ExceptionListener)
-# public XMLDecoder(java.io.InputStream, java.lang.Object, java.beans.ExceptionListener, java.lang.ClassLoader)
-# public XMLDecoder(org.xml.sax.InputSource)
-@Optional
-  java.beans.XMLDecoder -> com.sun.beans.decoder.DocumentHandler
-  java.beans.XMLDecoder -> org.xml.sax.InputSource
-
-# public static org.xml.sax.helpers.DefaultHandler createHandler(java.lang.Object, java.beans.ExceptionListener, java.lang.ClassLoader)
-@Optional
-  java.beans.XMLDecoder -> com.sun.beans.decoder.DocumentHandler
-  java.beans.XMLDecoder -> org.xml.sax.helpers.DefaultHandler
-
-# public final java.nio.channels.FileChannel getChannel()
-@Optional
-  java.net.SocketInputStream -> java.nio.channels.FileChannel
-
-# public final java.nio.channels.FileChannel getChannel()
-@Optional
-  java.net.SocketOutputStream -> java.nio.channels.FileChannel
-
-# public Scanner(java.io.File)
-# public Scanner(java.io.File, java.lang.String)
-@Optional
-  java.util.Scanner -> java.nio.channels.ReadableByteChannel
-  java.util.Scanner -> java.nio.channels.Channels
-
-# public Scanner(java.nio.file.FileRef)
-# public Scanner(java.nio.file.FileRef, java.lang.String)
-@Optional
-  java.util.Scanner -> java.nio.file.FileRef
-  java.util.Scanner -> java.nio.file.OpenOption
-
-# public Scanner(java.nio.channels.ReadableByteChannel)
-# public Scanner(java.nio.channels.ReadableByteChannel, java.lang.String)
-@Optional
-  java.util.Scanner -> java.nio.channels.ReadableByteChannel
-  java.util.Scanner -> java.nio.channels.Channels
-
-# private static void loadSnmpAgent(java.lang.String, java.util.Properties)
-@Optional
-  sun.management.Agent -> sun.management.snmp.AdaptorBootstrap
-
-# public void connect()
-@Optional
-  sun.net.www.protocol.http.HttpURLConnection -> java.net.SecureCacheResponse
-
-# private static sun.security.util.PermissionFactory<?> permissionFactory()
-@Optional
-  sun.security.util.SecurityConstants$AWT -> sun.awt.AWTPermissionFactory
-
-# sun.util.logging.LoggingSupport
-@Optional
-  sun.util.logging.LoggingSupport -> java.util.logging.LoggingProxyImpl
-
-# public java.nio.channels.DatagramChannel getChannel()
-@Optional
-  java.net.DatagramSocket -> java.nio.channels.DatagramChannel
-
-# public java.nio.channels.SocketChannel getChannel()
-@Optional
-  java.net.Socket -> java.nio.channels.SocketChannel
-
-# public java.nio.channels.ServerSocketChannel getChannel()
-@Optional
-  java.net.ServerSocket -> java.nio.channels.ServerSocketChannel
-
-# public final java.nio.channels.FileChannel getChannel()
-@Optional
-  java.io.RandomAccessFile -> java.nio.channels.FileChannel
-  java.io.RandomAccessFile -> sun.nio.ch.FileChannelImpl
-
-# public static sun.nio.cs.StreamDecoder forDecoder(java.nio.channels.ReadableByteChannel, java.nio.charset.CharsetDecoder, int)
-@Optional
-  sun.nio.cs.StreamDecoder -> java.nio.channels.ReadableByteChannel
-
-# private static java.nio.channels.FileChannel getChannel(java.io.FileInputStream)
-# StreamDecoder(java.io.InputStream, java.lang.Object, java.nio.charset.CharsetDecoder)
-@Optional
-  sun.nio.cs.StreamDecoder -> java.nio.channels.FileChannel
-
-# StreamDecoder(java.nio.channels.ReadableByteChannel, java.nio.charset.CharsetDecoder, int)
-@Optional
-  sun.nio.cs.StreamDecoder -> java.nio.channels.ReadableByteChannel
-
-# public static java.io.File createTemporaryFile(java.lang.String, java.lang.String, java.nio.file.attribute.FileAttribute<?>[])
-@Optional
-  java.io.File -> java.io.TempFileHelper
-  java.io.File -> java.nio.file.attribute.FileAttribute
-
-# public java.nio.file.Path toPath()
-@Optional
-  java.io.File -> java.nio.file.Paths
-  java.io.File -> java.nio.file.Path
-
-# public static sun.nio.cs.StreamEncoder forEncoder(java.nio.channels.WritableByteChannel, java.nio.charset.CharsetEncoder, int)
-# private StreamEncoder(java.nio.channels.WritableByteChannel, java.nio.charset.CharsetEncoder, int)
-@Optional
-  sun.nio.cs.StreamEncoder -> java.nio.channels.WritableByteChannel
-
-# public java.nio.channels.FileChannel getChannel()
-@Optional
-  java.io.FileOutputStream -> java.nio.channels.FileChannel
-  java.io.FileOutputStream -> sun.nio.ch.FileChannelImpl
-
-# public java.nio.channels.FileChannel getChannel()
-@Optional
-  java.io.FileInputStream -> java.nio.channels.FileChannel
-  java.io.FileInputStream -> sun.nio.ch.FileChannelImpl
-
-# public void loadFromXML(java.io.InputStream)
-# public void storeToXML(java.io.OutputStream, java.lang.String, java.lang.String)
-@Optional
-  java.util.Properties -> java.util.XMLUtils
-
-# public static java.nio.channels.Channel inheritedChannel()
-@Optional
-  java.lang.System -> java.nio.channels.Channel
-  java.lang.System -> java.nio.channels.spi.SelectorProvider
--- a/jdk/make/modules/tools/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,154 +0,0 @@
-#
-# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.  Oracle designates this
-# particular file as subject to the "Classpath" exception as provided
-# by Oracle in the LICENSE file that accompanied this code.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-
-#
-# Makefile for building the classanalyzer tool
-#
-
-BUILDDIR = ../..
-include $(BUILDDIR)/common/Defs.gmk
-
-PKGDIR = com/sun/classanalyzer
-BUILDTOOL_SOURCE_ROOT = src
-BUILDTOOL_MAIN        = $(PKGDIR)/ClassAnalyzer.java
-BUILTTOOL_MAINCLASS   = $(subst /,.,$(BUILDTOOL_MAIN:%.java=%))
-
-BUILDTOOL_MAIN_SOURCE_FILE = $(BUILDTOOL_SOURCE_ROOT)/$(BUILDTOOL_MAIN)
-BUILDTOOL_MANIFEST_FILE    = $(BUILDTOOLCLASSDIR)/classanalyzer_manifest.mf
-
-FILES_java := $(shell $(CD) $(BUILDTOOL_SOURCE_ROOT) \
-    && $(FIND) $(PKGDIR) -type f -print)
-
-FILES_class = $(FILES_java:%.java=$(BUILDTOOLCLASSDIR)/%.class)
-
-CLASSANALYZER_JAR_FILE     = $(BUILDTOOLJARDIR)/classanalyzer.jar
-
-#
-# ClassAnalyzer depends on the com.sun.tools.classfile API.
-# The tool is compiled with the latest version of the classfile 
-# library in the langtools repo to make sure that synchronized
-# change is made if the classfile API is changed. 
-#
-# If langtools repo exists, build its own copy of the
-# classfile library and use it for compile time and runtime.
-# If not exist (the top level repo is not a forest), use 
-# the built jdk tools that imports tools.jar from the latest
-# promoted build.
-#
-# If the classfile API is changed but not yet in a promoted build,
-# the build might fail and the tool would need the langtools repo
-# to build in that case.
-#
-ifndef LANGTOOLS_TOPDIR
-  LANGTOOLS_TOPDIR=$(JDK_TOPDIR)/../langtools
-endif
-
-LANGTOOLS_TOPDIR_EXISTS := $(shell \
-  if [ -d $(LANGTOOLS_TOPDIR) ] ; then \
-    echo true; \
-  else \
-    echo false; \
-  fi)
-
-CLASSFILE_SRC = $(LANGTOOLS_TOPDIR)/src/share/classes
-CLASSFILE_PKGDIR = com/sun/tools/classfile
-
-ifeq ($(LANGTOOLS_TOPDIR_EXISTS), true)
-  FILES_classfile_java := $(shell \
-       $(CD) $(CLASSFILE_SRC) && \
-           $(FIND) $(CLASSFILE_PKGDIR) -name '*.java' -print)
-  FILES_classfile_class = $(FILES_classfile_java:%.java=$(BUILDTOOLCLASSDIR)/%.class)
-  CLASSFILE_JAR_FILE = $(BUILDTOOLJARDIR)/classfile.jar
-  BUILDTOOL_JAVAC    = $(BOOT_JAVAC_CMD) $(JAVAC_JVM_FLAGS) \
-                          $(BOOT_JAVACFLAGS) -classpath $(CLASSFILE_JAR_FILE)
-  BUILDTOOL_JAVA     = $(BOOT_JAVA_CMD) $(JAVA_TOOLS_FLAGS) \
-                          -Xbootclasspath/p:$(CLASSFILE_JAR_FILE)
-else
-  # if langtools doesn't exist, use tools from the built jdk
-  BUILDTOOL_JAVAC = $(BINDIR)/javac $(JAVAC_JVM_FLAGS) \
-                       $(BOOT_JAVACFLAGS)
-  BUILDTOOL_JAVA  = $(BINDIR)/java $(JAVA_TOOLS_FLAGS)
-endif
-
-# Location of the output modules.list, <module>.classlist
-# and other output files generated by the class analyzer tool.
-#
-MODULE_CLASSLIST = $(MODULES_TEMPDIR)/classlist
-
-all build: classanalyzer gen-classlist
-
-classanalyzer: $(CLASSFILE_JAR_FILE) $(CLASSANALYZER_JAR_FILE) 
-
-gen-classlist:
-	@$(ECHO) ">>>Making "$@" @ `$(DATE)` ..."
-	@$(RM) -rf $(MODULE_CLASSLIST)
-	@$(MKDIR) -p $(MODULE_CLASSLIST)
-	$(BUILDTOOL_JAVA) \
-                -Dclassanalyzer.debug \
-                -jar $(CLASSANALYZER_JAR_FILE) \
-                -jdkhome $(OUTPUTDIR) \
-                -config ../modules.config \
-                -config ../modules.group \
-                -depconfig ../jdk7.depconfig \
-                -depconfig ../optional.depconfig \
-                -showdynamic \
-                -output $(MODULE_CLASSLIST)
-	@$(ECHO) ">>>Finished making "$@" @ `$(DATE)` ..."
-
-$(BUILDTOOL_MANIFEST_FILE): $(BUILDTOOL_MAIN_SOURCE_FILE)
-	@$(prep-target)
-	$(ECHO) "Main-Class: $(BUILTTOOL_MAINCLASS)" > $@
-
-$(BUILDTOOLCLASSDIR)/$(CLASSFILE_PKGDIR)/%.class : $(CLASSFILE_SRC)/$(CLASSFILE_PKGDIR)/%.java
-	@$(prep-target)
-	@$(BUILDTOOL_JAVAC) \
-            -sourcepath $(CLASSFILE_SRC) \
-            -d $(BUILDTOOLCLASSDIR) $<
-
-$(BUILDTOOLCLASSDIR)/%.class : $(BUILDTOOL_SOURCE_ROOT)/%.java
-	@$(prep-target)
-	$(BUILDTOOL_JAVAC) \
-            -sourcepath $(BUILDTOOL_SOURCE_ROOT) \
-            -d $(BUILDTOOLCLASSDIR) $<
-
-$(CLASSANALYZER_JAR_FILE): $(BUILDTOOL_MANIFEST_FILE) $(FILES_class)
-	@$(prep-target)
-	$(BOOT_JAR_CMD) cfm $@ $(BUILDTOOL_MANIFEST_FILE) \
-	    -C $(BUILDTOOLCLASSDIR) $(PKGDIR) $(BOOT_JAR_JFLAGS) || $(RM) $@
-	@$(java-vm-cleanup)
-
-$(BUILDTOOLJARDIR)/classfile.jar: $(FILES_classfile_class)
-	@$(prep-target)
-	$(CD) $(BUILDTOOLCLASSDIR) && \
-	    $(BOOT_JAR_CMD) cf $@ \
-	        $(CLASSFILE_PKGDIR) $(BOOT_JAR_JFLAGS) || $(RM) $@
-	@$(java-vm-cleanup)
-
-clean clobber::
-	@$(RM) -rf $(BUILDTOOLCLASSDIR)/$(PKGDIR)
-	@$(RM) -rf $(BUILDTOOLCLASSDIR)/$(CLASSFILE_PKGDIR)
-	@$(RM) $(BUILDTOOL_MANIFEST_FILE)
-	@$(RM) $(CLASSANALYZER_JAR_FILE)
-	@$(RM) $(CLASSFILE_JAR_FILE)
--- a/jdk/make/modules/tools/build.xml	Tue Mar 15 19:52:42 2011 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--
-  Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
-  DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
-  This code is free software; you can redistribute it and/or modify it
-  under the terms of the GNU General Public License version 2 only, as
-  published by the Free Software Foundation.  Oracle designates this
-  particular file as subject to the "Classpath" exception as provided
-  by Oracle in the LICENSE file that accompanied this code.
-
-  This code is distributed in the hope that it will be useful, but WITHOUT
-  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-  version 2 for more details (a copy is included in the LICENSE file that
-  accompanied this code).
-
-  You should have received a copy of the GNU General Public License version
-  2 along with this work; if not, write to the Free Software Foundation,
-  Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
-  Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-  or visit www.oracle.com if you need additional information or have any
-  questions.
--->
-
-<project name="classanalyzer" default="build" basedir=".">
-</project>
--- a/jdk/make/modules/tools/nbproject/project.properties	Tue Mar 15 19:52:42 2011 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,86 +0,0 @@
-#
-# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.  Oracle designates this
-# particular file as subject to the "Classpath" exception as provided
-# by Oracle in the LICENSE file that accompanied this code.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-
-application.title=classanalyzer
-application.vendor=mchung
-build.classes.dir=${build.dir}/classes
-build.classes.excludes=**/*.java,**/*.form
-
-# This directory is removed when the project is cleaned:
-build.dir=build
-build.generated.dir=${build.dir}/generated
-build.generated.sources.dir=${build.dir}/generated-sources
-
-# Only compile against the classpath explicitly listed here:
-build.sysclasspath=ignore
-build.test.classes.dir=${build.dir}/test/classes
-build.test.results.dir=${build.dir}/test/results
-
-cp.extra=${tools.jar} 
-
-debug.classpath=\
-    ${run.classpath}
-debug.test.classpath=\
-    ${run.test.classpath}
-
-# This directory is removed when the project is cleaned:
-dist.dir=dist
-dist.jar=${dist.dir}/classanalyzer.jar
-dist.javadoc.dir=${dist.dir}/javadoc
-
-excludes=
-
-file.reference.tools.jar=${jdk.home}/lib/tools.jar
-file.reference.tools-src=src
-includes=**
-jar.compress=false
-javac.classpath=\
-    ${file.reference.tools.jar}
-javac.deprecation=false
-javac.source=1.5
-javac.target=1.5
-javac.test.classpath=
-javadoc.author=false
-javadoc.noindex=false
-javadoc.nonavbar=false
-javadoc.notree=false
-javadoc.private=false
-javadoc.splitindex=false
-javadoc.use=false
-javadoc.version=false
-main.class=com.sun.classanalyzer.ClassAnalyzer
-manifest.file=manifest.mf
-meta.inf.dir=${src.dir}/META-INF
-platform.active=JDK_1.6
-run.classpath=\
-    ${javac.classpath}:\
-    ${build.classes.dir}
-# Space-separated list of JVM arguments used when running the project
-# (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value
-# or test-sys-prop.name=value to set system properties for unit tests):
-run.jvmargs=-Xmx256m
-run.test.classpath=
-source.encoding=UTF-8
-src.dir=${file.reference.tools-src}
--- a/jdk/make/modules/tools/nbproject/project.xml	Tue Mar 15 19:52:42 2011 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
-  DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- 
-  This code is free software; you can redistribute it and/or modify it
-  under the terms of the GNU General Public License version 2 only, as
-  published by the Free Software Foundation.  Oracle designates this
-  particular file as subject to the "Classpath" exception as provided
-  by Oracle in the LICENSE file that accompanied this code.
- 
-  This code is distributed in the hope that it will be useful, but WITHOUT
-  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-  version 2 for more details (a copy is included in the LICENSE file that
-  accompanied this code).
- 
-  You should have received a copy of the GNU General Public License version
-  2 along with this work; if not, write to the Free Software Foundation,
-  Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- 
-  Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-  or visit www.oracle.com if you need additional information or have any
-  questions.
--->
-
-<project xmlns="http://www.netbeans.org/ns/project/1">
-    <type>org.netbeans.modules.java.j2seproject</type>
-    <configuration>
-        <data xmlns="http://www.netbeans.org/ns/j2se-project/3">
-            <name>classanalyzer</name>
-            <explicit-platform explicit-source-supported="true"/>
-            <source-roots>
-                <root id="src.dir"/>
-            </source-roots>
-            <test-roots/>
-        </data>
-    </configuration>
-</project>
--- a/jdk/make/modules/tools/src/com/sun/classanalyzer/AnnotatedDependency.java	Tue Mar 15 19:52:42 2011 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,627 +0,0 @@
-/*
- * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-package com.sun.classanalyzer;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.Set;
-import java.util.TreeSet;
-import java.util.Map;
-
-import com.sun.classanalyzer.Module.Reference;
-import java.util.LinkedList;
-import java.util.TreeMap;
-
-/**
- *
- * @author Mandy Chung
- */
-public abstract class AnnotatedDependency implements Comparable<AnnotatedDependency> {
-
-    final Klass from;
-    final List<String> classes;
-    protected boolean optional;
-    String description;
-    Klass.Method method;
-    private List<Filter> filters = null;
-
-    public AnnotatedDependency(Klass klass) {
-        this(klass, false);
-    }
-
-    public AnnotatedDependency(Klass klass, boolean optional) {
-        this.from = klass;
-        this.classes = new ArrayList<String>();
-        this.optional = optional;
-    }
-
-    abstract String getTag();
-
-    abstract boolean isDynamic();
-
-    void setMethod(Klass.Method m) {
-        this.method = m;
-    }
-
-    void addElement(String element, List<String> value) {
-        if (element.equals("value")) {
-            addValue(value);
-        } else if (element.equals("description")) {
-            description = value.get(0);
-        } else if (element.equals("optional")) {
-            optional = value.get(0).equals("1") || Boolean.parseBoolean(value.get(0));
-        }
-    }
-
-    void addValue(List<String> value) {
-        for (String s : value) {
-            if ((s = s.trim()).length() > 0) {
-                classes.add(s);
-            }
-        }
-    }
-
-    List<String> getValue() {
-        return classes;
-    }
-
-    boolean isOptional() {
-        return optional;
-    }
-
-    boolean isEmpty() {
-        return classes.isEmpty();
-    }
-
-    boolean matches(String classname) {
-        synchronized (this) {
-            // initialize filters
-            if (filters == null) {
-                filters = new ArrayList<Filter>();
-                for (String pattern : classes) {
-                    filters.add(new Filter(pattern));
-                }
-
-            }
-        }
-
-        for (Filter f : filters) {
-            if (f.matches(classname)) {
-                return true;
-            }
-        }
-        return false;
-    }
-
-    @Override
-    public String toString() {
-        StringBuilder sb = new StringBuilder();
-        for (String v : getValue()) {
-            if (sb.length() == 0) {
-                sb.append(getTag());
-                sb.append("\n");
-            } else {
-                sb.append("\n");
-            }
-            sb.append("  ");
-            sb.append(from.getClassName()).append(" -> ");
-            sb.append(v);
-        }
-        return sb.toString();
-    }
-
-    @Override
-    public int compareTo(AnnotatedDependency o) {
-        if (from == o.from) {
-            if (this.getClass().getName().equals(o.getClass().getName())) {
-                String s1 = classes.isEmpty() ? "" : classes.get(0);
-                String s2 = o.classes.isEmpty() ? "" : o.classes.get(0);
-                return s1.compareTo(s2);
-            } else {
-                return this.getClass().getName().compareTo(o.getClass().getName());
-            }
-
-        } else {
-            return from.compareTo(o.from);
-        }
-    }
-
-    @Override
-    public int hashCode() {
-        int hashcode = 7 + 73 * from.hashCode();
-        for (String s : classes) {
-            hashcode ^= s.hashCode();
-        }
-        return hashcode;
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (!(obj instanceof AnnotatedDependency)) {
-            return false;
-        }
-        AnnotatedDependency other = (AnnotatedDependency) obj;
-        boolean ret = this.from.equals(other.from) && this.classes.size() == other.classes.size();
-        if (ret == true) {
-            for (int i = 0; i < this.classes.size(); i++) {
-                ret = ret && this.classes.get(i).equals(other.classes.get(i));
-            }
-        }
-        return ret;
-    }
-
-    static class ClassForName extends AnnotatedDependency {
-
-        public ClassForName(Klass klass, boolean optional) {
-            super(klass, optional);
-        }
-
-        @Override
-        String getTag() {
-            if (this.optional) {
-                return TAG + "(optional)";
-            } else {
-                return TAG;
-            }
-        }
-
-        @Override
-        boolean isDynamic() {
-            return true;
-        }
-        static final String TYPE = "sun.annotation.ClassForName";
-        static final String TAG = "@ClassForName";
-    }
-
-    static class NativeFindClass extends AnnotatedDependency {
-
-        public NativeFindClass(Klass klass, boolean optional) {
-            super(klass, optional);
-        }
-
-        @Override
-        String getTag() {
-            if (this.optional) {
-                return TAG + "(optional)";
-            } else {
-                return TAG;
-            }
-        }
-
-        @Override
-        boolean isDynamic() {
-            return true;
-        }
-        static final String TYPE = "sun.annotation.NativeFindClass";
-        static final String TAG = "@NativeFindClass";
-    }
-
-    static class Provider extends AnnotatedDependency {
-
-        private List<String> services = new ArrayList<String>();
-
-        Provider(Klass klass) {
-            super(klass, true);
-        }
-
-        @Override
-        boolean isDynamic() {
-            return true;
-        }
-
-        public List<String> services() {
-            return services;
-        }
-
-        @Override
-        void addElement(String element, List<String> value) {
-            if (element.equals("service")) {
-                List<String> configFiles = new ArrayList<String>();
-                for (String s : value) {
-                    if ((s = s.trim()).length() > 0) {
-                        configFiles.add(metaInfPath + s);
-                    }
-                }
-                addValue(configFiles);
-            }
-        }
-
-        @Override
-        void addValue(List<String> value) {
-            for (String s : value) {
-                if ((s = s.trim()).length() > 0) {
-                    if (s.startsWith("META-INF")) {
-                        services.add(s);
-                        readServiceConfiguration(s, classes);
-                    } else {
-                        throw new RuntimeException("invalid value" + s);
-                    }
-                }
-            }
-        }
-
-        boolean isEmpty() {
-            return services.isEmpty();
-        }
-        static final String metaInfPath =
-                "META-INF" + File.separator + "services" + File.separator;
-
-        static void readServiceConfiguration(String config, List<String> names) {
-            BufferedReader br = null;
-            try {
-                InputStream is = ClassPath.open(config);
-                if (is != null) {
-                    // Properties doesn't perserve the order of the input file
-                    br = new BufferedReader(new InputStreamReader(is, "utf-8"));
-                    int lc = 1;
-                    while ((lc = parseLine(br, lc, names)) >= 0);
-                }
-            } catch (IOException ex) {
-                throw new RuntimeException(ex);
-            } finally {
-                if (br != null) {
-                    try {
-                        br.close();
-                    } catch (IOException ex) {
-                        throw new RuntimeException(ex);
-                    }
-                }
-            }
-        }
-
-        // Parse a single line from the given configuration file, adding the name
-        // on the line to the names list.
-        //
-        private static int parseLine(BufferedReader r, int lc, List<String> names) throws IOException {
-            String ln = r.readLine();
-            if (ln == null) {
-                return -1;
-            }
-            int ci = ln.indexOf('#');
-            if (ci >= 0) {
-                ln = ln.substring(0, ci);
-            }
-            ln = ln.trim();
-            int n = ln.length();
-            if (n != 0) {
-                if ((ln.indexOf(' ') >= 0) || (ln.indexOf('\t') >= 0)) {
-                    throw new RuntimeException("Illegal configuration-file syntax");
-                }
-                int cp = ln.codePointAt(0);
-                if (!Character.isJavaIdentifierStart(cp)) {
-                    throw new RuntimeException("Illegal provider-class name: " + ln);
-                }
-                for (int i = Character.charCount(cp); i < n; i += Character.charCount(cp)) {
-                    cp = ln.codePointAt(i);
-                    if (!Character.isJavaIdentifierPart(cp) && (cp != '.')) {
-                        throw new RuntimeException("Illegal provider-class name: " + ln);
-                    }
-                }
-                if (!names.contains(ln)) {
-                    names.add(ln);
-                }
-            }
-            return lc + 1;
-        }
-
-        @Override
-        String getTag() {
-            return TAG;
-        }
-
-        @Override
-        public boolean equals(Object obj) {
-            if (!(obj instanceof AnnotatedDependency)) {
-                return false;
-            }
-            Provider other = (Provider) obj;
-            boolean ret = this.from.equals(other.from) &&
-                    this.services.size() == other.services.size();
-            if (ret == true) {
-                for (int i = 0; i < this.services.size(); i++) {
-                    ret = ret && this.services.get(i).equals(other.services.get(i));
-                }
-            }
-            return ret;
-        }
-
-        @Override
-        public int hashCode() {
-            int hashcode = 7 + 73 * from.hashCode();
-            for (String s : services) {
-                hashcode ^= s.hashCode();
-            }
-            return hashcode;
-        }
-
-        @Override
-        public List<String> getValue() {
-            List<String> result = new ArrayList<String>();
-            result.addAll(services);
-            return result;
-        }
-        static final String TYPE = "sun.annotation.Provider";
-        static final String TAG = "@Provider";
-    }
-
-    static class OptionalDependency extends AnnotatedDependency {
-
-        static boolean isOptional(Klass from, Klass to) {
-            synchronized (OptionalDependency.class) {
-                if (optionalDepsMap == null) {
-                    // Build a map of classes to its optional dependencies
-                    initDependencies();
-                }
-            }
-            for (Reference ref : optionalDepsMap.keySet()) {
-                if (ref.referrer() == from && ref.referree() == to) {
-                    return true;
-                }
-            }
-            return false;
-        }
-
-        OptionalDependency(Klass klass) {
-            super(klass, true);
-        }
-
-        @Override
-        boolean isDynamic() {
-            return false;
-        }
-
-        @Override
-        String getTag() {
-            return TAG;
-        }
-        static final String TYPE = "sun.annotation.Optional";
-        static final String TAG = "@Optional";
-    }
-
-    static class CompilerInline extends AnnotatedDependency {
-
-        public CompilerInline(Klass klass) {
-            super(klass);
-        }
-
-        @Override
-        String getTag() {
-            return TAG;
-        }
-
-        @Override
-        boolean isDynamic() {
-            return false;
-        }
-        static final String TYPE = "sun.annotation.Inline";
-        static final String TAG = "@Inline";
-    }
-
-    static class Filter {
-
-        final String pattern;
-        final String regex;
-
-        Filter(String pattern) {
-            this.pattern = pattern;
-
-            boolean isRegex = false;
-            for (int i = 0; i < pattern.length(); i++) {
-                char p = pattern.charAt(i);
-                if (p == '*' || p == '[' || p == ']') {
-                    isRegex = true;
-                    break;
-                }
-            }
-
-            if (isRegex) {
-                this.regex = convertToRegex(pattern);
-            } else {
-                this.regex = null;
-            }
-        }
-
-        private String convertToRegex(String pattern) {
-            StringBuilder sb = new StringBuilder();
-            int i = 0;
-            int index = 0;
-            int plen = pattern.length();
-            while (i < plen) {
-                char p = pattern.charAt(i);
-                if (p == '*') {
-                    sb.append("(").append(pattern.substring(index, i)).append(")");
-                    if (i + 1 < plen && pattern.charAt(i + 1) == '*') {
-                        sb.append(".*");
-                        index = i + 2;
-                    } else {
-                        sb.append("[^\\.]*");
-                        index = i + 1;
-                    }
-                } else if (p == '[') {
-                    int j = i + 1;
-                    while (j < plen) {
-                        if (pattern.charAt(j) == ']') {
-                            break;
-                        }
-                        j++;
-                    }
-                    if (j >= plen || pattern.charAt(j) != ']') {
-                        throw new RuntimeException("Malformed pattern " + pattern);
-                    }
-                    sb.append("(").append(pattern.substring(index, i)).append(")");
-                    sb.append(pattern.substring(i, j + 1));
-                    index = j + 1;
-                    i = j;
-                }
-                i++;
-            }
-            if (index < plen) {
-                sb.append("(").append(pattern.substring(index, plen)).append(")");
-            }
-            return sb.toString();
-        }
-
-        boolean matches(String name) {
-            if (regex == null) {
-                // the pattern is not a regex
-                return name.equals(pattern);
-            } else {
-                return name.matches(regex);
-            }
-        }
-    }
-
-    static boolean isValidType(String type) {
-        if (type.endsWith("(optional)")) {
-            int len = type.length() - "(optional)".length();
-            type = type.substring(0, len);
-        }
-        return type.equals(ClassForName.TYPE) || type.equals(ClassForName.TAG) ||
-                type.equals(NativeFindClass.TYPE) || type.equals(NativeFindClass.TAG) ||
-                type.equals(Provider.TYPE) || type.equals(Provider.TAG) ||
-                type.equals(CompilerInline.TYPE) || type.equals(CompilerInline.TAG) ||
-                type.equals(OptionalDependency.TYPE) || type.equals(OptionalDependency.TAG);
-    }
-
-    static AnnotatedDependency newAnnotatedDependency(String tag, String value, Klass klass) {
-        AnnotatedDependency dep = newAnnotatedDependency(tag, klass);
-        if (dep != null) {
-            dep.addValue(Collections.singletonList(value));
-        }
-        return dep;
-    }
-    static List<AnnotatedDependency> annotatedDependencies = new LinkedList<AnnotatedDependency>();
-    static List<AnnotatedDependency> optionalDependencies = new LinkedList<AnnotatedDependency>();
-
-    static AnnotatedDependency newAnnotatedDependency(String type, Klass klass) {
-        boolean optional = false;
-        if (type.endsWith("(optional)")) {
-            optional = true;
-            int len = type.length() - "(optional)".length();
-            type = type.substring(0, len);
-        }
-
-        if (type.equals(OptionalDependency.TYPE) || type.equals(OptionalDependency.TAG)) {
-            return newOptionalDependency(klass);
-        }
-
-        AnnotatedDependency dep;
-        if (type.equals(ClassForName.TYPE) || type.equals(ClassForName.TAG)) {
-            dep = new ClassForName(klass, optional);
-        } else if (type.equals(NativeFindClass.TYPE) || type.equals(NativeFindClass.TAG)) {
-            dep = new NativeFindClass(klass, optional);
-        } else if (type.equals(Provider.TYPE) || type.equals(Provider.TAG)) {
-            dep = new Provider(klass);
-        } else if (type.equals(CompilerInline.TYPE) || type.equals(CompilerInline.TAG)) {
-            dep = new CompilerInline(klass);
-        } else {
-            return null;
-        }
-        klass.addAnnotatedDep(dep);
-        annotatedDependencies.add(dep);
-        return dep;
-    }
-
-    static OptionalDependency newOptionalDependency(Klass klass) {
-        OptionalDependency dep = new OptionalDependency(klass);
-        optionalDependencies.add(dep);
-        return dep;
-    }
-    static Map<Reference, Set<AnnotatedDependency>> annotatedDepsMap = null;
-    static Map<Reference, Set<AnnotatedDependency>> optionalDepsMap = null;
-
-    static Map<Reference, Set<AnnotatedDependency>> getReferences(Module m) {
-        // ensure it's initialized
-        initDependencies();
-
-        Map<Reference, Set<AnnotatedDependency>> result = new TreeMap<Reference, Set<AnnotatedDependency>>();
-        for (Reference ref : annotatedDepsMap.keySet()) {
-            if (m.contains(ref.referrer()) && m.isModuleDependence(ref.referree())) {
-                result.put(ref, annotatedDepsMap.get(ref));
-            }
-        }
-        return result;
-    }
-
-    static Set<Module.Dependency> getDependencies(Module m) {
-        // ensure it's initialized
-        initDependencies();
-
-        Set<Module.Dependency> deps = new TreeSet<Module.Dependency>();
-        for (Reference ref : annotatedDepsMap.keySet()) {
-            if (m.contains(ref.referrer())) {
-                Module other = m.getModuleDependence(ref.referree());
-                if (other != null) {
-                    for (AnnotatedDependency ad : annotatedDepsMap.get(ref)) {
-                        Module.Dependency d = new Module.Dependency(other, ad.isOptional(), ad.isDynamic());
-                        deps.add(d);
-                    }
-                }
-            }
-        }
-        return deps;
-    }
-
-    synchronized static void initDependencies() {
-        if (annotatedDepsMap != null) {
-            return;
-        }
-
-        // Build a map of references to its dependencies
-        annotatedDepsMap = new TreeMap<Reference, Set<AnnotatedDependency>>();
-        optionalDepsMap = new TreeMap<Reference, Set<AnnotatedDependency>>();
-
-        for (Klass k : Klass.getAllClasses()) {
-            for (AnnotatedDependency ad : annotatedDependencies) {
-                if (ad.matches(k.getClassName())) {
-                    Reference ref = new Reference(ad.from, k);
-                    Set<AnnotatedDependency> set = annotatedDepsMap.get(ref);
-                    if (set == null) {
-                        set = new TreeSet<AnnotatedDependency>();
-                        annotatedDepsMap.put(ref, set);
-                    }
-                    set.add(ad);
-                }
-            }
-
-            for (AnnotatedDependency ad : optionalDependencies) {
-                if (ad.matches(k.getClassName())) {
-                    Reference ref = new Reference(ad.from, k);
-                    Set<AnnotatedDependency> set = optionalDepsMap.get(ref);
-                    if (set == null) {
-                        set = new TreeSet<AnnotatedDependency>();
-                        optionalDepsMap.put(ref, set);
-                    }
-                    set.add(ad);
-                }
-            }
-        }
-    }
-}
--- a/jdk/make/modules/tools/src/com/sun/classanalyzer/AnnotationParser.java	Tue Mar 15 19:52:42 2011 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,293 +0,0 @@
-/*
- * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.sun.classanalyzer;
-
-import com.sun.tools.classfile.*;
-import com.sun.tools.classfile.Annotation;
-import com.sun.tools.classfile.ExtendedAnnotation;
-import com.sun.tools.classfile.Annotation.Annotation_element_value;
-import com.sun.tools.classfile.Annotation.Array_element_value;
-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.ConstantPoolException;
-import com.sun.tools.classfile.Descriptor;
-import com.sun.tools.classfile.Descriptor.InvalidDescriptor;
-import java.util.ArrayList;
-import java.util.List;
-
-import com.sun.classanalyzer.AnnotatedDependency.*;
-import java.io.File;
-import java.io.PrintWriter;
-import java.util.Map;
-import java.util.Set;
-
-/**
- *
- * @author Mandy Chung
- */
-public class AnnotationParser {
-
-    static boolean parseAnnotation = false;
-    static void setParseAnnotation(boolean newValue) {
-        parseAnnotation = newValue;
-    }
-
-    private final ClassFileParser cfparser;
-    public AnnotationParser(ClassFileParser cfparser) {
-        this.cfparser = cfparser;
-    }
-
-    private AnnotatedDependency addAnnotation(Annotation annot, Klass.Method method) {
-        String type = getType(annot.type_index);
-        AnnotatedDependency dep = AnnotatedDependency.newAnnotatedDependency(type, cfparser.this_klass);
-        if (dep != null) {
-            for (int i = 0; i < annot.num_element_value_pairs; i++) {
-                Element element = getElement(annot.element_value_pairs[i]);
-                dep.addElement(element.name, element.value);
-            }
-            dep.setMethod(method);
-        }
-        return dep;
-    }
-
-    private AnnotatedDependency addAnnotation(ExtendedAnnotation annot, Klass.Method method) {
-        return addAnnotation(annot.annotation, method);
-    }
-
-    class Element {
-
-        String name;
-        List<String> value;
-
-        Element(String name) {
-            this.name = name;
-            this.value = new ArrayList<String>();
-        }
-
-        void add(String v) {
-            value.add(v);
-        }
-    }
-
-    Element getElement(Annotation.element_value_pair pair) {
-        Element element = new Element(getName(pair.element_name_index));
-        evp.parse(pair.value, element);
-        return element;
-    }
-
-    private String getType(int index) {
-        try {
-            Descriptor d = new Descriptor(index);
-            return d.getFieldType(cfparser.classfile.constant_pool);
-        } catch (ConstantPoolException ignore) {
-        } catch (InvalidDescriptor ignore) {
-        }
-        return "Unknown";
-    }
-
-    private String getName(int index) {
-        return cfparser.constantPoolParser.stringValue(index);
-    }
-    element_value_Parser evp = new element_value_Parser();
-
-    class element_value_Parser implements Annotation.element_value.Visitor<Void, Element> {
-
-        public Void parse(Annotation.element_value value, Element element) {
-            value.accept(this, element);
-            return null;
-        }
-
-        public Void visitPrimitive(Primitive_element_value ev, Element element) {
-            String value = getName(ev.const_value_index);
-            element.add(value);
-            return null;
-        }
-
-        public Void visitEnum(Enum_element_value ev, Element element) {
-            String value = getName(ev.type_name_index) + "." + getName(ev.const_name_index);
-            element.add(value);
-            return null;
-        }
-
-        public Void visitClass(Class_element_value ev, Element element) {
-            String value = getName(ev.class_info_index) + ".class";
-            element.add(value);
-            return null;
-        }
-
-        public Void visitAnnotation(Annotation_element_value ev, Element element) {
-            // AnnotationParser.this.addAnnotation(ev.annotation_value);
-            throw new UnsupportedOperationException("Not supported: " + ev);
-        }
-
-        public Void visitArray(Array_element_value ev, Element element) {
-            for (int i = 0; i < ev.num_values; i++) {
-                parse(ev.values[i], element);
-            }
-            return null;
-        }
-    }
-
-    void parseAttributes(Attributes attributes, Klass.Method method) {
-        if (!parseAnnotation) {
-            return;
-        }
-
-        visitRuntimeAnnotations((RuntimeVisibleAnnotations_attribute) attributes.get(Attribute.RuntimeVisibleAnnotations), method);
-        visitRuntimeAnnotations((RuntimeInvisibleAnnotations_attribute) attributes.get(Attribute.RuntimeInvisibleAnnotations), method);
-        visitRuntimeTypeAnnotations((RuntimeVisibleTypeAnnotations_attribute) attributes.get(Attribute.RuntimeVisibleTypeAnnotations), method);
-        visitRuntimeTypeAnnotations((RuntimeInvisibleTypeAnnotations_attribute) attributes.get(Attribute.RuntimeInvisibleTypeAnnotations), method);
-        visitRuntimeParameterAnnotations((RuntimeVisibleParameterAnnotations_attribute) attributes.get(Attribute.RuntimeVisibleParameterAnnotations), method);
-        visitRuntimeParameterAnnotations((RuntimeInvisibleParameterAnnotations_attribute) attributes.get(Attribute.RuntimeInvisibleParameterAnnotations), method);
-    }
-
-    public void visitRuntimeAnnotations(RuntimeAnnotations_attribute attr, Klass.Method method) {
-        if (attr == null) {
-            return;
-        }
-
-        for (int i = 0; i < attr.annotations.length; i++) {
-            addAnnotation(attr.annotations[i], method);
-        }
-    }
-
-    public void visitRuntimeTypeAnnotations(RuntimeTypeAnnotations_attribute attr, Klass.Method method) {
-        if (attr == null) {
-            return;
-        }
-
-        for (int i = 0; i < attr.annotations.length; i++) {
-            addAnnotation(attr.annotations[i], method);
-        }
-    }
-
-    public void visitRuntimeParameterAnnotations(RuntimeParameterAnnotations_attribute attr, Klass.Method method) {
-        if (attr == null) {
-            return;
-        }
-
-        for (int param = 0; param < attr.parameter_annotations.length; param++) {
-            for (int i = 0; i < attr.parameter_annotations[param].length; i++) {
-                addAnnotation(attr.parameter_annotations[param][i], method);
-            }
-        }
-    }
-
-    void parseAttributes(Attributes attributes) {
-        parseAttributes(attributes, null);
-    }
-
-    public static void main(String[] args) throws Exception {
-        String jdkhome = null;
-        String output = ".";
-
-        // process arguments
-        int i = 0;
-        while (i < args.length) {
-            String arg = args[i++];
-            if (arg.equals("-jdkhome")) {
-                if (i < args.length) {
-                    jdkhome = args[i++];
-                } else {
-                    usage();
-                }
-            } else if (arg.equals("-output")) {
-                output = args[i++];
-            } else {
-                usage();
-            }
-        }
-        if (jdkhome == null) {
-            usage();
-        }
-
-        // parse annotation and code attribute to find all references
-        // to Class.forName etc
-        CodeAttributeParser.setParseCodeAttribute(true);
-        AnnotationParser.setParseAnnotation(true);
-
-        ClassPath.setJDKHome(jdkhome);
-        ClassPath.parseAllClassFiles();
-
-        PrintWriter writer = new PrintWriter(new File(output, "jdk7.depconfig"));
-
-        try {
-            for (Klass k : Klass.getAllClasses()) {
-                for (AnnotatedDependency dep : k.getAnnotatedDeps()) {
-                    if (dep.isEmpty()) {
-                        continue;
-                    }
-                    writer.format("# %s \n", dep.method == null ? dep.from : dep.method);
-                    writer.format("%s\n\n", dep);
-                }
-            }
-        } finally {
-            writer.close();
-        }
-
-        writer = new PrintWriter(new File(output, "optional.depconfig"));
-        try {
-            AnnotatedDependency prev = null;
-            for (AnnotatedDependency dep : AnnotatedDependency.optionalDependencies) {
-                if (prev != null && !dep.equals(prev)) {
-                    writer.format("%s\n\n", prev);
-                }
-                writer.format("# %s \n", dep.method == null ? dep.from : dep.method);
-                prev = dep;
-            }
-            if (prev != null) {
-                writer.format("%s\n\n", prev);
-            }
-        } finally {
-            writer.close();
-        }
-
-        writer = new PrintWriter(new File(output, "runtime.references"));
-        try {
-            for (Map.Entry<String, Set<Klass.Method>> entry : CodeAttributeParser.runtimeReferences.entrySet()) {
-                writer.format("References to %s\n", entry.getKey());
-                Klass prev = null;
-                for (Klass.Method m : entry.getValue()) {
-                    if (prev == null || prev != m.getKlass()) {
-                        writer.format("  %-50s # %s\n", m.getKlass(), m);
-                    } else if (prev == m.getKlass()) {
-                        writer.format("  %-50s # %s\n", "", m);
-                    }
-                    prev = m.getKlass();
-                }
-            }
-        } finally {
-            writer.close();
-        }
-    }
-
-    private static void usage() {
-        System.out.println("Usage: AnnotationParser <options>");
-        System.out.println("Options: ");
-        System.out.println("\t-jdkhome <JDK home> where all jars will be parsed");
-        System.out.println("\t-depconfig <output file for annotated dependencies>");
-        System.out.println("\t-optional <output file for optional dependencies>");
-        System.exit(-1);
-    }
-}
--- a/jdk/make/modules/tools/src/com/sun/classanalyzer/BootAnalyzer.java	Tue Mar 15 19:52:42 2011 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,819 +0,0 @@
-/*
- * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-package com.sun.classanalyzer;
-
-import java.io.BufferedReader;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.io.PrintWriter;
-import java.io.File;
-import java.util.ArrayDeque;
-import java.util.Deque;
-import java.util.HashMap;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.TreeSet;
-
-import com.sun.tools.classfile.*;
-import com.sun.tools.classfile.ConstantPool.*;
-import static com.sun.tools.classfile.ConstantPool.*;
-import com.sun.tools.classfile.Instruction.TypeKind;
-import com.sun.tools.classfile.Type.*;
-
-/**
- * Generate the module config for the boot module with
- * a given set of roots (classes or methods) and exclude list.
- *
- * This tool does method-level dependency analysis starting
- * from the root set and follows references transitively as follows:
- * <ul>
- * <li>For a given class, it will parse the ClassFile to
- *     find its superclass and superinterfaces and also
- *     its static initializer &lt;clinit&gt;.</li>
- * <li>For each method, it will parse its Code attribute
- *     to look for a Methodref, Fieldref, and InterfaceMethodref.
- *     </li>
- * <li>For each Fieldref, it will include the type of
- *     the field in the dependency.</li>
- * <li>For each MethodRef, it will follow all references in
- *     that method.</li>
- * <li>For each InterfaceMethodref, it will follow all references in
- *     that method defined its implementation classes in
- *     the resulting dependency list.</li>
- * </ul>
- *
- * Limitation:
- * <ul>
- * <li>For each Methodref, it only parses the method of
- *     the specified type.  It doesn't analyze the class hierarchy
- *     and follow references of its subclasses since it ends up
- *     pulls in many unnecessary dependencies.  For now,
- *     the list of subclasses and methods need to be listed in
- *     the root set.</li>
- * </ul>
- *
- * @author Mandy Chung
- */
-public class BootAnalyzer {
-
-    public static void main(String[] args) throws Exception {
-        String jdkhome = null;
-        String config = null;
-        String output = ".";
-        boolean printClassList = false;
-
-        // process arguments
-        int i = 0;
-        while (i < args.length) {
-            String arg = args[i++];
-            if (arg.equals("-jdkhome")) {
-                if (i < args.length) {
-                    jdkhome = args[i++];
-                } else {
-                    usage();
-                }
-            } else if (arg.equals("-config")) {
-                config = args[i++];
-            } else if (arg.equals("-output")) {
-                output = args[i++];
-            } else if (arg.equals("-classlist")) {
-                printClassList = true;
-            } else {
-                usage();
-            }
-        }
-
-
-
-        if (jdkhome == null || config == null) {
-            usage();
-        }
-
-        File jre = new File(jdkhome, "jre");
-        if (jre.exists()) {
-            ClassPath.setJDKHome(jdkhome);
-        } else {
-            File classes = new File(jdkhome, "classes");
-            if (classes.exists()) {
-                ClassPath.setClassPath(classes.getCanonicalPath());
-            } else {
-                throw new RuntimeException("Invalid jdkhome: " + jdkhome);
-            }
-        }
-
-        parseConfigFile(config);
-        followRoots();
-
-        // create output directory if it doesn't exist
-        File dir = new File(output);
-        if (!dir.isDirectory()) {
-            if (!dir.exists()) {
-                boolean created = dir.mkdir();
-                if (!created) {
-                    throw new RuntimeException("Unable to create `" + dir + "'");
-                }
-            }
-        }
-
-        String bootmodule = "boot";
-        String bootconfig = resolve(dir, bootmodule, "config");
-        printBootConfig(bootconfig, bootmodule);
-
-        List<ModuleConfig> list = ModuleConfig.readConfigurationFile(bootconfig);
-        Module module = Module.addModule(list.get(0));
-        for (Klass k : Klass.getAllClasses()) {
-            module.addKlass(k);
-        }
-        module.fixupDependencies();
-
-        if (printClassList) {
-            module.printClassListTo(resolve(dir, bootmodule, "classlist"));
-            module.printSummaryTo(resolve(dir, bootmodule, "summary"));
-        }
-    }
-
-    // print boot.config file as an input to the ClassAnalyzer
-    private static void printBootConfig(String output, String bootmodule) throws IOException {
-
-        File f = new File(output);
-        PrintWriter writer = new PrintWriter(f);
-        try {
-            int count = 0;
-            writer.format("module %s {%n", bootmodule);
-            for (Klass k : Klass.getAllClasses()) {
-                if (count++ == 0) {
-                    writer.format("%4s%7s %s", "", "include", k);
-                } else {
-                    writer.format(",%n");
-                    writer.format("%4s%7s %s", "", "", k);
-                }
-            }
-            writer.format(";%n}%n");
-        } finally {
-            writer.close();
-        }
-    }
-
-    private static String resolve(File dir, String mname, String suffix) {
-        File f = new File(dir, mname + "." + suffix);
-        return f.toString();
-
-    }
-    static List<MethodDescriptor> methods = new LinkedList<MethodDescriptor>();
-    static Deque<MethodDescriptor> pending = new ArrayDeque<MethodDescriptor>();
-    static Deque<MethodDescriptor> interfaceMethodRefs = new ArrayDeque<MethodDescriptor>();
-    static Filter filter = new Filter();
-
-    private static void followRoots() throws IOException {
-        MethodDescriptor md = null;
-
-        while ((md = pending.poll()) != null) {
-            if (!methods.contains(md)) {
-                methods.add(md);
-                if (md.classname.isEmpty()) {
-                    trace("Warning: class missing %s%n", md);
-                    continue;
-                }
-
-                if (filter.isExcluded(md.classname)) {
-                    trace("excluded %s%n", md);
-                } else {
-                    KlassInfo kinfo = getKlassInfo(md.classname);
-                    if (kinfo.classname.contains("$")) {
-                        int pos = kinfo.classname.lastIndexOf('$');
-                        String outer = kinfo.classname.substring(0, pos);
-                        if (!cache.containsKey(outer)) {
-                            trace("  include outer class %s%n", outer);
-                            getKlassInfo(outer).ensureParse();
-                        }
-                    }
-
-                    kinfo.ensureParse();
-                    if (md.methodname.length() > 0) {
-                        if (filter.isExcluded(md.name)) {
-                            trace("excluded %s%n", md);
-                        } else {
-                            if (md.interfaceMethodRef) {
-                                trace("interface methodref %s%n", md);
-                                interfaceMethodRefs.add(md);
-                            } else {
-                                List<String> descriptors = kinfo.parse(md);
-                                if (descriptors.isEmpty()) {
-                                    if (kinfo.getSuperclass() != null) {
-                                        String sn = kinfo.getSuperclass().classname;
-                                        MethodDescriptor superMD = new MethodDescriptor(sn + "." + md.methodname, md.descriptor, false);
-                                        if (!methods.contains(superMD) && !pending.contains(superMD)) {
-                                            trace("  delegated %s to %s%n", md, superMD);
-                                            pending.add(superMD);
-                                        }
-                                    } else if (kinfo.isClass()) {
-                                        trace("  %s (not found)%n", md);
-                                    } else {
-                                        trace("  %s (interface)%n", md);
-                                    }
-                                } else {
-                                    if (md.descriptor.equals("*")) {
-                                        trace("  parsed %s : ", md.name);
-                                        for (String s : descriptors) {
-                                            trace(" %s", s);
-                                        }
-                                        trace("%n");
-                                    }
-                                }
-                            }
-                        }
-                    }
-                }
-            }
-            if (pending.isEmpty()) {
-                for (Klass k : Klass.getAllClasses()) {
-                    if (k.getFileSize() == 0) {
-                        getKlassInfo(k.getClassName()).ensureParse();
-                    }
-                }
-                while ((md = interfaceMethodRefs.poll()) != null) {
-                    addSubClassMethods(md);
-                }
-            }
-        }
-    }
-
-    static void addSubClassMethods(MethodDescriptor md) throws IOException {
-        for (KlassInfo kinfo : getSubClasses(md.classname)) {
-            String methodname = kinfo.classname + "." + md.methodname;
-            MethodDescriptor other = new MethodDescriptor(methodname, md.descriptor, false);
-            if (!methods.contains(other) && !pending.contains(other)) {
-                trace("Warning: subclass from %s to %s%n", md.classname, other);
-                pending.add(other);
-            }
-        }
-    }
-    private final static String privilegedActionInterf = "java.security.PrivilegedAction";
-    private final static String privilegedExceptionActionInterf = "java.security.PrivilegedExceptionAction";
-
-    static boolean isPrivilegedAction(String classname) {
-        if (classname.isEmpty()) {
-            return false;
-        }
-        KlassInfo kinfo = getKlassInfo(classname);
-        for (KlassInfo ki : kinfo.getInterfaces()) {
-            String interf = ki.classname;
-            if (interf.equals(privilegedActionInterf) ||
-                    interf.equals(privilegedExceptionActionInterf)) {
-                return true;
-            }
-        }
-        return false;
-    }
-    static Map<String, KlassInfo> cache = new HashMap<String, KlassInfo>();
-
-    static KlassInfo getKlassInfo(String classname) {
-        classname = classname.replace('/', '.');
-
-        KlassInfo kinfo = cache.get(classname);
-        if (kinfo == null) {
-            kinfo = new KlassInfo(classname);
-            cache.put(classname, kinfo);
-        }
-        return kinfo;
-    }
-
-    static class KlassInfo {
-
-        final String classname;
-        private ClassFileParser parser;
-        private KlassInfo superclass;
-        private List<KlassInfo> interfaces = new LinkedList<KlassInfo>();
-
-        KlassInfo(String classname) {
-            this.classname = classname;
-        }
-
-        boolean isClass() {
-            ensureParse();
-            return parser.classfile.isClass();
-        }
-
-        KlassInfo getSuperclass() {
-            ensureParse();
-            return superclass;
-        }
-
-        List<KlassInfo> getInterfaces() {
-            ensureParse();
-            return java.util.Collections.unmodifiableList(interfaces);
-        }
-
-        void ensureParse() {
-            try {
-                getClassFileParser();
-            } catch (IOException e) {
-                throw new RuntimeException(e);
-            }
-        }
-
-        synchronized ClassFileParser getClassFileParser() throws IOException {
-            if (parser == null) {
-                parser = ClassPath.parserForClass(classname);
-                if (parser != null) {
-                    parseClassFile();
-                    List<String> descriptors = parse(new MethodDescriptor(classname + ".<clinit>", "()V", false));
-                }
-            }
-            return parser;
-        }
-
-        List<String> parse(MethodDescriptor md) {
-            ensureParse();
-            try {
-                List<String> descriptors = new LinkedList<String>();
-                for (Method m : parser.classfile.methods) {
-                    String name = m.getName(parser.classfile.constant_pool);
-                    String desc = parser.constantPoolParser.getDescriptor(m.descriptor.index);
-                    if (name.equals(md.methodname)) {
-                        if (md.descriptor.equals("*") || md.descriptor.equals(desc)) {
-                            parseMethod(parser, m);
-                            descriptors.add(desc);
-                        }
-                    }
-                }
-                return descriptors;
-            } catch (ConstantPoolException ex) {
-                throw new RuntimeException(ex);
-            }
-        }
-
-        private void parseClassFile() throws IOException {
-            parser.parseClassInfo();
-
-            ClassFile classfile = parser.classfile;
-            try {
-                if (classfile.super_class > 0) {
-                    superclass = getKlassInfo(classfile.getSuperclassName());
-                }
-                if (classfile.interfaces != null) {
-                    for (int i = 0; i < classfile.interfaces.length; i++) {
-                        interfaces.add(getKlassInfo(classfile.getInterfaceName(i)));
-                    }
-                }
-            } catch (ConstantPoolException ex) {
-                throw new RuntimeException(ex);
-            }
-        }
-    }
-
-    static List<KlassInfo> getSubClasses(String classname) throws IOException {
-        List<KlassInfo> result = new LinkedList<KlassInfo>();
-        List<KlassInfo> list = new LinkedList<KlassInfo>();
-        list.addAll(cache.values());
-        for (KlassInfo kinfo : list) {
-            if (kinfo.getSuperclass() != null && classname.equals(kinfo.getSuperclass().classname)) {
-                result.add(kinfo);
-            }
-            for (KlassInfo interf : kinfo.getInterfaces()) {
-                if (classname.equals(interf.classname)) {
-                    result.add(kinfo);
-                }
-            }
-        }
-        return result;
-    }
-
-    private static void parseConfigFile(String config) throws IOException {
-        FileInputStream in = new FileInputStream(config);
-        try {
-            BufferedReader reader = new BufferedReader(new InputStreamReader(in));
-            String line;
-            int lineNumber = 0;
-            while ((line = reader.readLine()) != null) {
-                lineNumber++;
-                if ((line = line.trim()).length() > 0) {
-                    if (line.startsWith("#")) {
-                        continue;
-                    }
-
-                    String[] s = line.split("\\s+");
-                    if ("exclude".equals(s[0])) {
-                        filter.exclude(s[1]);
-                    } else {
-                        String name = s[0].replace('/', '.');
-                        if (name.length() > 0) {
-                            String classname = name.replace('/', '.');
-                            if (s.length == 2) {
-                                // method name
-                                int pos = classname.lastIndexOf('.');
-                                classname = classname.substring(0, pos);
-                            }
-
-                            KlassInfo kinfo = getKlassInfo(classname);
-                            if (kinfo.getClassFileParser() != null) {
-                                // class exists
-                                MethodDescriptor md = (s.length == 1) ? new MethodDescriptor(name) : new MethodDescriptor(name, s[1], false);
-                                if (!pending.contains(md)) {
-                                    pending.add(md);
-                                }
-                            } else {
-                                // class not found
-                                trace("Class %s not found%n", classname);
-                            }
-                        }
-                    }
-                }
-            }
-
-        } finally {
-            in.close();
-        }
-    }
-
-    private static void parseMethod(ClassFileParser cfparser, Method m) {
-        Klass.Method kmethod = cfparser.parseMethod(m);
-        Code_attribute c_attr = (Code_attribute) m.attributes.get(Attribute.Code);
-        if (c_attr != null) {
-            LineNumberTable_attribute lineNumTable =
-                    (LineNumberTable_attribute) c_attr.attributes.get(Attribute.LineNumberTable);
-            InstructorVisitor visitor = new InstructorVisitor(cfparser, lineNumTable);
-            trace("parseMethod %s %s %n", cfparser.this_klass, kmethod);
-            for (Instruction instr : c_attr.getInstructions()) {
-                try {
-                    instr.accept(visitor, kmethod);
-                } catch (ArrayIndexOutOfBoundsException e) {
-                    throw new RuntimeException("error at or after byte " + instr.getPC());
-                }
-
-            }
-
-            if (c_attr.exception_table_langth > 0) {
-                for (int i = 0; i <
-                        c_attr.exception_table.length; i++) {
-                    Code_attribute.Exception_data handler = c_attr.exception_table[i];
-                    int catch_type = handler.catch_type;
-                    if (catch_type > 0) {
-                        visitor.addConstantPoolRef(catch_type, kmethod, handler.start_pc);
-                    }
-
-                }
-            }
-        }
-    }
-
-    static class MethodDescriptor {
-
-        final String name;
-        final String classname;
-        final String methodname;
-        final String descriptor;
-        final boolean interfaceMethodRef;
-
-        MethodDescriptor(String classname) {
-            this.classname = classname.replace('/', '.');
-            this.name = this.classname;
-            this.methodname = "";
-            this.descriptor = "";
-            this.interfaceMethodRef = false;
-            if (this.classname.length() == 1) {
-                throw new RuntimeException("invalid " + this);
-            }
-        }
-
-        MethodDescriptor(String name, String descriptor, boolean interfaceMethodRef) {
-            name = name.replace('/', '.');
-            this.name = name;
-            int pos = name.lastIndexOf('.');
-            this.classname = name.substring(0, pos);
-            this.methodname = name.substring(pos + 1, name.length());
-            this.descriptor = descriptor;
-            this.interfaceMethodRef = interfaceMethodRef;
-            if (this.classname.length() == 1) {
-                throw new RuntimeException("invalid " + this);
-            }
-        }
-
-        @Override
-        public boolean equals(Object obj) {
-            MethodDescriptor m = (MethodDescriptor) obj;
-
-            return this.name.equals(m.name) &&
-                    this.descriptor.equals(m.descriptor);
-        }
-
-        @Override
-        public int hashCode() {
-            int hash = 7;
-            hash = 97 * hash + (this.name != null ? this.name.hashCode() : 0);
-            hash = 97 * hash + (this.descriptor != null ? this.descriptor.hashCode() : 0);
-            return hash;
-        }
-
-        public String toString() {
-            if (descriptor.isEmpty()) {
-                return name;
-            } else {
-                return name + " : " + descriptor;
-            }
-        }
-    }
-
-    static class Filter {
-
-        private Set<String> excludes = new TreeSet<String>();
-
-        Filter exclude(String pattern) {
-            excludes.add(pattern);
-            return this;
-        }
-
-        boolean isExcluded(String klass) {
-            for (String pattern : excludes) {
-                if (matches(klass, pattern)) {
-                    return true;
-                }
-            }
-            return false;
-        }
-
-        private boolean matches(String klass, String pattern) {
-            int pos = klass.lastIndexOf('.');
-            String packageName = pos > 0 ? klass.substring(0, pos) : "<unnamed>";
-            if (pattern.endsWith("**")) {
-                String p = pattern.substring(0, pattern.length() - 2);
-                return klass.startsWith(p);
-            } else if (pattern.endsWith("*")) {
-                pos = pattern.lastIndexOf('.');
-                String pkg = pos > 0 ? pattern.substring(0, pos) : "<unnamed>";
-                if (packageName.equals(pkg)) {
-                    // package name has to be exact match
-                    String p = pattern.substring(0, pattern.length() - 1);
-                    return klass.startsWith(p);
-                } else {
-                    return false;
-                }
-            } else {
-                // exact match or inner class
-                return klass.equals(pattern) || klass.startsWith(pattern + "$");
-            }
-        }
-    }
-
-    static class InstructorVisitor implements Instruction.KindVisitor<Void, Klass.Method> {
-
-        private final ClassFileParser parser;
-        private final LineNumberTable_attribute lineNumTable;
-
-        InstructorVisitor(ClassFileParser parser, LineNumberTable_attribute lineNumTable) {
-            this.parser = parser;
-            this.lineNumTable = lineNumTable;
-        }
-
-        int getLineNumber(int pc) {
-            if (lineNumTable != null) {
-                int start_pc = 0;
-                int lineno = 0;
-                for (int i = 0; i < lineNumTable.line_number_table_length; i++) {
-                    int cur_start_pc = lineNumTable.line_number_table[i].start_pc;
-                    if (pc == 0 && cur_start_pc == 0) {
-                        return lineNumTable.line_number_table[i].line_number;
-                    } else if (pc >= start_pc && pc < cur_start_pc) {
-                        return lineno;
-                    }
-                    start_pc = cur_start_pc;
-                    lineno = lineNumTable.line_number_table[i].line_number;
-                }
-            }
-            return 0;
-        }
-
-        void addConstantPoolRef(int index, Klass.Method m, int pc) {
-            try {
-                CPInfo cpInfo = parser.classfile.constant_pool.get(index);
-                String name = cpInfo.accept(typeFinder, null);
-                if (name != null) {
-                    trace("   %s %s at line %d%n", parser.constantPoolParser.tagName(index), name, getLineNumber(pc));
-                }
-            } catch (InvalidIndex ex) {
-                throw new RuntimeException(ex);
-            }
-        }
-
-        public Void visitNoOperands(Instruction instr, Klass.Method m) {
-            return null;
-        }
-
-        public Void visitArrayType(Instruction instr, TypeKind kind, Klass.Method m) {
-            return null;
-        }
-
-        public Void visitBranch(Instruction instr, int offset, Klass.Method m) {
-            return null;
-        }
-
-        public Void visitConstantPoolRef(Instruction instr, int index, Klass.Method m) {
-            addConstantPoolRef(index, m, instr.getPC());
-            return null;
-        }
-
-        public Void visitConstantPoolRefAndValue(Instruction instr, int index, int value, Klass.Method m) {
-            addConstantPoolRef(index, m, instr.getPC());
-            return null;
-        }
-
-        public Void visitLocal(Instruction instr, int index, Klass.Method m) {
-            return null;
-        }
-
-        public Void visitLocalAndValue(Instruction instr, int index, int value, Klass.Method m) {
-            return null;
-        }
-
-        public Void visitLookupSwitch(Instruction instr, int default_, int npairs, int[] matches, int[] offsets, Klass.Method m) {
-            return null;
-        }
-
-        public Void visitTableSwitch(Instruction instr, int default_, int low, int high, int[] offsets, Klass.Method m) {
-            return null;
-        }
-
-        public Void visitValue(Instruction instr, int value, Klass.Method m) {
-            return null;
-        }
-
-        public Void visitUnknown(Instruction instr, Klass.Method m) {
-            return null;
-        }
-        private ConstantPool.Visitor<String, Void> typeFinder = new ConstantPool.Visitor<String, Void>() {
-
-            String getClassName(CPRefInfo info, Void p) {
-                try {
-                    return parser.checkClassName(info.getClassName()).replace('/', '.');
-                } catch (ConstantPoolException ex) {
-                    throw new RuntimeException(ex);
-                }
-            }
-
-            boolean addReferencedClass(String name) {
-                if (Klass.findKlass(name) == null) {
-                    MethodDescriptor md = new MethodDescriptor(name);
-                    if (!methods.contains(md) && !pending.contains(md)) {
-                        pending.add(md);
-                    }
-                    return true;
-                }
-                return false;
-            }
-            private String privilegedActionClass = "";
-
-            void cachePrivilegedAction(String classname) {
-                trace("   found PrivilegedAction %s%n", classname);
-                privilegedActionClass = classname;
-            }
-
-            void doPrivilegedCall(String method) {
-                if (privilegedActionClass.length() > 0) {
-                    MethodDescriptor md = new MethodDescriptor(privilegedActionClass + ".run", "*", false);
-                    if (!methods.contains(md) && !pending.contains(md)) {
-                        trace("   doPrivileged %s%n", md);
-                        pending.add(md);
-                    }
-                }
-            }
-
-            private String addMethodDescriptor(CPRefInfo info, Void p) {
-                try {
-                    String classname = getClassName(info, null);
-                    String method = classname + "." + info.getNameAndTypeInfo().getName();
-                    String descriptor = info.getNameAndTypeInfo().getType();
-
-                    if (method.endsWith(".<init>") && isPrivilegedAction(classname)) {
-                        cachePrivilegedAction(classname);
-                    }
-                    if (method.equals("java.security.AccessController.doPrivileged")) {
-                        doPrivilegedCall(method);
-                        return method;
-                    }
-
-                    boolean interfaceMethodRef = info instanceof CONSTANT_InterfaceMethodref_info;
-                    MethodDescriptor md = new MethodDescriptor(method, descriptor, interfaceMethodRef);
-                    if (!methods.contains(md) && !pending.contains(md)) {
-                        pending.add(md);
-                    }
-                    return method;
-                } catch (ConstantPoolException e) {
-                    throw new RuntimeException(e);
-                }
-            }
-
-            public String visitClass(CONSTANT_Class_info info, Void p) {
-                try {
-                    String classname = parser.checkClassName(info.getName()).replace('/', '.');
-                    if (classname.length() > 0) {
-                        addReferencedClass(classname);
-                    }
-                    return classname;
-                } catch (ConstantPoolException ex) {
-                    throw new RuntimeException(ex);
-                }
-            }
-
-            public String visitDouble(CONSTANT_Double_info info, Void p) {
-                // skip
-                return null;
-            }
-
-            public String visitFieldref(CONSTANT_Fieldref_info info, Void p) {
-                try {
-                    String classname = getClassName(info, p);
-                    if (classname.length() > 0) {
-                        addReferencedClass(classname);
-                    }
-
-                    String type = info.getNameAndTypeInfo().getType();
-                    String fieldType = parser.checkClassName(type).replace('/', '.');
-                    if (fieldType.length() > 0) {
-                        addReferencedClass(classname);
-                    }
-                    return parser.constantPoolParser.stringValue(info);
-                } catch (ConstantPoolException e) {
-                    throw new RuntimeException(e);
-                }
-            }
-
-            public String visitFloat(CONSTANT_Float_info info, Void p) {
-                // skip
-                return null;
-            }
-
-            public String visitInteger(CONSTANT_Integer_info info, Void p) {
-                // skip
-                return null;
-            }
-
-            public String visitInterfaceMethodref(CONSTANT_InterfaceMethodref_info info, Void p) {
-                return addMethodDescriptor(info, p);
-            }
-
-            public String visitLong(CONSTANT_Long_info info, Void p) {
-                // skip
-                return null;
-            }
-
-            public String visitNameAndType(CONSTANT_NameAndType_info info, Void p) {
-                // skip
-                return null;
-            }
-
-            public String visitMethodref(CONSTANT_Methodref_info info, Void p) {
-                return addMethodDescriptor(info, p);
-            }
-
-            public String visitString(CONSTANT_String_info info, Void p) {
-                // skip
-                return null;
-            }
-
-            public String visitUtf8(CONSTANT_Utf8_info info, Void p) {
-                return null;
-            }
-        };
-    }
-    static boolean traceOn = System.getProperty("classanalyzer.debug") != null;
-
-    private static void trace(String format, Object... args) {
-        if (traceOn) {
-            System.out.format(format, args);
-        }
-    }
-
-    private static void usage() {
-        System.out.println("Usage: BootAnalyzer <options>");
-        System.out.println("Options: ");
-        System.out.println("\t-jdkhome <JDK home> where all jars will be parsed");
-        System.out.println("\t-config  <roots for the boot module>");
-        System.out.println("\t-output  <output dir>");
-        System.out.println("\t-classlist print class list and summary");
-        System.exit(-1);
-    }
-}
--- a/jdk/make/modules/tools/src/com/sun/classanalyzer/CheckDeps.java	Tue Mar 15 19:52:42 2011 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,181 +0,0 @@
-/*
- * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.sun.classanalyzer;
-
-import java.io.*;
-import java.util.*;
-
-/**
- * A simple tool to check module dependencies against a known list of
- * dependencies. The tool fails (by throwing a RuntimeException) is an
- * unexpected dependency is detected.
- */
-
-public class CheckDeps {
-
-    /**
-     * Represents a dependency from one module to another module. The dependency
-     * may be optional.
-     */
-    static class Dependency {
-        private final String module;
-        private final String other;
-        private final boolean optional;
-
-        private Dependency(String module, String other, boolean optional) {
-            this.module = module;
-            this.other = other;
-            this.optional = optional;
-        }
-
-        String module()      { return module; }
-        String other()       { return other; }
-        boolean isOptional() { return optional; }
-
-        /**
-         * Parses a dependency in one of the following forms:
-         *   a -> b
-         *   [optional] a -> b
-         */
-        static Dependency fromString(String s) {
-            String[] components = s.split(" ");
-            int count = components.length;
-            if (count != 3 && count != 4)
-                throw new IllegalArgumentException(s);
-            boolean optional = (count == 4);
-            if (optional && !components[0].equals("[optional]"))
-                throw new IllegalArgumentException(s);
-            String arrow = optional ? components[2] : components[1];
-            if (!arrow.equals("->"))
-                throw new IllegalArgumentException(s);
-            String module = optional ? components[1] : components[0];
-            String other = optional ? components[3] : components[2];
-            return new Dependency(module, other, optional);
-        }
-
-        @Override public String toString() {
-            StringBuilder sb = new StringBuilder();
-            if (optional)
-                sb.append("[optional] ");
-            sb.append(module);
-            sb.append(" -> ");
-            sb.append(other);
-            return sb.toString();
-        }
-    }
-
-    /**
-     * Represents the "tail"
-     */
-    static class DependencyTail {
-        private final String module;
-        private final boolean optional;
-
-        DependencyTail(String module, boolean optional) {
-            this.module = module;
-            this.optional = optional;
-        }
-        String module()      { return module; }
-        boolean isOptional() { return optional; }
-    }
-
-    static void usage() {
-        System.out.println("java CheckDeps file1 file2");
-        System.out.println("  where file1 is the expected dependencies and file2 is");
-        System.out.println("  the actual dependencies. Both files are assumed to be");
-        System.out.println("  in modules.summary format (see ClassAnalyzer tool).");
-        System.out.println();
-        System.out.println("Example usages:");
-        System.out.println("  java CheckDeps make/modules/modules.summary " +
-            "$(OUTPUTDIR)/modules.summary");
-        System.exit(-1);
-    }
-
-    public static void main(String[] args) throws IOException {
-        if (args.length != 2)
-            usage();
-
-        // maps a module to the list of modules that it depends on
-        Map<String,List<DependencyTail>> expected =
-            new HashMap<String,List<DependencyTail>>();
-
-        // parse the expected dependencies file
-        Scanner s;
-        s = new Scanner(new FileInputStream(args[0]));
-        try {
-            while (s.hasNextLine()) {
-                Dependency ref = Dependency.fromString(s.nextLine());
-                if (ref != null) {
-                    String module = ref.module();
-                    List<DependencyTail> list = expected.get(module);
-                    if (list == null) {
-                        list = new ArrayList<DependencyTail>();
-                        expected.put(module, list);
-                    }
-                    list.add(new DependencyTail(ref.other(), ref.isOptional()));
-                }
-            }
-        } finally {
-            s.close();
-        }
-
-        // parse the actual dependencies file, checking each dependency
-        // against the expected list.
-        boolean fail = false;
-        s = new Scanner(new FileInputStream(args[1]));
-        try {
-            while (s.hasNextLine()) {
-                Dependency dep = Dependency.fromString(s.nextLine());
-
-                // check if this dependency is expected
-                List<DependencyTail> list = expected.get(dep.module());
-                DependencyTail tail = null;
-                if (list != null) {
-                    for (DependencyTail t: list) {
-                        if (t.module().equals(dep.other())) {
-                            tail = t;
-                            break;
-                        }
-                    }
-                }
-                if (tail == null) {
-                    System.err.println("Unexpected dependency: " + dep);
-                    fail = true;
-                } else {
-                    // hard dependency when optional dependency is expected
-                    if (tail.isOptional() != dep.isOptional()) {
-                        if (tail.isOptional()) {
-                            System.err.println("Unexpected dependency: " + dep);
-                            fail = true;
-                        }
-                    }
-                }
-            }
-        } finally {
-            s.close();
-        }
-
-        if (fail)
-            throw new RuntimeException("Unexpected dependencies found");
-    }
-}
--- a/jdk/make/modules/tools/src/com/sun/classanalyzer/ClassAnalyzer.java	Tue Mar 15 19:52:42 2011 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,354 +0,0 @@
-/*
- * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.sun.classanalyzer;
-
-import com.sun.classanalyzer.AnnotatedDependency.*;
-import com.sun.classanalyzer.Module.Dependency;
-import com.sun.classanalyzer.Module.PackageInfo;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-import java.io.File;
-import java.io.PrintWriter;
-import java.util.Map;
-import java.util.Set;
-import java.util.TreeMap;
-import java.util.TreeSet;
-
-/**
- *
- * @author Mandy Chung
- */
-public class ClassAnalyzer {
-
-    public static void main(String[] args) throws Exception {
-        String jdkhome = null;
-        String cpath = null;
-        List<String> configs = new ArrayList<String>();
-        List<String> depconfigs = new ArrayList<String>();
-        String output = ".";
-        boolean mergeModules = true;
-        boolean showDynamic = false;
-
-        // process arguments
-        int i = 0;
-        while (i < args.length) {
-            String arg = args[i++];
-            if (arg.equals("-jdkhome")) {
-                if (i < args.length) {
-                    jdkhome = args[i++];
-                } else {
-                    usage();
-                }
-            } else if (arg.equals("-cpath")) {
-                if (i < args.length) {
-                    cpath = args[i++];
-                } else {
-                    usage();
-                }
-            } else if (arg.equals("-config")) {
-                if (i < args.length) {
-                    configs.add(args[i++]);
-                } else {
-                    usage();
-                }
-            } else if (arg.equals("-depconfig")) {
-                if (i < args.length) {
-                    depconfigs.add(args[i++]);
-                } else {
-                    usage();
-                }
-            } else if (arg.equals("-output")) {
-                if (i < args.length) {
-                    output = args[i++];
-                } else {
-                    usage();
-                }
-            } else if (arg.equals("-base")) {
-                ModuleConfig.setBaseModule(args[i++]);
-            } else if (arg.equals("-nomerge")) {
-                // analyze the fine-grained module dependencies
-                mergeModules = false;
-            } else if (arg.equals("-showdynamic")) {
-                showDynamic = true;
-            } else {
-                System.err.println("Invalid option: " + arg);
-                usage();
-            }
-        }
-
-        if ((jdkhome == null && cpath == null) || (jdkhome != null && cpath != null)) {
-            usage();
-        }
-        if (configs.isEmpty()) {
-            usage();
-        }
-
-        if (jdkhome != null) {
-            ClassPath.setJDKHome(jdkhome);
-        } else if (cpath != null) {
-            ClassPath.setClassPath(cpath);
-        }
-
-        // create output directory if it doesn't exist
-        File dir = new File(output);
-        if (!dir.isDirectory()) {
-            if (!dir.exists()) {
-                boolean created = dir.mkdir();
-                if (!created) {
-                    throw new RuntimeException("Unable to create `" + dir + "'");
-                }
-            }
-        }
-
-        buildModules(configs, depconfigs, mergeModules);
-
-        // generate output files
-        for (Module m : modules) {
-            // only generate reports for top-level modules
-            if (m.group() == m) {
-                m.printClassListTo(resolve(dir, m.name(), "classlist"));
-                m.printResourceListTo(resolve(dir, m.name(), "resources"));
-                m.printSummaryTo(resolve(dir, m.name(), "summary"));
-                m.printDependenciesTo(resolve(dir, m.name(), "dependencies"), showDynamic);
-            }
-        }
-
-        // Generate other summary reports
-        printModulesSummary(dir, showDynamic);
-        printModulesDot(dir, showDynamic);
-        printModulesList(dir);
-        printPackagesSummary(dir);
-    }
-    private static List<Module> modules = new ArrayList<Module>();
-
-    static void buildModules(List<String> configs,
-            List<String> depconfigs,
-            boolean mergeModules) throws IOException {
-        // create modules based on the input config files
-        for (String file : configs) {
-            for (ModuleConfig mconfig : ModuleConfig.readConfigurationFile(file)) {
-                modules.add(Module.addModule(mconfig));
-            }
-        }
-
-        // parse class files
-        ClassPath.parseAllClassFiles();
-
-        // Add additional dependencies if specified
-        if (depconfigs != null && depconfigs.size() > 0) {
-            DependencyConfig.parse(depconfigs);
-        }
-
-        // process the roots and dependencies to get the classes for each module
-        for (Module m : modules) {
-            m.processRootsAndReferences();
-        }
-
-        // update the dependencies for classes that were subsequently allocated
-        // to modules
-        for (Module m : modules) {
-            m.fixupDependencies();
-        }
-
-        if (mergeModules) {
-            Module.buildModuleMembers();
-        }
-    }
-
-    private static void printModulesSummary(File dir, boolean showDynamic) throws IOException {
-        // print summary of dependencies
-        PrintWriter writer = new PrintWriter(new File(dir, "modules.summary"));
-        try {
-            for (Module m : modules) {
-                // only show top-level module dependencies
-                if (m.group() == m) {
-                    for (Dependency dep : m.dependents()) {
-                        if (!showDynamic && dep.dynamic && dep.optional) {
-                            continue;
-                        }
-                        if (dep.module == null || !dep.module.isBase()) {
-
-                            String prefix = "";
-                            if (dep.optional) {
-                                if (dep.dynamic) {
-                                    prefix = "[dynamic] ";
-                                } else {
-                                    prefix = "[optional] ";
-                                }
-                            }
-
-                            Module other = dep != null ? dep.module : null;
-                            writer.format("%s%s -> %s%n", prefix, m, other);
-                        }
-                    }
-                }
-            }
-        } finally {
-            writer.close();
-        }
-    }
-
-    private static void printModulesDot(File dir, boolean showDynamic) throws IOException {
-        PrintWriter writer = new PrintWriter(new File(dir, "modules.dot"));
-        try {
-            writer.println("digraph jdk {");
-            for (Module m : modules) {
-                if (m.group() == m) {
-                    for (Dependency dep : m.dependents()) {
-                        if (!showDynamic && dep.dynamic && dep.optional) {
-                            continue;
-                        }
-                        if (dep.module == null || !dep.module.isBase()) {
-                            String style = "";
-                            String color = "";
-                            String property = "";
-                            if (dep.optional) {
-                                style = "style=dotted";
-                            }
-                            if (dep.dynamic) {
-                                color = "color=red";
-                            }
-                            if (style.length() > 0 || color.length() > 0) {
-                                String comma = "";
-                                if (style.length() > 0 && color.length() > 0) {
-                                    comma = ", ";
-                                }
-                                property = String.format(" [%s%s%s]", style, comma, color);
-                            }
-                            Module other = dep != null ? dep.module : null;
-                            writer.format("    \"%s\" -> \"%s\"%s;%n", m, other, property);
-                        }
-                    }
-                }
-            }
-            writer.println("}");
-        } finally {
-            writer.close();
-        }
-    }
-
-    private static void printMembers(Module m, PrintWriter writer) {
-        for (Module member : m.members()) {
-            if (!member.isEmpty()) {
-                writer.format("%s ", member);
-                printMembers(member, writer);
-            }
-        }
-    }
-
-    private static void printModulesList(File dir) throws IOException {
-        // print module group / members relationship
-        PrintWriter writer = new PrintWriter(new File(dir, "modules.list"));
-        try {
-            for (Module m : modules) {
-                if (m.group() == m && !m.isEmpty()) {
-                    writer.format("%s ", m);
-                    printMembers(m, writer);
-                    writer.println();
-                }
-            }
-        } finally {
-            writer.close();
-        }
-    }
-
-    private static void printPackagesSummary(File dir) throws IOException {
-        // print package / module relationship
-        PrintWriter writer = new PrintWriter(new File(dir, "modules.pkginfo"));
-        try {
-            Map<String, Set<Module>> packages = new TreeMap<String, Set<Module>>();
-            Set<String> splitPackages = new TreeSet<String>();
-
-            for (Module m : modules) {
-                if (m.group() == m) {
-                    for (PackageInfo info : m.getPackageInfos()) {
-                        Set<Module> value = packages.get(info.pkgName);
-                        if (value == null) {
-                            value = new TreeSet<Module>();
-                            packages.put(info.pkgName, value);
-                        } else {
-                            // package in more than one module
-                            splitPackages.add(info.pkgName);
-                        }
-                        value.add(m);
-                    }
-                }
-            }
-
-            // packages that are splitted among multiple modules
-            writer.println("Packages splitted across modules:-\n");
-            writer.format("%-60s  %s\n", "Package", "Module");
-
-            for (String pkgname : splitPackages) {
-                writer.format("%-60s", pkgname);
-                for (Module m : packages.get(pkgname)) {
-                    writer.format("  %s", m);
-                }
-                writer.println();
-            }
-
-            writer.println("\nPackage-private dependencies:-");
-            for (String pkgname : splitPackages) {
-                for (Klass k : Klass.getAllClasses()) {
-                    if (k.getPackageName().equals(pkgname)) {
-                        Module m = k.getModule();
-                        // check if this klass references a package-private
-                        // class that is in a different module
-                        for (Klass other : k.getReferencedClasses()) {
-                            if (other.getModule() != m &&
-                                    !other.isPublic() &&
-                                    other.getPackageName().equals(pkgname)) {
-                                String from = k.getClassName() + " (" + m + ")";
-                                writer.format("%-60s -> %s (%s)\n", from, other, other.getModule());
-                            }
-                        }
-                    }
-                }
-            }
-        } finally {
-            writer.close();
-        }
-
-    }
-
-    private static String resolve(File dir, String mname, String suffix) {
-        File f = new File(dir, mname + "." + suffix);
-        return f.toString();
-
-    }
-
-    private static void usage() {
-        System.out.println("Usage: ClassAnalyzer <options>");
-        System.out.println("Options: ");
-        System.out.println("\t-jdkhome <JDK home> where all jars will be parsed");
-        System.out.println("\t-cpath   <classpath> where classes and jars will be parsed");
-        System.out.println("\t         Either -jdkhome or -cpath option can be used.");
-        System.out.println("\t-config  <module config file>");
-        System.out.println("\t         This option can be repeated for multiple module config files");
-        System.out.println("\t-output  <output dir>");
-        System.out.println("\t-nomerge specify not to merge modules");
-        System.out.println("\t-showdynamic show dynamic dependencies in the reports");
-        System.exit(-1);
-    }
-}
--- a/jdk/make/modules/tools/src/com/sun/classanalyzer/ClassFileParser.java	Tue Mar 15 19:52:42 2011 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,629 +0,0 @@
-/*
- * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-package com.sun.classanalyzer;
-
-import com.sun.tools.classfile.*;
-import com.sun.tools.classfile.Type.*;
-import com.sun.tools.classfile.Descriptor.InvalidDescriptor;
-import static com.sun.tools.classfile.AccessFlags.*;
-
-import java.io.BufferedInputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.List;
-import java.util.Set;
-import java.util.TreeSet;
-
-/**
- *
- * @author Mandy Chung
- */
-public class ClassFileParser {
-
-    final Klass this_klass;
-    final ClassFile classfile;
-    final ConstantPoolParser constantPoolParser;
-    final AnnotationParser annotationParser;
-    final CodeAttributeParser codeAttributeParser;
-    private final boolean buildDeps;
-
-    protected ClassFileParser(InputStream in, long size, boolean buildDeps) throws IOException {
-        try {
-            this.classfile = ClassFile.read(in);
-            this.this_klass = getKlass(this.classfile);
-            this.buildDeps = buildDeps;
-            this.constantPoolParser = new ConstantPoolParser(this);
-            this.annotationParser = new AnnotationParser(this);
-            this.codeAttributeParser = new CodeAttributeParser(this);
-        } catch (ConstantPoolException ex) {
-            throw new RuntimeException(ex);
-        }
-    }
-
-    private Klass getKlass(ClassFile cf) throws ConstantPoolException {
-        Klass k = Klass.getKlass(cf.getName());
-        k.setAccessFlags(cf.access_flags.flags);
-        k.setFileSize(cf.byteLength());
-        return k;
-    }
-
-    public static ClassFileParser newParser(InputStream in, long size, boolean buildDeps) throws IOException {
-        return new ClassFileParser(in, size, buildDeps);
-    }
-
-    public static ClassFileParser newParser(String classPathname, boolean buildDeps) throws IOException {
-        return newParser(new File(classPathname), buildDeps);
-    }
-
-    public static ClassFileParser newParser(File f, boolean buildDeps) throws IOException {
-        BufferedInputStream in = new BufferedInputStream(new FileInputStream(f));
-        try {
-            return newParser(in, f.length(), buildDeps);
-        } finally {
-            in.close();
-        }
-    }
-
-    public void parseDependency(boolean publicAPIs) throws IOException {
-        if (publicAPIs && !classfile.access_flags.is(ACC_PUBLIC)) {
-            // process public APIs only
-            return;
-        }
-
-        parseClassInfo();
-        if (!publicAPIs) {
-            // parse all references in the classfile
-            constantPoolParser.parseDependency();
-        }
-        parseMethods(publicAPIs);
-        parseFields(publicAPIs);
-    }
-
-    void parseClassInfo() throws IOException {
-        ConstantPool cpool = classfile.constant_pool;
-        try {
-            Signature_attribute sigAttr = (Signature_attribute) classfile.attributes.get(Attribute.Signature);
-            if (sigAttr == null) {
-                // use info from class file header
-                if (classfile.isClass() && classfile.super_class != 0) {
-                    String sn = classfile.getSuperclassName();
-                    addExtends(sn);
-                }
-                for (int i = 0; i < classfile.interfaces.length; i++) {
-                    String interf = classfile.getInterfaceName(i);
-                    if (classfile.isClass()) {
-                        addImplements(interf);
-                    } else {
-                        addExtends(interf);
-                    }
-                }
-            } else {
-                Type t = sigAttr.getParsedSignature().getType(cpool);
-                // The signature parser cannot disambiguate between a
-                // FieldType and a ClassSignatureType that only contains a superclass type.
-                if (t instanceof Type.ClassSigType) {
-                    Type.ClassSigType cst = Type.ClassSigType.class.cast(t);
-                    if (cst.superclassType != null) {
-                        for (Klass k : getKlass(cst.superclassType)) {
-                            addExtends(k);
-                        }
-                    }
-                    if (cst.superinterfaceTypes != null) {
-                        for (Type t1 : cst.superinterfaceTypes) {
-                            for (Klass k : getKlass(t1)) {
-                                addImplements(k);
-                            }
-                        }
-                    }
-                } else {
-                    for (Klass k : getKlass(t)) {
-                        addExtends(k);
-                    }
-                }
-            }
-            // parse attributes
-            annotationParser.parseAttributes(classfile.attributes);
-        } catch (ConstantPoolException ex) {
-            throw new RuntimeException(ex);
-        }
-    }
-
-    private void parseFields(boolean publicAPIs) throws IOException {
-        ConstantPool cpool = classfile.constant_pool;
-        for (Field f : classfile.fields) {
-            try {
-                AccessFlags flags = f.access_flags;
-                if (publicAPIs && !flags.is(ACC_PUBLIC) && !flags.is(ACC_PROTECTED)) {
-                    continue;
-                }
-                String fieldname = f.getName(cpool);
-                Signature_attribute sigAttr = (Signature_attribute) f.attributes.get(Attribute.Signature);
-
-                if (sigAttr == null) {
-                    Set<Klass> types = parseDescriptor(f.descriptor);
-                    String info = getFlag(flags) + " " + f.descriptor.getFieldType(cpool) + " " + fieldname;
-                    addFieldTypes(types, info, flags);
-                } else {
-                    Type t = sigAttr.getParsedSignature().getType(cpool);
-                    String info = getFlag(flags) + " " + t + " " + fieldname;
-                    addFieldTypes(getKlass(t), info, flags);
-                }
-                // parse attributes
-                annotationParser.parseAttributes(f.attributes);
-            } catch (ConstantPoolException ex) {
-                throw new RuntimeException(ex);
-            } catch (InvalidDescriptor ex) {
-                throw new RuntimeException(ex);
-            }
-        }
-    }
-
-    private void parseMethods(boolean publicAPIs) {
-        for (Method m : classfile.methods) {
-            if (publicAPIs && !m.access_flags.is(ACC_PUBLIC) && !m.access_flags.is(ACC_PROTECTED)) {
-                // only interest in the API level
-                return;
-            }
-
-            parseMethod(m);
-        }
-    }
-
-    String checkClassName(String classname) {
-        int i = 0;
-        while (i < classname.length()) {
-            switch (classname.charAt(i)) {
-                case 'Z':
-                case 'B':
-                case 'C':
-                case 'S':
-                case 'I':
-                case 'J':
-                case 'F':
-                case 'D':
-                    return "";
-                case 'L':
-                    if (!classname.endsWith(";")) {
-                        throw new RuntimeException("Invalid classname " + classname);
-                    }
-                    return classname.substring(i + 1, classname.length() - 1);
-                case '[':
-                    i++;
-                    break;
-                default:
-                    if (classname.endsWith(";")) {
-                        throw new RuntimeException("Invalid classname " + classname);
-                    }
-                    return classname;
-
-            }
-        }
-        throw new RuntimeException("Invalid classname " + classname);
-    }
-
-    private void addExtends(String classname) throws IOException {
-        if (!buildDeps) {
-            return;
-        }
-
-        addExtends(Klass.getKlass(classname));
-    }
-
-    private void addExtends(Klass k) {
-        if (!buildDeps) {
-            return;
-        }
-
-        ResolutionInfo resInfo = ResolutionInfo.resolvedExtends(this_klass, k);
-        resInfo.setPublicAccess(classfile.access_flags.is(ACC_PUBLIC));
-        this_klass.addDep(k, resInfo);
-        k.addReferrer(this_klass, resInfo);
-    }
-
-    private void addImplements(String classname) throws IOException {
-        if (!buildDeps) {
-            return;
-        }
-
-        addImplements(Klass.getKlass(classname));
-    }
-
-    private void addImplements(Klass k) {
-        if (!buildDeps) {
-            return;
-        }
-
-        ResolutionInfo resInfo = ResolutionInfo.resolvedImplements(this_klass, k);
-        resInfo.setPublicAccess(classfile.access_flags.is(ACC_PUBLIC));
-
-        this_klass.addDep(k, resInfo);
-
-        k.addReferrer(this_klass, resInfo);
-    }
-
-    private Set<Klass> getKlass(Type type) throws IOException {
-        Set<Klass> refTypes = new TreeSet<Klass>();
-        if (!buildDeps) {
-            return refTypes;
-        }
-
-        type.accept(typevisitor, refTypes);
-        return refTypes;
-    }
-    private Type.Visitor<Void, Set<Klass>> typevisitor = new Type.Visitor<Void, Set<Klass>>() {
-
-        public Void visitSimpleType(SimpleType type, Set<Klass> klasses) {
-            // nop
-            return null;
-        }
-
-        public Void visitArrayType(ArrayType type, Set<Klass> klasses) {
-            try {
-                klasses.addAll(getKlass(type.elemType));
-            } catch (IOException ex) {
-                throw new RuntimeException(ex);
-            }
-            return null;
-
-        }
-
-        public Void visitMethodType(MethodType type, Set<Klass> klasses) {
-            throw new InternalError("Unexpected type " + type);
-        }
-
-        public Void visitClassSigType(ClassSigType type, Set<Klass> klasses) {
-            try {
-                if (type.superclassType != null) {
-                    klasses.addAll(getKlass(type.superclassType));
-                }
-                if (type.superinterfaceTypes != null) {
-                    for (Type t : type.superinterfaceTypes) {
-                        klasses.addAll(getKlass(t));
-                    }
-                }
-                if (type.typeParamTypes != null) {
-                    for (Type t : type.typeParamTypes) {
-                        klasses.addAll(getKlass(t));
-                    }
-                }
-            } catch (IOException ex) {
-                throw new RuntimeException(ex);
-            }
-            return null;
-        }
-
-        public Void visitClassType(ClassType type, Set<Klass> klasses) {
-            klasses.add(Klass.getKlass(type.getBinaryName()));
-            if (type.typeArgs != null) {
-                for (Type t : type.typeArgs) {
-                    try {
-                        klasses.addAll(getKlass(t));
-                    } catch (IOException ex) {
-                        throw new RuntimeException(ex);
-                    }
-                }
-            }
-            return null;
-
-        }
-
-        public Void visitTypeParamType(TypeParamType type, Set<Klass> klasses) {
-            try {
-                if (type.classBound != null) {
-                    klasses.addAll(getKlass(type.classBound));
-                }
-                if (type.interfaceBounds != null) {
-                    for (Type t : type.interfaceBounds) {
-                        klasses.addAll(getKlass(t));
-                    }
-                }
-
-            } catch (IOException ex) {
-                throw new RuntimeException(ex);
-            }
-
-            return null;
-
-        }
-
-        public Void visitWildcardType(WildcardType type, Set<Klass> klasses) {
-            if (type.boundType != null) {
-                try {
-                    klasses.addAll(getKlass(type.boundType));
-                } catch (IOException ex) {
-                    throw new RuntimeException(ex);
-                }
-            }
-            return null;
-
-        }
-    };
-
-    private void printMethod(Method m) {
-        try {
-            System.out.println("parsing " + m.getName(classfile.constant_pool) + "(" +
-                    m.descriptor.getParameterTypes(classfile.constant_pool) + ") return type " +
-                    m.descriptor.getReturnType(classfile.constant_pool));
-
-        } catch (ConstantPoolException ex) {
-        } catch (InvalidDescriptor ex) {
-        }
-    }
-
-    private static StringBuilder appendWord(StringBuilder sb, String word) {
-        if (sb.length() > 0) {
-            sb.append(" ");
-        }
-        sb.append(word);
-        return sb;
-    }
-
-    private static String getFlag(AccessFlags flags) {
-        StringBuilder modifier = new StringBuilder();
-        if (flags.is(ACC_PUBLIC)) {
-            modifier.append("public");
-        }
-        if (flags.is(ACC_PRIVATE)) {
-            modifier.append("private");
-        }
-        if (flags.is(ACC_PROTECTED)) {
-            modifier.append("protected");
-        }
-        if (flags.is(ACC_STATIC)) {
-            appendWord(modifier, "static");
-        }
-        if (flags.is(ACC_FINAL)) {
-            appendWord(modifier, "final");
-        }
-        if (flags.is(ACC_SYNCHRONIZED)) {
-            // return "synchronized";
-        }
-        if (flags.is(0x80)) {
-            // return (t == Type.Field ? "transient" : null);
-            // return "transient";
-        }
-        if (flags.is(ACC_VOLATILE)) {
-            // return "volatile";
-        }
-        if (flags.is(ACC_NATIVE)) {
-            // return "native";
-        }
-        if (flags.is(ACC_ABSTRACT)) {
-            appendWord(modifier, "abstract");
-        }
-        if (flags.is(ACC_STRICT)) {
-            // return "strictfp";
-        }
-        if (flags.is(ACC_MODULE)) {
-            appendWord(modifier, "module");
-        }
-        return modifier.toString();
-    }
-
-    private Klass.Method toKlassMethod(Method m, Descriptor d) {
-        try {
-            ConstantPool cpool = classfile.constant_pool;
-            String methodname = m.getName(cpool);
-            StringBuilder sb = new StringBuilder();
-            sb.append(getFlag(m.access_flags));
-            if (methodname.equals("<init>")) {
-                String s = this_klass.getBasename() + d.getParameterTypes(cpool);
-                appendWord(sb, s);
-            } else if (methodname.equals("<clinit>")) {
-                // <clinit>
-                appendWord(sb, methodname);
-            } else {
-                String s = d.getReturnType(cpool) + " " + methodname + d.getParameterTypes(cpool);
-                appendWord(sb, s);
-            }
-            String signature = sb.toString().replace('/', '.');
-            return this_klass.getMethod(methodname, signature);
-        } catch (ConstantPoolException ex) {
-            throw new RuntimeException(ex);
-        } catch (InvalidDescriptor ex) {
-            throw new RuntimeException(ex);
-        }
-    }
-
-    Klass.Method parseMethod(Method m) {
-        AccessFlags flags = m.access_flags;
-        Descriptor d;
-        List<? extends Type> methodExceptions = null;
-        try {
-            ConstantPool cpool = classfile.constant_pool;
-            Klass.Method kmethod;
-            Signature_attribute sigAttr = (Signature_attribute) m.attributes.get(Attribute.Signature);
-            if (sigAttr == null) {
-                d = m.descriptor;
-                Set<Klass> types = parseDescriptor(d);
-
-                kmethod = toKlassMethod(m, d);
-                addMethodTypes(types, kmethod, flags);
-            } else {
-                Type.MethodType methodType;
-                Signature methodSig = sigAttr.getParsedSignature();
-                d = methodSig;
-                try {
-                    kmethod = toKlassMethod(m, d);
-                    methodType = (Type.MethodType) methodSig.getType(cpool);
-                    addMethodTypes(getKlass(methodType.returnType), kmethod, flags);
-                    if (methodType.paramTypes != null) {
-                        for (Type t : methodType.paramTypes) {
-                            addMethodTypes(getKlass(t), kmethod, flags);
-                        }
-                    }
-                    if (methodType.typeParamTypes != null) {
-                        for (Type t : methodType.typeParamTypes) {
-                            addMethodTypes(getKlass(t), kmethod, flags);
-                        }
-                    }
-
-                    methodExceptions = methodType.throwsTypes;
-                    if (methodExceptions != null) {
-                        if (methodExceptions.size() == 0) {
-                            methodExceptions = null;
-                        } else {
-                            for (Type t : methodExceptions) {
-                                addCheckedExceptionTypes(getKlass(t), kmethod, flags);
-                            }
-                        }
-                    }
-                } catch (ConstantPoolException e) {
-                    throw new RuntimeException(e);
-                }
-            }
-
-            Attribute e_attr = m.attributes.get(Attribute.Exceptions);
-            if (e_attr != null && methodExceptions == null) {
-                // if there are generic exceptions, there must be erased exceptions
-                if (e_attr instanceof Exceptions_attribute) {
-                    Exceptions_attribute exceptions = (Exceptions_attribute) e_attr;
-                    for (int i = 0; i < exceptions.number_of_exceptions; i++) {
-                        String classname = checkClassName(exceptions.getException(i, classfile.constant_pool));
-                        if (classname.length() > 0 && buildDeps) {
-                            Klass to = Klass.getKlass(classname);
-                            ResolutionInfo resInfo = ResolutionInfo.resolvedCheckedException(this_klass, to, kmethod);
-                            resInfo.setPublicAccess(flags.is(ACC_PUBLIC));
-
-                            this_klass.addDep(to, resInfo);
-                            to.addReferrer(this_klass, resInfo);
-                        }
-                    }
-                } else {
-                    throw new RuntimeException("Invalid attribute: " + e_attr);
-                }
-            }
-
-            Code_attribute c_attr = (Code_attribute) m.attributes.get(Attribute.Code);
-            if (c_attr != null) {
-                codeAttributeParser.parse(c_attr, kmethod);
-            }
-            kmethod.isAbstract = classfile.access_flags.is(ACC_ABSTRACT);
-            kmethod.setCodeLength(m.byteLength());
-
-            // parse annotation attributes
-            annotationParser.parseAttributes(m.attributes, kmethod);
-            return kmethod;
-        } catch (ConstantPoolException ex) {
-            throw new RuntimeException(ex);
-        } catch (IOException ex) {
-            throw new RuntimeException(ex);
-        }
-    }
-
-    private void addFieldTypes(Set<Klass> types, String info, AccessFlags flags) {
-        if (types.isEmpty() || !buildDeps) {
-            return;
-        }
-
-        for (Klass to : types) {
-            ResolutionInfo resInfo = ResolutionInfo.resolvedField(this_klass, to, info);
-            resInfo.setPublicAccess(flags.is(ACC_PUBLIC));
-
-            this_klass.addDep(to, resInfo);
-            to.addReferrer(this_klass, resInfo);
-        }
-    }
-
-    private void addReferencedTypes(Method m, Descriptor d, AccessFlags flags) {
-        Set<Klass> types = parseDescriptor(d);
-
-        Klass.Method method = toKlassMethod(m, d);
-        addMethodTypes(types, method, flags);
-    }
-
-    private void addMethodTypes(Set<Klass> types, Klass.Method method, AccessFlags flags) {
-        if (types.isEmpty() || !buildDeps) {
-            return;
-        }
-        for (Klass to : types) {
-            ResolutionInfo resInfo = ResolutionInfo.resolvedMethodSignature(this_klass, to, method);
-            resInfo.setPublicAccess(flags.is(ACC_PUBLIC));
-
-            this_klass.addDep(to, resInfo);
-            to.addReferrer(this_klass, resInfo);
-        }
-    }
-
-    private void addCheckedExceptionTypes(Set<Klass> types, Klass.Method method, AccessFlags flags) {
-        if (types.isEmpty() || !buildDeps) {
-            return;
-        }
-        for (Klass to : types) {
-            ResolutionInfo resInfo = ResolutionInfo.resolvedCheckedException(this_klass, to, method);
-            resInfo.setPublicAccess(flags.is(ACC_PUBLIC));
-
-            this_klass.addDep(to, resInfo);
-            to.addReferrer(this_klass, resInfo);
-        }
-    }
-
-    private Set<Klass> parseDescriptor(Descriptor d) {
-        Set<Klass> types = new TreeSet<Klass>();
-        try {
-            String desc = d.getValue(classfile.constant_pool);
-            int p = 0;
-            while (p < desc.length()) {
-                String type;
-                char ch;
-                switch (ch = desc.charAt(p++)) {
-                    case '(':
-                    case ')':
-                    case '[':
-                    case 'B':
-                    case 'C':
-                    case 'D':
-                    case 'F':
-                    case 'I':
-                    case 'J':
-                    case 'S':
-                    case 'Z':
-                    case 'V':
-                        continue;
-                    case 'L':
-                        int sep = desc.indexOf(';', p);
-                        if (sep == -1) {
-                            throw new RuntimeException("Invalid descriptor: " + (p - 1) + " " + desc);
-                        }
-                        type = checkClassName(desc.substring(p, sep));
-                        p = sep + 1;
-                        break;
-                    default:
-                        throw new RuntimeException("Invalid descriptor: " + (p - 1) + " " + desc);
-                }
-
-                if (!type.isEmpty() && buildDeps) {
-                    Klass to = Klass.getKlass(type);
-                    types.add(to);
-
-                }
-            }
-        } catch (ConstantPoolException ex) {
-            throw new RuntimeException(ex);
-        }
-        return types;
-    }
-}
--- a/jdk/make/modules/tools/src/com/sun/classanalyzer/ClassPath.java	Tue Mar 15 19:52:42 2011 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,275 +0,0 @@
-/*
- * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-package com.sun.classanalyzer;
-
-import java.io.BufferedInputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-import java.util.jar.JarEntry;
-import java.util.jar.JarFile;
-
-/**
- *
- * @author mchung
- */
-public class ClassPath {
-
-    public class FileInfo {
-
-        File file;
-        JarFile jarfile;
-        int classCount;
-        long filesize;
-
-        FileInfo(File f) throws IOException {
-            this.file = f;
-            this.classCount = 0;
-            if (file.getName().endsWith(".jar")) {
-                this.filesize = file.length();
-                jarfile = new JarFile(f);
-            }
-        }
-
-        File getFile() {
-            return file;
-        }
-
-        JarFile getJarFile() {
-            return jarfile;
-        }
-
-        String getName() throws IOException {
-            return file.getCanonicalPath();
-        }
-    }
-    private List<FileInfo> fileList = new ArrayList<FileInfo>();
-    private static ClassPath instance = new ClassPath();
-
-    static List<FileInfo> getFileInfos() {
-        return instance.fileList;
-    }
-
-    static ClassPath setJDKHome(String jdkhome) throws IOException {
-        List<File> files = new ArrayList<File>();
-        File jre = new File(jdkhome, "jre");
-        File lib = new File(jdkhome, "lib");
-        if (jre.exists() && jre.isDirectory()) {
-            listFiles(new File(jre, "lib"), ".jar", files);
-        } else if (lib.exists() && lib.isDirectory()) {
-            // either a JRE or a jdk build image
-            listFiles(lib, ".jar", files);
-
-            File classes = new File(jdkhome, "classes");
-            if (classes.exists() && classes.isDirectory()) {
-                // jdk build outputdir
-                instance.add(classes);
-            }
-        } else {
-            throw new RuntimeException("\"" + jdkhome + "\" not a JDK home");
-        }
-
-        for (File f : files) {
-            instance.add(f);
-        }
-        return instance;
-    }
-
-    static ClassPath setClassPath(String path) throws IOException {
-        if (path.endsWith(".class")) {
-            // one class file
-            File f = new File(path);
-            if (!f.exists()) {
-                throw new RuntimeException("Classfile \"" + f + "\" doesn't exist");
-            }
-
-            instance.add(f);
-        } else {
-            List<File> jarFiles = new ArrayList<File>();
-            String[] locs = path.split(File.pathSeparator);
-            for (String p : locs) {
-                File f = new File(p);
-                if (!f.exists()) {
-                    throw new RuntimeException("\"" + f + "\" doesn't exist");
-                }
-
-                if (f.isDirectory()) {
-                    instance.add(f);  // add the directory to look up .class files
-                    listFiles(f, ".jar", jarFiles);
-                } else if (p.endsWith(".jar")) {
-                    // jar files
-                    jarFiles.add(f);
-                } else {
-                    throw new RuntimeException("Invalid file \"" + f);
-                }
-            }
-            // add jarFiles if any
-            for (File f : jarFiles) {
-                instance.add(f);
-            }
-        }
-
-        return instance;
-    }
-
-    private void add(File f) throws IOException {
-        fileList.add(new FileInfo(f));
-    }
-
-    public static InputStream open(String pathname) throws IOException {
-        for (FileInfo fi : instance.fileList) {
-            if (fi.getName().endsWith(".jar")) {
-                String path = pathname.replace(File.separatorChar, '/');
-                JarEntry e = fi.jarfile.getJarEntry(path);
-                if (e != null) {
-                    return fi.jarfile.getInputStream(e);
-                }
-            } else if (fi.getFile().isDirectory()) {
-                File f = new File(fi.getFile(), pathname);
-                if (f.exists()) {
-                    return new FileInputStream(f);
-                }
-            } else if (fi.file.isFile()) {
-                if (fi.getName().endsWith(File.separator + pathname)) {
-                    return new FileInputStream(fi.file);
-                }
-            }
-        }
-        return null;
-    }
-
-    static ClassFileParser parserForClass(String classname) throws IOException {
-        String pathname = classname.replace('.', File.separatorChar) + ".class";
-
-        ClassFileParser cfparser = null;
-        for (FileInfo fi : instance.fileList) {
-            if (fi.getName().endsWith(".class")) {
-                if (fi.getName().endsWith(File.separator + pathname)) {
-                    cfparser = ClassFileParser.newParser(fi.getFile(), true);
-                    break;
-                }
-            } else if (fi.getName().endsWith(".jar")) {
-                JarEntry e = fi.jarfile.getJarEntry(classname.replace('.', '/') + ".class");
-                if (e != null) {
-                    cfparser = ClassFileParser.newParser(fi.jarfile.getInputStream(e), e.getSize(), true);
-                    break;
-                }
-            } else if (fi.getFile().isDirectory()) {
-                File f = new File(fi.getFile(), pathname);
-                if (f.exists()) {
-                    cfparser = ClassFileParser.newParser(f, true);
-                    break;
-                }
-            }
-        }
-        return cfparser;
-    }
-
-    public static void parseAllClassFiles() throws IOException {
-        instance.parseFiles();
-    }
-
-    private void parseFiles() throws IOException {
-        Set<Klass> classes = new HashSet<Klass>();
-
-        int count = 0;
-        for (FileInfo fi : fileList) {
-            // filter out public generated classes (i.e. not public API)
-            // javax.management.remote.rmi._RMIConnectionImpl_Tie
-            // javax.management.remote.rmi._RMIServerImpl_Tie
-            if (fi.getName().endsWith(".class")) {
-                parseClass(fi);
-            } else if (fi.getName().endsWith(".jar")) {
-                Enumeration<JarEntry> entries = fi.jarfile.entries();
-                while (entries.hasMoreElements()) {
-                    JarEntry e = entries.nextElement();
-                    if (e.getName().endsWith(".class")) {
-                        ClassFileParser cfparser = ClassFileParser.newParser(fi.jarfile.getInputStream(e), e.getSize(), true);
-                        cfparser.parseDependency(false);
-                        fi.classCount++;
-                    } else if (!e.isDirectory() && ResourceFile.isResource(e.getName())) {
-                        ResourceFile.addResource(e.getName(), fi.jarfile.getInputStream(e));
-                    }
-                }
-            } else if (fi.getFile().isDirectory()) {
-                List<File> files = new ArrayList<File>();
-                listFiles(fi.getFile(), "", files);
-                for (File f : files) {
-                    if (f.getName().endsWith(".class")) {
-                        parseClass(fi, f);
-                    } else if (!f.isDirectory() && ResourceFile.isResource(f.getCanonicalPath())) {
-                        String pathname = f.getCanonicalPath();
-                        String dir = fi.getName();
-                        if (!pathname.startsWith(dir)) {
-                            throw new RuntimeException("Incorrect pathname " + pathname);
-                        }
-                        String name = pathname.substring(dir.length() + 1, pathname.length());
-                        BufferedInputStream in = new BufferedInputStream(new FileInputStream(f));
-                        try {
-                            ResourceFile.addResource(name, in);
-                        } finally {
-                            in.close();
-                        }
-                    }
-                }
-            } else {
-                // should not reach here
-                throw new RuntimeException("Unexpected class path: " + fi.getFile());
-            }
-        }
-    }
-
-    private void parseClass(FileInfo fi) throws IOException {
-        parseClass(fi, fi.getFile());
-    }
-
-    private void parseClass(FileInfo fi, File f) throws IOException {
-        ClassFileParser cfparser = ClassFileParser.newParser(f, true);
-        cfparser.parseDependency(false);
-        fi.classCount++;
-        // need to update the filesize for this directory
-        fi.filesize += fi.getFile().length();
-
-    }
-
-    public static void listFiles(File path, String suffix, List<File> result) {
-        if (path.isDirectory()) {
-            File[] children = path.listFiles();
-            for (File c : children) {
-                listFiles(c, suffix, result);
-            }
-
-        } else {
-            if (suffix.isEmpty() || path.getName().endsWith(suffix)) {
-                result.add(path);
-            }
-        }
-    }
-}
--- a/jdk/make/modules/tools/src/com/sun/classanalyzer/CodeAttributeParser.java	Tue Mar 15 19:52:42 2011 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,157 +0,0 @@
-/*
- * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-package com.sun.classanalyzer;
-
-import com.sun.classanalyzer.Klass.Method;
-
-import com.sun.tools.classfile.*;
-import com.sun.tools.classfile.Instruction.*;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
-import java.util.TreeSet;
-
-/**
- *
- * @author Mandy Chung
- */
-public class CodeAttributeParser {
-    private final ClassFileParser cfparser;
-    private final ConstantPool cpool;
-    private final ConstantPoolParser constantPoolParser;
-
-
-    static final Map<String, Set<Method>> runtimeReferences =
-            new HashMap<String, Set<Method>>();
-
-
-    CodeAttributeParser(ClassFileParser parser) {
-        this.cfparser = parser;
-        this.cpool = cfparser.classfile.constant_pool;
-        this.constantPoolParser = cfparser.constantPoolParser;
-    }
-
-    static boolean parseCodeAttribute = false; // by default don't parse code attribute
-    static void setParseCodeAttribute(boolean newValue) {
-        parseCodeAttribute = newValue;
-    }
-
-    void parse(Code_attribute attr, Klass.Method method) {
-        if (!parseCodeAttribute) {
-            return;
-        }
-
-        for (Instruction instr : attr.getInstructions()) {
-            try {
-                instr.accept(instructionVisitor, method);
-            } catch (ArrayIndexOutOfBoundsException e) {
-                throw new RuntimeException("error at or after byte " + instr.getPC());
-            }
-
-        }
-
-        if (attr.exception_table_langth > 0) {
-            for (int i = 0; i <
-                    attr.exception_table.length; i++) {
-                Code_attribute.Exception_data handler = attr.exception_table[i];
-                int catch_type = handler.catch_type;
-                if (catch_type > 0) {
-                    addMethodReference(catch_type, method);
-                }
-
-            }
-        }
-
-    }
-
-
-    private void addMethodReference(int index, Klass.Method m) {
-        String method = constantPoolParser.getMethodName(index);
-
-        if (method != null &&
-               (method.equals("java.lang.Class.forName") ||
-                method.equals("java.lang.Class.loadClass") ||
-                method.startsWith("java.util.ServiceLoader.load") ||
-                method.equals("sun.misc.Service.providers"))) {
-            Set<Method> refs = runtimeReferences.get(method);
-            if (refs == null) {
-                refs = new TreeSet<Method>();
-                runtimeReferences.put(method, refs);
-            }
-            refs.add(m);
-        }
-    }
-
-    Instruction.KindVisitor<Void, Klass.Method> instructionVisitor =
-            new Instruction.KindVisitor<Void, Klass.Method>() {
-
-                public Void visitNoOperands(Instruction instr, Klass.Method m) {
-                    return null;
-                }
-
-                public Void visitArrayType(Instruction instr, TypeKind kind, Klass.Method m) {
-                    return null;
-                }
-
-                public Void visitBranch(Instruction instr, int offset, Klass.Method m) {
-                    return null;
-                }
-
-                public Void visitConstantPoolRef(Instruction instr, int index, Klass.Method m) {
-                    addMethodReference(index, m);
-                    return null;
-                }
-
-                public Void visitConstantPoolRefAndValue(Instruction instr, int index, int value, Klass.Method m) {
-                    addMethodReference(index, m);
-                    return null;
-                }
-
-                public Void visitLocal(Instruction instr, int index, Klass.Method m) {
-                    return null;
-                }
-
-                public Void visitLocalAndValue(Instruction instr, int index, int value, Klass.Method m) {
-                    return null;
-                }
-
-                public Void visitLookupSwitch(Instruction instr, int default_, int npairs, int[] matches, int[] offsets, Klass.Method m) {
-                    return null;
-                }
-
-                public Void visitTableSwitch(Instruction instr, int default_, int low, int high, int[] offsets, Klass.Method m) {
-                    return null;
-                }
-
-                public Void visitValue(Instruction instr, int value, Klass.Method m) {
-                    return null;
-                }
-
-                public Void visitUnknown(Instruction instr, Klass.Method m) {
-                    return null;
-                }
-            };
-}
--- a/jdk/make/modules/tools/src/com/sun/classanalyzer/ConstantPoolAnalyzer.java	Tue Mar 15 19:52:42 2011 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.classanalyzer;
-
-/**
- *
- * @author Mandy Chung
- */
-public class ConstantPoolAnalyzer {
-    public static void main(String[] args) throws Exception {
-        String jdkhome = null;
-
-        // process arguments
-        int i = 0;
-        while (i < args.length) {
-            String arg = args[i++];
-            if (arg.equals("-jdkhome")) {
-                if (i < args.length) {
-                    jdkhome = args[i++];
-                } else {
-                    usage();
-                }
-            }
-        }
-        if (jdkhome == null) {
-            usage();
-        }
-        ClassPath.setJDKHome(jdkhome);
-        ClassPath.parseAllClassFiles();
-    }
-
-    private static void usage() {
-        System.out.println("Usage: ConstantPoolAnalyzer <options>");
-        System.out.println("Options: ");
-        System.out.println("\t-jdkhome <JDK home> where all jars will be parsed");
-        System.out.println("\t-cpath <classpath> where classes and jars will be parsed");
-        System.exit(-1);
-    }
-}
--- a/jdk/make/modules/tools/src/com/sun/classanalyzer/ConstantPoolParser.java	Tue Mar 15 19:52:42 2011 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,377 +0,0 @@
-/*
- * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.sun.classanalyzer;
-
-import com.sun.tools.classfile.*;
-import com.sun.tools.classfile.ConstantPool.*;
-import static com.sun.tools.classfile.ConstantPool.*;
-
-/**
- *
- * @author Mandy Chung
- */
-public class ConstantPoolParser {
-
-    private final ClassFileParser cfparser;
-    private final StringValueVisitor visitor;
-    private final ConstantPool cpool;
-
-    ConstantPoolParser(ClassFileParser parser) {
-        this.cfparser = parser;
-        this.cpool = cfparser.classfile.constant_pool;
-        this.visitor = new StringValueVisitor();
-    }
-
-    public String stringValue(CPInfo cpInfo) {
-        return visitor.visit(cpInfo);
-    }
-
-    public String stringValue(int constant_pool_index) {
-        try {
-            return stringValue(cpool.get(constant_pool_index));
-        } catch (ConstantPool.InvalidIndex e) {
-            throw new RuntimeException(e);
-        }
-    }
-
-    public void parseDependency() {
-        ConstantPool.Visitor<Integer, Void> v = new ConstantPool.Visitor<Integer, Void>() {
-
-            public Integer visitClass(CONSTANT_Class_info info, Void p) {
-                try {
-                    String classname = cfparser.checkClassName(info.getName());
-                    if (classname.isEmpty()) {
-                        return 1;
-                    }
-
-                    Klass from = cfparser.this_klass;
-                    Klass to = Klass.getKlass(classname);
-                    ResolutionInfo resInfo = ResolutionInfo.resolvedConstantPool(from, to, info.name_index);
-
-                    from.addDep(to, resInfo);
-                    to.addReferrer(from, resInfo);
-                } catch (ConstantPoolException ex) {
-                    throw new RuntimeException(ex);
-                }
-                return 1;
-            }
-
-            public Integer visitDouble(CONSTANT_Double_info info, Void p) {
-                // skip
-                return 2;
-            }
-
-            public Integer visitFieldref(CONSTANT_Fieldref_info info, Void p) {
-                // skip
-                return 1;
-            }
-
-            public Integer visitFloat(CONSTANT_Float_info info, Void p) {
-                // skip
-                return 1;
-            }
-
-            public Integer visitInteger(CONSTANT_Integer_info info, Void p) {
-                // skip
-                return 1;
-            }
-
-            public Integer visitInterfaceMethodref(CONSTANT_InterfaceMethodref_info info, Void p) {
-                // skip
-                return 1;
-            }
-
-            public Integer visitLong(CONSTANT_Long_info info, Void p) {
-                // skip
-                return 2;
-            }
-
-            public Integer visitNameAndType(CONSTANT_NameAndType_info info, Void p) {
-                // skip
-                return 1;
-            }
-
-            public Integer visitMethodref(CONSTANT_Methodref_info info, Void p) {
-                // skip
-                return 1;
-            }
-
-            public Integer visitString(CONSTANT_String_info info, Void p) {
-                // skip
-                return 1;
-            }
-
-            public Integer visitUtf8(CONSTANT_Utf8_info info, Void p) {
-                // skip
-                return 1;
-            }
-        };
-        int cpx = 1;
-        while (cpx < cpool.size()) {
-            try {
-                CPInfo cpInfo = cpool.get(cpx);
-                cpx += cpInfo.accept(v, null);
-            } catch (ConstantPool.InvalidIndex ex) {
-                throw new RuntimeException(ex);
-            }
-        }
-    }
-
-    int getTag(int index) {
-        try {
-            return cpool.get(index).getTag();
-        } catch (ConstantPoolException ex) {
-            throw new RuntimeException(ex);
-        }
-    }
-
-    String getDescriptor(int index) {
-        CPInfo cpInfo;
-        try {
-            cpInfo = cpool.get(index);
-        } catch (ConstantPoolException ex) {
-            throw new RuntimeException(ex);
-        }
-
-        int tag = cpInfo.getTag();
-        switch (tag) {
-            case CONSTANT_Methodref:
-            case CONSTANT_InterfaceMethodref:
-            case CONSTANT_Fieldref:
-                // simplify references within this class
-                CPRefInfo ref = (CPRefInfo) cpInfo;
-                try {
-                    return ref.getNameAndTypeInfo().getType();
-                } catch (ConstantPoolException ex) {
-                }
-        }
-        return stringValue(cpInfo);
-    }
-
-    String getMethodName(int index) {
-        try {
-            CPInfo cpInfo = cpool.get(index);
-            if (cpInfo.getTag() == CONSTANT_Methodref ||
-                    cpInfo.getTag() == CONSTANT_InterfaceMethodref) {
-
-                // simplify references within this class
-                CPRefInfo ref = (CPRefInfo) cpInfo;
-                String classname;
-                if (ref.class_index == cfparser.classfile.this_class) {
-                    classname = cfparser.this_klass.getClassName();
-                } else {
-                    classname = cfparser.checkClassName(ref.getClassName()).replace('/', '.');
-                }
-                String methodname = ref.getNameAndTypeInfo().getName();
-                return classname + "." + methodname;
-            } else {
-                return null;
-            }
-        } catch (InvalidIndex ex) {
-            throw new RuntimeException(ex);
-        } catch (ConstantPoolException ex) {
-            throw new RuntimeException(ex);
-        }
-
-    }
-
-    class StringValueVisitor implements ConstantPool.Visitor<String, Void> {
-
-        public StringValueVisitor() {
-        }
-
-        public String visit(CPInfo info) {
-            return info.accept(this, null);
-        }
-
-        public String visitClass(CONSTANT_Class_info info, Void p) {
-            return getCheckedName(info);
-        }
-
-        String getCheckedName(CONSTANT_Class_info info) {
-            try {
-                return checkName(info.getName());
-            } catch (ConstantPoolException e) {
-                throw new RuntimeException(e);
-            }
-        }
-
-        public String visitDouble(CONSTANT_Double_info info, Void p) {
-            return info.value + "d";
-        }
-
-        public String visitFieldref(CONSTANT_Fieldref_info info, Void p) {
-            return visitRef(info, p);
-        }
-
-        public String visitFloat(CONSTANT_Float_info info, Void p) {
-            return info.value + "f";
-        }
-
-        public String visitInteger(CONSTANT_Integer_info info, Void p) {
-            return String.valueOf(info.value);
-        }
-
-        public String visitInterfaceMethodref(CONSTANT_InterfaceMethodref_info info, Void p) {
-            return visitRef(info, p);
-        }
-
-        public String visitLong(CONSTANT_Long_info info, Void p) {
-            return info.value + "l";
-        }
-
-        public String visitNameAndType(CONSTANT_NameAndType_info info, Void p) {
-            return getCheckedName(info) + ":" + getType(info);
-        }
-
-        String getCheckedName(CONSTANT_NameAndType_info info) {
-            try {
-                return checkName(info.getName());
-            } catch (ConstantPoolException e) {
-                throw new RuntimeException(e);
-            }
-        }
-
-        String getType(CONSTANT_NameAndType_info info) {
-            try {
-                return info.getType();
-            } catch (ConstantPoolException e) {
-                throw new RuntimeException(e);
-            }
-        }
-
-        public String visitMethodref(CONSTANT_Methodref_info info, Void p) {
-            return visitRef(info, p);
-        }
-
-        public String visitString(CONSTANT_String_info info, Void p) {
-            try {
-                int string_index = info.string_index;
-                return cpool.getUTF8Info(string_index).accept(this, p);
-            } catch (ConstantPoolException e) {
-                throw new RuntimeException(e);
-            }
-        }
-
-        public String visitUtf8(CONSTANT_Utf8_info info, Void p) {
-            String s = info.value;
-            StringBuilder sb = new StringBuilder();
-            for (int i = 0; i < s.length(); i++) {
-                char c = s.charAt(i);
-                switch (c) {
-                    case '\t':
-                        sb.append('\\').append('t');
-                        break;
-                    case '\n':
-                        sb.append('\\').append('n');
-                        break;
-                    case '\r':
-                        sb.append('\\').append('r');
-                        break;
-                    case '\"':
-                        sb.append('\\').append('\"');
-                        break;
-                    default:
-                        sb.append(c);
-                }
-            }
-            return sb.toString();
-        }
-
-        String visitRef(CPRefInfo info, Void p) {
-            String cn = getCheckedClassName(info);
-            String nat;
-            try {
-                nat = info.getNameAndTypeInfo().accept(this, p);
-            } catch (ConstantPoolException e) {
-                nat = e.getMessage();
-            }
-            return cn + "." + nat;
-        }
-
-        String getCheckedClassName(CPRefInfo info) {
-            try {
-                return checkName(info.getClassName());
-            } catch (ConstantPoolException e) {
-                throw new RuntimeException(e);
-            }
-        }
-    }
-    /* If name is a valid binary name, return it; otherwise quote it. */
-
-    private static String checkName(String name) {
-        if (name == null) {
-            return "null";
-        }
-
-        int len = name.length();
-        if (len == 0) {
-            return "\"\"";
-        }
-
-        int cc = '/';
-        int cp;
-        for (int k = 0; k < len; k += Character.charCount(cp)) {
-            cp = name.codePointAt(k);
-            if ((cc == '/' && !Character.isJavaIdentifierStart(cp)) || (cp != '/' && !Character.isJavaIdentifierPart(cp))) {
-                return "\"" + name + "\"";
-            }
-            cc = cp;
-        }
-        return name;
-    }
-
-    String tagName(int index) {
-        try {
-            int tag = cpool.get(index).getTag();
-            switch (tag) {
-                case CONSTANT_Utf8:
-                    return "Utf8";
-                case CONSTANT_Integer:
-                    return "int";
-                case CONSTANT_Float:
-                    return "float";
-                case CONSTANT_Long:
-                    return "long";
-                case CONSTANT_Double:
-                    return "double";
-                case CONSTANT_Class:
-                    return "class";
-                case CONSTANT_String:
-                    return "String";
-                case CONSTANT_Fieldref:
-                    return "Field";
-                case CONSTANT_Methodref:
-                    return "Method";
-                case CONSTANT_InterfaceMethodref:
-                    return "InterfaceMethod";
-                case CONSTANT_NameAndType:
-                    return "NameAndType";
-                default:
-                    return "(unknown tag)";
-            }
-        } catch (InvalidIndex e) {
-            throw new RuntimeException(e);
-        }
-    }
-}
--- a/jdk/make/modules/tools/src/com/sun/classanalyzer/DependencyConfig.java	Tue Mar 15 19:52:42 2011 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,99 +0,0 @@
-/*
- * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.sun.classanalyzer;
-
-import java.io.BufferedReader;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.util.List;
-
-/**
- * Config file specifying additional dependency
- * Each line consists of:
- * <tag> <classname> -> <value>
- * where <tag> can be:
- *    @ClassForName and <value> is its dependency
- *    @Provider and <value> is the service name
- *    @Providers and <value> is the list of the service names
- *
- * @author Mandy Chung
- */
-public class DependencyConfig {
-    private DependencyConfig() {
-    }
-
-    static void parse(List<String> configs) throws IOException {
-        for (String s : configs) {
-            parse(s);
-        }
-    }
-
-    private static void parse(String config) throws IOException {
-        // parse configuration file
-        FileInputStream in = new FileInputStream(config);
-        try {
-            BufferedReader reader = new BufferedReader(new InputStreamReader(in));
-            String line;
-            int lineNumber = 0;
-            String type = null;
-            while ((line = reader.readLine()) != null) {
-                lineNumber++;
-                line = line.trim();
-                if (line.length() == 0 || line.charAt(0) == '#') {
-                    continue;
-                }
-                if (line.charAt(0) == '@') {
-                    if (AnnotatedDependency.isValidType(line)) {
-                        type = line;
-                        continue;
-                    } else {
-                        throw new RuntimeException(config + ", line " +
-                            lineNumber + ", invalid annotation type.");
-                    }
-                }
-                String[] s = line.split("\\s+");
-                if (s.length < 3 || !s[1].equals("->")) {
-                    throw new RuntimeException(config + ", line " +
-                            lineNumber + ", is malformed");
-                }
-                String classname = s[0].trim();
-                String value = s[2].trim();
-
-                Klass k = Klass.findKlass(classname);
-                if (k == null) {
-                    // System.out.println("Warning: " + classname + " cannot be found");
-                    continue;
-                }
-                AnnotatedDependency dep = AnnotatedDependency.newAnnotatedDependency(type, value, k);
-                if (dep == null) {
-                    throw new RuntimeException(config + ", line " +
-                            lineNumber + ", is malformed. Fail to construct the dependency.");
-                }
-            }
-
-        } finally {
-            in.close();
-        }
-    }
-}
--- a/jdk/make/modules/tools/src/com/sun/classanalyzer/Klass.java	Tue Mar 15 19:52:42 2011 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,357 +0,0 @@
-/*
- * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-package com.sun.classanalyzer;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.SortedMap;
-import java.util.TreeMap;
-import java.util.TreeSet;
-
-import com.sun.tools.classfile.AccessFlags;
-
-/**
- *
- * @author Mandy Chung
- */
-public class Klass implements Comparable<Klass> {
-    private final String classname;
-    private final String packagename;
-    private Module module;
-    private boolean isJavaLangObject;
-    private String[] paths;
-    private Map<String, Set<Method>> methods;
-    private AccessFlags accessFlags;
-    private long filesize;
-
-    private SortedMap<Klass, Set<ResolutionInfo>> deps;
-    private SortedMap<Klass, Set<ResolutionInfo>> referrers;
-    private List<AnnotatedDependency> annotatedDeps;
-    private Set<String> classForNameRefs;
-
-    private Klass(String classname) {
-        this.classname = classname;
-        this.paths = classname.replace('.', '/').split("/");
-        this.isJavaLangObject = classname.equals("java.lang.Object");
-        this.deps = new TreeMap<Klass, Set<ResolutionInfo>>();
-        this.referrers = new TreeMap<Klass, Set<ResolutionInfo>>();
-        this.methods = new HashMap<String, Set<Method>>();
-        this.annotatedDeps = new ArrayList<AnnotatedDependency>();
-        this.classForNameRefs = new TreeSet<String>();
-
-        int pos = classname.lastIndexOf('.');
-        this.packagename = (pos > 0) ? classname.substring(0, pos) : "<unnamed>";
-    }
-
-    String getBasename() {
-        return paths[paths.length - 1];
-    }
-
-    String getClassName() {
-        return classname;
-    }
-
-    String getPackageName() {
-        return packagename;
-    }
-
-    String getClassFilePathname() {
-        StringBuilder sb = new StringBuilder(paths[0]);
-        for (int i = 1; i < paths.length; i++) {
-            String p = paths[i];
-            sb.append(File.separator).append(p);
-        }
-        return sb.append(".class").toString();
-    }
-
-    boolean isPublic() {
-        return accessFlags == null || accessFlags.is(AccessFlags.ACC_PUBLIC);
-    }
-
-    Module getModule() {
-        return module;
-    }
-
-    void setModule(Module m) {
-        if (module != null) {
-            throw new RuntimeException("Module for " + this + " already set");
-        }
-        this.module = m;
-    }
-
-    Set<Klass> getReferencedClasses() {
-        return deps.keySet();
-    }
-
-    Set<Klass> getReferencingClasses() {
-        return referrers.keySet();
-    }
-
-    void setAccessFlags(int flags) {
-        this.accessFlags = new AccessFlags(flags);
-    }
-
-    void setFileSize(long size) {
-        this.filesize = size;
-    }
-
-    long getFileSize() {
-        return this.filesize;
-    }
-
-    boolean exists() {
-        return filesize > 0;
-    }
-
-    boolean skip(Klass k) {
-        // skip if either class is a root or same class
-        return k.isJavaLangObject || this == k || k.classname.equals(classname);
-    }
-
-    void addDep(Method callee, ResolutionInfo resInfo) {
-        addDep(callee.getKlass(), resInfo);
-    }
-
-    void addDep(Klass ref, ResolutionInfo ri) {
-        if (skip(ref)) {
-            return;
-        }
-        Set<ResolutionInfo> resInfos;
-        if (!deps.containsKey(ref)) {
-            resInfos = new TreeSet<ResolutionInfo>();
-            deps.put(ref, resInfos);
-        } else {
-            resInfos = deps.get(ref);
-        }
-        resInfos.add(ri);
-    }
-
-    void addReferrer(Method caller, ResolutionInfo resInfo) {
-        addReferrer(caller.getKlass(), resInfo);
-    }
-
-    void addReferrer(Klass k, ResolutionInfo ri) {
-        if (skip(k)) {
-            return;
-        }
-        Set<ResolutionInfo> resInfos;
-        if (!referrers.containsKey(k)) {
-            resInfos = new TreeSet<ResolutionInfo>();
-            referrers.put(k, resInfos);
-        } else {
-            resInfos = referrers.get(k);
-        }
-        resInfos.add(ri);
-    }
-
-    Method getMethod(String name) {
-        return getMethod(name, "");
-    }
-
-    Method getMethod(String name, String signature) {
-        Set<Method> set;
-        if (methods.containsKey(name)) {
-            set = methods.get(name);
-        } else {
-            set = new TreeSet<Method>();
-            methods.put(name, set);
-        }
-
-        for (Method m : set) {
-            if (m.getName().equals(name) && m.getSignature().equals(signature)) {
-                return m;
-            }
-        }
-        Method m = new Method(this, name, signature);
-        set.add(m);
-        return m;
-    }
-
-    @Override
-    public String toString() {
-        return classname;
-    }
-
-    @Override
-    public int compareTo(Klass o) {
-        return classname.compareTo(o.classname);
-    }
-
-    void addAnnotatedDep(AnnotatedDependency dep) {
-        annotatedDeps.add(dep);
-    }
-
-    void addClassForNameReference(String method) {
-        classForNameRefs.add(method);
-    }
-
-    List<AnnotatedDependency> getAnnotatedDeps() {
-        return annotatedDeps;
-    }
-
-    private static Map<String, Klass> classes = new TreeMap<String, Klass>();
-    static Set<Klass> getAllClasses() {
-        return new TreeSet<Klass>(classes.values());
-    }
-
-    static Klass findKlassFromPathname(String filename) {
-        String name = filename;
-        if (filename.endsWith(".class")) {
-            name = filename.substring(0, filename.length() - 6);
-        }
-
-        // trim ".class"
-        name = name.replace('/', '.');
-        for (Klass k : classes.values()) {
-            if (name.endsWith(k.getClassName())) {
-                return k;
-            }
-        }
-        return null;
-    }
-
-    static Klass findKlass(String classname) {
-        return classes.get(classname);
-    }
-
-    static Klass getKlass(String name) {
-        Klass k;
-        String classname = name.replace('/', '.');
-        if (classname.charAt(classname.length() - 1) == ';') {
-            classname = classname.substring(0, classname.length() - 1);
-        }
-        if (classes.containsKey(classname)) {
-            k = classes.get(classname);
-        } else {
-            k = new Klass(classname);
-            classes.put(classname, k);
-        }
-        return k;
-    }
-
-    public class Method implements Comparable<Method> {
-
-        private final Klass k;
-        private final String method;
-        private final String signature;
-        private long codeLength;
-        // non-primitive types only
-        private final List<Klass> argTypes;
-        private final Klass returnType;
-        boolean isAbstract = false;
-        boolean marked = false;
-
-        public Method(Klass k, String method, String signature) {
-            this(k, method, signature, null, null);
-        }
-
-        public Method(Klass k, String method, String signature, Klass returnType, List<Klass> argTypes) {
-            this.k = k;
-            this.method = method;
-            this.signature = signature;
-            this.argTypes = argTypes;
-            this.returnType = returnType;
-            this.codeLength = 0;
-        }
-
-        public Klass getKlass() {
-            return k;
-        }
-
-        public String getName() {
-            return method;
-        }
-
-        public String getSignature() {
-            return signature;
-        }
-
-        public Klass getReturnType() {
-            return returnType;
-        }
-
-        public List<Klass> argTypes() {
-            return argTypes;
-        }
-
-        public void setCodeLength(long len) {
-            this.codeLength = len;
-        }
-
-        public long getCodeLength() {
-            return codeLength;
-        }
-
-        @Override
-        public boolean equals(Object o) {
-            if (o instanceof Method) {
-                return compareTo((Method) o) == 0;
-            } else {
-                return false;
-            }
-        }
-
-        @Override
-        public int hashCode() {
-            int hash = 3;
-            hash = 71 * hash + (this.k != null ? this.k.hashCode() : 0);
-            hash = 71 * hash + (this.method != null ? this.method.hashCode() : 0);
-            return hash;
-        }
-
-        @Override
-        public String toString() {
-            if (signature.isEmpty()) {
-                return k.classname + "." + method;
-            } else {
-                return signature;
-            }
-        }
-
-        public String toHtmlString() {
-            return toString().replace("<", "&lt;").replace(">", "&gt;");
-        }
-
-        boolean isClinit() {
-            return method.equals("<clinit>");
-        }
-
-        public int compareTo(Method m) {
-            if (k == m.getKlass()) {
-                if (method.equals(m.method)) {
-                    return signature.compareTo(m.signature);
-                } else {
-                    return method.compareTo(m.method);
-                }
-            } else {
-                return k.compareTo(m.getKlass());
-            }
-        }
-    }
-}
--- a/jdk/make/modules/tools/src/com/sun/classanalyzer/Module.java	Tue Mar 15 19:52:42 2011 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,693 +0,0 @@
-/*
- * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-package com.sun.classanalyzer;
-
-import com.sun.classanalyzer.AnnotatedDependency.OptionalDependency;
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.util.ArrayDeque;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Deque;
-import java.util.HashSet;
-import java.util.LinkedHashMap;
-import java.util.Map;
-import java.util.Set;
-import java.util.TreeMap;
-import java.util.TreeSet;
-
-/**
- *
- * @author Mandy Chung
- */
-public class Module implements Comparable<Module> {
-
-    private static Map<String, Module> modules = new LinkedHashMap<String, Module>();
-
-    public static Module addModule(ModuleConfig config) {
-        String name = config.module;
-        if (modules.containsKey(name)) {
-            throw new RuntimeException("module \"" + name + "\" already exists");
-        }
-
-        Module m = new Module(config);
-        modules.put(name, m);
-        return m;
-    }
-
-    public static Module findModule(String name) {
-        return modules.get(name);
-    }
-
-    static Collection<Module> getAllModules() {
-        return Collections.unmodifiableCollection(modules.values());
-    }
-    private final String name;
-    private final ModuleConfig config;
-    private final Set<Klass> classes;
-    private final Set<ResourceFile> resources;
-    private final Set<Reference> unresolved;
-    private final Set<Dependency> dependents;
-    private final Map<String, PackageInfo> packages;
-    private final Set<Module> members;
-    private Module group;
-    private boolean isBaseModule;
-
-    private Module(ModuleConfig config) {
-        this.name = config.module;
-        this.isBaseModule = config.isBase;
-        this.classes = new TreeSet<Klass>();
-        this.resources = new TreeSet<ResourceFile>();
-        this.config = config;
-        this.unresolved = new HashSet<Reference>();
-        this.dependents = new TreeSet<Dependency>();
-        this.packages = new TreeMap<String, PackageInfo>();
-        this.members = new TreeSet<Module>();
-        this.group = this; // initialize to itself
-    }
-
-    String name() {
-        return name;
-    }
-
-    Module group() {
-        return group;
-    }
-
-    boolean isBase() {
-        return isBaseModule;
-    }
-
-    Set<Module> members() {
-        return members;
-    }
-
-    boolean contains(Klass k) {
-        return k != null && classes.contains(k);
-    }
-
-    boolean isEmpty() {
-        return classes.isEmpty() && resources.isEmpty();
-    }
-
-    /**
-     * Returns an Iterable of Dependency, only one for each dependent
-     * module of the strongest dependency (i.e.
-     * hard static > hard dynamic > optional static > optional dynamic
-     */
-    Iterable<Dependency> dependents() {
-        Map<Module, Dependency> deps = new LinkedHashMap<Module, Dependency>();
-        for (Dependency dep : dependents) {
-            Dependency d = deps.get(dep.module);
-            if (d == null || dep.compareTo(d) > 0) {
-                deps.put(dep.module, dep);
-            }
-        }
-        return deps.values();
-    }
-
-    @Override
-    public int compareTo(Module o) {
-        if (o == null) {
-            return -1;
-        }
-        return name.compareTo(o.name);
-    }
-
-    @Override
-    public String toString() {
-        return name;
-    }
-
-    void addKlass(Klass k) {
-        classes.add(k);
-        k.setModule(this);
-
-        // update package statistics
-        String pkg = k.getPackageName();
-        PackageInfo pkginfo = packages.get(pkg);
-        if (pkginfo == null) {
-            pkginfo = new PackageInfo(pkg);
-            packages.put(pkg, pkginfo);
-        }
-        if (k.exists()) {
-            // only count the class that is parsed
-            pkginfo.add(k.getFileSize());
-        }
-    }
-
-    void addResource(ResourceFile res) {
-        resources.add(res);
-        res.setModule(this);
-    }
-
-    void processRootsAndReferences() {
-        // start with the root set
-        Deque<Klass> pending = new ArrayDeque<Klass>();
-        for (Klass k : Klass.getAllClasses()) {
-            if (k.getModule() != null) {
-                continue;
-            }
-            String classname = k.getClassName();
-            if (config.matchesRoot(classname) && !config.isExcluded(classname)) {
-                addKlass(k);
-                pending.add(k);
-            }
-        }
-
-        // follow all references
-        Klass k;
-        while ((k = pending.poll()) != null) {
-            if (!classes.contains(k)) {
-                addKlass(k);
-            }
-            for (Klass other : k.getReferencedClasses()) {
-                Module otherModule = other.getModule();
-                if (otherModule != null && otherModule != this) {
-                    // this module is dependent on otherModule
-                    addDependency(k, other);
-                    continue;
-                }
-
-                if (!classes.contains(other)) {
-                    if (config.isExcluded(other.getClassName())) {
-                        // reference to an excluded class
-                        unresolved.add(new Reference(k, other));
-                    } else {
-                        pending.add(other);
-                    }
-                }
-            }
-        }
-
-        // add other matching classes that don't require dependency analysis
-        for (Klass c : Klass.getAllClasses()) {
-            if (c.getModule() == null) {
-                String classname = c.getClassName();
-                if (config.matchesIncludes(classname) && !config.isExcluded(classname)) {
-                    addKlass(c);
-                    // dependencies
-                    for (Klass other : c.getReferencedClasses()) {
-                        Module otherModule = other.getModule();
-                        if (otherModule == null) {
-                            unresolved.add(new Reference(c, other));
-                        } else {
-                            if (otherModule != this) {
-                                // this module is dependent on otherModule
-                                addDependency(c, other);
-                            }
-                        }
-                    }
-                }
-            }
-        }
-
-
-        // add other matching classes that don't require dependency analysis
-        for (ResourceFile res : ResourceFile.getAllResources()) {
-            if (res.getModule() == null) {
-                String name = res.getName();
-                if (config.matchesIncludes(name) && !config.isExcluded(name)) {
-                    addResource(res);
-                }
-            }
-        }
-    }
-
-    void addDependency(Klass from, Klass to) {
-        Dependency dep = new Dependency(from, to);
-        dependents.add(dep);
-    }
-
-    void fixupDependencies() {
-        // update dependencies for classes that were allocated to modules after
-        // this module was processed.
-        for (Reference ref : unresolved) {
-            Module m = ref.referree().getModule();
-            if (m == null || m != this) {
-                addDependency(ref.referrer, ref.referree);
-            }
-        }
-
-        fixupAnnotatedDependencies();
-    }
-
-    private void fixupAnnotatedDependencies() {
-        // add dependencies that this klass may depend on due to the AnnotatedDependency
-        dependents.addAll(AnnotatedDependency.getDependencies(this));
-    }
-
-    boolean isModuleDependence(Klass k) {
-        Module m = k.getModule();
-        return m == null || (!classes.contains(k) && !m.isBase());
-    }
-
-    Module getModuleDependence(Klass k) {
-        if (isModuleDependence(k)) {
-            Module m = k.getModule();
-            if (group == this && m != null) {
-                // top-level module
-                return m.group;
-            } else {
-                return m;
-            }
-        }
-        return null;
-    }
-
-    <P> void visit(Set<Module> visited, Visitor<P> visitor, P p) {
-        if (!visited.contains(this)) {
-            visited.add(this);
-            visitor.preVisit(this, p);
-            for (Module m : members) {
-                m.visit(visited, visitor, p);
-                visitor.postVisit(this, m, p);
-            }
-        } else {
-            throw new RuntimeException("Cycle detected: module " + this.name);
-        }
-    }
-
-    void addMember(Module m) {
-        // merge class list
-        for (Klass k : m.classes) {
-            classes.add(k);
-        }
-
-        // merge resource list
-        for (ResourceFile res : m.resources) {
-            resources.add(res);
-        }
-
-        // merge the package statistics
-        for (PackageInfo pinfo : m.getPackageInfos()) {
-            String packageName = pinfo.pkgName;
-            PackageInfo pkginfo = packages.get(packageName);
-            if (pkginfo == null) {
-                pkginfo = new PackageInfo(packageName);
-                packages.put(packageName, pkginfo);
-            }
-            pkginfo.add(pinfo);
-        }
-    }
-
-    static void buildModuleMembers() {
-        // set up module member relationship
-        for (Module m : modules.values()) {
-            m.group = m; // initialize to itself
-            for (String name : m.config.members()) {
-                Module member = modules.get(name);
-                if (member == null) {
-                    throw new RuntimeException("module \"" + name + "\" doesn't exist");
-                }
-                m.members.add(member);
-            }
-        }
-
-        // set up the top-level module
-        Visitor<Module> groupSetter = new Visitor<Module>() {
-
-            public void preVisit(Module m, Module p) {
-                m.group = p;
-                if (p.isBaseModule) {
-                    // all members are also base
-                    m.isBaseModule = true;
-                }
-            }
-
-            public void postVisit(Module m, Module child, Module p) {
-                // nop - breadth-first search
-            }
-        };
-
-        // propagate the top-level module to all its members
-        for (Module p : modules.values()) {
-            for (Module m : p.members) {
-                if (m.group == m) {
-                    m.visit(new TreeSet<Module>(), groupSetter, p);
-                }
-            }
-        }
-
-        Visitor<Module> mergeClassList = new Visitor<Module>() {
-
-            public void preVisit(Module m, Module p) {
-                // nop - depth-first search
-            }
-
-            public void postVisit(Module m, Module child, Module p) {
-                m.addMember(child);
-            }
-        };
-
-        Set<Module> visited = new TreeSet<Module>();
-        for (Module m : modules.values()) {
-            if (m.group() == m) {
-                if (m.members().size() > 0) {
-                    // merge class list from all its members
-                    m.visit(visited, mergeClassList, m);
-                }
-
-                // clear the dependencies before fixup
-                m.dependents.clear();
-
-                // fixup dependencies
-                for (Klass k : m.classes) {
-                    for (Klass other : k.getReferencedClasses()) {
-                        if (m.isModuleDependence(other)) {
-                            // this module is dependent on otherModule
-                            m.addDependency(k, other);
-                        }
-                    }
-                }
-
-                // add dependencies that this klass may depend on due to the AnnotatedDependency
-                m.fixupAnnotatedDependencies();
-            }
-        }
-    }
-
-    class PackageInfo implements Comparable {
-
-        final String pkgName;
-        int count;
-        long filesize;
-
-        PackageInfo(String name) {
-            this.pkgName = name;
-            this.count = 0;
-            this.filesize = 0;
-        }
-
-        void add(PackageInfo pkg) {
-            this.count += pkg.count;
-            this.filesize += pkg.filesize;
-        }
-
-        void add(long size) {
-            count++;
-            filesize += size;
-
-        }
-
-        @Override
-        public int compareTo(Object o) {
-            return pkgName.compareTo(((PackageInfo) o).pkgName);
-        }
-    }
-
-    Set<PackageInfo> getPackageInfos() {
-        return new TreeSet<PackageInfo>(packages.values());
-    }
-
-    void printSummaryTo(String output) throws IOException {
-        PrintWriter writer = new PrintWriter(output);
-        try {
-            long total = 0L;
-            int count = 0;
-            writer.format("%10s\t%10s\t%s\n", "Bytes", "Classes", "Package name");
-            for (String pkg : packages.keySet()) {
-                PackageInfo info = packages.get(pkg);
-                if (info.count > 0) {
-                    writer.format("%10d\t%10d\t%s\n", info.filesize, info.count, pkg);
-                    total += info.filesize;
-                    count += info.count;
-                }
-            }
-
-            writer.format("\nTotal: %d bytes (uncompressed) %d classes\n", total, count);
-        } finally {
-            writer.close();
-        }
-
-    }
-
-    void printClassListTo(String output) throws IOException {
-        // no file created if the module doesn't have any class nor resource
-        if (isEmpty()) {
-            return;
-        }
-
-        PrintWriter writer = new PrintWriter(output);
-        try {
-            for (Klass c : classes) {
-                if (c.exists()) {
-                    writer.format("%s\n", c.getClassFilePathname());
-                } else {
-                    trace("%s in module %s missing\n", c, this);
-                }
-            }
-
-        } finally {
-            writer.close();
-        }
-    }
-
-    void printResourceListTo(String output) throws IOException {
-        // no file created if the module doesn't have any resource file
-        if (resources.isEmpty()) {
-            return;
-        }
-
-        PrintWriter writer = new PrintWriter(output);
-        try {
-            for (ResourceFile res : resources) {
-                writer.format("%s\n", res.getPathname());
-            }
-        } finally {
-            writer.close();
-        }
-    }
-
-    void printDependenciesTo(String output, boolean showDynamic) throws IOException {
-        // no file created if the module doesn't have any class
-        if (isEmpty()) {
-            return;
-        }
-
-        PrintWriter writer = new PrintWriter(output);
-        try {
-            // classes that this klass may depend on due to the AnnotatedDependency
-            Map<Reference, Set<AnnotatedDependency>> annotatedDeps = AnnotatedDependency.getReferences(this);
-
-            for (Klass klass : classes) {
-                Set<Klass> references = klass.getReferencedClasses();
-                for (Klass other : references) {
-                    String classname = klass.getClassName();
-                    boolean optional = OptionalDependency.isOptional(klass, other);
-                    if (optional) {
-                        classname = "[optional] " + classname;
-                    }
-
-                    Module m = getModuleDependence(other);
-                    if (m != null || other.getModule() == null) {
-                        writer.format("%-40s -> %s (%s)", classname, other, m);
-                        Reference ref = new Reference(klass, other);
-                        if (annotatedDeps.containsKey(ref)) {
-                            for (AnnotatedDependency ad : annotatedDeps.get(ref)) {
-                                writer.format(" %s", ad.getTag());
-                            }
-                            // printed; so remove the dependency from the annotated deps list
-                            annotatedDeps.remove(ref);
-                        }
-                        writer.format("\n");
-                    }
-                }
-            }
-
-
-            // print remaining dependencies specified in AnnotatedDependency list
-            if (annotatedDeps.size() > 0) {
-                for (Map.Entry<Reference, Set<AnnotatedDependency>> entry : annotatedDeps.entrySet()) {
-                    Reference ref = entry.getKey();
-                    Module m = getModuleDependence(ref.referree);
-                    if (m != null || ref.referree.getModule() == null) {
-                        String classname = ref.referrer.getClassName();
-                        boolean optional = true;
-                        boolean dynamic = true;
-                        String tag = "";
-                        for (AnnotatedDependency ad : entry.getValue()) {
-                            if (optional && !ad.isOptional()) {
-                                optional = false;
-                                tag = ad.getTag();
-                            }
-                            if (!ad.isDynamic()) {
-                                dynamic = false;
-                            }
-                        }
-                        if (!showDynamic && optional && dynamic) {
-                            continue;
-                        }
-                        if (optional) {
-                            if (dynamic) {
-                                classname = "[dynamic] " + classname;
-                            } else {
-                                classname = "[optional] " + classname;
-                            }
-                        }
-                        writer.format("%-40s -> %s (%s) %s%n", classname, ref.referree, m, tag);
-                    }
-                }
-            }
-
-        } finally {
-            writer.close();
-        }
-    }
-
-    static class Dependency implements Comparable<Dependency> {
-
-        final Module module;
-        final boolean optional;
-        final boolean dynamic;
-
-        Dependency(Klass from, Klass to) {
-            // static dependency
-            this.module = to.getModule() != null ? to.getModule().group() : null;
-            this.optional = OptionalDependency.isOptional(from, to);
-            this.dynamic = false;
-        }
-
-        Dependency(Module m, boolean optional, boolean dynamic) {
-            this.module = m != null ? m.group() : null;
-            this.optional = optional;
-            this.dynamic = dynamic;
-        }
-
-        @Override
-        public boolean equals(Object obj) {
-            if (!(obj instanceof Dependency)) {
-                return false;
-            }
-            if (this == obj) {
-                return true;
-            }
-
-            Dependency d = (Dependency) obj;
-            if (this.module != d.module) {
-                return false;
-            } else {
-                return this.optional == d.optional && this.dynamic == d.dynamic;
-            }
-        }
-
-        @Override
-        public int hashCode() {
-            int hash = 3;
-            hash = 19 * hash + (this.module != null ? this.module.hashCode() : 0);
-            hash = 19 * hash + (this.optional ? 1 : 0);
-            hash = 19 * hash + (this.dynamic ? 1 : 0);
-            return hash;
-        }
-
-        @Override
-        public int compareTo(Dependency d) {
-            if (this.equals(d)) {
-                return 0;
-            }
-
-            // Hard static > hard dynamic > optional static > optional dynamic
-            if (this.module == d.module) {
-                if (this.optional == d.optional) {
-                    return this.dynamic ? -1 : 1;
-                } else {
-                    return this.optional ? -1 : 1;
-                }
-            } else if (this.module != null && d.module != null) {
-                return (this.module.compareTo(d.module));
-            } else {
-                return (this.module == null) ? -1 : 1;
-            }
-        }
-
-        @Override
-        public String toString() {
-            String s = module.name();
-            if (dynamic && optional) {
-                s += " (dynamic)";
-            } else if (optional) {
-                s += " (optional)";
-            }
-            return s;
-        }
-    }
-
-    static class Reference implements Comparable<Reference> {
-
-        private final Klass referrer, referree;
-
-        Reference(Klass referrer, Klass referree) {
-            this.referrer = referrer;
-            this.referree = referree;
-        }
-
-        Klass referrer() {
-            return referrer;
-        }
-
-        Klass referree() {
-            return referree;
-        }
-
-        @Override
-        public int hashCode() {
-            return referrer.hashCode() ^ referree.hashCode();
-        }
-
-        @Override
-        public boolean equals(Object obj) {
-            if (!(obj instanceof Reference)) {
-                return false;
-            }
-            if (this == obj) {
-                return true;
-            }
-
-            Reference r = (Reference) obj;
-            return (this.referrer.equals(r.referrer) &&
-                    this.referree.equals(r.referree));
-        }
-
-        @Override
-        public int compareTo(Reference r) {
-            int ret = referrer.compareTo(r.referrer);
-            if (ret == 0) {
-                ret = referree.compareTo(r.referree);
-            }
-            return ret;
-        }
-    }
-
-    interface Visitor<P> {
-
-        public void preVisit(Module m, P param);
-
-        public void postVisit(Module m, Module child, P param);
-    }
-    private static boolean traceOn = System.getProperty("classanalyzer.debug") != null;
-
-    private static void trace(String format, Object... params) {
-        System.err.format(format, params);
-    }
-}
--- a/jdk/make/modules/tools/src/com/sun/classanalyzer/ModuleConfig.java	Tue Mar 15 19:52:42 2011 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,562 +0,0 @@
-/*
- * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.sun.classanalyzer;
-
-import java.io.BufferedReader;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Set;
-import java.util.TreeSet;
-import java.util.regex.Pattern;
-
-/**
- *
- * @author Mandy Chung
- */
-public class ModuleConfig {
-
-    private static String baseModuleName = "base";
-    private final Set<String> roots;
-    private final Set<String> includes;
-    private final Filter filter;
-    private List<String> members;
-    final String module;
-    final boolean isBase;
-
-    private ModuleConfig(String name) throws IOException {
-        this.roots = new TreeSet<String>();
-        this.includes = new TreeSet<String>();
-        this.module = name;
-        this.isBase = name.equals(baseModuleName);
-        this.filter = new Filter(this);
-    }
-
-    List<String> members() {
-        if (members == null) {
-            members = new LinkedList<String>();
-
-            for (String s : includes) {
-                if (!s.contains("*") && Module.findModule(s) != null) {
-                    // module member
-                    members.add(s);
-                }
-            }
-        }
-        return members;
-    }
-
-    boolean matchesRoot(String name) {
-        for (String pattern : roots) {
-            if (matches(name, pattern)) {
-                return true;
-            }
-        }
-        return false;
-    }
-
-    boolean matchesIncludes(String name) {
-        for (String pattern : includes) {
-            if (matches(name, pattern)) {
-                return true;
-            }
-        }
-        return false;
-    }
-
-    boolean isExcluded(String name) {
-        return filter.isExcluded(name);
-    }
-
-    boolean matchesPackage(String packageName, String pattern) {
-        int pos = pattern.lastIndexOf('.');
-        String pkg = pos > 0 ? pattern.substring(0, pos) : "<unnamed>";
-        return packageName.equals(pkg);
-    }
-
-
-    boolean matches(String name, String pattern) {
-        if (pattern.contains("**") && !pattern.endsWith("**")) {
-            throw new UnsupportedOperationException("Not yet implemented");
-        }
-
-        String javaName = name;
-
-        boolean isResourceFile = name.indexOf('/') >= 0;
-        if (isResourceFile) {
-            // it's a resource file; convert the name as a java
-            javaName = name.replace('/', '.');
-        }
-        if (pattern.indexOf('/') < 0) {
-            // if the pattern doesn't contain '/
-            return matchesJavaName(javaName, pattern);
-        } else {
-            if (isResourceFile) {
-                // the pattern is for matching resource file
-                return matchesNameWithSlash(name, pattern);
-            } else {
-                return false;
-            }
-        }
-    }
-
-    boolean matchesJavaName(String name, String pattern) {
-        int pos = name.lastIndexOf('.');
-        String packageName = pos > 0 ? name.substring(0, pos) : "<unnamed>";
-        if (pattern.endsWith("**")) {
-            String p = pattern.substring(0, pattern.length() - 2);
-            return name.startsWith(p);
-        } else if (pattern.endsWith("*") && pattern.indexOf('*') == pattern.lastIndexOf('*')) {
-            if (matchesPackage(packageName, pattern)) {
-                // package name has to be exact match
-                String p = pattern.substring(0, pattern.length() - 1);
-                return name.startsWith(p);
-            } else {
-                return false;
-            }
-        } else if (pattern.contains("*")) {
-            String basename = pos > 0 ? name.substring(pos + 1, name.length()) : name;
-            pos = pattern.indexOf('*');
-            String prefix = pattern.substring(0, pos);
-            String suffix = pattern.substring(pos + 1, pattern.length());
-            if (name.startsWith(prefix) && matchesPackage(packageName, prefix)) {
-                // package name has to be exact match
-                if (suffix.contains("*")) {
-                    return name.matches(convertToRegex(pattern));
-                } else {
-                    return basename.endsWith(suffix);
-                }
-            } else {
-                // we don't support wildcard be used in the package name
-                return false;
-            }
-        } else {
-            // exact match or inner class
-            return name.equals(pattern) || name.startsWith(pattern + "$");
-        }
-    }
-
-    boolean matchesNameWithSlash(String name, String pattern) {
-        if (pattern.endsWith("**")) {
-            String p = pattern.substring(0, pattern.length() - 2);
-            return name.startsWith(p);
-        } else if (pattern.contains("*")) {
-            int pos = pattern.indexOf('*');
-            String prefix = pattern.substring(0, pos);
-            String suffix = pattern.substring(pos + 1, pattern.length());
-            String tail = name.substring(pos, name.length());
-
-            if (!name.startsWith(prefix)) {
-                // prefix has to exact match
-                return false;
-            }
-
-            if (pattern.indexOf('*') == pattern.lastIndexOf('*')) {
-                // exact match prefix with no '/' in the tail string
-                String wildcard = tail.substring(0, tail.length() - suffix.length());
-                return tail.indexOf('/') < 0 && tail.endsWith(suffix);
-            }
-
-            if (suffix.contains("*")) {
-                return matchesNameWithSlash(tail, suffix);
-            } else {
-                // tail ends with the suffix while no '/' in the wildcard matched string
-                String any = tail.substring(0, tail.length() - suffix.length());
-                return tail.endsWith(suffix) && any.indexOf('/') < 0;
-            }
-        } else {
-            // exact match
-            return name.equals(pattern);
-        }
-    }
-
-    private String convertToRegex(String pattern) {
-        StringBuilder sb = new StringBuilder();
-        int i = 0;
-        int index = 0;
-        int plen = pattern.length();
-        while (i < plen) {
-            char p = pattern.charAt(i);
-            if (p == '*') {
-                sb.append("(").append(pattern.substring(index, i)).append(")");
-                if (i + 1 < plen && pattern.charAt(i + 1) == '*') {
-                    sb.append(".*");
-                    index = i + 2;
-                } else {
-                    sb.append("[^\\.]*");
-                    index = i + 1;
-                }
-            }
-            i++;
-        }
-        if (index < plen) {
-            sb.append("(").append(pattern.substring(index, plen)).append(")");
-        }
-        return sb.toString();
-    }
-
-    static class Filter {
-
-        final ModuleConfig config;
-        final Set<String> exclude = new TreeSet<String>();
-        final Set<String> allow = new TreeSet<String>();
-
-        Filter(ModuleConfig config) {
-            this.config = config;
-        }
-
-        Filter exclude(String pattern) {
-            exclude.add(pattern);
-            return this;
-        }
-
-        Filter allow(String pattern) {
-            allow.add(pattern);
-            return this;
-        }
-
-        String allowedBy(String name) {
-            String allowedBy = null;
-            for (String pattern : allow) {
-                if (config.matches(name, pattern)) {
-                    if (name.equals(pattern)) {
-                        return pattern;  // exact match
-                    }
-                    if (allowedBy == null) {
-                        allowedBy = pattern;
-                    } else {
-                        if (pattern.length() > allowedBy.length()) {
-                            allowedBy = pattern;
-                        }
-                    }
-                }
-            }
-            return allowedBy;
-        }
-
-        String excludedBy(String name) {
-            String allowedBy = allowedBy(name);
-            String excludedBy = null;
-
-            if (allowedBy != null && name.equals(allowedBy)) {
-                return null;  // exact match
-            }
-            for (String pattern : exclude) {
-                if (config.matches(name, pattern)) {
-                    // not matched by allowed rule or exact match
-                    if (allowedBy == null || name.equals(pattern)) {
-                        return pattern;
-                    }
-                    if (excludedBy == null) {
-                        excludedBy = pattern;
-                    } else {
-                        if (pattern.length() > excludedBy.length()) {
-                            excludedBy = pattern;
-                        }
-                    }
-                }
-            }
-            return excludedBy;
-        }
-
-        boolean isExcluded(String name) {
-            String allowedBy = allowedBy(name);
-            String excludedBy = excludedBy(name);
-
-            if (excludedBy == null) {
-                return false;
-            }
-            // not matched by allowed rule or exact match
-            if (allowedBy == null || name.equals(excludedBy)) {
-                return true;
-            }
-
-            if (allowedBy == null) {
-                return true;
-            }
-            if (allowedBy != null &&
-                    excludedBy.length() > allowedBy.length()) {
-                return true;
-            }
-            return false;
-        }
-    }
-
-    private static String trimComment(String line) {
-        StringBuilder sb = new StringBuilder();
-
-        int pos = 0;
-        while (pos >= 0 && pos < line.length()) {
-            int c1 = line.indexOf("//", pos);
-            if (c1 > 0 && !Character.isWhitespace(line.charAt(c1-1))) {
-                // not a comment
-                c1 = -1;
-            }
-
-            int c2 = line.indexOf("/*", pos);
-            if (c2 > 0 && !Character.isWhitespace(line.charAt(c2-1))) {
-                // not a comment
-                c2 = -1;
-            }
-
-            int c = line.length();
-            int n = line.length();
-            if (c1 >= 0 || c2 >= 0) {
-                if (c1 >= 0) {
-                    c = c1;
-                }
-                if (c2 >= 0 && c2 < c) {
-                    c = c2;
-                }
-                int c3 = line.indexOf("*/", c2 + 2);
-                if (c == c2 && c3 > c2) {
-                    n = c3 + 2;
-                }
-            }
-            if (c > 0) {
-                if (sb.length() > 0) {
-                    // add a whitespace if multiple comments on one line
-                    sb.append(" ");
-                }
-                sb.append(line.substring(pos, c));
-            }
-            pos = n;
-        }
-        return sb.toString();
-    }
-
-    private static boolean beginBlockComment(String line) {
-        int pos = 0;
-        while (pos >= 0 && pos < line.length()) {
-            int c = line.indexOf("/*", pos);
-            if (c < 0) {
-                return false;
-            }
-
-            if (c > 0 && !Character.isWhitespace(line.charAt(c-1))) {
-                return false;
-            }
-
-            int c1 = line.indexOf("//", pos);
-            if (c1 >= 0 && c1 < c) {
-                return false;
-            }
-
-            int c2 = line.indexOf("*/", c + 2);
-            if (c2 < 0) {
-                return true;
-            }
-            pos = c + 2;
-        }
-        return false;
-    }
-
-    static void setBaseModule(String name) {
-        baseModuleName = name;
-    }
-    // TODO: we shall remove "-" from the regex once we define
-    // the naming convention for the module names without dashes
-    static final Pattern classNamePattern = Pattern.compile("[\\w\\.\\*_$-/]+");
-
-    static List<ModuleConfig> readConfigurationFile(String file) throws IOException {
-        List<ModuleConfig> result = new ArrayList<ModuleConfig>();
-        // parse configuration file
-        FileInputStream in = new FileInputStream(file);
-        try {
-            BufferedReader reader = new BufferedReader(new InputStreamReader(in));
-            String line;
-
-            int lineNumber = 0;
-            boolean inRoots = false;
-            boolean inIncludes = false;
-            boolean inAllows = false;
-            boolean inExcludes = false;
-            boolean inBlockComment = false;
-            ModuleConfig config = null;
-
-            while ((line = reader.readLine()) != null) {
-                lineNumber++;
-
-                if (inBlockComment) {
-                    int c = line.indexOf("*/");
-                    if (c >= 0) {
-                        line = line.substring(c + 2, line.length());
-                        inBlockComment = false;
-                    } else {
-                        // skip lines until end of comment block
-                        continue;
-                    }
-                }
-
-                inBlockComment = beginBlockComment(line);
-
-                line = trimComment(line).trim();
-                // ignore empty lines
-                if (line.length() == 0) {
-                    continue;
-                }
-
-                String values;
-                if (inRoots || inIncludes || inExcludes || inAllows) {
-                    values = line;
-                } else {
-                    String[] s = line.split("\\s+");
-                    String keyword = s[0].trim();
-                    if (keyword.equals("module")) {
-                        if (s.length != 3 || !s[2].trim().equals("{")) {
-                            throw new RuntimeException(file + ", line " +
-                                    lineNumber + ", is malformed");
-                        }
-                        config = new ModuleConfig(s[1].trim());
-                        result.add(config);
-                        // switch to a new module; so reset the flags
-                        inRoots = false;
-                        inIncludes = false;
-                        inExcludes = false;
-                        inAllows = false;
-                        continue;
-                    } else if (keyword.equals("roots")) {
-                        inRoots = true;
-                    } else if (keyword.equals("include")) {
-                        inIncludes = true;
-                    } else if (keyword.equals("exclude")) {
-                        inExcludes = true;
-                    } else if (keyword.equals("allow")) {
-                        inAllows = true;
-                    } else if (keyword.equals("}")) {
-                        if (config == null || s.length != 1) {
-                            throw new RuntimeException(file + ", line " +
-                                    lineNumber + ", is malformed");
-                        } else {
-                            // end of a module
-                            config = null;
-                            continue;
-                        }
-                    } else {
-                        throw new RuntimeException(file + ", \"" + keyword + "\" on line " +
-                                lineNumber + ", is not recognized");
-                    }
-                    values = line.substring(keyword.length(), line.length()).trim();
-                }
-
-                if (config == null) {
-                    throw new RuntimeException(file + ", module not specified");
-                }
-
-                int len = values.length();
-                if (len == 0) {
-                    continue;
-                }
-                char lastchar = values.charAt(len - 1);
-                if (lastchar != ',' && lastchar != ';') {
-                    throw new RuntimeException(file + ", line " +
-                            lineNumber + ", is malformed:" +
-                            " ',' or ';' is missing.");
-                }
-
-                values = values.substring(0, len - 1);
-                // parse the values specified for a keyword specified
-                for (String s : values.split(",")) {
-                    s = s.trim();
-                    if (s.length() > 0) {
-                        if (!classNamePattern.matcher(s).matches()) {
-                            throw new RuntimeException(file + ", line " +
-                                    lineNumber + ", is malformed: \"" + s + "\"");
-                        }
-                        if (inRoots) {
-                            config.roots.add(s);
-                        } else if (inIncludes) {
-                            config.includes.add(s);
-                        } else if (inExcludes) {
-                            config.filter.exclude(s);
-                        } else if (inAllows) {
-                            config.filter.allow(s);
-                        }
-
-                    }
-                }
-                if (lastchar == ';') {
-                    inRoots = false;
-                    inIncludes = false;
-                    inExcludes = false;
-                    inAllows = false;
-                }
-            }
-
-            if (inBlockComment) {
-                throw new RuntimeException(file + ", line " +
-                        lineNumber + ", missing \"*/\" to end a block comment");
-            }
-            if (config != null) {
-                throw new RuntimeException(file + ", line " +
-                        lineNumber + ", missing \"}\" to end module definition" +
-                        " for \"" + config.module + "\"");
-            }
-
-        } finally {
-            in.close();
-        }
-
-        return result;
-    }
-
-    private String format(String keyword, Collection<String> values) {
-        if (values.size() == 0) {
-            return "";
-        }
-
-        StringBuilder sb = new StringBuilder();
-        String format = "%4s%-9s";
-        String spaces = String.format(format, "", "");
-        sb.append(String.format(format, "", keyword));
-        int count = 0;
-        for (String s : values) {
-            if (count > 0) {
-                sb.append(",\n").append(spaces);
-            } else if (count++ > 0) {
-                sb.append(", ");
-            }
-            sb.append(s);
-        }
-        if (count > 0) {
-            sb.append(";\n");
-        }
-        return sb.toString();
-    }
-
-    @Override
-    public String toString() {
-        StringBuilder sb = new StringBuilder();
-        sb.append("module " + module).append(" {\n");
-        sb.append(format("include", includes));
-        sb.append(format("root", roots));
-        sb.append(format("allow", filter.allow));
-        sb.append(format("exclude", filter.exclude));
-        sb.append("}\n");
-        return sb.toString();
-    }
-}
--- a/jdk/make/modules/tools/src/com/sun/classanalyzer/ResolutionInfo.java	Tue Mar 15 19:52:42 2011 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,201 +0,0 @@
-/*
- * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-package com.sun.classanalyzer;
-
-import com.sun.classanalyzer.Klass.Method;
-
-/**
- *
- * @author mchung
- */
-public class ResolutionInfo implements Comparable<ResolutionInfo> {
-
-    enum Type {
-
-        REFLECTION("reflection", true),
-        NATIVE("native", true),
-        INTERFACE("interface", false),
-        SUPER("super", false),
-        EXPLICIT("explicit", false),
-        VERIFICATION("verification", false),
-        METHODTRACE("method trace", true),
-        CONSTANT_POOL("constant pool", true),
-        CHECKED_EXCEPTION("throws", true),
-        METHOD("method", true),
-        FIELD("field", true),
-        EXTENDS("extends", true),
-        IMPLEMENTS("implements", true),
-        NOINFO("No info", false);
-
-        private final String name;
-        private final boolean hasInfo;
-
-        private Type(String name, boolean hasInfo) {
-            this.name = name;
-            this.hasInfo = hasInfo;
-        }
-
-        public String getName() {
-            return name;
-        }
-
-        public boolean hasInfo() {
-            return hasInfo;
-        }
-
-        public static Type getType(String s) {
-            if (s.isEmpty()) {
-                return NOINFO;
-            }
-            for (Type t : values()) {
-                if (s.equals(t.name)) {
-                    return t;
-                }
-            }
-            // Need to fix the VM output to add "native"
-            // throw new IllegalArgumentException("Invalid ResolutionInfo.type \"" + s + "\"");
-            System.out.println("WARNING: Invalid ResolutionInfo.type \"" + s + "\"");
-            return null;
-        }
-    }
-    final Klass fromClass;
-    final Method method;
-    final Klass toClass;
-    final int linenumber;
-    final Type type;
-    final String info;
-    private boolean isPublic = false;
-
-    private ResolutionInfo(Klass from, Klass to, int linenumber, Type type, String info) {
-        this.fromClass = from;
-        this.method = null;
-        this.toClass = to;
-        this.linenumber = linenumber;
-        this.type = type;
-        this.info = info;
-    }
-
-    private ResolutionInfo(Klass from, Method m, Klass to, int linenumber, Type type) {
-        this.fromClass = from;
-        this.method = m;
-        this.toClass = to;
-        this.linenumber = linenumber;
-        this.type = type;
-        this.info = m.toString();
-    }
-
-    public boolean isPublic() {
-        return isPublic;
-    }
-
-    public void setPublicAccess(boolean value) {
-        isPublic = value;
-    }
-    static ResolutionInfo resolved(Klass from, Klass to) {
-        return new ResolutionInfo(from, to, 0, Type.NOINFO, "");
-    }
-
-    static ResolutionInfo resolved(Klass from, Klass to, int linenumber) {
-        return new ResolutionInfo(from, to, linenumber, Type.NOINFO, "");
-    }
-
-    static ResolutionInfo resolved(Klass from, Klass to, int linenumber, String reason) {
-        String[] ss = reason.split("\\s+");
-        Type type;
-        String info;
-        if (linenumber == -1) {
-            type = Type.NATIVE;
-            info = ss[0];  // native method name
-        } else {
-            info = ss.length == 2 ? ss[1] : "";
-            type = Type.getType(ss[0]);
-            if (type == null) {
-                if (reason.isEmpty()) {
-                    throw new IllegalArgumentException("Invalid type: " + reason + " (" + ss[0] + ")" + ss.length);
-                }
-                // assume it's native
-                type = Type.NATIVE;
-                info = reason.isEmpty() ? ss[0] : reason;
-            }
-        }
-
-        return new ResolutionInfo(from, to, linenumber, type, info);
-    }
-
-    static ResolutionInfo resolved(Klass from, Klass to, Method callee) {
-        return new ResolutionInfo(from, callee, to, 0, Type.METHODTRACE);
-    }
-
-    static ResolutionInfo resolvedConstantPool(Klass from, Klass to, int index) {
-        return new ResolutionInfo(from, to, 0, Type.CONSTANT_POOL, "#" + index);
-    }
-
-    static ResolutionInfo resolvedField(Klass from, Klass to, String fieldname) {
-        return new ResolutionInfo(from, to, 0, Type.FIELD, fieldname);
-    }
-
-    static ResolutionInfo resolvedMethodSignature(Klass from, Klass to, Method m) {
-        return new ResolutionInfo(from, m, to, 0, Type.METHOD);
-    }
-
-    static ResolutionInfo resolvedCheckedException(Klass from, Klass to, Method m) {
-        return new ResolutionInfo(from, m, to, 0, Type.CHECKED_EXCEPTION);
-    }
-
-    static ResolutionInfo resolvedExtends(Klass from, Klass to) {
-        String info = from.getClassName() + " implements " + to.getClassName();
-        return new ResolutionInfo(from, to, 0, Type.EXTENDS, info);
-    }
-
-    static ResolutionInfo resolvedImplements(Klass from, Klass to) {
-        String info = from.getClassName() + " implements " + to.getClassName();
-        return new ResolutionInfo(from, to, 0, Type.IMPLEMENTS, info);
-    }
-
-    @Override
-    public int compareTo(ResolutionInfo ri) {
-        if (this.fromClass == ri.fromClass &&
-                this.toClass == ri.toClass &&
-                this.linenumber == ri.linenumber &&
-                this.type == ri.type &&
-                this.info.equals(ri.info)) {
-            return 0;
-        } else if (this.fromClass == ri.fromClass) {
-            if (this.linenumber > ri.linenumber) {
-                return 1;
-            } else if (this.linenumber < ri.linenumber) {
-                return -1;
-            } else if (this.type != ri.type) {
-                return this.type.getName().compareTo(ri.type.getName());
-            } else if (this.toClass != ri.toClass) {
-                return this.toClass.compareTo(ri.toClass);
-            } else {
-                return this.info.compareTo(ri.info);
-            }
-        } else {
-            return this.fromClass.compareTo(ri.fromClass);
-        }
-    }
-}
--- a/jdk/make/modules/tools/src/com/sun/classanalyzer/ResourceFile.java	Tue Mar 15 19:52:42 2011 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,186 +0,0 @@
-/*
- * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-package com.sun.classanalyzer;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.Set;
-import java.util.TreeSet;
-
-/**
- *
- * @author Mandy Chung
- */
-public class ResourceFile implements Comparable<ResourceFile> {
-
-    private final String pathname;
-    private Module module;
-
-    ResourceFile(String pathname) {
-        this.pathname = pathname.replace(File.separatorChar, '/');
-    }
-
-    Module getModule() {
-        return module;
-    }
-
-    void setModule(Module m) {
-        if (module != null) {
-            throw new RuntimeException("Module for " + this + " already set");
-        }
-        this.module = m;
-    }
-
-    String getName() {
-        return pathname;
-    }
-
-    String getPathname() {
-        return pathname;
-    }
-
-    @Override
-    public String toString() {
-        return pathname;
-    }
-
-    @Override
-    public int compareTo(ResourceFile o) {
-        return pathname.compareTo(o.pathname);
-    }
-    static Set<ResourceFile> resources = new TreeSet<ResourceFile>();
-
-    static boolean isResource(String pathname) {
-        String name = pathname.replace(File.separatorChar, '/');
-
-        if (name.endsWith("META-INF/MANIFEST.MF")) {
-            return false;
-        }
-        if (name.contains("META-INF/JCE_RSA.")) {
-            return false;
-        }
-
-        return true;
-    }
-
-    static void addResource(String name, InputStream in) {
-        ResourceFile res;
-        name = name.replace(File.separatorChar, '/');
-        if (name.startsWith("META-INF/services")) {
-            res = new ServiceProviderConfigFile(name, in);
-        } else {
-            res = new ResourceFile(name);
-        }
-        resources.add(res);
-    }
-
-    static Set<ResourceFile> getAllResources() {
-        return Collections.unmodifiableSet(resources);
-    }
-
-    static class ServiceProviderConfigFile extends ResourceFile {
-
-        private final List<String> providers = new ArrayList<String>();
-        private final String service;
-        ServiceProviderConfigFile(String pathname, InputStream in) {
-            super(pathname);
-            readServiceConfiguration(in, providers);
-            this.service = pathname.substring("META-INF/services".length() + 1, pathname.length());
-        }
-
-        @Override
-        String getName() {
-            if (providers.isEmpty()) {
-                return service;
-            } else {
-                // just use the first one for matching
-                return providers.get(0);
-            }
-        }
-
-        @SuppressWarnings("empty-statement")
-        void readServiceConfiguration(InputStream in, List<String> names) {
-            BufferedReader br = null;
-            try {
-                if (in != null) {
-                    // Properties doesn't perserve the order of the input file
-                    br = new BufferedReader(new InputStreamReader(in, "utf-8"));
-                    int lc = 1;
-                    while ((lc = parseLine(br, lc, names)) >= 0);
-                }
-            } catch (IOException ex) {
-                throw new RuntimeException(ex);
-            } finally {
-                if (br != null) {
-                    try {
-                        br.close();
-                    } catch (IOException ex) {
-                        throw new RuntimeException(ex);
-                    }
-                }
-            }
-        }
-
-        // Parse a single line from the given configuration file, adding the name
-        // on the line to the names list.
-        //
-        private int parseLine(BufferedReader r, int lc, List<String> names) throws IOException {
-            String ln = r.readLine();
-            if (ln == null) {
-                return -1;
-            }
-            int ci = ln.indexOf('#');
-            if (ci >= 0) {
-                ln = ln.substring(0, ci);
-            }
-            ln = ln.trim();
-            int n = ln.length();
-            if (n != 0) {
-                if ((ln.indexOf(' ') >= 0) || (ln.indexOf('\t') >= 0)) {
-                    throw new RuntimeException("Illegal configuration-file syntax");
-                }
-                int cp = ln.codePointAt(0);
-                if (!Character.isJavaIdentifierStart(cp)) {
-                    throw new RuntimeException("Illegal provider-class name: " + ln);
-                }
-                for (int i = Character.charCount(cp); i < n; i += Character.charCount(cp)) {
-                    cp = ln.codePointAt(i);
-                    if (!Character.isJavaIdentifierPart(cp) && (cp != '.')) {
-                        throw new RuntimeException("Illegal provider-class name: " + ln);
-                    }
-                }
-                if (!names.contains(ln)) {
-                    names.add(ln);
-                }
-            }
-            return lc + 1;
-        }
-    }
-}
--- a/jdk/make/modules/tools/src/com/sun/classanalyzer/ShowDeps.java	Tue Mar 15 19:52:42 2011 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,100 +0,0 @@
-/*
- * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.sun.classanalyzer;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.*;
-
-/**
- * A simple tool to print out the static dependencies for a given set of JAR,
- * class files, or combinations of. The tools supports an -ignore option to
- * ignore references to classes listed in the file (including .classlists
- * created by the ClassAnalyzer tool).
- */
-
-public class ShowDeps {
-
-    static void usage() {
-        System.out.println("java ShowDeps [-ignore <classlist>] file...");
-        System.out.println("   where <file> is a class or JAR file, or a directory");
-        System.out.println();
-        System.out.println("Example usages:");
-        System.out.println("  java ShowDeps Foo.jar");
-        System.out.println("  java ShowDeps -ignore base.classlist Foo.jar");
-        System.out.println("  java ShowDeps -ignore base.classlist -ignore " +
-            "jaxp-parsers.classlist <dir>");
-        System.exit(-1);
-    }
-
-    public static void main(String[] args) throws IOException {
-        // process -ignore options
-        int argi = 0;
-        Set<String> ignore = new HashSet<String>();
-        while (argi < args.length && args[argi].equals("-ignore")) {
-            argi++;
-            Scanner s = new Scanner(new File(args[argi++]));
-            try {
-                while (s.hasNextLine()) {
-                    String line = s.nextLine();
-                    if (!line.endsWith(".class"))
-                        continue;
-                    int len = line.length();
-                    // convert to class names
-                    String clazz = line.replace('\\', '.').replace('/', '.')
-                        .substring(0, len-6);
-                    ignore.add(clazz);
-                }
-            } finally {
-                s.close();
-            }
-        }
-
-        if (argi >= args.length)
-            usage();
-
-        // parse all classes
-        while (argi < args.length)
-            ClassPath.setClassPath(args[argi++]);
-        ClassPath.parseAllClassFiles();
-
-        // find the classes that don't exist
-        Set<Klass> unresolved = new TreeSet<Klass>();
-        for (Klass k : Klass.getAllClasses()) {
-            if (k.getFileSize() == 0)
-                unresolved.add(k);
-        }
-
-        // print references to classes that don't exist
-        for (Klass k: Klass.getAllClasses()) {
-            for (Klass other : k.getReferencedClasses()) {
-                if (unresolved.contains(other)) {
-                    String name = other.toString();
-                    if (!ignore.contains(name)) {
-                        System.out.format("%s -> %s\n", k, other);
-                    }
-                }
-            }
-        }
-    }
-}
--- a/jdk/make/sun/applet/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/sun/applet/Makefile	Tue Mar 15 20:00:45 2011 -0400
@@ -28,7 +28,6 @@
 #
 
 BUILDDIR = ../..
-MODULE  = applet
 PACKAGE = sun.applet
 PRODUCT = sun
 include $(BUILDDIR)/common/Defs.gmk
--- a/jdk/make/sun/awt/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/sun/awt/Makefile	Tue Mar 15 20:00:45 2011 -0400
@@ -24,7 +24,6 @@
 #
 
 BUILDDIR = ../..
-MODULE  = awt
 PACKAGE = sun.awt
 LIBRARY = awt
 PRODUCT = sun
@@ -368,7 +367,7 @@
 FONTCONFIGS_SRC	= $(CLOSED_SRC)/solaris/classes/sun/awt/fontconfigs
 _FONTCONFIGS	= \
 	fontconfig.properties				\
-	fontconfig.RedHat.properties			\
+	fontconfig.RedHat.5.5.properties		\
 	fontconfig.Turbo.properties			\
 	fontconfig.SuSE.10.properties                   \
 	fontconfig.SuSE.11.properties
@@ -405,7 +404,6 @@
     $(COMPILEFONTCONFIG_JARFILE)
 	$(prep-target)
 	$(BOOT_JAVA_CMD) -jar $(COMPILEFONTCONFIG_JARFILE) $(COMPILEFONTCONFIG_FLAGS) $< $@
-	$(install-module-file)
 	$(call chmod-file, 444)
 	@$(java-vm-cleanup)
 
--- a/jdk/make/sun/awt/mapfile-mawt-vers	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/sun/awt/mapfile-mawt-vers	Tue Mar 15 20:00:45 2011 -0400
@@ -424,6 +424,7 @@
 		Java_sun_java2d_xr_XRSurfaceData_initXRPicture;
 		Java_sun_java2d_xr_XRSurfaceData_initIDs;
 		Java_sun_java2d_xr_XRSurfaceData_XRInitSurface;
+		Java_sun_java2d_xr_XRSurfaceData_freeXSDOPicture;
 		Java_sun_java2d_xr_XRBackendNative_initIDs;
 		Java_sun_java2d_xr_XIDGenerator_bufferXIDs;
 		Java_sun_java2d_xr_XRBackendNative_freeGC;
--- a/jdk/make/sun/cmm/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/sun/cmm/Makefile	Tue Mar 15 20:00:45 2011 -0400
@@ -24,7 +24,6 @@
 #
 
 BUILDDIR = ../..
-MODULE   = java2d
 PRODUCT  = sun
 include $(BUILDDIR)/common/Defs.gmk
 
--- a/jdk/make/sun/cmm/kcms/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/sun/cmm/kcms/Makefile	Tue Mar 15 20:00:45 2011 -0400
@@ -24,7 +24,6 @@
 #
 
 BUILDDIR = ../../..
-MODULE  = java2d
 PACKAGE = sun.java2d.cmm.kcms
 LIBRARY = kcms
 PRODUCT = sun
--- a/jdk/make/sun/cmm/lcms/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/sun/cmm/lcms/Makefile	Tue Mar 15 20:00:45 2011 -0400
@@ -24,7 +24,6 @@
 #
 
 BUILDDIR = ../../..
-MODULE  = java2d
 PACKAGE = sun.java2d.cmm.lcms
 LIBRARY = lcms
 PRODUCT = sun
--- a/jdk/make/sun/dcpr/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/sun/dcpr/Makefile	Tue Mar 15 20:00:45 2011 -0400
@@ -24,7 +24,6 @@
 #
 
 BUILDDIR = ../..
-MODULE  = java2d
 PACKAGE = sun.dc
 LIBRARY = dcpr
 PRODUCT = sun
--- a/jdk/make/sun/font/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/sun/font/Makefile	Tue Mar 15 20:00:45 2011 -0400
@@ -28,7 +28,6 @@
 #
 
 BUILDDIR = ../..
-MODULE  = font
 PACKAGE = sun.font
 LIBRARY = fontmanager
 PRODUCT = sun
@@ -136,7 +135,6 @@
 
 $(FREETYPE_LIB):
 	$(CP) $(FREETYPE_LIB_PATH)/$(LIB_PREFIX)freetype.$(LIBRARY_SUFFIX) $@
-	$(install-module-file)
 endif
 
 #ifeq ($(PLATFORM), solaris)
--- a/jdk/make/sun/font/t2k/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/sun/font/t2k/Makefile	Tue Mar 15 20:00:45 2011 -0400
@@ -28,7 +28,6 @@
 #
 
 BUILDDIR = ../../..
-MODULE  = font
 PACKAGE = sun.font
 LIBRARY = t2k
 PRODUCT = sun
--- a/jdk/make/sun/headless/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/sun/headless/Makefile	Tue Mar 15 20:00:45 2011 -0400
@@ -30,7 +30,6 @@
 MOTIF_VERSION_STRING=none
 LIB_LOCATION = $(LIBDIR)/$(LIBARCH)/headless
 
-MODULE  = awt
 PACKAGE = sun.awt
 LIBRARY = mawt
 LIBRARY_OUTPUT = headless
--- a/jdk/make/sun/image/generic/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/sun/image/generic/Makefile	Tue Mar 15 20:00:45 2011 -0400
@@ -28,7 +28,6 @@
 #
 
 BUILDDIR = ../../..
-MODULE  = media
 PACKAGE = sun.awt.medialib
 LIBRARY = mlib_image
 PRODUCT = sun
--- a/jdk/make/sun/image/vis/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/sun/image/vis/Makefile	Tue Mar 15 20:00:45 2011 -0400
@@ -27,7 +27,6 @@
 # Makefile for building the VIS (solaris-only) version of medialib
 #
 BUILDDIR = ../../..
-MODULE  = media
 PACKAGE = sun.awt.medialib
 LIBRARY = mlib_image_v
 PRODUCT = sun
--- a/jdk/make/sun/jar/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/sun/jar/Makefile	Tue Mar 15 20:00:45 2011 -0400
@@ -28,7 +28,6 @@
 #
 
 BUILDDIR = ../..
-MODULE  = jar-tool
 PACKAGE = sun.tools
 PRODUCT = sun
 include $(BUILDDIR)/common/Defs.gmk
--- a/jdk/make/sun/javazic/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/sun/javazic/Makefile	Tue Mar 15 20:00:45 2011 -0400
@@ -27,7 +27,6 @@
 
 
 BUILDDIR = ../..
-MODULE  = base
 PACKAGE = sun.javazic
 PRODUCT = sun
 include $(BUILDDIR)/common/Defs.gmk
@@ -70,7 +69,6 @@
 	$(RM) -r $(@D)
 	$(prep-target)
 	$(CP) -r $(WORKDIR)/* $(@D)
-	$(install-module-dir)
 
 clean clobber::
 	$(RM) -r $(TEMPDIR) $(INSTALLDIR)
--- a/jdk/make/sun/jawt/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/sun/jawt/Makefile	Tue Mar 15 20:00:45 2011 -0400
@@ -24,7 +24,6 @@
 #
 
 BUILDDIR = ../..
-MODULE  = awt
 PACKAGE = sun.awt
 LIBRARY = jawt
 PRODUCT = sun
--- a/jdk/make/sun/jconsole/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/sun/jconsole/Makefile	Tue Mar 15 20:00:45 2011 -0400
@@ -28,7 +28,6 @@
 #
 
 BUILDDIR = ../..
-MODULE  = jconsole
 PACKAGE = sun.tools.jconsole
 PRODUCT = sun
 include $(BUILDDIR)/common/Defs.gmk
--- a/jdk/make/sun/jdbc/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/sun/jdbc/Makefile	Tue Mar 15 20:00:45 2011 -0400
@@ -33,7 +33,6 @@
 #
 
 BUILDDIR = ../..
-MODULE  = jdbc-odbc
 PACKAGE = sun.jdbc.odbc
 LIBRARY = JdbcOdbc
 PRODUCT = sun
--- a/jdk/make/sun/jdga/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/sun/jdga/Makefile	Tue Mar 15 20:00:45 2011 -0400
@@ -25,7 +25,6 @@
 
 
 BUILDDIR = ../..
-MODULE  = java2d
 PACKAGE = sun.jdga
 LIBRARY = sunwjdga
 PRODUCT = sun
--- a/jdk/make/sun/jpeg/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/sun/jpeg/Makefile	Tue Mar 15 20:00:45 2011 -0400
@@ -24,7 +24,6 @@
 #
 
 BUILDDIR = ../..
-MODULE  = java2d
 PACKAGE = sun.awt
 LIBRARY = jpeg
 PRODUCT = sun
--- a/jdk/make/sun/launcher/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/sun/launcher/Makefile	Tue Mar 15 20:00:45 2011 -0400
@@ -24,7 +24,6 @@
 #
 
 BUILDDIR = ../..
-MODULE  = base
 PACKAGE = sun.launcher
 PRODUCT = sun
 include $(BUILDDIR)/common/Defs.gmk
--- a/jdk/make/sun/management/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/sun/management/Makefile	Tue Mar 15 20:00:45 2011 -0400
@@ -28,7 +28,6 @@
 #
 
 BUILDDIR = ../..
-MODULE   = management
 
 include $(BUILDDIR)/common/Defs.gmk
 
--- a/jdk/make/sun/native2ascii/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/sun/native2ascii/Makefile	Tue Mar 15 20:00:45 2011 -0400
@@ -28,7 +28,6 @@
 #
 
 BUILDDIR = ../..
-MODULE  = tools
 PACKAGE = sun.tools.native2ascii
 PRODUCT = sun
 OTHER_JAVACFLAGS += -Xlint:serial -Werror
--- a/jdk/make/sun/net/others/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/sun/net/others/Makefile	Tue Mar 15 20:00:45 2011 -0400
@@ -24,7 +24,6 @@
 #
 
 BUILDDIR = ../../..
-MODULE  = base
 PACKAGE = sun.net
 PRODUCT = sun
 include $(BUILDDIR)/common/Defs.gmk
--- a/jdk/make/sun/net/spi/nameservice/dns/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/sun/net/spi/nameservice/dns/Makefile	Tue Mar 15 20:00:45 2011 -0400
@@ -30,7 +30,6 @@
 BUILDDIR = ../../../../..
 
 # dns should probably be its own module
-MODULE  = net-dns
 PACKAGE = sun.net.spi.nameservice.dns
 PRODUCT = sun
 include $(BUILDDIR)/common/Defs.gmk
--- a/jdk/make/sun/nio/cs/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/sun/nio/cs/Makefile	Tue Mar 15 20:00:45 2011 -0400
@@ -30,7 +30,6 @@
 BUILDDIR = ../../..
 
 # charsets should be separated from nio module 
-MODULE  = charsets
 PACKAGE = sun.nio
 PRODUCT = sun
 
--- a/jdk/make/sun/org/mozilla/javascript/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/sun/org/mozilla/javascript/Makefile	Tue Mar 15 20:00:45 2011 -0400
@@ -28,7 +28,6 @@
 #
 
 BUILDDIR = ../../../..
-MODULE  = scripting-rhino
 PACKAGE = sun.org.mozilla.javascript.internal
 PRODUCT = sun
 include $(BUILDDIR)/common/Defs.gmk
--- a/jdk/make/sun/pisces/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/sun/pisces/Makefile	Tue Mar 15 20:00:45 2011 -0400
@@ -24,7 +24,6 @@
 #
 
 BUILDDIR = ../..
-MODULE  = java2d
 PACKAGE = sun.pisces
 PRODUCT = sun
 include $(BUILDDIR)/common/Defs.gmk
--- a/jdk/make/sun/rmi/cgi/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/sun/rmi/cgi/Makefile	Tue Mar 15 20:00:45 2011 -0400
@@ -29,7 +29,6 @@
 
 BUILDDIR = ../../..
 # java-rmi.cgi is a JDK tool
-MODULE  = tools
 PACKAGE = sun.rmi
 PRODUCT = sun
 PROGRAM = java-rmi
--- a/jdk/make/sun/rmi/oldtools/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/sun/rmi/oldtools/Makefile	Tue Mar 15 20:00:45 2011 -0400
@@ -28,7 +28,6 @@
 #
 
 BUILDDIR = ../../..
-MODULE   = oldjavac
 PRODUCT	 = oldjavac
 
 include $(BUILDDIR)/common/Defs.gmk
--- a/jdk/make/sun/rmi/registry/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/sun/rmi/registry/Makefile	Tue Mar 15 20:00:45 2011 -0400
@@ -28,7 +28,6 @@
 #
 
 BUILDDIR = ../../..
-MODULE  = rmi
 PACKAGE = sun.rmi.registry
 PRODUCT = sun
 include $(BUILDDIR)/common/Defs.gmk
--- a/jdk/make/sun/rmi/rmi/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/sun/rmi/rmi/Makefile	Tue Mar 15 20:00:45 2011 -0400
@@ -28,7 +28,6 @@
 #
 
 BUILDDIR = ../../..
-MODULE  = rmi
 PACKAGE = sun.rmi
 PRODUCT = sun
 LIBRARY = rmi
--- a/jdk/make/sun/rmi/rmic/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/sun/rmi/rmic/Makefile	Tue Mar 15 20:00:45 2011 -0400
@@ -28,7 +28,6 @@
 #
 
 BUILDDIR = ../../..
-MODULE  = rmic
 PACKAGE = sun.rmi.rmic
 PRODUCT = sun
 include $(BUILDDIR)/common/Defs.gmk
--- a/jdk/make/sun/rmi/rmid/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/sun/rmi/rmid/Makefile	Tue Mar 15 20:00:45 2011 -0400
@@ -29,7 +29,6 @@
 #
 
 BUILDDIR = ../../..
-MODULE  = rmi-activation
 PACKAGE = sun.rmi.activation
 PRODUCT = sun
 include $(BUILDDIR)/common/Defs.gmk
--- a/jdk/make/sun/security/ec/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/sun/security/ec/Makefile	Tue Mar 15 20:00:45 2011 -0400
@@ -89,7 +89,6 @@
 #
 
 BUILDDIR = ../../..
-MODULE  = security-sunec
 PACKAGE = sun.security.ec
 PRODUCT = sun
 
@@ -309,7 +308,7 @@
 else
 $(JAR_DESTFILE): $(SIGNED_DIR)/sunec.jar
 endif
-	$(install-non-module-file)
+	$(install-file)
 
 ifndef OPENJDK
 install-prebuilt:
--- a/jdk/make/sun/security/jgss/wrapper/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/sun/security/jgss/wrapper/Makefile	Tue Mar 15 20:00:45 2011 -0400
@@ -24,7 +24,6 @@
 #
 
 BUILDDIR = ../../../..
-MODULE  = security-kerberos
 PACKAGE = sun.security.jgss.wrapper
 PRODUCT = sun
 
--- a/jdk/make/sun/security/krb5/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/sun/security/krb5/Makefile	Tue Mar 15 20:00:45 2011 -0400
@@ -24,7 +24,6 @@
 #
 
 BUILDDIR = ../../..
-MODULE  = security-kerberos
 PACKAGE = sun.security.krb5
 PRODUCT = sun
 include $(BUILDDIR)/common/Defs.gmk
--- a/jdk/make/sun/security/mscapi/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/sun/security/mscapi/Makefile	Tue Mar 15 20:00:45 2011 -0400
@@ -89,7 +89,6 @@
 #
 
 BUILDDIR = ../../..
-MODULE  = security-sunmscapi
 PACKAGE = sun.security.mscapi
 LIBRARY = sunmscapi
 PRODUCT = sun
@@ -273,7 +272,7 @@
 else
 $(JAR_DESTFILE): $(SIGNED_DIR)/sunmscapi.jar
 endif
-	$(install-non-module-file)
+	$(install-file)
 
 ifndef OPENJDK
 install-prebuilt:
--- a/jdk/make/sun/security/pkcs11/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/sun/security/pkcs11/Makefile	Tue Mar 15 20:00:45 2011 -0400
@@ -89,7 +89,6 @@
 #
 
 BUILDDIR = ../../..
-MODULE  = security-sunpkcs11
 PACKAGE = sun.security.pkcs11
 LIBRARY = j2pkcs11
 PRODUCT = sun
@@ -288,7 +287,7 @@
 else
 $(JAR_DESTFILE): $(SIGNED_DIR)/sunpkcs11.jar
 endif
-	$(install-non-module-file)
+	$(install-file)
 
 ifndef OPENJDK
 install-prebuilt:
--- a/jdk/make/sun/security/smartcardio/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/sun/security/smartcardio/Makefile	Tue Mar 15 20:00:45 2011 -0400
@@ -24,7 +24,6 @@
 #
 
 BUILDDIR = ../../..
-MODULE  = security-smartcardio
 PACKAGE = sun.security.smartcardio
 LIBRARY = j2pcsc
 PRODUCT = sun
--- a/jdk/make/sun/security/tools/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/sun/security/tools/Makefile	Tue Mar 15 20:00:45 2011 -0400
@@ -24,7 +24,6 @@
 #
 
 BUILDDIR = ../../..
-MODULE  = security-tools
 PACKAGE = sun.security.tools
 PRODUCT = sun
 include $(BUILDDIR)/common/Defs.gmk
--- a/jdk/make/sun/serialver/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/sun/serialver/Makefile	Tue Mar 15 20:00:45 2011 -0400
@@ -28,7 +28,6 @@
 #
 
 BUILDDIR = ../..
-MODULE  = serialver
 PACKAGE = sun.tools.serialver
 PRODUCT = sun
 include $(BUILDDIR)/common/Defs.gmk
--- a/jdk/make/sun/splashscreen/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/sun/splashscreen/Makefile	Tue Mar 15 20:00:45 2011 -0400
@@ -24,7 +24,6 @@
 #
 
 BUILDDIR = ../..
-MODULE  = awt
 PACKAGE = sun.awt
 LIBRARY = splashscreen
 PRODUCT = sun
--- a/jdk/make/sun/text/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/sun/text/Makefile	Tue Mar 15 20:00:45 2011 -0400
@@ -29,7 +29,6 @@
 
 BUILDDIR = ../..
 
-MODULE  = localedata
 PACKAGE = sun.text
 PRODUCT = sun
 
--- a/jdk/make/sun/tools/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/sun/tools/Makefile	Tue Mar 15 20:00:45 2011 -0400
@@ -28,7 +28,6 @@
 #
 
 BUILDDIR = ../..
-MODULE  = tools
 PACKAGE = sun.tools
 PRODUCT = sun
 include $(BUILDDIR)/common/Defs.gmk
--- a/jdk/make/sun/tracing/dtrace/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/sun/tracing/dtrace/Makefile	Tue Mar 15 20:00:45 2011 -0400
@@ -27,7 +27,6 @@
 # Makefile for building dtrace extension
 #
 BUILDDIR = ../../..
-MODULE  = tracing
 PACKAGE = sun.tracing.dtrace
 LIBRARY = jsdt
 PRODUCT = sun
--- a/jdk/make/sun/xawt/Makefile	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/sun/xawt/Makefile	Tue Mar 15 20:00:45 2011 -0400
@@ -24,7 +24,6 @@
 #
 
 BUILDDIR = ../..
-MODULE  = awt
 PACKAGE = sun.awt.X11
 LIBRARY = mawt
 LIBRARY_OUTPUT = xawt
--- a/jdk/make/sun/xawt/mapfile-vers	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/make/sun/xawt/mapfile-vers	Tue Mar 15 20:00:45 2011 -0400
@@ -374,6 +374,7 @@
         Java_sun_java2d_xr_XRSurfaceData_initXRPicture;
         Java_sun_java2d_xr_XRSurfaceData_initIDs;
         Java_sun_java2d_xr_XRSurfaceData_XRInitSurface;
+	Java_sun_java2d_xr_XRSurfaceData_freeXSDOPicture;
 	Java_sun_java2d_xr_XRBackendNative_initIDs;
 	Java_sun_java2d_xr_XRBackendNative_freeGC;
 	Java_sun_java2d_xr_XRBackendNative_createGC;
@@ -432,6 +433,7 @@
         Java_sun_awt_X11_GtkFileDialogPeer_run;
         Java_sun_awt_X11_GtkFileDialogPeer_quit;
         Java_sun_awt_X11_GtkFileDialogPeer_toFront;
+        Java_sun_awt_X11_GtkFileDialogPeer_setBounds;
 
 	Java_sun_print_CUPSPrinter_initIDs;
 	Java_sun_print_CUPSPrinter_getCupsServer;
--- a/jdk/src/share/classes/com/sun/media/sound/AiffFileWriter.java	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/src/share/classes/com/sun/media/sound/AiffFileWriter.java	Tue Mar 15 20:00:45 2011 -0400
@@ -25,12 +25,10 @@
 
 package com.sun.media.sound;
 
-import java.util.Vector;
 import java.io.File;
 import java.io.InputStream;
 import java.io.OutputStream;
 import java.io.IOException;
-import java.io.DataInputStream;
 
 import java.io.BufferedOutputStream;
 import java.io.DataOutputStream;
@@ -398,7 +396,8 @@
         header = baos.toByteArray();
         headerStream = new ByteArrayInputStream( header );
 
-        aiffStream = new SequenceInputStream(headerStream,codedAudioStream);
+        aiffStream = new SequenceInputStream(headerStream,
+                            new NoCloseInputStream(codedAudioStream));
 
         return aiffStream;
 
--- a/jdk/src/share/classes/com/sun/media/sound/AlawCodec.java	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/src/share/classes/com/sun/media/sound/AlawCodec.java	Tue Mar 15 20:00:45 2011 -0400
@@ -52,9 +52,6 @@
     private static final short seg_end [] = {0xFF, 0x1FF, 0x3FF,
                                              0x7FF, 0xFFF, 0x1FFF, 0x3FFF, 0x7FFF};
 
-    private static final int tempBufferSize = 64;
-    private byte tempBuffer [] = null;
-
     /**
      * Initializes the decode tables
      */
@@ -199,12 +196,9 @@
         AudioFormat inputFormat = stream.getFormat();
 
         if( inputFormat.matches(outputFormat) ) {
-
             cs = stream;
         } else {
-
             cs = (AudioInputStream) (new AlawCodecStream(stream, outputFormat));
-            tempBuffer = new byte[tempBufferSize];
         }
 
         return cs;
@@ -264,6 +258,10 @@
 
     class AlawCodecStream extends AudioInputStream {
 
+        // tempBuffer required only for encoding (when encode is true)
+        private static final int tempBufferSize = 64;
+        private byte tempBuffer [] = null;
+
         /**
          * True to encode to a-law, false to decode to linear
          */
@@ -303,6 +301,7 @@
                 encodeFormat = outputFormat;
                 decodeFormat = inputFormat;
                 PCMIsBigEndian = inputFormat.isBigEndian();
+                tempBuffer = new byte[tempBufferSize];
             }
 
             if (PCMIsBigEndian) {
--- a/jdk/src/share/classes/com/sun/media/sound/AuFileWriter.java	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/src/share/classes/com/sun/media/sound/AuFileWriter.java	Tue Mar 15 20:00:45 2011 -0400
@@ -25,12 +25,10 @@
 
 package com.sun.media.sound;
 
-import java.util.Vector;
 import java.io.File;
 import java.io.InputStream;
 import java.io.OutputStream;
 import java.io.IOException;
-import java.lang.IllegalArgumentException;
 
 import java.io.BufferedOutputStream;
 import java.io.DataOutputStream;
@@ -131,10 +129,10 @@
             // $$fb: 2001-07-13: done. Fixes Bug 4479981
             RandomAccessFile raf=new RandomAccessFile(out, "rw");
             if (raf.length()<=0x7FFFFFFFl) {
-                                // skip AU magic and data offset field
+                // skip AU magic and data offset field
                 raf.skipBytes(8);
                 raf.writeInt(bytesWritten-AuFileFormat.AU_HEADERSIZE);
-                                // that's all
+                // that's all
             }
             raf.close();
         }
@@ -303,7 +301,8 @@
         dos.close();
         header = baos.toByteArray();
         headerStream = new ByteArrayInputStream( header );
-        auStream = new SequenceInputStream(headerStream,codedAudioStream);
+        auStream = new SequenceInputStream(headerStream,
+                        new NoCloseInputStream(codedAudioStream));
 
         return auStream;
     }
--- a/jdk/src/share/classes/com/sun/media/sound/DirectAudioDevice.java	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/src/share/classes/com/sun/media/sound/DirectAudioDevice.java	Tue Mar 15 20:00:45 2011 -0400
@@ -395,11 +395,7 @@
         protected volatile boolean noService = false; // do not run the nService method
 
         // Guards all native calls.
-        protected Object lockNative = new Object();
-        // Guards the lastOpened static variable in implOpen and implClose.
-        protected static Object lockLast = new Object();
-        // Keeps track of last opened line, see implOpen "trick".
-        protected static DirectDL lastOpened;
+        protected final Object lockNative = new Object();
 
         // CONSTRUCTOR
         protected DirectDL(DataLine.Info info,
@@ -501,48 +497,21 @@
             // align buffer to full frames
             bufferSize = ((int) bufferSize / format.getFrameSize()) * format.getFrameSize();
 
-            synchronized(lockLast) {
-                id = nOpen(mixerIndex, deviceID, isSource,
-                        encoding,
-                        hardwareFormat.getSampleRate(),
-                        hardwareFormat.getSampleSizeInBits(),
-                        hardwareFormat.getFrameSize(),
-                        hardwareFormat.getChannels(),
-                        hardwareFormat.getEncoding().equals(
-                            AudioFormat.Encoding.PCM_SIGNED),
-                        hardwareFormat.isBigEndian(),
-                        bufferSize);
+            id = nOpen(mixerIndex, deviceID, isSource,
+                    encoding,
+                    hardwareFormat.getSampleRate(),
+                    hardwareFormat.getSampleSizeInBits(),
+                    hardwareFormat.getFrameSize(),
+                    hardwareFormat.getChannels(),
+                    hardwareFormat.getEncoding().equals(
+                        AudioFormat.Encoding.PCM_SIGNED),
+                    hardwareFormat.isBigEndian(),
+                    bufferSize);
 
-                if (id == 0) {
-                    // Bah... Dirty trick. The most likely cause is an application
-                    // already having a line open for this particular hardware
-                    // format and forgetting about it. If so, silently close that
-                    // implementation and try again. Unfortuantely we can only
-                    // open one line per hardware format currently.
-                    if (lastOpened != null
-                            && hardwareFormat.matches(lastOpened.hardwareFormat)) {
-                        lastOpened.implClose();
-                        lastOpened = null;
-
-                        id = nOpen(mixerIndex, deviceID, isSource,
-                                encoding,
-                                hardwareFormat.getSampleRate(),
-                                hardwareFormat.getSampleSizeInBits(),
-                                hardwareFormat.getFrameSize(),
-                                hardwareFormat.getChannels(),
-                                hardwareFormat.getEncoding().equals(
-                                    AudioFormat.Encoding.PCM_SIGNED),
-                                hardwareFormat.isBigEndian(),
-                                bufferSize);
-                    }
-
-                    if (id == 0) {
-                        // TODO: nicer error messages...
-                        throw new LineUnavailableException(
-                            "line with format "+format+" not supported.");
-                    }
-                }
-                lastOpened = this;
+            if (id == 0) {
+                // TODO: nicer error messages...
+                throw new LineUnavailableException(
+                        "line with format "+format+" not supported.");
             }
 
             this.bufferSize = nGetBufferSize(id, isSource);
@@ -615,14 +584,13 @@
             }
             synchronized (lockNative) {
                 nStop(id, isSource);
-
+            }
+            // wake up any waiting threads
+            synchronized(lock) {
                 // need to set doIO to false before notifying the
                 // read/write thread, that's why isStartedRunning()
                 // cannot be used
                 doIO = false;
-            }
-            // wake up any waiting threads
-            synchronized(lock) {
                 lock.notifyAll();
             }
             setActive(false);
@@ -649,12 +617,8 @@
             doIO = false;
             long oldID = id;
             id = 0;
-            synchronized (lockLast) {
-                synchronized (lockNative) {
-                    nClose(oldID, isSource);
-                    if (lastOpened == this)
-                      lastOpened = null;
-                }
+            synchronized (lockNative) {
+                nClose(oldID, isSource);
             }
             bytePosition = 0;
             softwareConversionSize = 0;
@@ -667,10 +631,9 @@
             if (id == 0) {
                 return 0;
             }
-            int a = 0;
+            int a;
             synchronized (lockNative) {
-                if (doIO)
-                    a = nAvailable(id, isSource);
+                a = nAvailable(id, isSource);
             }
             return a;
         }
@@ -726,7 +689,7 @@
                     lock.notifyAll();
                 }
                 synchronized (lockNative) {
-                    if (id != 0 && doIO) {
+                    if (id != 0) {
                         // then flush native buffers
                         nFlush(id, isSource);
                     }
@@ -737,10 +700,9 @@
 
         // replacement for getFramePosition (see AbstractDataLine)
         public long getLongFramePosition() {
-            long pos = 0;
+            long pos;
             synchronized (lockNative) {
-                if (doIO)
-                    pos = nGetBytePosition(id, isSource, bytePosition);
+                pos = nGetBytePosition(id, isSource, bytePosition);
             }
             // hack because ALSA sometimes reports wrong framepos
             if (pos < 0) {
@@ -786,12 +748,11 @@
             }
             int written = 0;
             while (!flushing) {
-                int thisWritten = 0;
+                int thisWritten;
                 synchronized (lockNative) {
-                    if (doIO)
-                        thisWritten = nWrite(id, b, off, len,
-                                softwareConversionSize,
-                                leftGain, rightGain);
+                    thisWritten = nWrite(id, b, off, len,
+                            softwareConversionSize,
+                            leftGain, rightGain);
                     if (thisWritten < 0) {
                         // error in native layer
                         break;
@@ -1014,10 +975,9 @@
             }
             int read = 0;
             while (doIO && !flushing) {
-                int thisRead = 0;
+                int thisRead;
                 synchronized (lockNative) {
-                    if (doIO)
-                        thisRead = nRead(id, b, off, len, softwareConversionSize);
+                    thisRead = nRead(id, b, off, len, softwareConversionSize);
                     if (thisRead < 0) {
                         // error in native layer
                         break;
@@ -1252,8 +1212,7 @@
             // set new native position (if necessary)
             // this must come after the flush!
             synchronized (lockNative) {
-                if (doIO)
-                    nSetBytePosition(id, isSource, frames * frameSize);
+                nSetBytePosition(id, isSource, frames * frameSize);
             }
 
             if (Printer.debug) Printer.debug("  DirectClip.setFramePosition: "
--- a/jdk/src/share/classes/com/sun/media/sound/RealTimeSequencer.java	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/src/share/classes/com/sun/media/sound/RealTimeSequencer.java	Tue Mar 15 20:00:45 2011 -0400
@@ -775,15 +775,22 @@
         Receiver rec = null;
         // first try to connect to the default synthesizer
         // IMPORTANT: this code needs to be synch'ed with
-        //            MidiSystem.getReceiver(boolean), because the same
+        //            MidiSystem.getSequencer(boolean), because the same
         //            algorithm needs to be used!
         try {
             Synthesizer synth = MidiSystem.getSynthesizer();
-            synth.open();
             if (synth instanceof ReferenceCountingDevice) {
                 rec = ((ReferenceCountingDevice) synth).getReceiverReferenceCounting();
             } else {
-                rec = synth.getReceiver();
+                synth.open();
+                try {
+                    rec = synth.getReceiver();
+                } finally {
+                    // make sure that the synth is properly closed
+                    if (rec == null) {
+                        synth.close();
+                    }
+                }
             }
         } catch (Exception e) {
             // something went wrong with synth
--- a/jdk/src/share/classes/com/sun/media/sound/StandardMidiFileReader.java	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/src/share/classes/com/sun/media/sound/StandardMidiFileReader.java	Tue Mar 15 20:00:45 2011 -0400
@@ -127,7 +127,7 @@
                 resolution = timing;
             } else {
                 // SMPTE based timing.  first decipher the frame code.
-                int frameCode = (-1 * timing) >> 8;
+                int frameCode = -1 * (timing >> 8);
                 switch(frameCode) {
                 case 24:
                     divisionType = Sequence.SMPTE_24;
--- a/jdk/src/share/classes/com/sun/media/sound/SunFileWriter.java	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/src/share/classes/com/sun/media/sound/SunFileWriter.java	Tue Mar 15 20:00:45 2011 -0400
@@ -30,14 +30,9 @@
 import java.io.OutputStream;
 import java.io.IOException;
 import java.io.DataInputStream;
-import java.io.RandomAccessFile;
-import java.net.URL;
 
-import javax.sound.sampled.AudioFormat;
 import javax.sound.sampled.AudioFileFormat;
 import javax.sound.sampled.AudioInputStream;
-import javax.sound.sampled.AudioSystem;
-import javax.sound.sampled.UnsupportedAudioFileException;
 import javax.sound.sampled.spi.AudioFileWriter;
 
 
@@ -177,4 +172,62 @@
         return i;
     }
 
+    /**
+     * InputStream wrapper class which prevent source stream from being closed.
+     * The class is usefull for use with SequenceInputStream to prevent
+     * closing of the source input streams.
+     */
+    protected class NoCloseInputStream extends InputStream {
+        private final InputStream in;
+
+        public NoCloseInputStream(InputStream in) {
+            this.in = in;
+        }
+
+        @Override
+        public int read() throws IOException {
+            return in.read();
+        }
+
+        @Override
+        public int read(byte b[]) throws IOException {
+            return in.read(b);
+        }
+
+        @Override
+        public int read(byte b[], int off, int len) throws IOException {
+            return in.read(b, off, len);
+        }
+
+        @Override
+        public long skip(long n) throws IOException {
+            return in.skip(n);
+        }
+
+        @Override
+        public int available() throws IOException {
+            return in.available();
+        }
+
+        @Override
+        public void close() throws IOException {
+            // don't propagate the call
+        }
+
+        @Override
+        public void mark(int readlimit) {
+            in.mark(readlimit);
+        }
+
+        @Override
+        public void reset() throws IOException {
+            in.reset();
+        }
+
+        @Override
+        public boolean markSupported() {
+            return in.markSupported();
+        }
+
+    }
 }
--- a/jdk/src/share/classes/com/sun/media/sound/WaveFileWriter.java	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/src/share/classes/com/sun/media/sound/WaveFileWriter.java	Tue Mar 15 20:00:45 2011 -0400
@@ -25,12 +25,10 @@
 
 package com.sun.media.sound;
 
-import java.util.Vector;
 import java.io.File;
 import java.io.InputStream;
 import java.io.OutputStream;
 import java.io.IOException;
-import java.lang.IllegalArgumentException;
 
 import java.io.BufferedOutputStream;
 import java.io.DataOutputStream;
@@ -371,7 +369,8 @@
         dos.close();
         header = baos.toByteArray();
         headerStream = new ByteArrayInputStream( header );
-        waveStream = new SequenceInputStream(headerStream,codedAudioStream);
+        waveStream = new SequenceInputStream(headerStream,
+                            new NoCloseInputStream(codedAudioStream));
 
         return (InputStream)waveStream;
     }
--- a/jdk/src/share/classes/java/awt/Font.java	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/src/share/classes/java/awt/Font.java	Tue Mar 15 20:00:45 2011 -0400
@@ -1985,8 +1985,22 @@
      * @since 1.2
      */
     public int canDisplayUpTo(String str) {
-        return canDisplayUpTo(new StringCharacterIterator(str), 0,
-            str.length());
+        Font2D font2d = getFont2D();
+        int len = str.length();
+        for (int i = 0; i < len; i++) {
+            char c = str.charAt(i);
+            if (font2d.canDisplay(c)) {
+                continue;
+            }
+            if (!Character.isHighSurrogate(c)) {
+                return i;
+            }
+            if (!font2d.canDisplay(str.codePointAt(i))) {
+                return i;
+            }
+            i++;
+        }
+        return -1;
     }
 
     /**
@@ -2009,11 +2023,21 @@
      * @since 1.2
      */
     public int canDisplayUpTo(char[] text, int start, int limit) {
-        while (start < limit && canDisplay(text[start])) {
-            ++start;
+        Font2D font2d = getFont2D();
+        for (int i = start; i < limit; i++) {
+            char c = text[i];
+            if (font2d.canDisplay(c)) {
+                continue;
+            }
+            if (!Character.isHighSurrogate(c)) {
+                return i;
+            }
+            if (!font2d.canDisplay(Character.codePointAt(text, i, limit))) {
+                return i;
+            }
+            i++;
         }
-
-        return start == limit ? -1 : start;
+        return -1;
     }
 
     /**
@@ -2034,13 +2058,26 @@
      * @since 1.2
      */
     public int canDisplayUpTo(CharacterIterator iter, int start, int limit) {
-        for (char c = iter.setIndex(start);
-             iter.getIndex() < limit && canDisplay(c);
-             c = iter.next()) {
+        Font2D font2d = getFont2D();
+        char c = iter.setIndex(start);
+        for (int i = start; i < limit; i++, c = iter.next()) {
+            if (font2d.canDisplay(c)) {
+                continue;
+            }
+            if (!Character.isHighSurrogate(c)) {
+                return i;
+            }
+            char c2 = iter.next();
+            // c2 could be CharacterIterator.DONE which is not a low surrogate.
+            if (!Character.isLowSurrogate(c2)) {
+                return i;
+            }
+            if (!font2d.canDisplay(Character.toCodePoint(c, c2))) {
+                return i;
+            }
+            i++;
         }
-
-        int result = iter.getIndex();
-        return result == limit ? -1 : result;
+        return -1;
     }
 
     /**
--- a/jdk/src/share/classes/java/util/Calendar.java	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/src/share/classes/java/util/Calendar.java	Tue Mar 15 20:00:45 2011 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -554,7 +554,7 @@
 
     /**
      * Field number for <code>get</code> and <code>set</code> indicating the
-     * daylight savings offset in milliseconds.
+     * daylight saving offset in milliseconds.
      * <p>
      * This field reflects the correct daylight saving offset value of
      * the time zone of this <code>Calendar</code> if the
--- a/jdk/src/share/classes/java/util/GregorianCalendar.java	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/src/share/classes/java/util/GregorianCalendar.java	Tue Mar 15 20:00:45 2011 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -260,7 +260,7 @@
  * // create a Pacific Standard Time time zone
  * SimpleTimeZone pdt = new SimpleTimeZone(-8 * 60 * 60 * 1000, ids[0]);
  *
- * // set up rules for daylight savings time
+ * // set up rules for Daylight Saving Time
  * pdt.setStartRule(Calendar.APRIL, 1, Calendar.SUNDAY, 2 * 60 * 60 * 1000);
  * pdt.setEndRule(Calendar.OCTOBER, -1, Calendar.SUNDAY, 2 * 60 * 60 * 1000);
  *
--- a/jdk/src/share/classes/java/util/TimeZone.java	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/src/share/classes/java/util/TimeZone.java	Tue Mar 15 20:00:45 2011 -0400
@@ -339,8 +339,9 @@
     /**
      * Returns a name in the specified {@code style} of this {@code TimeZone}
      * suitable for presentation to the user in the default locale. If the
-     * specified {@code daylight} is {@code true}, a daylight saving time name
-     * is returned. Otherwise, a standard time name is returned.
+     * specified {@code daylight} is {@code true}, a Daylight Saving Time name
+     * is returned (even if this {@code TimeZone} doesn't observe Daylight Saving
+     * Time). Otherwise, a Standard Time name is returned.
      *
      * <p>This method is equivalent to:
      * <pre><blockquote>
@@ -348,7 +349,8 @@
      *                Locale.getDefault({@link Locale.Category#DISPLAY}))
      * </blockquote></pre>
      *
-     * @param daylight if {@code true}, return the daylight saving time name.
+     * @param daylight {@code true} specifying a Daylight Saving Time name, or
+     *                 {@code false} specifying a Standard Time name
      * @param style either {@link #LONG} or {@link #SHORT}
      * @return the human-readable name of this time zone in the default locale.
      * @exception IllegalArgumentException if {@code style} is invalid.
@@ -356,6 +358,7 @@
      * @see #getDisplayName(boolean, int, Locale)
      * @see Locale#getDefault(Locale.Category)
      * @see Locale.Category
+     * @see java.text.DateFormatSymbols#getZoneStrings()
      */
     public final String getDisplayName(boolean daylight, int style) {
         return getDisplayName(daylight, style,
@@ -365,8 +368,9 @@
     /**
      * Returns a name in the specified {@code style} of this {@code TimeZone}
      * suitable for presentation to the user in the specified {@code
-     * locale}. If the specified {@code daylight} is {@code true}, a daylight
-     * saving time name is returned. Otherwise, a standard time name is
+     * locale}. If the specified {@code daylight} is {@code true}, a Daylight
+     * Saving Time name is returned (even if this {@code TimeZone} doesn't
+     * observe Daylight Saving Time). Otherwise, a Standard Time name is
      * returned.
      *
      * <p>When looking up a time zone name, the {@linkplain
@@ -379,13 +383,15 @@
      * found, the name is returned. Otherwise, a string in the
      * <a href="#NormalizedCustomID">normalized custom ID format</a> is returned.
      *
-     * @param daylight if {@code true}, return the daylight saving time name.
+     * @param daylight {@code true} specifying a Daylight Saving Time name, or
+     *                 {@code false} specifying a Standard Time name
      * @param style either {@link #LONG} or {@link #SHORT}
-     * @param locale the locale in which to supply the display name.
+     * @param locale   the locale in which to supply the display name.
      * @return the human-readable name of this time zone in the given locale.
      * @exception IllegalArgumentException if {@code style} is invalid.
      * @exception NullPointerException if {@code locale} is {@code null}.
      * @since 1.2
+     * @see java.text.DateFormatSymbols#getZoneStrings()
      */
     public String getDisplayName(boolean daylight, int style, Locale locale) {
         if (style != SHORT && style != LONG) {
@@ -526,10 +532,10 @@
 
     /**
      * Queries if the given {@code date} is in Daylight Saving Time in
-     * this {@code TimeZone}.
+     * this time zone.
      *
-     * @param date the given {@code Date}.
-     * @return {@code true} if the given {@code date} is in Daylight Saving Time,
+     * @param date the given Date.
+     * @return {@code true} if the given date is in Daylight Saving Time,
      *         {@code false}, otherwise.
      */
     abstract public boolean inDaylightTime(Date date);
@@ -566,7 +572,7 @@
      * @param rawOffset the given time zone GMT offset in milliseconds.
      * @return an array of IDs, where the time zone for that ID has
      * the specified GMT offset. For example, "America/Phoenix" and "America/Denver"
-     * both have GMT-07:00, but differ in daylight savings behavior.
+     * both have GMT-07:00, but differ in daylight saving behavior.
      * @see #getRawOffset()
      */
     public static synchronized String[] getAvailableIDs(int rawOffset) {
--- a/jdk/src/share/classes/javax/sound/midi/MidiSystem.java	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/src/share/classes/javax/sound/midi/MidiSystem.java	Tue Mar 15 20:00:45 2011 -0400
@@ -441,13 +441,6 @@
                 Synthesizer synth = getSynthesizer();
                 if (synth instanceof ReferenceCountingDevice) {
                     rec = ((ReferenceCountingDevice) synth).getReceiverReferenceCounting();
-                    // only use MixerSynth if it could successfully load a soundbank
-                    if (synth.getClass().toString().contains("com.sun.media.sound.MixerSynth")
-                        && (synth.getDefaultSoundbank() == null)) {
-                        // don't use this receiver if no soundbank available
-                        rec = null;
-                        synth.close();
-                    }
                 } else {
                     synth.open();
                     try {
--- a/jdk/src/share/classes/javax/swing/DefaultDesktopManager.java	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/src/share/classes/javax/swing/DefaultDesktopManager.java	Tue Mar 15 20:00:45 2011 -0400
@@ -174,6 +174,8 @@
         if(!wasIcon(f)) {
             Rectangle r = getBoundsForIconOf(f);
             desktopIcon.setBounds(r.x, r.y, r.width, r.height);
+            // we must validate the hierarchy to not break the hw/lw mixing
+            desktopIcon.revalidate();
             setWasIcon(f, Boolean.TRUE);
         }
 
@@ -453,11 +455,9 @@
 
     /** This moves the <code>JComponent</code> and repaints the damaged areas. */
     public void setBoundsForFrame(JComponent f, int newX, int newY, int newWidth, int newHeight) {
-        boolean didResize = (f.getWidth() != newWidth || f.getHeight() != newHeight);
         f.setBounds(newX, newY, newWidth, newHeight);
-        if(didResize) {
-            f.validate();
-        }
+        // we must validate the hierarchy to not break the hw/lw mixing
+        f.revalidate();
     }
 
     /** Convenience method to remove the desktopIcon of <b>f</b> is necessary. */
--- a/jdk/src/share/classes/javax/swing/JComponent.java	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/src/share/classes/javax/swing/JComponent.java	Tue Mar 15 20:00:45 2011 -0400
@@ -5158,31 +5158,30 @@
                 }
             }
         }
-
         try {
-            g = safelyGetGraphics(paintingComponent, c);
-            try {
-                if (hasBuffer) {
-                    RepaintManager rm = RepaintManager.currentManager(
-                                               bufferedComponent);
-                    rm.beginPaint();
-                    try {
-                        rm.paint(paintingComponent, bufferedComponent, g,
-                                 paintImmediatelyClip.x,
-                                 paintImmediatelyClip.y,
-                                 paintImmediatelyClip.width,
-                                 paintImmediatelyClip.height);
-                    } finally {
-                        rm.endPaint();
+            if ((g = safelyGetGraphics(paintingComponent, c)) != null) {
+                try {
+                    if (hasBuffer) {
+                        RepaintManager rm = RepaintManager.currentManager(
+                                bufferedComponent);
+                        rm.beginPaint();
+                        try {
+                            rm.paint(paintingComponent, bufferedComponent, g,
+                                    paintImmediatelyClip.x,
+                                    paintImmediatelyClip.y,
+                                    paintImmediatelyClip.width,
+                                    paintImmediatelyClip.height);
+                        } finally {
+                            rm.endPaint();
+                        }
+                    } else {
+                        g.setClip(paintImmediatelyClip.x, paintImmediatelyClip.y,
+                                paintImmediatelyClip.width, paintImmediatelyClip.height);
+                        paintingComponent.paint(g);
                     }
+                } finally {
+                    g.dispose();
                 }
-                else {
-                    g.setClip(paintImmediatelyClip.x,paintImmediatelyClip.y,
-                       paintImmediatelyClip.width,paintImmediatelyClip.height);
-                    paintingComponent.paint(g);
-                }
-            } finally {
-                g.dispose();
             }
         }
         finally {
--- a/jdk/src/share/classes/javax/swing/JViewport.java	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/src/share/classes/javax/swing/JViewport.java	Tue Mar 15 20:00:45 2011 -0400
@@ -1111,6 +1111,8 @@
                 view.setLocation(newX, newY);
                 repaintAll = false;
             }
+            // we must validate the hierarchy to not break the hw/lw mixing
+            revalidate();
             fireStateChanged();
         }
     }
--- a/jdk/src/share/classes/javax/swing/text/Utilities.java	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/src/share/classes/javax/swing/text/Utilities.java	Tue Mar 15 20:00:45 2011 -0400
@@ -390,11 +390,15 @@
             }
             if ((x >= currX) && (x < nextX)) {
                 // found the hit position... return the appropriate side
-                if ((round == false) || ((x - currX) < (nextX - x))) {
-                    return i - txtOffset;
-                } else {
-                    return i + 1 - txtOffset;
+                int offset = ((round == false) || ((x - currX) < (nextX - x))) ?
+                        (i - txtOffset) : (i + 1 - txtOffset);
+                // the length of the string measured as a whole may differ from
+                // the sum of individual character lengths, for example if
+                // fractional metrics are enabled; and we must guard from this.
+                while (metrics.charsWidth(txt, txtOffset, offset + 1) > (x - x0)) {
+                    offset--;
                 }
+                return (offset < 0 ? 0 : offset);
             }
             currX = nextX;
         }
@@ -404,24 +408,6 @@
     }
 
     /**
-     * Adjust text offset so that the length of a resulting string as a whole
-     * fits into the specified width.
-     */
-    static int adjustOffsetForFractionalMetrics(
-            Segment s, FontMetrics fm, int offset, int width) {
-        // Sometimes the offset returned by getTabbedTextOffset is beyond the
-        // available area, when fractional metrics are enabled. We should
-        // guard against this.
-        if (offset < s.count) {
-            while (offset > 0 &&
-                    fm.charsWidth(s.array, s.offset, offset + 1) > width) {
-                offset--;
-            }
-        }
-        return offset;
-    }
-
-    /**
      * Determine where to break the given text to fit
      * within the given span. This tries to find a word boundary.
      * @param s  the source of the text
@@ -443,7 +429,6 @@
         int txtCount = s.count;
         int index = Utilities.getTabbedTextOffset(s, metrics, x0, x,
                                                   e, startOffset, false);
-        index = adjustOffsetForFractionalMetrics(s, metrics, index, x - x0);
 
         if (index >= txtCount - 1) {
             return txtCount;
--- a/jdk/src/share/classes/javax/swing/text/WrappedPlainView.java	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/src/share/classes/javax/swing/text/WrappedPlainView.java	Tue Mar 15 20:00:45 2011 -0400
@@ -239,11 +239,9 @@
                                                 tabBase, tabBase + currentWidth,
                                                 this, p0);
         } else {
-            int offset = Utilities.getTabbedTextOffset(segment, metrics,
-                    tabBase, tabBase + currentWidth, this, p0, false);
-            offset = Utilities.adjustOffsetForFractionalMetrics(
-                    segment, metrics, offset, currentWidth);
-            p = p0 + offset;
+            p = p0 + Utilities.getTabbedTextOffset(segment, metrics,
+                                                   tabBase, tabBase + currentWidth,
+                                                   this, p0, false);
         }
         SegmentCache.releaseSharedSegment(segment);
         return p;
--- a/jdk/src/share/classes/javax/swing/text/html/CSSBorder.java	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/src/share/classes/javax/swing/text/html/CSSBorder.java	Tue Mar 15 20:00:45 2011 -0400
@@ -203,10 +203,11 @@
 
     public void paintBorder(Component c, Graphics g,
                                         int x, int y, int width, int height) {
-        assert (g instanceof Graphics2D) : "need Graphics2D instanse";
-        Graphics2D g2 = (Graphics2D) g;
-        Color savedColor = g2.getColor();
-        Shape savedClip = g2.getClip();
+        if (!(g instanceof Graphics2D)) {
+            return;
+        }
+
+        Graphics2D g2 = (Graphics2D) g.create();
 
         int[] widths = getWidths();
 
@@ -238,16 +239,16 @@
                 BorderPainter painter = getBorderPainter(i);
 
                 double angle = i * Math.PI / 2;
+                g2.setClip(g.getClip()); // Restore initial clip
                 g2.translate(intCorners[i][0], intCorners[i][1]);
                 g2.rotate(angle);
-                g2.setClip(shape);
-                painter.paint(shape, g, color, i);
+                g2.clip(shape);
+                painter.paint(shape, g2, color, i);
                 g2.rotate(-angle);
                 g2.translate(-intCorners[i][0], -intCorners[i][1]);
             }
         }
-        g2.setColor(savedColor);
-        g2.setClip(savedClip);
+        g2.dispose();
     }
 
 
--- a/jdk/src/share/classes/sun/font/StrikeCache.java	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/src/share/classes/sun/font/StrikeCache.java	Tue Mar 15 20:00:45 2011 -0400
@@ -319,8 +319,7 @@
                 ArrayList<Long> gids = null;
 
                 for (int i = 0; i < glyphPtrs.length; i++) {
-                    if (glyphPtrs[i] != 0 && unsafe.getByte(glyphPtrs[i] + managedOffset) == 0
-                            && unsafe.getInt(glyphPtrs[i] + cacheCellOffset) != 0) {
+                    if (glyphPtrs[i] != 0 && unsafe.getByte(glyphPtrs[i] + managedOffset) == 0) {
 
                         if (gids == null) {
                             gids = new ArrayList<Long>();
@@ -330,6 +329,8 @@
                 }
 
                 if (gids != null) {
+                    // Any reference by the disposers to the native glyph ptrs
+                    // must be done before this returns.
                     notifyDisposeListeners(gids);
                 }
             }
@@ -345,8 +346,7 @@
 
                 for (int i=0; i < glyphPtrs.length; i++) {
                     if (glyphPtrs[i] != 0
-                            && unsafe.getByte(glyphPtrs[i] + managedOffset) == 0
-                            && unsafe.getInt(glyphPtrs[i] + cacheCellOffset) != 0) {
+                            && unsafe.getByte(glyphPtrs[i] + managedOffset) == 0) {
 
                         if (gids == null) {
                             gids = new ArrayList<Long>();
@@ -356,6 +356,8 @@
                 }
 
                 if (gids != null) {
+                    // Any reference by the disposers to the native glyph ptrs
+                    // must be done before this returns.
                     notifyDisposeListeners(gids);
                 }
         }
--- a/jdk/src/share/classes/sun/java2d/pipe/AAShapePipe.java	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/src/share/classes/sun/java2d/pipe/AAShapePipe.java	Tue Mar 15 20:00:45 2011 -0400
@@ -109,7 +109,7 @@
         Region clip = sg.getCompClip();
         int abox[] = new int[4];
         AATileGenerator aatg =
-            renderengine.getAATileGenerator(x, y, dx1, dy1, dx2, dy2, 0, 0,
+            renderengine.getAATileGenerator(x, y, dx1, dy1, dx2, dy2, lw1, lw2,
                                             clip, abox);
         if (aatg == null) {
             // Nothing to render
--- a/jdk/src/share/classes/sun/util/calendar/ZoneInfo.java	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/src/share/classes/sun/util/calendar/ZoneInfo.java	Tue Mar 15 20:00:45 2011 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -266,7 +266,7 @@
         int index = getTransitionIndex(date, type);
 
         // prior to the transition table, returns the raw offset.
-        // should support LMT.
+        // FIXME: should support LMT.
         if (index < 0) {
             int offset = getLastRawOffset();
             if (offsets != null) {
@@ -297,7 +297,13 @@
             if (type != UTC_TIME) {
                 msec -= rawOffset;
             }
-            int dstoffset = tz.inDaylightTime(new Date(msec)) ? tz.getDSTSavings() : 0;
+            int dstoffset = tz.getOffset(msec) - rawOffset;
+
+            // Check if it's in a standard-to-daylight transition.
+            if (dstoffset > 0 && tz.getOffset(msec - dstoffset) == rawoffset) {
+                dstoffset = 0;
+            }
+
             if (offsets != null) {
                 offsets[0] = rawoffset;
                 offsets[1] = dstoffset;
@@ -452,6 +458,36 @@
         return (simpleTimeZoneParams != null);
     }
 
+    @Override
+    public boolean observesDaylightTime() {
+        if (simpleTimeZoneParams != null) {
+            return true;
+        }
+        if (transitions == null) {
+            return false;
+        }
+
+        // Look up the transition table to see if it's in DST right
+        // now or if there's any standard-to-daylight transition at
+        // any future.
+        long utc = System.currentTimeMillis() - rawOffsetDiff;
+        int index = getTransitionIndex(utc, UTC_TIME);
+
+        // before transitions in the transition table
+        if (index < 0) {
+            return false;
+        }
+
+        // the time is in the table range.
+        for (int i = index; i < transitions.length; i++) {
+            if ((transitions[i] & DST_MASK) != 0) {
+                return true;
+            }
+        }
+        // No further DST is observed.
+        return false;
+    }
+
     /**
      * Queries if the specified date is in Daylight Saving Time.
      */
--- a/jdk/src/share/classes/sun/util/logging/PlatformLogger.java	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/src/share/classes/sun/util/logging/PlatformLogger.java	Tue Mar 15 20:00:45 2011 -0400
@@ -535,7 +535,14 @@
         }
 
         void doLog(int level, String msg, Object... params) {
-            LoggingSupport.log(javaLogger, levelObjects.get(level), msg, params);
+            // only pass String objects to the j.u.l.Logger which may
+            // be created by untrusted code
+            int len = (params != null) ? params.length : 0;
+            Object[] sparams = new String[len];
+            for (int i = 0; i < len; i++) {
+                sparams [i] = String.valueOf(params[i]);
+            }
+            LoggingSupport.log(javaLogger, levelObjects.get(level), msg, sparams);
         }
 
         boolean isEnabled() {
--- a/jdk/src/solaris/classes/sun/awt/X11/GtkFileDialogPeer.java	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/src/solaris/classes/sun/awt/X11/GtkFileDialogPeer.java	Tue Mar 15 20:00:45 2011 -0400
@@ -56,12 +56,14 @@
     }
 
     private native void run(String title, int mode, String dir, String file,
-            FilenameFilter filter, boolean isMultipleMode);
+                            FilenameFilter filter, boolean isMultipleMode, int x, int y);
     private native void quit();
 
     @Override
     public native void toFront();
 
+    @Override
+    public native void setBounds(int x, int y, int width, int height, int op);
 
     /**
      * Called exclusively by the native C code.
@@ -106,9 +108,8 @@
                 Thread t = new Thread() {
                     public void run() {
                         GtkFileDialogPeer.this.run(fd.getTitle(), fd.getMode(),
-                                fd.getDirectory(), fd.getFile(), fd
-                                        .getFilenameFilter(), fd
-                                        .isMultipleMode());
+                                   fd.getDirectory(), fd.getFile(), fd.getFilenameFilter(), fd.isMultipleMode(),
+                                   fd.getX(), fd.getY());
                         fd.setVisible(false);
                     }
                 };
--- a/jdk/src/solaris/classes/sun/font/XRGlyphCache.java	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/src/solaris/classes/sun/font/XRGlyphCache.java	Tue Mar 15 20:00:45 2011 -0400
@@ -70,9 +70,14 @@
         try {
             SunToolkit.awtLock();
 
-            ArrayList<Integer> glyphIDList = new ArrayList<Integer>(glyphPtrList.size());
+            GrowableIntArray glyphIDList = new GrowableIntArray(1, glyphPtrList.size());
             for (long glyphPtr : glyphPtrList) {
-                glyphIDList.add(XRGlyphCacheEntry.getGlyphID(glyphPtr));
+                int glyphID = XRGlyphCacheEntry.getGlyphID(glyphPtr);
+
+                //Check if glyph hasn't been freed already
+                if (glyphID != 0) {
+                   glyphIDList.addInt(glyphID);
+                }
             }
             freeGlyphs(glyphIDList);
         } finally {
@@ -83,7 +88,6 @@
     protected int getFreeGlyphID() {
         if (freeGlyphIDs.size() > 0) {
             int newID = freeGlyphIDs.remove(freeGlyphIDs.size() - 1);
-            ;
             return newID;
         }
         return nextID++;
@@ -246,7 +250,7 @@
             glyph.setPinned();
         }
 
-        ArrayList<Integer> deleteGlyphList = new ArrayList<Integer>();
+        GrowableIntArray deleteGlyphList = new GrowableIntArray(1, 10);
         int pixelsToRelease = cachedPixels - MAX_CACHED_PIXELS;
 
         for (int i = cacheList.size() - 1; i >= 0 && pixelsToRelease > 0; i--) {
@@ -254,7 +258,7 @@
 
             if (!entry.isPinned()) {
                 pixelsToRelease -= entry.getPixelCnt();
-                deleteGlyphList.add(new Integer(entry.getGlyphID()));
+                deleteGlyphList.addInt(entry.getGlyphID());
             }
         }
 
@@ -265,26 +269,23 @@
         freeGlyphs(deleteGlyphList);
     }
 
-    private void freeGlyphs(List<Integer> glyphIdList) {
-
-        freeGlyphIDs.addAll(glyphIdList);
+    private void freeGlyphs(GrowableIntArray glyphIdList) {
+        GrowableIntArray removedLCDGlyphs = new GrowableIntArray(1, 10);
+        GrowableIntArray removedGrayscaleGlyphs = new GrowableIntArray(1, 10);
 
-        GrowableIntArray removedLCDGlyphs = new GrowableIntArray(1, 1);
-        GrowableIntArray removedGrayscaleGlyphs = new GrowableIntArray(1, 1);
+        for (int i=0; i < glyphIdList.getSize(); i++) {
+            int glyphId = glyphIdList.getInt(i);
+            freeGlyphIDs.add(glyphId);
 
-        for (Integer glyphId : glyphIdList) {
-            tmp.setValue(glyphId.intValue());
+            tmp.setValue(glyphId);
             XRGlyphCacheEntry entry = cacheMap.get(tmp);
             cachedPixels -= entry.getPixelCnt();
-
-            int removedGlyphID = entry.getGlyphID();
-            tmp.setValue(removedGlyphID);
             cacheMap.remove(tmp);
 
             if (entry.getGlyphSet() == grayGlyphSet) {
-                removedGrayscaleGlyphs.addInt(removedGlyphID);
+                removedGrayscaleGlyphs.addInt(glyphId);
             } else {
-                removedLCDGlyphs.addInt(removedGlyphID);
+                removedLCDGlyphs.addInt(glyphId);
             }
 
             entry.setGlyphID(0);
--- a/jdk/src/solaris/classes/sun/java2d/xr/XRSurfaceData.java	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/src/solaris/classes/sun/java2d/xr/XRSurfaceData.java	Tue Mar 15 20:00:45 2011 -0400
@@ -55,6 +55,8 @@
 
     native void initXRPicture(long xsdo, int pictForm);
 
+    native void freeXSDOPicture(long xsdo);
+
     public static final String DESC_BYTE_A8_X11 = "Byte A8 Pixmap";
     public static final String DESC_INT_RGB_X11 = "Integer RGB Pixmap";
     public static final String DESC_INT_ARGB_X11 = "Integer ARGB-Pre Pixmap";
@@ -531,6 +533,17 @@
         public Object getDestination() {
             return peer.getTarget();
         }
+
+       public void invalidate() {
+           try {
+               SunToolkit.awtLock();
+               freeXSDOPicture(getNativeOps());
+           }finally {
+               SunToolkit.awtUnlock();
+           }
+
+           super.invalidate();
+       }
     }
 
     public static class XRInternalSurfaceData extends XRSurfaceData {
--- a/jdk/src/solaris/native/sun/awt/gtk2_interface.c	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/src/solaris/native/sun/awt/gtk2_interface.c	Tue Mar 15 20:00:45 2011 -0400
@@ -608,7 +608,10 @@
         fp_gtk_viewport_new = dl_symbol("gtk_viewport_new");
         fp_gtk_window_new = dl_symbol("gtk_window_new");
         fp_gtk_window_present = dl_symbol("gtk_window_present");
-        fp_gtk_dialog_new = dl_symbol("gtk_dialog_new");
+        fp_gtk_window_move = dl_symbol("gtk_window_move");
+        fp_gtk_window_resize = dl_symbol("gtk_window_resize");
+
+          fp_gtk_dialog_new = dl_symbol("gtk_dialog_new");
         fp_gtk_frame_new = dl_symbol("gtk_frame_new");
 
         fp_gtk_adjustment_new = dl_symbol("gtk_adjustment_new");
--- a/jdk/src/solaris/native/sun/awt/gtk2_interface.h	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/src/solaris/native/sun/awt/gtk2_interface.h	Tue Mar 15 20:00:45 2011 -0400
@@ -750,7 +750,8 @@
 GdkPixbuf *(*fp_gdk_pixbuf_new_from_file)(const char *filename, GError **error);
 void (*fp_gtk_widget_destroy)(GtkWidget *widget);
 void (*fp_gtk_window_present)(GtkWindow *window);
-
+void (*fp_gtk_window_move)(GtkWindow *window, gint x, gint y);
+void (*fp_gtk_window_resize)(GtkWindow *window, gint width, gint height);
 
 /**
  * Function Pointers for GtkFileChooser
--- a/jdk/src/solaris/native/sun/awt/sun_awt_X11_GtkFileDialogPeer.c	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/src/solaris/native/sun/awt/sun_awt_X11_GtkFileDialogPeer.c	Tue Mar 15 20:00:45 2011 -0400
@@ -102,6 +102,33 @@
     fp_gdk_threads_leave();
 }
 
+/*
+ * Class:     sun_awt_X11_GtkFileDialogPeer
+ * Method:    setBounds
+ * Signature: (IIIII)V
+ */
+JNIEXPORT void JNICALL Java_sun_awt_X11_GtkFileDialogPeer_setBounds
+(JNIEnv * env, jobject jpeer, jint x, jint y, jint width, jint height, jint op)
+{
+    GtkWindow* dialog;
+
+    fp_gdk_threads_enter();
+
+    dialog = (GtkWindow*)jlong_to_ptr(
+        (*env)->GetLongField(env, jpeer, widgetFieldID));
+
+    if (dialog != NULL) {
+        if (x >= 0 && y >= 0) {
+            fp_gtk_window_move(dialog, (gint)x, (gint)y);
+        }
+        if (width > 0 && height > 0) {
+            fp_gtk_window_resize(dialog, (gint)width, (gint)height);
+        }
+    }
+
+    fp_gdk_threads_leave();
+}
+
 /**
  * Convert a GSList to an array of filenames (without the parent folder)
  */
@@ -175,12 +202,12 @@
 /*
  * Class:     sun_awt_X11_GtkFileDialogPeer
  * Method:    run
- * Signature: (Ljava/lang/String;ILjava/lang/String;Ljava/lang/String;Ljava/io/FilenameFilter;Z;)V
+ * Signature: (Ljava/lang/String;ILjava/lang/String;Ljava/lang/String;Ljava/io/FilenameFilter;ZII)V
  */
 JNIEXPORT void JNICALL
 Java_sun_awt_X11_GtkFileDialogPeer_run(JNIEnv * env, jobject jpeer,
         jstring jtitle, jint mode, jstring jdir, jstring jfile,
-        jobject jfilter, jboolean multiple)
+        jobject jfilter, jboolean multiple, int x, int y)
 {
     GtkWidget *dialog = NULL;
     GtkFileFilter *filter;
@@ -244,6 +271,14 @@
                 dialog), TRUE);
     }
 
+    /* Set the initial location */
+    if (x >= 0 && y >= 0) {
+        fp_gtk_window_move((GtkWindow*)dialog, (gint)x, (gint)y);
+
+        // NOTE: it doesn't set the initial size for the file chooser
+        // as it seems like the file chooser overrides the size internally
+    }
+
     fp_g_signal_connect(G_OBJECT(dialog), "response", G_CALLBACK(
             handle_response), jpeer);
 
--- a/jdk/src/solaris/native/sun/awt/sun_awt_X11_GtkFileDialogPeer.h	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/src/solaris/native/sun/awt/sun_awt_X11_GtkFileDialogPeer.h	Tue Mar 15 20:00:45 2011 -0400
@@ -20,10 +20,10 @@
 /*
  * Class:     sun_awt_X11_GtkFileDialogPeer
  * Method:    run
- * Signature: (Ljava/lang/String;ILjava/lang/String;Ljava/lang/String;Ljava/io/FilenameFilter;Z;)V
+ * Signature: (Ljava/lang/String;ILjava/lang/String;Ljava/lang/String;Ljava/io/FilenameFilter;ZII)V
  */
 JNIEXPORT void JNICALL Java_sun_awt_X11_GtkFileDialogPeer_run
-(JNIEnv *, jobject, jstring, jint, jstring, jstring, jobject, jboolean);
+(JNIEnv *, jobject, jstring, jint, jstring, jstring, jobject, jboolean, jint, jint);
 
 /*
  * Class:     sun_awt_X11_GtkFileDialogPeer
@@ -41,6 +41,14 @@
 JNIEXPORT void JNICALL Java_sun_awt_X11_GtkFileDialogPeer_toFront
 (JNIEnv *, jobject);
 
+/*
+ * Class:     sun_awt_X11_GtkFileDialogPeer
+ * Method:    setBounds
+ * Signature: (IIIII)V
+ */
+JNIEXPORT void JNICALL Java_sun_awt_X11_GtkFileDialogPeer_setBounds
+(JNIEnv * env, jobject jpeer, jint x, jint y, jint width, jint height, jint op);
+
 #ifdef __cplusplus
 }
 #endif
--- a/jdk/src/solaris/native/sun/java2d/x11/X11SurfaceData.c	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/src/solaris/native/sun/java2d/x11/X11SurfaceData.c	Tue Mar 15 20:00:45 2011 -0400
@@ -375,6 +375,12 @@
     AWT_LOCK();
 
     xsdo->invalid = JNI_TRUE;
+
+    if (xsdo->xrPic != None) {
+        XRenderFreePicture(awt_display, xsdo->xrPic);
+        xsdo->xrPic = None;
+     }
+
     if (xsdo->isPixmap == JNI_TRUE && xsdo->drawable != 0) {
 #ifdef MITSHM
         if (xsdo->shmPMData.shmSegInfo != NULL) {
--- a/jdk/src/solaris/native/sun/java2d/x11/XRBackendNative.c	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/src/solaris/native/sun/java2d/x11/XRBackendNative.c	Tue Mar 15 20:00:45 2011 -0400
@@ -304,23 +304,27 @@
     color.blue = blue;
 
     if (rectCnt <= 256) {
-      xRects = &sRects[0];
+        xRects = &sRects[0];
     } else {
-      xRects = (XRectangle *) malloc(sizeof(XRectangle) * rectCnt);
-      if (xRects == NULL) {
-        return;
-      }
+        xRects = (XRectangle *) malloc(sizeof(XRectangle) * rectCnt);
+        if (xRects == NULL) {
+            return;
+        }
     }
 
-    if ((rects = (jint *) (*env)->GetPrimitiveArrayCritical(env, rectArray, NULL)) == NULL) {
-      return;
+    if ((rects = (jint *)
+         (*env)->GetPrimitiveArrayCritical(env, rectArray, NULL)) == NULL) {
+        if (xRects != &sRects[0]) {
+            free(xRects);
+        }
+        return;
     }
 
     for (i=0; i < rectCnt; i++) {
-      xRects[i].x = rects[i*4 + 0];
-      xRects[i].y = rects[i*4 + 1];
-      xRects[i].width = rects[i*4 + 2];
-      xRects[i].height = rects[i*4 + 3];
+        xRects[i].x = rects[i*4 + 0];
+        xRects[i].y = rects[i*4 + 1];
+        xRects[i].width = rects[i*4 + 2];
+        xRects[i].height = rects[i*4 + 3];
     }
 
     XRenderFillRectangles(awt_display, op,
@@ -328,7 +332,7 @@
 
     (*env)->ReleasePrimitiveArrayCritical(env, rectArray, rects, JNI_ABORT);
     if (xRects != &sRects[0]) {
-      free(xRects);
+        free(xRects);
     }
 }
 
@@ -610,17 +614,30 @@
     Glyph *gid = (Glyph *) malloc(sizeof(Glyph) * glyphCnt);
 
     if (xginfo == NULL || gid == NULL) {
-      return;
+        if (xginfo != NULL) {
+            free(xginfo);
+        }
+        if (gid != NULL) {
+            free(gid);
+        }
+        return;
     }
 
-    if ((glyphInfoPtrs = (jlong *) (*env)->GetPrimitiveArrayCritical(env, glyphInfoPtrsArray, NULL)) == NULL) {
+    if ((glyphInfoPtrs = (jlong *)(*env)->
+        GetPrimitiveArrayCritical(env, glyphInfoPtrsArray, NULL)) == NULL)
+    {
+        free(xginfo);
+        free(gid);
         return;
     }
 
     if ((pixelData = (unsigned char *)
-        (*env)->GetPrimitiveArrayCritical(env, pixelDataArray, NULL)) == NULL) {
+        (*env)->GetPrimitiveArrayCritical(env, pixelDataArray, NULL)) == NULL)
+    {
         (*env)->ReleasePrimitiveArrayCritical(env,
-                                  glyphInfoPtrsArray, glyphInfoPtrs, JNI_ABORT);
+                                glyphInfoPtrsArray, glyphInfoPtrs, JNI_ABORT);
+        free(xginfo);
+        free(gid);
         return;
     }
 
@@ -637,7 +654,7 @@
     }
 
     XRenderAddGlyphs(awt_display, glyphSet, &gid[0], &xginfo[0], glyphCnt,
-                     pixelData, pixelDataLength);
+                     (const char*)pixelData, pixelDataLength);
 
     (*env)->ReleasePrimitiveArrayCritical(env, glyphInfoPtrsArray, glyphInfoPtrs, JNI_ABORT);
     (*env)->ReleasePrimitiveArrayCritical(env, pixelDataArray, pixelData, JNI_ABORT);
@@ -684,22 +701,44 @@
       xelts = &selts[0];
     }else {
       xelts = (XGlyphElt32 *) malloc(sizeof(XGlyphElt32) * eltCnt);
+      if (xelts == NULL) {
+          return;
+      }
     }
 
     if (glyphCnt <= 256) {
       xids = &sids[0];
-    }else {
+    } else {
       xids = (Glyph *) malloc(sizeof(Glyph) * glyphCnt);
+      if (xids == NULL) {
+          if (xelts != &selts[0]) {
+            free(xelts);
+          }
+          return;
+      }
     }
 
-    if ((ids = (jint *) (*env)->GetPrimitiveArrayCritical(env, glyphIDArray, NULL)) == NULL) {
-      return;
+    if ((ids = (jint *)
+         (*env)->GetPrimitiveArrayCritical(env, glyphIDArray, NULL)) == NULL) {
+        if (xelts != &selts[0]) {
+            free(xelts);
+        }
+        if (xids != &sids[0]) {
+            free(xids);
+        }
+        return;
     }
     if ((elts = (jint *)
           (*env)->GetPrimitiveArrayCritical(env, eltArray, NULL)) == NULL) {
         (*env)->ReleasePrimitiveArrayCritical(env,
                                               glyphIDArray, ids, JNI_ABORT);
-      return;
+        if (xelts != &selts[0]) {
+            free(xelts);
+        }
+        if (xids != &sids[0]) {
+            free(xids);
+        }
+        return;
     }
 
     for (i=0; i < glyphCnt; i++) {
@@ -724,11 +763,11 @@
     (*env)->ReleasePrimitiveArrayCritical(env, eltArray, elts, JNI_ABORT);
 
     if (xelts != &selts[0]) {
-      free(xelts);
+        free(xelts);
     }
 
     if (xids != &sids[0]) {
-      free(xids);
+        free(xids);
     }
 }
 
@@ -762,8 +801,12 @@
       }
     }
 
-    if ((rects = (jint *) (*env)->GetPrimitiveArrayCritical(env, rectArray, NULL)) == NULL) {
-      return;
+    if ((rects = (jint*)
+         (*env)->GetPrimitiveArrayCritical(env, rectArray, NULL)) == NULL) {
+        if (xRects != &sRects[0]) {
+            free(xRects);
+        }
+        return;
     }
 
     for (i=0; i < rectCnt; i++) {
--- a/jdk/src/solaris/native/sun/java2d/x11/XRSurfaceData.c	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/src/solaris/native/sun/java2d/x11/XRSurfaceData.c	Tue Mar 15 20:00:45 2011 -0400
@@ -114,3 +114,26 @@
     XShared_initSurface(env, xsdo, depth, width, height, drawable);
 #endif /* !HEADLESS */
 }
+
+
+
+JNIEXPORT void JNICALL
+Java_sun_java2d_xr_XRSurfaceData_freeXSDOPicture(JNIEnv *env, jobject xsd,
+                                                  jlong pXSData)
+{
+#ifndef HEADLESS
+    X11SDOps *xsdo;
+
+    J2dTraceLn(J2D_TRACE_INFO, "in XRSurfaceData_freeXSDOPicture");
+
+    xsdo = X11SurfaceData_GetOps(env, xsd);
+    if (xsdo == NULL) {
+        return;
+    }
+
+    if(xsdo->xrPic != None) {
+       XRenderFreePicture(awt_display, xsdo->xrPic);
+       xsdo->xrPic = None;
+    }
+#endif /* !HEADLESS */
+}
--- a/jdk/src/windows/native/sun/windows/awt_Frame.cpp	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/src/windows/native/sun/windows/awt_Frame.cpp	Tue Mar 15 20:00:45 2011 -0400
@@ -109,7 +109,6 @@
     m_isMenuDropped = FALSE;
     m_isInputMethodWindow = FALSE;
     m_isUndecorated = FALSE;
-    m_proxyFocusOwner = NULL;
     m_lastProxiedFocusOwner = NULL;
     m_actualFocusedWindow = NULL;
     m_iconic = FALSE;
@@ -127,7 +126,6 @@
 
 void AwtFrame::Dispose()
 {
-    DestroyProxyFocusOwner();
     AwtWindow::Dispose();
 }
 
@@ -308,22 +306,9 @@
     return frame;
 }
 
-LRESULT CALLBACK AwtFrame::ProxyWindowProc(HWND hwnd, UINT message,
-                                           WPARAM wParam, LPARAM lParam)
+LRESULT AwtFrame::ProxyWindowProc(UINT message, WPARAM wParam, LPARAM lParam, MsgRouting &mr)
 {
-    TRY;
-
-    DASSERT(::IsWindow(hwnd));
-
-    AwtFrame *parent = (AwtFrame *)
-        AwtComponent::GetComponentImpl(::GetParent(hwnd));
-
-    if (!parent || parent->GetProxyFocusOwner() != hwnd ||
-        message == AwtComponent::WmAwtIsComponent ||
-        message == WM_GETOBJECT)
-    {
-        return ComCtl32Util::GetInstance().DefWindowProc(NULL, hwnd, message, wParam, lParam);
-    }
+    LRESULT retValue = 0L;
 
     AwtComponent *focusOwner = NULL;
     // IME and input language related messages need to be sent to a window
@@ -346,19 +331,23 @@
         // TODO: when a Choice's list is dropped down and we're scrolling in
         // the list WM_MOUSEWHEEL messages come to the poxy, not to the list. Why?
         case WM_MOUSEWHEEL:
-            focusOwner = AwtComponent::GetComponent(parent->GetLastProxiedFocusOwner());
-            if  (focusOwner != NULL) {
-                return focusOwner->WindowProc(message, wParam, lParam);
+            focusOwner = AwtComponent::GetComponent(GetLastProxiedFocusOwner());
+            if  (focusOwner != NULL &&
+                 focusOwner != this) // avoid recursive calls
+            {
+                 retValue = focusOwner->WindowProc(message, wParam, lParam);
+                 mr = mrConsume;
             }
             break;
         case WM_SETFOCUS:
-            if (!sm_suppressFocusAndActivation && parent->IsEmbeddedFrame()) {
-                parent->AwtSetActiveWindow();
+            if (!sm_suppressFocusAndActivation && IsEmbeddedFrame()) {
+                AwtSetActiveWindow();
             }
-            return 0;
+            mr = mrConsume;
+            break;
         case WM_KILLFOCUS:
-            if (!sm_suppressFocusAndActivation && parent->IsEmbeddedFrame()) {
-                AwtWindow::SynthesizeWmActivate(FALSE, parent->GetHWnd(), NULL);
+            if (!sm_suppressFocusAndActivation && IsEmbeddedFrame()) {
+                AwtWindow::SynthesizeWmActivate(FALSE, GetHWnd(), NULL);
 
             } else if (sm_restoreFocusAndActivation) {
                 if (AwtComponent::GetFocusedWindow() != NULL) {
@@ -369,64 +358,28 @@
                     }
                 }
             }
-            return 0;
+            mr = mrConsume;
+            break;
         case 0x0127: // WM_CHANGEUISTATE
         case 0x0128: // WM_UPDATEUISTATE
-            return 0;
+            mr = mrConsume;
+            break;
     }
-    return parent->WindowProc(message, wParam, lParam);
-
-    CATCH_BAD_ALLOC_RET(0);
-}
 
-void AwtFrame::CreateProxyFocusOwner()
-{
-    if (AwtToolkit::IsMainThread()) {
-        AwtFrame::_CreateProxyFocusOwner((void *)this);
-    } else {
-        AwtToolkit::GetInstance().InvokeFunction(AwtFrame::_CreateProxyFocusOwner, (void *)this);
-    }
+    return retValue;
 }
 
-void AwtFrame::_CreateProxyFocusOwner(void *param)
-{
-    DASSERT(AwtToolkit::IsMainThread());
-
-    AwtFrame *f = (AwtFrame *)param;
-    DASSERT(f->m_proxyFocusOwner == NULL);
-
-    f->m_proxyFocusOwner = ::CreateWindow(TEXT("STATIC"),
-                                          TEXT("ProxyFocusOwner"),
-                                          WS_CHILD,
-                                          0, 0, 0, 0, f->GetHWnd(), NULL,
-                                          AwtToolkit::GetInstance().
-                                          GetModuleHandle(),
-                                          NULL);
-
-    f->m_proxyDefWindowProc = ComCtl32Util::GetInstance().SubclassHWND(f->m_proxyFocusOwner, ProxyWindowProc);
-}
-
-void AwtFrame::DestroyProxyFocusOwner()
+LRESULT AwtFrame::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
 {
-    // proxy focus owner must be destroyed on toolkit thread only
-    if (AwtToolkit::IsMainThread()) {
-        AwtFrame::_DestroyProxyFocusOwner((void *)this);
-    } else {
-        AwtToolkit::GetInstance().InvokeFunction(AwtFrame::_DestroyProxyFocusOwner, (void *)this);
-    }
-}
+    MsgRouting mr = mrDoDefault;
+    LRESULT retValue = 0L;
+
+    retValue = ProxyWindowProc(message, wParam, lParam, mr);
 
-void AwtFrame::_DestroyProxyFocusOwner(void *param)
-{
-    DASSERT(AwtToolkit::IsMainThread());
-
-    AwtFrame *f = (AwtFrame *)param;
-    if (f->m_proxyFocusOwner != NULL) {
-        HWND toDestroy = f->m_proxyFocusOwner;
-        f->m_proxyFocusOwner = NULL;
-        ComCtl32Util::GetInstance().UnsubclassHWND(toDestroy, ProxyWindowProc, f->m_proxyDefWindowProc);
-        ::DestroyWindow(toDestroy);
+    if (mr != mrConsume) {
+        retValue = AwtWindow::WindowProc(message, wParam, lParam);
     }
+    return retValue;
 }
 
 MsgRouting AwtFrame::WmShowWindow(BOOL show, UINT status)
--- a/jdk/src/windows/native/sun/windows/awt_Frame.h	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/src/windows/native/sun/windows/awt_Frame.h	Tue Mar 15 20:00:45 2011 -0400
@@ -96,6 +96,8 @@
     AwtMenuBar* GetMenuBar();
     void SetMenuBar(AwtMenuBar*);
 
+    virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam);
+
     MsgRouting WmGetMinMaxInfo(LPMINMAXINFO lpmmi);
     MsgRouting WmSize(UINT type, int w, int h);
     MsgRouting WmActivate(UINT nState, BOOL fMinimized, HWND opposite);
@@ -117,10 +119,7 @@
     INLINE BOOL IsUndecorated() { return m_isUndecorated; }
 
     INLINE HWND GetProxyFocusOwner() {
-        if (m_proxyFocusOwner == NULL) {
-            CreateProxyFocusOwner();
-        }
-        return m_proxyFocusOwner;
+        return GetHWnd();
     }
 
     void SetMaximizedBounds(int x, int y, int w, int h);
@@ -159,15 +158,7 @@
     BOOL m_isUndecorated;
 
 private:
-    static LRESULT CALLBACK ProxyWindowProc(HWND hwnd, UINT message,
-                                            WPARAM wParam, LPARAM lParam);
-    void CreateProxyFocusOwner();
-    void DestroyProxyFocusOwner();
-
-    /* creates proxy focus owner, called on Toolkit thread */
-    static void _CreateProxyFocusOwner(void *param);
-    /* destroys proxy focus owner, called on Toolkit thread */
-    static void _DestroyProxyFocusOwner(void *param);
+    LRESULT ProxyWindowProc(UINT message, WPARAM wParam, LPARAM lParam, MsgRouting &mr);
 
     /* The frame's embedding parent (if any) */
     HWND m_parentWnd;
@@ -188,10 +179,6 @@
     /* The frame is an InputMethodWindow */
     BOOL m_isInputMethodWindow;
 
-    /* Receives all keyboard input when an AwtWindow which is not an AwtFrame
-       or an AwtDialog (or one of its children) has the logical input focus. */
-    HWND m_proxyFocusOwner;
-
     /* Retains the last/current sm_focusOwner proxied. Actually, it should be
      * a component of an owned window last/currently active. */
     HWND m_lastProxiedFocusOwner;
--- a/jdk/src/windows/native/sun/windows/awt_TrayIcon.cpp	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/src/windows/native/sun/windows/awt_TrayIcon.cpp	Tue Mar 15 20:00:45 2011 -0400
@@ -200,10 +200,9 @@
             m_nid.cbSize = (BYTE *)(&m_nid.guidItem) - (BYTE *)(&m_nid.cbSize);
             break;
         case 6: // WIN_XP
-            // Uncomment these two lines when moving to VS2008
-//            m_nid.cbSize = (BYTE *)(&m_nid.hBalloonIcon) - (BYTE *)(&m_nid.cbSize);
-//            break;
-        default: // WIN_VISTA?
+            m_nid.cbSize = (BYTE *)(&m_nid.hBalloonIcon) - (BYTE *)(&m_nid.cbSize);
+            break;
+        default: // WIN_VISTA
             m_nid.cbSize = sizeof(m_nid);
             break;
     }
--- a/jdk/src/windows/native/sun/windows/awt_Window.cpp	Tue Mar 15 19:52:42 2011 -0400
+++ b/jdk/src/windows/native/sun/windows/awt_Window.cpp	Tue Mar 15 20:00:45 2011 -0400
@@ -221,6 +221,8 @@
 
     m_windowType = NORMAL;
     m_alwaysOnTop = false;
+
+    fullScreenExclusiveModeState = FALSE;
 }
 
 AwtWindow::~AwtWindow()
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/FontClass/SurrogateTest/SupplementaryCanDisplayUpToTest.java	Tue Mar 15 20:00:45 2011 -0400
@@ -0,0 +1,105 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 6623219
+ * @summary Test canDisplayUpTo with supplementary characters.
+ */
+
+import java.awt.*;
+import java.text.*;
+
+public class SupplementaryCanDisplayUpToTest {
+    // Lists consisting of a font name, test text, and its expected
+    // return value. Test text uses private area code point U+F0000
+    // (\udb80\udc00).
+    private static String[][] DATA = {
+        // Windows
+        { "Meiryo", "\ud87e\udd45\ud87e\udd47\udb80\udc00", "4" },
+        { "Meiryo", "\ud87e\udd45\ud87e\udd47\udb80Z", "4" },
+        { "Meiryo", "\ud87e\udd45\ud87e\udd47\udb80", "4" },
+        { "Meiryo", "\ud87e\udd45\ud87e\udd47\udc00", "4" },
+        { "Meiryo", "\ud87e\udd45\ud87e\udd47", "-1" },
+
+        // Linux
+        { "AR PL UMing TW", "\ud87e\udc25\ud87e\udc3b\udb80\udc00", "4" },
+        { "AR PL UMing TW", "\ud87e\udc25\ud87e\udc3b\udb80Z", "4" },
+        { "AR PL UMing TW", "\ud87e\udc25\ud87e\udc3b\udb80", "4" },
+        { "AR PL UMing TW", "\ud87e\udc25\ud87e\udc3b\udc00", "4" },
+        { "AR PL UMing TW", "\ud87e\udc25\ud87e\udc3b", "-1" },
+
+        // Solaris
+        { "FZMingTi", "\ud87e\udc25\ud87e\udc3b\udb80\udc00", "4" },
+        { "FZMingTi", "\ud87e\udc25\ud87e\udc3b\udb80Z", "4" },
+        { "FZMingTi", "\ud87e\udc25\ud87e\udc3b\udb80", "4" },
+        { "FZMingTi", "\ud87e\udc25\ud87e\udc3b\udc00", "4" },
+        { "FZMingTi", "\ud87e\udc25\ud87e\udc3b", "-1" },
+    };
+    private static int errorcount = 0;
+
+    public static void main(String[] args) {
+        for (String[] data : DATA) {
+            String fontname = data[0];
+            Font font = new Font(fontname, Font.PLAIN, 16);
+            if (font.getFamily().equals(Font.DIALOG)) {
+                // Skip any unavailable fonts.
+                continue;
+            }
+
+            System.out.printf("Testing with font '%s'... ", fontname);
+            int errors = 0;
+            String text = data[1];
+            int expected = Integer.parseInt(data[2]);
+
+            int result = font.canDisplayUpTo(text);
+            if (result != expected) {
+                System.err.println("canDisplayUpTo(String) returns " + result);
+                errors++;
+            }
+
+            result = font.canDisplayUpTo(text.toCharArray(), 0, text.length());
+            if (result != expected) {
+                System.err.println("canDisplayUpTo(char[], int, int) returns " + result);
+                errors++;
+            }
+
+            CharacterIterator iter = new StringCharacterIterator(text);
+            result = font.canDisplayUpTo(iter, iter.getBeginIndex(), iter.getEndIndex());
+            if (result != expected) {
+                System.err.println("canDisplayUpTo(CharacterIterator, int, int) returns " + result);
+                errors++;
+            }
+
+            if (errors == 0) {
+                System.out.println("passed");
+            } else {
+                System.out.println("failed");
+                errorcount += errors;
+            }
+        }
+        if (errorcount > 0) {
+            throw new RuntimeException("SupplementaryCanDisplayUpToTest: failed");
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/util/TimeZone/Bug6772689.java	Tue Mar 15 20:00:45 2011 -0400
@@ -0,0 +1,91 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 6772689
+ * @summary Test for standard-to-daylight transitions at midnight:
+ * date stays on the given day.
+ */
+
+import java.util.Calendar;
+import java.util.Date;
+import java.util.GregorianCalendar;
+import java.util.TimeZone;
+import static java.util.GregorianCalendar.*;
+
+public class Bug6772689 {
+    private static final int BEGIN_YEAR = 2035;
+    private static final int END_YEAR = BEGIN_YEAR + 28;
+
+    public static void main(String[] args) {
+        TimeZone defaultTimeZone = TimeZone.getDefault();
+        int errors = 0;
+
+        Calendar cal = new GregorianCalendar(BEGIN_YEAR, MARCH, 1);
+        String[] tzids = TimeZone.getAvailableIDs();
+        try {
+            for (String id : tzids) {
+                TimeZone tz = TimeZone.getTimeZone(id);
+                if (!tz.useDaylightTime()) {
+                    continue;
+                }
+                TimeZone.setDefault(tz);
+
+              dateloop:
+                // Use future dates because sun.util.calendar.ZoneInfo
+                // delegates offset transition calculations to a SimpleTimeZone
+                // (after 2038 as of JDK7).
+                for (int year = BEGIN_YEAR; year < END_YEAR; year++) {
+                    for (int month = MARCH; month <= NOVEMBER; month++) {
+                        cal.set(year, month, 1, 15, 0, 0);
+                        int maxDom = cal.getActualMaximum(DAY_OF_MONTH);
+                        for (int dom = 1; dom <= maxDom; dom++) {
+                            Date date = new Date(year - 1900, month, dom);
+                            if (date.getYear()+1900 != year
+                                || date.getMonth() != month
+                                || date.getDate() != dom) {
+                                System.err.printf("%s: got %04d-%02d-%02d, expected %04d-%02d-%02d%n",
+                                                  id,
+                                                  date.getYear() + 1900,
+                                                  date.getMonth() + 1,
+                                                  date.getDate(),
+                                                  year,
+                                                  month + 1,
+                                                  dom);
+                                errors++;
+                                break dateloop;
+                            }
+                        }
+                    }
+                }
+            }
+        } finally {
+            // Restore the default TimeZone.
+            TimeZone.setDefault(defaultTimeZone);
+        }
+        if (errors > 0) {
+            throw new RuntimeException("Transition test failed");
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/sound/midi/File/SMPTESequence.java	Tue Mar 15 20:00:45 2011 -0400
@@ -0,0 +1,75 @@
+/**
+ * @test
+ * @bug 6835393
+ * @summary Tests that MidiFileReader correctly reads sequences with different division types
+ * @author Alex Menkov
+ */
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import javax.sound.midi.InvalidMidiDataException;
+import javax.sound.midi.MidiSystem;
+import javax.sound.midi.Sequence;
+
+public class SMPTESequence {
+
+    static int failed = 0;
+
+    public static void main(String[] args) {
+        test(Sequence.PPQ);
+        test(Sequence.SMPTE_24);
+        test(Sequence.SMPTE_25);
+        test(Sequence.SMPTE_30);
+        test(Sequence.SMPTE_30DROP);
+
+        if (failed > 0) {
+            throw new RuntimeException("" + failed + " tests failed");
+        }
+    }
+
+    static boolean test(float divisionType) {
+        boolean result = false;
+        try {
+            log("Testing divisionType == " + divisionType);
+            Sequence sequence = new Sequence(divisionType, 16, 1);
+            float div1 = sequence.getDivisionType();
+
+            ByteArrayOutputStream outStream = new ByteArrayOutputStream();
+            MidiSystem.write(sequence, 1, outStream);
+
+            InputStream inStream = new ByteArrayInputStream(outStream.toByteArray());
+
+            sequence = MidiSystem.getSequence(inStream);
+            float div2 = sequence.getDivisionType();
+
+            log("After write/read got divisionType == " + div2);
+            if (Math.abs(div2 - div1) < 0.001f) {
+                result = true;
+            }
+        } catch (InvalidMidiDataException ex) {
+            log(ex);
+        } catch (IOException ex) {
+            log(ex);
+        } catch (IllegalArgumentException ex) {
+            log(ex);
+        }
+        if (result) {
+            log("OK");
+        } else {
+            log("FAIL");
+            failed++;
+        }
+        return result;
+    }
+
+    static void log(String s) {
+        System.out.println(s);
+    }
+
+    static void log(Exception ex) {
+        log("got exception (" + ex.getClass().getSimpleName() + "): " + ex.getMessage());
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/sound/midi/Sequencer/SequencerImplicitSynthOpen.java	Tue Mar 15 20:00:45 2011 -0400
@@ -0,0 +1,110 @@
+/**
+ * @test
+ * @bug 6660470
+ * @summary Tests that sequencer correctly opens/closes (implicitly) devices
+ * @author Alex Menkov
+ */
+
+import java.util.List;
+import javax.sound.midi.MidiDevice;
+import javax.sound.midi.MidiDeviceReceiver;
+import javax.sound.midi.MidiSystem;
+import javax.sound.midi.MidiUnavailableException;
+import javax.sound.midi.Receiver;
+import javax.sound.midi.Sequencer;
+import javax.sound.midi.Transmitter;
+
+public class SequencerImplicitSynthOpen {
+
+    static int TEST_COUNT   = 5;
+
+    public static void main(String[] args) {
+        try {
+            log("getting sequencer...");
+            Sequencer sequencer = MidiSystem.getSequencer();
+            log("  - got " + getDeviceStr(sequencer));
+
+            // obtain connected device (usually synthesizer)
+            MidiDevice synth = getConnectedDevice(sequencer);
+            if (synth == null) {
+                log("could not get connected device, returning");
+                return;
+            }
+
+            log("connected device: " + getDeviceStr(synth));
+
+            int success = 0;
+            for (int i=0; i<TEST_COUNT; i++) {
+                if (test(sequencer)) {
+                    success++;
+                }
+            }
+
+            if (success != TEST_COUNT) {
+                throw new RuntimeException("test FAILS");
+            }
+        } catch (MidiUnavailableException ex) {
+            // this is not a failure
+            log("Could not get Sequencer");
+        }
+        log("test PASSED.");
+    }
+
+    static boolean test(Sequencer sequencer) throws MidiUnavailableException {
+        log("");
+        log("opening sequencer...");
+        sequencer.open();   // opens connected synthesizer implicitly
+        MidiDevice synth = getConnectedDevice(sequencer);
+        log("  connected device: " + getDeviceStr(synth));
+
+        log("closing sequencer...");
+        sequencer.close();  // closes the synth implicitly
+        log("  synth is " + getDeviceStr(synth));
+        MidiDevice synth2 = getConnectedDevice(sequencer);
+        log("  currently connected device: " + getDeviceStr(synth2));
+
+        if (synth != null && synth.isOpen()) {
+            log("FAIL.");
+            return false;
+        }
+        log("OK.");
+        return true;
+    }
+
+    static MidiDevice getConnectedDevice(Sequencer sequencer) {
+        List<Transmitter> trans = sequencer.getTransmitters();
+        log("  sequencer has " + trans.size() + " opened transmitters:");
+        for (Transmitter tr: trans) {
+            Receiver r = tr.getReceiver();
+            log("    " + getClassStr(tr) + " connected to " + getClassStr(r));
+            if (r instanceof MidiDeviceReceiver) {
+                MidiDeviceReceiver recv = (MidiDeviceReceiver)r;
+                MidiDevice dev = recv.getMidiDevice();
+                log("      - receiver of " + getClassStr(dev));
+                return dev;
+            } else {
+                log("      - does NOT implement MidiDeviceReceiver");
+            }
+        }
+        return null;
+    }
+
+    static String getClassStr(Object o) {
+        if (o == null) {
+            return "<null>";
+        }
+        return o.getClass().getName();
+    }
+
+    static String getDeviceStr(MidiDevice dev) {
+        if (dev == null) {
+            return "NULL";
+        }
+        return getClassStr(dev) + ", " + (dev.isOpen() ? "OPENED" : "CLOSED");
+    }
+
+    static void log(String s) {
+        System.out.println(s);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/sound/sampled/Clip/ClipSetPos.java	Tue Mar 15 20:00:45 2011 -0400
@@ -0,0 +1,90 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * @test
+ * @bug 6801206
+ * @summary Tests that Clip sets frame position
+ * @author Alex Menkov
+ */
+
+import javax.sound.sampled.AudioFormat;
+import javax.sound.sampled.AudioSystem;
+import javax.sound.sampled.Clip;
+import javax.sound.sampled.LineUnavailableException;
+
+public class ClipSetPos {
+
+    final static AudioFormat audioFormat = new AudioFormat(44100f, 16, 2, true, true);
+    final static int frameLength = 44100 * 2; // 2 seconds
+    final static byte[] dataBuffer
+            = new byte[frameLength * (audioFormat.getSampleSizeInBits()/8)
+                       * audioFormat.getChannels()];
+    final static int MAX_FRAME_DELTA = 20;
+
+    public static void main(String[] args) {
+        boolean testPassed = true;
+        Clip clip = null;
+        try {
+            clip = AudioSystem.getClip();
+            clip.open(audioFormat, dataBuffer, 0, dataBuffer.length);
+        } catch (LineUnavailableException ex) {
+            log(ex);
+            log("Cannot test (this is not failure)");
+            return;
+        }
+
+        log("clip: " + clip.getClass().getName());
+
+        int len = clip.getFrameLength();
+        for (int pos=0; pos < len; pos += (len /100)) {
+            clip.setFramePosition(pos);
+            int curPos = clip.getFramePosition();
+            if (Math.abs(pos - curPos) > MAX_FRAME_DELTA) {
+                log("Tried to set pos to " + pos + ", but got back " + curPos);
+                testPassed = false;
+            } else {
+                log("Sucessfully set pos to " + pos);
+            }
+        }
+        clip.close();
+
+        if (testPassed) {
+            log("Test PASSED.");
+        } else {
+            log("Test FAILED.");
+            throw new RuntimeException("Test FAILED (see log)");
+        }
+    }
+
+    static void log(String s) {
+        System.out.println(s);
+    }
+
+    static void log(Exception ex) {
+        ex.printStackTrace(System.out);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/sound/sampled/FileWriter/AlawEncoderSync.java	Tue Mar 15 20:00:45 2011 -0400
@@ -0,0 +1,113 @@
+/**
+ * @test
+ * @bug 6938426
+ * @summary Tests that Alaw encoder works properly in multithreaded environment
+ * @author Alex Menkov
+ */
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.InputStream;
+import java.util.Arrays;
+import javax.sound.sampled.AudioFormat;
+import javax.sound.sampled.AudioInputStream;
+import javax.sound.sampled.AudioSystem;
+
+public class AlawEncoderSync {
+
+    static final int THREAD_COUNT   = 20;
+
+    static final AudioFormat pcmFormat = new AudioFormat(8000f, 16, 2, true, false);
+    static final int STREAM_LENGTH = 10;    // in seconds
+    static byte[] pcmBuffer;
+    static final AudioFormat alawFormat
+            = new AudioFormat(AudioFormat.Encoding.ALAW, 8000f, 8, 2, 2, 8000f, false);
+
+    static final ConversionThread[] threads = new ConversionThread[THREAD_COUNT];
+
+    public static void main(String[] args) {
+        preparePCMBuffer();
+        log("pcmStream size: " + pcmBuffer.length);
+
+        for (int i=0; i<THREAD_COUNT; i++) {
+            threads[i] = new ConversionThread(i);
+            threads[i].start();
+        }
+
+        for (int i=1; i<THREAD_COUNT; i++) {
+            try {
+                threads[i].join();
+            } catch (InterruptedException ex) {
+                log("Main thread was interrupted, exiting.");
+                return;
+            }
+        }
+
+        int failed = 0;
+        log("comparing result arrays...");
+        for (int i=1; i<THREAD_COUNT; i++) {
+            if (!Arrays.equals(threads[0].resultArray, threads[i].resultArray)) {
+                failed++;
+                log("NOT equals: 0 and " + i);
+            }
+        }
+        if (failed > 0) {
+            throw new RuntimeException("test FAILED");
+        }
+        log("test PASSED.");
+    }
+
+
+    static void preparePCMBuffer() {
+        pcmBuffer = new byte[STREAM_LENGTH * (int)pcmFormat.getSampleRate()
+                * (pcmFormat.getSampleSizeInBits() / 8) * pcmFormat.getChannels()];
+        for (int i=0; i<pcmBuffer.length; i++) {
+            pcmBuffer[i] = (byte)(Math.random() * 256.0 - 128.0);
+        }
+    }
+
+    static AudioInputStream createPCMStream() {
+        InputStream byteStream = new ByteArrayInputStream(pcmBuffer);
+        return new AudioInputStream(byteStream, pcmFormat, AudioSystem.NOT_SPECIFIED);
+    }
+
+    static class ConversionThread extends Thread {
+        public final int num;
+        public byte[] resultArray = null;
+        public ConversionThread(int num) {
+            this.num = num;
+        }
+        @Override
+        public void run() {
+            log("ConversionThread[" + num + "] started.");
+            try {
+                InputStream inStream = new ByteArrayInputStream(pcmBuffer);
+
+                AudioInputStream pcmStream = new AudioInputStream(
+                        inStream, pcmFormat, AudioSystem.NOT_SPECIFIED);
+                AudioInputStream alawStream = AudioSystem.getAudioInputStream(alawFormat, pcmStream);
+
+                ByteArrayOutputStream outStream = new ByteArrayOutputStream();
+                int read = 0;
+                byte[] data = new byte[4096];
+                while((read = alawStream.read(data)) != -1) {
+                    outStream.write(data, 0, read);
+               }
+               alawStream.close();
+               resultArray = outStream.toByteArray();
+            } catch (Exception ex) {
+                log("ConversionThread[" + num + "] exception:");
+                log(ex);
+            }
+            log("ConversionThread[" + num + "] completed.");
+        }
+    }
+
+    static void log(String s) {
+        System.out.println(s);
+    }
+
+    static void log(Exception ex) {
+        ex.printStackTrace(System.out);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/sound/sampled/FileWriter/WriterCloseInput.java	Tue Mar 15 20:00:45 2011 -0400
@@ -0,0 +1,127 @@
+/**
+ * @test
+ * @bug 7013521
+ * @summary AIFF/AU/WAVE writers close input audio stream
+ * @author Alex Menkov
+ */
+
+import java.io.ByteArrayInputStream;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import javax.sound.sampled.AudioFileFormat;
+import javax.sound.sampled.AudioFormat;
+import javax.sound.sampled.AudioInputStream;
+import javax.sound.sampled.AudioSystem;
+
+
+public class WriterCloseInput {
+
+    final static AudioFormat audioFormat = new AudioFormat(44100f, 16, 2, true, true);
+    //final static AudioFormat audioFormat = new AudioFormat(AudioFormat.Encoding.ULAW, 44100f, 8, 2, 2, 44100f, true);
+    final static int frameLength = 44100 * 2; // 2 seconds
+    final static byte[] dataBuffer
+            = new byte[frameLength * (audioFormat.getSampleSizeInBits()/8)
+                       * audioFormat.getChannels()];
+
+    static int testTotal = 0;
+    static int testFailed = 0;
+
+    public static void main(String[] args) throws Exception {
+        test(AudioFileFormat.Type.AIFF);
+        test(AudioFileFormat.Type.AU);
+        test(AudioFileFormat.Type.WAVE);
+
+        if (testFailed == 0) {
+            out("All tests passed.");
+        } else {
+            out("" + testFailed + " of " + testTotal + " tests FAILED.");
+            System.out.flush();
+            throw new RuntimeException("Test FAILED.");
+        }
+    }
+
+    static void test(AudioFileFormat.Type fileType) {
+        test(fileType, frameLength);
+        test(fileType, AudioSystem.NOT_SPECIFIED);
+    }
+
+    static void test(AudioFileFormat.Type fileType, int length) {
+        test(fileType, length, false);
+        test(fileType, length, true);
+    }
+
+    static void test(AudioFileFormat.Type fileType, int length, boolean isFile) {
+        testTotal++;
+        out("Testing fileType: " + fileType
+                + ", frameLength: " + (length >= 0 ? length : "unspecified")
+                + ", output: " + (isFile ? "File" : "OutputStream"));
+        AudioInputStream inStream = new ThrowAfterCloseStream(
+                new ByteArrayInputStream(dataBuffer), audioFormat, length);
+
+        AudioSystem.isFileTypeSupported(fileType, inStream);
+
+        try {
+            if (isFile) {
+                File f = File.createTempFile("WriterCloseInput" + testTotal, "tmp");
+                AudioSystem.write(inStream, fileType, f);
+                f.delete();
+            } else {
+                OutputStream outStream = new NullOutputStream();
+                AudioSystem.write(inStream, fileType, outStream);
+            }
+        } catch (Exception ex) {
+            // this is not failure
+            out("SKIPPED (AudioSystem.write exception): " + ex.getMessage());
+            //out(ex);
+            inStream = null;
+        }
+
+        if (inStream != null) {
+            try {
+                // test if the stream is closed
+                inStream.available();
+                out("PASSED");
+            } catch (IOException ex) {
+                testFailed++;
+                out("FAILED: " + ex.getMessage());
+                //out(ex);
+            }
+        }
+        out("");
+    }
+
+    static class ThrowAfterCloseStream extends AudioInputStream {
+        private boolean closed = false;
+        public ThrowAfterCloseStream(InputStream in, AudioFormat format, long length) {
+            super(in, format, length);
+        }
+        @Override
+        public void close() {
+            closed = true;
+        }
+        @Override
+        public int available() throws IOException {
+            if (closed) {
+                throw new IOException("The stream has been closed");
+            }
+            return 1;
+        }
+    }
+
+    static class NullOutputStream extends OutputStream {
+        @Override
+        public void write(int b) throws IOException {
+            // nop
+        }
+    }
+
+    static void out(String s) {
+        System.out.println(s);
+    }
+
+    static void out(Exception ex) {
+        ex.printStackTrace(System.out);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/swing/regtesthelpers/Util.java	Tue Mar 15 20:00:45 2011 -0400
@@ -0,0 +1,75 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import javax.swing.*;
+import java.awt.*;
+import java.awt.image.BufferedImage;
+
+/**
+ * <p>This class contains utilities useful for regression testing.
+ * <p>When using jtreg you would include this class via something like:
+ * <pre>
+ *
+ * @library ../../regtesthelpers
+ * @build Util
+ * </pre>
+ */
+
+public class Util {
+    /**
+     * Convert a rectangle from coordinate system of Component c to
+     * screen coordinate system.
+     *
+     * @param r a non-null Rectangle
+     * @param c a Component whose coordinate system is used for conversion
+     */
+    public static void convertRectToScreen(Rectangle r, Component c) {
+        Point p = new Point(r.x, r.y);
+        SwingUtilities.convertPointToScreen(p, c);
+        r.x = p.x;
+        r.y = p.y;
+    }
+
+    /**
+     * Compares two bufferedImages pixel-by-pixel.
+     * return true if all pixels in the two areas are identical
+     */
+    public static boolean compareBufferedImages(BufferedImage bufferedImage0, BufferedImage bufferedImage1) {
+        int width = bufferedImage0.getWidth();
+        int height = bufferedImage0.getHeight();
+
+        if (width != bufferedImage1.getWidth() || height != bufferedImage1.getHeight()) {
+            return false;
+        }
+
+        for (int y = 0; y < height; y++) {
+            for (int x = 0; x < width; x++) {
+                if (bufferedImage0.getRGB(x, y) != bufferedImage1.getRGB(x, y)) {
+                    return false;
+                }
+            }
+        }
+
+        return true;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/swing/text/CSSBorder/6796710/bug6796710.java	Tue Mar 15 20:00:45 2011 -0400
@@ -0,0 +1,120 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 6796710
+ * @summary Html content in JEditorPane is overlapping on swing components while resizing the application.
+ * @library ../../../regtesthelpers
+ * @build Util
+ * @author Pavel Porvatov
+   @run main bug6796710
+ */
+
+import javax.swing.*;
+import java.awt.*;
+import java.awt.image.BufferedImage;
+
+public class bug6796710 {
+    // The page is inlined because we want to be sure that the JEditorPane filled synchronously
+    public static final String TEXT = "<html>" +
+            "<body>" +
+            "<table cellpadding=\"0\" cellspacing=\"0\" border=\"1\">" +
+            "    <tbody>" +
+            "        <tr>" +
+            "            <td>Col1</td>" +
+            "            <td>Col2</td>" +
+            "            <td>Col3</td>" +
+            "        </tr>" +
+            "        <tr>" +
+            "            <td>1. It's a regression from CR 4419748. The problem is in the CSSBorder#paintBorder, which ignores clip area while painting.</td>" +
+            "            <td>2. It's a regression from CR 4419748. The problem is in the CSSBorder#paintBorder, which ignores clip area while painting.</td>" +
+            "            <td>3. It's a regression from CR 4419748. The problem is in the CSSBorder#paintBorder, which ignores clip area while painting.</td>" +
+            "        </tr>" +
+            "    </tbody>" +
+            "</table>" +
+            "</body>" +
+            "</html>";
+
+    private static Robot robot;
+
+    private static JFrame frame;
+
+    private static JPanel pnBottom;
+
+    public static void main(String[] args) throws Exception {
+        robot = new Robot();
+
+        SwingUtilities.invokeAndWait(new Runnable() {
+            public void run() {
+                frame = new JFrame();
+
+                pnBottom = new JPanel();
+                pnBottom.add(new JLabel("Some label"));
+                pnBottom.add(new JButton("A button"));
+
+                JEditorPane editorPane = new JEditorPane();
+
+                editorPane.setContentType("text/html");
+                editorPane.setText(TEXT);
+                editorPane.setEditable(false);
+
+                JPanel pnContent = new JPanel(new BorderLayout());
+
+                pnContent.add(new JScrollPane(editorPane), BorderLayout.CENTER);
+                pnContent.add(pnBottom, BorderLayout.SOUTH);
+
+                frame.setContentPane(pnContent);
+                frame.setSize(400, 600);
+                frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+                frame.setVisible(true);
+            }
+        });
+
+        robot.waitForIdle();
+
+        BufferedImage bufferedImage = getPnBottomImage();
+
+        SwingUtilities.invokeAndWait(new Runnable() {
+            public void run() {
+                frame.setSize(400, 150);
+            }
+        });
+
+        robot.waitForIdle();
+
+        if (!Util.compareBufferedImages(bufferedImage, getPnBottomImage())) {
+            throw new RuntimeException("The test failed");
+        }
+
+        System.out.println("The test bug6796710 passed.");
+    }
+
+    private static BufferedImage getPnBottomImage() {
+        Rectangle rect = pnBottom.getBounds();
+
+        Util.convertRectToScreen(rect, pnBottom.getParent());
+
+        return robot.createScreenCapture(rect);
+    }
+}
--- a/langtools/.hgtags	Tue Mar 15 19:52:42 2011 -0400
+++ b/langtools/.hgtags	Tue Mar 15 20:00:45 2011 -0400
@@ -106,3 +106,4 @@
 1383d1ee8b5db13d5df9523d1760df17b9d228d4 jdk7-b129
 7a98db8cbfce77a619057aa4fdde69d2a06d4101 jdk7-b130
 67221b8643b478c4fceacc89240db876455aae76 jdk7-b131
+e3d011d59a33acef79eff7523bef069557e91002 jdk7-b132
--- a/make/Defs-internal.gmk	Tue Mar 15 19:52:42 2011 -0400
+++ b/make/Defs-internal.gmk	Tue Mar 15 20:00:45 2011 -0400
@@ -28,21 +28,63 @@
 # not contain rules.
 #
 
-# Indicate that we are visiting a separate repo or component 
+# The build times report is turned off by setting REPORT_BUILD_TIMES to nothing.
+# This is necessary for the target clobber/clean which will erase the
+# directories where the buildtimes are stored.
+REPORT_BUILD_TIMES=1
+# Store the build times in this directory.
+BUILDTIMESDIR=$(ABS_OUTPUTDIR)/tmp/buildtimes
+
+# Record starting time for build of a sub repository.
+define RecordStartTime
+$(MKDIR) -p $(BUILDTIMESDIR)
+$(DATE) '+%Y %m %d %H %M %S' | $(NAWK) '{ print $$1,$$2,$$3,$$4,$$5,$$6,($$4*3600+$$5*60+$$6) }' > $(BUILDTIMESDIR)/build_time_start_$1
+$(DATE) '+%Y-%m-%d %H:%M:%S' > $(BUILDTIMESDIR)/build_time_start_$1_human_readable
+endef
+
+# Indicate that we started to build a sub repository and record starting time. 
 define MakeStart
-$(PRINTF) "\n\n%s\n%s\n##### %-60.60s #####\n%s\n" \
+$(call RecordStartTime,$1)
+$(PRINTF) "\n\n%s\n%s\n##### %-60.60s #####\n%s\n\n" \
 "########################################################################" \
 "########################################################################" \
-"Entering $1 for target $2" \
+"Entering $1 for target(s) $2" \
 "########################################################################"
 endef
 
-define MakeFinish
-$(PRINTF) "%s\n##### %-60.60s #####\n%s\n%s\n\n" \
+# Record ending time and calculate the difference and store it in a
+# easy to read format. Handles builds that cross midnight. Expects
+# that a build will never take 24 hours or more. 
+define RecordEndTime
+$(DATE) '+%Y %m %d %H %M %S' | $(NAWK) '{ print $$1,$$2,$$3,$$4,$$5,$$6,($$4*3600+$$5*60+$$6) }' > $(BUILDTIMESDIR)/build_time_end_$1
+$(DATE) '+%Y-%m-%d %H:%M:%S' > $(BUILDTIMESDIR)/build_time_end_$1_human_readable
+$(ECHO) `$(CAT) $(BUILDTIMESDIR)/build_time_start_$1` `$(CAT) $(BUILDTIMESDIR)/build_time_end_$1` $1 | \
+  $(NAWK) '{ F=$$7; T=$$14; if (F > T) { T+=3600*24 }; D=T-F; H=int(D/3600); \
+             M=int((D-H*3600)/60); S=D-H*3600-M*60; printf("%02d:%02d:%02d %s\n",H,M,S,$$15); }' \
+  > $(BUILDTIMESDIR)/build_time_diff_$1
+endef
+
+# Indicate that we are done.
+# Record ending time and print out the total time it took to build.
+define MakeFinish 
+$(if $(REPORT_BUILD_TIMES),$(call RecordEndTime,$1),) 
+$(PRINTF) "%s\n##### %-60.60s #####\n%s\n##### %-60.60s #####\n%s\n\n" \
 "########################################################################" \
-"Leaving $1 for target $2" \
+"Leaving $1 for target(s) $2" \
 "########################################################################" \
-"########################################################################"
+$(if $(REPORT_BUILD_TIMES),"Build time `$(CAT) $(BUILDTIMESDIR)/build_time_diff_$1` for target(s) $2","") \
+"########################################################################" 
+endef
+
+# Find all build_time_* files and print their contents in a list sorted
+# on the name of the sub repository.
+define ReportBuildTimes
+$(PRINTF) "-- Build times ----------\nTarget %s\nStart %s\nEnd   %s\n%s\n%s\n-------------------------\n" \
+$1 \
+"`$(CAT) $(BUILDTIMESDIR)/build_time_start_TOTAL_human_readable`" \
+"`$(CAT) $(BUILDTIMESDIR)/build_time_end_TOTAL_human_readable`" \
+"`$(LS) $(BUILDTIMESDIR)/build_time_diff_* | $(GREP) -v _TOTAL | $(XARGS) $(CAT) | $(SORT) -k 2`" \
+"`$(CAT) $(BUILDTIMESDIR)/build_time_diff_TOTAL`"
 endef
 
 ifdef OPENJDK
--- a/make/corba-rules.gmk	Tue Mar 15 19:52:42 2011 -0400
+++ b/make/corba-rules.gmk	Tue Mar 15 20:00:45 2011 -0400
@@ -40,17 +40,17 @@
 corba: corba-build
 corba-build:
 	$(MKDIR) -p $(CORBA_OUTPUTDIR)
-	@$(call MakeStart, corba, all)
+	@$(call MakeStart,corba,all)
 	($(CD) $(CORBA_TOPDIR)/make && \
 	 $(MAKE) $(CORBA_BUILD_ARGUMENTS) all)
-	@$(call MakeFinish, corba, all)
+	@$(call MakeFinish,corba,all)
 
 corba-clobber::
 	$(MKDIR) -p $(CORBA_OUTPUTDIR)
-	@$(call MakeStart, corba, clobber)
+	@$(call MakeStart,corba,clobber)
 	($(CD) $(CORBA_TOPDIR)/make &&  \
 	 $(MAKE) $(CORBA_BUILD_ARGUMENTS) clobber)
-	@$(call MakeFinish, corba, clobber)
+	@$(call MakeFinish,corba,clobber)
 
 .PHONY: corba corba-build corba-clobber 
 
--- a/make/deploy-rules.gmk	Tue Mar 15 19:52:42 2011 -0400
+++ b/make/deploy-rules.gmk	Tue Mar 15 20:00:45 2011 -0400
@@ -116,18 +116,18 @@
 
 deploy-build:
 ifeq ($(BUILD_DEPLOY), true)
-	@$(call MakeStart, deploy, $(DEPLOY_BUILD_TARGETS))
+	@$(call MakeStart,deploy,$(DEPLOY_BUILD_TARGETS))
 	($(CD) $(DEPLOY_TOPDIR)/make && \
 	  $(MAKE) $(DEPLOY_BUILD_TARGETS) $(DEPLOY_BUILD_ARGUMENTS))
-	@$(call MakeFinish, deploy, $(DEPLOY_BUILD_TARGETS))
+	@$(call MakeFinish,deploy,$(DEPLOY_BUILD_TARGETS))
 endif
 
 deploy-clobber::
 ifeq ($(BUILD_DEPLOY), true)
-	@$(call MakeStart, deploy, clobber)
+	@$(call MakeStart,deploy,clobber)
 	($(CD) $(DEPLOY_TOPDIR)/make && \
 	  $(MAKE) clobber $(DEPLOY_BUILD_ARGUMENTS))
-	@$(call MakeFinish, deploy, clobber)
+	@$(call MakeFinish,deploy,clobber)
 endif 
 
 deploy-sanity::
--- a/make/hotspot-rules.gmk	Tue Mar 15 19:52:42 2011 -0400
+++ b/make/hotspot-rules.gmk	Tue Mar 15 20:00:45 2011 -0400
@@ -96,10 +96,10 @@
 hotspot-build::
 	$(MKDIR) -p $(HOTSPOT_OUTPUTDIR)
 	$(MKDIR) -p $(HOTSPOT_EXPORT_PATH)
-	@$(call MakeStart, hotspot, $(HOTSPOT_TARGET))
+	@$(call MakeStart,hotspot,$(HOTSPOT_TARGET))
 	$(CD) $(HOTSPOT_TOPDIR)/make && \
 	    $(MAKE) $(HOTSPOT_BUILD_ARGUMENTS) $(HOTSPOT_TARGET)
-	@$(call MakeFinish, hotspot, $(HOTSPOT_TARGET))
+	@$(call MakeFinish,hotspot,$(HOTSPOT_TARGET))
 
 #####################
 # .PHONY
--- a/make/install-rules.gmk	Tue Mar 15 19:52:42 2011 -0400
+++ b/make/install-rules.gmk	Tue Mar 15 20:00:45 2011 -0400
@@ -57,39 +57,39 @@
 
 install-build:
 ifeq ($(BUILD_INSTALL), true)
-	@$(call MakeStart, install, $(INSTALL_BUILD_TARGETS))
+	@$(call MakeStart,install,$(INSTALL_BUILD_TARGETS))
 	($(CD) $(INSTALL_TOPDIR)/make && \
 	  $(MAKE) $(INSTALL_BUILD_TARGETS) $(INSTALL_BUILD_ARGUMENTS))
-	@$(call MakeFinish, install, $(INSTALL_BUILD_TARGETS))
+	@$(call MakeFinish,install,$(INSTALL_BUILD_TARGETS))
 endif
 
 update-patcher:
 ifeq ($(BUILD_INSTALL), true)
 	if [ -r $(INSTALL_TOPDIR)/make/update/Makefile ]; then \
-	  $(call MakeStart, install update, all); \
+	  $(call MakeStart,install_update,all); \
 	  ( $(CD) $(INSTALL_TOPDIR)/make/update && \
 	    $(MAKE) all $(INSTALL_BUILD_ARGUMENTS) ); \
-	  $(call MakeFinish, install, all); \
+	  $(call MakeFinish,install_update,all); \
 	fi
 endif
 
 update-patchgen:
 ifeq ($(BUILD_INSTALL), true)
 	if [ -r $(INSTALL_TOPDIR)/make/update/Makefile ]; then \
-	  $(call MakeStart, install update, patchgen); \
+	  $(call MakeStart,install_update,patchgen); \
 	  ( $(CD) $(INSTALL_TOPDIR)/make/update && \
 	    $(MAKE) patchgen $(INSTALL_BUILD_ARGUMENTS) ); \
-	  $(call MakeFinish, install, patchgen); \
+	  $(call MakeFinish,install_update,patchgen); \
 	fi
 endif
 
 installer:
 ifeq ($(BUILD_INSTALL), true)
 	if [ -r $(INSTALL_TOPDIR)/make/installer/Makefile ]; then \
-	  $(call MakeStart, install installer, all); \
+	  $(call MakeStart,install_installer,all); \
 	  ( $(CD) $(INSTALL_TOPDIR)/make/installer && \
 	    $(MAKE) all $(INSTALL_BUILD_ARGUMENTS) ); \
-	  $(call MakeFinish, install, all); \
+	  $(call MakeFinish,install_installer,all); \
 	fi
 endif
 
@@ -99,10 +99,10 @@
 
 install-clobber:
 ifeq ($(BUILD_INSTALL), true)
-	@$(call MakeStart, install, clobber)
+	@$(call MakeStart,install,clobber)
 	($(CD) $(INSTALL_TOPDIR)/make && \
 	  $(MAKE) clobber $(INSTALL_BUILD_ARGUMENTS))
-	@$(call MakeFinish, install, clobber)
+	@$(call MakeFinish,install,clobber)
 endif
 
 install-sanity:: 
--- a/make/jaxp-rules.gmk	Tue Mar 15 19:52:42 2011 -0400
+++ b/make/jaxp-rules.gmk	Tue Mar 15 20:00:45 2011 -0400
@@ -40,17 +40,17 @@
 jaxp: jaxp-build
 jaxp-build:
 	$(MKDIR) -p $(JAXP_OUTPUTDIR)
-	@$(call MakeStart, jaxp, all)
+	@$(call MakeStart,jaxp,all)
 	($(CD) $(JAXP_TOPDIR)/make && \
 	 $(MAKE) $(JAXP_BUILD_ARGUMENTS) all)
-	@$(call MakeFinish, jaxp, all)
+	@$(call MakeFinish,jaxp,all)
 
 jaxp-clobber::
 	$(MKDIR) -p $(JAXP_OUTPUTDIR)
-	@$(call MakeStart, jaxp, clobber)
+	@$(call MakeStart,jaxp,clobber)
 	($(CD) $(JAXP_TOPDIR)/make &&  \
 	 $(MAKE) $(JAXP_BUILD_ARGUMENTS) clobber)
-	@$(call MakeFinish, jaxp, clobber)
+	@$(call MakeFinish,jaxp,clobber)
 
 .PHONY: jaxp jaxp-build jaxp-clobber
 
--- a/make/jaxws-rules.gmk	Tue Mar 15 19:52:42 2011 -0400
+++ b/make/jaxws-rules.gmk	Tue Mar 15 20:00:45 2011 -0400
@@ -40,17 +40,17 @@
 jaxws: jaxws-build
 jaxws-build:
 	$(MKDIR) -p $(JAXWS_OUTPUTDIR)
-	@$(call MakeStart, jaxws, all)
+	@$(call MakeStart,jaxws,all)
 	($(CD) $(JAXWS_TOPDIR)/make && \
 	 $(MAKE) $(JAXWS_BUILD_ARGUMENTS) all)
-	@$(call MakeFinish, jaxws, all)
+	@$(call MakeFinish,jaxws,all)
 
 jaxws-clobber::
 	$(MKDIR) -p $(JAXWS_OUTPUTDIR)
-	@$(call MakeStart, jaxws, clobber)
+	@$(call MakeStart,jaxws,clobber)
 	($(CD) $(JAXWS_TOPDIR)/make &&  \
 	 $(MAKE) $(JAXWS_BUILD_ARGUMENTS) clobber)
-	@$(call MakeFinish, jaxws, clobber)
+	@$(call MakeFinish,jaxws,clobber)
 
 .PHONY: jaxws jaxws-build jaxws-clobber
 
--- a/make/jdk-rules.gmk	Tue Mar 15 19:52:42 2011 -0400
+++ b/make/jdk-rules.gmk	Tue Mar 15 20:00:45 2011 -0400
@@ -75,16 +75,16 @@
 
 jdk: jdk-build
 jdk-build:
-	@$(call MakeStart, jdk, $(JDK_BUILD_TARGETS))
+	@$(call MakeStart,jdk,$(JDK_BUILD_TARGETS))
 	( $(CD) $(JDK_TOPDIR)/make && \
 	  $(MAKE) $(JDK_BUILD_TARGETS) $(JDK_BUILD_ARGUMENTS) ; )
-	@$(call MakeFinish, jdk, $(JDK_BUILD_TARGETS))
+	@$(call MakeFinish,jdk,$(JDK_BUILD_TARGETS))
 
 jdk-clobber::
-	@$(call MakeStart, jdk, $(JDK_CLOBBER_TARGETS))
+	@$(call MakeStart,jdk,$(JDK_CLOBBER_TARGETS))
 	( $(CD) $(JDK_TOPDIR)/make && \
 	  $(MAKE) $(JDK_CLOBBER_TARGETS) $(JDK_BUILD_ARGUMENTS) ; )
-	@$(call MakeFinish, jdk, $(JDK_CLOBBER_TARGETS))
+	@$(call MakeFinish,jdk,$(JDK_CLOBBER_TARGETS))
 
 jdk-sanity::
 	( $(CD) $(JDK_TOPDIR)/make && \
@@ -92,17 +92,17 @@
 
 compare-images: compare-image
 compare-image:
-	@$(call MakeStart, jdk, compare-image)
+	@$(call MakeStart,jdk,compare-image)
 	( $(CD) $(JDK_TOPDIR)/make && \
 	  $(MAKE) ALT_OUTPUTDIR=$(ABS_OUTPUTDIR) compare-image )
-	@$(call MakeFinish, jdk, compare-image)
+	@$(call MakeFinish,jdk,compare-image)
 
 compare-images-clobber: compare-image-clobber
 compare-image-clobber:
-	@$(call MakeStart, jdk, compare-image-clobber)
+	@$(call MakeStart,jdk,compare-image-clobber)
 	( $(CD) $(JDK_TOPDIR)/make && \
 	  $(MAKE) ALT_OUTPUTDIR=$(ABS_OUTPUTDIR) compare-image-clobber )
-	@$(call MakeFinish, jdk, compare-image-clobber)
+	@$(call MakeFinish,jdk,compare-image-clobber)
 
 .PHONY: jdk jdk-build jdk-clobber jdk-sanity 
 
--- a/make/langtools-rules.gmk	Tue Mar 15 19:52:42 2011 -0400
+++ b/make/langtools-rules.gmk	Tue Mar 15 20:00:45 2011 -0400
@@ -35,17 +35,17 @@
 langtools: langtools-build
 langtools-build:
 	$(MKDIR) -p $(LANGTOOLS_OUTPUTDIR)
-	@$(call MakeStart, langtools, all)
+	@$(call MakeStart,langtools,all)
 	($(CD) $(LANGTOOLS_TOPDIR)/make && \
 	  $(MAKE) $(LANGTOOLS_BUILD_ARGUMENTS) all)
-	@$(call MakeFinish, langtools, all)
+	@$(call MakeFinish,langtools,all)
 
 langtools-clobber::
 	$(MKDIR) -p $(LANGTOOLS_OUTPUTDIR)
-	@$(call MakeStart, langtools, clobber)
+	@$(call MakeStart,langtools,clobber)
 	($(CD) $(LANGTOOLS_TOPDIR)/make &&  \
 	  $(MAKE) $(LANGTOOLS_BUILD_ARGUMENTS) clobber)
-	@$(call MakeFinish, langtools, clobber)
+	@$(call MakeFinish,langtools,clobber)
 
 .PHONY: langtools langtools-build langtools-clobber
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/scripts/webrev.ksh	Tue Mar 15 20:00:45 2011 -0400
@@ -0,0 +1,3182 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+# Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
+# Use is subject to license terms.
+#
+# This script takes a file list and a workspace and builds a set of html files
+# suitable for doing a code review of source changes via a web page.
+# Documentation is available via 'webrev -h'.
+#
+
+WEBREV_UPDATED=23.18-hg
+
+HTML='<?xml version="1.0"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\n'
+
+FRAMEHTML='<?xml version="1.0"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
+    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\n'
+
+STDHEAD='<meta http-equiv="cache-control" content="no-cache" />
+<meta http-equiv="Pragma" content="no-cache" />
+<meta http-equiv="Expires" content="-1" />
+<!--
+   Note to customizers: the body of the webrev is IDed as SUNWwebrev
+   to allow easy overriding by users of webrev via the userContent.css
+   mechanism available in some browsers.
+
+   For example, to have all "removed" information be red instead of
+   brown, set a rule in your userContent.css file like:
+
+       body#SUNWwebrev span.removed { color: red ! important; }
+-->
+<style type="text/css" media="screen">
+body {
+    background-color: #eeeeee;
+}
+hr {
+    border: none 0;
+    border-top: 1px solid #aaa;
+    height: 1px;
+}
+div.summary {
+    font-size: .8em;
+    border-bottom: 1px solid #aaa;
+    padding-left: 1em;
+    padding-right: 1em;
+}
+div.summary h2 {
+    margin-bottom: 0.3em;
+}
+div.summary table th {
+    text-align: right;
+    vertical-align: top;
+    white-space: nowrap;
+}
+span.lineschanged {
+    font-size: 0.7em;
+}
+span.oldmarker {
+    color: red;
+    font-size: large;
+    font-weight: bold;
+}
+span.newmarker {
+    color: green;
+    font-size: large;
+    font-weight: bold;
+}
+span.removed {
+    color: brown;
+}
+span.changed {
+    color: blue;
+}
+span.new {
+    color: blue;
+    font-weight: bold;
+}
+a.print { font-size: x-small; }
+
+</style>
+
+<style type="text/css" media="print">
+pre { font-size: 0.8em; font-family: courier, monospace; }
+span.removed { color: #444; font-style: italic }
+span.changed { font-weight: bold; }
+span.new { font-weight: bold; }
+span.newmarker { font-size: 1.2em; font-weight: bold; }
+span.oldmarker { font-size: 1.2em; font-weight: bold; }
+a.print {display: none}
+hr { border: none 0; border-top: 1px solid #aaa; height: 1px; }
+</style>
+'
+
+#
+# UDiffs need a slightly different CSS rule for 'new' items (we don't
+# want them to be bolded as we do in cdiffs or sdiffs).
+#
+UDIFFCSS='
+<style type="text/css" media="screen">
+span.new {
+    color: blue;
+    font-weight: normal;
+}
+</style>
+'
+
+#
+# input_cmd | html_quote | output_cmd
+# or
+# html_quote filename | output_cmd
+#
+# Make a piece of source code safe for display in an HTML <pre> block.
+#
+html_quote()
+{
+	sed -e "s/&/\&amp;/g" -e "s/</\&lt;/g" -e "s/>/\&gt;/g" "$@" | expand
+}
+
+#
+# input_cmd | bug2url | output_cmd
+#
+# Scan for bugids and insert <a> links to the relevent bug database.
+#
+bug2url()
+{
+	sed -e 's|[0-9]\{5,\}|<a href=\"'$BUGURL'&\">&</a>|g'
+}
+
+#
+# input_cmd | sac2url | output_cmd
+#
+# Scan for ARC cases and insert <a> links to the relevent SAC database.
+# This is slightly complicated because inside the SWAN, SAC cases are
+# grouped by ARC: PSARC/2006/123.  But on OpenSolaris.org, they are
+# referenced as 2006/123 (without labelling the ARC).
+#
+sac2url()
+{
+	if [[ -z $Oflag ]]; then
+	    sed -e 's|\([A-Z]\{1,2\}ARC\)[ /]\([0-9]\{4\}\)/\([0-9]\{3\}\)|<a href=\"'$SACURL'\1/\2/\3\">\1 \2/\3</a>|g'
+	else
+	    sed -e 's|\([A-Z]\{1,2\}ARC\)[ /]\([0-9]\{4\}\)/\([0-9]\{3\}\)|<a href=\"'$SACURL'/\2/\3\">\1 \2/\3</a>|g'
+	fi
+}
+
+#
+# strip_unchanged <infile> | output_cmd
+#
+# Removes chunks of sdiff documents that have not changed. This makes it
+# easier for a code reviewer to find the bits that have changed.
+#
+# Deleted lines of text are replaced by a horizontal rule. Some
+# identical lines are retained before and after the changed lines to
+# provide some context.  The number of these lines is controlled by the
+# variable C in the $AWK script below.
+#
+# The script detects changed lines as any line that has a "<span class="
+# string embedded (unchanged lines have no particular class and are not
+# part of a <span>).  Blank lines (without a sequence number) are also
+# detected since they flag lines that have been inserted or deleted.
+#
+strip_unchanged()
+{
+	$AWK '
+	BEGIN	{ C = c = 20 }
+	NF == 0 || /span class=/ {
+		if (c > C) {
+			c -= C
+			inx = 0
+			if (c > C) {
+				print "\n</pre><hr></hr><pre>"
+				inx = c % C
+				c = C
+			}
+
+			for (i = 0; i < c; i++)
+				print ln[(inx + i) % C]
+		}
+		c = 0;
+		print
+		next
+	}
+	{	if (c >= C) {
+			ln[c % C] = $0
+			c++;
+			next;
+		}
+		c++;
+		print
+	}
+	END	{ if (c > (C * 2)) print "\n</pre><hr></hr>" }
+
+	' $1
+}
+
+#
+# sdiff_to_html
+#
+# This function takes two files as arguments, obtains their diff, and
+# processes the diff output to present the files as an HTML document with
+# the files displayed side-by-side, differences shown in color.  It also
+# takes a delta comment, rendered as an HTML snippet, as the third
+# argument.  The function takes two files as arguments, then the name of
+# file, the path, and the comment.  The HTML will be delivered on stdout,
+# e.g.
+#
+#   $ sdiff_to_html old/usr/src/tools/scripts/webrev.sh \
+#         new/usr/src/tools/scripts/webrev.sh \
+#         webrev.sh usr/src/tools/scripts \
+#         '<a href="http://monaco.sfbay.sun.com/detail.jsp?cr=1234567">
+#          1234567</a> my bugid' > <file>.html
+#
+# framed_sdiff() is then called which creates $2.frames.html
+# in the webrev tree.
+#
+# FYI: This function is rather unusual in its use of awk.  The initial
+# diff run produces conventional diff output showing changed lines mixed
+# with editing codes.  The changed lines are ignored - we're interested in
+# the editing codes, e.g.
+#
+#      8c8
+#      57a61
+#      63c66,76
+#      68,93d80
+#      106d90
+#      108,110d91
+#
+#  These editing codes are parsed by the awk script and used to generate
+#  another awk script that generates HTML, e.g the above lines would turn
+#  into something like this:
+#
+#      BEGIN { printf "<pre>\n" }
+#      function sp(n) {for (i=0;i<n;i++)printf "\n"}
+#      function wl(n) {printf "<font color=%s>%4d %s </font>\n", n, NR, $0}
+#      NR==8           {wl("#7A7ADD");next}
+#      NR==54          {wl("#7A7ADD");sp(3);next}
+#      NR==56          {wl("#7A7ADD");next}
+#      NR==57          {wl("black");printf "\n"; next}
+#        :               :
+#
+#  This script is then run on the original source file to generate the
+#  HTML that corresponds to the source file.
+#
+#  The two HTML files are then combined into a single piece of HTML that
+#  uses an HTML table construct to present the files side by side.  You'll
+#  notice that the changes are color-coded:
+#
+#   black     - unchanged lines
+#   blue      - changed lines
+#   bold blue - new lines
+#   brown     - deleted lines
+#
+#  Blank lines are inserted in each file to keep unchanged lines in sync
+#  (side-by-side).  This format is familiar to users of sdiff(1) or
+#  Teamware's filemerge tool.
+#
+sdiff_to_html()
+{
+	diff -b $1 $2 > /tmp/$$.diffs
+
+	TNAME=$3
+	TPATH=$4
+	COMMENT=$5
+
+	#
+	#  Now we have the diffs, generate the HTML for the old file.
+	#
+	$AWK '
+	BEGIN	{
+		printf "function sp(n) {for (i=0;i<n;i++)printf \"\\n\"}\n"
+		printf "function removed() "
+		printf "{printf \"<span class=\\\"removed\\\">%%4d %%s</span>\\n\", NR, $0}\n"
+		printf "function changed() "
+		printf "{printf \"<span class=\\\"changed\\\">%%4d %%s</span>\\n\", NR, $0}\n"
+		printf "function bl() {printf \"%%4d %%s\\n\", NR, $0}\n"
+}
+	/^</	{next}
+	/^>/	{next}
+	/^---/	{next}
+
+	{
+	split($1, a, /[cad]/) ;
+	if (index($1, "a")) {
+		if (a[1] == 0) {
+			n = split(a[2], r, /,/);
+			if (n == 1)
+				printf "BEGIN\t\t{sp(1)}\n"
+			else
+				printf "BEGIN\t\t{sp(%d)}\n",\
+				(r[2] - r[1]) + 1
+			next
+		}
+
+		printf "NR==%s\t\t{", a[1]
+		n = split(a[2], r, /,/);
+		s = r[1];
+		if (n == 1)
+			printf "bl();printf \"\\n\"; next}\n"
+		else {
+			n = r[2] - r[1]
+			printf "bl();sp(%d);next}\n",\
+			(r[2] - r[1]) + 1
+		}
+		next
+	}
+	if (index($1, "d")) {
+		n = split(a[1], r, /,/);
+		n1 = r[1]
+		n2 = r[2]
+		if (n == 1)
+			printf "NR==%s\t\t{removed(); next}\n" , n1
+		else
+			printf "NR==%s,NR==%s\t{removed(); next}\n" , n1, n2
+		next
+	}
+	if (index($1, "c")) {
+		n = split(a[1], r, /,/);
+		n1 = r[1]
+		n2 = r[2]
+		final = n2
+		d1 = 0
+		if (n == 1)
+			printf "NR==%s\t\t{changed();" , n1
+		else {
+			d1 = n2 - n1
+			printf "NR==%s,NR==%s\t{changed();" , n1, n2
+		}
+		m = split(a[2], r, /,/);
+		n1 = r[1]
+		n2 = r[2]
+		if (m > 1) {
+			d2  = n2 - n1
+			if (d2 > d1) {
+				if (n > 1) printf "if (NR==%d)", final
+				printf "sp(%d);", d2 - d1
+			}
+		}
+		printf "next}\n" ;
+
+		next
+	}
+	}
+
+	END	{ printf "{printf \"%%4d %%s\\n\", NR, $0 }\n" }
+	' /tmp/$$.diffs > /tmp/$$.file1
+
+	#
+	#  Now generate the HTML for the new file
+	#
+	$AWK '
+	BEGIN	{
+		printf "function sp(n) {for (i=0;i<n;i++)printf \"\\n\"}\n"
+		printf "function new() "
+		printf "{printf \"<span class=\\\"new\\\">%%4d %%s</span>\\n\", NR, $0}\n"
+		printf "function changed() "
+		printf "{printf \"<span class=\\\"changed\\\">%%4d %%s</span>\\n\", NR, $0}\n"
+		printf "function bl() {printf \"%%4d %%s\\n\", NR, $0}\n"
+	}
+
+	/^</	{next}
+	/^>/	{next}
+	/^---/	{next}
+
+	{
+	split($1, a, /[cad]/) ;
+	if (index($1, "d")) {
+		if (a[2] == 0) {
+			n = split(a[1], r, /,/);
+			if (n == 1)
+				printf "BEGIN\t\t{sp(1)}\n"
+			else
+				printf "BEGIN\t\t{sp(%d)}\n",\
+				(r[2] - r[1]) + 1
+			next
+		}
+
+		printf "NR==%s\t\t{", a[2]
+		n = split(a[1], r, /,/);
+		s = r[1];
+		if (n == 1)
+			printf "bl();printf \"\\n\"; next}\n"
+		else {
+			n = r[2] - r[1]
+			printf "bl();sp(%d);next}\n",\
+			(r[2] - r[1]) + 1
+		}
+		next
+	}
+	if (index($1, "a")) {
+		n = split(a[2], r, /,/);
+		n1 = r[1]
+		n2 = r[2]
+		if (n == 1)
+			printf "NR==%s\t\t{new() ; next}\n" , n1
+		else
+			printf "NR==%s,NR==%s\t{new() ; next}\n" , n1, n2
+		next
+	}
+	if (index($1, "c")) {
+		n = split(a[2], r, /,/);
+		n1 = r[1]
+		n2 = r[2]
+		final = n2
+		d2 = 0;
+		if (n == 1) {
+			final = n1
+			printf "NR==%s\t\t{changed();" , n1
+		} else {
+			d2 = n2 - n1
+			printf "NR==%s,NR==%s\t{changed();" , n1, n2
+		}
+		m = split(a[1], r, /,/);
+		n1 = r[1]
+		n2 = r[2]
+		if (m > 1) {
+			d1  = n2 - n1
+			if (d1 > d2) {
+				if (n > 1) printf "if (NR==%d)", final
+				printf "sp(%d);", d1 - d2
+			}
+		}
+		printf "next}\n" ;
+		next
+	}
+	}
+	END	{ printf "{printf \"%%4d %%s\\n\", NR, $0 }\n" }
+	' /tmp/$$.diffs > /tmp/$$.file2
+
+	#
+	# Post-process the HTML files by running them back through $AWK
+	#
+	html_quote < $1 | $AWK -f /tmp/$$.file1 > /tmp/$$.file1.html
+
+	html_quote < $2 | $AWK -f /tmp/$$.file2 > /tmp/$$.file2.html
+
+	#
+	# Now combine into a valid HTML file and side-by-side into a table
+	#
+	print "$HTML<head>$STDHEAD"
+	print "<title>$WNAME Sdiff $TPATH </title>"
+	print "</head><body id=\"SUNWwebrev\">"
+	print "<h2>$TPATH/$TNAME</h2>"
+        print "<a class=\"print\" href=\"javascript:print()\">Print this page</a>"
+	print "<pre>$COMMENT</pre>\n"
+	print "<table><tr valign=\"top\">"
+	print "<td><pre>"
+
+	strip_unchanged /tmp/$$.file1.html
+
+	print "</pre></td><td><pre>"
+
+	strip_unchanged /tmp/$$.file2.html
+
+	print "</pre></td>"
+	print "</tr></table>"
+	print "</body></html>"
+
+	framed_sdiff $TNAME $TPATH /tmp/$$.file1.html /tmp/$$.file2.html \
+	    "$COMMENT"
+}
+
+
+#
+# framed_sdiff <filename> <filepath> <lhsfile> <rhsfile> <comment>
+#
+# Expects lefthand and righthand side html files created by sdiff_to_html.
+# We use insert_anchors() to augment those with HTML navigation anchors,
+# and then emit the main frame.  Content is placed into:
+#
+#    $WDIR/DIR/$TNAME.lhs.html
+#    $WDIR/DIR/$TNAME.rhs.html
+#    $WDIR/DIR/$TNAME.frames.html
+#
+# NOTE: We rely on standard usage of $WDIR and $DIR.
+#
+function framed_sdiff
+{
+	typeset TNAME=$1
+	typeset TPATH=$2
+	typeset lhsfile=$3
+	typeset rhsfile=$4
+	typeset comments=$5
+	typeset RTOP
+
+	# Enable html files to access WDIR via a relative path.
+	RTOP=$(relative_dir $TPATH $WDIR)
+
+	# Make the rhs/lhs files and output the frameset file.
+	print "$HTML<head>$STDHEAD" > $WDIR/$DIR/$TNAME.lhs.html
+
+	cat >> $WDIR/$DIR/$TNAME.lhs.html <<-EOF
+	    <script type="text/javascript" src="$RTOP/ancnav.js"></script>
+	    </head>
+	    <body id="SUNWwebrev" onkeypress="keypress(event);">
+	    <a name="0"></a>
+	    <pre>$comments</pre><hr></hr>
+	EOF
+
+	cp $WDIR/$DIR/$TNAME.lhs.html $WDIR/$DIR/$TNAME.rhs.html
+
+	insert_anchors $lhsfile >> $WDIR/$DIR/$TNAME.lhs.html
+	insert_anchors $rhsfile >> $WDIR/$DIR/$TNAME.rhs.html
+
+	close='</body></html>'
+
+	print $close >> $WDIR/$DIR/$TNAME.lhs.html
+	print $close >> $WDIR/$DIR/$TNAME.rhs.html
+
+	print "$FRAMEHTML<head>$STDHEAD" > $WDIR/$DIR/$TNAME.frames.html
+	print "<title>$WNAME Framed-Sdiff " \
+	    "$TPATH/$TNAME</title> </head>" >> $WDIR/$DIR/$TNAME.frames.html
+	cat >> $WDIR/$DIR/$TNAME.frames.html <<-EOF
+	  <frameset rows="*,60">
+	    <frameset cols="50%,50%">
+	      <frame src="$TNAME.lhs.html" scrolling="auto" name="lhs" />
+	      <frame src="$TNAME.rhs.html" scrolling="auto" name="rhs" />
+	    </frameset>
+	  <frame src="$RTOP/ancnav.html" scrolling="no" marginwidth="0"
+	   marginheight="0" name="nav" />
+	  <noframes>
+            <body id="SUNWwebrev">
+	      Alas 'frames' webrev requires that your browser supports frames
+	      and has the feature enabled.
+            </body>
+	  </noframes>
+	  </frameset>
+	</html>
+	EOF
+}
+
+
+#
+# fix_postscript
+#
+# Merge codereview output files to a single conforming postscript file, by:
+# 	- removing all extraneous headers/trailers
+#	- making the page numbers right
+#	- removing pages devoid of contents which confuse some
+#	  postscript readers.
+#
+# From Casper.
+#
+function fix_postscript
+{
+	infile=$1
+
+	cat > /tmp/$$.crmerge.pl << \EOF
+
+	print scalar(<>);		# %!PS-Adobe---
+	print "%%Orientation: Landscape\n";
+
+	$pno = 0;
+	$doprint = 1;
+
+	$page = "";
+
+	while (<>) {
+		next if (/^%%Pages:\s*\d+/);
+
+		if (/^%%Page:/) {
+			if ($pno == 0 || $page =~ /\)S/) {
+				# Header or single page containing text
+				print "%%Page: ? $pno\n" if ($pno > 0);
+				print $page;
+				$pno++;
+			} else {
+				# Empty page, skip it.
+			}
+			$page = "";
+			$doprint = 1;
+			next;
+		}
+
+		# Skip from %%Trailer of one document to Endprolog
+		# %%Page of the next
+		$doprint = 0 if (/^%%Trailer/);
+		$page .= $_ if ($doprint);
+	}
+
+	if ($page =~ /\)S/) {
+		print "%%Page: ? $pno\n";
+		print $page;
+	} else {
+		$pno--;
+	}
+	print "%%Trailer\n%%Pages: $pno\n";
+EOF
+
+	$PERL /tmp/$$.crmerge.pl < $infile
+}
+
+
+#
+# input_cmd | insert_anchors | output_cmd
+#
+# Flag blocks of difference with sequentially numbered invisible
+# anchors.  These are used to drive the frames version of the
+# sdiffs output.
+#
+# NOTE: Anchor zero flags the top of the file irrespective of changes,
+# an additional anchor is also appended to flag the bottom.
+#
+# The script detects changed lines as any line that has a "<span
+# class=" string embedded (unchanged lines have no class set and are
+# not part of a <span>.  Blank lines (without a sequence number)
+# are also detected since they flag lines that have been inserted or
+# deleted.
+#
+function insert_anchors
+{
+	$AWK '
+	function ia() {
+		# This should be able to be a singleton <a /> but that
+		# seems to trigger a bug in firefox a:hover rule processing
+		printf "<a name=\"%d\" id=\"anc%d\"></a>", anc, anc++;
+	}
+
+	BEGIN {
+		anc=1;
+		inblock=1;
+		printf "<pre>\n";
+	}
+	NF == 0 || /^<span class=/ {
+		if (inblock == 0) {
+			ia();
+			inblock=1;
+		}
+		print;
+		next;
+	}
+	{
+		inblock=0;
+		print;
+	}
+	END {
+		ia();
+
+		printf "<b style=\"font-size: large; color: red\">";
+		printf "--- EOF ---</b>"
+        	for(i=0;i<8;i++) printf "\n\n\n\n\n\n\n\n\n\n";
+		printf "</pre>"
+		printf "<form name=\"eof\">";
+		printf "<input name=\"value\" value=\"%d\" type=\"hidden\" />",
+		    anc - 1;
+		printf "</form>";
+	}
+	' $1
+}
+
+
+#
+# relative_dir
+#
+# Print a relative return path from $1 to $2.  For example if
+# $1=/tmp/myreview/raw_files/usr/src/tools/scripts and $2=/tmp/myreview,
+# this function would print "../../../../".
+#
+# In the event that $1 is not in $2 a warning is printed to stderr,
+# and $2 is returned-- the result of this is that the resulting webrev
+# is not relocatable.
+#
+function relative_dir
+{
+    d1=$1
+    d2=$2
+    if [[ "$d1" == "." ]]; then
+	print "."
+    else
+	typeset cur="${d1##$d2?(/)}"
+	typeset ret=""
+	if [[ $d2 == $cur ]]; then   # Should never happen.
+		# Should never happen.
+		print -u2 "\nWARNING: relative_dir: \"$1\" not relative "
+		print -u2 "to \"$2\".  Check input paths.  Framed webrev "
+		print -u2 "will not be relocatable!"
+		print $2
+		return
+	fi
+
+	while [[ -n ${cur} ]];
+	do
+		cur=${cur%%*(/)*([!/])}
+		if [[ -z $ret ]]; then
+			ret=".."
+		else
+			ret="../$ret"
+		fi
+	done
+	print $ret
+    fi
+}
+
+
+#
+# frame_nav_js
+#
+# Emit javascript for frame navigation
+#
+function frame_nav_js
+{
+cat << \EOF
+var myInt;
+var scrolling=0;
+var sfactor = 3;
+var scount=10;
+
+function scrollByPix() {
+	if (scount<=0) {
+		sfactor*=1.2;
+		scount=10;
+	}
+	parent.lhs.scrollBy(0,sfactor);
+	parent.rhs.scrollBy(0,sfactor);
+	scount--;
+}
+
+function scrollToAnc(num) {
+
+	// Update the value of the anchor in the form which we use as
+	// storage for this value.  setAncValue() will take care of
+	// correcting for overflow and underflow of the value and return
+	// us the new value.
+	num = setAncValue(num);
+
+	// Set location and scroll back a little to expose previous
+	// lines.
+	//
+	// Note that this could be improved: it is possible although
+	// complex to compute the x and y position of an anchor, and to
+	// scroll to that location directly.
+	//
+	parent.lhs.location.replace(parent.lhs.location.pathname + "#" + num);
+	parent.rhs.location.replace(parent.rhs.location.pathname + "#" + num);
+
+	parent.lhs.scrollBy(0,-30);
+	parent.rhs.scrollBy(0,-30);
+}
+
+function getAncValue()
+{
+	return (parseInt(parent.nav.document.diff.real.value));
+}
+
+function setAncValue(val)
+{
+	if (val <= 0) {
+		val = 0;
+		parent.nav.document.diff.real.value = val;
+		parent.nav.document.diff.display.value = "BOF";
+		return (val);
+	}
+
+	//
+	// The way we compute the max anchor value is to stash it
+	// inline in the left and right hand side pages-- it's the same
+	// on each side, so we pluck from the left.
+	//
+	maxval = parent.lhs.document.eof.value.value;
+	if (val < maxval) {
+		parent.nav.document.diff.real.value = val;
+		parent.nav.document.diff.display.value = val.toString();
+		return (val);
+	}
+
+	// this must be: val >= maxval
+	val = maxval;
+	parent.nav.document.diff.real.value = val;
+	parent.nav.document.diff.display.value = "EOF";
+	return (val);
+}
+
+function stopScroll() {
+	if (scrolling==1) {
+		clearInterval(myInt);
+		scrolling=0;
+	}
+}
+
+function startScroll() {
+	stopScroll();
+	scrolling=1;
+	myInt=setInterval("scrollByPix()",10);
+}
+
+function handlePress(b) {
+
+	switch (b) {
+	    case 1 :
+		scrollToAnc(-1);
+		break;
+	    case 2 :
+		scrollToAnc(getAncValue() - 1);
+		break;
+	    case 3 :
+		sfactor=-3;
+		startScroll();
+		break;
+	    case 4 :
+		sfactor=3;
+		startScroll();
+		break;
+	    case 5 :
+		scrollToAnc(getAncValue() + 1);
+		break;
+	    case 6 :
+		scrollToAnc(999999);
+		break;
+	}
+}
+
+function handleRelease(b) {
+	stopScroll();
+}
+
+function keypress(ev) {
+	var keynum;
+	var keychar;
+
+	if (window.event) { // IE
+		keynum = ev.keyCode;
+	} else if (ev.which) { // non-IE
+		keynum = ev.which;
+	}
+
+	keychar = String.fromCharCode(keynum);
+
+	if (keychar == "k") {
+		handlePress(2);
+		return (0);
+	} else if (keychar == "j" || keychar == " ") {
+		handlePress(5);
+		return (0);
+	}
+	return (1);
+}
+
+function ValidateDiffNum(){
+	val = parent.nav.document.diff.display.value;
+	if (val == "EOF") {
+		scrollToAnc(999999);
+		return;
+	}
+
+	if (val == "BOF") {
+		scrollToAnc(0);
+		return;
+	}
+
+        i=parseInt(val);
+        if (isNaN(i)) {
+                parent.nav.document.diff.display.value = getAncValue();
+        } else {
+                scrollToAnc(i);
+        }
+        return false;
+}
+
+EOF
+}
+
+#
+# frame_navigation
+#
+# Output anchor navigation file for framed sdiffs.
+#
+function frame_navigation
+{
+	print "$HTML<head>$STDHEAD"
+
+	cat << \EOF
+<title>Anchor Navigation</title>
+<meta http-equiv="Content-Script-Type" content="text/javascript" />
+<meta http-equiv="Content-Type" content="text/html" />
+
+<style type="text/css">
+    div.button td { padding-left: 5px; padding-right: 5px;
+		    background-color: #eee; text-align: center;
+		    border: 1px #444 outset; cursor: pointer; }
+    div.button a { font-weight: bold; color: black }
+    div.button td:hover { background: #ffcc99; }
+</style>
+EOF
+
+	print "<script type=\"text/javascript\" src=\"ancnav.js\"></script>"
+
+	cat << \EOF
+</head>
+<body id="SUNWwebrev" bgcolor="#eeeeee" onload="document.diff.real.focus();"
+	onkeypress="keypress(event);">
+    <noscript lang="javascript">
+      <center>
+	<p><big>Framed Navigation controls require Javascript</big><br />
+	Either this browser is incompatable or javascript is not enabled</p>
+      </center>
+    </noscript>
+    <table width="100%" border="0" align="center">
+	<tr>
+          <td valign="middle" width="25%">Diff navigation:
+          Use 'j' and 'k' for next and previous diffs; or use buttons
+          at right</td>
+	  <td align="center" valign="top" width="50%">
+	    <div class="button">
+	      <table border="0" align="center">
+                  <tr>
+		    <td>
+		      <a onMouseDown="handlePress(1);return true;"
+			 onMouseUp="handleRelease(1);return true;"
+			 onMouseOut="handleRelease(1);return true;"
+			 onClick="return false;"
+			 title="Go to Beginning Of file">BOF</a></td>
+		    <td>
+		      <a onMouseDown="handlePress(3);return true;"
+			 onMouseUp="handleRelease(3);return true;"
+			 onMouseOut="handleRelease(3);return true;"
+			 title="Scroll Up: Press and Hold to accelerate"
+			 onClick="return false;">Scroll Up</a></td>
+		    <td>
+		      <a onMouseDown="handlePress(2);return true;"
+			 onMouseUp="handleRelease(2);return true;"
+			 onMouseOut="handleRelease(2);return true;"
+			 title="Go to previous Diff"
+			 onClick="return false;">Prev Diff</a>
+		    </td></tr>
+
+		  <tr>
+		    <td>
+		      <a onMouseDown="handlePress(6);return true;"
+			 onMouseUp="handleRelease(6);return true;"
+			 onMouseOut="handleRelease(6);return true;"
+			 onClick="return false;"
+			 title="Go to End Of File">EOF</a></td>
+		    <td>
+		      <a onMouseDown="handlePress(4);return true;"
+			 onMouseUp="handleRelease(4);return true;"
+			 onMouseOut="handleRelease(4);return true;"
+			 title="Scroll Down: Press and Hold to accelerate"
+			 onClick="return false;">Scroll Down</a></td>
+		    <td>
+		      <a onMouseDown="handlePress(5);return true;"
+			 onMouseUp="handleRelease(5);return true;"
+			 onMouseOut="handleRelease(5);return true;"
+			 title="Go to next Diff"
+			 onClick="return false;">Next Diff</a></td>
+		  </tr>
+              </table>
+	    </div>
+	  </td>
+	  <th valign="middle" width="25%">
+	    <form action="" name="diff" onsubmit="return ValidateDiffNum();">
+		<input name="display" value="BOF" size="8" type="text" />
+		<input name="real" value="0" size="8" type="hidden" />
+	    </form>
+	  </th>
+	</tr>
+    </table>
+  </body>
+</html>
+EOF
+}
+
+
+
+#
+# diff_to_html <filename> <filepath> { U | C } <comment>
+#
+# Processes the output of diff to produce an HTML file representing either
+# context or unified diffs.
+#
+diff_to_html()
+{
+	TNAME=$1
+	TPATH=$2
+	DIFFTYPE=$3
+	COMMENT=$4
+
+	print "$HTML<head>$STDHEAD"
+	print "<title>$WNAME ${DIFFTYPE}diff $TPATH</title>"
+
+	if [[ $DIFFTYPE == "U" ]]; then
+		print "$UDIFFCSS"
+	fi
+
+	cat <<-EOF
+	</head>
+	<body id="SUNWwebrev">
+	<h2>$TPATH</h2>
+        <a class="print" href="javascript:print()">Print this page</a>
+	<pre>$COMMENT</pre>
+        <pre>
+EOF
+
+	html_quote | $AWK '
+	/^--- new/	{ next }
+	/^\+\+\+ new/	{ next }
+	/^--- old/	{ next }
+	/^\*\*\* old/	{ next }
+	/^\*\*\*\*/	{ next }
+	/^-------/	{ printf "<center><h1>%s</h1></center>\n", $0; next }
+	/^\@\@.*\@\@$/	{ printf "</pre><hr /><pre>\n";
+			  printf "<span class=\"newmarker\">%s</span>\n", $0;
+			  next}
+
+	/^\*\*\*/	{ printf "<hr /><span class=\"oldmarker\">%s</span>\n", $0;
+			  next}
+	/^---/		{ printf "<span class=\"newmarker\">%s</span>\n", $0;
+			  next}
+	/^\+/		{printf "<span class=\"new\">%s</span>\n", $0; next}
+	/^!/		{printf "<span class=\"changed\">%s</span>\n", $0; next}
+	/^-/		{printf "<span class=\"removed\">%s</span>\n", $0; next}
+			{printf "%s\n", $0; next}
+	'
+
+	print "</pre></body></html>\n"
+}
+
+
+#
+# source_to_html { new | old } <filename>
+#
+# Process a plain vanilla source file to transform it into an HTML file.
+#
+source_to_html()
+{
+	WHICH=$1
+	TNAME=$2
+
+	print "$HTML<head>$STDHEAD"
+	print "<title>$WHICH $TNAME</title>"
+	print "<body id=\"SUNWwebrev\">"
+	print "<pre>"
+	html_quote | $AWK '{line += 1 ; printf "%4d %s\n", line, $0 }'
+	print "</pre></body></html>"
+}
+
+#
+# teamwarecomments {text|html} parent-file child-file
+#
+# Find the first delta in the child that's not in the parent.  Get the
+# newest delta from the parent, get all deltas from the child starting
+# with that delta, and then get all info starting with the second oldest
+# delta in that list (the first delta unique to the child).
+#
+# This code adapted from Bill Shannon's "spc" script
+#
+comments_from_teamware()
+{
+	fmt=$1
+	pfile=$PWS/$2
+	cfile=$CWS/$3
+
+	psid=$($SCCS prs -d:I: $pfile 2>/dev/null)
+	if [[ -z "$psid" ]]; then
+	    psid=1.1
+	fi
+
+	set -A sids $($SCCS prs -l -r$psid -d:I: $cfile 2>/dev/null)
+	N=${#sids[@]}
+
+	nawkprg='
+		/^COMMENTS:/	{p=1; next}
+		/^D [0-9]+\.[0-9]+/ {printf "--- %s ---\n", $2; p=0; }
+		NF == 0u	{ next }
+		{if (p==0) next; print $0 }'
+
+	if [[ $N -ge 2 ]]; then
+		sid1=${sids[$((N-2))]}	# Gets 2nd to last sid
+
+		if [[ $fmt == "text" ]]; then
+			$SCCS prs -l -r$sid1 $cfile  2>/dev/null | \
+			    $AWK "$nawkprg"
+			return
+		fi
+
+		$SCCS prs -l -r$sid1 $cfile  2>/dev/null | \
+		    html_quote | bug2url | sac2url | $AWK "$nawkprg"
+	fi
+}
+
+#
+# wxcomments {text|html} filepath
+#
+# Given the pathname of a file, find its location in a "wx" active file
+# list and print the following sccs comment.  Output is either text or
+# HTML; if the latter, embedded bugids (sequence of 5 or more digits) are
+# turned into URLs.
+#
+comments_from_wx()
+{
+	typeset fmt=$1
+	typeset p=$2
+
+	comm=`$AWK '
+	$1 == "'$p'" {
+		do getline ; while (NF > 0)
+		getline
+		while (NF > 0) { print ; getline }
+		exit
+	}' < $wxfile`
+
+	if [[ $fmt == "text" ]]; then
+		print "$comm"
+		return
+	fi
+
+	print "$comm" | html_quote | bug2url | sac2url
+}
+
+comments_from_mercurial()
+{
+	fmt=$1
+	pfile=$PWS/$2
+	cfile=$CWS/$3
+
+        logdir=`dirname $cfile`
+        logf=`basename $cfile`
+        if [ -d $logdir ]; then
+            ( cd $logdir;
+	        active=`hg status $logf 2>/dev/null`
+                # If the output from 'hg status' is not empty, it means the file
+                # hasn't been committed, so don't fetch comments.
+	        if [[ -z $active ]] ; then
+                    if [[ -n $ALL_CREV ]]; then
+                        rev_opt=
+                        for rev in $ALL_CREV; do
+                            rev_opt="$rev_opt --rev $rev"
+                        done
+                        comm=`hg log $rev_opt --follow --template 'rev {rev} : {desc}\n' $logf`
+                    elif [[ -n $FIRST_CREV ]]; then
+		        comm=`hg log --rev $FIRST_CREV:tip --follow --template 'rev {rev} : {desc}\n' $logf`
+                    else
+		        comm=`hg log -l1 --follow --template 'rev {rev} : {desc}\n' $logf`
+                    fi
+	        else
+	            comm=""
+	        fi
+	        if [[ $fmt == "text" ]]; then
+	            print "$comm"
+	            return
+	        fi
+	  
+	        print "$comm" | html_quote | bug2url | sac2url
+                )
+        fi
+}
+
+
+#
+# getcomments {text|html} filepath parentpath
+#
+# Fetch the comments depending on what SCM mode we're in.
+#
+getcomments()
+{
+	typeset fmt=$1
+	typeset p=$2
+	typeset pp=$3
+
+	if [[ -n $wxfile ]]; then
+		comments_from_wx $fmt $p
+	else
+		if [[ $SCM_MODE == "teamware" ]]; then
+			comments_from_teamware $fmt $pp $p
+		elif [[ $SCM_MODE == "mercurial" ]]; then
+			comments_from_mercurial $fmt $pp $p
+		fi
+	fi
+}
+
+#
+# printCI <total-changed> <inserted> <deleted> <modified> <unchanged>
+#
+# Print out Code Inspection figures similar to sccs-prt(1) format.
+#
+function printCI
+{
+	integer tot=$1 ins=$2 del=$3 mod=$4 unc=$5
+	typeset str
+	if (( tot == 1 )); then
+		str="line"
+	else
+		str="lines"
+	fi
+	printf '%d %s changed: %d ins; %d del; %d mod; %d unchg' \
+	    $tot $str $ins $del $mod $unc
+}
+
+
+#
+# difflines <oldfile> <newfile>
+#
+# Calculate and emit number of added, removed, modified and unchanged lines,
+# and total lines changed, the sum of added + removed + modified.
+#
+function difflines
+{
+	integer tot mod del ins unc err
+	typeset filename
+
+	eval $( diff -e $1 $2 | $AWK '
+	# Change range of lines: N,Nc
+	/^[0-9]*,[0-9]*c$/ {
+		n=split(substr($1,1,length($1)-1), counts, ",");
+		if (n != 2) {
+		    error=2
+		    exit;
+		}
+		#
+		# 3,5c means lines 3 , 4 and 5 are changed, a total of 3 lines.
+		# following would be 5 - 3 = 2! Hence +1 for correction.
+		#
+		r=(counts[2]-counts[1])+1;
+
+		#
+		# Now count replacement lines: each represents a change instead
+		# of a delete, so increment c and decrement r.
+		#
+		while (getline != /^\.$/) {
+			c++;
+			r--;
+		}
+		#
+		# If there were more replacement lines than original lines,
+		# then r will be negative; in this case there are no deletions,
+		# but there are r changes that should be counted as adds, and
+		# since r is negative, subtract it from a and add it to c.
+		#
+		if (r < 0) {
+			a-=r;
+			c+=r;
+		}
+
+		#
+		# If there were more original lines than replacement lines, then
+		# r will be positive; in this case, increment d by that much.
+		#
+		if (r > 0) {
+			d+=r;
+		}
+		next;
+	}
+
+	# Change lines: Nc
+	/^[0-9].*c$/ {
+		# The first line is a replacement; any more are additions.
+		if (getline != /^\.$/) {
+			c++;
+			while (getline != /^\.$/) a++;
+		}
+		next;
+	}
+
+	# Add lines: both Na and N,Na
+	/^[0-9].*a$/ {
+		while (getline != /^\.$/) a++;
+		next;
+	}
+
+	# Delete range of lines: N,Nd
+	/^[0-9]*,[0-9]*d$/ {
+		n=split(substr($1,1,length($1)-1), counts, ",");
+		if (n != 2) {
+			error=2
+			exit;
+		}
+		#
+		# 3,5d means lines 3 , 4 and 5 are deleted, a total of 3 lines.
+		# following would be 5 - 3 = 2! Hence +1 for correction.
+		#
+		r=(counts[2]-counts[1])+1;
+		d+=r;
+		next;
+	}
+
+	# Delete line: Nd.   For example 10d says line 10 is deleted.
+	/^[0-9]*d$/ {d++; next}
+
+	# Should not get here!
+	{
+		error=1;
+		exit;
+	}
+
+	# Finish off - print results
+	END {
+		printf("tot=%d;mod=%d;del=%d;ins=%d;err=%d\n",
+		    (c+d+a), c, d, a, error);
+	}' )
+
+	# End of $AWK, Check to see if any trouble occurred.
+	if (( $? > 0 || err > 0 )); then
+		print "Unexpected Error occurred reading" \
+		    "\`diff -e $1 $2\`: \$?=$?, err=" $err
+		return
+	fi
+
+	# Accumulate totals
+	(( TOTL += tot ))
+	(( TMOD += mod ))
+	(( TDEL += del ))
+	(( TINS += ins ))
+	# Calculate unchanged lines
+	unc=`wc -l < $1`
+	if (( unc > 0 )); then
+		(( unc -= del + mod ))
+		(( TUNC += unc ))
+	fi
+	# print summary
+	print "<span class=\"lineschanged\">\c"
+	printCI $tot $ins $del $mod $unc
+	print "</span>"
+}
+
+
+#
+# flist_from_wx
+#
+# Sets up webrev to source its information from a wx-formatted file.
+# Sets the global 'wxfile' variable.
+#
+function flist_from_wx
+{
+	typeset argfile=$1
+	if [[ -n ${argfile%%/*} ]]; then
+		#
+		# If the wx file pathname is relative then make it absolute
+		# because the webrev does a "cd" later on.
+		#
+		wxfile=$PWD/$argfile
+	else
+		wxfile=$argfile
+	fi
+
+	$AWK '{ c = 1; print;
+	  while (getline) {
+		if (NF == 0) { c = -c; continue }
+		if (c > 0) print
+	  }
+	}' $wxfile > $FLIST
+
+	print " Done."
+}
+
+#
+# flist_from_teamware [ <args-to-putback-n> ]
+#
+# Generate the file list by extracting file names from a putback -n.  Some
+# names may come from the "update/create" messages and others from the
+# "currently checked out" warning.  Renames are detected here too.  Extract
+# values for CODEMGR_WS and CODEMGR_PARENT from the output of the putback
+# -n as well, but remove them if they are already defined.
+#
+function flist_from_teamware
+{
+	if [[ -n $codemgr_parent ]]; then
+		if [[ ! -d $codemgr_parent/Codemgr_wsdata ]]; then
+			print -u2 "parent $codemgr_parent doesn't look like a" \
+			    "valid teamware workspace"
+			exit 1
+		fi
+		parent_args="-p $codemgr_parent"
+	fi
+
+	print " File list from: 'putback -n $parent_args $*' ... \c"
+
+	putback -n $parent_args $* 2>&1 |
+	    $AWK '
+		/^update:|^create:/	{print $2}
+		/^Parent workspace:/	{printf("CODEMGR_PARENT=%s\n",$3)}
+		/^Child workspace:/	{printf("CODEMGR_WS=%s\n",$3)}
+		/^The following files are currently checked out/ {p = 1; next}
+		NF == 0			{p=0 ; next}
+		/^rename/		{old=$3}
+		$1 == "to:"		{print $2, old}
+		/^"/			{next}
+		p == 1			{print $1}' |
+	    sort -r -k 1,1 -u | sort > $FLIST
+
+	print " Done."
+}
+
+function outgoing_from_mercurial_forest
+{
+    hg foutgoing --template 'rev: {rev}\n' $OUTPWS | $FILTER | $AWK '
+        BEGIN           {ntree=0}
+        /^comparing/    {next}
+        /^no changes/   {next}
+        /^searching/    {next}
+	/^\[.*\]$/	{tree=substr($1,2,length($1)-2);
+                         trees[ntree++] = tree;
+                         revs[tree]=-1;
+                         next}
+        /^rev:/   {rev=$2+0;
+                   if (revs[tree] == -1 || rev < revs[tree])
+                        { revs[tree] = rev; };
+                  next;}
+        END       {for (tree in trees)
+                        { rev=revs[trees[tree]];
+                          if (rev > 0) 
+                                {printf("%s %d\n",trees[tree],rev-1)}
+                        }}' | while read LINE
+    do
+        set - $LINE
+        TREE=$1
+        REV=$2
+        A=`hg -R $CWS/$TREE log --rev $REV --template '{node}'`
+        FSTAT_OPT="--rev $A"
+        print "Revision: $A $REV" >> $FLIST
+        treestatus $TREE
+    done
+}
+
+function flist_from_mercurial_forest
+{
+    rm -f $FLIST
+    if [ -z "$Nflag" ]; then
+	print " File list from hg foutgoing $PWS ..."
+        outgoing_from_mercurial_forest
+        HG_LIST_FROM_COMMIT=1
+    fi
+    if [ ! -f $FLIST ]; then
+        # hg commit hasn't been run see what is lying around
+	print "\n No outgoing, perhaps you haven't commited."
+	print " File list from hg fstatus -mard ...\c"
+        FSTAT_OPT=
+        fstatus
+        HG_LIST_FROM_COMMIT=0
+    fi
+    print " Done."
+}
+
+#
+# Used when dealing with the result of 'hg foutgoing'
+# When now go down the tree and generate the change list
+#
+function treestatus
+{
+    TREE=$1
+    HGCMD="hg -R $CWS/$TREE status $FSTAT_OPT"
+    
+    $HGCMD -mdn 2>/dev/null | $FILTER | while read F
+    do
+        echo $TREE/$F
+    done >> $FLIST
+
+    # Then all the added files
+    # But some of these could have been "moved" or renamed ones
+    # so let's make sure we get the proper info
+    # hg status -aC will produce something like:
+    #	A subdir/File3
+    #	A subdir/File4
+    #	  File4
+    #	A subdir/File5
+    # The first and last are simple addition while the middle one
+    # is a move/rename
+
+    $HGCMD -aC | $FILTER | while read LINE; do
+	ldone=""
+	while [ -z "$ldone" ]; do
+	    ldone="1"
+	    set - $LINE
+	    if [ $# -eq 2 -a "$1" == "A" ]; then
+		AFILE=$2
+		if read LINE2; then
+		    set - $LINE2
+		    if [ $# -eq 1 ]; then
+			echo $TREE/$AFILE $TREE/$1 >>$FLIST
+		    elif [ $# -eq 2 ]; then
+			echo $TREE/$AFILE >>$FLIST
+			LINE=$LINE2
+			ldone=""
+		    fi
+		else
+		    echo $TREE/$AFILE >>$FLIST
+		fi
+	    fi
+	done
+    done
+    $HGCMD -rn | $FILTER | while read RFILE; do
+	grep "$TREE/$RFILE" $FLIST >/dev/null
+	if [ $? -eq 1 ]; then
+	    echo $TREE/$RFILE >>$FLIST
+	fi
+    done
+}
+
+function fstatus
+{
+    #
+    # forest extension is still being changed. For instance the output
+    # of fstatus used to no prepend the tree path to filenames, but
+    # this has changed recently. AWK code below does try to handle both
+    # cases
+    #
+    hg fstatus -mdn $FSTAT_OPT 2>/dev/null | $FILTER | $AWK '
+	/^\[.*\]$/	{tree=substr($1,2,length($1)-2); next}
+	$1 != ""	{n=index($1,tree);
+			 if (n == 0)
+				{ printf("%s/%s\n",tree,$1)}
+			 else
+				{ printf("%s\n",$1)}}' >> $FLIST
+
+    #
+    # There is a bug in the output of fstatus -aC on recent versions: it
+    # inserts a space between the name of the tree and the filename of the
+    # old file. e.g.:
+    #
+    # $ hg fstatus -aC
+    # [.]
+    #
+    # [MyWS]
+    # A MyWS/subdir/File2
+    #  MyWS/ File2
+    #
+    # [MyWS2]
+    #
+
+    hg fstatus -aC $FSTAT_OPT 2>/dev/null | $FILTER | $AWK '
+	/^\[.*\]$/	{tree=substr($1,2,length($1)-2); next}
+	/^A .*/		{n=index($2,tree);
+			 if (n == 0)
+				{ printf("A %s/%s\n",tree,$2)}
+			 else
+				{ printf("A %s\n",$2)}; 
+			 next}
+	/^ /		{n=index($1,tree);
+			 if (n == 0)
+				{ printf("%s/%s\n",tree,$1)}
+			 else
+				{ if (NF == 2)
+					printf("%s/%s\n",tree,$2)
+				  else
+					printf("%s\n",$1)
+				};
+			 next}
+	' | while read LINE; do
+	ldone=""
+	while [ -z "$ldone" ]; do
+	    ldone="1"
+	    set - $LINE
+	    if [ $# -eq 2 -a "$1" == "A" ]; then
+		AFILE=$2
+		if read LINE2; then
+		    set - $LINE2
+		    if [ $# -eq 1 ]; then
+			echo $AFILE $1 >>$FLIST
+		    elif [ $# -eq 2 ]; then
+			echo $AFILE >>$FLIST
+			LINE=$LINE2
+			ldone=""
+		    fi
+		else
+		    echo $AFILE >>$FLIST
+		fi
+	    fi
+	done
+    done
+    hg fstatus -rn $FSTAT_OPT 2>/dev/null | $FILTER | $AWK '
+	/^\[.*\]$/	{tree=substr($1,2,length($1)-2); next}
+	$1 != ""	{n=index($1,tree);
+			 if (n == 0)
+				{ printf("%s/%s\n",tree,$1)}
+			 else
+				{ printf("%s\n",$1)}}' | while read RFILE; do
+	grep "$RFILE" $FLIST >/dev/null
+	if [ $? -eq 1 ]; then
+	    echo $RFILE >>$FLIST
+	fi
+    done
+}
+
+#
+# flist_from_mercurial $PWS
+#
+# Only local file based repositories are supported at present
+# since even though we can determine the list from the parent finding
+# the changes is harder.
+#
+# We first look for any outgoing files, this is for when the user has
+# run hg commit.  If we don't find any then we look with hg status.
+#
+# We need at least one of default-push or default paths set in .hg/hgrc
+# If neither are set we don't know who to compare with.
+
+function flist_from_mercurial 
+{
+#	if [ "${PWS##ssh://}" != "$PWS" -o \
+#	     "${PWS##http://}" != "$PWS" -o \
+#	     "${PWS##https://}" != "$PWS" ]; then
+#		print "Remote Mercurial repositories not currently supported."
+#		print "Set default and/or default-push to a local repository"
+#		exit
+#	fi
+    if [[ -n $forestflag ]]; then
+        HG_LIST_FROM_COMMIT=
+	flist_from_mercurial_forest
+    else
+        STATUS_REV=
+        if [[ -n $rflag ]]; then
+            STATUS_REV="--rev $PARENT_REV"
+        elif [[ -n $OUTREV ]]; then
+            STATUS_REV="--rev $OUTREV"
+        else
+            # hg commit hasn't been run see what is lying around
+            print "\n No outgoing, perhaps you haven't commited."
+        fi
+	# First let's list all the modified or deleted files
+
+	hg status $STATUS_REV -mdn | $FILTER > $FLIST
+
+	# Then all the added files
+	# But some of these could have been "moved" or renamed ones
+	# so let's make sure we get the proper info
+	# hg status -aC will produce something like:
+	#	A subdir/File3
+	#	A subdir/File4
+	#	  File4
+	#	A subdir/File5
+	# The first and last are simple addition while the middle one
+	# is a move/rename
+
+	hg status $STATUS_REV -aC | $FILTER >$FLIST.temp
+	while read LINE; do
+	    ldone=""
+	    while [ -z "$ldone" ]; do
+		ldone="1"
+		set - $LINE
+		if [ $# -eq 2 -a "$1" == "A" ]; then
+		    AFILE=$2
+		    if read LINE2; then
+			set - $LINE2
+			if [ $# -eq 1 ]; then
+			    echo $AFILE $1 >>$FLIST
+			elif [ $# -eq 2 ]; then
+			    echo $AFILE >>$FLIST
+			    LINE=$LINE2
+			    ldone=""
+			fi
+		    else
+			echo $AFILE >>$FLIST
+		    fi
+		fi
+	    done
+	done < $FLIST.temp
+	hg status $STATUS_REV -rn | $FILTER > $FLIST.temp
+	while read RFILE; do
+	    grep "$RFILE" $FLIST >/dev/null
+	    if [ $? -eq 1 ]; then
+		echo $RFILE >>$FLIST
+	    fi
+	done < $FLIST.temp
+	rm -f $FLIST.temp
+    fi
+}
+
+function env_from_flist
+{
+	[[ -r $FLIST ]] || return
+
+	#
+	# Use "eval" to set env variables that are listed in the file
+	# list.  Then copy those into our local versions of those
+	# variables if they have not been set already.
+	#
+	eval `sed -e "s/#.*$//" $FLIST | grep = `
+
+	[[ -z $codemgr_ws && -n $CODEMGR_WS ]] && codemgr_ws=$CODEMGR_WS
+
+	#
+	# Check to see if CODEMGR_PARENT is set in the flist file.
+	#
+	[[ -z $codemgr_parent && -n $CODEMGR_PARENT ]] && \
+	    codemgr_parent=$CODEMGR_PARENT
+}
+
+#
+# detect_scm
+#
+# We dynamically test the SCM type; this allows future extensions to
+# new SCM types
+#
+function detect_scm
+{
+	#
+	# If CODEMGR_WS is specified in the flist file, we assume teamware.
+	#
+	if [[ -r $FLIST ]]; then
+		egrep '^CODEMGR_WS=' $FLIST > /dev/null 2>&1
+		if [[ $? -eq 0 ]]; then
+			print "teamware"
+			return
+		fi
+	fi
+
+	#
+	# The presence of $CODEMGR_WS and a Codemgr_wsdata directory
+	# is our clue that this is a teamware workspace.
+	# Same if true if current directory has a Codemgr_wsdata sub-dir
+	#
+	if [[ -z "$CODEMGR_WS" ]]; then
+	    CODEMGR_WS=`workspace name 2>/dev/null`
+	fi
+
+	if [[ -n $CODEMGR_WS && -d "$CODEMGR_WS/Codemgr_wsdata" ]]; then
+		print "teamware"
+	elif [[ -d $PWD/Codemgr_wsdata ]]; then
+		print "teamware"
+	elif hg root >/dev/null ; then
+		print "mercurial"
+	else
+		print "unknown"
+	fi
+}
+
+#
+# Extract the parent workspace from the Codemgr_wsdata/parent file
+#
+function parent_from_teamware
+{
+    if [[ -f "$1/Codemgr_wsdata/parent" ]]; then
+	tail -1 "$1/Codemgr_wsdata/parent"
+    fi
+}
+
+function look_for_prog
+{
+	typeset path
+	typeset ppath
+	typeset progname=$1
+
+	DEVTOOLS=
+	OS=`uname`
+	if [[ "$OS" == "SunOS" ]]; then
+	    DEVTOOLS="/java/devtools/`uname -p`/bin"
+	elif [[ "$OS" == "Linux" ]]; then
+	    DEVTOOLS="/java/devtools/linux/bin"
+	fi
+	    
+	ppath=$PATH
+	ppath=$ppath:/usr/sfw/bin:/usr/bin:/usr/sbin
+	ppath=$ppath:/opt/teamware/bin:/opt/onbld/bin
+	ppath=$ppath:/opt/onbld/bin/`uname -p`
+	ppath=$ppath:/java/devtools/share/bin:$DEVTOOLS
+
+	PATH=$ppath prog=`whence $progname`
+	if [[ -n $prog ]]; then
+		print $prog
+	fi
+}
+
+function build_old_new_teamware
+{
+	# If the child's version doesn't exist then
+	# get a readonly copy.
+
+	if [[ ! -f $F && -f SCCS/s.$F ]]; then
+		$SCCS get -s $F
+	fi
+
+	#
+	# Snag new version of file.
+	#
+	rm -f $newdir/$DIR/$F
+	cp $F $newdir/$DIR/$F
+
+	#
+	# Get the parent's version of the file. First see whether the
+	# child's version is checked out and get the parent's version
+	# with keywords expanded or unexpanded as appropriate.
+	#
+	if [ -f $PWS/$PDIR/SCCS/s.$PF -o \
+	    -f $PWS/$PDIR/SCCS/p.$PF ]; then
+		rm -f $olddir/$PDIR/$PF
+		if [ -f SCCS/p.$F ]; then
+			$SCCS get -s -p -k $PWS/$PDIR/$PF \
+			    > $olddir/$PDIR/$PF
+		else
+			$SCCS get -s -p    $PWS/$PDIR/$PF \
+			    > $olddir/$PDIR/$PF
+		fi
+	else
+		if [[ -f $PWS/$PDIR/$PF ]]; then
+			# Parent is not a real workspace, but just a raw
+			# directory tree - use the file that's there as
+			# the old file.
+
+			rm -f $olddir/$DIR/$F
+			cp $PWS/$PDIR/$PF $olddir/$DIR/$F
+		fi
+	fi
+}
+
+#
+# Find the parent for $1
+#
+function find_outrev
+{
+    crev=$1
+    prev=`hg log -r $crev --template '{parents}\n'`
+    if [[ -z "$prev" ]]
+    then
+	# No specific parent means previous changeset is parent
+	prev=`expr $crev - 1`
+    else
+	# Format is either of the following two:
+	# 546:7df6fcf1183b
+	# 548:16f1915bb5cd 547:ffaa4e775815
+	prev=`echo $prev | sed -e 's/\([0-9]*\):.*/\1/'`
+    fi
+    print $prev
+}
+
+function extract_ssh_infos
+{
+    CMD=$1
+    if expr "$CMD" : 'ssh://[^/]*@' >/dev/null; then
+	ssh_user=`echo $CMD | sed -e 's/ssh:\/\/\(.*\)@.*/\1/'`
+	ssh_host=`echo $CMD | sed -e 's/ssh:\/\/.*@\([^/]*\)\/.*/\1/'`
+	ssh_dir=`echo $CMD | sed -e 's/ssh:\/\/.*@[^/]*\/\(.*\)/\1/'`
+    else
+	ssh_user=
+	ssh_host=`echo $CMD | sed -e 's/ssh:\/\/\([^/]*\)\/.*/\1/'`
+	ssh_dir=`echo $CMD | sed -e 's/ssh:\/\/[^/]*\/\(.*\)/\1/'`
+    fi
+    
+}
+
+function build_old_new_mercurial
+{
+	olddir=$1
+	newdir=$2
+	DIR=$3
+	F=$4
+	#
+	# new version of the file.
+	#
+	rm -rf $newdir/$DIR/$F
+	if [ -f $F ]; then
+	    cp $F  $newdir/$DIR/$F
+	fi
+
+	#
+	# Old version of the file.
+	#
+	rm -rf $olddir/$DIR/$F
+
+	if [ -n "$PWS" ]; then
+	    if expr "$PWS" : 'ssh://' >/dev/null
+	    then
+		extract_ssh_infos $PWS
+		if [ -n "$ssh_user" ]; then
+		    parent="ssh -l $ssh_user $ssh_host hg -R $ssh_dir --cwd $ssh_dir"
+		else
+		    parent="ssh $ssh_host hg -R $ssh_dir --cwd $ssh_dir"
+		fi
+	    else
+		parent="hg -R $PWS --cwd $PWS"
+	    fi
+	else
+	    parent=""
+	fi
+
+	if [ -z "$rename" ]; then
+	    if [ -n "$rflag" ]; then
+		parentrev=$PARENT_REV
+	    elif [ "$HG_LIST_FROM_COMMIT" -eq 1 ]; then
+                parentrev=$OUTREV
+	    else
+                if [[ -n $HG_BRANCH ]]; then
+                    parentrev=$HG_BRANCH
+                else
+		    parentrev="tip"
+                fi
+	    fi
+
+	    if [ -n "$parentrev" ]; then
+		if [ -z "$parent" ]; then
+		    hg cat --rev $parentrev --output $olddir/$DIR/$F $F 2>/dev/null
+		else
+		    # when specifying a workspace we have to provide
+		    # the full path
+		    $parent cat --rev $parentrev --output $olddir/$DIR/$F $DIR/$F 2>/dev/null
+		fi
+	    fi
+	else
+	    # It's a rename (or a move), so let's make sure we move
+	    # to the right directory first, then restore it once done
+	    current_dir=`pwd`
+	    cd $CWS/$PDIR
+	    if [ -n "$rflag" ]; then
+		parentrev=$PARENT_REV
+	    elif [ "$HG_LIST_FROM_COMMIT" -eq 1 ]; then
+                parentrev=$OUTREV
+	    fi
+	    if [ -z "$parentrev" ]; then
+		parentrev=`hg log -l1 $PF | $AWK -F: '/changeset/ {print $2}'`
+	    fi
+	    if [ -n "$parentrev" ]; then
+		mkdir -p $olddir/$PDIR
+		if [ -z "$parent" ]; then
+		    hg cat --rev $parentrev --output $olddir/$PDIR/$PF $PF 2>/dev/null
+		else
+		    $parent cat --rev $parentrev --output $olddir/$PDIR/$PF $PDIR/$PF 2>/dev/null
+		fi
+	    fi
+	    cd $current_dir
+	fi
+}
+
+function build_old_new
+{
+	if [[ $SCM_MODE == "teamware" ]]; then
+		build_old_new_teamware $@
+	fi
+
+	if [[ $SCM_MODE == "mercurial" ]]; then
+		build_old_new_mercurial $@
+	fi
+}
+
+
+#
+# Usage message.
+#
+function usage
+{
+	print "Usage:\twebrev [common-options]
+	webrev [common-options] ( <file> | - )
+	webrev [common-options] -w <wx file>
+	webrev [common-options] -l [arguments to 'putback']
+
+Options:
+	-v: Print the version of this tool.
+        -b: Do not ignore changes in the amount of white space.
+        -c <CR#>: Include link to CR (aka bugid) in the main page.
+	-O: Print bugids/arc cases suitable for OpenJDK.
+	-i <filename>: Include <filename> in the index.html file.
+	-o <outdir>: Output webrev to specified directory.
+	-p <compare-against>: Use specified parent wkspc or basis for comparison
+	-w <wxfile>: Use specified wx active file.
+        -u <username>: Use that username instead of 'guessing' one.
+	-m: Forces the use of Mercurial
+	-t: Forces the use of Teamware
+
+Mercurial only options:
+	-r rev: Compare against a specified revision
+	-N: Skip 'hg outgoing', use only 'hg status'
+	-f: Use the forest extension
+
+Environment:
+	WDIR: Control the output directory.
+	WEBREV_BUGURL: Control the URL prefix for bugids.
+	WEBREV_SACURL: Control the URL prefix for ARC cases.
+
+SCM Environment:
+	Teamware: CODEMGR_WS: Workspace location.
+	Teamware: CODEMGR_PARENT: Parent workspace location.
+
+"
+
+	exit 2
+}
+
+#
+#
+# Main program starts here
+#
+#
+LANG="C"
+LC_ALL="C"
+export LANG LC_ALL
+trap "rm -f /tmp/$$.* ; exit" 0 1 2 3 15
+
+set +o noclobber
+
+[[ -z $WDIFF ]] && WDIFF=`look_for_prog wdiff`
+[[ -z $WX ]] && WX=`look_for_prog wx`
+[[ -z $CODEREVIEW ]] && CODEREVIEW=`look_for_prog codereview`
+[[ -z $PS2PDF ]] && PS2PDF=`look_for_prog ps2pdf`
+[[ -z $PERL ]] && PERL=`look_for_prog perl`
+[[ -z $SCCS ]] && SCCS=`look_for_prog sccs`
+[[ -z $AWK ]] && AWK=`look_for_prog nawk`
+[[ -z $AWK ]] && AWK=`look_for_prog gawk`
+[[ -z $AWK ]] && AWK=`look_for_prog awk`
+[[ -z $WSPACE ]] && WSPACE=`look_for_prog workspace`
+[[ -z $JAR ]] && JAR=`look_for_prog jar`
+[[ -z $ZIP ]] && ZIP=`look_for_prog zip`
+[[ -z $GETENT ]] && GETENT=`look_for_prog getent`
+[[ -z $WGET ]] && WGET=`look_for_prog wget`
+
+if uname | grep CYGWIN >/dev/null
+then
+        ISWIN=1
+        # Under windows mercurial outputs '\' instead of '/'
+        FILTER="tr '\\\\' '/'"
+else
+        FILTER="cat"
+fi
+
+if [[ ! -x $PERL ]]; then
+	print -u2 "Error: No perl interpreter found.  Exiting."
+	exit 1
+fi
+
+#
+# These aren't fatal, but we want to note them to the user.
+# We don't warn on the absence of 'wx' until later when we've
+# determined that we actually need to try to invoke it.
+#
+# [[ ! -x $CODEREVIEW ]] && print -u2 "WARNING: codereview(1) not found."
+# [[ ! -x $PS2PDF ]] && print -u2 "WARNING: ps2pdf(1) not found."
+# [[ ! -x $WDIFF ]] && print -u2 "WARNING: wdiff not found."
+
+# Declare global total counters.
+integer TOTL TINS TDEL TMOD TUNC
+
+flist_mode=
+flist_file=
+bflag=
+iflag=
+oflag=
+pflag=
+uflag=
+lflag=
+wflag=
+Oflag=
+rflag=
+Nflag=
+forestflag=
+while getopts "c:i:o:p:r:u:lmtwONvfb" opt
+do
+	case $opt in
+        b)      bflag=1;;
+
+	i)	iflag=1
+		INCLUDE_FILE=$OPTARG;;
+
+	o)	oflag=1
+		WDIR=$OPTARG;;
+
+	p)	pflag=1
+		codemgr_parent=$OPTARG;;
+
+	u)      uflag=1
+		username=$OPTARG;;
+
+        c)      if [[ -z $CRID ]]; then
+                   CRID=$OPTARG
+                else
+                   CRID="$CRID $OPTARG"
+                fi;;
+
+	m)	SCM_MODE="mercurial";;
+
+	t)	SCM_MODE="teamware";;
+
+	#
+	# If -l has been specified, we need to abort further options
+	# processing, because subsequent arguments are going to be
+	# arguments to 'putback -n'.
+	#
+	l)	lflag=1
+		break;;
+
+	w)	wflag=1;;
+
+	O)	Oflag=1;;
+
+	N)	Nflag=1;;
+
+	f)	forestflag=1;;
+
+	r)	rflag=1
+		PARENT_REV=$OPTARG;;
+
+	v)	print "$0 version: $WEBREV_UPDATED";;
+		
+
+	?)	usage;;
+	esac
+done
+
+FLIST=/tmp/$$.flist
+
+if [[ -n $wflag && -n $lflag ]]; then
+	usage
+fi
+
+if [[ -n $forestflag && -n $rflag ]]; then
+    print "The -r <rev> flag is incompatible with the use of forests"
+    exit 2
+fi
+
+#
+# If this manually set as the parent, and it appears to be an earlier webrev,
+# then note that fact and set the parent to the raw_files/new subdirectory.
+#
+if [[ -n $pflag && -d $codemgr_parent/raw_files/new ]]; then
+	parent_webrev="$codemgr_parent"
+	codemgr_parent="$codemgr_parent/raw_files/new"
+fi
+
+if [[ -z $wflag && -z $lflag ]]; then
+	shift $(($OPTIND - 1))
+
+	if [[ $1 == "-" ]]; then
+		cat > $FLIST
+		flist_mode="stdin"
+		flist_done=1
+		shift
+	elif [[ -n $1 ]]; then
+		if [[ ! -r $1 ]]; then
+			print -u2 "$1: no such file or not readable"
+			usage
+		fi
+		cat $1 > $FLIST
+		flist_mode="file"
+		flist_file=$1
+		flist_done=1
+		shift
+	else
+		flist_mode="auto"
+	fi
+fi
+
+#
+# Before we go on to further consider -l and -w, work out which SCM we think
+# is in use.
+#
+if [[ -z $SCM_MODE ]]; then
+    SCM_MODE=`detect_scm $FLIST`
+fi
+if [[ $SCM_MODE == "unknown" ]]; then
+	print -u2 "Unable to determine SCM type currently in use."
+	print -u2 "For teamware: webrev looks for \$CODEMGR_WS either in"
+	print -u2 "              the environment or in the file list."
+	print -u2 "For mercurial: webrev runs 'hg root'."
+	exit 1
+fi
+
+print -u2 "   SCM detected: $SCM_MODE"
+
+
+if [[ $SCM_MODE == "mercurial" ]]; then
+    #
+    # determine Workspace and parent workspace paths
+    #
+    CWS=`hg root | $FILTER`
+    if [[ -n $pflag && -z "$PWS" ]]; then
+	OUTPWS=$codemgr_parent
+        # Let's try to expand it if it's an alias defined in [paths]
+        tmp=`hg path $OUTPWS 2>/dev/null | $FILTER`
+        if [[ -n $tmp ]]; then
+            OUTPWS="$tmp"
+        fi
+        if [[ -n $rflag ]]; then
+	    if expr "$codemgr_parent" : 'ssh://.*' >/dev/null; then
+	        PWS=$codemgr_parent
+	    else
+	        PWS=`hg -R "$codemgr_parent" root 2>/dev/null | $FILTER`
+	    fi
+        fi
+    fi
+    #
+    # OUTPWS is the parent repository to use when using 'hg outgoing'
+    #
+    if [[ -z $Nflag ]]; then
+        if [[ -n $forestflag ]]; then
+            #
+            # for forest we have to rely on properly set default and
+            # default-push because they can be different from the top one.
+            # unless of course it was explicitely speficied with -p
+            if [[ -z $pflag ]]; then
+                OUTPWS=
+            fi
+        else
+            #
+            # Unfortunately mercurial is bugged and doesn't handle
+            # aliases correctly in 'hg path default'
+            # So let's do it ourselves. Sigh...
+            if [[ -z "$OUTPWS" ]]; then
+                OUTPWS=`grep default-push $CWS/.hg/hgrc | $AWK '{print $3}' | $FILTER`
+            fi
+            # Still empty, means no default-push
+            if [[ -z "$OUTPWS" ]]; then
+                OUTPWS=`grep 'default =' $CWS/.hg/hgrc | $AWK '{print $3}' | $FILTER`
+            fi
+            # Let's try to expand it if it's an alias defined in [paths]
+            tmp=`hg path $OUTPWS 2>/dev/null | $FILTER`
+            if [[ -n $tmp ]]; then
+                OUTPWS="$tmp"
+            fi
+        fi
+    fi
+    #
+    # OUTPWS may contain username:password, let's make sure we remove the
+    # sensitive information before we print out anything in the HTML
+    #
+    OUTPWS2=$OUTPWS
+    if [[ -n $OUTPWS ]]; then
+	if [[ `expr "$OUTPWS" : '.*://[^/]*@.*'` -gt 0 ]]; then
+	    # Remove everything between '://' and '@'
+	    OUTPWS2=`echo $OUTPWS | sed -e 's/\(.*:\/\/\).*@\(.*\)/\1\2/'`
+	fi
+    fi
+
+    if [[ -z $HG_BRANCH ]]; then
+        HG_BRANCH=`hg branch`
+        if [ "$HG_BRANCH" == "default" ]; then
+            #
+            # 'default' means no particular branch, so let's cancel that
+            #
+            HG_BRANCH=
+        fi
+    fi
+
+    if [[ -z $forestflag ]]; then
+        if [[ -z $Nflag ]]; then
+            #
+            # If no "-N", always do "hg outgoing" against parent
+            # repository to determine list of outgoing revisions.
+            #
+            ALL_CREV=`hg outgoing -q --template '{rev}\n' $OUTPWS | sort -n`
+            if [[ -n $ALL_CREV ]]; then
+                FIRST_CREV=`echo "$ALL_CREV" | head -1`
+                #
+                # If no "-r", choose revision to compare against by
+                # finding the latest revision not in the outgoing list.
+                #
+                if [[ -z $rflag ]]; then
+                    OUTREV=`find_outrev "$FIRST_CREV"`
+                    if [[ -n $OUTREV ]]; then
+                        HG_LIST_FROM_COMMIT=1
+                    fi
+                fi
+            fi
+        elif [[ -n $rflag ]]; then
+            #
+            # If skipping "hg outgoing" but still comparing against a
+            # specific revision (not the tip), set revision for comment
+            # accumulation.
+            #
+            FIRST_CREV=`hg log --rev $PARENT_REV --template '{rev}'`
+            FIRST_CREV=`expr $FIRST_CREV + 1`
+        fi
+    fi
+    #Let's check if a merge is needed, if so, issue a warning
+    PREV=`hg parent | grep '^tag:.*tip$'`
+    if [[ -z $PREV ]]; then
+        print "WARNING: parent rev is not tip. Maybe an update or merge is needed"
+    fi
+fi
+
+if [[ -n $lflag ]]; then
+	#
+	# If the -l flag is given instead of the name of a file list,
+	# then generate the file list by extracting file names from a
+	# putback -n.
+	#
+	shift $(($OPTIND - 1))
+	if [[ $SCM_MODE == "teamware" ]]; then
+		flist_from_teamware "$*"
+	elif [[ $SCM_MODE == "mercurial" ]]; then
+		flist_from_mercurial
+	fi
+	flist_done=1
+	shift $#
+
+elif [[ -n $wflag ]]; then
+	#
+	# If the -w is given then assume the file list is in Bonwick's "wx"
+	# command format, i.e.  pathname lines alternating with SCCS comment
+	# lines with blank lines as separators.  Use the SCCS comments later
+	# in building the index.html file.
+	#
+	shift $(($OPTIND - 1))
+	wxfile=$1
+	if [[ -z $wxfile && -n $CODEMGR_WS ]]; then
+		if [[ -r $CODEMGR_WS/wx/active ]]; then
+			wxfile=$CODEMGR_WS/wx/active
+		fi
+	fi
+
+	[[ -z $wxfile ]] && print -u2 "wx file not specified, and could not " \
+	    "be auto-detected (check \$CODEMGR_WS)" && exit 1
+
+	print -u2 " File list from: wx 'active' file '$wxfile' ... \c"
+	flist_from_wx $wxfile
+	flist_done=1
+	if [[ -n "$*" ]]; then
+		shift
+	fi
+elif [[ $flist_mode == "stdin" ]]; then
+	print -u2 " File list from: standard input"
+elif [[ $flist_mode == "file" ]]; then
+	print -u2 " File list from: $flist_file"
+fi
+
+if [[ $# -gt 0 ]]; then
+	print -u2 "WARNING: unused arguments: $*"
+fi
+
+if [[ $SCM_MODE == "teamware" ]]; then
+	#
+	# Parent (internally $codemgr_parent) and workspace ($codemgr_ws) can
+	# be set in a number of ways, in decreasing precedence:
+	#
+	#      1) on the command line (only for the parent)
+	#      2) in the user environment
+	#      3) in the flist
+	#      4) automatically based on the workspace (only for the parent)
+	#
+
+	#
+	# Here is case (2): the user environment
+	#
+	[[ -z $codemgr_ws && -n $CODEMGR_WS ]] && codemgr_ws=$CODEMGR_WS
+	[[ -z $codemgr_ws && -n $WSPACE ]] && codemgr_ws=`$WSPACE name`
+	    
+	if [[ -n $codemgr_ws && ! -d $codemgr_ws ]]; then
+		print -u2 "$codemgr_ws: no such workspace"
+		exit 1
+	fi
+
+	[[ -z $codemgr_parent && -n $CODEMGR_PARENT ]] && \
+	    codemgr_parent=$CODEMGR_PARENT
+
+	if [[ -n $codemgr_parent && ! -d $codemgr_parent ]]; then
+		print -u2 "$codemgr_parent: no such directory"
+		exit 1
+	fi
+
+	#
+	# If we're in auto-detect mode and we haven't already gotten the file
+	# list, then see if we can get it by probing for wx.
+	#
+	if [[ -z $flist_done && $flist_mode == "auto" && -n $codemgr_ws ]]; then
+		if [[ ! -x $WX ]]; then
+			print -u2 "WARNING: wx not found!"
+		fi
+
+		#
+		# We need to use wx list -w so that we get renamed files, etc.
+		# but only if a wx active file exists-- otherwise wx will
+		# hang asking us to initialize our wx information.
+		#
+		if [[ -x $WX && -f $codemgr_ws/wx/active ]]; then
+			print -u2 " File list from: 'wx list -w' ... \c"
+			$WX list -w > $FLIST
+			$WX comments > /tmp/$$.wx_comments
+			wxfile=/tmp/$$.wx_comments
+			print -u2 "done"
+			flist_done=1
+		fi
+	fi
+
+	#
+	# If by hook or by crook we've gotten a file list by now (perhaps
+	# from the command line), eval it to extract environment variables from
+	# it: This is step (3).
+	#
+	env_from_flist
+
+	#
+	# Continuing step (3): If we still have no file list, we'll try to get
+	# it from teamware.
+	#
+	if [[ -z $flist_done ]]; then
+		flist_from_teamware
+		env_from_flist
+	fi
+
+	if [[ -z $codemgr_ws && -d $PWD/Codemgr_wsdata ]]; then
+	    codemgr_ws=$PWD
+	fi
+	#
+	# Observe true directory name of CODEMGR_WS, as used later in
+	# webrev title.
+	#
+	if [[ -n $codemgr_ws ]]; then
+	    codemgr_ws=$(cd $codemgr_ws;print $PWD)
+	fi
+
+	if [[ -n $codemgr_parent ]]; then
+	    codemgr_parent=$(cd $codemgr_parent;print $PWD)
+	fi
+
+	#
+	# (4) If we still don't have a value for codemgr_parent, get it
+	# from workspace.
+	#
+	[[ -z $codemgr_parent && -n $WSPACE ]] && codemgr_parent=`$WSPACE parent`
+	[[ -z $codemgr_parent ]] && codemgr_parent=`parent_from_teamware $codemgr_ws`
+
+	if [[ ! -d $codemgr_parent ]]; then
+	    print -u2 "$CODEMGR_PARENT: no such parent workspace"
+	    exit 1
+	fi
+
+	#
+	# Reset CODEMGR_WS to make sure teamware commands are happy.
+	#
+	CODEMGR_WS=$codemgr_ws
+	CWS=$codemgr_ws
+	PWS=$codemgr_parent
+elif [[ $SCM_MODE == "mercurial" ]]; then
+    if [[ -z $flist_done ]]; then
+	flist_from_mercurial $PWS
+    fi
+fi
+
+#
+# If the user didn't specify a -i option, check to see if there is a
+# webrev-info file in the workspace directory.
+#
+if [[ -z $iflag && -r "$CWS/webrev-info" ]]; then
+	iflag=1
+	INCLUDE_FILE="$CWS/webrev-info"
+fi
+
+if [[ -n $iflag ]]; then
+	if [[ ! -r $INCLUDE_FILE ]]; then
+		print -u2 "include file '$INCLUDE_FILE' does not exist or is" \
+		    "not readable."
+		exit 1
+	else
+		#
+		# $INCLUDE_FILE may be a relative path, and the script alters
+		# PWD, so we just stash a copy in /tmp.
+		#
+		cp $INCLUDE_FILE /tmp/$$.include
+	fi
+fi
+
+#
+# Output directory.
+#
+if [[ -z $WDIR ]]; then
+    WDIR=$CWS/webrev
+else
+    # If the output directory doesn't end with '/webrev' or '/webrev/'
+    # then add '/webrev'. This is for backward compatibility
+    if ! expr $WDIR : '.*/webrev/\?$' >/dev/null
+    then
+	WDIR=$WDIR/webrev
+    fi
+fi
+# WDIR=${WDIR:-$CWS/webrev}
+
+#
+# Name of the webrev, derived from the workspace name; in the
+# future this could potentially be an option.
+#
+# Let's keep what's after the last '/'
+WNAME=${CWS##*/}
+
+#
+# If WDIR doesn't start with '/' or 'x:' prepend the current dir
+#
+if [ ${WDIR%%/*} ]; then
+    if [[ -n $ISWIN ]]; then
+        if [ ${WDIR%%[A-Za-z]:*} ]; then
+	    WDIR=$PWD/$WDIR
+        fi
+    else
+	WDIR=$PWD/$WDIR
+    fi
+fi
+
+if [[ ! -d $WDIR ]]; then
+	mkdir -p $WDIR
+	[[ $? != 0 ]] && exit 1
+fi
+
+#
+# Summarize what we're going to do.
+#
+print "      Workspace: $CWS"
+if [[ -n $parent_webrev ]]; then
+    print "Compare against: webrev at $parent_webrev"
+elif [[ -n $OUTPWS2 ]]; then
+    print "Compare against: $OUTPWS2"
+fi
+if [[ -n $HG_BRANCH ]]; then
+    print "         Branch: $HG_BRANCH"
+fi
+if [[ -n $rflag ]]; then
+        print "Compare against version: $PARENT_REV"
+fi
+[[ -n $INCLUDE_FILE ]] && print "      Including: $INCLUDE_FILE"
+print "      Output to: $WDIR"
+
+#
+# Save the file list in the webrev dir
+#
+[[ ! $FLIST -ef $WDIR/file.list ]] && cp $FLIST $WDIR/file.list
+
+#
+#    Bug IDs will be replaced by a URL.  Order of precedence
+#    is: default location, $WEBREV_BUGURL, the -O flag.
+#
+BUGURL='http://monaco.sfbay.sun.com/detail.jsp?cr='
+[[ -n $WEBREV_BUGURL ]] && BUGURL="$WEBREV_BUGURL"
+[[ -n "$Oflag" ]] && \
+    BUGURL='http://bugs.sun.com/bugdatabase/view_bug.do?bug_id='
+
+#
+#    Likewise, ARC cases will be replaced by a URL.  Order of precedence
+#    is: default, $WEBREV_SACURL, the -O flag.
+#
+#    Note that -O also triggers different substitution behavior for
+#    SACURL.  See sac2url().
+#
+SACURL='http://sac.eng.sun.com'
+[[ -n $WEBREV_SACURL ]] && SACURL="$WEBREV_SACURL"
+[[ -n $Oflag ]] && \
+    SACURL='http://www.opensolaris.org/os/community/arc/caselog'
+
+rm -f $WDIR/$WNAME.patch
+rm -f $WDIR/$WNAME.ps
+rm -f $WDIR/$WNAME.pdf
+
+touch $WDIR/$WNAME.patch
+
+print "   Output Files:"
+
+#
+# Clean up the file list: Remove comments, blank lines and env variables.
+#
+sed -e "s/#.*$//" -e "/=/d" -e "/^[   ]*$/d" $FLIST > /tmp/$$.flist.clean
+FLIST=/tmp/$$.flist.clean
+
+#
+# Clean up residual raw files
+#
+if [ -d $WDIR/raw_files ]; then
+    rm -rf $WDIR/raw_files 2>/dev/null
+fi
+
+#
+# Should we ignore changes in white spaces when generating diffs?
+# 
+if [[ -n $bflag ]]; then
+    DIFFOPTS="-t"
+else
+    DIFFOPTS="-bt"
+fi
+#
+# First pass through the files: generate the per-file webrev HTML-files.
+#
+while read LINE
+do
+	set - $LINE
+	P=$1
+
+        if [[ $1 == "Revision:" ]]; then
+            OUTREV=$2
+            continue
+        fi
+	#
+	# Normally, each line in the file list is just a pathname of a
+	# file that has been modified or created in the child.  A file
+	# that is renamed in the child workspace has two names on the
+	# line: new name followed by the old name.
+	#
+	oldname=""
+	oldpath=""
+	rename=
+	if [[ $# -eq 2 ]]; then
+		PP=$2			# old filename
+		oldname=" (was $PP)"
+		oldpath="$PP"
+		rename=1
+        	PDIR=${PP%/*}
+        	if [[ $PDIR == $PP ]]; then
+			PDIR="."   # File at root of workspace
+		fi
+
+		PF=${PP##*/}
+
+	        DIR=${P%/*}
+	        if [[ $DIR == $P ]]; then
+			DIR="."   # File at root of workspace
+		fi
+
+		F=${P##*/}
+        else
+	        DIR=${P%/*}
+	        if [[ "$DIR" == "$P" ]]; then
+			DIR="."   # File at root of workspace
+		fi
+
+		F=${P##*/}
+
+		PP=$P
+		PDIR=$DIR
+		PF=$F
+	fi
+
+        # Make the webrev directory if necessary as it may have been
+        # removed because it was empty
+        if [ ! -d $CWS/$DIR ]; then
+	    mkdir -p $CWS/$DIR
+        fi
+
+	COMM=`getcomments html $P $PP`
+
+	print "\t$P$oldname\n\t\t\c"
+
+	# Make the webrev mirror directory if necessary
+	mkdir -p $WDIR/$DIR
+
+	# cd to the directory so the names are short
+	cd $CWS/$DIR
+
+	#
+	# If we're in OpenSolaris mode, we enforce a minor policy:
+	# help to make sure the reviewer doesn't accidentally publish
+	# source which is in usr/closed/*
+	#
+	if [[ -n $Oflag ]]; then
+		pclosed=${P##usr/closed/}
+		if [[ $pclosed != $P ]]; then
+			print "*** Omitting closed source for OpenSolaris" \
+			    "mode review"
+			continue
+		fi
+	fi
+
+	#
+	# We stash old and new files into parallel directories in /tmp
+	# and do our diffs there.  This makes it possible to generate
+	# clean looking diffs which don't have absolute paths present.
+	#
+	olddir=$WDIR/raw_files/old
+	newdir=$WDIR/raw_files/new
+	mkdir -p $olddir
+	mkdir -p $newdir
+	mkdir -p $olddir/$PDIR
+	mkdir -p $newdir/$DIR
+
+	build_old_new $olddir $newdir $DIR $F
+
+	if [[ ! -f $F && ! -f $olddir/$DIR/$F ]]; then
+		print "*** Error: file not in parent or child"
+		continue
+	fi
+
+	cd $WDIR/raw_files
+	ofile=old/$PDIR/$PF
+	nfile=new/$DIR/$F
+
+	mv_but_nodiff=
+	cmp $ofile $nfile > /dev/null 2>&1
+	if [[ $? == 0 && $rename == 1 ]]; then
+		mv_but_nodiff=1
+	fi
+
+        #
+        # Cleaning up
+        #
+        rm -f $WDIR/$DIR/$F.cdiff.html
+        rm -f $WDIR/$DIR/$F.udiff.html
+        rm -f $WDIR/$DIR/$F.wdiff.html
+        rm -f $WDIR/$DIR/$F.sdiff.html
+        rm -f $WDIR/$DIR/$F-.html
+        rm -f $WDIR/$DIR/$F.html
+
+	its_a_jar=
+	if expr $F : '.*\.jar' >/dev/null; then
+	    its_a_jar=1
+	    # It's a JAR file, let's do it differntly
+	    if [[ -z $JAR ]]; then
+		print "No access to jar, so can't produce diffs for jar files"
+	    else
+		if [ -f $ofile ]; then
+		    $JAR -tvf $ofile >"$ofile".lst
+		fi
+		if [ -f $nfile ]; then
+		    $JAR -tvf $nfile >"$nfile".lst
+		fi
+
+		if [[ -f $ofile && -f $nfile && -z $mv_but_nodiff ]]; then
+
+		    ${CDIFFCMD:-diff -bt -C 5} $ofile.lst $nfile.lst > $WDIR/$DIR/$F.cdiff
+		    diff_to_html $F $DIR/$F "C" "$COMM" < $WDIR/$DIR/$F.cdiff \
+			> $WDIR/$DIR/$F.cdiff.html
+		    print " cdiffs\c"
+
+		    ${UDIFFCMD:-diff -bt -U 5} $ofile.lst $nfile.lst > $WDIR/$DIR/$F.udiff
+		    diff_to_html $F $DIR/$F "U" "$COMM" < $WDIR/$DIR/$F.udiff \
+			> $WDIR/$DIR/$F.udiff.html
+
+		    print " udiffs\c"
+
+		    if [[ -x $WDIFF ]]; then
+			$WDIFF -c "$COMM" \
+			    -t "$WNAME Wdiff $DIR/$F" $ofile.lst $nfile.lst > \
+			    $WDIR/$DIR/$F.wdiff.html 2>/dev/null
+			if [[ $? -eq 0 ]]; then
+			    print " wdiffs\c"
+			else
+			    print " wdiffs[fail]\c"
+			fi
+		    fi
+
+		    sdiff_to_html $ofile $nfile $F $DIR "$COMM" \
+			> $WDIR/$DIR/$F.sdiff.html
+		    print " sdiffs\c"
+
+		    print " frames\c"
+
+		    rm -f $WDIR/$DIR/$F.cdiff $WDIR/$DIR/$F.udiff
+
+		    difflines $ofile.lst $nfile.lst > $WDIR/$DIR/$F.count
+
+		elif [[ -f $ofile && -f $nfile && -n $mv_but_nodiff ]]; then
+		# renamed file: may also have differences
+		    difflines $ofile.lst $nfile.lst > $WDIR/$DIR/$F.count
+		elif [[ -f $nfile ]]; then
+		# new file: count added lines
+		    difflines /dev/null $nfile.lst > $WDIR/$DIR/$F.count
+		elif [[ -f $ofile ]]; then
+		# old file: count deleted lines
+		    difflines $ofile.lst /dev/null > $WDIR/$DIR/$F.count
+		fi
+	    fi
+	else
+	    
+	    #
+	    # If we have old and new versions of the file then run the
+	    # appropriate diffs.  This is complicated by a couple of factors:
+	    #
+	    #	- renames must be handled specially: we emit a 'remove'
+	    #	  diff and an 'add' diff
+	    #	- new files and deleted files must be handled specially
+	    #	- Solaris patch(1m) can't cope with file creation
+	    #	  (and hence renames) as of this writing.
+	    #   - To make matters worse, gnu patch doesn't interpret the
+	    #	  output of Solaris diff properly when it comes to
+	    #	  adds and deletes.  We need to do some "cleansing"
+	    #     transformations:
+	    # 	    [to add a file] @@ -1,0 +X,Y @@  -->  @@ -0,0 +X,Y @@
+	    #	    [to del a file] @@ -X,Y +1,0 @@  -->  @@ -X,Y +0,0 @@
+	    #
+	    cleanse_rmfile="sed 's/^\(@@ [0-9+,-]*\) [0-9+,-]* @@$/\1 +0,0 @@/'"
+	    cleanse_newfile="sed 's/^@@ [0-9+,-]* \([0-9+,-]* @@\)$/@@ -0,0 \1/'"
+
+	    rm -f $WDIR/$DIR/$F.patch
+	    if [[ -z $rename ]]; then
+		if [ ! -f $ofile ]; then
+		    diff -u /dev/null $nfile | sh -c "$cleanse_newfile" \
+			> $WDIR/$DIR/$F.patch
+		elif [ ! -f $nfile ]; then
+		    diff -u $ofile /dev/null | sh -c "$cleanse_rmfile" \
+			> $WDIR/$DIR/$F.patch
+		else
+		    diff -u $ofile $nfile > $WDIR/$DIR/$F.patch
+		fi
+	    else
+		diff -u $ofile /dev/null | sh -c "$cleanse_rmfile" \
+		    > $WDIR/$DIR/$F.patch
+
+		diff -u /dev/null $nfile | sh -c "$cleanse_newfile" \
+		    >> $WDIR/$DIR/$F.patch
+
+	    fi
+
+
+	#
+	# Tack the patch we just made onto the accumulated patch for the
+	# whole wad.
+	#
+	    cat $WDIR/$DIR/$F.patch >> $WDIR/$WNAME.patch
+
+	    print " patch\c"
+
+	    if [[ -f $ofile && -f $nfile && -z $mv_but_nodiff ]]; then
+
+		${CDIFFCMD:-diff -bt -C 5} $ofile $nfile > $WDIR/$DIR/$F.cdiff
+		diff_to_html $F $DIR/$F "C" "$COMM" < $WDIR/$DIR/$F.cdiff \
+		    > $WDIR/$DIR/$F.cdiff.html
+		print " cdiffs\c"
+
+		${UDIFFCMD:-diff -bt -U 5} $ofile $nfile > $WDIR/$DIR/$F.udiff
+		diff_to_html $F $DIR/$F "U" "$COMM" < $WDIR/$DIR/$F.udiff \
+		    > $WDIR/$DIR/$F.udiff.html
+
+		print " udiffs\c"
+
+		if [[ -x $WDIFF ]]; then
+		    $WDIFF -c "$COMM" \
+			-t "$WNAME Wdiff $DIR/$F" $ofile $nfile > \
+			$WDIR/$DIR/$F.wdiff.html 2>/dev/null
+		    if [[ $? -eq 0 ]]; then
+			print " wdiffs\c"
+		    else
+			print " wdiffs[fail]\c"
+		    fi
+		fi
+
+		sdiff_to_html $ofile $nfile $F $DIR "$COMM" \
+		    > $WDIR/$DIR/$F.sdiff.html
+		print " sdiffs\c"
+
+		print " frames\c"
+
+		rm -f $WDIR/$DIR/$F.cdiff $WDIR/$DIR/$F.udiff
+
+		difflines $ofile $nfile > $WDIR/$DIR/$F.count
+
+	    elif [[ -f $ofile && -f $nfile && -n $mv_but_nodiff ]]; then
+		# renamed file: may also have differences
+		difflines $ofile $nfile > $WDIR/$DIR/$F.count
+	    elif [[ -f $nfile ]]; then
+		# new file: count added lines
+		difflines /dev/null $nfile > $WDIR/$DIR/$F.count
+	    elif [[ -f $ofile ]]; then
+		# old file: count deleted lines
+		difflines $ofile /dev/null > $WDIR/$DIR/$F.count
+	    fi
+	fi
+	#
+	# Now we generate the postscript for this file.  We generate diffs
+	# only in the event that there is delta, or the file is new (it seems
+	# tree-killing to print out the contents of deleted files).
+	#
+	if [[ -f $nfile ]]; then
+		ocr=$ofile
+		[[ ! -f $ofile ]] && ocr=/dev/null
+
+		if [[ -z $mv_but_nodiff ]]; then
+			textcomm=`getcomments text $P $PP`
+			if [[ -x $CODEREVIEW ]]; then
+				$CODEREVIEW -y "$textcomm" \
+				    -e $ocr $nfile \
+				    > /tmp/$$.psfile 2>/dev/null &&
+				    cat /tmp/$$.psfile >> $WDIR/$WNAME.ps
+				if [[ $? -eq 0 ]]; then
+					print " ps\c"
+				else
+					print " ps[fail]\c"
+				fi
+			fi
+		fi
+	fi
+
+	if [[ -f $ofile && -z $mv_but_nodiff ]]; then
+	    if [[ -n $its_a_jar ]]; then
+		source_to_html Old $P < $ofile.lst > $WDIR/$DIR/$F-.html
+	    else
+		source_to_html Old $P < $ofile > $WDIR/$DIR/$F-.html
+	    fi
+		print " old\c"
+	fi
+
+	if [[ -f $nfile ]]; then
+	    if [[ -n $its_a_jar ]]; then
+		source_to_html New $P < $nfile.lst > $WDIR/$DIR/$F.html
+	    else
+		source_to_html New $P < $nfile > $WDIR/$DIR/$F.html
+	    fi
+		print " new\c"
+	fi
+
+	print
+done < $FLIST
+
+frame_nav_js > $WDIR/ancnav.js
+frame_navigation > $WDIR/ancnav.html
+
+if [[ -f $WDIR/$WNAME.ps && -x $CODEREVIEW && -x $PS2PDF ]]; then
+	print " Generating PDF: \c"
+	fix_postscript $WDIR/$WNAME.ps | $PS2PDF - > $WDIR/$WNAME.pdf
+	print "Done."
+fi
+
+# Now build the index.html file that contains
+# links to the source files and their diffs.
+
+cd $CWS
+
+# Save total changed lines for Code Inspection.
+print "$TOTL" > $WDIR/TotalChangedLines
+
+print "     index.html: \c"
+INDEXFILE=$WDIR/index.html
+exec 3<&1			# duplicate stdout to FD3.
+exec 1<&-			# Close stdout.
+exec > $INDEXFILE		# Open stdout to index file.
+
+print "$HTML<head>"
+print "<meta name=\"scm\" content=\"$SCM_MODE\" />"
+print "$STDHEAD"
+print "<title>$WNAME</title>"
+print "</head>"
+print "<body id=\"SUNWwebrev\">"
+print "<div class=\"summary\">"
+print "<h2>Code Review for $WNAME</h2>"
+
+print "<table>"
+
+if [[ -z $uflag ]]
+then
+    if [[ $SCM_MODE == "mercurial" ]]
+    then
+        #
+        # Let's try to extract the user name from the .hgrc file
+        #
+	username=`grep '^username' $HOME/.hgrc | sed 's/^username[ ]*=[ ]*\(.*\)/\1/'`
+    fi
+
+    if [[ -z $username ]]
+    then
+        #
+        # Figure out the username and gcos name.  To maintain compatibility
+        # with passwd(4), we must support '&' substitutions.
+        #
+	username=`id | cut -d '(' -f 2 | cut -d ')' -f 1`
+	if [[ -x $GETENT ]]; then
+	    realname=`$GETENT passwd $username | cut -d':' -f 5 | cut -d ',' -f 1`
+	fi
+	userupper=`print "$username" | sed 's/\<./\u&/g'`
+	realname=`print $realname | sed s/\&/$userupper/`
+    fi
+fi
+
+date="on `date`"
+
+if [[ -n "$username" && -n "$realname" ]]; then
+	print "<tr><th>Prepared by:</th>"
+	print "<td>$realname ($username) $date</td></tr>"
+elif [[ -n "$username" ]]; then
+	print "<tr><th>Prepared by:</th><td>$username $date</td></tr>"
+fi
+
+print "<tr><th>Workspace:</th><td>$CWS</td></tr>"
+if [[ -n $parent_webrev ]]; then
+        print "<tr><th>Compare against:</th><td>"
+	print "webrev at $parent_webrev"
+else
+    if [[ -n $OUTPWS2 ]]; then
+        print "<tr><th>Compare against:</th><td>"
+	print "$OUTPWS2"
+    fi
+fi
+print "</td></tr>"
+if [[ -n $rflag ]]; then
+    print "<tr><th>Compare against version:</th><td>$PARENT_REV</td></tr>"
+elif [[ -n $OUTREV ]]; then
+    if [[ -z $forestflag ]]; then
+        print "<tr><th>Compare against version:</th><td>$OUTREV</td></tr>"
+    fi
+fi
+if [[ -n $HG_BRANCH ]]; then
+    print "<tr><th>Branch:</th><td>$HG_BRANCH</td></tr>"
+fi
+
+print "<tr><th>Summary of changes:</th><td>"
+printCI $TOTL $TINS $TDEL $TMOD $TUNC
+print "</td></tr>"
+
+if [[ -f $WDIR/$WNAME.patch ]]; then
+	print "<tr><th>Patch of changes:</th><td>"
+	print "<a href=\"$WNAME.patch\">$WNAME.patch</a></td></tr>"
+fi
+if [[ -f $WDIR/$WNAME.pdf ]]; then
+	print "<tr><th>Printable review:</th><td>"
+	print "<a href=\"$WNAME.pdf\">$WNAME.pdf</a></td></tr>"
+fi
+
+if [[ -n "$iflag" ]]; then
+	print "<tr><th>Author comments:</th><td><div>"
+	cat /tmp/$$.include
+	print "</div></td></tr>"
+fi
+# Add links to referenced CRs, if any
+# external URL has a <title> like:
+# <title>Bug ID: 6641309 Wrong Cookie separator used in HttpURLConnection</title>
+# while internal URL has <title> like:
+# <title>6641309: Wrong Cookie separator used in HttpURLConnection</title>
+#
+if [[ -n $CRID ]]; then
+    for id in $CRID
+    do
+        print "<tr><th>Bug id:</th><td>"
+        url="${BUGURL}${id}"
+        if [[ -n $WGET ]]; then
+            msg=`$WGET -q $url -O - | grep '<title>' | sed 's/<title>\(.*\)<\/title>/\1/' | sed 's/Bug ID://'`
+        fi
+        if [[ -n $msg ]]; then
+            print "<a href=\"$url\">$msg</a>"
+        else
+            print $id | bug2url
+        fi
+        
+        print "</td></tr>"
+    done
+fi
+print "<tr><th>Legend:</th><td>"
+print "<b>Modified file</b><br><font color=red><b>Deleted file</b></font><br><font color=green><b>New file</b></font></td></tr>"
+print "</table>"
+print "</div>"
+
+#
+# Second pass through the files: generate the rest of the index file
+#
+while read LINE
+do
+	set - $LINE
+        if [[ $1 == "Revision:" ]]; then
+            FIRST_CREV=`expr $3 + 1`
+            continue
+        fi
+	P=$1
+
+	if [[ $# == 2 ]]; then
+		PP=$2
+		oldname=" <i>(was $PP)</i>"
+
+	else
+		PP=$P
+		oldname=""
+	fi
+
+	DIR=${P%/*}
+	if [[ $DIR == $P ]]; then
+		DIR="."   # File at root of workspace
+	fi
+
+	# Avoid processing the same file twice.
+	# It's possible for renamed files to
+	# appear twice in the file list
+
+	F=$WDIR/$P
+
+	print "<p><code>"
+
+	# If there's a diffs file, make diffs links
+
+        NODIFFS=
+	if [[ -f $F.cdiff.html ]]; then
+		print "<a href=\"$P.cdiff.html\">Cdiffs</a>"
+		print "<a href=\"$P.udiff.html\">Udiffs</a>"
+
+		if [[ -f $F.wdiff.html && -x $WDIFF ]]; then
+			print "<a href=\"$P.wdiff.html\">Wdiffs</a>"
+		fi
+
+		print "<a href=\"$P.sdiff.html\">Sdiffs</a>"
+
+		print "<a href=\"$P.frames.html\">Frames</a>"
+	else
+                NODIFFS=1
+		print " ------ ------ ------"
+
+		if [[ -x $WDIFF ]]; then
+			print " ------"
+		fi
+
+		print " ------"
+	fi
+
+	# If there's an old file, make the link
+
+        NOOLD=
+	if [[ -f $F-.html ]]; then
+		print "<a href=\"$P-.html\">Old</a>"
+	else
+                NOOLD=1
+		print " ---"
+	fi
+
+	# If there's an new file, make the link
+
+        NONEW=
+	if [[ -f $F.html ]]; then
+		print "<a href=\"$P.html\">New</a>"
+	else
+                NONEW=1
+		print " ---"
+	fi
+
+	if [[ -f $F.patch ]]; then
+		print "<a href=\"$P.patch\">Patch</a>"
+	else
+		print " -----"
+	fi
+
+	if [[ -f $WDIR/raw_files/new/$P ]]; then
+		print "<a href=\"raw_files/new/$P\">Raw</a>"
+	else
+		print " ---"
+	fi
+        print "</code>"
+        if [[ -n $NODIFFS && -z $oldname ]]; then
+            if [[ -n $NOOLD ]]; then
+                print "<font color=green><b>$P</b></font>"
+            elif [[ -n $NONEW ]]; then
+                print "<font color=red><b>$P</b></font>"
+            fi
+        else
+	    print "<b>$P</b> $oldname"
+        fi
+
+	#
+	# Check for usr/closed
+	#
+	if [ ! -z "$Oflag" ]; then
+		if [[ $P == usr/closed/* ]]; then
+			print "&nbsp;&nbsp;<i>Closed source: omitted from" \
+			    "this review</i>"
+		fi
+	fi
+
+	print "</p><blockquote>\c"
+	# Insert delta comments if any
+	comments=`getcomments html $P $PP`
+	if [ -n "$comments" ]; then
+	    print "<pre>$comments</pre>"
+	fi
+
+	# Add additional comments comment
+
+	print "<!-- Add comments to explain changes in $P here -->"
+
+	# Add count of changes.
+
+	if [[ -f $F.count ]]; then
+	    cat $F.count
+	    rm $F.count
+	fi
+        print "</blockquote>"
+done < $FLIST
+
+print
+print
+print "<hr />"
+print "<p style=\"font-size: small\">"
+print "This code review page was prepared using <b>$0</b>"
+print "(vers $WEBREV_UPDATED)."
+print "</body>"
+print "</html>"
+
+if [[ -n $ZIP ]]; then
+    # Let's generate a zip file for convenience
+    cd $WDIR/..
+    if [ -f webrev.zip ]; then
+	rm webrev.zip
+    fi
+    $ZIP -r webrev webrev >/dev/null 2>&1
+fi
+
+exec 1<&-			# Close FD 1.
+exec 1<&3			# dup FD 3 to restore stdout.
+exec 3<&-			# close FD 3.
+
+print "Done."
+print "Output to: $WDIR"
+
--- a/make/sponsors-rules.gmk	Tue Mar 15 19:52:42 2011 -0400
+++ b/make/sponsors-rules.gmk	Tue Mar 15 20:00:45 2011 -0400
@@ -59,10 +59,10 @@
 sponsors-build:
 ifeq ($(ARCH_DATA_MODEL), 32)
   ifeq ($(BUILD_SPONSORS), true)
-	@$(call MakeStart, sponsors, $(SPONSORS_BUILD_TARGETS))
+	@$(call MakeStart,sponsors,$(SPONSORS_BUILD_TARGETS))
 	($(CD) $(SPONSORS_TOPDIR)/make && \
 	  $(MAKE) $(SPONSORS_BUILD_TARGETS) $(SPONSORS_BUILD_ARGUMENTS))
-	@$(call MakeFinish, sponsors, $(SPONSORS_BUILD_TARGETS))
+	@$(call MakeFinish,sponsors,$(SPONSORS_BUILD_TARGETS))
   endif
 endif