changeset 7:e7ecde4010e9 jdk6-b03

6755902: Changes for openjdk6 build 03 6501053: Specification of java.lang.Override was not updated when integrating 6399361 6589527: Window and Frame instances can hide their "Applet Warning" 6570445: Win32ShellFolder2 throws exceptions if security manager installed 6491795: COM should be initialized for Shell API calls in ShellFolder2.cpp 5074439: JTree.setSelectionModel(null) prevents JTree garbage collection 6423287: PargraphView returns wrong minimum span 6459331: There should be an easy way of removing elements from HTMLDocument 6493702: Several spec bugs in tree and related classes 6604470: j2se/make/docs/Makefile does not work without ALL jdk sources available (langtools too) 6487891: RFE: LTP: @ConstructorProperties should be used 6616088: SCCS keyword removal from j2se src/ and make/ directories 6628146: Exclude the .hgignore and .hgtags files from the source bundles 6589530: HW/LW mixing code incorrectly handles insertion of components with the setComponentZOrder() method 6550433: OpenJDK Netbeans AWT & 2d Run Project fails 6616758: Regression: Subpixel Courier New W looks bad 4222827: RFE: Support getAsText and setAsText in all default editors 6599318: SCCS keywords in Driver.java and main.cpp 6501089: (so) test/java/nio/channels/SocketChannel/AsyncCloseChannel.java failing (timeout) on Linux 6630270: VetoableChangeSupport.fireVetoableChange contradicts the Java SE 6 spec 6630501: CRASH: JCK test eats much memory and jvm crashes 6637583: Build failure on latest Solaris, source missing include of resource.h? 6638060: Build failed with GNU make 3.81 (part of latest Solaris 'gmake') 6638571: Fix freetype sanity check to work on solaris 64bit 6638671: Change default binaryplugs location Summary: Final b03 state (as defined by the source bundle) Reviewed-by: darcy
author ohair
date Fri, 30 Jan 2009 16:23:12 -0800
parents cf1ab142a11e
children 80cec5783547
files THIRD_PARTY_README make/THIRD_PARTY_README make/common/Defs.gmk make/common/shared/Platform.gmk make/docs/Makefile make/java/nio/Makefile make/java/nio/genCharsetProvider.sh make/java/nio/genExceptions.sh make/netbeans/awt2d/build.properties make/netbeans/awt2d/build.xml make/netbeans/awt2d/nbproject/project.xml make/netbeans/common/generated-sources.ent make/netbeans/common/generated-view.ent make/netbeans/common/java-data-native.ent make/netbeans/common/java-data-no-native.ent make/netbeans/jconsole/build.properties make/netbeans/jconsole/nbproject/project.xml make/sun/awt/mawt.gmk make/sun/xawt/Makefile make/tools/freetypecheck/Makefile src/share/classes/java/awt/Color.java src/share/classes/java/awt/Component.java src/share/classes/java/awt/Container.java src/share/classes/java/awt/Cursor.java src/share/classes/java/awt/ScrollPane.java src/share/classes/java/awt/Window.java src/share/classes/java/awt/datatransfer/DataFlavor.java src/share/classes/java/awt/datatransfer/FlavorEvent.java src/share/classes/java/awt/event/KeyEvent.java src/share/classes/java/awt/package.html src/share/classes/java/beans/EventHandler.java src/share/classes/java/beans/Expression.java src/share/classes/java/beans/MetaData.java src/share/classes/java/beans/Statement.java src/share/classes/java/beans/VetoableChangeSupport.java src/share/classes/java/lang/Override.java src/share/classes/javax/sound/sampled/spi/FormatConversionProvider.java src/share/classes/javax/swing/Box.java src/share/classes/javax/swing/BoxLayout.java src/share/classes/javax/swing/DefaultCellEditor.java src/share/classes/javax/swing/ImageIcon.java src/share/classes/javax/swing/JButton.java src/share/classes/javax/swing/JSplitPane.java src/share/classes/javax/swing/JTree.java src/share/classes/javax/swing/OverlayLayout.java src/share/classes/javax/swing/border/BevelBorder.java src/share/classes/javax/swing/border/CompoundBorder.java src/share/classes/javax/swing/border/EmptyBorder.java src/share/classes/javax/swing/border/EtchedBorder.java src/share/classes/javax/swing/border/LineBorder.java src/share/classes/javax/swing/border/SoftBevelBorder.java src/share/classes/javax/swing/border/TitledBorder.java src/share/classes/javax/swing/event/TreeSelectionEvent.java src/share/classes/javax/swing/plaf/BorderUIResource.java src/share/classes/javax/swing/plaf/ColorUIResource.java src/share/classes/javax/swing/plaf/basic/BasicDirectoryModel.java src/share/classes/javax/swing/text/DefaultStyledDocument.java src/share/classes/javax/swing/text/DocumentFilter.java src/share/classes/javax/swing/text/GlyphView.java src/share/classes/javax/swing/text/ParagraphView.java src/share/classes/javax/swing/text/html/InlineView.java src/share/classes/javax/swing/text/html/ParagraphView.java src/share/classes/javax/swing/tree/DefaultTreeModel.java src/share/classes/javax/swing/tree/TreePath.java src/share/classes/sun/font/Type1Font.java src/solaris/classes/sun/awt/X11/XDecoratedPeer.java src/solaris/classes/sun/awt/X11/XDialogPeer.java src/solaris/classes/sun/awt/X11/XEmbeddedFramePeer.java src/solaris/classes/sun/awt/X11/XFramePeer.java src/solaris/classes/sun/awt/X11/XWindowPeer.java src/solaris/classes/sun/awt/motif/MDialogPeer.java src/solaris/classes/sun/awt/motif/MEmbeddedFramePeer.java src/solaris/classes/sun/awt/motif/MFramePeer.java src/solaris/classes/sun/awt/motif/MWindowPeer.java src/solaris/hpi/native_threads/src/sys_api_td.c src/solaris/native/sun/awt/awt_GraphicsEnv.c src/windows/classes/sun/awt/shell/Win32ShellFolder2.java src/windows/classes/sun/awt/windows/WDialogPeer.java src/windows/classes/sun/awt/windows/WEmbeddedFramePeer.java src/windows/classes/sun/awt/windows/WFramePeer.java src/windows/classes/sun/awt/windows/WWindowPeer.java src/windows/native/sun/windows/ShellFolder2.cpp src/windows/native/sun/windows/awt_Window.cpp src/windows/native/sun/windows/awt_Window.h test/java/awt/Mixing/setComponentZOrder.java
diffstat 85 files changed, 1830 insertions(+), 1612 deletions(-) [+]
line wrap: on
line diff
--- a/THIRD_PARTY_README	Fri Jan 30 16:19:11 2009 -0800
+++ b/THIRD_PARTY_README	Fri Jan 30 16:23:12 2009 -0800
@@ -1431,63 +1431,6 @@
 
 END  src/solaris/native/sun/awt/HPkeysym.h 
 ****************************************************** 
-BEGIN  src/solaris/native/sun/awt/Xinerama.c 
-/***************************************************************** 
-Copyright (c) 1991, 1997 Digital Equipment Corporation, Maynard, Massachusetts. 
-Permission is hereby granted, free of charge, to any person obtaining a copy 
-of this software and associated documentation files (the "Software"), to deal 
-in the Software without restriction, including without limitation the rights 
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 
-copies of the Software. 
-
-The above copyright notice and this permission notice shall be included in 
-all copies or substantial portions of the Software. 
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL 
-DIGITAL EQUIPMENT CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES, INCLUDING, 
-BUT NOT LIMITED TO CONSEQUENTIAL OR INCIDENTAL DAMAGES, OR OTHER LIABILITY, 
-WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR 
-IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 
-
-Except as contained in this notice, the name of Digital Equipment Corporation 
-shall not be used in advertising or otherwise to promote the sale, use or other 
-dealings in this Software without prior written authorization from Digital 
-Equipment Corporation. 
-******************************************************************/ 
-END  src/solaris/native/sun/awt/Xinerama.c 
-****************************************************** 
-BEGIN src/solaris/native/sun/awt/Xinerama.h 
-/* 
-Copyright (C) 1994-2001 The XFree86 Project, Inc. All Rights Reserved. 
-
-Permission is hereby granted, free of charge, to any person obtaining a 
-copy of this software and associated documentation files (the "Soft- 
-ware"), to deal in the Software without restriction, including without 
-limitation the rights to use, copy, modify, merge, publish, distribute, 
-and/or sell copies of the Software, and to permit persons to whom the 
-Software is furnished to do so, provided that the above copyright 
-notice(s) and this permission notice appear in all copies of the Soft- 
-ware and that both the above copyright notice(s) and this permission 
-notice appear in supporting documentation. 
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- 
-ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY 
-RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN 
-THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSE- 
-QUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, 
-DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER 
-TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFOR- 
-MANCE OF THIS SOFTWARE. 
-
-Except as contained in this notice, the name of a copyright holder shall 
-not be used in advertising or otherwise to promote the sale, use or 
-other dealings in this Software without prior written authorization of 
-the copyright holder. 
-*/ 
-END src/solaris/native/sun/awt/Xinerama.h 
 ****************************************************** 
 BEGIN src/solaris/native/sun/awt/Xrandr.h 
 /* 
@@ -1619,33 +1562,6 @@
 AND  src/solaris/native/sun/awt/wsutils.h 
 
 ***************************************************************** 
-BEGIN src/solaris/native/sun/awt/panoramiXext.h 
-Copyright (c) 1991, 1997 Digital Equipment Corporation, Maynard, Massachusetts. 
-Permission is hereby granted, free of charge, to any person obtaining a copy 
-of this software and associated documentation files (the "Software"), to deal 
-in the Software without restriction, including without limitation the rights 
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 
-copies of the Software. 
-
-The above copyright notice and this permission notice shall be included in 
-all copies or substantial portions of the Software. 
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL 
-DIGITAL EQUIPMENT CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES, INCLUDING, 
-BUT NOT LIMITED TO CONSEQUENTIAL OR INCIDENTAL DAMAGES, OR OTHER LIABILITY, 
-WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR 
-IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 
-
-Except as contained in this notice, the name of Digital Equipment Corporation 
-shall not be used in advertising or otherwise to promote the sale, use or other 
-dealings in this Software without prior written authorization from Digital 
-Equipment Corporation. 
-
-END src/solaris/native/sun/awt/panoramiXext.h 
-****************************************************** 
-
 BEGIN src/solaris/native/sun/awt/randr.h 
 
  * 
--- a/make/THIRD_PARTY_README	Fri Jan 30 16:19:11 2009 -0800
+++ b/make/THIRD_PARTY_README	Fri Jan 30 16:23:12 2009 -0800
@@ -1431,63 +1431,6 @@
 
 END  src/solaris/native/sun/awt/HPkeysym.h 
 ****************************************************** 
-BEGIN  src/solaris/native/sun/awt/Xinerama.c 
-/***************************************************************** 
-Copyright (c) 1991, 1997 Digital Equipment Corporation, Maynard, Massachusetts. 
-Permission is hereby granted, free of charge, to any person obtaining a copy 
-of this software and associated documentation files (the "Software"), to deal 
-in the Software without restriction, including without limitation the rights 
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 
-copies of the Software. 
-
-The above copyright notice and this permission notice shall be included in 
-all copies or substantial portions of the Software. 
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL 
-DIGITAL EQUIPMENT CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES, INCLUDING, 
-BUT NOT LIMITED TO CONSEQUENTIAL OR INCIDENTAL DAMAGES, OR OTHER LIABILITY, 
-WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR 
-IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 
-
-Except as contained in this notice, the name of Digital Equipment Corporation 
-shall not be used in advertising or otherwise to promote the sale, use or other 
-dealings in this Software without prior written authorization from Digital 
-Equipment Corporation. 
-******************************************************************/ 
-END  src/solaris/native/sun/awt/Xinerama.c 
-****************************************************** 
-BEGIN src/solaris/native/sun/awt/Xinerama.h 
-/* 
-Copyright (C) 1994-2001 The XFree86 Project, Inc. All Rights Reserved. 
-
-Permission is hereby granted, free of charge, to any person obtaining a 
-copy of this software and associated documentation files (the "Soft- 
-ware"), to deal in the Software without restriction, including without 
-limitation the rights to use, copy, modify, merge, publish, distribute, 
-and/or sell copies of the Software, and to permit persons to whom the 
-Software is furnished to do so, provided that the above copyright 
-notice(s) and this permission notice appear in all copies of the Soft- 
-ware and that both the above copyright notice(s) and this permission 
-notice appear in supporting documentation. 
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- 
-ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY 
-RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN 
-THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSE- 
-QUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, 
-DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER 
-TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFOR- 
-MANCE OF THIS SOFTWARE. 
-
-Except as contained in this notice, the name of a copyright holder shall 
-not be used in advertising or otherwise to promote the sale, use or 
-other dealings in this Software without prior written authorization of 
-the copyright holder. 
-*/ 
-END src/solaris/native/sun/awt/Xinerama.h 
 ****************************************************** 
 BEGIN src/solaris/native/sun/awt/Xrandr.h 
 /* 
@@ -1619,33 +1562,6 @@
 AND  src/solaris/native/sun/awt/wsutils.h 
 
 ***************************************************************** 
-BEGIN src/solaris/native/sun/awt/panoramiXext.h 
-Copyright (c) 1991, 1997 Digital Equipment Corporation, Maynard, Massachusetts. 
-Permission is hereby granted, free of charge, to any person obtaining a copy 
-of this software and associated documentation files (the "Software"), to deal 
-in the Software without restriction, including without limitation the rights 
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 
-copies of the Software. 
-
-The above copyright notice and this permission notice shall be included in 
-all copies or substantial portions of the Software. 
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL 
-DIGITAL EQUIPMENT CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES, INCLUDING, 
-BUT NOT LIMITED TO CONSEQUENTIAL OR INCIDENTAL DAMAGES, OR OTHER LIABILITY, 
-WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR 
-IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 
-
-Except as contained in this notice, the name of Digital Equipment Corporation 
-shall not be used in advertising or otherwise to promote the sale, use or other 
-dealings in this Software without prior written authorization from Digital 
-Equipment Corporation. 
-
-END src/solaris/native/sun/awt/panoramiXext.h 
-****************************************************** 
-
 BEGIN src/solaris/native/sun/awt/randr.h 
 
  * 
--- a/make/common/Defs.gmk	Fri Jan 30 16:19:11 2009 -0800
+++ b/make/common/Defs.gmk	Fri Jan 30 16:23:12 2009 -0800
@@ -157,7 +157,7 @@
   ifdef ALT_BUILD_BINARY_PLUGS_PATH
     BUILD_BINARY_PLUGS_PATH = $(ALT_BUILD_BINARY_PLUGS_PATH)
   else
-    BUILD_BINARY_PLUGS_PATH = $(SLASH_JAVA)/re/jdk/$(JDK_VERSION)/promoted/latest/openjdk/binaryplugs
+    BUILD_BINARY_PLUGS_PATH = $(SLASH_JAVA)/re/openjdk/$(JDK_MINOR_VERSION)/promoted/latest/openjdk/binaryplugs
   endif
   BINARY_PLUGS_PATH = $(BUILD_BINARY_PLUGS_PATH)/$(PLATFORM)-$(ARCH)
   BINARY_PLUGS_JARFILE = $(BINARY_PLUGS_PATH)/jre/lib/$(BINARY_PLUGS_JARNAME)
--- a/make/common/shared/Platform.gmk	Fri Jan 30 16:19:11 2009 -0800
+++ b/make/common/shared/Platform.gmk	Fri Jan 30 16:23:12 2009 -0800
@@ -103,10 +103,10 @@
 # so they will not be included when copying directory trees
 # or packaging up .jar files, etc.  This applies to all workspaces.
 #
-SCM_DIRs = .hg .svn CVS RCS SCCS Codemgr_wsdata deleted_files
+SCM_DIRs = .hg .svn CVS RCS SCCS Codemgr_wsdata deleted_files .hgignore .hgtags
 # When changing SCM_DIRs also change SCM_DIRS_rexp and SCM_DIRS_prune:
-SCM_DIRS_rexp = ".hg|.svn|CVS|RCS|SCCS|Codemgr_wsdata|deleted_files"
-SCM_DIRS_prune = \( -name .hg -o -name .svn -o -name CVS -o -name RCS -o -name SCCS -o -name Codemgr_wsdata -o -name deleted_files \) -prune
+SCM_DIRS_rexp = ".hg|.svn|CVS|RCS|SCCS|Codemgr_wsdata|deleted_files|.hgignore|.hgtags"
+SCM_DIRS_prune = \( -name .hg -o -name .svn -o -name CVS -o -name RCS -o -name SCCS -o -name Codemgr_wsdata -o -name deleted_files -o -name .hgignore -o -name .hgtags \) -prune
 
 # Don't define this unless it's not defined
 ifndef VARIANT
--- a/make/docs/Makefile	Fri Jan 30 16:19:11 2009 -0800
+++ b/make/docs/Makefile	Fri Jan 30 16:23:12 2009 -0800
@@ -30,6 +30,28 @@
 PRODUCT=docs
 include $(BUILDDIR)/common/Defs.gmk
 
+#
+# Definitions for imported components
+#
+include $(BUILDDIR)/common/internal/ImportComponents.gmk
+
+IMPORT_PACKAGES := $(subst /,.,$(filter-out META-INF/% %.class, $(IMPORT_RT_PACKAGES) $(IMPORT_TOOLS_PACKAGES)))
+
+# Handle javax.rmi and javax.xml specially since they are listed as classes in 
+# $(IMPORT_RT_PACKAGES), and in both cases, they are the only source file in 
+# their package.
+IMPORT_PACKAGE_FILTER = \
+    $(IMPORT_PACKAGES) \
+    $(patsubst %,%.%, $(IMPORT_PACKAGES)) 
+
+ifneq ($(filter javax/rmi/PortableRemoteObject.class,$(IMPORT_RT_PACKAGES)),)
+    IMPORT_PACKAGE_FILTER += javax.rmi
+endif
+
+ifneq ($(filter javax/xml/XMLConstants.class,$(IMPORT_RT_PACKAGES)),)
+    IMPORT_PACKAGE_FILTER += javax.xml
+endif
+
 # We override whatever the max VM memory setting is here.
 #    NOTE: javadoc will not complete without these larger settings.
 #    WARNING: This could cause thrashing on low memory machines.
@@ -412,9 +434,6 @@
 
 # Targets for all APIs other than the core platform APIs
 ALL_OTHER_TARGETS = \
-    mirrordocs \
-    docletapidocs \
-    tagletapidocs \
     domapidocs \
     jpdadocs \
     jaasdocs \
@@ -423,8 +442,15 @@
     httpserverdocs  \
     mgmtdocs \
     attachdocs \
-    jconsoledocs \
-    treeapidocs
+    jconsoledocs
+
+ifdef LANGTOOLS_DIST
+    ALL_OTHER_TARGETS += \
+	mirrordocs \
+	docletapidocs \
+	tagletapidocs \
+	treeapidocs
+endif
 
 .PHONY: all docs
 all docs: coredocs otherdocs
@@ -432,7 +458,6 @@
 .PHONY: otherdocs
 otherdocs: ${ALL_OTHER_TARGETS}
 
-
 #################################################################
 # Production Targets -- USE THESE TARGETS WHEN:
 #    a) You're generating docs outside of release engineering's
@@ -477,7 +502,7 @@
 	$(JAVADOC_CMD) $(CORE_JAVADOCFLAGS)            \
                    -d $(DOCSDIR)/api                   \
                    -sourcepath $(RELEASEDOCS_SRCPATH)  \
-                   $(CORE_PKGS)
+                   $(filter-out $(IMPORT_PACKAGE_FILTER), $(CORE_PKGS))
 
 .PHONY: mirrordocs
 mirrordocs:
@@ -525,7 +550,7 @@
                    -d $(DOCSDIR)/jre/api/plugin/dom            \
                    -sourcepath $(RELEASEDOCS_SRCPATH)        \
                    -linkoffline ../../../../api $(DOCSDIR)/api/ \
-                   $(DOMAPI_PKGS)
+                   $(filter-out $(IMPORT_PACKAGE_FILTER), $(DOMAPI_PKGS))
 
 .PHONY: jpdadocs
 jpdadocs: jdidocs jdwpdocs jvmtidocs
@@ -646,6 +671,11 @@
 .PHONY: echovalues
 echovalues:
 	@$(ECHO) ""
+	@$(ECHO) --------------Imports---------------------------
+	@$(ECHO) "IMPORT_PACKAGES = $(IMPORT_PACKAGES)"
+	@$(ECHO) "IMPORT_PACKAGE_FILTER = $(IMPORT_PACKAGE_FILTER)"
+	@$(ECHO) --------------Imports---------------------------
+	@$(ECHO) ""
 	@$(ECHO) --------------Shared---------------------------
 	@$(ECHO) BUILD_NUMBER = $(BUILD_NUMBER)
 	@$(ECHO) FULL_VERSION = $(FULL_VERSION)
@@ -669,7 +699,12 @@
 	@$(ECHO) "   SHARE_SRC/classes: $(SHARE_SRC)/classes"
 	@$(ECHO) "   PLATFORM_SRC/classes: $(PLATFORM_SRC)/classes"
 	@$(ECHO) "   GENSRCDIR: $(GENSRCDIR)"
+	@$(ECHO) "   SHARE_SRC/doc/stub: $(SHARE_SRC)/doc/stub"
+ifeq ($(CLOSED_SRC_DIR_EXISTS),true)
+	@$(ECHO) "   CLOSED_SRC/src/share/classes: $(CLOSED_SRC)/share/classes"
+endif
 	@$(ECHO) "   IMPORTSRCDIR: $(IMPORTSRCDIR)"
-	@$(ECHO) "   SHARE_SRC/doc/stub: $(SHARE_SRC)/doc/stub"
 	@$(ECHO) --------------common/Defs---------------------------
 	@$(ECHO) ""
+
+
--- a/make/java/nio/Makefile	Fri Jan 30 16:19:11 2009 -0800
+++ b/make/java/nio/Makefile	Fri Jan 30 16:23:12 2009 -0800
@@ -602,7 +602,7 @@
 
 GEN_EX_SH = genExceptions.sh
 
-GEN_EX_CMD = NAWK=$(NAWK) $(SHELL) $(GEN_EX_SH)
+GEN_EX_CMD = NAWK=$(NAWK) SH=$(SH) $(SH) $(GEN_EX_SH)
 
 $(CH_GEN)/%Exception.java: genExceptions.sh $(CH_SRC)/exceptions
 	$(prep-target)
@@ -637,6 +637,6 @@
 	@$(RM) $@.temp
 	NAWK=$(NAWK) TEMPDIR=$(TEMPDIR) \
 	  HASHER="$(BOOT_JAVA_CMD) -jar $(HASHER_JARFILE)" \
-	  $(SHELL) -e genCharsetProvider.sh $(SCS_SRC)/standard-charsets $(SCS_GEN)
+	  SH=$(SH) $(SH) -e genCharsetProvider.sh $(SCS_SRC)/standard-charsets $(SCS_GEN)
 
 .PHONY: sources
--- a/make/java/nio/genCharsetProvider.sh	Fri Jan 30 16:19:11 2009 -0800
+++ b/make/java/nio/genCharsetProvider.sh	Fri Jan 30 16:23:12 2009 -0800
@@ -48,7 +48,7 @@
 # Header
 #
 
-$SHELL addNotices.sh "$COPYRIGHT_YEARS" > $OUT
+$SH addNotices.sh "$COPYRIGHT_YEARS" > $OUT
 
 cat <<__END__ >>$OUT
 
--- a/make/java/nio/genExceptions.sh	Fri Jan 30 16:19:11 2009 -0800
+++ b/make/java/nio/genExceptions.sh	Fri Jan 30 16:23:12 2009 -0800
@@ -41,7 +41,7 @@
   echo '-->' $DST/$ID.java
   out=$DST/${ID}.java
 
-  $SHELL addNotices.sh "$COPYRIGHT_YEARS" > $out
+  $SH addNotices.sh "$COPYRIGHT_YEARS" > $out
 
 cat >>$out <<__END__
 
--- a/make/netbeans/awt2d/build.properties	Fri Jan 30 16:19:11 2009 -0800
+++ b/make/netbeans/awt2d/build.properties	Fri Jan 30 16:23:12 2009 -0800
@@ -62,6 +62,8 @@
     java2d/J2DBench/options/ \
     java2d/J2DBench/build.xml \
     jfc/
+gensrc=\
+    sun/awt/X11/
 jtreg.tests=\
     java/awt/ \
     javax/imageio/ \
--- a/make/netbeans/awt2d/build.xml	Fri Jan 30 16:19:11 2009 -0800
+++ b/make/netbeans/awt2d/build.xml	Fri Jan 30 16:23:12 2009 -0800
@@ -54,7 +54,6 @@
         <make-run target="all" dir="${make.dir}/sun/jawt"/>
         <make-run target="all" dir="${make.dir}/sun/text"/>
         <make-run target="all" dir="${make.dir}/com/sun/image"/>
-        <make-run target="all" dir="${make.dir}/com/sun/java2d"/>
     </target>
 
     <target name="-build-make-windows" depends="-make.init" if="os.windows">
@@ -68,7 +67,6 @@
         <make-run target="all" dir="${make.dir}/sun/jawt"/>
         <make-run target="all" dir="${make.dir}/sun/text"/>
         <make-run target="all" dir="${make.dir}/com/sun/image"/>
-        <make-run target="all" dir="${make.dir}/com/sun/java2d"/>
     </target>
 
     <target name="-clean-make" depends="-make.init,-clean-docs-tests" if="use.make">
@@ -86,8 +84,8 @@
         <make-run target="clean" dir="${make.dir}/sun/jawt"/>
         <make-run target="clean" dir="${make.dir}/sun/text"/>
         <make-run target="clean" dir="${make.dir}/com/sun/image"/>
-        <make-run target="clean" dir="${make.dir}/com/sun/java2d"/>
         <make-run target="clean" dir="${make.dir}/mkdemo/jfc"/>
+        <delete file="${build.dir}/tmp/sun/sun.awt.X11/xawt/.gen_icons"/>
     </target>
     
     <target name="run" depends="-make.init">
--- a/make/netbeans/awt2d/nbproject/project.xml	Fri Jan 30 16:19:11 2009 -0800
+++ b/make/netbeans/awt2d/nbproject/project.xml	Fri Jan 30 16:23:12 2009 -0800
@@ -37,6 +37,7 @@
     <!ENTITY unix-sources SYSTEM "../../common/unix-sources.ent">
     <!ENTITY windows-sources SYSTEM "../../common/windows-sources.ent">
     <!ENTITY demo-sources SYSTEM "../../common/demo-sources.ent">
+    <!ENTITY generated-sources SYSTEM "../../common/generated-sources.ent">
     <!ENTITY jtreg-sources SYSTEM "../../common/jtreg-sources.ent">
     <!ENTITY build-folder SYSTEM "../../common/build-folder.ent">
     <!ENTITY standard-bindings SYSTEM "../../common/standard-bindings.ent">
@@ -44,6 +45,7 @@
     <!ENTITY unix-view SYSTEM "../../common/unix-view.ent">
     <!ENTITY windows-view SYSTEM "../../common/windows-view.ent">
     <!ENTITY demo-view SYSTEM "../../common/demo-view.ent">
+    <!ENTITY generated-view SYSTEM "../../common/generated-view.ent">
     <!ENTITY jtreg-view SYSTEM "../../common/jtreg-view.ent">
     <!ENTITY file-view SYSTEM "../../common/file-view.ent">
     <!ENTITY standard-actions SYSTEM "../../common/standard-actions.ent">
@@ -62,6 +64,7 @@
                 &share-sources;
                 &unix-sources;
                 &windows-sources;
+                &generated-sources;
                 &demo-sources;
                 &jtreg-sources;
                 &build-folder;
@@ -80,6 +83,7 @@
                     &share-view;
                     &unix-view;
                     &windows-view;
+                    &generated-view;
                     &demo-view;
                     &jtreg-view;
                     &file-view;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/netbeans/common/generated-sources.ent	Fri Jan 30 16:23:12 2009 -0800
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ Copyright 2007 Sun Microsystems, Inc.  All Rights Reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+   - Redistributions of source code must retain the above copyright
+     notice, this list of conditions and the following disclaimer.
+
+   - Redistributions in binary form must reproduce the above copyright
+     notice, this list of conditions and the following disclaimer in the
+     documentation and/or other materials provided with the distribution.
+
+   - Neither the name of Sun Microsystems nor the names of its
+     contributors may be used to endorse or promote products derived
+     from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+ IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+-->
+
+<source-folder>
+    <label>Generated sources</label>
+    <location>${root}/build/${platform}-${arch}/gensrc</location>
+    <includes>${gensrc}</includes>
+</source-folder>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/netbeans/common/generated-view.ent	Fri Jan 30 16:23:12 2009 -0800
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ Copyright 2007 Sun Microsystems, Inc.  All Rights Reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+   - Redistributions of source code must retain the above copyright
+     notice, this list of conditions and the following disclaimer.
+
+   - Redistributions in binary form must reproduce the above copyright
+     notice, this list of conditions and the following disclaimer in the
+     documentation and/or other materials provided with the distribution.
+
+   - Neither the name of Sun Microsystems nor the names of its
+     contributors may be used to endorse or promote products derived
+     from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+ IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+-->
+
+<source-folder style="tree">
+    <label>Generated sources</label>
+    <location>${root}/build/${platform}-${arch}/gensrc</location>
+    <includes>${gensrc}</includes>
+</source-folder>
--- a/make/netbeans/common/java-data-native.ent	Fri Jan 30 16:19:11 2009 -0800
+++ b/make/netbeans/common/java-data-native.ent	Fri Jan 30 16:23:12 2009 -0800
@@ -36,6 +36,7 @@
         <package-root>${root}/src/share/classes</package-root>
         <package-root>${root}/src/windows/classes</package-root>
         <package-root>${root}/src/solaris/classes</package-root>
+        <package-root>${root}/build/${platform}-${arch}/gensrc</package-root>
         <classpath mode="boot">${bootstrap.jdk}/jre/lib/rt.jar</classpath>
         <built-to>${root}/build/${platform}-${arch}/classes</built-to>
         <javadoc-built-to>${root}/build/javadoc/${name}</javadoc-built-to>
--- a/make/netbeans/common/java-data-no-native.ent	Fri Jan 30 16:19:11 2009 -0800
+++ b/make/netbeans/common/java-data-no-native.ent	Fri Jan 30 16:23:12 2009 -0800
@@ -34,7 +34,9 @@
 <java-data xmlns="http://www.netbeans.org/ns/freeform-project-java/2">
     <compilation-unit>
         <package-root>${root}/src/share/classes</package-root>
+        <package-root>${root}/build/${platform}-${arch}/gensrc</package-root>
         <classpath mode="boot">${bootstrap.jdk}/jre/lib/rt.jar</classpath>
+        <classpath mode="compile">${bootstrap.jdk}/lib/tools.jar</classpath>
         <built-to>${root}/build/${platform}-${arch}/classes</built-to>
         <javadoc-built-to>${root}/build/javadoc/${name}</javadoc-built-to>
         <source-level>1.5</source-level>
--- a/make/netbeans/jconsole/build.properties	Fri Jan 30 16:19:11 2009 -0800
+++ b/make/netbeans/jconsole/build.properties	Fri Jan 30 16:23:12 2009 -0800
@@ -34,6 +34,8 @@
     sun/tools/jconsole/
 excludes=\
     sun/tools/jconsole/Version-template.java
+gensrc=\
+    sun/tools/jconsole/
 jtreg.tests=\
     sun/tools/jconsole/
 javadoc.packagenames=\
--- a/make/netbeans/jconsole/nbproject/project.xml	Fri Jan 30 16:19:11 2009 -0800
+++ b/make/netbeans/jconsole/nbproject/project.xml	Fri Jan 30 16:23:12 2009 -0800
@@ -34,10 +34,12 @@
 <!DOCTYPE project [
     <!ENTITY properties SYSTEM "../../common/properties.ent">
     <!ENTITY share-sources SYSTEM "../../common/share-sources.ent">
+    <!ENTITY generated-sources SYSTEM "../../common/generated-sources.ent">
     <!ENTITY jtreg-sources SYSTEM "../../common/jtreg-sources.ent">
     <!ENTITY build-folder SYSTEM "../../common/build-folder.ent">
     <!ENTITY standard-bindings SYSTEM "../../common/standard-bindings.ent">
     <!ENTITY share-view SYSTEM "../../common/share-view.ent">
+    <!ENTITY generated-view SYSTEM "../../common/generated-view.ent">
     <!ENTITY jtreg-view SYSTEM "../../common/jtreg-view.ent">
     <!ENTITY file-view SYSTEM "../../common/file-view.ent">
     <!ENTITY standard-actions SYSTEM "../../common/standard-actions.ent">
@@ -54,6 +56,7 @@
             </properties>
             <folders>
                 &share-sources;
+                &generated-sources;
                 &jtreg-sources;
                 &build-folder;
             </folders>
@@ -69,6 +72,7 @@
             <view>
                 <items>
                     &share-view;
+                    &generated-view;
                     &jtreg-view;
                     &file-view;
                 </items>
--- a/make/sun/awt/mawt.gmk	Fri Jan 30 16:19:11 2009 -0800
+++ b/make/sun/awt/mawt.gmk	Fri Jan 30 16:23:12 2009 -0800
@@ -57,9 +57,6 @@
   ifeq ($(MOTIF_VERSION), 2)
     FILES_c += awt_motif21.c
     FILES_c += awt_Choice21.c
-    ifeq  ($(PLATFORM), linux)
-        FILES_c += Xinerama.c
-    endif
   endif
 
 endif
--- a/make/sun/xawt/Makefile	Fri Jan 30 16:19:11 2009 -0800
+++ b/make/sun/xawt/Makefile	Fri Jan 30 16:23:12 2009 -0800
@@ -49,7 +49,6 @@
 LDFLAGS += -L$(OPENWIN_LIB)
 
 ifeq ($(PLATFORM), linux)
-FILES_c += Xinerama.c
 LDFLAGS += -lpthread
 dummy := $(shell $(MKDIR) -p $(LIB_LOCATION))
 endif
@@ -251,8 +250,6 @@
 	    $(ECHO) COMPARING $@ and $(STORED_SIZES_TMPL_$(PLATFORM)_$(LIBARCH)); \
 	    $(DIFF) $@ $(STORED_SIZES_TMPL_$(PLATFORM)_$(LIBARCH)); \
 	fi	
-		
-
 
 $(TEMPDIR)/.gen.wrappers: $(SIZES) $(WRAPPER_GENERATOR_CLASS) $(XLIBTYPES)
 	$(BOOT_JAVA_CMD) -cp $(WRAPPER_GENERATOR_TEMPDIR) WrapperGenerator \
--- a/make/tools/freetypecheck/Makefile	Fri Jan 30 16:19:11 2009 -0800
+++ b/make/tools/freetypecheck/Makefile	Fri Jan 30 16:23:12 2009 -0800
@@ -38,7 +38,14 @@
 
 all: $(FT_TEST_PATH)
 
-FT_OPTIONS  = -I$(FT_HEADERS) -I$(FT_HEADERS)/freetype2
+# Start with CFLAGS (which gets us the required -xarch setting on solaris)
+ifeq ($(PLATFORM), windows)
+  FT_OPTIONS  =
+else
+  FT_OPTIONS  = $(CFLAGS)
+endif
+
+FT_OPTIONS += -I$(FT_HEADERS) -I$(FT_HEADERS)/freetype2
 FT_OPTIONS += $(XARCH)
 
 #add runtime library search path
--- a/src/share/classes/java/awt/Color.java	Fri Jan 30 16:19:11 2009 -0800
+++ b/src/share/classes/java/awt/Color.java	Fri Jan 30 16:23:12 2009 -0800
@@ -25,7 +25,6 @@
 
 package java.awt;
 
-import java.beans.ConstructorProperties;
 import java.awt.image.ColorModel;
 import java.awt.geom.AffineTransform;
 import java.awt.geom.Rectangle2D;
@@ -386,7 +385,6 @@
      * @see #getAlpha
      * @see #getRGB
      */
