Merge
authorlana
Mon, 21 Jun 2010 22:08:10 -0700
changeset 5816 1708ca89fc34
parent 5770 b8ab8c6db9a6 (diff)
parent 5815 8c68030e27b1 (current diff)
child 5817 0011b9666943
Merge
--- a/.hgtags	Mon Jun 21 15:02:47 2010 -0700
+++ b/.hgtags	Mon Jun 21 22:08:10 2010 -0700
@@ -71,3 +71,4 @@
 8bb281f0f91582104d65d032be22522bfd2d8110 jdk7-b94
 654298d26561b76dfe3cfcffbbd7078080837300 jdk7-b95
 d260f892491e040ae385a8e6df59557a7d721abf jdk7-b96
+7e406ebed9a5968b584f3c3e6b60893b5d6d9741 jdk7-b97
--- a/.hgtags-top-repo	Mon Jun 21 15:02:47 2010 -0700
+++ b/.hgtags-top-repo	Mon Jun 21 22:08:10 2010 -0700
@@ -71,3 +71,4 @@
 d7f35c61afa092b6357c2c4bce3f298f16620f71 jdk7-b94
 fd3663286e77b9f13c39eee124db2beb079b3ca6 jdk7-b95
 cf71cb5151166f35433afebaf67dbf34a704a170 jdk7-b96
+5e197c942c6ebd8b92f324a31049c5f1d26d40ef jdk7-b97
--- a/README-builds.html	Mon Jun 21 15:02:47 2010 -0700
+++ b/README-builds.html	Mon Jun 21 22:08:10 2010 -0700
@@ -65,8 +65,9 @@
                             <li><a href="#cacerts">Certificate Authority File (cacert)</a> </li>
                             <li><a href="#compilers">Compilers</a> 
                                 <ul>
-                                    <li><a href="#msvc">Microsoft Visual Studio</a> </li>
-                                    <li><a href="#mssdk">Microsoft Platform SDK</a> </li>
+                                    <li><a href="#msvc32">Microsoft Visual Studio Professional/Express for 32 bit</a> </li>
+                                    <li><a href="#msvc64">Microsoft Visual Studio Professional for 64 bit</a> </li>
+                                    <li><a href="#mssdk64">Microsoft Windows SDK for 64 bit</a> </li>
                                     <li><a href="#gcc">Linux gcc/binutils</a> </li>
                                     <li><a href="#studio">Sun Studio</a> </li>
                                 </ul>
@@ -789,11 +790,11 @@
                 </li>
                 <li>
                     Install the
-                    <a href="#msvc">Microsoft Visual Studio Compilers</a>).
+                    <a href="#msvc32">Microsoft Visual Studio Compilers</a>).
                 </li>
                 <li>
                     Setup all environment variables for compilers 
-                    (see <a href="#msvc">compilers</a>).
+                    (see <a href="#msvc32">compilers</a>).
                 </li>
                 <li>
                     Install 
@@ -958,7 +959,7 @@
                     are also an option, although these compilers have not
                     been extensively used yet.
                 </blockquote>
-                <strong><a name="msvc">Windows i586: Microsoft Visual Studio Compilers</a></strong>
+                <strong><a name="msvc32">Windows i586: Microsoft Visual Studio 2010 Compilers</a></strong>
                 <blockquote>
 <p>
 <b>BEGIN WARNING</b>: At this time (Spring/Summer 2010) JDK 7 is starting a transition to
@@ -971,14 +972,13 @@
 We do not guarantee that VS2008 will work, although there is sufficient
 makefile support to make at least basic JDK builds plausible.
 Visual Studio 2010 Express compilers are now able to build all the
-open source repositories, but this is 32 bit only, since
-we have not yet seen the 7.1 Windows SDK with the 64 bit
-compilers. <b>END WARNING.</b>
+open source repositories, but this is 32 bit only. To build 64 bit
+Windows binaries use the the 7.1 Windows SDK.<b>END WARNING.</b>
 <p>
                     The 32-bit OpenJDK Windows build
                     requires 
                     Microsoft Visual Studio C++ 2010 (VS2010) Professional
-                    Edition compiler. 
+                    Edition or Express compiler.
                     The compiler and other tools are expected to reside
                     in the location defined by the variable 
                     <tt>VS100COMNTOOLS</tt> which
@@ -1001,14 +1001,33 @@
                     The path <tt>/usr/bin</tt> must be after the path to the
                     Visual Studio product.
                 </blockquote>
-                <strong><a name="mssdk">Windows x64: Microsoft Visual Studio Compilers</a></strong>
+                <strong><a name="msvc64">Windows x64: Microsoft Visual Studio 2010 Professional Compiler</a></strong>
                 <blockquote>
-                    On <b>X64</b>, the set up is much the same in VS2010
+                    For <b>X64</b>, builds, when using the VS2010 Professional
+                    compiler, the 64 bit build set up is much the same as 32 bit
                     except that you run <tt>amd64\VCVARS64.BAT</tt>
                     to set the compiler environment variables.
-                    Previously 64 builds had used the 64 bit compiler in
-                    an unbundled Windows SDK but this is no longer necessary.
+                    Previously 64 bit builds had used the 64 bit compiler in
+                    an unbundled Windows SDK but this is no longer necessary if
+                    you have VS2010 Professional.
                 </blockquote>
+                <strong><a name="mssdk64">Windows x64: Microsoft Windows 7.1 SDK 64 bit compilers.</a></strong>
+                   For a free alternative for 64 bit builds, use the 7.1 SDK.
+                   Microsoft say that to set up your paths for this run
+<pre>
+    c:\Program Files\Microsoft SDKs\Windows\v7.1\bin\setenv.cmd /x64.
+</pre>
+                   What was tested is just directly setting up LIB, INCLUDE,
+                   PATH and based on the installation directories using the
+                   DOS short name appropriate for the system, (you will
+                   need to set them for yours, not just blindly copy this) eg :
+<pre>
+    set VSINSTALLDIR=c:\PROGRA~2\MICROS~1.0
+    set WindowsSdkDir=c:\PROGRA~1\MICROS~1\Windows\v7.1
+    set PATH=%VSINSTALLDIR%\vc\bin\amd64;%VSINSTALLDIR%\Common7\IDE;%WindowsSdkDir%\bin;%PATH%
+    set INCLUDE=%VSINSTALLDIR%\vc\include;%WindowsSdkDir%\include
+    set LIB=%VSINSTALLDIR%\vc\lib\amd64;%WindowsSdkDir%\lib\x64
+</pre>
             </blockquote>
             <!-- ------------------------------------------------------ --> 
             <h4><a name="zip">Zip and Unzip</a></h4>
--- a/corba/.hgtags	Mon Jun 21 15:02:47 2010 -0700
+++ b/corba/.hgtags	Mon Jun 21 22:08:10 2010 -0700
@@ -71,3 +71,4 @@
 533c11186b44e3a02d6c5fe69a73260505fcfe5e jdk7-b94
 06dbf406818c789bb586c1de4c002024cd26ecd2 jdk7-b95
 edc2a2659c77dabc55cb55bb617bad89e3a05bb3 jdk7-b96