-    @ConstructorProperties({"red", "green", "blue", "alpha"})
     public Color(int r, int g, int b, int a) {
         value = ((a & 0xFF) << 24) |
                 ((r & 0xFF) << 16) |
--- a/src/share/classes/java/awt/Component.java	Fri Jan 30 16:19:11 2009 -0800
+++ b/src/share/classes/java/awt/Component.java	Fri Jan 30 16:23:12 2009 -0800
@@ -936,24 +936,26 @@
      */
     public GraphicsConfiguration getGraphicsConfiguration() {
         synchronized(getTreeLock()) {
-            GraphicsConfiguration gc = graphicsConfig;
-            Component parent = getParent();
-            while ((gc == null) && (parent != null)) {
-                gc = parent.getGraphicsConfiguration();
-                parent = parent.getParent();
-            }
-            return gc;
+            if (graphicsConfig != null) { 
+                return graphicsConfig; 
+            } else if (getParent() != null) { 
+                return getParent().getGraphicsConfiguration(); 
+            } else { 
+                return null; 
+            }
         }
     }
 
     final GraphicsConfiguration getGraphicsConfiguration_NoClientCode() {
-        GraphicsConfiguration gc = this.graphicsConfig;
-        Component par = this.parent;
-        while ((gc == null) && (par != null)) {
-            gc = par.getGraphicsConfiguration_NoClientCode();
-            par = par.parent;
-        }
-        return gc;
+        GraphicsConfiguration graphicsConfig = this.graphicsConfig; 
+        Container parent = this.parent; 
+        if (graphicsConfig != null) { 
+            return graphicsConfig; 
+        } else if (parent != null) { 
+            return parent.getGraphicsConfiguration_NoClientCode(); 
+        } else { 
+            return null; 
+        }
     }
 
     /**
--- a/src/share/classes/java/awt/Container.java	Fri Jan 30 16:19:11 2009 -0800
+++ b/src/share/classes/java/awt/Container.java	Fri Jan 30 16:23:12 2009 -0800
@@ -709,7 +709,14 @@
              
              addDelicately(comp, curParent, index);
 
-             if (!peerRecreated) {
+             // If the oldZindex == -1, the component gets inserted, 
+             // rather than it changes its z-order.
+             if (!peerRecreated && oldZindex != -1) {
+                 // The new 'index' cannot be == -1.
+                 // It gets checked at the checkAdding() method.
+                 // Therefore both oldZIndex and index denote
+                 // some existing positions at this point and
+                 // this is actually a Z-order changing.
                  comp.mixOnZOrderChanging(oldZindex, index);
              }
          }
--- a/src/share/classes/java/awt/Cursor.java	Fri Jan 30 16:19:11 2009 -0800
+++ b/src/share/classes/java/awt/Cursor.java	Fri Jan 30 16:23:12 2009 -0800
@@ -31,7 +31,6 @@
 import java.io.File;
 import java.io.FileInputStream;
 
-import java.beans.ConstructorProperties;
 import java.util.Hashtable;
 import java.util.Properties;
 import java.util.StringTokenizer;
@@ -363,7 +362,6 @@
      * @throws IllegalArgumentException if the specified cursor type
      * is invalid
      */
-    @ConstructorProperties({"type"})
     public Cursor(int type) {
 	if (type < Cursor.DEFAULT_CURSOR || type > Cursor.MOVE_CURSOR) {
 	    throw new IllegalArgumentException("illegal cursor type");
--- a/src/share/classes/java/awt/ScrollPane.java	Fri Jan 30 16:19:11 2009 -0800
+++ b/src/share/classes/java/awt/ScrollPane.java	Fri Jan 30 16:23:12 2009 -0800
@@ -31,7 +31,6 @@
 import sun.awt.ScrollPaneWheelScroller;
 import sun.awt.SunToolkit;
 
-import java.beans.ConstructorProperties;
 import java.io.ObjectInputStream;
 import java.io.ObjectOutputStream;
 import java.io.IOException;
@@ -197,7 +196,6 @@
      *     returns true
      * @see java.awt.GraphicsEnvironment#isHeadless
      */
-    @ConstructorProperties({"scrollbarDisplayPolicy"})
     public ScrollPane(int scrollbarDisplayPolicy) throws HeadlessException {
         GraphicsEnvironment.checkHeadless();
 	this.layoutMgr = null;
--- a/src/share/classes/java/awt/Window.java	Fri Jan 30 16:19:11 2009 -0800
+++ b/src/share/classes/java/awt/Window.java	Fri Jan 30 16:23:12 2009 -0800
@@ -683,19 +683,12 @@
     }
 
     /**
-     * Causes this Window to be sized to fit the preferred size 
-     * and layouts of its subcomponents. The resulting width and 
-     * height of the window are automatically enlarged if either
-     * of dimensions is less than the minimum size as specified 
-     * by the previous call to the {@code setMinimumSize} method.
-     * <p>
-     * If the window and/or its owner are not displayable yet, 
-     * both of them are made displayable before calculating 
-     * the preferred size. The Window is validated after its 
-     * size is being calculated.
-     *                 
+     * Causes this Window to be sized to fit the preferred size
+     * and layouts of its subcomponents.  If the window and/or its owner
+     * are not yet displayable, both are made displayable before
+     * calculating the preferred size.  The Window will be validated
+     * after the preferredSize is calculated.
      * @see Component#isDisplayable
-     * @see #setMinimumSize
      */
     public void pack() {
         Container parent = this.parent;
@@ -726,13 +719,10 @@
      * <p>
      * If the {@code setSize} or {@code setBounds} methods
      * are called afterwards with a width or height less than
-     * that was specified by the {@code setMinimumSize} method 
-     * the window is automatically enlarged to meet 
-     * the {@code minimumSize} value. The {@code minimumSize} 
-     * value also affects the behaviour of the {@code pack} method.
-     * <p> 
-     * The default behavior is restored by setting the minimum size 
-     * parameter to the {@code null} value.
+     * that specified by {@code setMinimumSize} the window
+     * is automatically enlarged to honor the {@code minimumSize}
+     * value. Setting the minimum size to {@code null} restores
+     * the default behavior.
      * <p>
      * Resizing operation may be restricted if the user tries
      * to resize window below the {@code minimumSize} value.
@@ -743,7 +733,6 @@
      * @see #getMinimumSize
      * @see #isMinimumSizeSet
      * @see #setSize(Dimension)
-     * @see #pack
      * @since 1.6
      */
     public void setMinimumSize(Dimension minimumSize) {
@@ -2885,49 +2874,18 @@
 
     /**
      * Sets the location of the window relative to the specified
-     * component according to the following scenarios.
-     * <p>
-     * The target screen mentioned below is a screen to which
-     * the window should be placed after the setLocationRelativeTo
-     * method is called.
-     * <ul>
-     * <li>If the component is {@code null}, or the {@code
-     * GraphicsConfiguration} associated with this component is
-     * {@code null}, the window is placed in the center of the
-     * screen. The center point can be obtained with the {@link
-     * GraphicsEnvironment#getCenterPoint
-     * GraphicsEnvironment.getCenterPoint} method.
-     * <li>If the component is not {@code null}, but it is not
-     * currently showing, the window is placed in the center of
-     * the target screen defined by the {@code
-     * GraphicsConfiguration} associated with this component.
-     * <li>If the component is not {@code null} and is shown on
-     * the screen, then the window is located in such a way that
-     * the center of the window coincides with the center of the
      * component.
-     * </ul>
      * <p>
-     * If the screens configuration does not allow the window to
-     * be moved from one screen to another, then the window is
-     * only placed at the location determined according to the
-     * above conditions and its {@code GraphicsConfiguration} is
-     * not changed.
+     * If the component is not currently showing, or <code>c</code>
+     * is <code>null</code>, the window is placed at the center of
+     * the screen. The center point can be determined with {@link 
+     * GraphicsEnvironment#getCenterPoint GraphicsEnvironment.getCenterPoint}
      * <p>
-     * <b>Note</b>: If the lower edge of the window is out of the screen,
-     * then the window is placed to the side of the <code>Component</code>
-     * that is closest to the center of the screen. So if the
-     * component is on the right part of the screen, the window
-     * is placed to its left, and vice versa. 
-     * <p>
-     * If after the window location has been calculated, the upper,
-     * left, or right edge of the window is out of the screen,
-     * then the window is located in such a way that the upper,
-     * left, or right edge of the window coincides with the
-     * corresponding edge of the screen. If both left and right
-     * edges of the window are out of the screen, the window is
-     * placed at the left side of the screen. The similar placement
-     * will occur if both top and bottom edges are out of the screen.
-     * In that case, the window is placed at the top side of the screen.
+     * If the bottom of the component is offscreen, the window is
+     * placed to the side of the <code>Component</code> that is
+     * closest to the center of the screen.  So if the <code>Component</code>
+     * is on the right part of the screen, the <code>Window</code>
+     * is placed to its left, and vice versa.
      *
      * @param c  the component in relation to which the window's location
      *           is determined
@@ -2935,66 +2893,59 @@
      * @since 1.4
      */
     public void setLocationRelativeTo(Component c) {
-        // target location
-        int dx = 0, dy = 0;
-        // target GC
-        GraphicsConfiguration gc = this.graphicsConfig;
-        Rectangle gcBounds = gc.getBounds();
-
-        Dimension windowSize = getSize();
-
-        // search a top-level of c
-        Window componentWindow = Component.getContainingWindow(c);
-        if ((c == null) || (componentWindow == null)) {
-            GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
-            gc = ge.getDefaultScreenDevice().getDefaultConfiguration();
-            gcBounds = gc.getBounds();
-            Point centerPoint = ge.getCenterPoint();
-            dx = centerPoint.x - windowSize.width / 2;
-            dy = centerPoint.y - windowSize.height / 2;
-        } else if (!c.isShowing()) {
-            gc = componentWindow.getGraphicsConfiguration();
-            gcBounds = gc.getBounds();
-            dx = gcBounds.x + (gcBounds.width - windowSize.width) / 2;
-            dy = gcBounds.y + (gcBounds.height - windowSize.height) / 2;
-        } else {
-            gc = componentWindow.getGraphicsConfiguration();
-            gcBounds = gc.getBounds();
-            Dimension compSize = c.getSize();
-            Point compLocation = c.getLocationOnScreen();
-            dx = compLocation.x + ((compSize.width - windowSize.width) / 2);
-            dy = compLocation.y + ((compSize.height - windowSize.height) / 2);
-
-            // Adjust for bottom edge being offscreen
-            if (dy + windowSize.height > gcBounds.y + gcBounds.height) {
-                dy = gcBounds.y + gcBounds.height - windowSize.height;
-                if (compLocation.x - gcBounds.x + compSize.width / 2 < gcBounds.width / 2) {
-                    dx = compLocation.x + compSize.width;
-                } else {
-                    dx = compLocation.x - windowSize.width;
+        Container root=null;
+ 
+        if (c != null) {
+            if (c instanceof Window || c instanceof Applet) {
+                root = (Container)c;
+            } else {
+                Container parent;
+                for(parent = c.getParent() ; parent != null ; parent = parent.getParent()) {
+                    if (parent instanceof Window || parent instanceof Applet) {
+                        root = parent;
+                        break;
+                    }
                 }
             }
         }
-
-        // Avoid being placed off the edge of the screen:
-        // bottom
-        if (dy + windowSize.height > gcBounds.y + gcBounds.height) {
-            dy = gcBounds.y + gcBounds.height - windowSize.height;
-        }
-        // top
-        if (dy < gcBounds.y) {
-            dy = gcBounds.y;
+ 
+        if((c != null && !c.isShowing()) || root == null ||
+           !root.isShowing()) {
+            Dimension         paneSize = getSize();
+ 
+            Point centerPoint = GraphicsEnvironment.getLocalGraphicsEnvironment().getCenterPoint();
+            setLocation(centerPoint.x - paneSize.width / 2,
+                        centerPoint.y - paneSize.height / 2);
+        } else {
+            Dimension invokerSize = c.getSize();
+            Point invokerScreenLocation = c.getLocationOnScreen();
+ 
+            Rectangle  windowBounds = getBounds();
+            int        dx = invokerScreenLocation.x+((invokerSize.width-windowBounds.width)>>1);
+            int        dy = invokerScreenLocation.y+((invokerSize.height - windowBounds.height)>>1);
+            Rectangle ss = root.getGraphicsConfiguration().getBounds();
+  
+            // Adjust for bottom edge being offscreen
+            if (dy+windowBounds.height>ss.y+ss.height) {
+                dy = ss.y + ss.height-windowBounds.height;
+                if (invokerScreenLocation.x - ss.x + invokerSize.width / 2 <
+                    ss.width / 2) {
+                    dx = invokerScreenLocation.x+invokerSize.width;
+                }
+                else {
+                    dx = invokerScreenLocation.x-windowBounds.width;
+                }
+            }
+ 
+            // Avoid being placed off the edge of the screen
+            if (dx+windowBounds.width > ss.x + ss.width) {
+                dx = ss.x + ss.width - windowBounds.width;
+            }
+            if (dx < ss.x) dx = ss.x;
+            if (dy < ss.y) dy = ss.y;
+  
+            setLocation(dx, dy);
         }
-        // right
-        if (dx + windowSize.width > gcBounds.x + gcBounds.width) {
-            dx = gcBounds.x + gcBounds.width - windowSize.width;
-        }
-        // left
-        if (dx < gcBounds.x) {
-            dx = gcBounds.x;
-        }
-
-        setLocation(dx, dy);
     }
     
     /**
--- a/src/share/classes/java/awt/datatransfer/DataFlavor.java	Fri Jan 30 16:19:11 2009 -0800
+++ b/src/share/classes/java/awt/datatransfer/DataFlavor.java	Fri Jan 30 16:23:12 2009 -0800
@@ -888,10 +888,8 @@
     }
     
     /**
-     * {@inheritDoc}
-     * <p>
-     * The equals comparison for the {@code DataFlavor} class is implemented
-     * as follows: Two <code>DataFlavor</code>s are considered equal if and
+     * Tests an arbitrary <code>Object</code> to this <code>DataFlavor</code>
+     * for equality. Two <code>DataFlavor</code>s are considered equal if and
      * only if their MIME primary type and subtype and representation class are
      * equal. Additionally, if the primary type is "text", the subtype denotes
      * a text flavor which supports the charset parameter, and the
@@ -913,9 +911,18 @@
     }
 
     /**
-     * This method has the same behavior as {@link #equals(Object)}.
-     * The only difference being that it takes a {@code DataFlavor} instance
-     * as a parameter.
+     * Tests a <code>DataFlavor</code> to this <code>DataFlavor</code> for
+     * equality. Two <code>DataFlavor</code>s are considered equal if and only
+     * if their MIME primary type and subtype and representation class are
+     * equal. Additionally, if the primary type is "text", the subtype denotes
+     * a text flavor which supports the charset parameter, and the
+     * representation class is not <code>java.io.Reader</code>,
+     * <code>java.lang.String</code>, <code>java.nio.CharBuffer</code>, or
+     * <code>[C</code>, the <code>charset</code> parameter must also be equal.
+     * If a charset is not explicitly specified for one or both
+     * <code>DataFlavor</code>s, the platform default encoding is assumed. See
+     * <code>selectBestTextFlavor</code> for a list of text flavors which
+     * support the charset parameter.
      *
      * @param that the <code>DataFlavor</code> to compare with
      *        <code>this</code>
@@ -981,14 +988,12 @@
      * Compares only the <code>mimeType</code> against the passed in 
      * <code>String</code> and <code>representationClass</code> is
      * not considered in the comparison.
-     *
      * If <code>representationClass</code> needs to be compared, then
      * <code>equals(new DataFlavor(s))</code> may be used.
+     *
      * @deprecated As inconsistent with <code>hashCode()</code> contract,
      *             use <code>isMimeTypeEqual(String)</code> instead.
-     * @param s the {@code mimeType} to compare.
-     * @return true if the String (MimeType) is equal; false otherwise or if
-     *         {@code s} is {@code null}
+     * @return true if the String (MimeType) is equal
      */
     @Deprecated
     public boolean equals(String s) {
@@ -1045,7 +1050,18 @@
     }
 
     /**
-     * Identical to {@link #equals(DataFlavor)}.
+     * Tests a <code>DataFlavor</code> to this <code>DataFlavor</code> for
+     * equality. Two <code>DataFlavor</code>s are considered equal if and only
+     * if their MIME primary type and subtype and representation class are
+     * equal. Additionally, if the primary type is "text", the subtype denotes
+     * a text flavor which supports the charset parameter, and the
+     * representation class is not <code>java.io.Reader</code>,
+     * <code>java.lang.String</code>, <code>java.nio.CharBuffer</code>, or
+     * <code>[C</code>, the <code>charset</code> parameter must also be equal.
+     * If a charset is not explicitly specified for one or both
+     * <code>DataFlavor</code>s, the platform default encoding is assumed. See
+     * <code>selectBestTextFlavor</code> for a list of text flavors which
+     * support the charset parameter.
      *
      * @param that the <code>DataFlavor</code> to compare with
      *        <code>this</code>
--- a/src/share/classes/java/awt/datatransfer/FlavorEvent.java	Fri Jan 30 16:19:11 2009 -0800
+++ b/src/share/classes/java/awt/datatransfer/FlavorEvent.java	Fri Jan 30 16:23:12 2009 -0800
@@ -43,8 +43,6 @@
      * Constructs a <code>FlavorEvent</code> object.
      *
      * @param source  the <code>Clipboard</code> that is the source of the event
-     *
-     * @throws IllegalArgumentException if the {@code source} is {@code null}
      */
     public FlavorEvent(Clipboard source) {
         super(source);
--- a/src/share/classes/java/awt/event/KeyEvent.java	Fri Jan 30 16:19:11 2009 -0800
+++ b/src/share/classes/java/awt/event/KeyEvent.java	Fri Jan 30 16:23:12 2009 -0800
@@ -907,12 +907,6 @@
      */
     private static native void initIDs();
 
-    private KeyEvent(Component source, int id, long when, int modifiers,
-                    int keyCode, char keyChar, int keyLocation, boolean isProxyActive) {
-        this(source, id, when, modifiers, keyCode, keyChar, keyLocation);
-        this.isProxyActive = isProxyActive;
-    }
-    
     /**
      * Constructs a <code>KeyEvent</code> object.
      * <p>Note that passing in an invalid <code>id</code> results in
@@ -951,6 +945,11 @@
      * @throws IllegalArgumentException if <code>source</code> is null
      * @since 1.4
      */
+    private KeyEvent(Component source, int id, long when, int modifiers,
+                    int keyCode, char keyChar, int keyLocation, boolean isProxyActive) {
+        this(source, id, when, modifiers, keyCode, keyChar, keyLocation);
+        this.isProxyActive = isProxyActive;
+    }
     public KeyEvent(Component source, int id, long when, int modifiers,
                     int keyCode, char keyChar, int keyLocation) {
         super(source, id, when, modifiers);
--- a/src/share/classes/java/awt/package.html	Fri Jan 30 16:19:11 2009 -0800
+++ b/src/share/classes/java/awt/package.html	Fri Jan 30 16:23:12 2009 -0800
@@ -41,19 +41,6 @@
 tainer can also have a layout manager that controls the visual placement of components in the
 container. The AWT package contains several layout manager classes and an interface for
 building your own layout manager. See Container and LayoutManager for more information.
-<p>
-Each {@code Component} object is limited in its maximum size and
-its location because the values are stored as an integer.
-Also, a platform may further restrict maximum size and location
-coordinates. The exact maximum values are dependent on the platform.
-There is no way to change these maximum values, either in Java
-code or in native code.
-These limitations also impose restrictions on component layout.
-If the bounds of a Component object exceed a platform limit,
-there is no way to properly arrange them within a Container object.
-The object's bounds are defined by any object's coordinate
-in combination with its size on a respective axis. 
-<p>
 
 <h2>Additional Specification</h2>
 <ul>
--- a/src/share/classes/java/beans/EventHandler.java	Fri Jan 30 16:19:11 2009 -0800
+++ b/src/share/classes/java/beans/EventHandler.java	Fri Jan 30 16:23:12 2009 -0800
@@ -309,7 +309,6 @@
      * @see #getEventPropertyName
      * @see #getListenerMethodName
      */
-    @ConstructorProperties({"target", "action", "eventPropertyName", "listenerMethodName"})
     public EventHandler(Object target, String action, String eventPropertyName, String listenerMethodName) {
 	this.acc = AccessController.getContext();
         this.target = target;
--- a/src/share/classes/java/beans/Expression.java	Fri Jan 30 16:19:11 2009 -0800
+++ b/src/share/classes/java/beans/Expression.java	Fri Jan 30 16:23:12 2009 -0800
@@ -61,7 +61,6 @@
      *     
      * @see #getValue
      */
-    @ConstructorProperties({"target", "methodName", "arguments"})
     public Expression(Object target, String methodName, Object[] arguments) { 
         super(target, methodName, arguments); 
     } 
--- a/src/share/classes/java/beans/MetaData.java	Fri Jan 30 16:19:11 2009 -0800
+++ b/src/share/classes/java/beans/MetaData.java	Fri Jan 30 16:23:12 2009 -0800
@@ -1364,6 +1364,70 @@
 
     static {
 
+// Constructors.
+
+  // beans
+
+        registerConstructor("java.beans.Statement", new String[]{"target", "methodName", "arguments"});
+        registerConstructor("java.beans.Expression", new String[]{"target", "methodName", "arguments"});
+        registerConstructor("java.beans.EventHandler", new String[]{"target", "action", "eventPropertyName", "listenerMethodName"});
+
+  // awt
+  
+        registerConstructor("java.awt.Color", new String[]{"red", "green", "blue", "alpha"});
+        registerConstructor("java.awt.Cursor", new String[]{"type"});
+        registerConstructor("java.awt.ScrollPane", new String[]{"scrollbarDisplayPolicy"});
+
+  // swing
+
+        registerConstructor("javax.swing.plaf.ColorUIResource", new String[]{"red", "green", "blue"});
+
+        registerConstructor("javax.swing.tree.DefaultTreeModel", new String[]{"root"});
+        registerConstructor("javax.swing.JTree", new String[]{"model"});
+        registerConstructor("javax.swing.tree.TreePath", new String[]{"path"});
+
+        registerConstructor("javax.swing.OverlayLayout", new String[]{"target"});
+        registerConstructor("javax.swing.BoxLayout", new String[]{"target", "axis"});
+        registerConstructor("javax.swing.Box$Filler", new String[]{"minimumSize", "preferredSize",
+                                                                   "maximumSize"});
+        registerConstructor("javax.swing.DefaultCellEditor", new String[]{"component"});
+
+        /*
+        This is required because the JSplitPane reveals a private layout class
+        called BasicSplitPaneUI$BasicVerticalLayoutManager which changes with
+        the orientation. To avoid the necessity for instantiating it we cause
+        the orientation attribute to get set before the layout manager - that
+        way the layout manager will be changed as a side effect. Unfortunately,
+        the layout property belongs to the superclass and therefore precedes
+        the orientation property. PENDING - we need to allow this kind of
+        modification. For now, put the property in the constructor.
+        */
+        registerConstructor("javax.swing.JSplitPane", new String[]{"orientation"});
+        // Try to synthesize the ImageIcon from its description.
+        registerConstructor("javax.swing.ImageIcon", new String[]{"description"});
+        // JButton's "text" and "actionCommand" properties are related,
+        // use the text as a constructor argument to ensure that it is set first.
+        // This remove the benign, but unnecessary, manipulation of actionCommand
+        // property in the common case.
+        registerConstructor("javax.swing.JButton", new String[]{"text"});
+
+        // borders
+
+        registerConstructor("javax.swing.border.BevelBorder", new String[]{"bevelType", "highlightOuterColor", "highlightInnerColor", "shadowOuterColor", "shadowInnerColor"});
+        registerConstructor("javax.swing.plaf.BorderUIResource$BevelBorderUIResource", new String[]{"bevelType", "highlightOuterColor", "highlightInnerColor", "shadowOuterColor", "shadowInnerColor"});
+        registerConstructor("javax.swing.border.CompoundBorder", new String[]{"outsideBorder", "insideBorder"});
+        registerConstructor("javax.swing.plaf.BorderUIResource$CompoundBorderUIResource", new String[]{"outsideBorder", "insideBorder"});
+        registerConstructor("javax.swing.border.EmptyBorder", new String[]{"borderInsets"});
+        registerConstructor("javax.swing.plaf.BorderUIResource$EmptyBorderUIResource", new String[]{"borderInsets"});
+        registerConstructor("javax.swing.border.EtchedBorder", new String[]{"etchType", "highlightColor", "shadowColor"});
+        registerConstructor("javax.swing.plaf.BorderUIResource$EtchedBorderUIResource", new String[]{"etchType", "highlightColor", "shadowColor"});
+        registerConstructor("javax.swing.border.LineBorder", new String[]{"lineColor", "thickness"});
+        registerConstructor("javax.swing.plaf.BorderUIResource$LineBorderUIResource", new String[]{"lineColor", "thickness"});
+        registerConstructor("javax.swing.border.SoftBevelBorder", new String[]{"bevelType", "highlightOuterColor", "highlightInnerColor", "shadowOuterColor", "shadowInnerColor"});
+        // registerConstructorWithBadEqual("javax.swing.plaf.BorderUIResource$SoftBevelBorderUIResource", new String[]{"bevelType", "highlightOuter", "highlightInner", "shadowOuter", "shadowInner"});
+        registerConstructor("javax.swing.border.TitledBorder", new String[]{"border", "title", "titleJustification", "titlePosition", "titleFont", "titleColor"});
+        registerConstructor("javax.swing.plaf.BorderUIResource$TitledBorderUIResource", new String[]{"border", "title", "titleJustification", "titlePosition", "titleFont", "titleColor"});
+
         internalPersistenceDelegates.put("java.net.URI",
                                          new PrimitivePersistenceDelegate());
 
@@ -1627,6 +1691,14 @@
 	return getBeanInfo(type).getBeanDescriptor().getValue(attribute);
     }
 
+    // MetaData registration
+
+    private synchronized static void registerConstructor(String typeName, 
+                                                         String[] constructor) {
+        internalPersistenceDelegates.put(typeName, 
+                                         new DefaultPersistenceDelegate(constructor));
+    }
+
     private static void removeProperty(String typeName, String property) {
         Vector tp = (Vector)transientProperties.get(typeName);
         if (tp == null) {
--- a/src/share/classes/java/beans/Statement.java	Fri Jan 30 16:19:11 2009 -0800
+++ b/src/share/classes/java/beans/Statement.java	Fri Jan 30 16:23:12 2009 -0800
@@ -75,7 +75,6 @@
      * @param arguments The arguments of this statement. If <code>null</code> then an empty array will be used.
      *
      */
-    @ConstructorProperties({"target", "methodName", "arguments"})
     public Statement(Object target, String methodName, Object[] arguments) {
 	this.target = target;
         this.methodName = methodName;
--- a/src/share/classes/java/beans/VetoableChangeSupport.java	Fri Jan 30 16:19:11 2009 -0800
+++ b/src/share/classes/java/beans/VetoableChangeSupport.java	Fri Jan 30 16:23:12 2009 -0800
@@ -294,9 +294,6 @@
                                                  event.getNewValue(),
                                                  event.getOldValue() );
                 for (VetoableChangeListener listener : listeners) {
-                    if (current == listener) {
-                        break;
-                    }
 		    try {
                         listener.vetoableChange(event);
 		    } catch (PropertyVetoException ex) {
--- a/src/share/classes/java/lang/Override.java	Fri Jan 30 16:19:11 2009 -0800
+++ b/src/share/classes/java/lang/Override.java	Fri Jan 30 16:23:12 2009 -0800
@@ -29,21 +29,11 @@
 
 /**
  * Indicates that a method declaration is intended to override a
- * method declaration in a supertype. If a method is annotated with
- * this annotation type compilers are required to generate an error
- * message unless at least one of the following conditions hold:
+ * method declaration in a superclass.  If a method is annotated with
+ * this annotation type but does not override a superclass method,
+ * compilers are required to generate an error message.
  *
- * <ul><li>
- * The method does override or implement a method declared in a
- * supertype.
- * </li><li>
- * The method has a signature that is override-equivalent to that of
- * any public method declared in {@linkplain Object}.
- * </li></ul>
- *
- * @author  Peter von der Ah&eacute;
  * @author  Joshua Bloch
- * @jls3 9.6.1.4 Override
  * @since 1.5
  */
 @Target(ElementType.METHOD)
--- a/src/share/classes/javax/sound/sampled/spi/FormatConversionProvider.java	Fri Jan 30 16:19:11 2009 -0800
+++ b/src/share/classes/javax/sound/sampled/spi/FormatConversionProvider.java	Fri Jan 30 16:23:12 2009 -0800
@@ -57,9 +57,8 @@
     /**
      * Obtains the set of source format encodings from which format
      * conversion services are provided by this provider.
-     * @return array of source format encodings. If for some reason provider
-     * does not provide any conversion services, an array of length 0 is
-     * returned.
+     * @return array of source format encodings.  The array will always
+     * have a length of at least 1.
      */
     public abstract AudioFormat.Encoding[] getSourceEncodings();
 
@@ -67,9 +66,8 @@
     /**
      * Obtains the set of target format encodings to which format
      * conversion services are provided by this provider.
-     * @return array of target format encodings. If for some reason provider
-     * does not provide any conversion services, an array of length 0 is
-     * returned.
+     * @return array of target format encodings.  The array will always
+     * have a length of at least 1.
      */
     public abstract AudioFormat.Encoding[] getTargetEncodings();
 
--- a/src/share/classes/javax/swing/Box.java	Fri Jan 30 16:19:11 2009 -0800
+++ b/src/share/classes/javax/swing/Box.java	Fri Jan 30 16:23:12 2009 -0800
@@ -28,7 +28,6 @@
 
 import java.awt.*;
 import java.awt.event.*;
-import java.beans.ConstructorProperties;
 import java.util.Locale;
 import java.io.Serializable;
 import javax.accessibility.*;
@@ -311,7 +310,6 @@
 	 * @param pref  Preferred size
 	 * @param max   Maximum size
 	 */
-        @ConstructorProperties({"minimumSize", "preferredSize", "maximumSize"})
         public Filler(Dimension min, Dimension pref, Dimension max) {
             setMinimumSize(min);
             setPreferredSize(pref);
--- a/src/share/classes/javax/swing/BoxLayout.java	Fri Jan 30 16:19:11 2009 -0800
+++ b/src/share/classes/javax/swing/BoxLayout.java	Fri Jan 30 16:23:12 2009 -0800
@@ -27,7 +27,6 @@
 package javax.swing;
 
 import java.awt.*;
-import java.beans.ConstructorProperties;
 import java.io.Serializable;
 import java.io.PrintStream;
 
@@ -175,7 +174,6 @@
      *
      * @exception AWTError  if the value of <code>axis</code> is invalid 
      */
-    @ConstructorProperties({"target", "axis"})
     public BoxLayout(Container target, int axis) {
         if (axis != X_AXIS && axis != Y_AXIS && 
             axis != LINE_AXIS && axis != PAGE_AXIS) {
--- a/src/share/classes/javax/swing/DefaultCellEditor.java	Fri Jan 30 16:19:11 2009 -0800
+++ b/src/share/classes/javax/swing/DefaultCellEditor.java	Fri Jan 30 16:23:12 2009 -0800
@@ -27,7 +27,6 @@
 
 import java.awt.Component;
 import java.awt.event.*;
-import java.beans.ConstructorProperties;
 import java.lang.Boolean;
 import javax.swing.table.*;
 import javax.swing.event.*;
@@ -82,7 +81,6 @@
      *
      * @param textField  a <code>JTextField</code> object
      */
-    @ConstructorProperties({"component"})
     public DefaultCellEditor(final JTextField textField) {
         editorComponent = textField;
 	this.clickCountToStart = 2;
--- a/src/share/classes/javax/swing/ImageIcon.java	Fri Jan 30 16:19:11 2009 -0800
+++ b/src/share/classes/javax/swing/ImageIcon.java	Fri Jan 30 16:23:12 2009 -0800
@@ -26,7 +26,6 @@
 
 import java.awt.*;
 import java.awt.image.*;
-import java.beans.ConstructorProperties;
 import java.net.URL;
 
 import java.io.Serializable;
@@ -122,7 +121,6 @@
      * @param filename a String specifying a filename or path
      * @see #getDescription
      */
-    @ConstructorProperties({"description"})
     public ImageIcon (String filename) {
         this(filename, filename);
     }
--- a/src/share/classes/javax/swing/JButton.java	Fri Jan 30 16:19:11 2009 -0800
+++ b/src/share/classes/javax/swing/JButton.java	Fri Jan 30 16:23:12 2009 -0800
@@ -24,8 +24,6 @@
  */
 package javax.swing;
 
-import java.beans.ConstructorProperties;
-
 import java.awt.*;
 import java.awt.event.*;
 import java.awt.image.*;
@@ -105,7 +103,6 @@
      *
      * @param text  the text of the button
      */
-    @ConstructorProperties({"text"})
     public JButton(String text) {
         this(text, null);
     }
--- a/src/share/classes/javax/swing/JSplitPane.java	Fri Jan 30 16:19:11 2009 -0800
+++ b/src/share/classes/javax/swing/JSplitPane.java	Fri Jan 30 16:23:12 2009 -0800
@@ -29,7 +29,6 @@
 
 
 
-import java.beans.ConstructorProperties;
 import javax.swing.plaf.*;
 import javax.accessibility.*;
 
@@ -262,7 +261,6 @@
      * @exception IllegalArgumentException if <code>orientation</code>
      *		is not one of HORIZONTAL_SPLIT or VERTICAL_SPLIT.
      */
-    @ConstructorProperties({"orientation"})
     public JSplitPane(int newOrientation) {
         this(newOrientation, false);
     }
--- a/src/share/classes/javax/swing/JTree.java	Fri Jan 30 16:19:11 2009 -0800
+++ b/src/share/classes/javax/swing/JTree.java	Fri Jan 30 16:23:12 2009 -0800
@@ -533,8 +533,8 @@
      * <li>a <code>Hashtable</code>, or
      * <li>a <code>Vector</code>
      * </ul>then a new root node is created with each of the incoming 
-     * objects as children. Otherwise, a new root is created with
-     * a value of {@code "root"}.
+     * objects as children. Otherwise, a new root is created with the 
+     * specified object as its value.
      *
      * @param value  the <code>Object</code> used as the foundation for
      *		the <code>TreeModel</code>
@@ -650,7 +650,6 @@
      *
      * @param newModel  the <code>TreeModel</code> to use as the data model
      */
-    @ConstructorProperties({"model"})
     public JTree(TreeModel newModel) {
         super();
 	expandedStack = new Stack();
@@ -680,8 +679,6 @@
 
     /**
      * Sets the L&F object that renders this component.
-     * <p>
-     * This is a bound property.  
      *
      * @param ui  the <code>TreeUI</code> L&F object
      * @see UIDefaults#getUI
@@ -744,8 +741,6 @@
     /**
      * Sets the <code>TreeCellRenderer</code> that will be used to
      * draw each cell.
-     * <p>
-     * This is a bound property.  
      *
      * @param x  the <code>TreeCellRenderer</code> that is to render each cell
      * @beaninfo
@@ -765,8 +760,6 @@
       * Determines whether the tree is editable. Fires a property
       * change event if the new setting is different from the existing
       * setting.
-     * <p>
-     * This is a bound property.  
       *
       * @param flag  a boolean value, true if the tree is editable
       * @beaninfo
@@ -800,8 +793,6 @@
      * tree cannot be edited.  If this represents a change in the
      * <code>cellEditor</code>, the <code>propertyChange</code>
      * method is invoked on all listeners.
-     * <p>
-     * This is a bound property.  
      *
      * @param cellEditor the <code>TreeCellEditor</code> to use
      * @beaninfo
@@ -838,8 +829,6 @@
 
     /**
      * Sets the <code>TreeModel</code> that will provide the data.
-     * <p>
-     * This is a bound property.  
      *
      * @param newModel the <code>TreeModel</code> that is to provide the data
      * @beaninfo
@@ -894,8 +883,6 @@
     /**
      * Determines whether or not the root node from
      * the <code>TreeModel</code> is visible.
-     * <p>
-     * This is a bound property.  
      *
      * @param rootVisible true if the root node of the tree is to be displayed
      * @see #rootVisible
@@ -921,8 +908,6 @@
      * used to create the <code>JTree</code>.
      * Some look and feels might not support handles;
      * they will ignore this property.
-     * <p>
-     * This is a bound property.  
      *
      * @param newValue <code>true</code> if root handles should be displayed;
      *                 otherwise, <code>false</code>
@@ -962,8 +947,6 @@
      * Sets the height of each cell, in pixels.  If the specified value
      * is less than or equal to zero the current cell renderer is
      * queried for each row's height.
-     * <p>
-     * This is a bound property.  
      *
      * @param rowHeight the height of each cell, in pixels
      * @beaninfo
@@ -1005,8 +988,6 @@
      * Specifies whether the UI should use a large model.
      * (Not all UIs will implement this.) Fires a property change
      * for the LARGE_MODEL_PROPERTY.
-     * <p>
-     * This is a bound property.  
      * 
      * @param newValue true to suggest a large model to the UI
      * @see #largeModel
@@ -1079,8 +1060,6 @@
      * the maximum possible number of the node's descendants visible.
      * In some look and feels, trees might not need to scroll when expanded;
      * those look and feels will ignore this property.
-     * <p>
-     * This is a bound property.  
      *
      * @param newValue <code>false</code> to disable scrolling on expansion;
      *                 <code>true</code> to enable it
@@ -1111,8 +1090,6 @@
     /**
      * Sets the number of mouse clicks before a node will expand or close.
      * The default is two. 
-     * <p>
-     * This is a bound property.  
      *
      * @since 1.3
      * @beaninfo
@@ -1148,8 +1125,6 @@
      * changes the nodes parent is not made visible (all its parents expanded).
      * This is useful if you wish to have your selection model maintain paths
      * that are not always visible (all parents expanded).
-     * <p>
-     * This is a bound property.  
      *
      * @param newValue the new value for <code>expandsSelectedPaths</code>
      *
@@ -1646,8 +1621,6 @@
      * Sets the path identifies as the lead. The lead may not be selected.
      * The lead is not maintained by <code>JTree</code>,
      * rather the UI will update it.
-     * <p>
-     * This is a bound property.  
      *
      * @param newPath  the new lead path
      * @since 1.3
@@ -1666,8 +1639,6 @@
      * Sets the path identified as the anchor.
      * The anchor is not maintained by <code>JTree</code>, rather the UI will 
      * update it.
-     * <p>
-     * This is a bound property.  
      *
      * @param newPath  the new anchor path
      * @since 1.3
@@ -2153,13 +2124,12 @@
 
     /**
      * Returns the path for the specified row.  If <code>row</code> is
-     * not visible, or a {@code TreeUI} has not been set, <code>null</code>
-     * is returned.
+     * not visible, <code>null</code> is returned.
      *
      * @param row  an integer specifying a row
      * @return the <code>TreePath</code> to the specified node,
      *		<code>null</code> if <code>row < 0</code>
-     *          or <code>row >= getRowCount()</code>
+     *		or <code>row > getRowCount()</code>
      */
     public TreePath getPathForRow(int row) {
         TreeUI                  tree = getUI();
@@ -2414,8 +2384,6 @@
      * Sets the tree's selection model. When a <code>null</code> value is
      * specified an empty
      * <code>selectionModel</code> is used, which does not allow selections.
-     * <p>
-     * This is a bound property.  
      *
      * @param selectionModel the <code>TreeSelectionModel</code> to use,
      *		or <code>null</code> to disable selections
@@ -2878,8 +2846,6 @@
      * This will only work if the tree is contained in a 
      * <code>JScrollPane</code>,
      * and will adjust the preferred size and size of that scrollpane.
-     * <p>
-     * This is a bound property.  
      *
      * @param newCount the number of rows to display
      * @beaninfo
@@ -3183,107 +3149,21 @@
     protected static class EmptySelectionModel extends
               DefaultTreeSelectionModel
     {
-        /**
-         * The single instance of {@code EmptySelectionModel}.
-         */
+        /** Unique shared instance. */
         protected static final EmptySelectionModel sharedInstance =
             new EmptySelectionModel();
 
-        /**
-         * Returns the single instance of {@code EmptySelectionModel}.
-         *
-         * @return single instance of {@code EmptySelectionModel}
-         */
+        /** Returns a shared instance of an empty selection model. */
         static public EmptySelectionModel sharedInstance() {
             return sharedInstance;
         }
 
-        /**
-         * This is overriden to do nothing; {@code EmptySelectionModel}
-         * does not allow a selection.
-         *
-         * @param paths the paths to select; this is ignored
-         */
-        public void setSelectionPaths(TreePath[] paths) {}
-
-        /**
-         * This is overriden to do nothing; {@code EmptySelectionModel}
-         * does not allow a selection.
-         *
-         * @param paths the paths to add to the selection; this is ignored
-         */
+        /** A <code>null</code> implementation that selects nothing. */
+        public void setSelectionPaths(TreePath[] pPaths) {}
+        /** A <code>null</code> implementation that adds nothing. */
         public void addSelectionPaths(TreePath[] paths) {}
-
-        /**
-         * This is overriden to do nothing; {@code EmptySelectionModel}
-         * does not allow a selection.
-         *
-         * @param paths the paths to remove; this is ignored
-         */
+        /** A <code>null</code> implementation that removes nothing. */
         public void removeSelectionPaths(TreePath[] paths) {}
-
-        /**
-         * This is overriden to do nothing; {@code EmptySelectionModel}
-         * does not allow a selection.
-         *
-         * @param mode the selection mode; this is ignored
-         * @since 1.7
-         */
-        public void setSelectionMode(int mode) {
-        }
-
-        /**
-         * This is overriden to do nothing; {@code EmptySelectionModel}
-         * does not allow a selection.
-         *
-         * @param mapper the {@code RowMapper} instance; this is ignored
-         * @since 1.7
-         */
-        public void setRowMapper(RowMapper mapper) {
-        }
-
-        /**
-         * This is overriden to do nothing; {@code EmptySelectionModel}
-         * does not allow a selection.
-         *
-         * @param listener the listener to add; this is ignored
-         * @since 1.7
-         */
-        public void addTreeSelectionListener(TreeSelectionListener listener) {
-        }
-
-        /**
-         * This is overriden to do nothing; {@code EmptySelectionModel}
-         * does not allow a selection.
-         *
-         * @param listener the listener to remove; this is ignored
-         * @since 1.7
-         */
-        public void removeTreeSelectionListener(
-                TreeSelectionListener listener) {
-        }
-
-        /**
-         * This is overriden to do nothing; {@code EmptySelectionModel}
-         * does not allow a selection.
-         *
-         * @param listener the listener to add; this is ignored
-         * @since 1.7
-         */
-        public void addPropertyChangeListener(
-                                PropertyChangeListener listener) {
-        }
-
-        /**
-         * This is overriden to do nothing; {@code EmptySelectionModel}
-         * does not allow a selection.
-         *
-         * @param listener the listener to remove; this is ignored
-         * @since 1.7
-         */
-        public void removePropertyChangeListener(
-                                PropertyChangeListener listener) {
-        }
     }
 
 
@@ -3433,7 +3313,7 @@
      * the tree is smaller than the viewports width.  In other words: 
      * ensure that the tree is never smaller than its viewport.
      * 
-     * @return whether the tree should track the width of the viewport
+     * @return false
      * @see Scrollable#getScrollableTracksViewportWidth
      */
     public boolean getScrollableTracksViewportWidth() {
@@ -3449,7 +3329,7 @@
      * of the tree is smaller than the viewports height.  In other words: 
      * ensure that the tree is never smaller than its viewport.
      * 
-     * @return whether the tree should track the height of the viewport
+     * @return false
      * @see Scrollable#getScrollableTracksViewportHeight
      */
     public boolean getScrollableTracksViewportHeight() {
@@ -3588,12 +3468,6 @@
      * Removes any descendants of the <code>TreePaths</code> in
      * <code>toRemove</code>
      * that have been expanded.
-     *
-     * @param toRemove an enumeration of the paths to remove; a value of
-     *        {@code null} is ignored
-     * @throws ClassCastException if {@code toRemove} contains an
-     *         element that is not a {@code TreePath}; {@code null}
-     *         values are ignored
      */
      protected void
 	 removeDescendantToggledPaths(Enumeration<TreePath> toRemove)
--- a/src/share/classes/javax/swing/OverlayLayout.java	Fri Jan 30 16:19:11 2009 -0800
+++ b/src/share/classes/javax/swing/OverlayLayout.java	Fri Jan 30 16:23:12 2009 -0800
@@ -26,7 +26,6 @@
 
 
 import java.awt.*;
-import java.beans.ConstructorProperties;
 import java.io.Serializable;
 
 /**
@@ -61,7 +60,6 @@
      *
      * @param target  the container to do layout against
      */
-    @ConstructorProperties({"target"})
     public OverlayLayout(Container target) {
 	this.target = target;
     }
--- a/src/share/classes/javax/swing/border/BevelBorder.java	Fri Jan 30 16:19:11 2009 -0800
+++ b/src/share/classes/javax/swing/border/BevelBorder.java	Fri Jan 30 16:23:12 2009 -0800
@@ -29,7 +29,6 @@
 import java.awt.Rectangle;
 import java.awt.Color;
 import java.awt.Component;
-import java.beans.ConstructorProperties;
 
 /**
  * A class which implements a simple two-line bevel border.
@@ -93,7 +92,6 @@
      * @param shadowOuterColor the color to use for the bevel outer shadow
      * @param shadowInnerColor the color to use for the bevel inner shadow
      */
-    @ConstructorProperties({"bevelType", "highlightOuterColor", "highlightInnerColor", "shadowOuterColor", "shadowInnerColor"})
     public BevelBorder(int bevelType, Color highlightOuterColor, 
                        Color highlightInnerColor, Color shadowOuterColor, 
                        Color shadowInnerColor) {
--- a/src/share/classes/javax/swing/border/CompoundBorder.java	Fri Jan 30 16:19:11 2009 -0800
+++ b/src/share/classes/javax/swing/border/CompoundBorder.java	Fri Jan 30 16:23:12 2009 -0800
@@ -27,7 +27,6 @@
 import java.awt.Graphics;
 import java.awt.Insets;
 import java.awt.Component;
-import java.beans.ConstructorProperties;
 
 /**
  * A composite Border class used to compose two Border objects
@@ -73,7 +72,6 @@
      * @param outsideBorder the outside border
      * @param insideBorder the inside border to be nested
      */
-    @ConstructorProperties({"outsideBorder", "insideBorder"})
     public CompoundBorder(Border outsideBorder, Border insideBorder) {
 	this.outsideBorder = outsideBorder;
 	this.insideBorder = insideBorder;
--- a/src/share/classes/javax/swing/border/EmptyBorder.java	Fri Jan 30 16:19:11 2009 -0800
+++ b/src/share/classes/javax/swing/border/EmptyBorder.java	Fri Jan 30 16:23:12 2009 -0800
@@ -29,7 +29,6 @@
 import java.awt.Rectangle;
 import java.awt.Component;
 import java.io.Serializable;
-import java.beans.ConstructorProperties;
 
 /**
  * A class which provides an empty, transparent border which
@@ -69,7 +68,6 @@
      * Creates an empty border with the specified insets.
      * @param borderInsets the insets of the border
      */
-    @ConstructorProperties({"borderInsets"})
     public EmptyBorder(Insets borderInsets)   {
         this.top = borderInsets.top; 
         this.right = borderInsets.right;
--- a/src/share/classes/javax/swing/border/EtchedBorder.java	Fri Jan 30 16:19:11 2009 -0800
+++ b/src/share/classes/javax/swing/border/EtchedBorder.java	Fri Jan 30 16:23:12 2009 -0800
@@ -29,7 +29,6 @@
 import java.awt.Rectangle;
 import java.awt.Color;
 import java.awt.Component;
-import java.beans.ConstructorProperties;
 
 /**
  * A class which implements a simple etched border which can 
@@ -100,7 +99,6 @@
      * @param highlight the color to use for the etched highlight
      * @param shadow the color to use for the etched shadow
      */
-    @ConstructorProperties({"etchType", "highlightColor", "shadowColor"})
     public EtchedBorder(int etchType, Color highlight, Color shadow)    {
         this.etchType = etchType;
         this.highlight = highlight;
--- a/src/share/classes/javax/swing/border/LineBorder.java	Fri Jan 30 16:19:11 2009 -0800
+++ b/src/share/classes/javax/swing/border/LineBorder.java	Fri Jan 30 16:23:12 2009 -0800
@@ -33,7 +33,6 @@
 import java.awt.geom.Path2D;
 import java.awt.geom.Rectangle2D;
 import java.awt.geom.RoundRectangle2D;
-import java.beans.ConstructorProperties;
 
 /**
  * A class which implements a line border of arbitrary thickness
@@ -104,7 +103,6 @@
      * @param roundedCorners whether or not border corners should be round
      * @since 1.3
      */
-    @ConstructorProperties({"lineColor", "thickness", "roundedCorners"})
     public LineBorder(Color color, int thickness, boolean roundedCorners)  {
         lineColor = color;
         this.thickness = thickness;
--- a/src/share/classes/javax/swing/border/SoftBevelBorder.java	Fri Jan 30 16:19:11 2009 -0800
+++ b/src/share/classes/javax/swing/border/SoftBevelBorder.java	Fri Jan 30 16:23:12 2009 -0800
@@ -29,7 +29,6 @@
 import java.awt.Rectangle;
 import java.awt.Color;
 import java.awt.Component;
-import java.beans.ConstructorProperties;
 
 /**
  * A class which implements a raised or lowered bevel with
@@ -81,7 +80,6 @@
      * @param shadowOuterColor the color to use for the bevel outer shadow
      * @param shadowInnerColor the color to use for the bevel inner shadow
      */
-    @ConstructorProperties({"bevelType", "highlightOuterColor", "highlightInnerColor", "shadowOuterColor", "shadowInnerColor"})
     public SoftBevelBorder(int bevelType, Color highlightOuterColor, 
                         Color highlightInnerColor, Color shadowOuterColor, 
                         Color shadowInnerColor) {
--- a/src/share/classes/javax/swing/border/TitledBorder.java	Fri Jan 30 16:19:11 2009 -0800
+++ b/src/share/classes/javax/swing/border/TitledBorder.java	Fri Jan 30 16:23:12 2009 -0800
@@ -36,7 +36,6 @@
 import java.awt.Toolkit;
 import java.awt.Component;
 import java.awt.Dimension;
-import java.beans.ConstructorProperties;
 
 import javax.swing.JComponent;
 import javax.swing.UIManager;
@@ -206,7 +205,6 @@
      * @param titleFont the font of the title
      * @param titleColor the color of the title
      */
-    @ConstructorProperties({"border", "title", "titleJustification", "titlePosition", "titleFont", "titleColor"})
     public TitledBorder(Border border,                     
                         String title,
                         int titleJustification,
--- a/src/share/classes/javax/swing/event/TreeSelectionEvent.java	Fri Jan 30 16:19:11 2009 -0800
+++ b/src/share/classes/javax/swing/event/TreeSelectionEvent.java	Fri Jan 30 16:23:12 2009 -0800
@@ -127,34 +127,19 @@
     }
 
     /**
-     * Returns whether the path identified by {@code getPath} was
-     * added to the selection.  A return value of {@code true}
-     * indicates the path identified by {@code getPath} was added to
-     * the selection. A return value of {@code false} indicates {@code
-     * getPath} was selected, but is no longer selected.
-     *
-     * @return {@code true} if {@code getPath} was added to the selection,
-     *         {@code false} otherwise
+     * Returns true if the first path element has been added to the
+     * selection, a return value of false means the first path has been
+     * removed from the selection.
      */
     public boolean isAddedPath() {
 	return areNew[0];
     }
 
     /**
-     * Returns whether the specified path was added to the selection.
-     * A return value of {@code true} indicates the path identified by
-     * {@code path} was added to the selection. A return value of
-     * {@code false} indicates {@code path} is no longer selected. This method
-     * is only valid for the paths returned from {@code getPaths()}; invoking
-     * with a path not included in {@code getPaths()} throws an
-     * {@code IllegalArgumentException}.
-     *
-     * @param path the path to test
-     * @return {@code true} if {@code path} was added to the selection,
-     *         {@code false} otherwise
-     * @throws IllegalArgumentException if {@code path} is not contained
-     *         in {@code getPaths}
-     * @see #getPaths
+     * Returns true if the path identified by path was added to the
+     * selection. A return value of false means the path was in the
+     * selection but is no longer in the selection. This will raise if
+     * path is not one of the paths identified by this event.
      */
     public boolean isAddedPath(TreePath path) {
 	for(int counter = paths.length - 1; counter >= 0; counter--)
@@ -164,17 +149,10 @@
     }
 
     /**
-     * Returns whether the path at {@code getPaths()[index]} was added
-     * to the selection.  A return value of {@code true} indicates the
-     * path was added to the selection. A return value of {@code false}
-     * indicates the path is no longer selected.
-     *
-     * @param index the index of the path to test
-     * @return {@code true} if the path was added to the selection,
-     *         {@code false} otherwise
-     * @throws IllegalArgumentException if index is outside the range of
-     *         {@code getPaths}
-     * @see #getPaths
+     * Returns true if the path identified by <code>index</code> was added to
+     * the selection. A return value of false means the path was in the
+     * selection but is no longer in the selection. This will raise if
+     * index < 0 || >= <code>getPaths</code>.length.
      *
      * @since 1.3
      */
--- a/src/share/classes/javax/swing/plaf/BorderUIResource.java	Fri Jan 30 16:19:11 2009 -0800
+++ b/src/share/classes/javax/swing/plaf/BorderUIResource.java	Fri Jan 30 16:23:12 2009 -0800
@@ -32,7 +32,6 @@
 import java.awt.Graphics;
 import java.io.Serializable;
 
-import java.beans.ConstructorProperties;
 import javax.swing.border.*;
 import javax.swing.Icon;
 import javax.swing.plaf.UIResource;
@@ -123,7 +122,6 @@
     }
 
     public static class CompoundBorderUIResource extends CompoundBorder implements UIResource {
-        @ConstructorProperties({"outsideBorder", "insideBorder"})
         public CompoundBorderUIResource(Border outsideBorder, Border insideBorder) {
             super(outsideBorder, insideBorder);
         }
@@ -135,7 +133,6 @@
         public EmptyBorderUIResource(int top, int left, int bottom, int right)   {
             super(top, left, bottom, right);
         }
-        @ConstructorProperties({"borderInsets"})
         public EmptyBorderUIResource(Insets insets) {
             super(insets);
         }
@@ -147,7 +144,6 @@
             super(color);
         }
 
-        @ConstructorProperties({"lineColor", "thickness"})
         public LineBorderUIResource(Color color, int thickness)  {
             super(color, thickness);
         }
@@ -164,7 +160,6 @@
             super(bevelType, highlight, shadow);
         }
 
-        @ConstructorProperties({"bevelType", "highlightOuterColor", "highlightInnerColor", "shadowOuterColor", "shadowInnerColor"})
         public BevelBorderUIResource(int bevelType, 
                                      Color highlightOuter, Color highlightInner,
                                      Color shadowOuter, Color shadowInner) {
@@ -186,7 +181,6 @@
             super(highlight, shadow);
         }
 
-        @ConstructorProperties({"etchType", "highlightColor", "shadowColor"})
         public EtchedBorderUIResource(int etchType, Color highlight, Color shadow)    {
             super(etchType, highlight, shadow);
         }
@@ -238,7 +232,6 @@
             super(border, title, titleJustification, titlePosition, titleFont);
         }
 
-        @ConstructorProperties({"border", "title", "titleJustification", "titlePosition", "titleFont", "titleColor"})
         public TitledBorderUIResource(Border border,                     
                         String title,
                         int titleJustification,
--- a/src/share/classes/javax/swing/plaf/ColorUIResource.java	Fri Jan 30 16:19:11 2009 -0800
+++ b/src/share/classes/javax/swing/plaf/ColorUIResource.java	Fri Jan 30 16:23:12 2009 -0800
@@ -26,7 +26,6 @@
 package javax.swing.plaf;
 
 import java.awt.Color;
-import java.beans.ConstructorProperties;
 
 /*
  * A subclass of Color that implements UIResource.  UI
@@ -48,7 +47,6 @@
  */
 public class ColorUIResource extends Color implements UIResource
 {
-    @ConstructorProperties({"red", "green", "blue"})
     public ColorUIResource(int r, int g, int b) {
 	super(r, g, b);
     }
--- a/src/share/classes/javax/swing/plaf/basic/BasicDirectoryModel.java	Fri Jan 30 16:19:11 2009 -0800
+++ b/src/share/classes/javax/swing/plaf/basic/BasicDirectoryModel.java	Fri Jan 30 16:23:12 2009 -0800
@@ -235,104 +235,110 @@
 	}
 
 	public void run0() {
-	    FileSystemView fileSystem = filechooser.getFileSystemView();
+            try {
+                FileSystemView fileSystem = filechooser.getFileSystemView();
 
-	    File[] list = fileSystem.getFiles(currentDirectory, filechooser.isFileHidingEnabled());
+                File[] list = fileSystem.getFiles(currentDirectory, filechooser.isFileHidingEnabled());
 
-	    Vector<File> acceptsList = new Vector<File>();
+                Vector<File> acceptsList = new Vector<File>();
 
-	    if (isInterrupted()) {
-		return;
-	    }
+                if (isInterrupted()) {
+                    return;
+                }
 
-	    // run through the file list, add directories and selectable files to fileCache
-	    for (int i = 0; i < list.length; i++) {
-		if(filechooser.accept(list[i])) {
-		    acceptsList.addElement(list[i]);
-		}
-	    }
+                // run through the file list, add directories and selectable files to fileCache
+                for (int i = 0; i < list.length; i++) {
+                    if(filechooser.accept(list[i])) {
+                        acceptsList.addElement(list[i]);
+                    }
+                }
 
-	    if (isInterrupted()) {
-		return;
-	    }
+                if (isInterrupted()) {
+                    return;
+                }
 
-	    // First sort alphabetically by filename
-	    sort(acceptsList);
+                // First sort alphabetically by filename
+                sort(acceptsList);
 
-	    Vector newDirectories = new Vector(50);
-	    Vector newFiles = new Vector();
-	    // run through list grabbing directories in chunks of ten
-	    for(int i = 0; i < acceptsList.size(); i++) {
-		File f = (File) acceptsList.elementAt(i);
-		boolean isTraversable = filechooser.isTraversable(f);
-		if (isTraversable) {
-		    newDirectories.addElement(f);
-		} else if (!isTraversable && filechooser.isFileSelectionEnabled()) {
-		    newFiles.addElement(f);
-		}
-		if(isInterrupted()) {
-		    return;
-		}
-	    }
+                Vector newDirectories = new Vector(50);
+                Vector newFiles = new Vector();
+                // run through list grabbing directories in chunks of ten
+                for(int i = 0; i < acceptsList.size(); i++) {
+                    File f = (File) acceptsList.elementAt(i);
+                    boolean isTraversable = filechooser.isTraversable(f);
+                    if (isTraversable) {
+                        newDirectories.addElement(f);
+                    } else if (!isTraversable && filechooser.isFileSelectionEnabled()) {
+                        newFiles.addElement(f);
+                    }
+                    if(isInterrupted()) {
+                        return;
+                    }
+                }
 
-	    Vector newFileCache = new Vector(newDirectories);
-	    newFileCache.addAll(newFiles);
+                Vector newFileCache = new Vector(newDirectories);
+                newFileCache.addAll(newFiles);
 
-	    int newSize = newFileCache.size();
-	    int oldSize = fileCache.size();
+                int newSize = newFileCache.size();
+                int oldSize = fileCache.size();
 
-	    if (newSize > oldSize) {
-		//see if interval is added
-		int start = oldSize;
-		int end = newSize;
-		for (int i = 0; i < oldSize; i++) {
-		    if (!newFileCache.get(i).equals(fileCache.get(i))) {
-			start = i;
-			for (int j = i; j < newSize; j++) {
-			    if (newFileCache.get(j).equals(fileCache.get(i))) {
-				end = j;
-				break;
-			    }
-			}
-			break;
-		    }
-		}
-		if (start >= 0 && end > start
-		    && newFileCache.subList(end, newSize).equals(fileCache.subList(start, oldSize))) {
-		    if(isInterrupted()) {
-		        return;
-		    }
-		    invokeLater(new DoChangeContents(newFileCache.subList(start, end), start, null, 0, fid));
-		    newFileCache = null;
-		}
-	    } else if (newSize < oldSize) {
-		//see if interval is removed
-		int start = -1;
-		int end = -1;
-		for (int i = 0; i < newSize; i++) {
-		    if (!newFileCache.get(i).equals(fileCache.get(i))) {
-			start = i;
-			end = i + oldSize - newSize;
-			break;
-		    }
-		}
-		if (start >= 0 && end > start
-		    && fileCache.subList(end, oldSize).equals(newFileCache.subList(start, newSize))) {
-		    if(isInterrupted()) {
-		        return;
-		    }
-		    invokeLater(new DoChangeContents(null, 0, new Vector(fileCache.subList(start, end)),
-						     start, fid));
-		    newFileCache = null;
-		}
-	    }
-	    if (newFileCache != null && !fileCache.equals(newFileCache)) {
-	        if (isInterrupted()) {
-		    cancelRunnables(runnables);
-	        }
-		invokeLater(new DoChangeContents(newFileCache, 0, fileCache, 0, fid));
-	    }
-	}
+                if (newSize > oldSize) {
+                    //see if interval is added
+                    int start = oldSize;
+                    int end = newSize;
+                    for (int i = 0; i < oldSize; i++) {
+                        if (!newFileCache.get(i).equals(fileCache.get(i))) {
+                            start = i;
+                            for (int j = i; j < newSize; j++) {
+                                if (newFileCache.get(j).equals(fileCache.get(i))) {
+                                    end = j;
+                                    break;
+                                }
+                            }
+                            break;
+                        }
+                    }
+                    if (start >= 0 && end > start
+                        && newFileCache.subList(end, newSize).equals(fileCache.subList(start, oldSize))) {
+                        if(isInterrupted()) {
+                            return;
+                        }
+                        invokeLater(new DoChangeContents(newFileCache.subList(start, end), start, null, 0, fid));
+                        newFileCache = null;
+                    }
+                } else if (newSize < oldSize) {
+                    //see if interval is removed
+                    int start = -1;
+                    int end = -1;
+                    for (int i = 0; i < newSize; i++) {
+                        if (!newFileCache.get(i).equals(fileCache.get(i))) {
+                            start = i;
+                            end = i + oldSize - newSize;
+                            break;
+                        }
+                    }
+                    if (start >= 0 && end > start
+                        && fileCache.subList(end, oldSize).equals(newFileCache.subList(start, newSize))) {
+                        if(isInterrupted()) {
+                            return;
+                        }
+                        invokeLater(new DoChangeContents(null, 0, new Vector(fileCache.subList(start, end)),
+                                                         start, fid));
+                        newFileCache = null;
+                    }
+                }
+                if (newFileCache != null && !fileCache.equals(newFileCache)) {
+                    if (isInterrupted()) {
+                        cancelRunnables(runnables);
+                    }
+                    invokeLater(new DoChangeContents(newFileCache, 0, fileCache, 0, fid));
+                }
+            } catch (RuntimeException e) {
+                if (!(e.getCause() instanceof InterruptedException /* just exit on interruption */)) {
+                    throw e;
+                }
+            }
+        }
 
 
 	public void cancelRunnables(Vector runnables) {
--- a/src/share/classes/javax/swing/text/DefaultStyledDocument.java	Fri Jan 30 16:19:11 2009 -0800
+++ b/src/share/classes/javax/swing/text/DefaultStyledDocument.java	Fri Jan 30 16:23:12 2009 -0800
@@ -229,147 +229,6 @@
     }
 
     /**
-     * Removes an element from this document.
-     *
-     * <p>The element is removed from its parent element, as well as
-     * the text in the range identified by the element.  If the
-     * element isn't associated with the document, {@code
-     * IllegalArgumentException} is thrown.</p>
-     * 
-     * <p>As empty branch elements are not allowed in the document, if the
-     * element is the sole child, its parent element is removed as well,
-     * recursively.  This means that when replacing all the children of a
-     * particular element, new children should be added <em>before</em>
-     * removing old children.
-     *
-     * <p>Element removal results in two events being fired, the
-     * {@code DocumentEvent} for changes in element structure and {@code
-     * UndoableEditEvent} for changes in document content.</p>
-     *
-     * <p>If the element contains end-of-content mark (the last {@code
-     * "\n"} character in document), this character is not removed;
-     * instead, preceding leaf element is extended to cover the
-     * character.  If the last leaf already ends with {@code "\n",} it is
-     * included in content removal.</p>
-     *
-     * <p>If the element is {@code null,} {@code NullPointerException} is
-     * thrown.  If the element structure would become invalid after the removal,
-     * for example if the element is the document root element, {@code
-     * IllegalArgumentException} is thrown.  If the current element structure is
-     * invalid, {@code IllegalStateException} is thrown.</p>
-     *
-     * @param  elem                      the element to remove
-     * @throws NullPointerException      if the element is {@code null}
-     * @throws IllegalArgumentException  if the element could not be removed
-     * @throws IllegalStateException     if the element structure is invalid
-     *
-     * @since  1.7
-     */    
-    public void removeElement(Element elem) {
-        try {
-            writeLock();
-            removeElementImpl(elem);
-        } finally {
-            writeUnlock();
-        }
-    }
-    
-    private void removeElementImpl(Element elem) {
-        if (elem.getDocument() != this) {
-            throw new IllegalArgumentException("element doesn't belong to document");
-        }
-        BranchElement parent = (BranchElement) elem.getParentElement();
-        if (parent == null) {
-            throw new IllegalArgumentException("can't remove the root element");
-        }
-        
-        int startOffset = elem.getStartOffset();
-        int removeFrom = startOffset;
-        int endOffset = elem.getEndOffset();
-        int removeTo = endOffset;
-        int lastEndOffset = getLength() + 1;
-        Content content = getContent();
-        boolean atEnd = false;
-        boolean isComposedText = Utilities.isComposedTextElement(elem);
-        
-        if (endOffset >= lastEndOffset) {
-            // element includes the last "\n" character, needs special handling
-            if (startOffset <= 0) {
-                throw new IllegalArgumentException("can't remove the whole content");
-            }
-            removeTo = lastEndOffset - 1; // last "\n" must not be removed
-            try {
-                if (content.getString(startOffset - 1, 1).charAt(0) == '\n') {
-                    removeFrom--; // preceding leaf ends with "\n", remove it
-                }
-            } catch (BadLocationException ble) { // can't happen
-                throw new IllegalStateException(ble);
-            }
-            atEnd = true;
-        }
-        int length = removeTo - removeFrom;
-
-        DefaultDocumentEvent dde = new DefaultDocumentEvent(removeFrom,
-                length, DefaultDocumentEvent.EventType.REMOVE);
-        UndoableEdit ue = null;
-        // do not leave empty branch elements
-        while (parent.getElementCount() == 1) {
-            elem = parent;
-            parent = (BranchElement) parent.getParentElement();
-            if (parent == null) { // shouldn't happen
-                throw new IllegalStateException("invalid element structure");
-            }
-        }
-        Element[] removed = { elem };
-        Element[] added = {};
-        int index = parent.getElementIndex(startOffset);
-        parent.replace(index, 1, added);
-        dde.addEdit(new ElementEdit(parent, index, removed, added));
-        if (length > 0) {  
-            try {
-                ue = content.remove(removeFrom, length);
-                if (ue != null) {
-                    dde.addEdit(ue);
-                }
-            } catch (BadLocationException ble) {
-                // can only happen if the element structure is severely broken
-                throw new IllegalStateException(ble);
-            }
-            lastEndOffset -= length;
-        }
-        
-        if (atEnd) {
-            // preceding leaf element should be extended to cover orphaned "\n"
-            Element prevLeaf = parent.getElement(parent.getElementCount() - 1);
-            while ((prevLeaf != null) && !prevLeaf.isLeaf()) {
-                prevLeaf = prevLeaf.getElement(prevLeaf.getElementCount() - 1);
-            }
-            if (prevLeaf == null) { // shouldn't happen
-                throw new IllegalStateException("invalid element structure");
-            }
-            int prevStartOffset = prevLeaf.getStartOffset();
-            BranchElement prevParent = (BranchElement) prevLeaf.getParentElement();
-            int prevIndex = prevParent.getElementIndex(prevStartOffset);
-            Element newElem = null;
-            newElem = createLeafElement(prevParent, prevLeaf.getAttributes(),
-                                            prevStartOffset, lastEndOffset);
-            Element[] prevRemoved = { prevLeaf };
-            Element[] prevAdded = { newElem };
-            prevParent.replace(prevIndex, 1, prevAdded);
-            dde.addEdit(new ElementEdit(prevParent, prevIndex,
-                                                    prevRemoved, prevAdded));
-        }
-
-        postRemoveUpdate(dde);
-        dde.end();
-        fireRemoveUpdate(dde);
-        if (! (isComposedText && (ue != null))) {
-            // do not fire UndoabeEdit event for composed text edit (unsupported)
-            fireUndoableEditUpdate(new UndoableEditEvent(this, dde));
-        }
-    }
-
-    /**
      * Adds a new style into the logical style hierarchy.  Style attributes
      * resolve from bottom up so an attribute specified in a child
      * will override an attribute specified in the parent.
--- a/src/share/classes/javax/swing/text/DocumentFilter.java	Fri Jan 30 16:19:11 2009 -0800
+++ b/src/share/classes/javax/swing/text/DocumentFilter.java	Fri Jan 30 16:23:12 2009 -0800
@@ -43,19 +43,8 @@
  * <code>FilterBypass</code> multiple times, or for different regions, but
  * it should not callback into the <code>FilterBypass</code> after returning
  * from the <code>remove</code> or <code>insertString</code> method.
- * <p>
- * By default, text related document mutation methods such as
- * <code>insertString</code>, <code>replace</code> and <code>remove</code>
- * in <code>AbstractDocument</code> use <code>DocumentFilter</code> when
- * available, and <code>Element</code> related mutation methods such as
- * <code>create</code>, <code>insert</code> and <code>removeElement</code> in
- * <code>DefaultStyledDocument</code> do not use <code>DocumentFilter</code>.
- * If a method doesn't follow these defaults, this must be explicitly stated
- * in the method documentation.
  *
  * @see javax.swing.text.Document
- * @see javax.swing.text.AbstractDocument
- * @see javax.swing.text.DefaultStyledDocument
  *
  * @version %I% %G%
  * @since 1.4
--- a/src/share/classes/javax/swing/text/GlyphView.java	Fri Jan 30 16:19:11 2009 -0800
+++ b/src/share/classes/javax/swing/text/GlyphView.java	Fri Jan 30 16:23:12 2009 -0800
@@ -28,7 +28,6 @@
 import java.text.BreakIterator;
 import javax.swing.event.*;
 import java.util.BitSet;
-import java.util.Locale;
 
 import sun.swing.SwingUtilities2;
 
@@ -527,45 +526,6 @@
 
 	}
     }
-    
-    /**
-     * Determines the minimum span for this view along an axis.
-     * 
-     * <p>This implementation returns the longest non-breakable area within
-     * the view as a minimum span for {@code View.X_AXIS}.</p>
-     *
-     * @param axis  may be either {@code View.X_AXIS} or {@code View.Y_AXIS}
-     * @return      the minimum span the view can be rendered into
-     * @throws IllegalArgumentException if the {@code axis} parameter is invalid
-     * @see         javax.swing.text.View#getMinimumSpan
-     */
-    @Override
-    public float getMinimumSpan(int axis) {
-        switch (axis) {
-        case View.X_AXIS:
-            if (minimumSpan < 0) {
-                minimumSpan = 0;
-                int p0 = getStartOffset();
-                int p1 = getEndOffset();
-                while (p1 > p0) {
-                    int breakSpot = getBreakSpot(p0, p1);
-                    if (breakSpot == BreakIterator.DONE) {
-                        // the rest of the view is non-breakable
-                        breakSpot = p0;
-                    }
-                    minimumSpan = Math.max(minimumSpan,
-                            getPartialSpan(breakSpot, p1));
-                    // Note: getBreakSpot returns the *last* breakspot
-                    p1 = breakSpot - 1;
-                }
-            }
-            return minimumSpan;
-        case View.Y_AXIS:
-            return super.getMinimumSpan(axis);
-        default:
-            throw new IllegalArgumentException("Invalid axis: " + axis);
-        }
-    }
 
     /**
      * Determines the preferred span for this view along an
@@ -720,8 +680,20 @@
 	    checkPainter();
 	    int p0 = getStartOffset();
 	    int p1 = painter.getBoundedPosition(this, p0, pos, len);
-            return ((p1 > p0) && (getBreakSpot(p0, p1) != BreakIterator.DONE)) ?
-                    View.ExcellentBreakWeight : View.BadBreakWeight;            
+	    if (p1 == p0) {
+		// can't even fit a single character
+		return View.BadBreakWeight;	    
+	    }
+            if (getBreakSpot(p0, p1) != -1) {
+                return View.ExcellentBreakWeight;
+            }
+	    // Nothing good to break on.
+            // breaking on the View boundary is better than splitting it
+            if (p1 == getEndOffset()) {
+                return View.GoodBreakWeight;
+            } else {
+                return View.GoodBreakWeight - 1;
+            }
 	}
 	return super.getBreakWeight(axis, pos, len);
     }
@@ -769,75 +741,103 @@
     }
 
     /**
-     * Returns a location to break at in the passed in region, or 
-     * BreakIterator.DONE if there isn't a good location to break at
-     * in the specified region.
+     * Returns a location to break at in the passed in region, or -1 if
+     * there isn't a good location to break at in the specified region.
      */
     private int getBreakSpot(int p0, int p1) {
-        if (breakSpots == null) {
-            // Re-calculate breakpoints for the whole view
-            int start = getStartOffset();
-            int end = getEndOffset();
-            int[] bs = new int[end + 1 - start];
-            int ix = 0;
-            
-            // Breaker should work on the parent element because there may be
-            // a valid breakpoint at the end edge of the view (space, etc.)
-            Element parent = getElement().getParentElement();
-            int pstart = (parent == null ? start : parent.getStartOffset());
-            int pend = (parent == null ? end : parent.getEndOffset());
-            
-            Segment s = getText(pstart, pend);
-            s.first();
-            BreakIterator breaker = getBreaker();
-            breaker.setText(s);
-            
-            // Backward search should start from end+1 unless there's NO end+1
-            int startFrom = end + (pend > end ? 1 : 0);
-            for (;;) {
-                startFrom = breaker.preceding(s.offset + (startFrom - pstart))
-                          + (pstart - s.offset);
-                if (startFrom > start) {
-                    // The break spot is within the view
-                    bs[ix++] = startFrom;
-                } else {
-                    break;
-                }
-            }
-            
-            SegmentCache.releaseSharedSegment(s);
-            breakSpots = new int[ix];
-            System.arraycopy(bs, 0, breakSpots, 0, ix);
+        Document doc = getDocument();
+
+        if (doc != null && Boolean.TRUE.equals(doc.getProperty(
+                                   AbstractDocument.MultiByteProperty))) {
+            return getBreakSpotUseBreakIterator(p0, p1);
         }
-        
-        int breakSpot = BreakIterator.DONE;
-        for (int i = 0; i < breakSpots.length; i++) {
-            int bsp = breakSpots[i];
-            if (bsp <= p1) {
-                if (bsp > p0) {
-                    breakSpot = bsp;
-                }
-                break;
-            }
-        }        
-        return breakSpot;            
+        return getBreakSpotUseWhitespace(p0, p1);
     }
 
     /**
-     * Return break iterator appropriate for the current document.
-     *
-     * For non-i18n documents a fast whitespace-based break iterator is used.
+     * Returns the appropriate place to break based on the last whitespace
+     * character encountered.
+     */
+    private int getBreakSpotUseWhitespace(int p0, int p1) {
+        Segment s = getText(p0, p1);
+
+        for (char ch = s.last(); ch != Segment.DONE; ch = s.previous()) {
+            if (Character.isWhitespace(ch)) {
+                // found whitespace
+                SegmentCache.releaseSharedSegment(s);
+                return s.getIndex() - s.getBeginIndex() + 1 + p0;
+            }
+        }
+        SegmentCache.releaseSharedSegment(s);
+        return -1;
+    }
+     
+    /**
+     * Returns the appropriate place to break based on BreakIterator.
      */
-    private BreakIterator getBreaker() {
-        Document doc = getDocument();
-        if ((doc != null) && Boolean.TRUE.equals(
-                    doc.getProperty(AbstractDocument.MultiByteProperty))) {
-            Container c = getContainer();
-            Locale locale = (c == null ? Locale.getDefault() : c.getLocale());
-            return BreakIterator.getLineInstance(locale);
-        } else {
-            return new WhitespaceBasedBreakIterator();
+    private int getBreakSpotUseBreakIterator(int p0, int p1) {
+        // Certain regions require context for BreakIterator, start from
+        // our parents start offset.
+        Element parent = getElement().getParentElement();
+        int parent0;
+        int parent1;
+        Container c = getContainer();
+        BreakIterator breaker;
+
+        if (parent == null) {
+            parent0 = p0;
+            parent1 = p1;
+        }
+        else {
+            parent0 = parent.getStartOffset();
+            parent1 = parent.getEndOffset();
+        }
+        if (c != null) {
+            breaker = BreakIterator.getLineInstance(c.getLocale());
+        }
+        else {
+            breaker = BreakIterator.getLineInstance();
         }
+
+        Segment s = getText(parent0, parent1);
+        int breakPoint;
+
+        // Needed to initialize the Segment.
+        s.first();
+        breaker.setText(s);
+
+        if (p1 == parent1) {
+            // This will most likely return the end, the assumption is
+            // that if parent1 == p1, then we are the last portion of
+            // a paragraph
+            breakPoint = breaker.last();
+        }
+        else if (p1 + 1 == parent1) {
+            // assert(s.count > 1)
+            breakPoint = breaker.following(s.offset + s.count - 2);
+            if (breakPoint >= s.count + s.offset) {
+                breakPoint = breaker.preceding(s.offset + s.count - 1);
+            }
+        }
+        else {
+            breakPoint = breaker.preceding(p1 - parent0 + s.offset + 1);
+        }
+
+        int retValue = -1;
+
+        if (breakPoint != BreakIterator.DONE) {
+            breakPoint = breakPoint - s.offset + parent0;
+            if (breakPoint > p0) {
+                if (p0 == parent0 && breakPoint == p0) {
+                    retValue = -1;
+                }
+                else if (breakPoint <= p1) {
+                    retValue = breakPoint;
+                }
+            }
+        }
+        SegmentCache.releaseSharedSegment(s);
+        return retValue;
     }
 
     /**
@@ -911,8 +911,6 @@
      */
     public void insertUpdate(DocumentEvent e, Shape a, ViewFactory f) {
         justificationInfo = null;
-        breakSpots = null;
-        minimumSpan = -1;
 	syncCR();
 	preferenceChanged(null, true, false);
     }
@@ -930,8 +928,6 @@
      */
     public void removeUpdate(DocumentEvent e, Shape a, ViewFactory f) {
         justificationInfo = null;
-        breakSpots = null;
-        minimumSpan = -1;
 	syncCR();
 	preferenceChanged(null, true, false);
     }
@@ -948,7 +944,6 @@
      * @see View#changedUpdate
      */
     public void changedUpdate(DocumentEvent e, Shape a, ViewFactory f) {
-        minimumSpan = -1;
 	syncCR();
 	preferenceChanged(null, true, true);
     }
@@ -1092,12 +1087,6 @@
      */
     TabExpander expander;
 
-    /** Cached minimum x-span value  */
-    private float minimumSpan = -1;
-    
-    /** Cached breakpoints within the view  */
-    private int[] breakSpots = null;
-    
     /**
      * location for determining tab expansion against.
      */
--- a/src/share/classes/javax/swing/text/ParagraphView.java	Fri Jan 30 16:19:11 2009 -0800
+++ b/src/share/classes/javax/swing/text/ParagraphView.java	Fri Jan 30 16:23:12 2009 -0800
@@ -718,84 +718,6 @@
     }
 
     /**
-     * Calculate the needs for the paragraph along the minor axis.
-     *
-     * <p>This uses size requirements of the superclass, modified to take into
-     * account the non-breakable areas at the adjacent views edges.  The minimal
-     * size requirements for such views should be no less than the sum of all
-     * adjacent fragments.</p>
-     *
-     * <p>If the {@code axis} parameter is neither {@code View.X_AXIS} nor
-     * {@code View.Y_AXIS}, {@link IllegalArgumentException} is thrown.  If the
-     * {@code r} parameter is {@code null,} a new {@code SizeRequirements}
-     * object is created, otherwise the supplied {@code SizeRequirements}
-     * object is returned.</p>
-     *
-     * @param axis  the minor axis
-     * @param r     the input {@code SizeRequirements} object 
-     * @return      the new or adjusted {@code SizeRequirements} object
-     * @throw IllegalArgumentException  if the {@code axis} parameter is invalid
-     */
-    @Override
-    protected SizeRequirements calculateMinorAxisRequirements(int axis,
-                                                        SizeRequirements r) {
-        r = super.calculateMinorAxisRequirements(axis, r);
-        
-        float min = 0;
-        float glue = 0;
-        int n = getLayoutViewCount();
-        for (int i = 0; i < n; i++) {
-            View v = getLayoutView(i);
-            float span = v.getMinimumSpan(axis);
-            if (v.getBreakWeight(axis, 0, v.getMaximumSpan(axis))
-                                                        > View.BadBreakWeight) {
-                // find the longest non-breakable fragments at the view edges
-                int p0 = v.getStartOffset();
-                int p1 = v.getEndOffset();
-                float start = findEdgeSpan(v, axis, p0, p0, p1);
-                float end = findEdgeSpan(v, axis, p1, p0, p1);
-                glue += start;
-                min = Math.max(min, Math.max(span, glue));
-                glue = end;
-            } else {
-                // non-breakable view
-                glue += span;
-                min = Math.max(min, glue);
-            }           
-        }
-        r.minimum = Math.max(r.minimum, (int) min);
-        r.preferred = Math.max(r.minimum,  r.preferred);
-        r.maximum = Math.max(r.preferred, r.maximum);
-
-        return r;
-    }
-    
-    /**
-     * Binary search for the longest non-breakable fragment at the view edge.
-     */
-    private float findEdgeSpan(View v, int axis, int fp, int p0, int p1) {
-        int len = p1 - p0;
-        if (len <= 1) {
-            // further fragmentation is not possible
-            return v.getMinimumSpan(axis);
-        } else {
-            int mid = p0 + len / 2;
-            boolean startEdge = mid > fp;
-            // initial view is breakable hence must support fragmentation
-            View f = startEdge ?
-                v.createFragment(fp, mid) : v.createFragment(mid, fp);
-            boolean breakable = f.getBreakWeight(
-                    axis, 0, f.getMaximumSpan(axis)) > View.BadBreakWeight;
-            if (breakable == startEdge) {
-                p1 = mid;
-            } else {
-                p0 = mid;
-            }
-            return findEdgeSpan(f, axis, fp, p0, p1);
-        }
-    }
-    
-    /**
      * Gives notification from the document that attributes were changed
      * in a location that this view is responsible for.
      *
--- a/src/share/classes/javax/swing/text/html/InlineView.java	Fri Jan 30 16:19:11 2009 -0800
+++ b/src/share/classes/javax/swing/text/html/InlineView.java	Fri Jan 30 16:23:12 2009 -0800
@@ -63,6 +63,7 @@
      */
     public void insertUpdate(DocumentEvent e, Shape a, ViewFactory f) {
 	super.insertUpdate(e, a, f);
+        longestWordSpan = -1.0f;
     }
 
     /**
@@ -79,6 +80,7 @@
      */
     public void removeUpdate(DocumentEvent e, Shape a, ViewFactory f) {
         super.removeUpdate(e, a, f);
+        longestWordSpan = -1.0f;
     }
 
     /**
@@ -94,6 +96,7 @@
 	super.changedUpdate(e, a, f);
 	StyleSheet sheet = getStyleSheet();
 	attr = sheet.getViewAttributes(this);
+        longestWordSpan = -1.0f;
 	preferenceChanged(null, true, true);
     }
 
@@ -177,10 +180,126 @@
      * @see javax.swing.text.View#breakView
      */
     public View breakView(int axis, int offset, float pos, float len) {
-        return super.breakView(axis, offset, pos, len);
+        InlineView view = (InlineView)super.breakView(axis, offset, pos, len);
+        if (view != this) {
+            view.longestWordSpan = -1;
+        }
+        return view;
+    }
+
+    /**
+     * Fetch the span of the longest word in the view.
+     */
+    float getLongestWordSpan() {
+        if (longestWordSpan < 0.0f) {
+            longestWordSpan = calculateLongestWordSpan();
+        }
+        return longestWordSpan; 
+    }
+    
+    float calculateLongestWordSpan() {
+        float rv = 0f;
+        Document doc = getDocument();
+        //AbstractDocument.MultiByteProperty
+        final Object MultiByteProperty = "multiByte";
+        if (doc != null && 
+              Boolean.TRUE.equals(doc.getProperty(MultiByteProperty))) {
+            rv = calculateLongestWordSpanUseBreakIterator();
+        } else {
+            rv = calculateLongestWordSpanUseWhitespace();
+        }
+        return rv;
+    }
+
+    float calculateLongestWordSpanUseBreakIterator() {
+        float span = 0;
+        Document doc = getDocument();
+        int p0 = getStartOffset();
+        int p1 = getEndOffset();
+        if (p1 > p0) {
+            try {
+                FontMetrics metrics = getFontMetrics();
+                Segment segment = new Segment();
+                doc.getText(p0, p1 - p0, segment);
+                Container c = getContainer();
+                BreakIterator line;
+                if (c != null) {
+                    line = BreakIterator.getLineInstance(c.getLocale());
+                } else {
+                    line = BreakIterator.getLineInstance();
+                }
+                line.setText(segment);
+                int start = line.first();
+                for (int end = line.next();
+                     end != BreakIterator.DONE;
+                     start = end, end = line.next()) {
+                    if (end > start) {
+                        span = Math.max(span,
+                            metrics.charsWidth(segment.array, start,
+                                               end - start)); 
+                    }
+                }
+            } catch (BadLocationException ble) {
+                // If the text can't be retrieved, it can't influence the size.
+            }
+        }
+        return span;
     }
 
     
+    float calculateLongestWordSpanUseWhitespace() {
+        float span = 0;
+        Document doc = getDocument();
+        int p0 = getStartOffset();
+        int p1 = getEndOffset();
+        if (p1 > p0) {
+            try {
+                Segment segment = new Segment();
+                doc.getText(p0, p1 - p0, segment);
+                final int CONTENT = 0;
+                final int SPACES = 1;
+                int state = CONTENT;
+                int start = segment.offset;
+                int end = start;
+                FontMetrics metrics = getFontMetrics();
+                final int lastIndex = segment.offset + segment.count - 1;
+                for (int i = segment.offset; i <= lastIndex; i++) {
+                    boolean updateSpan = false;
+                    if (Character.isWhitespace(segment.array[i])) {
+                        if (state == CONTENT) {
+                            //we got a word
+                            updateSpan = true;
+                            state = SPACES;
+                        }
+                    } else {
+                        if (state == SPACES) {
+                            //first non space
+                            start = i;
+                            end = start;
+                            state = CONTENT;
+                        } else {
+                            end = i;
+                        }
+                        //handle last word
+                        if (i == lastIndex) {
+                            updateSpan = true;
+                        }
+                    }
+                    if (updateSpan) {
+                        if (end > start) {
+                            span = Math.max(span,
+                                metrics.charsWidth(segment.array, start, 
+                                                   end - start + 1)); 
+                        }
+                    }
+
+                }
+            } catch (BadLocationException ble) {
+                // If the text can't be retrieved, it can't influence the size.
+            }
+        }
+        return span;
+    }
     /**
      * Set the cached properties from the attributes.
      */
@@ -223,4 +342,5 @@
 
     private boolean nowrap;
     private AttributeSet attr;
+    private float longestWordSpan = -1.0f;
 }
--- a/src/share/classes/javax/swing/text/html/ParagraphView.java	Fri Jan 30 16:19:11 2009 -0800
+++ b/src/share/classes/javax/swing/text/html/ParagraphView.java	Fri Jan 30 16:23:12 2009 -0800
@@ -137,27 +137,35 @@
 
     /**
      * Calculate the needs for the paragraph along the minor axis.
-     *
-     * <p>If size requirements are explicitly specified for the paragraph,
-     * use that requirements.  Otherwise, use the requirements of the
-     * superclass {@link javax.swing.text.ParagraphView}.</p>
-     *
-     * <p>If the {@code axis} parameter is neither {@code View.X_AXIS} nor
-     * {@code View.Y_AXIS}, {@link IllegalArgumentException} is thrown.  If the
-     * {@code r} parameter is {@code null,} a new {@code SizeRequirements}
-     * object is created, otherwise the supplied {@code SizeRequirements}
-     * object is returned.</p>
-     *
-     * @param axis  the minor axis
-     * @param r     the input {@code SizeRequirements} object 
-     * @return      the new or adjusted {@code SizeRequirements} object
-     * @throw IllegalArgumentException  if the {@code axis} parameter is invalid
+     * This implemented to use the requirements of the superclass,
+     * modified slightly to set a minimum span allowed.  Typical
+     * html rendering doesn't let the view size shrink smaller than
+     * the length of the longest word.  
      */
-    protected SizeRequirements calculateMinorAxisRequirements(
-                                                int axis, SizeRequirements r) {
+    protected SizeRequirements calculateMinorAxisRequirements(int axis, SizeRequirements r) {
 	r = super.calculateMinorAxisRequirements(axis, r);
 
-        if (BlockView.spanSetFromAttributes(axis, r, cssWidth, cssHeight)) {
+        if (!BlockView.spanSetFromAttributes(axis, r, cssWidth, cssHeight)) {
+            // PENDING(prinz) Need to make this better so it doesn't require
+            // InlineView and works with font changes within the word.
+
+            // find the longest minimum span.
+            float min = 0;
+            int n = getLayoutViewCount();
+            for (int i = 0; i < n; i++) {
+                View v = getLayoutView(i);
+                if (v instanceof InlineView) {
+                    float wordSpan = ((InlineView) v).getLongestWordSpan();
+                    min = Math.max(wordSpan, min);
+                } else {
+                    min = Math.max(v.getMinimumSpan(axis), min);
+                }
+            }
+            r.minimum = Math.max(r.minimum, (int) min);
+            r.preferred = Math.max(r.minimum,  r.preferred);
+            r.maximum = Math.max(r.preferred, r.maximum);
+        }
+        else {
             // Offset by the margins so that pref/min/max return the
             // right value.
             int margin = (axis == X_AXIS) ? getLeftInset() + getRightInset() :
--- a/src/share/classes/javax/swing/tree/DefaultTreeModel.java	Fri Jan 30 16:19:11 2009 -0800
+++ b/src/share/classes/javax/swing/tree/DefaultTreeModel.java	Fri Jan 30 16:23:12 2009 -0800
@@ -26,7 +26,6 @@
 package javax.swing.tree;
 
 import java.util.*;
-import java.beans.ConstructorProperties;
 import java.io.*;
 import javax.swing.event.*;
 
@@ -80,7 +79,6 @@
       * @param root a TreeNode object that is the root of the tree
       * @see #DefaultTreeModel(TreeNode, boolean)
       */
-     @ConstructorProperties({"root"})
      public DefaultTreeModel(TreeNode root) {
         this(root, false);
     }
@@ -464,12 +462,11 @@
      * is lazily created using the parameters passed into 
      * the fire method.
      *
-     * @param source the source of the {@code TreeModelEvent};
-     *               typically {@code this}
-     * @param path the path to the parent of the nodes that changed; use
-     *             {@code null} to identify the root has changed
+     * @param source the node being changed
+     * @param path the path to the root node
      * @param childIndices the indices of the changed elements
      * @param children the changed elements
+     * @see EventListenerList
      */
     protected void fireTreeNodesChanged(Object source, Object[] path, 
                                         int[] childIndices, 
@@ -496,11 +493,11 @@
      * is lazily created using the parameters passed into 
      * the fire method.
      *
-     * @param source the source of the {@code TreeModelEvent};
-     *               typically {@code this}
-     * @param path the path to the parent the nodes were added to
+     * @param source the node where new elements are being inserted
+     * @param path the path to the root node
      * @param childIndices the indices of the new elements
      * @param children the new elements
+     * @see EventListenerList
      */
     protected void fireTreeNodesInserted(Object source, Object[] path, 
                                         int[] childIndices, 
@@ -527,11 +524,11 @@
      * is lazily created using the parameters passed into 
      * the fire method.
      *
-     * @param source the source of the {@code TreeModelEvent};
-     *               typically {@code this}
-     * @param path the path to the parent the nodes were removed from
+     * @param source the node where elements are being removed
+     * @param path the path to the root node
      * @param childIndices the indices of the removed elements
      * @param children the removed elements
+     * @see EventListenerList
      */
     protected void fireTreeNodesRemoved(Object source, Object[] path, 
                                         int[] childIndices, 
@@ -558,12 +555,11 @@
      * is lazily created using the parameters passed into 
      * the fire method.
      *
-     * @param source the source of the {@code TreeModelEvent};
-     *               typically {@code this}
-     * @param path the path to the parent of the structure that has changed;
-     *             use {@code null} to identify the root has changed
+     * @param source the node where the tree model has changed
+     * @param path the path to the root node
      * @param childIndices the indices of the affected elements
      * @param children the affected elements
+     * @see EventListenerList
      */
     protected void fireTreeStructureChanged(Object source, Object[] path, 
                                         int[] childIndices, 
@@ -584,16 +580,15 @@
         }
     }
 
-    /**
+    /*
      * Notifies all listeners that have registered interest for
      * notification on this event type.  The event instance 
      * is lazily created using the parameters passed into 
      * the fire method.
      *
-     * @param source the source of the {@code TreeModelEvent};
-     *               typically {@code this}
-     * @param path the path to the parent of the structure that has changed;
-     *             use {@code null} to identify the root has changed
+     * @param source the node where the tree model has changed
+     * @param path the path to the root node
+     * @see EventListenerList
      */
     private void fireTreeStructureChanged(Object source, TreePath path) {
         // Guaranteed to return a non-null array
--- a/src/share/classes/javax/swing/tree/TreePath.java	Fri Jan 30 16:19:11 2009 -0800
+++ b/src/share/classes/javax/swing/tree/TreePath.java	Fri Jan 30 16:23:12 2009 -0800
@@ -27,7 +27,6 @@
 
 import java.io.*;
 import java.util.Vector;
-import java.beans.ConstructorProperties;
 
 /**
  * Represents a path to a node. A TreePath is an array of Objects that are
@@ -74,7 +73,6 @@
      *
      * @param path  an array of Objects representing the path to a node
      */
-    @ConstructorProperties({"path"})
     public TreePath(Object[] path) {
         if(path == null || path.length == 0)
             throw new IllegalArgumentException("path in TreePath must be non null and not empty.");
--- a/src/share/classes/sun/font/Type1Font.java	Fri Jan 30 16:19:11 2009 -0800
+++ b/src/share/classes/sun/font/Type1Font.java	Fri Jan 30 16:23:12 2009 -0800
@@ -589,7 +589,7 @@
 
     protected synchronized FontScaler getScaler() {
         if (scaler == null) {
-            return FontManager.getScaler(this, 0, false, fileSize);
+            scaler = FontManager.getScaler(this, 0, false, fileSize);
         }
 
         return scaler;
--- a/src/solaris/classes/sun/awt/X11/XDecoratedPeer.java	Fri Jan 30 16:19:11 2009 -0800
+++ b/src/solaris/classes/sun/awt/X11/XDecoratedPeer.java	Fri Jan 30 16:23:12 2009 -0800
@@ -36,7 +36,7 @@
 import sun.awt.ComponentAccessor;
 import sun.awt.SunToolkit;
 
-class XDecoratedPeer extends XWindowPeer {
+abstract class XDecoratedPeer extends XWindowPeer {
     private static final Logger log = Logger.getLogger("sun.awt.X11.XDecoratedPeer");
     private static final Logger insLog = Logger.getLogger("sun.awt.X11.insets.XDecoratedPeer");
     private static final Logger focusLog = Logger.getLogger("sun.awt.X11.focus.XDecoratedPeer");
@@ -471,6 +471,15 @@
         if (insLog.isLoggable(Level.FINE)) {
             insLog.fine("Reshaping " + this + " to " + newDimensions + " op " + op + " user reshape " + userReshape);
         }
+        if (userReshape) {
+            // We handle only userReshape == true cases. It means that
+            // if the window manager or any other part of the windowing
+            // system sets inappropriate size for this window, we can
+            // do nothing but accept it.
+            Rectangle reqBounds = newDimensions.getBounds();
+            Rectangle newBounds = constrainBounds(reqBounds.x, reqBounds.y, reqBounds.width, reqBounds.height);
+            newDimensions = new WindowDimensions(newBounds, newDimensions.getInsets(), newDimensions.isClientSizeSet());
+        }
         XToolkit.awtLock();
         try {
             if (!isReparented() || !isVisible()) {
@@ -586,6 +595,49 @@
         reshape(dims, operation, userReshape);
     }
     
+    // This method gets overriden in XFramePeer & XDialogPeer.
+    abstract boolean isTargetUndecorated();
+
+    @Override
+    Rectangle constrainBounds(int x, int y, int width, int height) {
+        // We don't restrict the setBounds() operation if the code is trusted.
+        if (!hasWarningWindow()) {
+            return new Rectangle(x, y, width, height);
+        }
+
+        // If it's undecorated or is not currently visible,
+        // apply the same constraints as for the Window.
+        if (!isVisible() || isTargetUndecorated()) {
+            return super.constrainBounds(x, y, width, height);
+        }
+
+        // If it's visible & decorated, constraint the size only
+        int newX = x;
+        int newY = y;
+        int newW = width;
+        int newH = height;
+        
+        GraphicsConfiguration gc = ((Window)target).getGraphicsConfiguration();
+        Rectangle sB = gc.getBounds();
+        Insets sIn = ((Window)target).getToolkit().getScreenInsets(gc);
+
+        Rectangle curBounds = getBounds();
+
+        int maxW = Math.max(sB.width - sIn.left - sIn.right, curBounds.width);
+        int maxH = Math.max(sB.height - sIn.top - sIn.bottom, curBounds.height);
+
+        // First make sure the size is withing the visible part of the screen
+        if (newW > maxW) {
+            newW = maxW;
+        }
+
+        if (newH > maxH) {
+            newH = maxH;
+        }
+
+        return new Rectangle(newX, newY, newW, newH);
+    }
+
     /**
      * @see java.awt.peer.ComponentPeer#setBounds
      */
--- a/src/solaris/classes/sun/awt/X11/XDialogPeer.java	Fri Jan 30 16:19:11 2009 -0800
+++ b/src/solaris/classes/sun/awt/X11/XDialogPeer.java	Fri Jan 30 16:23:12 2009 -0800
@@ -88,7 +88,8 @@
         }
     }
 
-    private boolean isTargetUndecorated() {
+    @Override
+    boolean isTargetUndecorated() {
         if (undecorated != null) {
             return undecorated.booleanValue();
         } else {
--- a/src/solaris/classes/sun/awt/X11/XEmbeddedFramePeer.java	Fri Jan 30 16:19:11 2009 -0800
+++ b/src/solaris/classes/sun/awt/X11/XEmbeddedFramePeer.java	Fri Jan 30 16:23:12 2009 -0800
@@ -184,6 +184,12 @@
         }
     }
 
+    @Override
+    Rectangle constrainBounds(int x, int y, int width, int height) {
+        // We don't constrain the bounds of the EmbeddedFrames
+        return new Rectangle(x, y, width, height);
+    }
+
     // don't use getBounds() inherited from XDecoratedPeer
     public Rectangle getBounds() {
         return new Rectangle(x, y, width, height);
--- a/src/solaris/classes/sun/awt/X11/XFramePeer.java	Fri Jan 30 16:19:11 2009 -0800
+++ b/src/solaris/classes/sun/awt/X11/XFramePeer.java	Fri Jan 30 16:23:12 2009 -0800
@@ -92,7 +92,8 @@
         }
     }
 
-    private boolean isTargetUndecorated() {
+    @Override
+    boolean isTargetUndecorated() {
         if (undecorated != null) {
             return undecorated.booleanValue();
         } else {
--- a/src/solaris/classes/sun/awt/X11/XWindowPeer.java	Fri Jan 30 16:19:11 2009 -0800
+++ b/src/solaris/classes/sun/awt/X11/XWindowPeer.java	Fri Jan 30 16:23:12 2009 -0800
@@ -188,6 +188,9 @@
 
         GraphicsConfiguration gc = getGraphicsConfiguration();
         ((X11GraphicsDevice)gc.getDevice()).addDisplayChangedListener(this);
+
+        Rectangle bounds = (Rectangle)(params.get(BOUNDS));
+        params.put(BOUNDS, constrainBounds(bounds.x, bounds.y, bounds.width, bounds.height));
     }
 
     private void initWMProtocols() {
@@ -437,6 +440,56 @@
         return ownerPeer;
     }
 
+    // This method is overriden at the XDecoratedPeer to handle
+    // decorated windows a bit differently.
+    Rectangle constrainBounds(int x, int y, int width, int height) {
+        // We don't restrict the setBounds() operation if the code is trusted.
+        if (!hasWarningWindow()) {
+            return new Rectangle(x, y, width, height);
+        }
+
+        // The window bounds should be within the visible part of the screen
+        int newX = x;
+        int newY = y;
+        int newW = width;
+        int newH = height;
+
+        // Now check each point is within the visible part of the screen
+        GraphicsConfiguration gc = ((Window)target).getGraphicsConfiguration();
+        Rectangle sB = gc.getBounds();
+        Insets sIn = ((Window)target).getToolkit().getScreenInsets(gc);
+
+        int screenX = sB.x + sIn.left;
+        int screenY = sB.y + sIn.top;
+        int screenW = sB.width - sIn.left - sIn.right;
+        int screenH = sB.height - sIn.top - sIn.bottom;
+
+
+        // First make sure the size is withing the visible part of the screen
+        if (newW > screenW) {
+            newW = screenW;
+        }
+
+        if (newH > screenH) {
+            newH = screenH;
+        }
+
+        // Tweak the location if needed
+        if (newX < screenX) {
+            newX = screenX;
+        } else if (newX + newW > screenX + screenW) {
+            newX = screenX + screenW - newW;
+        }
+
+        if (newY < screenY) {
+            newY = screenY;
+        } else if (newY + newH > screenY + screenH) {
+            newY = screenY + screenH - newH;
+        }
+        
+        return new Rectangle(newX, newY, newW, newH);
+    }
+
     //Fix for 6318144: PIT:Setting Min Size bigger than current size enlarges 
     //the window but fails to revalidate, Sol-CDE
     //This bug is regression for 
@@ -445,10 +498,14 @@
     //Note that this function is overriden in XDecoratedPeer so event
     //posting is not changing for decorated peers
     public void setBounds(int x, int y, int width, int height, int op) {
+        Rectangle newBounds = constrainBounds(x, y, width, height);
+
         XToolkit.awtLock();
         try {
 	    Rectangle oldBounds = getBounds();
-	    super.setBounds(x, y, width, height, op);
+
+        super.setBounds(newBounds.x, newBounds.y, newBounds.width, newBounds.height, op);
+
 	    Rectangle bounds = getBounds();
         
             XSizeHints hints = getHints();
@@ -1038,7 +1095,7 @@
         return !(target instanceof Frame || target instanceof Dialog);
     }
     boolean hasWarningWindow() {
-        return warningWindow != null;
+        return ((Window)target).getWarningString() != null;
     }
 
     // The height of menu bar window
--- a/src/solaris/classes/sun/awt/motif/MDialogPeer.java	Fri Jan 30 16:19:11 2009 -0800
+++ b/src/solaris/classes/sun/awt/motif/MDialogPeer.java	Fri Jan 30 16:23:12 2009 -0800
@@ -102,4 +102,9 @@
     public void blockWindows(java.util.List<Window> toBlock) {
         // do nothing
     }
+
+    @Override
+    final boolean isTargetUndecorated() {
+        return ((Dialog)target).isUndecorated();
+    }
 }
--- a/src/solaris/classes/sun/awt/motif/MEmbeddedFramePeer.java	Fri Jan 30 16:19:11 2009 -0800
+++ b/src/solaris/classes/sun/awt/motif/MEmbeddedFramePeer.java	Fri Jan 30 16:23:12 2009 -0800
@@ -204,4 +204,10 @@
     }
 
     public native Rectangle getBoundsPrivate();
+
+    @Override
+    Rectangle constrainBounds(int x, int y, int width, int height) {
+        // We don't constrain the bounds of the EmbeddedFrames
+        return new Rectangle(x, y, width, height);
+    }
 }
--- a/src/solaris/classes/sun/awt/motif/MFramePeer.java	Fri Jan 30 16:19:11 2009 -0800
+++ b/src/solaris/classes/sun/awt/motif/MFramePeer.java	Fri Jan 30 16:23:12 2009 -0800
@@ -503,4 +503,9 @@
     public Rectangle getBoundsPrivate() {
         return getBounds();
     }
+
+    @Override
+    final boolean isTargetUndecorated() {
+        return ((Frame)target).isUndecorated();
+    }
 }
--- a/src/solaris/classes/sun/awt/motif/MWindowPeer.java	Fri Jan 30 16:19:11 2009 -0800
+++ b/src/solaris/classes/sun/awt/motif/MWindowPeer.java	Fri Jan 30 16:23:12 2009 -0800
@@ -113,6 +113,12 @@
             insets.right = getInset("awt.frame.rightInset", -1);
         }
 
+        Rectangle bounds = target.getBounds();
+        sysX = bounds.x;
+        sysY = bounds.y;
+        sysW = bounds.width;
+        sysH = bounds.height;
+
         super.init(target);
         InputMethodManager imm = InputMethodManager.getInstance();
         String menuString = imm.getTriggerMenuString();
@@ -150,6 +156,7 @@
 
         GraphicsConfiguration gc = getGraphicsConfiguration();
         ((X11GraphicsDevice)gc.getDevice()).addDisplayChangedListener(this);
+
     }
 
     /* Support for multiple icons is not implemented in MAWT */
@@ -246,6 +253,8 @@
     // NOTE: This method may be called by privileged threads.
     //       DO NOT INVOKE CLIENT CODE ON THIS THREAD!
     public void handleResize(int width, int height) {
+        sysW = width;
+        sysH = height;
 
         // REMIND: Is this secure? Can client code subclass input method?
         if (!tcList.isEmpty() &&
@@ -268,6 +277,8 @@
     }
 
     public void handleMoved(int x, int y) {
+        sysX = x;
+        sysY = y;
         postEvent(new ComponentEvent(target, ComponentEvent.COMPONENT_MOVED));
     }
 
@@ -505,5 +516,88 @@
         }
         return false;              
     }
+
+    private final boolean hasWarningWindow() {
+        return ((Window)target).getWarningString() != null;
+    }
+
+    // This method is overriden at Dialog and Frame peers.
+    boolean isTargetUndecorated() {
+        return true;
+    }
+
+    private volatile int sysX = 0;
+    private volatile int sysY = 0;
+    private volatile int sysW = 0;
+    private volatile int sysH = 0;
+
+    Rectangle constrainBounds(int x, int y, int width, int height) {
+        // We don't restrict the setBounds() operation if the code is trusted.
+        if (!hasWarningWindow()) {
+            return new Rectangle(x, y, width, height);
+        }
+
+        int newX = x;
+        int newY = y;
+        int newW = width;
+        int newH = height;
+
+        GraphicsConfiguration gc = ((Window)target).getGraphicsConfiguration();
+        Rectangle sB = gc.getBounds();
+        Insets sIn = ((Window)target).getToolkit().getScreenInsets(gc);
+
+        int screenW = sB.width - sIn.left - sIn.right;
+        int screenH = sB.height - sIn.top - sIn.bottom;
+
+        // If it's undecorated or is not currently visible,
+        // then check each point is within the visible part of the screen
+        if (!target.isVisible() || isTargetUndecorated()) {
+            int screenX = sB.x + sIn.left;
+            int screenY = sB.y + sIn.top;
+
+            // First make sure the size is withing the visible part of the screen
+            if (newW > screenW) {
+                newW = screenW;
+            }
+
+            if (newH > screenH) {
+                newH = screenH;
+            }
+
+            // Tweak the location if needed
+            if (newX < screenX) {
+                newX = screenX;
+            } else if (newX + newW > screenX + screenW) {
+                newX = screenX + screenW - newW;
+            }
+
+            if (newY < screenY) {
+                newY = screenY;
+            } else if (newY + newH > screenY + screenH) {
+                newY = screenY + screenH - newH;
+            }
+        } else {
+            int maxW = Math.max(screenW, sysW);
+            int maxH = Math.max(screenH, sysH);
+
+            // Make sure the size is withing the visible part of the screen
+            // OR is less that the current size of the window.
+            if (newW > maxW) {
+                newW = maxW;
+            }
+
+            if (newH > maxH) {
+                newH = maxH;
+            }
+        }
+
+        return new Rectangle(newX, newY, newW, newH);
+    }
+
+    public void setBounds(int x, int y, int width, int height, int op) {
+        Rectangle newBounds = constrainBounds(x, y, width, height);
+        super.setBounds(newBounds.x, newBounds.y, newBounds.width, newBounds.height, op);
+    }
+
 }
 
--- a/src/solaris/hpi/native_threads/src/sys_api_td.c	Fri Jan 30 16:19:11 2009 -0800
+++ b/src/solaris/hpi/native_threads/src/sys_api_td.c	Fri Jan 30 16:23:12 2009 -0800
@@ -70,6 +70,8 @@
  */
 #ifdef __linux__
 typedef int rlim_t ;
+#else
+#include <sys/resource.h>
 #endif
 
 
--- a/src/solaris/native/sun/awt/awt_GraphicsEnv.c	Fri Jan 30 16:19:11 2009 -0800
+++ b/src/solaris/native/sun/awt/awt_GraphicsEnv.c	Fri Jan 30 16:23:12 2009 -0800
@@ -32,6 +32,7 @@
 #include <sun_awt_X11GraphicsConfig.h>
 #ifndef HEADLESS
 #include <X11/extensions/Xdbe.h>
+#include <X11/XKBlib.h>
 #include "Xrandr.h"
 #include "GLXGraphicsConfig.h"
 #endif /* !HEADLESS */
@@ -56,10 +57,6 @@
 #endif
 
 #ifndef HEADLESS
-#ifdef __linux__
-#include <X11/XKBlib.h>
-#include "Xinerama.h"
-#endif
 
 int awt_numScreens;     /* Xinerama-aware number of screens */
 
@@ -125,7 +122,18 @@
  */
 
 #define MAXFRAMEBUFFERS 16
-#ifndef __linux__ /* SOLARIS */
+#ifdef __linux__
+typedef struct {
+   int   screen_number;
+   short x_org;
+   short y_org;
+   short width;
+   short height;
+} XineramaScreenInfo;
+
+typedef XineramaScreenInfo* XineramaQueryScreensFunc(Display*, int*);
+
+#else /* SOLARIS */
 typedef Status XineramaGetInfoFunc(Display* display, int screen_number,
          XRectangle* framebuffer_rects, unsigned char* framebuffer_hints,
          int* num_framebuffers);
@@ -617,109 +625,124 @@
         /* update peer, target Comp */
         (*env)->CallVoidMethod(env, peer,
                                mWindowPeerIDs.draggedToScreenMID, largestAmtScr);
-                               
     }
 #endif /* XAWT */
 }
 #endif /* HEADLESS */
 
+#ifndef HEADLESS
+#ifdef __linux__
+static void xinerama_init_linux()
+{
+    void* libHandle = 0;
+    char* XineramaLibName= "libXinerama.so.1";
+    int32_t locNumScr = 0;
+    XineramaScreenInfo *xinInfo;
+    char* XineramaQueryScreensName = "XineramaQueryScreens";
+    XineramaQueryScreensFunc* XineramaQueryScreens = NULL;
+
+    /* load library */
+    libHandle = dlopen(XineramaLibName, RTLD_LAZY | RTLD_GLOBAL);
+    if (libHandle != 0) {
+        XineramaQueryScreens = (XineramaQueryScreensFunc*)
+            dlsym(libHandle, XineramaQueryScreensName);
+
+        if (XineramaQueryScreens != NULL) {
+            DTRACE_PRINTLN("calling XineramaQueryScreens func on Linux");
+            xinInfo = (*XineramaQueryScreens)(awt_display, &locNumScr);
+            if (xinInfo != NULL) {
+                int32_t idx;
+                DTRACE_PRINTLN("Enabling Xinerama support");
+                usingXinerama = True;
+                /* set global number of screens */
+                DTRACE_PRINTLN1(" num screens = %i\n", locNumScr);
+                awt_numScreens = locNumScr;
+
+                /* stuff values into fbrects */
+                for (idx = 0; idx < awt_numScreens; idx++) {
+                    DASSERT(xinInfo[idx].screen_number == idx);
+
+                    fbrects[idx].width = xinInfo[idx].width;
+                    fbrects[idx].height = xinInfo[idx].height;
+                    fbrects[idx].x = xinInfo[idx].x_org;
+                    fbrects[idx].y = xinInfo[idx].y_org;
+                }
+            } else {
+                DTRACE_PRINTLN("calling XineramaQueryScreens didn't work");
+            }
+        } else {
+            DTRACE_PRINTLN("couldn't load XineramaQueryScreens symbol");
+        }
+        dlclose(libHandle);
+    } else {
+        DTRACE_PRINTLN1("\ncouldn't open shared library: %s\n", dlerror());
+    }
+}
+#endif
+#ifndef __linux__ /* Solaris */
+static void xinerama_init_solaris()
+{
+    void* libHandle = 0;
+    char* XineramaLibName= "libXext.so";
+    unsigned char fbhints[MAXFRAMEBUFFERS];
+    int32_t locNumScr = 0;
+    /* load and run XineramaGetInfo */
+    char* XineramaGetInfoName = "XineramaGetInfo";
+    char* XineramaGetCenterHintName = "XineramaGetCenterHint";
+    XineramaGetInfoFunc* XineramaSolarisFunc = NULL;
+
+    /* load library */
+    libHandle = dlopen(XineramaLibName, RTLD_LAZY | RTLD_GLOBAL);
+    if (libHandle != 0) {
+        XineramaSolarisFunc = (XineramaGetInfoFunc*)dlsym(libHandle, XineramaGetInfoName);
+        XineramaSolarisCenterFunc =
+            (XineramaGetCenterHintFunc*)dlsym(libHandle, XineramaGetCenterHintName);
+
+        if (XineramaSolarisFunc != NULL) {
+            DTRACE_PRINTLN("calling XineramaGetInfo func on Solaris");
+            if ((*XineramaSolarisFunc)(awt_display, 0, &fbrects[0],
+                                       &fbhints[0], &locNumScr) != 0)
+            {
+                DTRACE_PRINTLN("Enabling Xinerama support");
+                usingXinerama = True;
+                /* set global number of screens */
+                DTRACE_PRINTLN1(" num screens = %i\n", locNumScr);
+                awt_numScreens = locNumScr;
+            } else {
+                DTRACE_PRINTLN("calling XineramaGetInfo didn't work");
+            }
+        } else {
+            DTRACE_PRINTLN("couldn't load XineramaGetInfo symbol");
+        }
+        dlclose(libHandle);
+    } else {
+        DTRACE_PRINTLN1("\ncouldn't open shared library: %s\n", dlerror());
+    }
+}
+#endif
+
 /*
- * Do Xinerama-related initialization such as
- * - check if Xinerama is running
- * - if so, load and run Xinerama query functions from the appropriate library
+ * Checks if Xinerama is running and perform Xinerama-related
+ * platform dependent initialization.
  */
-#ifndef HEADLESS
-void xineramaInit(void) {
-#ifdef __linux__
+static void xineramaInit(void) {
     char* XinExtName = "XINERAMA";
     int32_t major_opcode, first_event, first_error;
     Bool gotXinExt = False;
-    unsigned char fbhints[MAXFRAMEBUFFERS];
-    int32_t locNumScr = 0;
-    int32_t idx;
-
-    XineramaScreenInfo *xinInfo;
 
     gotXinExt = XQueryExtension(awt_display, XinExtName, &major_opcode,
                                 &first_event, &first_error);
 
-    if (gotXinExt) {
-        DTRACE_PRINTLN("Xinerama extension available");
-                    DTRACE_PRINTLN("calling XineramaGetInfo func on Linux");
-                    xinInfo = XineramaQueryScreens(awt_display, &locNumScr);
-                    if (xinInfo != NULL) {
-                        DTRACE_PRINTLN("Enabling Xinerama support");
-                        usingXinerama = True;
-                        /* set global number of screens */
-                        DTRACE_PRINTLN1(" num screens = %i\n", locNumScr);
-                        awt_numScreens = locNumScr;
-
-                        /* stuff values into fbrects */
-                        for (idx = 0; idx < awt_numScreens; idx++) {
-                            DASSERT(xinInfo[idx].screen_number == idx);
-
-                            fbrects[idx].width = xinInfo[idx].width;
-                            fbrects[idx].height = xinInfo[idx].height;
-                            fbrects[idx].x = xinInfo[idx].x_org;
-                            fbrects[idx].y = xinInfo[idx].y_org;
-                        }
-                    } else {
-                        DTRACE_PRINTLN("calling XineramaQueryScreens didn't work");
-                    }
-    } else {
-        DTRACE_PRINTLN("Xinerama not available");
+    if (!gotXinExt) {
+        DTRACE_PRINTLN("Xinerama extension is not available");
+        return;
     }
 
+    DTRACE_PRINTLN("Xinerama extension is available");
+#ifdef __linux__
+    xinerama_init_linux();
 #else /* Solaris */
-
-    char* XinExtName = "XINERAMA";
-    int32_t major_opcode, first_event, first_error;
-    Bool gotXinExt = False;
-    void* libHandle = 0;
-    unsigned char fbhints[MAXFRAMEBUFFERS];
-    int locNumScr = 0;
-
-    char* XineramaLibName= "libXext.so";
-    char* XineramaGetInfoName = "XineramaGetInfo";
-    char* XineramaGetCenterHintName = "XineramaGetCenterHint";
-    XineramaGetInfoFunc* XineramaSolarisFunc = NULL;
-
-    gotXinExt = XQueryExtension(awt_display, XinExtName, &major_opcode,
-                                &first_event, &first_error);
-
-    if (gotXinExt) {
-        DTRACE_PRINTLN("Xinerama extension available");
-
-        /* load library, load and run XineramaGetInfo */
-        libHandle = dlopen(XineramaLibName, RTLD_LAZY | RTLD_GLOBAL);
-        if (libHandle != 0) {
-            XineramaSolarisFunc = (XineramaGetInfoFunc*)dlsym(libHandle, XineramaGetInfoName);
-            XineramaSolarisCenterFunc =
-             (XineramaGetCenterHintFunc*)dlsym(libHandle,
-                                               XineramaGetCenterHintName);
-            if (XineramaSolarisFunc != NULL) {
-                DTRACE_PRINTLN("calling XineramaGetInfo func on Solaris");
-                if ((*XineramaSolarisFunc)(awt_display, 0, &fbrects[0],
-                     &fbhints[0], &locNumScr) != 0) {
-
-                    DTRACE_PRINTLN("Enabling Xinerama support");
-                    usingXinerama = True;
-                    /* set global number of screens */
-                    DTRACE_PRINTLN1(" num screens = %i\n", locNumScr);
-                    awt_numScreens = locNumScr;
-                } else {
-                    DTRACE_PRINTLN("calling XineramaGetInfo didn't work");
-                }
-            } else {
-                DTRACE_PRINTLN("couldn't load XineramaGetInfo symbol");
-            }
-            dlclose(libHandle);
-        } else {
-            DTRACE_PRINTLN1("\ncouldn't open shared library: %s\n", dlerror());
-        }
-    } else {
-        DTRACE_PRINTLN("Xinerama not available");
-    }
+    xinerama_init_solaris();
 #endif /* __linux__ */
 }
 #endif /* HEADLESS */
@@ -922,7 +945,7 @@
 #ifdef HEADLESS
     return NULL;
 #else
-    return (jlong) awt_display;
+    return ptr_to_jlong(awt_display);
 #endif /* !HEADLESS */
 }
 
--- a/src/windows/classes/sun/awt/shell/Win32ShellFolder2.java	Fri Jan 30 16:19:11 2009 -0800
+++ b/src/windows/classes/sun/awt/shell/Win32ShellFolder2.java	Fri Jan 30 16:23:12 2009 -0800
@@ -32,6 +32,9 @@
 import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.util.*;
+import java.util.concurrent.*;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
 import javax.swing.SwingConstants;
 
 // NOTE: This class supersedes Win32ShellFolder, which was removed from
@@ -184,15 +187,20 @@
         boolean disposed;
         public void dispose() {
             if (disposed) return;
-            if (relativePIDL != 0) {
-                releasePIDL(relativePIDL);
-            }
-            if (absolutePIDL != 0) {
-                releasePIDL(absolutePIDL);
-            }
-            if (pIShellFolder != 0) {
-                releaseIShellFolder(pIShellFolder);
-            }
+            new ComTask<Void>() {
+                public Void call() throws Exception {
+                    if (relativePIDL != 0) {
+                        releasePIDL(relativePIDL);
+                    }
+                    if (absolutePIDL != 0) {
+                        releasePIDL(absolutePIDL);
+                    }
+                    if (pIShellFolder != 0) {
+                        releaseIShellFolder(pIShellFolder);
+                    }
+                    return null;
+                }
+            }.execute();
             disposed = true;
         }
     }
@@ -219,49 +227,59 @@
     private boolean isPersonal;
 
 
+    private static String composePathForCsidl(int csidl) throws IOException {
+        String path = getFileSystemPath(csidl);
+        return path == null
+                ? ("ShellFolder: 0x" + Integer.toHexString(csidl))
+                : path;
+    }
+
     /**
      * Create a system special shell folder, such as the
      * desktop or Network Neighborhood.
      */
-    Win32ShellFolder2(int csidl) throws IOException {
+    Win32ShellFolder2(final int csidl) throws IOException {
 	// Desktop is parent of DRIVES and NETWORK, not necessarily
 	// other special shell folders.
-	super(null,
-	      (getFileSystemPath(csidl) == null)
-		? ("ShellFolder: 0x"+Integer.toHexString(csidl)) : getFileSystemPath(csidl));
-        if (csidl == DESKTOP) {
-            initDesktop();
-        } else {
-            initSpecial(getDesktop().getIShellFolder(), csidl);
-	    // At this point, the native method initSpecial() has set our relativePIDL
-	    // relative to the Desktop, which may not be our immediate parent. We need
-	    // to traverse this ID list and break it into a chain of shell folders from
-	    // the top, with each one having an immediate parent and a relativePIDL
-	    // relative to that parent.
-	    long pIDL = disposer.relativePIDL;
-	    parent = getDesktop();
-	    while (pIDL != 0) {
-		// Get a child pidl relative to 'parent'
-		long childPIDL = copyFirstPIDLEntry(pIDL);
-		if (childPIDL != 0) {
-		    // Get a handle to the the rest of the ID list
-		    // i,e, parent's grandchilren and down
-		    pIDL = getNextPIDLEntry(pIDL);
-		    if (pIDL != 0) {
-			// Now we know that parent isn't immediate to 'this' because it
-			// has a continued ID list. Create a shell folder for this child
-			// pidl and make it the new 'parent'.
-			parent = new Win32ShellFolder2((Win32ShellFolder2)parent, childPIDL);
-		    } else {
-			// No grandchildren means we have arrived at the parent of 'this',
-			// and childPIDL is directly relative to parent.
-			disposer.relativePIDL = childPIDL;
-		    }
-		} else {
-		    break;
-		}
-	    }
-        }
+        super(null, composePathForCsidl(csidl));
+        new ComTask<Void>() {
+            public Void call() throws Exception {
+                if (csidl == DESKTOP) {
+                    initDesktop();
+                } else {
+                    initSpecial(getDesktop().getIShellFolder(), csidl);
+                    // At this point, the native method initSpecial() has set our relativePIDL
+                    // relative to the Desktop, which may not be our immediate parent. We need
+                    // to traverse this ID list and break it into a chain of shell folders from
+                    // the top, with each one having an immediate parent and a relativePIDL
+                    // relative to that parent.
+                    long pIDL = disposer.relativePIDL;
+                    parent = getDesktop();
+                    while (pIDL != 0) {
+                        // Get a child pidl relative to 'parent'
+                        long childPIDL = copyFirstPIDLEntry(pIDL);
+                        if (childPIDL != 0) {
+                            // Get a handle to the the rest of the ID list
+                            // i,e, parent's grandchilren and down
+                            pIDL = getNextPIDLEntry(pIDL);
+                            if (pIDL != 0) {
+                                // Now we know that parent isn't immediate to 'this' because it
+                                // has a continued ID list. Create a shell folder for this child
+                                // pidl and make it the new 'parent'.
+                                parent = new Win32ShellFolder2((Win32ShellFolder2)parent, childPIDL);
+                            } else {
+                                // No grandchildren means we have arrived at the parent of 'this',
+                                // and childPIDL is directly relative to parent.
+                                disposer.relativePIDL = childPIDL;
+                            }
+                        } else {
+                            break;
+                        }
+                    }
+                }
+                return null;
+            }
+        }.execute();
 
         sun.java2d.Disposer.addRecord(this, disposer);
     }
@@ -281,17 +299,25 @@
     /**
      * Creates a shell folder with a parent and relative PIDL
      */
-    Win32ShellFolder2(Win32ShellFolder2 parent, long relativePIDL) {
-	super(parent, getFileSystemPath(parent.getIShellFolder(), relativePIDL));
+    Win32ShellFolder2(final Win32ShellFolder2 parent, final long relativePIDL) {
+        super(parent,
+                new ComTask<String>() {
+                    public String call() throws Exception {
+                        return getFileSystemPath(parent.getIShellFolder(), relativePIDL);
+                    }
+                }.execute()
+        );
         this.disposer.relativePIDL = relativePIDL;
         getAbsolutePath();
         sun.java2d.Disposer.addRecord(this, disposer);
     }
 
     // Initializes the desktop shell folder
+    /* NOTE: this method uses COM and must be called on the 'COM thread'. See ComTask for the details */
     private native void initDesktop();
     // Initializes a special, non-file system shell folder
     // from one of the above constants
+    /* NOTE: this method uses COM and must be called on the 'COM thread'. See ComTask for the details */
     private native void initSpecial(long desktopIShellFolder, int csidl);
 
     /** Marks this folder as being the My Documents (Personal) folder */
@@ -306,31 +332,35 @@
      * <code>java.io.File</code> instead. If not, then the object depends
      * on native PIDL state and should not be serialized.
      *
-     * @returns a <code>java.io.File</code> replacement object. If the folder
+     * @return a <code>java.io.File</code> replacement object. If the folder
      * is a not a normal directory, then returns the first non-removable
      * drive (normally "C:\").
      */
     protected Object writeReplace() throws java.io.ObjectStreamException {
-	if (isFileSystem()) {
-	    return new File(getPath());
-	} else {
-	    Win32ShellFolder2 drives = Win32ShellFolderManager2.getDrives();
-	    if (drives != null) {
-		File[] driveRoots = drives.listFiles();
-		if (driveRoots != null) {
-		    for (int i = 0; i < driveRoots.length; i++) {
-			if (driveRoots[i] instanceof Win32ShellFolder2) {
-			    Win32ShellFolder2 sf = (Win32ShellFolder2)driveRoots[i];
-			    if (sf.isFileSystem() && !sf.hasAttribute(ATTRIB_REMOVABLE)) {
-				return new File(sf.getPath());
-			    }
-			}
-		    }
-		}
-	    }
-	    // Ouch, we have no hard drives. Return something "valid" anyway.
-	    return new File("C:\\");
-	}
+        return new ComTask<File>() {
+            public File call() throws Exception {
+                if (isFileSystem()) {
+                    return new File(getPath());
+                } else {
+                    Win32ShellFolder2 drives = Win32ShellFolderManager2.getDrives();
+                    if (drives != null) {
+                        File[] driveRoots = drives.listFiles();
+                        if (driveRoots != null) {
+                            for (int i = 0; i < driveRoots.length; i++) {
+                                if (driveRoots[i] instanceof Win32ShellFolder2) {
+                                    Win32ShellFolder2 sf = (Win32ShellFolder2)driveRoots[i];
+                                    if (sf.isFileSystem() && !sf.hasAttribute(ATTRIB_REMOVABLE)) {
+                                        return new File(sf.getPath());
+                                    }
+                                }
+                            }
+                        }
+                    }
+                    // Ouch, we have no hard drives. Return something "valid" anyway.
+                    return new File("C:\\");
+                }
+            }
+        }.execute();
     }
 
 
@@ -363,7 +393,7 @@
     // Needs to be accessible to Win32ShellFolderManager2
     static native void releasePIDL(long pIDL);
 
-    // Release an IShellFolder object
+    /* NOTE: this method uses COM and must be called on the 'COM thread'. See ComTask for the details */
     private static native void releaseIShellFolder(long pIShellFolder);
     
     /**
@@ -371,19 +401,29 @@
      */
     public long getIShellFolder() {
 	if (disposer.pIShellFolder == 0) {
-	    assert(isDirectory());
-	    assert(parent != null);
-	    long parentIShellFolder = getParentIShellFolder();
-	    if (parentIShellFolder == 0) {
-		throw new InternalError("Parent IShellFolder was null for " + getAbsolutePath());
-	    }
-	    // We are a directory with a parent and a relative PIDL.
-	    // We want to bind to the parent so we get an IShellFolder instance associated with us.
-	    disposer.pIShellFolder = bindToObject(parentIShellFolder, disposer.relativePIDL);
-	    if (disposer.pIShellFolder == 0) {
-		throw new InternalError("Unable to bind " + getAbsolutePath() + " to parent");
-	    }
-	}
+            disposer.pIShellFolder =
+                new ComTask<Long>() {
+                    public Long call() throws Exception {
+                        assert(isDirectory());
+                        assert(parent != null);
+                        long parentIShellFolder = getParentIShellFolder();
+                        if (parentIShellFolder == 0) {
+                            throw new InternalError("Parent IShellFolder was null for "
+                                    + getAbsolutePath());
+                        }
+                        // We are a directory with a parent and a relative PIDL.
+                        // We want to bind to the parent so we get an
+                        // IShellFolder instance associated with us.
+                        long pIShellFolder = bindToObject(parentIShellFolder,
+                                                        disposer.relativePIDL);
+                        if (pIShellFolder == 0) {
+                            throw new InternalError("Unable to bind "
+                                    + getAbsolutePath() + " to parent");
+                        }
+                        return pIShellFolder;
+                    }
+                }.execute();
+        }
         return disposer.pIShellFolder;
     }
 
@@ -416,7 +456,9 @@
 	    return getRelativePIDL();
 	} else {
 	    if (disposer.absolutePIDL == 0) {
-		disposer.absolutePIDL = combinePIDLs(((Win32ShellFolder2)parent).getAbsolutePIDL(), getRelativePIDL());
+                disposer.absolutePIDL = combinePIDLs(
+                        ((Win32ShellFolder2)parent).getAbsolutePIDL(),
+                        getRelativePIDL());
 	    }
 
 	    return disposer.absolutePIDL;
@@ -472,9 +514,14 @@
 	return false;
     }
     
-    private static boolean pidlsEqual(long pIShellFolder, long pidl1, long pidl2) {
-	return (compareIDs(pIShellFolder, pidl1, pidl2) == 0);
+    private static boolean pidlsEqual(final long pIShellFolder, final long pidl1, final long pidl2) {
+        return new ComTask<Boolean>() {
+            public Boolean call() throws Exception {
+                return (compareIDs(pIShellFolder, pidl1, pidl2) == 0);
+            }
+        }.execute();
     }
+    /* NOTE: this method uses COM and must be called on the 'COM thread'. See ComTask for the details */
     private static native int compareIDs(long pParentIShellFolder, long pidl1, long pidl2);
 
     /**
@@ -487,9 +534,15 @@
     /**
      * Return whether the given attribute flag is set for this object
      */
-    public boolean hasAttribute(int attribute) {
-	// Caching at this point doesn't seem to be cost efficient
-	return (getAttributes0(getParentIShellFolder(), getRelativePIDL(), attribute) & attribute) != 0;
+    public boolean hasAttribute(final int attribute) {
+        return new ComTask<Boolean>() {
+            public Boolean call() throws Exception {
+                // Caching at this point doesn't seem to be cost efficient
+                return (getAttributes0(getParentIShellFolder(),
+                                    getRelativePIDL(), attribute)
+                        & attribute) != 0;
+            }
+        }.execute();
     }
 
     /**
@@ -498,26 +551,39 @@
      * Could plausibly be used for attribute caching but have to be
      * very careful not to touch network drives and file system roots
      * with a full attrsMask
-     */
+     * NOTE: this method uses COM and must be called on the 'COM thread'. See ComTask for the details
+     * */
     private static native int getAttributes0(long pParentIShellFolder, long pIDL, int attrsMask);
 
     // Return the path to the underlying file system object
-    private static String getFileSystemPath(long parentIShellFolder, long relativePIDL) {
-	int linkedFolder = ATTRIB_LINK | ATTRIB_FOLDER;
-	if (parentIShellFolder == Win32ShellFolderManager2.getNetwork().getIShellFolder() &&
-	    getAttributes0(parentIShellFolder, relativePIDL, linkedFolder) == linkedFolder) {
+    private static String getFileSystemPath(final long parentIShellFolder, final long relativePIDL) {
+        return new ComTask<String>() {
+            public String call() throws Exception {
+                int linkedFolder = ATTRIB_LINK | ATTRIB_FOLDER;
+                if (parentIShellFolder == Win32ShellFolderManager2.getNetwork().getIShellFolder() &&
+                    getAttributes0(parentIShellFolder, relativePIDL, linkedFolder) == linkedFolder) {
 
-	    String s =
-		getFileSystemPath(Win32ShellFolderManager2.getDesktop().getIShellFolder(),
-				  getLinkLocation(parentIShellFolder, relativePIDL, false));
-	    if (s != null && s.startsWith("\\\\")) {
-		return s;
-	    }
-	}
-	return getDisplayNameOf(parentIShellFolder, relativePIDL, SHGDN_NORMAL | SHGDN_FORPARSING);
+                    String s =
+                        getFileSystemPath(Win32ShellFolderManager2.getDesktop().getIShellFolder(),
+                                          getLinkLocation(parentIShellFolder, relativePIDL, false));
+                    if (s != null && s.startsWith("\\\\")) {
+                        return s;
+                    }
+                }
+                return getDisplayNameOf(parentIShellFolder, relativePIDL, SHGDN_FORPARSING);
+            }
+        }.execute();
     }
     // Needs to be accessible to Win32ShellFolderManager2
-    static native String getFileSystemPath(int csidl) throws IOException;
+    static String getFileSystemPath(final int csidl) throws IOException {
+        return new ComTask<String>() {
+            public String call() throws Exception {
+                return getFileSystemPath0(csidl);
+            }
+        }.execute();
+    }
+    /* NOTE: this method uses COM and must be called on the 'COM thread'. See ComTask for the details */
+    private static native String getFileSystemPath0(int csidl) throws IOException;
     
     // Return whether the path is a network root.
     // Path is assumed to be non-null
@@ -557,24 +623,32 @@
      */
     // Returns an IEnumIDList interface for an IShellFolder.  The value
     // returned must be released using releaseEnumObjects().
-    private long getEnumObjects(long pIShellFolder, boolean includeHiddenFiles) {
-        boolean isDesktop = (disposer.pIShellFolder == getDesktopIShellFolder());
-        return getEnumObjects(disposer.pIShellFolder, isDesktop, includeHiddenFiles);
+    private long getEnumObjects(long pIShellFolder, final boolean includeHiddenFiles) {
+        final boolean isDesktop = (disposer.pIShellFolder == getDesktopIShellFolder());
+        return new ComTask<Long>() {
+            public Long call() throws Exception {
+                return getEnumObjects(disposer.pIShellFolder, isDesktop, includeHiddenFiles);
+            }
+        }.execute();
     }
     // Returns an IEnumIDList interface for an IShellFolder.  The value
     // returned must be released using releaseEnumObjects().
+    /* NOTE: this method uses COM and must be called on the 'COM thread'. See ComTask for the details */
     private native long getEnumObjects(long pIShellFolder, boolean isDesktop,
 				       boolean includeHiddenFiles);
     // Returns the next sequential child as a relative PIDL
     // from an IEnumIDList interface.  The value returned must
     // be released using releasePIDL().
+    /* NOTE: this method uses COM and must be called on the 'COM thread'. See ComTask for the details */
     private native long getNextChild(long pEnumObjects);
     // Releases the IEnumIDList interface
+    /* NOTE: this method uses COM and must be called on the 'COM thread'. See ComTask for the details */
     private native void releaseEnumObjects(long pEnumObjects);
     
     // Returns the IShellFolder of a child from a parent IShellFolder
     // and a relative PIDL.  The value returned must be released
     // using releaseIShellFolder().
+    /* NOTE: this method uses COM and must be called on the 'COM thread'. See ComTask for the details */
     private static native long bindToObject(long parentIShellFolder, long pIDL);
 
     /**
@@ -582,60 +656,61 @@
      *         object. The array will be empty if the folder is empty.  Returns
      *         <code>null</code> if this shellfolder does not denote a directory.
      */
-    public File[] listFiles(boolean includeHiddenFiles) {
-        SecurityManager security = System.getSecurityManager();
-        if (security != null) {
-            security.checkRead(getPath());
-        }
-	if (!isDirectory()) {
-	    return null;
-	}
-	// Links to directories are not directories and cannot be parents.
-	// This does not apply to folders in My Network Places (NetHood)
-	// because they are both links and real directories!
-	if (isLink() && !hasAttribute(ATTRIB_FOLDER)) {
-	    return new File[0];
-	}
+    public File[] listFiles(final boolean includeHiddenFiles) {
 
-	Win32ShellFolder2 desktop = Win32ShellFolderManager2.getDesktop();
-	Win32ShellFolder2 personal = Win32ShellFolderManager2.getPersonal();
-
-	// If we are a directory, we have a parent and (at least) a
-	// relative PIDL. We must first ensure we are bound to the
-	// parent so we have an IShellFolder to query.
-	long pIShellFolder = getIShellFolder();
-	// Now we can enumerate the objects in this folder.
-	ArrayList list = new ArrayList();
-	long pEnumObjects = getEnumObjects(pIShellFolder, includeHiddenFiles);
-	if (pEnumObjects != 0) {
-	    long childPIDL = 0;
-	    int testedAttrs = ATTRIB_FILESYSTEM | ATTRIB_FILESYSANCESTOR;
-	    do {
-                if (Thread.currentThread().isInterrupted()) {
+        return new ComTask<File[]>() {
+            public File[] call() throws Exception {
+                if (!isDirectory()) {
+                    return null;
+                }
+                // Links to directories are not directories and cannot be parents.
+                // This does not apply to folders in My Network Places (NetHood)
+                // because they are both links and real directories!
+                if (isLink() && !hasAttribute(ATTRIB_FOLDER)) {
                     return new File[0];
                 }
-		childPIDL = getNextChild(pEnumObjects);
-                boolean releasePIDL = true;
-		if (childPIDL != 0 &&
-		    (getAttributes0(pIShellFolder, childPIDL, testedAttrs) & testedAttrs) != 0) {
-		    Win32ShellFolder2 childFolder = null;
-		    if (this.equals(desktop)
-			&& personal != null
-			&& pidlsEqual(pIShellFolder, childPIDL, personal.disposer.relativePIDL)) {
-			childFolder = personal;
-		    } else {
-			childFolder = new Win32ShellFolder2(this, childPIDL);
-                        releasePIDL = false;
-		    }
-		    list.add(childFolder);
-		}
-                if (releasePIDL) {
-                    releasePIDL(childPIDL);
-		}
-	    } while (childPIDL != 0);
-	    releaseEnumObjects(pEnumObjects);
-	}
-	return (ShellFolder[])list.toArray(new ShellFolder[list.size()]);
+
+                Win32ShellFolder2 desktop = Win32ShellFolderManager2.getDesktop();
+                Win32ShellFolder2 personal = Win32ShellFolderManager2.getPersonal();
+
+                // If we are a directory, we have a parent and (at least) a
+                // relative PIDL. We must first ensure we are bound to the
+                // parent so we have an IShellFolder to query.
+                long pIShellFolder = getIShellFolder();
+                // Now we can enumerate the objects in this folder.
+                ArrayList list = new ArrayList();
+                long pEnumObjects = getEnumObjects(pIShellFolder, includeHiddenFiles);
+                if (pEnumObjects != 0) {
+                    long childPIDL = 0;
+                    int testedAttrs = ATTRIB_FILESYSTEM | ATTRIB_FILESYSANCESTOR;
+                    do {
+                        if (Thread.currentThread().isInterrupted()) {
+                            return new File[0];
+                        }
+                        childPIDL = getNextChild(pEnumObjects);
+                        boolean releasePIDL = true;
+                        if (childPIDL != 0 &&
+                            (getAttributes0(pIShellFolder, childPIDL, testedAttrs) & testedAttrs) != 0) {
+                            Win32ShellFolder2 childFolder = null;
+                            if (this.equals(desktop)
+                                && personal != null
+                                && pidlsEqual(pIShellFolder, childPIDL, personal.disposer.relativePIDL)) {
+                                childFolder = personal;
+                            } else {
+                                childFolder = new Win32ShellFolder2(Win32ShellFolder2.this, childPIDL);
+                                releasePIDL = false;
+                            }
+                            list.add(childFolder);
+                        }
+                        if (releasePIDL) {
+                            releasePIDL(childPIDL);
+                        }
+                    } while (childPIDL != 0);
+                    releaseEnumObjects(pEnumObjects);
+                }
+                return (ShellFolder[])list.toArray(new ShellFolder[list.size()]);
+            }
+        }.execute();
     }
     
     
@@ -644,25 +719,31 @@
      *
      * @return The child shellfolder, or null if not found.
      */
-    Win32ShellFolder2 getChildByPath(String filePath) {
-	long pIShellFolder = getIShellFolder();
-	long pEnumObjects =  getEnumObjects(pIShellFolder, true);
-	Win32ShellFolder2 child = null;
-	long childPIDL = 0;
+    Win32ShellFolder2 getChildByPath(final String filePath) {
+
+        return new ComTask<Win32ShellFolder2>() {
+            public Win32ShellFolder2 call() throws Exception {
+                long pIShellFolder = getIShellFolder();
+                long pEnumObjects =  getEnumObjects(pIShellFolder, true);
+                Win32ShellFolder2 child = null;
+                long childPIDL = 0;
 
-	while ((childPIDL = getNextChild(pEnumObjects)) != 0) {
-	    if (getAttributes0(pIShellFolder, childPIDL, ATTRIB_FILESYSTEM) != 0) {
-		String path = getFileSystemPath(pIShellFolder, childPIDL);
-		if (path != null && path.equalsIgnoreCase(filePath)) {
-		    long childIShellFolder = bindToObject(pIShellFolder, childPIDL);
-		    child = new Win32ShellFolder2(this, childIShellFolder, childPIDL, path);
-		    break;
-		}
-	    }
-            releasePIDL(childPIDL);            
-	}
-	releaseEnumObjects(pEnumObjects);
-	return child;
+                while ((childPIDL = getNextChild(pEnumObjects)) != 0) {
+                    if (getAttributes0(pIShellFolder, childPIDL, ATTRIB_FILESYSTEM) != 0) {
+                        String path = getFileSystemPath(pIShellFolder, childPIDL);
+                        if (path != null && path.equalsIgnoreCase(filePath)) {
+                            long childIShellFolder = bindToObject(pIShellFolder, childPIDL);
+                            child = new Win32ShellFolder2(Win32ShellFolder2.this,
+                                            childIShellFolder, childPIDL, path);
+                            break;
+                        }
+                    }
+                    releasePIDL(childPIDL);
+                }
+                releaseEnumObjects(pEnumObjects);
+                return child;
+            }
+        }.execute();
     }
 
 
@@ -682,6 +763,7 @@
 
 
     // Return the link location of a shell folder
+    /* NOTE: this method uses COM and must be called on the 'COM thread'. See ComTask for the details */
     private static native long getLinkLocation(long parentIShellFolder,
 					long relativePIDL, boolean resolve);
 
@@ -693,38 +775,52 @@
 	return getLinkLocation(true);
     }
 
-    private ShellFolder getLinkLocation(boolean resolve)  {
-	if (!isLink()) {
-	    return null;
-	}
+    private ShellFolder getLinkLocation(final boolean resolve)  {
+        return new ComTask<ShellFolder>() {
+            public ShellFolder call() throws Exception {
+                if (!isLink()) {
+                    return null;
+                }
 
-	ShellFolder location = null;
-	long linkLocationPIDL = getLinkLocation(getParentIShellFolder(),
-						getRelativePIDL(), resolve);
-	if (linkLocationPIDL != 0) {
-	    try { 
-		location =
-		    Win32ShellFolderManager2.createShellFolderFromRelativePIDL(getDesktop(),
-									       linkLocationPIDL);
-	    } catch (InternalError e) {
-		// Could be a link to a non-bindable object, such as a network connection
-		// TODO: getIShellFolder() should throw FileNotFoundException instead
-	    }
-	}
-	return location;
+                ShellFolder location = null;
+                long linkLocationPIDL = getLinkLocation(getParentIShellFolder(),
+                                                        getRelativePIDL(), resolve);
+                if (linkLocationPIDL != 0) {
+                    try {
+                        location =
+                            Win32ShellFolderManager2.createShellFolderFromRelativePIDL(
+                                                        getDesktop(), linkLocationPIDL);
+                    } catch (InternalError e) {
+                        // Could be a link to a non-bindable object,
+                        // such as a network connection
+                        // TODO: getIShellFolder() should throw FileNotFoundException instead
+                    }
+                }
+                return location;
+            }
+        }.execute();
     }
-    
+
     // Parse a display name into a PIDL relative to the current IShellFolder.
-    long parseDisplayName(String name) throws FileNotFoundException {
-	try {
-	    return parseDisplayName0(getIShellFolder(), name);
-	} catch (IOException e) {
-	    throw new FileNotFoundException("Could not find file " + name);
-	}
+    long parseDisplayName(final String name) throws FileNotFoundException {
+        try {
+            return new ComTask<Long>() {
+                public Long call() throws Exception {
+                    return parseDisplayName0(getIShellFolder(), name);
+                }
+            }.execute();
+        } catch (RuntimeException e) {
+            if (e.getCause() instanceof IOException) {
+                throw new FileNotFoundException("Could not find file " + name);
+            }
+            throw e;
+        }
     }
+    /* NOTE: this method uses COM and must be called on the 'COM thread'. See ComTask for the details */
     private static native long parseDisplayName0(long pIShellFolder, String name) throws IOException;
 
     // Return the display name of a shell folder
+    /* NOTE: this method uses COM and must be called on the 'COM thread'. See ComTask for the details */
     private static native String getDisplayNameOf(long parentIShellFolder,
 						  long relativePIDL,
 						  int attrs);
@@ -734,12 +830,19 @@
      */
     public String getDisplayName() {
 	if (displayName == null) {
-	    displayName = getDisplayNameOf(getParentIShellFolder(), getRelativePIDL(), SHGDN_NORMAL);
-	}
+            displayName =
+                new ComTask<String>() {
+                    public String call() throws Exception {
+                        return getDisplayNameOf(getParentIShellFolder(),
+                                        getRelativePIDL(), SHGDN_NORMAL);
+                    }
+                }.execute();
+        }
 	return displayName;
     }
     
     // Return the folder type of a shell folder
+    /* NOTE: this method uses COM and must be called on the 'COM thread'. See ComTask for the details */
     private static native String getFolderType(long pIDL);
 
     /**
@@ -747,8 +850,14 @@
      */
     public String getFolderType() {
 	if (folderType == null) {
-	    folderType = getFolderType(getAbsolutePIDL());
-	}
+            final long absolutePIDL = getAbsolutePIDL();
+            folderType =
+                new ComTask<String>() {
+                    public String call() throws Exception {
+                        return getFolderType(absolutePIDL);
+                    }
+                }.execute();
+        }
 	return folderType;
     }
     
@@ -774,11 +883,14 @@
     private static Map smallLinkedSystemImages = new HashMap();
     private static Map largeLinkedSystemImages = new HashMap();
 
+    /* NOTE: this method uses COM and must be called on the 'COM thread'. See ComTask for the details */
     private static native long getIShellIcon(long pIShellFolder);
+    /* NOTE: this method uses COM and must be called on the 'COM thread'. See ComTask for the details */
     private static native int getIconIndex(long parentIShellIcon, long relativePIDL);
 
     // Return the icon of a file system shell folder in the form of an HICON
     private static native long getIcon(String absolutePath, boolean getLargeIcon);
+    /* NOTE: this method uses COM and must be called on the 'COM thread'. See ComTask for the details */
     private static native long extractIcon(long parentIShellFolder, long relativePIDL,
 					   boolean getLargeIcon);
 
@@ -799,9 +911,14 @@
 
     private long getIShellIcon() {
 	if (pIShellIcon == -1L) {
-	    pIShellIcon = getIShellIcon(getIShellFolder());
-	}
-	return pIShellIcon;
+            pIShellIcon =
+                new ComTask<Long>() {
+                    public Long call() throws Exception {
+                        return getIShellIcon(getIShellFolder());
+                    }
+                }.execute();
+        }
+        return pIShellIcon;
     }
 
 
@@ -850,50 +967,65 @@
     /**
      * @return The icon image used to display this shell folder
      */
-    public Image getIcon(boolean getLargeIcon) {
-	Image icon = getLargeIcon ? largeIcon : smallIcon;
-	if (icon == null) {
-	    long parentIShellIcon = (parent != null) ? ((Win32ShellFolder2)parent).getIShellIcon() : 0L;
-	    long relativePIDL = getRelativePIDL();
+    public Image getIcon(final boolean getLargeIcon) {
+        Image icon = getLargeIcon ? largeIcon : smallIcon;
+        if (icon == null) {
+            icon =
+                new ComTask<Image>() {
+                    public Image call() throws Exception {
+
+                        Image newIcon = null;
+                        if (isFileSystem()) {
+                            long parentIShellIcon = (parent != null)
+                                    ? ((Win32ShellFolder2)parent).getIShellIcon()
+                                    : 0L;
+                            long relativePIDL = getRelativePIDL();
 
-	    if (isFileSystem()) {
-		// These are cached per type (using the index in the system image list)
-		int index = getIconIndex(parentIShellIcon, relativePIDL);
-		if (index > 0) {
-		    Map imageCache;
-		    if (isLink()) {
-			imageCache = getLargeIcon ? largeLinkedSystemImages : smallLinkedSystemImages;
-		    } else {
-			imageCache = getLargeIcon ? largeSystemImages : smallSystemImages;
-		    }
-		    icon = (Image)imageCache.get(Integer.valueOf(index));
-		    if (icon == null) {
-			long hIcon = getIcon(getAbsolutePath(), getLargeIcon);
-			icon = makeIcon(hIcon, getLargeIcon);
-                        disposeIcon(hIcon);
-			if (icon != null) {
-			    imageCache.put(Integer.valueOf(index), icon);
-			}
-		    }
-		}
-	    }
+                            // These are cached per type (using the index in the system image list)
+                            int index = getIconIndex(parentIShellIcon, relativePIDL);
+                            if (index > 0) {
+                                Map imageCache;
+                                if (isLink()) {
+                                    imageCache = getLargeIcon
+                                            ? largeLinkedSystemImages
+                                            : smallLinkedSystemImages;
+                                } else {
+                                    imageCache = getLargeIcon
+                                            ? largeSystemImages
+                                            : smallSystemImages;
+                                }
+                                newIcon = (Image) imageCache.get(Integer.valueOf(index));
+                                if (newIcon == null) {
+                                    long hIcon = getIcon(getAbsolutePath(), getLargeIcon);
+                                    newIcon = makeIcon(hIcon, getLargeIcon);
+                                    disposeIcon(hIcon);
+                                    if (newIcon != null) {
+                                        imageCache.put(Integer.valueOf(index), newIcon);
+                                    }
+                                }
+                            }
+                        }
 
-	    if (icon == null) {
-		// These are only cached per object
-		long hIcon = extractIcon(getParentIShellFolder(), getRelativePIDL(), getLargeIcon);
-		icon = makeIcon(hIcon, getLargeIcon);
-                disposeIcon(hIcon);
-	    }
+                        if (newIcon == null) {
+                            // These are only cached per object
+                            long hIcon = extractIcon(getParentIShellFolder(),
+                                            getRelativePIDL(), getLargeIcon);
+                            newIcon = makeIcon(hIcon, getLargeIcon);
+                            disposeIcon(hIcon);
+                        }
 
-	    if (getLargeIcon) {
-		largeIcon = icon;
-	    } else {
-		smallIcon = icon;
-	    }
-	}
-	if (icon == null) {
-	    icon = super.getIcon(getLargeIcon);
-	}
+                        if (newIcon == null) {
+                            newIcon = Win32ShellFolder2.super.getIcon(getLargeIcon);
+                        }
+                        return newIcon;
+                    }
+                }.execute();
+            if (getLargeIcon) {
+                largeIcon = icon;
+            } else {
+                smallIcon = icon;
+            }
+        }
 	return icon;
     }
     
@@ -967,39 +1099,48 @@
     private static final int LVCFMT_CENTER = 2;
 
     public ShellFolderColumnInfo[] getFolderColumns() {
-        ShellFolderColumnInfo[] columns = doGetColumnInfo(getIShellFolder());
+        return new ComTask<ShellFolderColumnInfo[]>() {
+            public ShellFolderColumnInfo[] call() throws Exception {
+                ShellFolderColumnInfo[] columns = doGetColumnInfo(getIShellFolder());
 
-        if (columns != null) {
-            List<ShellFolderColumnInfo> notNullColumns =
-                    new ArrayList<ShellFolderColumnInfo>();
-            for (int i = 0; i < columns.length; i++) {
-                ShellFolderColumnInfo column = columns[i];
-                if (column != null) {
-                    column.setAlignment(column.getAlignment() == LVCFMT_RIGHT
-                            ? SwingConstants.RIGHT
-                                : column.getAlignment() == LVCFMT_CENTER
-                            ? SwingConstants.CENTER
-                                : SwingConstants.LEADING);
+                if (columns != null) {
+                    List<ShellFolderColumnInfo> notNullColumns =
+                            new ArrayList<ShellFolderColumnInfo>();
+                    for (int i = 0; i < columns.length; i++) {
+                        ShellFolderColumnInfo column = columns[i];
+                        if (column != null) {
+                            column.setAlignment(column.getAlignment() == LVCFMT_RIGHT
+                                    ? SwingConstants.RIGHT
+                                        : column.getAlignment() == LVCFMT_CENTER
+                                    ? SwingConstants.CENTER
+                                        : SwingConstants.LEADING);
 
-                    column.setComparator(new ColumnComparator(i));
+                            column.setComparator(new ColumnComparator(i));
 
-                    notNullColumns.add(column);
+                            notNullColumns.add(column);
+                        }
+                    }
+                    columns = new ShellFolderColumnInfo[notNullColumns.size()];
+                    notNullColumns.toArray(columns);
                 }
+                return columns;
             }
-            columns = new ShellFolderColumnInfo[notNullColumns.size()];
-            notNullColumns.toArray(columns);
-        }
-        return columns;
+        }.execute();
     }
 
-    public Object getFolderColumnValue(int column) {
-        return doGetColumnValue(getParentIShellFolder(), getRelativePIDL(), column);
+    public Object getFolderColumnValue(final int column) {
+        return new ComTask<Object>() {
+            public Object call() throws Exception {
+                return doGetColumnValue(getParentIShellFolder(), getRelativePIDL(), column);
+            }
+        }.execute();
     }
 
+    /* NOTE: this method uses COM and must be called on the 'COM thread'. See ComTask for the details */
     private native ShellFolderColumnInfo[] doGetColumnInfo(long iShellFolder2);
-
+    /* NOTE: this method uses COM and must be called on the 'COM thread'. See ComTask for the details */
     private native Object doGetColumnValue(long parentIShellFolder2, long childPIDL, int columnIdx);
-
+    /* NOTE: this method uses COM and must be called on the 'COM thread'. See ComTask for the details */
     private native int compareIDsByColumn(long pParentIShellFolder, long pidl1, long pidl2, int columnIdx);
 
 
@@ -1011,16 +1152,107 @@
         }
 
         // compares 2 objects within this folder by the specified column
-        public int compare(Object o, Object o1) {
-            if (o instanceof Win32ShellFolder2
-                    && o1 instanceof Win32ShellFolder2) {
-                // delegates comparison to native method
-                return compareIDsByColumn(getIShellFolder(),
-                        ((Win32ShellFolder2) o).getRelativePIDL(),
-                        ((Win32ShellFolder2) o1).getRelativePIDL(),
-                        columnIdx);
+        public int compare(final Object o, final Object o1) {
+            return new ComTask<Integer>() {
+                public Integer call() throws Exception {
+                    if (o instanceof Win32ShellFolder2
+                            && o1 instanceof Win32ShellFolder2) {
+                        // delegates comparison to native method
+                        return compareIDsByColumn(getIShellFolder(),
+                                ((Win32ShellFolder2) o).getRelativePIDL(),
+                                ((Win32ShellFolder2) o1).getRelativePIDL(),
+                                columnIdx);
+                    }
+                    return 0;
+                }
+            }.execute();
+        }
+    }
+
+    private static native void initializeCom();
+    private static native void uninitializeCom();
+
+    private static class ComTaskExecutor extends ThreadPoolExecutor implements ThreadFactory {
+        private final static ComTaskExecutor executor = new ComTaskExecutor();
+        private Thread thread;
+
+        private ComTaskExecutor() {
+            // Executor with the single thread that never dies
+            super(1, 1, 0, TimeUnit.DAYS, new LinkedBlockingQueue<Runnable>());
+            allowCoreThreadTimeOut(false);
+            setThreadFactory(this);
+
+            final Runnable shutdownHook = new Runnable() { 
+                public void run() {
+                    AccessController.doPrivileged(new PrivilegedAction<Void>() {
+                        public Void run() {
+                            shutdownNow();
+                            return null;
+                        }
+                    }); 
+                } 
+            }; 
+            AccessController.doPrivileged(new PrivilegedAction<Void>() { 
+                public Void run() { 
+                    Runtime.getRuntime().addShutdownHook( 
+                        new Thread(shutdownHook) 
+                    );
+                    return null;
+                }
+            });
+        }
+
+        public synchronized Thread newThread(final Runnable task) {
+            final Runnable comRun = new Runnable() {
+                public void run() {
+                    try {
+                        initializeCom();
+                        task.run();
+                    } finally {
+                        uninitializeCom();
+                    }
+                }
+            };
+            thread =
+                AccessController.doPrivileged( 
+                    new PrivilegedAction<Thread>() { 
+                        public Thread run() {
+                            /* The thread must be a member of a thread group
+                             * which will not get GCed before VM exit.
+                             * Make its parent the top-level thread group.
+                             */
+                            ThreadGroup tg = Thread.currentThread().getThreadGroup();
+                            for (ThreadGroup tgn = tg;
+                                 tgn != null;
+                                 tg = tgn, tgn = tg.getParent());
+                            Thread thread = new Thread(tg, comRun, "Swing-Shell"); 
+                            thread.setDaemon(true); 
+                            return thread; 
+                        }
+                    }
+                );
+            return thread;
+        }
+
+        public synchronized boolean isAlreadyOnComThread() {
+            return Thread.currentThread() == thread;
+        }
+    }
+
+    private static abstract class ComTask<T> implements Callable<T> {
+        public T execute() {
+            try {
+                return ComTaskExecutor.executor.isAlreadyOnComThread()
+                        // if it's already called from the COM
+                        // thread, we don't need to delegate the task
+                        ? this.call()
+                        : ComTaskExecutor.executor.submit(this).get();
+            } catch (Exception e) {
+                Throwable cause = (e instanceof ExecutionException) ? e.getCause() : e;
+                if (cause instanceof RuntimeException) { throw (RuntimeException) cause; }
+                if (cause instanceof Error)            { throw (Error) cause; }
+                throw new RuntimeException(cause);
             }
-            return 0;
         }
     }
 
--- a/src/windows/classes/sun/awt/windows/WDialogPeer.java	Fri Jan 30 16:19:11 2009 -0800
+++ b/src/windows/classes/sun/awt/windows/WDialogPeer.java	Fri Jan 30 16:23:12 2009 -0800
@@ -108,11 +108,18 @@
         }
     }
 
+    @Override
+    boolean isTargetUndecorated() {
+        return ((Dialog)target).isUndecorated();
+    }
+
     public void reshape(int x, int y, int width, int height) {
+        Rectangle newBounds = constrainBounds(x, y, width, height);
+
         if (((Dialog)target).isUndecorated()) {
-            super.reshape(x,y,width,height);
+            super.reshape(newBounds.x, newBounds.y, newBounds.width, newBounds.height);
         } else {
-            reshapeFrame(x,y,width,height);
+            reshapeFrame(newBounds.x, newBounds.y, newBounds.width, newBounds.height);
         }
     }
 
--- a/src/windows/classes/sun/awt/windows/WEmbeddedFramePeer.java	Fri Jan 30 16:19:11 2009 -0800
+++ b/src/windows/classes/sun/awt/windows/WEmbeddedFramePeer.java	Fri Jan 30 16:23:12 2009 -0800
@@ -65,4 +65,10 @@
     public native Rectangle getBoundsPrivate();
 
     public native void synthesizeWmActivate(boolean doActivate);
+
+    @Override
+    Rectangle constrainBounds(int x, int y, int width, int height) {
+        // We don't constrain the bounds of the EmbeddedFrames
+        return new Rectangle(x, y, width, height);
+    }
 }
--- a/src/windows/classes/sun/awt/windows/WFramePeer.java	Fri Jan 30 16:19:11 2009 -0800
+++ b/src/windows/classes/sun/awt/windows/WFramePeer.java	Fri Jan 30 16:23:12 2009 -0800
@@ -64,11 +64,18 @@
 	}
     }
 
+    @Override
+    boolean isTargetUndecorated() {
+        return ((Frame)target).isUndecorated();
+    }
+
     public void reshape(int x, int y, int width, int height) {
+        Rectangle newBounds = constrainBounds(x, y, width, height);
+
         if (((Frame)target).isUndecorated()) {
-            super.reshape(x,y,width,height);
+            super.reshape(newBounds.x, newBounds.y, newBounds.width, newBounds.height);
         } else {
-            reshapeFrame(x,y,width,height);
+            reshapeFrame(newBounds.x, newBounds.y, newBounds.width, newBounds.height);
         }
     }
 
--- a/src/windows/classes/sun/awt/windows/WWindowPeer.java	Fri Jan 30 16:19:11 2009 -0800
+++ b/src/windows/classes/sun/awt/windows/WWindowPeer.java	Fri Jan 30 16:23:12 2009 -0800
@@ -440,6 +440,97 @@
      private native void nativeGrab();
      private native void nativeUngrab();
 
+     private final boolean hasWarningWindow() {
+         return ((Window)target).getWarningString() != null;
+     }
+
+     boolean isTargetUndecorated() {
+         return true;
+     }
+
+     // These are the peer bounds. They get updated at:
+     //    1. the WWindowPeer.setBounds() method.
+     //    2. the native code (on WM_SIZE/WM_MOVE)
+     private volatile int sysX = 0;
+     private volatile int sysY = 0;
+     private volatile int sysW = 0;
+     private volatile int sysH = 0;
+
+     Rectangle constrainBounds(int x, int y, int width, int height) {
+         // We don't restrict the setBounds() operation if the code is trusted.
+         if (!hasWarningWindow()) {
+             return new Rectangle(x, y, width, height);
+         }
+
+         int newX = x;
+         int newY = y;
+         int newW = width;
+         int newH = height;
+
+         GraphicsConfiguration gc = ((Window)target).getGraphicsConfiguration();
+         Rectangle sB = gc.getBounds();
+         Insets sIn = ((Window)target).getToolkit().getScreenInsets(gc);
+
+         int screenW = sB.width - sIn.left - sIn.right;
+         int screenH = sB.height - sIn.top - sIn.bottom;
+
+         // If it's undecorated or is not currently visible
+         if (!((Window)target).isVisible() || isTargetUndecorated()) {
+             // Now check each point is within the visible part of the screen
+             int screenX = sB.x + sIn.left;
+             int screenY = sB.y + sIn.top;
+
+             // First make sure the size is withing the visible part of the screen
+             if (newW > screenW) {
+                 newW = screenW;
+             }
+
+             if (newH > screenH) {
+                 newH = screenH;
+             }
+
+             // Tweak the location if needed
+             if (newX < screenX) {
+                 newX = screenX;
+             } else if (newX + newW > screenX + screenW) {
+                 newX = screenX + screenW - newW;
+             }
+
+             if (newY < screenY) {
+                 newY = screenY;
+             } else if (newY + newH > screenY + screenH) {
+                 newY = screenY + screenH - newH;
+             }
+         } else {
+             int maxW = Math.max(screenW, sysW);
+             int maxH = Math.max(screenH, sysH);
+
+             // Make sure the size is withing the visible part of the screen
+             // OR less that the current size of the window.
+             if (newW > maxW) {
+                 newW = maxW;
+             }
+
+             if (newH > maxH) {
+                 newH = maxH;
+             }
+         }
+
+         return new Rectangle(newX, newY, newW, newH);
+     }
+
+     @Override
+     public void setBounds(int x, int y, int width, int height, int op) {
+         Rectangle newBounds = constrainBounds(x, y, width, height);
+
+         sysX = newBounds.x;
+         sysY = newBounds.y;
+         sysW = newBounds.width;
+         sysH = newBounds.height;
+
+         super.setBounds(newBounds.x, newBounds.y, newBounds.width, newBounds.height, op);
+     }
+
     /*
      * Static inner class, listens for 'activeWindow' KFM property changes and
      * updates the list of active windows per AppContext, so the latest active
--- a/src/windows/native/sun/windows/ShellFolder2.cpp	Fri Jan 30 16:19:11 2009 -0800
+++ b/src/windows/native/sun/windows/ShellFolder2.cpp	Fri Jan 30 16:23:12 2009 -0800
@@ -87,14 +87,7 @@
 static IShellFolder* pDesktop;
 
 static BOOL isXP;
-
-// copied from awt.h, because it is not included in release
-#if defined (WIN32)
-    #define IS_WINVISTA (!(::GetVersion() & 0x80000000) && LOBYTE(LOWORD(::GetVersion())) >= 6)
-#else
-    #define IS_WINVISTA FALSE
-#endif
-
+static BOOL isVista;
 
 extern "C" {
 
@@ -219,6 +212,36 @@
 	    (LOBYTE(LOWORD(version)) == 5 &&
 	     HIBYTE(LOWORD(version)) >= 1) ||
 	    LOBYTE(LOWORD(version)) > 5);
+
+    isVista = (!(version & 0x80000000) && LOBYTE(LOWORD(version)) >= 6);
+}
+
+
+/*
+* Class:     sun_awt_shell_Win32ShellFolder2
+* Method:    initializeCom
+* Signature: ()V
+*/
+JNIEXPORT void JNICALL Java_sun_awt_shell_Win32ShellFolder2_initializeCom
+        (JNIEnv* env, jclass cls)
+{
+    HRESULT hr = ::CoInitialize(NULL);
+    if (FAILED(hr)) {
+        char c[64];
+        sprintf(c, "Could not initialize COM: HRESULT=0x%08X", hr);
+        JNU_ThrowInternalError(env, c);
+    }
+}
+
+/*
+* Class:     sun_awt_shell_Win32ShellFolder2
+* Method:    uninitializeCom
+* Signature: ()V
+*/
+JNIEXPORT void JNICALL Java_sun_awt_shell_Win32ShellFolder2_uninitializeCom
+        (JNIEnv* env, jclass cls)
+{
+    ::CoUninitialize();
 }
 
 static IShellIcon* getIShellIcon(IShellFolder* pIShellFolder) {
@@ -235,29 +258,6 @@
     return (IShellIcon*)NULL;
 }
 
-// Fixed 6263669
-//
-// CoInitialize wrapper
-// call CoInitialize to initialize COM in STA mode and check result
-// RPC_E_CHANGED_MODE means COM has already been initialized in MTA mode,
-// so don't set the flag to call CoUninitialize later
-
-BOOL CoInit(BOOL& doCoUninit) { // returns TRUE if initialized successfully
-    switch(::CoInitialize(NULL)) {
-    case S_OK:
-    case S_FALSE:
-        doCoUninit = TRUE;
-        return TRUE;
-        break;
-    case RPC_E_CHANGED_MODE:
-        doCoUninit = FALSE;
-        return TRUE;
-        break;
-    default:
-        return FALSE;
-    }
-}
-
 
 /*
  * Class:     sun_awt_shell_Win32ShellFolder2
@@ -503,10 +503,10 @@
 
 /*
  * Class:     sun_awt_shell_Win32ShellFolder2
- * Method:    getFileSystemPath
+ * Method:    getFileSystemPath0
  * Signature: (I)Ljava/lang/String;
  */
-JNIEXPORT jstring JNICALL Java_sun_awt_shell_Win32ShellFolder2_getFileSystemPath__I
+JNIEXPORT jstring JNICALL Java_sun_awt_shell_Win32ShellFolder2_getFileSystemPath0
     (JNIEnv* env, jclass cls, jint csidl)
 {
     LPITEMIDLIST relPIDL;
@@ -607,18 +607,6 @@
     if (SUCCEEDED (hr)) {
         return (jlong)pFolder;
     }
-    if (IS_WINVISTA) {
-        BOOL doCoUninit;
-        if (CoInit(doCoUninit)) {
-            hr = pParent->BindToObject(pidl, NULL, IID_IShellFolder, (void**)&pFolder);
-            if (doCoUninit) {
-                ::CoUninitialize();
-            }
-            if (SUCCEEDED (hr)) {
-                return (jlong)pFolder;
-            }
-        }
-    }
     return 0;
 }
 
@@ -646,7 +634,10 @@
         return NULL;
     }
 
-    pParent->GetDisplayNameOf(pidl, SHGDN_NORMAL | SHGDN_FORPARSING, &strret);
+    hres = pParent->GetDisplayNameOf(pidl, SHGDN_NORMAL | SHGDN_FORPARSING, &strret);
+    if (FAILED(hres)) {
+        return NULL;
+    }
 
     switch (strret.uType) {
       case STRRET_CSTR :
@@ -665,10 +656,6 @@
 	break;
     }
 
-    BOOL doCoUninit;
-    if (!CoInit(doCoUninit)) {
-        return 0;
-    }
     if (IS_NT) {
 	IShellLinkW* psl;
 	hres = ::CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER, IID_IShellLinkW, (LPVOID *)&psl);
@@ -710,9 +697,6 @@
 	    psl->Release();
         }
     }
-    if (doCoUninit) {
-        ::CoUninitialize();
-    }
 
     if (SUCCEEDED(hres)) {
 	return (jlong)pidl;
@@ -759,7 +743,7 @@
 /*
  * Class:     sun_awt_shell_Win32ShellFolder2
  * Method:    getDisplayNameOf
- * Signature: (JJ)Ljava/lang/String;
+ * Signature: (JJI)Ljava/lang/String;
  */
 JNIEXPORT jstring JNICALL Java_sun_awt_shell_Win32ShellFolder2_getDisplayNameOf
     (JNIEnv* env, jclass cls, jlong parentIShellFolder, jlong relativePIDL, jint attrs)
@@ -851,10 +835,6 @@
     }
 
     INT index = -1;
-    BOOL doCoUninit;
-    if (!CoInit(doCoUninit)) {
-        return (jint)index;
-    }
 
     HRESULT hres;
     // http://msdn.microsoft.com/library/en-us/shellcc/platform/Shell/programmersguide/shell_int/shell_int_programming/std_ifaces.asp
@@ -862,9 +842,6 @@
 	hres = pIShellIcon->GetIconOf(pidl, GIL_FORSHELL, &index);
     }
 
-    if (doCoUninit) {
-        ::CoUninitialize();
-    }
     return (jint)index;
 }
 
@@ -884,10 +861,6 @@
     }
 
     HICON hIcon = NULL;
-    BOOL doCoUninit;
-    if (!CoInit(doCoUninit)) {
-        return (jlong)hIcon;
-    }
 
     HRESULT hres;
     if (IS_NT) {
@@ -937,9 +910,6 @@
 	    pIcon->Release();
         }
     }
-    if (doCoUninit) {
-        ::CoUninitialize();
-    }
     return (jlong)hIcon;
 }
 
@@ -1040,9 +1010,6 @@
 
     libShell32 = LoadLibrary(TEXT("shell32.dll"));
     if (libShell32 != NULL) {
-        long osVersion = GetVersion();
-        BOOL isVista = (!(osVersion & 0x80000000) && (LOBYTE(LOWORD(osVersion)) >= 6));
-
         hBitmap = (HBITMAP)LoadImage(libShell32, 
                     isVista ? TEXT("IDB_TB_SH_DEF_16") : MAKEINTRESOURCE(216),
                     IMAGE_BITMAP, 0, 0, LR_CREATEDIBSECTION);
@@ -1138,45 +1105,6 @@
 }
 
 
-// Helper functions for workaround COM initialization:
-
-static HRESULT GetDetailsOfFolder(
-        IShellFolder2 *folder,
-        LPCITEMIDLIST pidl,
-        UINT column,
-        SHELLDETAILS *psd)
-{
-    HRESULT hr = folder->GetDetailsOf(pidl, column, psd);
-    if (IS_WINVISTA && FAILED (hr)) {
-        BOOL doCoUninit;
-        if (CoInit(doCoUninit)) {
-            hr = folder->GetDetailsOf(pidl, column, psd);
-            if (doCoUninit) {
-                ::CoUninitialize();
-            }
-        }
-    }
-    return hr;
-}
-
-static HRESULT GetDetailsOf(
-        IShellDetails *details,
-        LPCITEMIDLIST pidl,
-        UINT column,
-        SHELLDETAILS *psd)
-{
-    HRESULT hr = details->GetDetailsOf(pidl, column, psd);
-    if (IS_WINVISTA && FAILED (hr)) {
-        BOOL doCoUninit;
-        if (CoInit(doCoUninit)) {
-            hr = details->GetDetailsOf(pidl, column, psd);
-            if (doCoUninit) {
-                ::CoUninitialize();
-            }
-        }
-    }
-    return hr;
-}
 
 /*
  * Helper function for creating Java column info object
@@ -1230,7 +1158,7 @@
         int colNum = -1;
         hr = S_OK;
         do{
-            hr = GetDetailsOfFolder(pIShellFolder2, NULL, ++colNum, &sd);
+            hr = pIShellFolder2->GetDetailsOf(NULL, ++colNum, &sd);
         } while (SUCCEEDED (hr));
 
         jobjectArray columns =
@@ -1245,7 +1173,7 @@
         colNum = 0;
         hr = S_OK;
         while (SUCCEEDED (hr)) {
-            hr = GetDetailsOfFolder(pIShellFolder2, NULL, colNum, &sd);
+            hr = pIShellFolder2->GetDetailsOf(NULL, colNum, &sd);
 
             if (SUCCEEDED (hr)) {
                 hr = pIShellFolder2->GetDefaultColumnState(colNum, &csFlags);
@@ -1275,7 +1203,7 @@
         int colNum = -1;
         hr = S_OK;
         do{
-            hr = GetDetailsOf(pIShellDetails, NULL, ++colNum, &sd);
+            hr = pIShellDetails->GetDetailsOf(NULL, ++colNum, &sd);
         } while (SUCCEEDED (hr));
 
         jobjectArray columns =
@@ -1289,7 +1217,7 @@
         colNum = 0;
         hr = S_OK;
         while (SUCCEEDED (hr)) {
-            hr = GetDetailsOf(pIShellDetails, NULL, colNum, &sd);
+            hr = pIShellDetails->GetDetailsOf(NULL, colNum, &sd);
             if (SUCCEEDED (hr)) {
                 jobject column = CreateColumnInfo(env,
                                     &columnClass, &columnConstructor,
@@ -1331,7 +1259,7 @@
     if(SUCCEEDED (hr)) {
         // The folder exposes IShellFolder2 interface
         IShellFolder2 *pIShellFolder2 = (IShellFolder2*) pIUnknown;
-        hr = GetDetailsOfFolder(pIShellFolder2, pidl, (UINT)columnIdx, &sd);
+        hr = pIShellFolder2->GetDetailsOf(pidl, (UINT)columnIdx, &sd);
         pIShellFolder2->Release();
         if (SUCCEEDED (hr)) {
             STRRET strRet = sd.str;
@@ -1343,7 +1271,7 @@
     if(SUCCEEDED (hr)) {
         // The folder exposes IShellDetails interface
         IShellDetails *pIShellDetails = (IShellDetails*) pIUnknown;
-        hr = GetDetailsOf(pIShellDetails, pidl, (UINT)columnIdx, &sd);
+        hr = pIShellDetails->GetDetailsOf(pidl, (UINT)columnIdx, &sd);
         pIShellDetails->Release();
         if (SUCCEEDED (hr)) {
             STRRET strRet = sd.str;
--- a/src/windows/native/sun/windows/awt_Window.cpp	Fri Jan 30 16:19:11 2009 -0800
+++ b/src/windows/native/sun/windows/awt_Window.cpp	Fri Jan 30 16:23:12 2009 -0800
@@ -125,6 +125,11 @@
 jclass AwtWindow::wwindowPeerCls;
 jmethodID AwtWindow::getActiveWindowsMID;
 
+jfieldID AwtWindow::sysXID;
+jfieldID AwtWindow::sysYID;
+jfieldID AwtWindow::sysWID;
+jfieldID AwtWindow::sysHID;
+
 int AwtWindow::ms_instanceCounter = 0;
 HHOOK AwtWindow::ms_hCBTFilter;
 AwtWindow * AwtWindow::m_grabbedWindow = NULL;
@@ -1053,6 +1058,8 @@
 
     (env)->SetIntField(target, AwtComponent::xID, rect.left);
     (env)->SetIntField(target, AwtComponent::yID, rect.top);
+    (env)->SetIntField(peer, AwtWindow::sysXID, rect.left);
+    (env)->SetIntField(peer, AwtWindow::sysYID, rect.top);
     SendComponentEvent(java_awt_event_ComponentEvent_COMPONENT_MOVED);
 
     env->DeleteLocalRef(target);
@@ -1116,6 +1123,11 @@
 
     (env)->SetIntField(target, AwtComponent::widthID, newWidth);
     (env)->SetIntField(target, AwtComponent::heightID, newHeight);
+
+    jobject peer = GetPeer(env);
+    (env)->SetIntField(peer, AwtWindow::sysWID, newWidth);
+    (env)->SetIntField(peer, AwtWindow::sysHID, newHeight);
+
     if (!AwtWindow::IsResizing()) {
         WindowResized();
     }
@@ -1754,17 +1766,22 @@
             // Fix for 4459064 : do not enforce thresholds for embedded frames
             if (!p->IsEmbeddedFrame()) 
             {
+                jobject peer = p->GetPeer(env);
                 int minWidth = ::GetSystemMetrics(SM_CXMIN);
                 int minHeight = ::GetSystemMetrics(SM_CYMIN);
                 if (w < minWidth)
                 {
                     env->SetIntField(target, AwtComponent::widthID,
                         w = minWidth);
+                    env->SetIntField(peer, AwtWindow::sysWID,
+                        w);
                 }
                 if (h < minHeight)
                 {
                     env->SetIntField(target, AwtComponent::heightID,
                         h = minHeight);
+                    env->SetIntField(peer, AwtWindow::sysHID,
+                        h);
                 }
             }
             env->DeleteLocalRef(target);
@@ -2143,6 +2160,11 @@
 {
     TRY;
 
+    AwtWindow::sysXID = env->GetFieldID(cls, "sysX", "I");
+    AwtWindow::sysYID = env->GetFieldID(cls, "sysY", "I");
+    AwtWindow::sysWID = env->GetFieldID(cls, "sysW", "I");
+    AwtWindow::sysHID = env->GetFieldID(cls, "sysH", "I");
+
     AwtWindow::wwindowPeerCls = cls;
     AwtWindow::getActiveWindowsMID =
         env->GetStaticMethodID(cls, "getActiveWindowHandles", "()[J");
--- a/src/windows/native/sun/windows/awt_Window.h	Fri Jan 30 16:19:11 2009 -0800
+++ b/src/windows/native/sun/windows/awt_Window.h	Fri Jan 30 16:23:12 2009 -0800
@@ -63,6 +63,12 @@
     /* long[] getActiveWindowHandles() method in WWindowPeer */
     static jmethodID getActiveWindowsMID;
 
+    // The coordinates at the peer.
+    static jfieldID sysXID;
+    static jfieldID sysYID;
+    static jfieldID sysWID;
+    static jfieldID sysHID;
+
     AwtWindow();
     virtual ~AwtWindow();
 
--- a/test/java/awt/Mixing/setComponentZOrder.java	Fri Jan 30 16:19:11 2009 -0800
+++ b/test/java/awt/Mixing/setComponentZOrder.java	Fri Jan 30 16:23:12 2009 -0800
@@ -21,7 +21,7 @@
  * have any questions.
  */
 
-/*
+/* 
   @test
   @bug 6589530
   @summary Mixing code should correctly handle insertion of components with setComponentZOrder.
@@ -45,11 +45,11 @@
     //*** test-writer defined static variables go here ***
 
 
-    private static void init()
+    private static void init() 
     {
         //*** Create instructions for the user here ***
-
-        String[] instructions =
+      
+        String[] instructions = 
         {
             "This is an AUTOMATIC test, simply wait until it is done.",
             "The result (passed or failed) will be shown in the",
@@ -75,7 +75,7 @@
 
     /*****************************************************
      * Standard Test Machinery Section
-     * DO NOT modify anything in this section -- it's a
+     * DO NOT modify anything in this section -- it's a 
      * standard chunk of code which has all of the
      * synchronisation necessary for the test harness.
      * By keeping it the same in all tests, it is easier
@@ -116,13 +116,13 @@
 
         //Test involves other threads, so sleep and wait for them to
         // called pass() or fail()
-        try
+        try 
         {
             Thread.sleep( sleepTime );
             //Timed out, so fail the test
             throw new RuntimeException( "Timed out after " + sleepTime/1000 + " seconds" );
-        }
-        catch (InterruptedException e)
+        } 
+        catch (InterruptedException e) 
         {
             //The test harness may have interrupted the test.  If so, rethrow the exception
             // so that the harness gets it and deals with it.
@@ -136,14 +136,14 @@
                 throw new RuntimeException( failureMessage );
             }
         }
-
+      
     }//main
 
     public static synchronized void setTimeoutTo( int seconds )
     {
         sleepTime = seconds * 1000;
     }
-
+   
     public static synchronized void pass()
     {
         Sysout.println( "The test passed." );
@@ -195,22 +195,22 @@
 
 //*********** End Standard Test Machinery Section **********
 
-
+ 
 //************ Begin classes defined for the test ****************
 
-// if want to make listeners, here is the recommended place for them, then instantiate
+// if want to make listeners, here is the recommended place for them, then instantiate 
 //  them in init()
 
 /* Example of a class which may be written as part of a test
-class NewClass implements anInterface
+class NewClass implements anInterface 
  {
    static int newVar = 0;
-
-   public void eventDispatched(AWTEvent e)
+   
+   public void eventDispatched(AWTEvent e) 
     {
       //Counting events to see if we get enough
       eventCount++;
-
+      
       if( eventCount == 20 )
        {
          //got enough events, so pass
@@ -223,7 +223,7 @@
 
          setComponentZOrder.fail();
        }
-
+      
     }// eventDispatched()
 
  }// NewClass class
@@ -232,14 +232,14 @@
 
 
 //************** End classes defined for the test *******************
-
+  
 
 
 
 /****************************************************
  Standard Test Machinery
- DO NOT modify anything below -- it's a standard
-  chunk of code whose purpose is to make user
+ DO NOT modify anything below -- it's a standard 
+  chunk of code whose purpose is to make user 
   interaction uniform, and thereby make it simpler
   to read and understand someone else's test.
  ****************************************************/
@@ -252,12 +252,12 @@
   WithInstructions method.  Put one line of instructions per array entry.
  To display a message for the tester to see, simply call Sysout.println
   with the string to be displayed.
- This mimics System.out.println but works within the test harness as well
+ This mimics System.out.println but works within the test harness as well 
   as standalone.
  */
 
-class Sysout
-{
+class Sysout 
+{ 
     private static TestDialog dialog;
 
     public static void createDialogWithInstructions( String[] instructions )
@@ -267,7 +267,7 @@
         dialog.setVisible(true);
         println( "Any messages for the tester will display here." );
     }
-
+   
     public static void createDialog( )
     {
         dialog = new TestDialog( new Frame(), "Instructions" );
@@ -276,8 +276,8 @@
         dialog.setVisible(true);
         println( "Any messages for the tester will display here." );
     }
-
-
+   
+      
     public static void printInstructions( String[] instructions )
     {
         dialog.printInstructions( instructions );
@@ -306,20 +306,20 @@
     TextArea instructionsText;
     TextArea messageText;
     int maxStringLength = 80;
-
+   
     //DO NOT call this directly, go through Sysout
-    public TestDialog( Frame frame, String name )
+    public TestDialog( Frame frame, String name ) 
     {
         super( frame, name );
         int scrollBoth = TextArea.SCROLLBARS_BOTH;
         instructionsText = new TextArea( "", 15, maxStringLength, scrollBoth );
         add( "North", instructionsText );
-
+      
         messageText = new TextArea( "", 5, maxStringLength, scrollBoth );
         add("Center", messageText);
-
+      
         pack();
-
+      
         setVisible(true);
     }// TestDialog()
 
@@ -333,7 +333,7 @@
 
         String printStr, remainingStr;
         for( int i=0; i < instructions.length; i++ )
-        {
+        { 
             //chop up each into pieces maxSringLength long
             remainingStr = instructions[ i ];
             while( remainingStr.length() > 0 )
@@ -344,25 +344,25 @@
                     //Try to chop on a word boundary
                     int posOfSpace = remainingStr.
                         lastIndexOf( ' ', maxStringLength - 1 );
-
+               
                     if( posOfSpace <= 0 ) posOfSpace = maxStringLength - 1;
-
+               
                     printStr = remainingStr.substring( 0, posOfSpace + 1 );
                     remainingStr = remainingStr.substring( posOfSpace + 1 );
                 }
                 //else just print
-                else
-                {
+                else 
+                { 
                     printStr = remainingStr;
                     remainingStr = "";
                 }
-
+            
                 instructionsText.append( printStr + "\n" );
-
+            
             }// while
-
+         
         }// for
-
+      
     }//printInstructions()
 
     //DO NOT call this directly, go through Sysout
@@ -370,6 +370,8 @@
     {
         messageText.append( messageIn + "\n" );
         System.out.println(messageIn);
-    }
+    }  
+   
+}// TestDialog  class    
+  
 
-}// TestDialog  class