+4ec9d59374caa1e5d72fa802291b4d66955a4936 jdk7-b97
--- a/hotspot/.hgtags	Mon Jun 21 15:02:47 2010 -0700
+++ b/hotspot/.hgtags	Mon Jun 21 22:08:10 2010 -0700
@@ -100,3 +100,4 @@
 91d861ba858daca645993a1ab6ba2fa06a8f4a5b jdk7-b95
 573e8ea5fd68e8e51eb6308d283ac3b3889d15e0 jdk7-b96
 573e8ea5fd68e8e51eb6308d283ac3b3889d15e0 hs19-b02
+5f42499e57adc16380780f40541e1a66cd601891 jdk7-b97
--- a/hotspot/make/windows/makefiles/defs.make	Mon Jun 21 15:02:47 2010 -0700
+++ b/hotspot/make/windows/makefiles/defs.make	Mon Jun 21 22:08:10 2010 -0700
@@ -69,8 +69,20 @@
   MAKE_ARGS += Platform_arch_model=x86_64
 endif
 
+ifneq ($(shell $(ECHO) $(PROCESSOR_IDENTIFIER) | $(GREP) EM64T),)
+  ARCH_DATA_MODEL=64
+  PLATFORM=windows-amd64
+  VM_PLATFORM=windows_amd64
+  HS_ARCH=x86
+  MAKE_ARGS += LP64=1
+  MAKE_ARGS += ARCH=x86
+  MAKE_ARGS += BUILDARCH=amd64
+  MAKE_ARGS += Platform_arch=x86
+  MAKE_ARGS += Platform_arch_model=x86_64
+endif
+
 # NB later OS versions than 2003 may report "Intel64"
-ifneq ($(shell $(ECHO) $(PROCESSOR_IDENTIFIER) | $(GREP) "EM64T\|Intel64"),)
+ifneq ($(shell $(ECHO) $(PROCESSOR_IDENTIFIER) | $(GREP) Intel64),)
   ARCH_DATA_MODEL=64
   PLATFORM=windows-amd64
   VM_PLATFORM=windows_amd64
--- a/jaxp/.hgtags	Mon Jun 21 15:02:47 2010 -0700
+++ b/jaxp/.hgtags	Mon Jun 21 22:08:10 2010 -0700
@@ -71,3 +71,4 @@
 2de307cd3b4e71127e75dff70809c1b1fbc1a494 jdk7-b94
 07050840f98cda357aa6a8d416fdccbd03038d35 jdk7-b95
 9510ed0e1c7ab46a8b6659234e1dc7786407a72b jdk7-b96
+ca01ec32561fee1855630b68a2fcd0042257a8ef jdk7-b97
--- a/jaxws/.hgtags	Mon Jun 21 15:02:47 2010 -0700
+++ b/jaxws/.hgtags	Mon Jun 21 22:08:10 2010 -0700
@@ -71,3 +71,4 @@
 8515e093efd14ac054e941ef743f76561a393a70 jdk7-b94
 ee06cfb113d554b5c8a9a53383bae2b168533829 jdk7-b95
 208fd4451232f7a522ddb20334c598656844ccb7 jdk7-b96
+dac23846092ad4956ed41b5278f8686476ae46ef jdk7-b97
--- a/jdk/.hgtags	Mon Jun 21 15:02:47 2010 -0700
+++ b/jdk/.hgtags	Mon Jun 21 22:08:10 2010 -0700
@@ -72,3 +72,4 @@
 db951e984ccf50756160fee3078c791300b0917e jdk7-b95
 51b9e5dbc2da0631414484b934ac3fb62e48a2c6 jdk7-b96
 b1903d7528d33b521df42bc9291bdcdd2f444a29 jdk7-b97
+82593186fa54ab12f17af31f86a7bf364efaf4df jdk7-b98
--- a/jdk/make/common/shared/Defs-windows.gmk	Mon Jun 21 15:02:47 2010 -0700
+++ b/jdk/make/common/shared/Defs-windows.gmk	Mon Jun 21 22:08:10 2010 -0700
@@ -331,23 +331,50 @@
   endif
 endif
 
-# Compilers for 64bit may be from SDK. For VS 2010 we use those.
-# The Express compilers don't contain 64 bit compilers, so in
-# that case, you additionally need the SDK. At this time,
-# there's no 64 bit SDK available that has VS 2010.
-# Presumably SDK v7.1 will provide that and we may want to update
-# the logic here to work with that.
-# However official builds will use the Professional version.
+# Compilers for 64bit may be from the free SDK, or Visual Studio Professional
+# The free Express compilers don't contain 64 bit compilers, which is why
+# you instead need the SDK.
+# So for VS2010 based builds, either VS2010 Pro with the 7.0a SDK, or
+# the Windows 7.1 standalone SDK with compilers may be used.
+# Release enginering will use VS2010 Pro, so the frequency of testing of
+# SDK based builds will depend entirely on individual usage.
 ifeq ($(ARCH_DATA_MODEL), 64)
   ifdef VS100COMNTOOLS  # /Common7/Tools directory, use ../../Vc
+    # VS2010 default location is used when building 64 bit using the 7.1 SDK
+    # This is safe to hardwire as the SDK installer won't let you change it
+    # and the VS2010 variable is only used if the compilers are from the SDK
+    xVS2010 :="$(_program_files32)/Microsoft Visual Studio 10.0/"
+    VS2010 :=$(call FullPath,$(xVS2010))
     xVS100COMNTOOLS :="$(subst \,/,$(VS100COMNTOOLS))"
     _vs100tools     :=$(call FullPath,$(xVS100COMNTOOLS))
   endif
   ifneq ($(_vs100tools),)
     _compiler_bin :=$(_vs100tools)/../../Vc/bin/amd64
-    _redist_sdk   :=$(_vs100tools)/../../Vc/redist/x64/Microsoft.VC100.CRT
-    xMSSDK70      :="$(_program_files32)/Microsoft SDKs/Windows/v7.0a/"
-    MSSDK70       :=$(call FullPath,$(xMSSDK70))
+    x_redist_sdk   :=$(_vs100tools)/../../Vc/redist/x64/Microsoft.VC100.CRT
+    _redist_sdk    :=$(call FullPath,$(x_redist_sdk))
+    # The SDK doesn't have the redist directory, but the DLL is installed
+    # into the windows directory.
+    ifeq ($(_redist_sdk),)
+      _redist_sdk   :=c:/windows/system32
+    endif
+    # Not currently using MSSDK7n, but maybe we can make use of it for
+    # doing default location lookup to find some SDK tools that presently
+    # require the developer to explicitly set the path.
+    # The 7.0a path is from VS2010 Pro, the 7.1 path is the standalone SDK.
+    # Either will work for us.
+    # If a developer chooses to install the standalone SDK in some other
+    # location, then this will fail to find it, which won't matter so long as
+    # we aren't using this variable. If we do they'd still need to set the
+    # ALT_MSDEVTOOLS_PATH as now.
+    # %WindowsSdkDir% could be referenced instead but the SDK installer
+    # doesn't set it and in the case of the VS2010 compilers,
+    # you can't change this location in the installer anyway.
+    xMSSDK7n      :="$(_program_files32)/Microsoft SDKs/Windows/v7.0a/"
+    MSSDK7n       :=$(call FullPath,$(xMSSDK7n))
+    ifeq ($(MSSDK7n),)
+      xMSSDK7n      :="$(_program_files32)/Microsoft SDKs/Windows/v7.1/"
+      MSSDK7n       :=$(call FullPath,$(xMSSDK7n))
+    endif
   else
     xVS2008 :="$(_program_files32)/Microsoft Visual Studio 9.0/"
     VS2008 :=$(call FullPath,$(xVS2008))
@@ -355,7 +382,7 @@
       _compiler_bin :=$(VS2008)/VC/Bin/$(ARCH)
       xMSSDK61      :="$(_program_files)/Microsoft SDKs/Windows/v6.1/"
       MSSDK61       :=$(call FullPath,$(xMSSDK61))
-      _redist_sdk   :=$(VS2008)/VC/redist/x86/Microsoft.VC90.CRT
+      _redist_sdk   :=$(VS2008)/VC/redist/x64/Microsoft.VC90.CRT
     else
       ifneq ($(_ms_sdk),)
         ifeq ($(ARCH), ia64)
--- a/jdk/make/sun/pisces/Makefile	Mon Jun 21 15:02:47 2010 -0700
+++ b/jdk/make/sun/pisces/Makefile	Mon Jun 21 22:08:10 2010 -0700
@@ -52,5 +52,11 @@
 
 copy-files: $(FILES_copy)
 
-$(SERVICEDIR)/%: $(SHARE_SRC)/classes/sun/java2d/pisces/META-INF/services/%
+ifneq ($(PLATFORM), windows)
+ SERVICE_SRC = $(PLATFORM_SRC)
+else
+ SERVICE_SRC = $(SHARE_SRC)
+endif
+
+$(SERVICEDIR)/%: $(SERVICE_SRC)/classes/sun/java2d/pisces/META-INF/services/%
 	$(install-file)
--- a/jdk/make/tools/freetypecheck/freetypecheck.c	Mon Jun 21 15:02:47 2010 -0700
+++ b/jdk/make/tools/freetypecheck/freetypecheck.c	Mon Jun 21 22:08:10 2010 -0700
@@ -33,7 +33,7 @@
 #include FT_FREETYPE_H
 
 #ifdef _MSC_VER
-#if _MSC_VER > 1400
+#if _MSC_VER > 1400 && _MSC_VER < 1600
 
 /*
  * When building for Microsoft Windows, your program has a dependency
@@ -68,7 +68,7 @@
         "publicKeyToken='" _VC_ASSEMBLY_PUBLICKEYTOKEN "'\"")
 
 #endif  /* _M_AMD64 */
-#endif  /* _MSC_VER > 1400 */
+#endif  /* _MSC_VER > 1400 && _MSC_VER < 1600 */
 #endif  /* _MSC_VER */
 
 #define QUOTEMACRO(x) QUOTEME(x)
--- a/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsComboBoxUI.java	Mon Jun 21 15:02:47 2010 -0700
+++ b/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsComboBoxUI.java	Mon Jun 21 22:08:10 2010 -0700
@@ -424,7 +424,7 @@
             State rv;
             rv = super.getState();
             if (rv != State.DISABLED
-                && ! comboBox.isEditable()
+                && comboBox != null && ! comboBox.isEditable()
                 && XPStyle.getXP().isSkinDefined(comboBox,
                                                  Part.CP_DROPDOWNBUTTONRIGHT)) {
                 /*
--- a/jdk/src/share/classes/javax/swing/BorderFactory.java	Mon Jun 21 15:02:47 2010 -0700
+++ b/jdk/src/share/classes/javax/swing/BorderFactory.java	Mon Jun 21 22:08:10 2010 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,6 @@
 
 import java.awt.Color;
 import java.awt.Font;
-import javax.swing.JComponent;
 import javax.swing.border.*;
 
 /**
@@ -74,10 +73,20 @@
         return new LineBorder(color, thickness);
     }
 
-//    public static Border createLineBorder(Color color, int thickness,
-//                                      boolean drawRounded)  {
-//        return new JLineBorder(color, thickness, drawRounded);
-//    }
+    /**
+     * Creates a line border with the specified color, thickness, and corner shape.
+     *
+     * @param color      the color of the border
+     * @param thickness  the thickness of the border
+     * @param rounded    whether or not border corners should be round
+     * @return the {@code Border} object
+     *
+     * @see LineBorder#LineBorder(Color, int, boolean)
+     * @since 1.7
+     */
+    public static Border createLineBorder(Color color, int thickness, boolean rounded) {
+        return new LineBorder(color, thickness, rounded);
+    }
 
 //// BevelBorder /////////////////////////////////////////////////////////////
 ///////////////////////////////////////////////////////////////////////////////
@@ -180,7 +189,115 @@
         }
         return null;
     }
+
+//// SoftBevelBorder ///////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+    private static Border sharedSoftRaisedBevel;
+    private static Border sharedSoftLoweredBevel;
+
+    /**
+     * Creates a beveled border with a raised edge and softened corners,
+     * using brighter shades of the component's current background color
+     * for highlighting, and darker shading for shadows.
+     * In a raised border, highlights are on top and shadows are underneath.
+     *
+     * @return the {@code Border} object
+     *
+     * @since 1.7
+     */
+    public static Border createRaisedSoftBevelBorder() {
+        if (sharedSoftRaisedBevel == null) {
+            sharedSoftRaisedBevel = new SoftBevelBorder(BevelBorder.RAISED);
+        }
+        return sharedSoftRaisedBevel;
+    }
+
+    /**
+     * Creates a beveled border with a lowered edge and softened corners,
+     * using brighter shades of the component's current background color
+     * for highlighting, and darker shading for shadows.
+     * In a lowered border, shadows are on top and highlights are underneath.
+     *
+     * @return the {@code Border} object
+     *
+     * @since 1.7
+     */
+    public static Border createLoweredSoftBevelBorder() {
+        if (sharedSoftLoweredBevel == null) {
+            sharedSoftLoweredBevel = new SoftBevelBorder(BevelBorder.LOWERED);
+        }
+        return sharedSoftLoweredBevel;
+    }
+
+    /**
+     * Creates a beveled border of the specified type with softened corners,
+     * using brighter shades of the component's current background color
+     * for highlighting, and darker shading for shadows.
+     * The type is either {@link BevelBorder#RAISED} or {@link BevelBorder#LOWERED}.
+     *
+     * @param type  a type of a bevel
+     * @return the {@code Border} object or {@code null}
+     *         if the specified type is not valid
+     *
+     * @see BevelBorder#BevelBorder(int)
+     * @since 1.7
+     */
+    public static Border createSoftBevelBorder(int type) {
+        if (type == BevelBorder.RAISED) {
+            return createRaisedSoftBevelBorder();
+        }
+        if (type == BevelBorder.LOWERED) {
+            return createLoweredSoftBevelBorder();
+        }
+        return null;
+    }
+
+    /**
+     * Creates a beveled border of the specified type with softened corners,
+     * using the specified highlighting and shadowing.
+     * The type is either {@link BevelBorder#RAISED} or {@link BevelBorder#LOWERED}.
+     * The outer edge of the highlight area uses
+     * a brighter shade of the {@code highlight} color.
+     * The inner edge of the shadow area uses
+     * a brighter shade of the {@code shadow} color.
+     *
+     * @param type       a type of a bevel
+     * @param highlight  a basic color of the highlight area
+     * @param shadow     a basic color of the shadow area
+     * @return the {@code Border} object
+     *
+     * @see BevelBorder#BevelBorder(int, Color, Color)
+     * @since 1.7
+     */
+    public static Border createSoftBevelBorder(int type, Color highlight, Color shadow) {
+        return new BevelBorder(type, highlight, shadow);
+    }
+
+    /**
+     * Creates a beveled border of the specified type with softened corners,
+     * using the specified colors for the inner and outer edges
+     * of the highlight and the shadow areas.
+     * The type is either {@link BevelBorder#RAISED} or {@link BevelBorder#LOWERED}.
+     * Note: The shadow inner and outer colors are switched
+     * for a lowered bevel border.
+     *
+     * @param type            a type of a bevel
+     * @param highlightOuter  a color of the outer edge of the highlight area
+     * @param highlightInner  a color of the inner edge of the highlight area
+     * @param shadowOuter     a color of the outer edge of the shadow area
+     * @param shadowInner     a color of the inner edge of the shadow area
+     * @return the {@code Border} object
+     *
+     * @see BevelBorder#BevelBorder(int, Color, Color, Color, Color)
+     * @since 1.7
+     */
+    public static Border createSoftBevelBorder(int type, Color highlightOuter, Color highlightInner, Color shadowOuter, Color shadowInner) {
+        return new BevelBorder(type, highlightOuter, highlightInner, shadowOuter, shadowInner);
+    }
+
 //// EtchedBorder ///////////////////////////////////////////////////////////
+
     static final Border sharedEtchedBorder = new EtchedBorder();
     private static Border sharedRaisedEtchedBorder;
 
--- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthParser.java	Mon Jun 21 15:02:47 2010 -0700
+++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthParser.java	Mon Jun 21 22:08:10 2010 -0700
@@ -658,8 +658,7 @@
                     }
                     try {
                         _colorTypes.add((ColorType)checkCast(typeClass.
-                              getField(typeName.substring(classIndex,
-                              typeName.length() - classIndex)).
+                              getField(typeName.substring(classIndex)).
                               get(typeClass), ColorType.class));
                     } catch (NoSuchFieldException nsfe) {
                         throw new SAXException("Unable to find color type: " +
--- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthToolBarUI.java	Mon Jun 21 15:02:47 2010 -0700
+++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthToolBarUI.java	Mon Jun 21 22:08:10 2010 -0700
@@ -363,18 +363,24 @@
                     SynthIcon.getIconWidth(handleIcon, context) : 0;
                 Dimension compDim;
                 for (int i = 0; i < tb.getComponentCount(); i++) {
-                    compDim = tb.getComponent(i).getMinimumSize();
-                    dim.width += compDim.width;
-                    dim.height = Math.max(dim.height, compDim.height);
+                    Component component = tb.getComponent(i);
+                    if (component.isVisible()) {
+                        compDim = component.getMinimumSize();
+                        dim.width += compDim.width;
+                        dim.height = Math.max(dim.height, compDim.height);
+                    }
                 }
             } else {
                 dim.height = tb.isFloatable() ?
                     SynthIcon.getIconHeight(handleIcon, context) : 0;
                 Dimension compDim;
                 for (int i = 0; i < tb.getComponentCount(); i++) {
-                    compDim = tb.getComponent(i).getMinimumSize();
-                    dim.width = Math.max(dim.width, compDim.width);
-                    dim.height += compDim.height;
+                    Component component = tb.getComponent(i);
+                    if (component.isVisible()) {
+                        compDim = component.getMinimumSize();
+                        dim.width = Math.max(dim.width, compDim.width);
+                        dim.height += compDim.height;
+                    }
                 }
             }
             dim.width += insets.left + insets.right;
@@ -395,18 +401,24 @@
                     SynthIcon.getIconWidth(handleIcon, context) : 0;
                 Dimension compDim;
                 for (int i = 0; i < tb.getComponentCount(); i++) {
-                    compDim = tb.getComponent(i).getPreferredSize();
-                    dim.width += compDim.width;
-                    dim.height = Math.max(dim.height, compDim.height);
+                    Component component = tb.getComponent(i);
+                    if (component.isVisible()) {
+                        compDim = component.getPreferredSize();
+                        dim.width += compDim.width;
+                        dim.height = Math.max(dim.height, compDim.height);
+                    }
                 }
             } else {
                 dim.height = tb.isFloatable() ?
                     SynthIcon.getIconHeight(handleIcon, context) : 0;
                 Dimension compDim;
                 for (int i = 0; i < tb.getComponentCount(); i++) {
-                    compDim = tb.getComponent(i).getPreferredSize();
-                    dim.width = Math.max(dim.width, compDim.width);
-                    dim.height += compDim.height;
+                    Component component = tb.getComponent(i);
+                    if (component.isVisible()) {
+                        compDim = component.getPreferredSize();
+                        dim.width = Math.max(dim.width, compDim.width);
+                        dim.height += compDim.height;
+                    }
                 }
             }
             dim.width += insets.left + insets.right;
@@ -469,22 +481,24 @@
 
                 for (int i = 0; i < tb.getComponentCount(); i++) {
                     c = tb.getComponent(i);
-                    d = c.getPreferredSize();
-                    int y, h;
-                    if (d.height >= baseH || c instanceof JSeparator) {
-                        // Fill available height
-                        y = baseY;
-                        h = baseH;
-                    } else {
-                        // Center component vertically in the available space
-                        y = baseY + (baseH / 2) - (d.height / 2);
-                        h = d.height;
+                    if (c.isVisible()) {
+                        d = c.getPreferredSize();
+                        int y, h;
+                        if (d.height >= baseH || c instanceof JSeparator) {
+                            // Fill available height
+                            y = baseY;
+                            h = baseH;
+                        } else {
+                            // Center component vertically in the available space
+                            y = baseY + (baseH / 2) - (d.height / 2);
+                            h = d.height;
+                        }
+                        //if the component is a "glue" component then add to its
+                        //width the extraSpacePerGlue it is due
+                        if (isGlue(c)) d.width += extraSpacePerGlue;
+                        c.setBounds(ltr ? x : x - d.width, y, d.width, h);
+                        x = ltr ? x + d.width : x - d.width;
                     }
-                    //if the component is a "glue" component then add to its
-                    //width the extraSpacePerGlue it is due
-                    if (isGlue(c)) d.width += extraSpacePerGlue;
-                    c.setBounds(ltr ? x : x - d.width, y, d.width, h);
-                    x = ltr ? x + d.width : x - d.width;
                 }
             } else {
                 int handleHeight = tb.isFloatable() ?
@@ -512,29 +526,31 @@
 
                 for (int i = 0; i < tb.getComponentCount(); i++) {
                     c = tb.getComponent(i);
-                    d = c.getPreferredSize();
-                    int x, w;
-                    if (d.width >= baseW || c instanceof JSeparator) {
-                        // Fill available width
-                        x = baseX;
-                        w = baseW;
-                    } else {
-                        // Center component horizontally in the available space
-                        x = baseX + (baseW / 2) - (d.width / 2);
-                        w = d.width;
+                    if (c.isVisible()) {
+                        d = c.getPreferredSize();
+                        int x, w;
+                        if (d.width >= baseW || c instanceof JSeparator) {
+                            // Fill available width
+                            x = baseX;
+                            w = baseW;
+                        } else {
+                            // Center component horizontally in the available space
+                            x = baseX + (baseW / 2) - (d.width / 2);
+                            w = d.width;
+                        }
+                        //if the component is a "glue" component then add to its
+                        //height the extraSpacePerGlue it is due
+                        if (isGlue(c)) d.height += extraSpacePerGlue;
+                        c.setBounds(x, y, w, d.height);
+                        y += d.height;
                     }
-                    //if the component is a "glue" component then add to its
-                    //height the extraSpacePerGlue it is due
-                    if (isGlue(c)) d.height += extraSpacePerGlue;
-                    c.setBounds(x, y, w, d.height);
-                    y += d.height;
                 }
             }
             context.dispose();
         }
 
         private boolean isGlue(Component c) {
-            if (c instanceof Box.Filler) {
+            if (c.isVisible() && c instanceof Box.Filler) {
                 Box.Filler f = (Box.Filler)c;
                 Dimension min = f.getMinimumSize();
                 Dimension pref = f.getPreferredSize();
--- a/jdk/src/share/classes/javax/swing/text/DefaultStyledDocument.java	Mon Jun 21 15:02:47 2010 -0700
+++ b/jdk/src/share/classes/javax/swing/text/DefaultStyledDocument.java	Mon Jun 21 22:08:10 2010 -0700
@@ -25,15 +25,12 @@
 package javax.swing.text;
 
 import java.awt.Color;
-import java.awt.Component;
 import java.awt.Font;
-import java.awt.FontMetrics;
 import java.awt.font.TextAttribute;
 import java.lang.ref.ReferenceQueue;
 import java.lang.ref.WeakReference;
 import java.util.Enumeration;
 import java.util.HashMap;
-import java.util.Hashtable;
 import java.util.List;
 import java.util.Map;
 import java.util.Stack;
@@ -41,15 +38,14 @@
 import java.util.ArrayList;
 import java.io.IOException;
 import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
 import java.io.Serializable;
-import javax.swing.Icon;
 import javax.swing.event.*;
 import javax.swing.undo.AbstractUndoableEdit;
 import javax.swing.undo.CannotRedoException;
 import javax.swing.undo.CannotUndoException;
 import javax.swing.undo.UndoableEdit;
 import javax.swing.SwingUtilities;
+import static sun.swing.SwingUtilities2.IMPLIED_CR;
 
 /**
  * A document that can be marked up with character and paragraph
@@ -782,9 +778,18 @@
             // Check for the composed text element. If it is, merge the character attributes
             // into this element as well.
             if (Utilities.isComposedTextAttributeDefined(attr)) {
-                ((MutableAttributeSet)attr).addAttributes(cattr);
-                ((MutableAttributeSet)attr).addAttribute(AbstractDocument.ElementNameAttribute,
-                                                         AbstractDocument.ContentElementName);
+                MutableAttributeSet mattr = (MutableAttributeSet) attr;
+                mattr.addAttributes(cattr);
+                mattr.addAttribute(AbstractDocument.ElementNameAttribute,
+                        AbstractDocument.ContentElementName);
+
+                // Assure that the composed text element is named properly
+                // and doesn't have the CR attribute defined.
+                mattr.addAttribute(StyleConstants.NameAttribute,
+                        AbstractDocument.ContentElementName);
+                if (mattr.isDefined(IMPLIED_CR)) {
+                    mattr.removeAttribute(IMPLIED_CR);
+                }
             }
 
             ElementSpec[] spec = new ElementSpec[parseBuffer.size()];
--- a/jdk/src/share/classes/javax/swing/text/GlyphView.java	Mon Jun 21 15:02:47 2010 -0700
+++ b/jdk/src/share/classes/javax/swing/text/GlyphView.java	Mon Jun 21 22:08:10 2010 -0700
@@ -32,6 +32,7 @@
 
 import javax.swing.UIManager;
 import sun.swing.SwingUtilities2;
+import static sun.swing.SwingUtilities2.IMPLIED_CR;
 
 /**
  * A GlyphView is a styled chunk of text that represents a view
@@ -1061,7 +1062,6 @@
     int length;
     // if it is an implied newline character
     boolean impliedCR;
-    private static final String IMPLIED_CR = "CR";
     boolean skipWidth;
 
     /**
--- a/jdk/src/share/classes/javax/swing/text/Utilities.java	Mon Jun 21 15:02:47 2010 -0700
+++ b/jdk/src/share/classes/javax/swing/text/Utilities.java	Mon Jun 21 22:08:10 2010 -0700
@@ -404,6 +404,24 @@
     }
 
     /**
+     * Adjust text offset so that the length of a resulting string as a whole
+     * fits into the specified width.
+     */
+    static int adjustOffsetForFractionalMetrics(
+            Segment s, FontMetrics fm, int offset, int width) {
+        // Sometimes the offset returned by getTabbedTextOffset is beyond the
+        // available area, when fractional metrics are enabled. We should
+        // guard against this.
+        if (offset < s.count) {
+            while (offset > 0 &&
+                    fm.charsWidth(s.array, s.offset, offset + 1) > width) {
+                offset--;
+            }
+        }
+        return offset;
+    }
+
+    /**
      * Determine where to break the given text to fit
      * within the given span. This tries to find a word boundary.
      * @param s  the source of the text
@@ -425,7 +443,7 @@
         int txtCount = s.count;
         int index = Utilities.getTabbedTextOffset(s, metrics, x0, x,
                                                   e, startOffset, false);
-
+        index = adjustOffsetForFractionalMetrics(s, metrics, index, x - x0);
 
         if (index >= txtCount - 1) {
             return txtCount;
--- a/jdk/src/share/classes/javax/swing/text/WrappedPlainView.java	Mon Jun 21 15:02:47 2010 -0700
+++ b/jdk/src/share/classes/javax/swing/text/WrappedPlainView.java	Mon Jun 21 22:08:10 2010 -0700
@@ -108,7 +108,7 @@
 
         try {
             if (line.isLeaf()) {
-                drawText(line, p0, p1, g, x, y);
+                 drawText(line, p0, p1, g, x, y);
             } else {
                 // this line contains the composed text.
                 int idx = line.getElementIndex(p0);
@@ -239,9 +239,11 @@
                                                 tabBase, tabBase + currentWidth,
                                                 this, p0);
         } else {
-            p = p0 + Utilities.getTabbedTextOffset(segment, metrics,
-                                                   tabBase, tabBase + currentWidth,
-                                                   this, p0, false);
+            int offset = Utilities.getTabbedTextOffset(segment, metrics,
+                    tabBase, tabBase + currentWidth, this, p0, false);
+            offset = Utilities.adjustOffsetForFractionalMetrics(
+                    segment, metrics, offset, currentWidth);
+            p = p0 + offset;
         }
         SegmentCache.releaseSharedSegment(segment);
         return p;
--- a/jdk/src/share/classes/javax/swing/text/html/HTMLDocument.java	Mon Jun 21 15:02:47 2010 -0700
+++ b/jdk/src/share/classes/javax/swing/text/html/HTMLDocument.java	Mon Jun 21 22:08:10 2010 -0700
@@ -24,20 +24,17 @@
  */
 package javax.swing.text.html;
 
-import java.awt.Color;
-import java.awt.Component;
 import java.awt.font.TextAttribute;
 import java.util.*;
 import java.net.URL;
-import java.net.URLEncoder;
 import java.net.MalformedURLException;
 import java.io.*;
 import javax.swing.*;
 import javax.swing.event.*;
 import javax.swing.text.*;
 import javax.swing.undo.*;
-import java.text.Bidi;
 import sun.swing.SwingUtilities2;
+import static sun.swing.SwingUtilities2.IMPLIED_CR;
 
 /**
  * A document that models HTML.  The purpose of this model is to
@@ -1819,7 +1816,6 @@
     static String MAP_PROPERTY = "__MAP__";
 
     private static char[] NEWLINE;
-    private static final String IMPLIED_CR = "CR";
 
     /**
      * I18N property key.
--- a/jdk/src/share/classes/sun/java2d/pisces/META-INF/services/sun.java2d.pipe.RenderingEngine	Mon Jun 21 15:02:47 2010 -0700
+++ b/jdk/src/share/classes/sun/java2d/pisces/META-INF/services/sun.java2d.pipe.RenderingEngine	Mon Jun 21 22:08:10 2010 -0700
@@ -1,5 +1,2 @@
-# Jules Rendering Engine module
-sun.java2d.jules.JulesRenderingEngine
-
 #  Pisces Rendering Engine module
-sun.java2d.pisces.PiscesRenderingEngine
\ No newline at end of file
+sun.java2d.pisces.PiscesRenderingEngine
--- a/jdk/src/share/classes/sun/swing/SwingUtilities2.java	Mon Jun 21 15:02:47 2010 -0700
+++ b/jdk/src/share/classes/sun/swing/SwingUtilities2.java	Mon Jun 21 22:08:10 2010 -0700
@@ -109,6 +109,12 @@
                           new StringBuffer("AATextInfoPropertyKey");
 
     /**
+     * Attribute key for the content elements.  If it is set on an element, the
+     * element is considered to be a line break.
+     */
+    public static final String IMPLIED_CR = "CR";
+
+    /**
      * Used to tell a text component, being used as an editor for table
      * or tree, how many clicks it took to start editing.
      */
--- a/jdk/src/share/classes/sun/swing/table/DefaultTableCellHeaderRenderer.java	Mon Jun 21 15:02:47 2010 -0700
+++ b/jdk/src/share/classes/sun/swing/table/DefaultTableCellHeaderRenderer.java	Mon Jun 21 22:08:10 2010 -0700
@@ -127,7 +127,7 @@
 
     public static SortOrder getColumnSortOrder(JTable table, int column) {
         SortOrder rv = null;
-        if (table.getRowSorter() == null) {
+        if (table == null || table.getRowSorter() == null) {
             return rv;
         }
         java.util.List<? extends RowSorter.SortKey> sortKeys =
--- a/jdk/src/share/native/sun/awt/splashscreen/splashscreen_png.c	Mon Jun 21 15:02:47 2010 -0700
+++ b/jdk/src/share/native/sun/awt/splashscreen/splashscreen_png.c	Mon Jun 21 22:08:10 2010 -0700
@@ -182,7 +182,7 @@
     int success = 0;
 
     stream->read(stream, sig, SIG_BYTES);
-    if (!png_check_sig(sig, SIG_BYTES)) {
+    if (png_sig_cmp(sig, 0, SIG_BYTES)) {
         goto done;
     }
     success = SplashDecodePng(splash, my_png_read_stream, stream);
--- a/jdk/src/share/native/sun/font/freetypeScaler.c	Mon Jun 21 15:02:47 2010 -0700
+++ b/jdk/src/share/native/sun/font/freetypeScaler.c	Mon Jun 21 22:08:10 2010 -0700
@@ -490,22 +490,23 @@
 
     /* ascent */
     ax = 0;
-    ay = -(jfloat) FT26Dot6ToFloat(
-                       scalerInfo->face->size->metrics.ascender +
-                       bmodifier/2);
+    ay = -(jfloat) FT26Dot6ToFloat(FT_MulFix(
+                       ((jlong) scalerInfo->face->ascender + bmodifier/2),
+                       (jlong) scalerInfo->face->size->metrics.y_scale));
     /* descent */
     dx = 0;
-    dy = -(jfloat) FT26Dot6ToFloat(
-                       scalerInfo->face->size->metrics.descender +
-                       bmodifier/2);
+    dy = -(jfloat) FT26Dot6ToFloat(FT_MulFix(
+                       ((jlong) scalerInfo->face->descender + bmodifier/2),
+                       (jlong) scalerInfo->face->size->metrics.y_scale));
     /* baseline */
     bx = by = 0;
 
     /* leading */
     lx = 0;
-    ly = (jfloat) FT26Dot6ToFloat(
-                      scalerInfo->face->size->metrics.height +
-                      bmodifier) + ay - dy;
+    ly = (jfloat) FT26Dot6ToFloat(FT_MulFix(
+                      (jlong) scalerInfo->face->height + bmodifier,
+                      (jlong) scalerInfo->face->size->metrics.y_scale))
+                  + ay - dy;
     /* max advance */
     mx = (jfloat) FT26Dot6ToFloat(
                      scalerInfo->face->size->metrics.max_advance +
--- a/jdk/src/solaris/classes/sun/awt/X11/XEmbeddedFramePeer.java	Mon Jun 21 15:02:47 2010 -0700
+++ b/jdk/src/solaris/classes/sun/awt/X11/XEmbeddedFramePeer.java	Mon Jun 21 22:08:10 2010 -0700
@@ -275,7 +275,7 @@
         Point absoluteLoc = XlibUtil.translateCoordinates(getWindow(),
                                                           XToolkit.getDefaultRootWindow(),
                                                           new Point(0, 0));
-        return absoluteLoc.x;
+        return absoluteLoc != null ? absoluteLoc.x : 0;
     }
 
     public int getAbsoluteY()
@@ -283,7 +283,7 @@
         Point absoluteLoc = XlibUtil.translateCoordinates(getWindow(),
                                                           XToolkit.getDefaultRootWindow(),
                                                           new Point(0, 0));
-        return absoluteLoc.y;
+        return absoluteLoc != null ? absoluteLoc.y : 0;
     }
 
     public int getWidth() {
--- a/jdk/src/solaris/classes/sun/awt/X11/XToolkit.java	Mon Jun 21 15:02:47 2010 -0700
+++ b/jdk/src/solaris/classes/sun/awt/X11/XToolkit.java	Mon Jun 21 22:08:10 2010 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -849,7 +849,7 @@
                     // if _NET_WM_STRUT_PARTIAL is present, we should use its values to detect
                     // if the struts area intersects with screenBounds, however some window
                     // managers don't set this hint correctly, so we just get intersection with windowBounds
-                    if (windowBounds.intersects(screenBounds))
+                    if (windowBounds != null && windowBounds.intersects(screenBounds))
                     {
                         insets.left = Math.max((int)Native.getLong(native_ptr, 0), insets.left);
                         insets.right = Math.max((int)Native.getLong(native_ptr, 1), insets.right);
@@ -1961,7 +1961,7 @@
     }
 
     static long reset_time_utc;
-    static final long WRAP_TIME_MILLIS = Integer.MAX_VALUE;
+    static final long WRAP_TIME_MILLIS = 0x00000000FFFFFFFFL;
 
     /*
      * This function converts between the X server time (number of milliseconds
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/solaris/classes/sun/java2d/pisces/META-INF/services/sun.java2d.pipe.RenderingEngine	Mon Jun 21 22:08:10 2010 -0700
@@ -0,0 +1,5 @@
+# Jules Rendering Engine module
+sun.java2d.jules.JulesRenderingEngine
+
+#  Pisces Rendering Engine module
+sun.java2d.pisces.PiscesRenderingEngine
--- a/jdk/src/solaris/native/sun/awt/sun_awt_X11_GtkFileDialogPeer.c	Mon Jun 21 15:02:47 2010 -0700
+++ b/jdk/src/solaris/native/sun/awt/sun_awt_X11_GtkFileDialogPeer.c	Mon Jun 21 22:08:10 2010 -0700
@@ -52,11 +52,15 @@
 {
     if (dialog != NULL)
     {
+        fp_gdk_threads_enter();
+
         fp_gtk_widget_hide (dialog);
         fp_gtk_widget_destroy (dialog);
 
         fp_gtk_main_quit ();
         dialog = NULL;
+
+        fp_gdk_threads_leave();
     }
 }
 
@@ -162,7 +166,6 @@
         (*env)->GetJavaVM(env, &jvm);
     }
 
-    fp_gdk_threads_init();
     fp_gdk_threads_enter();
 
     const char *title = (*env)->GetStringUTFChars(env, jtitle, 0);
--- a/jdk/src/windows/native/sun/font/fontpath.c	Mon Jun 21 15:02:47 2010 -0700
+++ b/jdk/src/windows/native/sun/font/fontpath.c	Mon Jun 21 22:08:10 2010 -0700
@@ -154,7 +154,7 @@
     fullname = JNU_NewStringPlatform(env, lpelfe->elfFullName);
     fullnameLC = (*env)->CallObjectMethod(env, fullname,
                                           fmi->toLowerCaseMID, fmi->locale);
-    (*env)->CallObjectMethod(env, fmi->list, fmi->addMID, fullname);
+    (*env)->CallBooleanMethod(env, fmi->list, fmi->addMID, fullname);
     (*env)->CallObjectMethod(env, fmi->fontToFamilyMap,
                              fmi->putMID, fullnameLC, fmi->family);
     return 1;
@@ -238,7 +238,7 @@
                                  wcslen((LPWSTR)lpelfe->elfFullName));
     fullnameLC = (*env)->CallObjectMethod(env, fullname,
                                           fmi->toLowerCaseMID, fmi->locale);
-    (*env)->CallObjectMethod(env, fmi->list, fmi->addMID, fullname);
+    (*env)->CallBooleanMethod(env, fmi->list, fmi->addMID, fullname);
     (*env)->CallObjectMethod(env, fmi->fontToFamilyMap,
                              fmi->putMID, fullnameLC, fmi->family);
     return 1;
--- a/jdk/test/java/awt/FileDialog/FilenameFilterTest/FilenameFilterTest.java	Mon Jun 21 15:02:47 2010 -0700
+++ b/jdk/test/java/awt/FileDialog/FilenameFilterTest/FilenameFilterTest.java	Mon Jun 21 22:08:10 2010 -0700
@@ -83,6 +83,12 @@
         if (fd == null) {
             throw new RuntimeException("fd is null (very unexpected thing :(");
         }
+        //Wait a little; some native dialog implementations may take a while
+        //to initialize and call the filter. See 6959787 for an example.
+        try {
+            Thread.sleep(5000);
+        } catch (Exception ex) {
+        }
         fd.dispose();
         if (!filter_was_called) {
             throw new RuntimeException("Filter was not called");
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/swing/JTable/6788484/bug6788484.java	Mon Jun 21 22:08:10 2010 -0700
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2010 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+/* @test
+   @bug 6788484
+   @summary NPE in DefaultTableCellHeaderRenderer.getColumnSortOrder() with null table
+   @author Alexander Potochkin
+   @run main bug6788484
+*/
+import sun.swing.table.DefaultTableCellHeaderRenderer;
+
+import javax.swing.*;
+
+public class bug6788484 {
+
+    public static void main(String[] args) throws Exception {
+        DefaultTableCellHeaderRenderer.getColumnSortOrder(null, 0);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/swing/plaf/synth/6771547/SynthTest.java	Mon Jun 21 22:08:10 2010 -0700
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * @test
+ * @bug 6771547
+ * @author Alexander Potochkin
+ * @summary SynthParser throws StringIndexOutOfBoundsException parsing custom ColorTypes
+ */
+
+import javax.swing.plaf.synth.SynthLookAndFeel;
+import javax.swing.*;
+import java.io.InputStream;
+import java.awt.*;
+
+public class SynthTest {
+
+    public static void main(String[] args) throws Exception {
+        SynthLookAndFeel laf = new SynthLookAndFeel();
+        InputStream in = SynthTest.class.getResourceAsStream(
+                "synthconfig.xml");
+        laf.load(in, SynthTest.class);
+
+        UIManager.setLookAndFeel(laf);
+
+        if (!Color.RED.equals(new JButton().getForeground())) {
+            throw new RuntimeException("The wrong foreground color!");
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/swing/plaf/synth/6771547/synthconfig.xml	Mon Jun 21 22:08:10 2010 -0700
@@ -0,0 +1,10 @@
+<synth>
+    <style id="button">
+        <font name="Verdana" size="16"/>
+        <state>
+            <color value="RED"
+                   type="javax.swing.plaf.synth.ColorType.FOREGROUND"/>
+        </state>
+    </style>
+    <bind style="button" type="region" key="button"/>
+</synth>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/swing/plaf/synth/SynthToolBarUI/6739756/bug6739756.java	Mon Jun 21 22:08:10 2010 -0700
@@ -0,0 +1,59 @@
+/*
+ * Copyright 2010 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+/**
+ * @test
+ * @bug 6739756
+ * @author Alexander Potochkin
+ * @summary JToolBar leaves space for non-visible items under Nimbus L&F
+ * @run main bug6739756
+ */
+
+import javax.swing.*;
+import java.awt.*;
+
+public class bug6739756 {
+
+    public static void main(String[] args) throws Exception {
+        try {
+           UIManager.setLookAndFeel(
+                   "com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel");
+        }
+        catch (Exception e) {
+            e.printStackTrace();
+            return;
+        }
+        SwingUtilities.invokeAndWait(new Runnable() {
+            public void run() {
+                JToolBar tb = new JToolBar();
+                Dimension preferredSize = tb.getPreferredSize();
+                JButton button = new JButton("Test");
+                button.setVisible(false);
+                tb.add(button);
+                if (!preferredSize.equals(tb.getPreferredSize())) {
+                    throw new RuntimeException("Toolbar's preferredSize is wrong");
+                }
+            }
+        });
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/swing/text/DefaultStyledDocument/6636983/bug6636983.java	Mon Jun 21 22:08:10 2010 -0700
@@ -0,0 +1,152 @@
+/*
+ * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 6636983
+ * @summary test that composed text at the line starts is handled correctly
+ * @author Sergey Groznyh
+ * @run main bug6636983
+ */
+
+import sun.swing.SwingUtilities2;
+
+import javax.swing.*;
+import javax.swing.text.*;
+import javax.swing.text.html.HTMLDocument;
+import java.awt.*;
+import java.awt.event.InputMethodEvent;
+import java.awt.event.KeyEvent;
+import java.text.AttributedString;
+
+public class bug6636983 {
+    private Robot robot;
+
+    private final AttributedString Hiragana_A = new AttributedString("\u3042");
+
+    void sendInputMethodEvent() {
+        InputMethodEvent ime = new InputMethodEvent(
+                ep,
+                InputMethodEvent.INPUT_METHOD_TEXT_CHANGED,
+                Hiragana_A.getIterator(),
+                0,
+                null,
+                null);
+        ep.dispatchEvent(ime);
+    }
+
+    void checkComposedTextRun() {
+        HTMLDocument d = (HTMLDocument) ep.getDocument();
+        ElementIterator it = new ElementIterator(d.getDefaultRootElement());
+
+        while (true) {
+            Element e = it.next();
+            if (e == null) {
+                throw new RuntimeException("no composed text found");
+            }
+            AttributeSet a = e.getAttributes();
+            if (a.isDefined(StyleConstants.ComposedTextAttribute)) {
+                if (!AbstractDocument.ContentElementName.equals(a.getAttribute(StyleConstants.NameAttribute))) {
+                    throw new RuntimeException("AbstractDocument.ContentElementName.equals(a.getAttribute(StyleConstants.NameAttribute)) is false");
+                }
+
+                if (a.isDefined(SwingUtilities2.IMPLIED_CR)) {
+                    throw new RuntimeException("a.isDefined(SwingUtilities2.IMPLIED_CR) is true");
+                }
+
+                return;
+            }
+        }
+
+    }
+
+    JEditorPane ep;
+
+    void initAtParagraphStart() {
+        ep.setText("A<p>B");
+        hitKey(KeyEvent.VK_LEFT);
+    }
+
+    void sendAtParagraphStart() {
+        sendInputMethodEvent();
+    }
+
+    void checkAtParagraphStart() {
+        checkComposedTextRun();
+    }
+
+    void initAfterBRElement() {
+        ep.setText("A<br>B");
+        hitKey(KeyEvent.VK_LEFT);
+    }
+
+    void sendAtBRElement() {
+        sendInputMethodEvent();
+    }
+
+    void checkAtBrElement() {
+        checkComposedTextRun();
+    }
+
+    private void hitKey(int keycode) {
+        robot.keyPress(keycode);
+        robot.keyRelease(keycode);
+        robot.delay(550); // The magic number equals JRobot.DEFAULT_DELAY
+    }
+
+    private void run() throws Exception {
+        robot = new Robot();
+
+        ep = new JEditorPane();
+        ep.setContentType("text/html");
+        ep.setPreferredSize(new Dimension(100, 100));
+
+        JFrame frame = new JFrame("Test: " + getClass().getName());
+
+        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+        frame.add(ep);
+        frame.setVisible(true);
+    }
+
+    public static void main(String[] args) throws Throwable {
+        SwingUtilities.invokeAndWait(new Runnable() {
+            public void run() {
+                try {
+                    bug6636983 bug6636983 = new bug6636983();
+
+                    bug6636983.run();
+                    bug6636983.initAtParagraphStart();
+                    bug6636983.sendAtParagraphStart();
+                    bug6636983.checkAtParagraphStart();
+                    bug6636983.initAfterBRElement();
+                    bug6636983.sendAtBRElement();
+                    bug6636983.checkAtBrElement();
+
+                    System.out.println("OK");
+                } catch (Exception e) {
+                    throw new RuntimeException("The test failed", e);
+                }
+            }
+        });
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/swing/text/WrappedPlainView/6857057/StubBranchElement.java	Mon Jun 21 22:08:10 2010 -0700
@@ -0,0 +1,87 @@
+/*
+ * Copyright 2010 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+import javax.swing.text.*;
+
+class StubBranchElement implements Element {
+    Document document = new DefaultStyledDocument();
+    String context;
+    Element[] children = new StubLeafElement[3];
+
+    public StubBranchElement(String context) {
+        this.context = context;
+        int len = context.length() / 3;
+        for (int i = 0; i < 3; i++) {
+            children[i] = new StubLeafElement(
+                    context.substring(len * i, len * (i + 1)), this, len * i);
+        }
+        try {
+            document.insertString(0, context, new SimpleAttributeSet());
+        } catch (BadLocationException e) {
+        }
+    }
+
+    public Document getDocument() {
+        return document;
+    }
+
+    public Element getParentElement() {
+        return null;
+    }
+
+    public String getName() {
+        return "StubBranchElement";
+    }
+
+    public AttributeSet getAttributes() {
+        return new SimpleAttributeSet();
+    }
+
+    public int getStartOffset() {
+        return 0;
+    }
+
+    public int getEndOffset() {
+        return document.getLength();
+    }
+
+    public int getElementIndex(int offset) {
+        return offset / 3;
+    }
+
+    public int getElementCount() {
+        return 3;
+    }
+
+    public Element getElement(int index) {
+        return children[index];
+    }
+
+    public boolean isLeaf() {
+        return false;
+    }
+
+    public Element[] getChildren() {
+        return children;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/swing/text/WrappedPlainView/6857057/StubLeafElement.java	Mon Jun 21 22:08:10 2010 -0700
@@ -0,0 +1,81 @@
+/*
+ * Copyright 2010 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+import javax.swing.text.*;
+
+class StubLeafElement implements Element {
+    Document document = new DefaultStyledDocument();
+    String context;
+    Element parent;
+    int position;
+
+    public StubLeafElement(String context, Element parent, int position) {
+        this.context = context;
+        this.parent = parent;
+        this.position = position;
+        try {
+            document.insertString(0, context, new SimpleAttributeSet());
+        } catch (BadLocationException e) {
+        }
+    }
+
+    public Document getDocument() {
+        return document;
+    }
+
+    public Element getParentElement() {
+        return parent;
+    }
+
+    public String getName() {
+        return "StubLeafElement";
+    }
+
+    public AttributeSet getAttributes() {
+        return new SimpleAttributeSet();
+    }
+
+    public int getStartOffset() {
+        return position;
+    }
+
+    public int getEndOffset() {
+        return position + document.getLength();
+    }
+
+    public int getElementIndex(int offset) {
+        return 0;
+    }
+
+    public int getElementCount() {
+        return 0;
+    }
+
+    public Element getElement(int index) {
+        return this;
+    }
+
+    public boolean isLeaf() {
+        return true;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/swing/text/WrappedPlainView/6857057/bug6857057.java	Mon Jun 21 22:08:10 2010 -0700
@@ -0,0 +1,59 @@
+/*
+ * Copyright 2010 Sun Microsystems, Inc.  All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+/*
+ * @test
+ * @bug 6857057
+ * @summary test that the JCK GlyphView2021 test doesn't fail
+ * @author Sergey Groznyh
+ * @run main bug6857057
+ */
+
+import javax.swing.*;
+import javax.swing.text.Element;
+import javax.swing.text.GlyphView;
+import javax.swing.text.View;
+
+public class bug6857057 {
+
+    bug6857057() {
+        Element elem = new StubBranchElement(" G L Y P H V");
+        GlyphView view = new GlyphView(elem);
+        float pos = elem.getStartOffset();
+        float len = elem.getEndOffset() - pos;
+        int res = view.getBreakWeight(View.X_AXIS, pos, len);
+        if (res != View.ExcellentBreakWeight) {
+            throw new RuntimeException("breakWeight != ExcellentBreakWeight");
+        }
+    }
+
+    public static void main(String[] args) throws Throwable {
+        SwingUtilities.invokeLater(new Runnable() {
+            public void run() {
+                new bug6857057();
+            }
+        });
+
+        System.out.println("OK");
+    }
+}
--- a/langtools/.hgtags	Mon Jun 21 15:02:47 2010 -0700
+++ b/langtools/.hgtags	Mon Jun 21 22:08:10 2010 -0700
@@ -71,3 +71,4 @@
 bb3d7c75a56df0c00246072b996fad1858a771a1 jdk7-b94
 752bb790fc2d6df91e91d84420c9c87136eb81eb jdk7-b95
 89cd267c216751bdacf8629bb07a40c0950fc4f2 jdk7-b96
+c0a41294297ed397098dd92b647f481f0e1bb8fa jdk7-b97