changeset 5490:9e25381cbff4

Merge jdk7u8-b01
author andrew
date Mon, 06 Aug 2012 14:20:32 +0100
parents e1fa4501b4a7 (current diff) dd1e513c05b8 (diff)
children 00e2703dc639
files .hgtags src/share/classes/com/sun/jndi/ldap/Connection.java src/share/classes/sun/nio/ch/DatagramChannelImpl.java
diffstat 57 files changed, 794 insertions(+), 420 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags	Mon Aug 06 13:31:40 2012 +0100
+++ b/.hgtags	Mon Aug 06 14:20:32 2012 +0100
@@ -201,3 +201,4 @@
 4a6917092af80481c1fa5b9ec8ccae75411bb72c jdk7u6-b18
 a263f787ced5bc7c14078ae552c82de6bd011611 jdk7u6-b19
 09145b546a2b6ae1f44d5c8a7d2a37d48e4b39e2 jdk7u6-b20
+df945ef30444adf08f3ef14b0c49c8bda6dda587 jdk7u8-b01
--- a/make/java/nio/mapfile-linux	Mon Aug 06 13:31:40 2012 +0100
+++ b/make/java/nio/mapfile-linux	Mon Aug 06 14:20:32 2012 +0100
@@ -88,6 +88,7 @@
                 Java_sun_nio_ch_IOUtil_drain;
                 Java_sun_nio_ch_IOUtil_fdVal;
                 Java_sun_nio_ch_IOUtil_initIDs;
+		Java_sun_nio_ch_IOUtil_iovMax;
                 Java_sun_nio_ch_IOUtil_makePipe;
                 Java_sun_nio_ch_IOUtil_randomBytes;
                 Java_sun_nio_ch_IOUtil_setfdVal;
--- a/make/java/nio/mapfile-solaris	Mon Aug 06 13:31:40 2012 +0100
+++ b/make/java/nio/mapfile-solaris	Mon Aug 06 14:20:32 2012 +0100
@@ -76,6 +76,7 @@
                 Java_sun_nio_ch_IOUtil_drain;
                 Java_sun_nio_ch_IOUtil_fdVal;
                 Java_sun_nio_ch_IOUtil_initIDs;
+		Java_sun_nio_ch_IOUtil_iovMax;
                 Java_sun_nio_ch_IOUtil_makePipe;
                 Java_sun_nio_ch_IOUtil_randomBytes;
                 Java_sun_nio_ch_IOUtil_setfdVal;
--- a/src/share/classes/com/sun/java/util/jar/pack/Driver.java	Mon Aug 06 13:31:40 2012 +0100
+++ b/src/share/classes/com/sun/java/util/jar/pack/Driver.java	Mon Aug 06 14:20:32 2012 +0100
@@ -36,6 +36,7 @@
 import java.io.PrintStream;
 import java.text.MessageFormat;
 import java.nio.file.Files;
+import java.nio.file.Path;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.HashMap;
@@ -381,12 +382,15 @@
         String prefix = base.getName();
         if (prefix.length() < 3)  prefix += "tmp";
 
-        File where = base.getParentFile();
+        File where = (base.getParentFile() == null && suffix.equals(".bak"))
+                ? new File(".").getAbsoluteFile()
+                : base.getParentFile();
 
-        if ( base.getParentFile() == null && suffix.equals(".bak"))
-            where = new File(".").getAbsoluteFile();
+        Path tmpfile = (where == null)
+                ? Files.createTempFile(prefix, suffix)
+                : Files.createTempFile(where.toPath(), prefix, suffix);
 
-        return Files.createTempFile(where.toPath(), prefix, suffix).toFile();
+        return tmpfile.toFile();
     }
 
     static private
--- a/src/share/classes/com/sun/jndi/ldap/Connection.java	Mon Aug 06 13:31:40 2012 +0100
+++ b/src/share/classes/com/sun/jndi/ldap/Connection.java	Mon Aug 06 14:20:32 2012 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2012, 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
@@ -685,9 +685,11 @@
                         ldr = ldr.next;
                     }
                 }
-                parent.processConnectionClosure();
             }
         }
+        if (nparent) {
+            parent.processConnectionClosure();
+        }
     }
 
 
--- a/src/share/classes/com/sun/jndi/ldap/LdapClient.java	Mon Aug 06 13:31:40 2012 +0100
+++ b/src/share/classes/com/sun/jndi/ldap/LdapClient.java	Mon Aug 06 14:20:32 2012 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2012, 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
@@ -487,14 +487,16 @@
      */
     void processConnectionClosure() {
         // Notify listeners
-        if (unsolicited.size() > 0) {
-            String msg;
-            if (conn != null) {
-                msg = conn.host + ":" + conn.port + " connection closed";
-            } else {
-                msg = "Connection closed";
+        synchronized (unsolicited) {
+            if (unsolicited.size() > 0) {
+                String msg;
+                if (conn != null) {
+                    msg = conn.host + ":" + conn.port + " connection closed";
+                } else {
+                    msg = "Connection closed";
+                }
+                notifyUnsolicited(new CommunicationException(msg));
             }
-            notifyUnsolicited(new CommunicationException(msg));
         }
 
         // Remove from pool
--- a/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic.properties	Mon Aug 06 13:31:40 2012 +0100
+++ b/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic.properties	Mon Aug 06 14:20:32 2012 +0100
@@ -1,186 +1,189 @@
-# This properties file is used to create a PropertyResourceBundle
-# It contains Locale specific strings used in Swing
-# Currently, the following components need this for support:
-#
-#    ColorChooser
-#    FileChooser
-#    OptionPane
-#
-# When this file is read in, the strings are put into the
-# defaults table.  This is an implementation detail of the current
-# workings of Swing.  DO NOT DEPEND ON THIS.
-# This may change in future versions of Swing as we improve localization
-# support.
-#
-#                        MNEMONIC NOTE:
-# Many of strings in this file are used by widgets that have a
-# mnemonic, for example:
-#   ColorChooser.rgbNameTextAndMnemonic=R&GB
-#
-# Indicates that the tab in the ColorChooser for RGB colors will have
-# the text 'RGB', further the mnemonic character will be 'g' and that
-# a decoration will be provided under the 'G'. This will typically
-# look like:  RGB
-#              -
-#
-# One important thing to remember is that the mnemonic MUST exist in
-# the String, if it does not exist you should add text that makes it
-# exist. This will typically take the form 'XXXX (M)' where M is the
-# character for the mnemonic.
-#
-# @author Steve Wilson
-
-############ FILE CHOOSER STRINGS #############
-FileChooser.fileDescription.textAndMnemonic=Generic File
-FileChooser.directoryDescription.textAndMnemonic=Directory
-FileChooser.newFolderError.textAndMnemonic=Error creating new folder
-FileChooser.newFolderErrorSeparator= :
-FileChooser.newFolderParentDoesntExistTitle.textAndMnemonic=Unable to create folder
-FileChooser.newFolderParentDoesntExist.textAndMnemonic=Unable to create the folder.\n\nThe system cannot find the path specified.
-FileChooser.renameErrorTitle.textAndMnemonic=Error Renaming File or Folder
-FileChooser.renameError.textAndMnemonic=Cannot rename {0}
+# This properties file is used to create a PropertyResourceBundle
+# It contains Locale specific strings used in Swing
+# Currently, the following components need this for support:
+#
+#    ColorChooser
+#    FileChooser
+#    OptionPane
+#
+# When this file is read in, the strings are put into the
+# defaults table.  This is an implementation detail of the current
+# workings of Swing.  DO NOT DEPEND ON THIS.
+# This may change in future versions of Swing as we improve localization
+# support.
+#
+#                        MNEMONIC NOTE:
+# Many of strings in this file are used by widgets that have a
+# mnemonic, for example:
+#   ColorChooser.rgbNameTextAndMnemonic=R&GB
+#
+# Indicates that the tab in the ColorChooser for RGB colors will have
+# the text 'RGB', further the mnemonic character will be 'g' and that
+# a decoration will be provided under the 'G'. This will typically
+# look like:  RGB
+#              -
+#
+# One important thing to remember is that the mnemonic MUST exist in
+# the String, if it does not exist you should add text that makes it
+# exist. This will typically take the form 'XXXX (M)' where M is the
+# character for the mnemonic.
+#
+# @author Steve Wilson
+
+############ FILE CHOOSER STRINGS #############
+FileChooser.fileDescription.textAndMnemonic=Generic File
+FileChooser.directoryDescription.textAndMnemonic=Directory
+FileChooser.newFolderError.textAndMnemonic=Error creating new folder
+FileChooser.newFolderErrorSeparator= :
+FileChooser.newFolderParentDoesntExistTitle.textAndMnemonic=Unable to create folder
+FileChooser.newFolderParentDoesntExist.textAndMnemonic=Unable to create the folder.\n\nThe system cannot find the path specified.
+FileChooser.renameErrorTitle.textAndMnemonic=Error Renaming File or Folder
+FileChooser.renameError.textAndMnemonic=Cannot rename {0}
 FileChooser.renameErrorFileExists.textAndMnemonic=Cannot rename {0}: A file with the name you specified already exists. \
-  Specify a different file name.
-FileChooser.acceptAllFileFilter.textAndMnemonic=All Files
-FileChooser.cancelButton.textAndMnemonic=Cancel
-FileChooser.saveButton.textAndMnemonic=&Save
-FileChooser.openButton.textAndMnemonic=&Open
-FileChooser.saveDialogTitle.textAndMnemonic=Save
-FileChooser.openDialogTitle.textAndMnemonic=Open
-FileChooser.updateButton.textAndMnemonic=&Update
-FileChooser.helpButton.textAndMnemonic=&Help
-FileChooser.directoryOpenButton.textAndMnemonic=&Open
-
-# File Size Units
-FileChooser.fileSizeKiloBytes={0} KB
-FileChooser.fileSizeMegaBytes={0} MB
-FileChooser.fileSizeGigaBytes={0} GB
-
-# These strings are platform dependent not look and feel dependent.
-FileChooser.win32.newFolder=New Folder
-FileChooser.win32.newFolder.subsequent=New Folder ({0})
-FileChooser.other.newFolder=NewFolder
-FileChooser.other.newFolder.subsequent=NewFolder.{0}
-
-
-## file chooser tooltips ###
-FileChooser.cancelButtonToolTip.textAndMnemonic=Abort file chooser dialog
-FileChooser.saveButtonToolTip.textAndMnemonic=Save selected file
-FileChooser.openButtonToolTip.textAndMnemonic=Open selected file
-FileChooser.updateButtonToolTip.textAndMnemonic=Update directory listing
-FileChooser.helpButtonToolTip.textAndMnemonic=FileChooser help
-FileChooser.directoryOpenButtonToolTip.textAndMnemonic=Open selected directory
-
-############ COLOR CHOOSER STRINGS #############
-ColorChooser.preview.textAndMnemonic=Preview
-ColorChooser.ok.textAndMnemonic=OK
-ColorChooser.cancel.textAndMnemonic=Cancel
-ColorChooser.reset.textAndMnemonic=&Reset
-ColorChooser.sample.textAndMnemonic=Sample Text  Sample Text
-ColorChooser.swatches.textAndMnemonic=&Swatches
-ColorChooser.swatchesRecent.textAndMnemonic=Recent:
-ColorChooser.hsv.textAndMnemonic=&HSV
-ColorChooser.hsvHue.textAndMnemonic=Hue
-ColorChooser.hsvSaturation.textAndMnemonic=Saturation
-ColorChooser.hsvValue.textAndMnemonic=Value
-ColorChooser.hsvTransparency.textAndMnemonic=Transparency
-ColorChooser.hsl.textAndMnemonic=HS&L
-ColorChooser.hslHue.textAndMnemonic=Hue
-ColorChooser.hslSaturation.textAndMnemonic=Saturation
-ColorChooser.hslLightness.textAndMnemonic=Lightness
-ColorChooser.hslTransparency.textAndMnemonic=Transparency
-ColorChooser.rgb.textAndMnemonic=R&GB
-ColorChooser.rgbRed.textAndMnemonic=Re&d
-ColorChooser.rgbGreen.textAndMnemonic=Gree&n
-ColorChooser.rgbBlue.textAndMnemonic=&Blue
-ColorChooser.rgbAlpha.textAndMnemonic=Alpha
-ColorChooser.rgbHexCode.textAndMnemonic=&Color Code
-ColorChooser.cmyk.textAndMnemonic=C&MYK
-ColorChooser.cmykCyan.textAndMnemonic=Cyan
-ColorChooser.cmykMagenta.textAndMnemonic=Magenta
-ColorChooser.cmykYellow.textAndMnemonic=Yellow
-ColorChooser.cmykBlack.textAndMnemonic=Black
-ColorChooser.cmykAlpha.textAndMnemonic=Alpha
-
-############ OPTION PANE STRINGS #############
-# We only define mnemonics for YES/NO, but for completeness you can
-# define mnemonics for any of the buttons.
-OptionPane.yesButton.textAndMnemonic=&Yes
-OptionPane.noButton.textAndMnemonic=&No
-OptionPane.okButton.textAndMnemonic=OK
-#OptionPane.okButtonMnemonic=0
-OptionPane.cancelButton.textAndMnemonic=Cancel
-#OptionPane.cancelButtonMnemonic=0
-OptionPane.title.textAndMnemonic=Select an Option
-# Title for the dialog for the showInputDialog methods. Only used if
-# the developer uses one of the variants that doesn't take a title.
-OptionPane.inputDialog.titleAndMnemonic=Input
-# Title for the dialog for the showMessageDialog methods. Only used if
-# the developer uses one of the variants that doesn't take a title.
-OptionPane.messageDialog.titleAndMnemonic=Message
-
-############ Printing Dialog Strings ############
-PrintingDialog.titleProgress.textAndMnemonic=Printing
-PrintingDialog.titleAborting.textAndMnemonic=Printing (Aborting)
-
-PrintingDialog.contentInitial.textAndMnemonic=Printing in progress...
-
-# The following string will be formatted by a MessageFormat
-# and {0} will be replaced by page number being printed
-PrintingDialog.contentProgress.textAndMnemonic=Printed page {0}...
-
-PrintingDialog.contentAborting.textAndMnemonic=Printing aborting...
-
-PrintingDialog.abortButton.textAndMnemonic=&Abort
-PrintingDialog.abortButtonToolTip.textAndMnemonic=Abort Printing
-
-############ Internal Frame Strings ############
-InternalFrame.iconButtonToolTip=Minimize
-InternalFrame.maxButtonToolTip=Maximize
-InternalFrame.restoreButtonToolTip=Restore
-InternalFrame.closeButtonToolTip=Close
-
-############ Internal Frame Title Pane Strings ############
-InternalFrameTitlePane.restoreButton.textAndMnemonic=Restore
-InternalFrameTitlePane.moveButton.textAndMnemonic=Move
-InternalFrameTitlePane.sizeButton.textAndMnemonic=Size
-InternalFrameTitlePane.minimizeButton.textAndMnemonic=Minimize
-InternalFrameTitlePane.maximizeButton.textAndMnemonic=Maximize
-InternalFrameTitlePane.closeButton.textAndMnemonic=Close
-
-############ Text strings #############
-# Used for html forms
-FormView.submitButton.textAndMnemonic=Submit Query
-FormView.resetButton.textAndMnemonic=Reset
-FormView.browseFileButton.textAndMnemonic=Browse...
-
-############ Abstract Document Strings ############
-AbstractDocument.styleChange.textAndMnemonic=style change
-AbstractDocument.addition.textAndMnemonic=addition
-AbstractDocument.deletion.textAndMnemonic=deletion
-AbstractDocument.undo.textAndMnemonic=Undo
-AbstractDocument.redo.textAndMnemonic=Redo
-
-############ Abstract Button Strings ############
-AbstractButton.click.textAndMnemonic=click
-
-############ Abstract Undoable Edit Strings ############
-AbstractUndoableEdit.undo.textAndMnemonic=Undo
-AbstractUndoableEdit.redo.textAndMnemonic=Redo
-
-############ Combo Box Strings ############
-ComboBox.togglePopup.textAndMnemonic=togglePopup
-
-############ Progress Monitor Strings ############
-ProgressMonitor.progress.textAndMnemonic=Progress...
-
-############ Split Pane Strings ############
-SplitPane.leftButton.textAndMnemonic=left button
-SplitPane.rightButton.textAndMnemonic=right button
-# Used for Isindex
-IsindexView.prompt=This is a searchable index.  Enter search keywords:
-
-############ InternalFrameTitlePane Strings ############
-InternalFrameTitlePane.iconifyButtonAccessibleName=Iconify
-InternalFrameTitlePane.maximizeButtonAccessibleName=Maximize
-InternalFrameTitlePane.closeButtonAccessibleName=Close
+  Specify a different file name.
+FileChooser.acceptAllFileFilter.textAndMnemonic=All Files
+FileChooser.cancelButton.textAndMnemonic=Cancel
+FileChooser.saveButton.textAndMnemonic=&Save
+FileChooser.openButton.textAndMnemonic=&Open
+FileChooser.saveDialogTitle.textAndMnemonic=Save
+FileChooser.openDialogTitle.textAndMnemonic=Open
+FileChooser.updateButton.textAndMnemonic=&Update
+FileChooser.helpButton.textAndMnemonic=&Help
+FileChooser.directoryOpenButton.textAndMnemonic=&Open
+
+# File Size Units
+FileChooser.fileSizeKiloBytes={0} KB
+FileChooser.fileSizeMegaBytes={0} MB
+FileChooser.fileSizeGigaBytes={0} GB
+
+# These strings are platform dependent not look and feel dependent.
+FileChooser.win32.newFolder=New Folder
+FileChooser.win32.newFolder.subsequent=New Folder ({0})
+FileChooser.other.newFolder=NewFolder
+FileChooser.other.newFolder.subsequent=NewFolder.{0}
+
+
+## file chooser tooltips ###
+FileChooser.cancelButtonToolTip.textAndMnemonic=Abort file chooser dialog
+FileChooser.saveButtonToolTip.textAndMnemonic=Save selected file
+FileChooser.openButtonToolTip.textAndMnemonic=Open selected file
+FileChooser.updateButtonToolTip.textAndMnemonic=Update directory listing
+FileChooser.helpButtonToolTip.textAndMnemonic=FileChooser help
+FileChooser.directoryOpenButtonToolTip.textAndMnemonic=Open selected directory
+
+FileChooser.filesListAccessibleName=Files List
+FileChooser.filesDetailsAccessibleName=Files Details
+
+############ COLOR CHOOSER STRINGS #############
+ColorChooser.preview.textAndMnemonic=Preview
+ColorChooser.ok.textAndMnemonic=OK
+ColorChooser.cancel.textAndMnemonic=Cancel
+ColorChooser.reset.textAndMnemonic=&Reset
+ColorChooser.sample.textAndMnemonic=Sample Text  Sample Text
+ColorChooser.swatches.textAndMnemonic=&Swatches
+ColorChooser.swatchesRecent.textAndMnemonic=Recent:
+ColorChooser.hsv.textAndMnemonic=&HSV
+ColorChooser.hsvHue.textAndMnemonic=Hue
+ColorChooser.hsvSaturation.textAndMnemonic=Saturation
+ColorChooser.hsvValue.textAndMnemonic=Value
+ColorChooser.hsvTransparency.textAndMnemonic=Transparency
+ColorChooser.hsl.textAndMnemonic=HS&L
+ColorChooser.hslHue.textAndMnemonic=Hue
+ColorChooser.hslSaturation.textAndMnemonic=Saturation
+ColorChooser.hslLightness.textAndMnemonic=Lightness
+ColorChooser.hslTransparency.textAndMnemonic=Transparency
+ColorChooser.rgb.textAndMnemonic=R&GB
+ColorChooser.rgbRed.textAndMnemonic=Re&d
+ColorChooser.rgbGreen.textAndMnemonic=Gree&n
+ColorChooser.rgbBlue.textAndMnemonic=&Blue
+ColorChooser.rgbAlpha.textAndMnemonic=Alpha
+ColorChooser.rgbHexCode.textAndMnemonic=&Color Code
+ColorChooser.cmyk.textAndMnemonic=C&MYK
+ColorChooser.cmykCyan.textAndMnemonic=Cyan
+ColorChooser.cmykMagenta.textAndMnemonic=Magenta
+ColorChooser.cmykYellow.textAndMnemonic=Yellow
+ColorChooser.cmykBlack.textAndMnemonic=Black
+ColorChooser.cmykAlpha.textAndMnemonic=Alpha
+
+############ OPTION PANE STRINGS #############
+# We only define mnemonics for YES/NO, but for completeness you can
+# define mnemonics for any of the buttons.
+OptionPane.yesButton.textAndMnemonic=&Yes
+OptionPane.noButton.textAndMnemonic=&No
+OptionPane.okButton.textAndMnemonic=OK
+#OptionPane.okButtonMnemonic=0
+OptionPane.cancelButton.textAndMnemonic=Cancel
+#OptionPane.cancelButtonMnemonic=0
+OptionPane.title.textAndMnemonic=Select an Option
+# Title for the dialog for the showInputDialog methods. Only used if
+# the developer uses one of the variants that doesn't take a title.
+OptionPane.inputDialog.titleAndMnemonic=Input
+# Title for the dialog for the showMessageDialog methods. Only used if
+# the developer uses one of the variants that doesn't take a title.
+OptionPane.messageDialog.titleAndMnemonic=Message
+
+############ Printing Dialog Strings ############
+PrintingDialog.titleProgress.textAndMnemonic=Printing
+PrintingDialog.titleAborting.textAndMnemonic=Printing (Aborting)
+
+PrintingDialog.contentInitial.textAndMnemonic=Printing in progress...
+
+# The following string will be formatted by a MessageFormat
+# and {0} will be replaced by page number being printed
+PrintingDialog.contentProgress.textAndMnemonic=Printed page {0}...
+
+PrintingDialog.contentAborting.textAndMnemonic=Printing aborting...
+
+PrintingDialog.abortButton.textAndMnemonic=&Abort
+PrintingDialog.abortButtonToolTip.textAndMnemonic=Abort Printing
+
+############ Internal Frame Strings ############
+InternalFrame.iconButtonToolTip=Minimize
+InternalFrame.maxButtonToolTip=Maximize
+InternalFrame.restoreButtonToolTip=Restore
+InternalFrame.closeButtonToolTip=Close
+
+############ Internal Frame Title Pane Strings ############
+InternalFrameTitlePane.restoreButton.textAndMnemonic=Restore
+InternalFrameTitlePane.moveButton.textAndMnemonic=Move
+InternalFrameTitlePane.sizeButton.textAndMnemonic=Size
+InternalFrameTitlePane.minimizeButton.textAndMnemonic=Minimize
+InternalFrameTitlePane.maximizeButton.textAndMnemonic=Maximize
+InternalFrameTitlePane.closeButton.textAndMnemonic=Close
+
+############ Text strings #############
+# Used for html forms
+FormView.submitButton.textAndMnemonic=Submit Query
+FormView.resetButton.textAndMnemonic=Reset
+FormView.browseFileButton.textAndMnemonic=Browse...
+
+############ Abstract Document Strings ############
+AbstractDocument.styleChange.textAndMnemonic=style change
+AbstractDocument.addition.textAndMnemonic=addition
+AbstractDocument.deletion.textAndMnemonic=deletion
+AbstractDocument.undo.textAndMnemonic=Undo
+AbstractDocument.redo.textAndMnemonic=Redo
+
+############ Abstract Button Strings ############
+AbstractButton.click.textAndMnemonic=click
+
+############ Abstract Undoable Edit Strings ############
+AbstractUndoableEdit.undo.textAndMnemonic=Undo
+AbstractUndoableEdit.redo.textAndMnemonic=Redo
+
+############ Combo Box Strings ############
+ComboBox.togglePopup.textAndMnemonic=togglePopup
+
+############ Progress Monitor Strings ############
+ProgressMonitor.progress.textAndMnemonic=Progress...
+
+############ Split Pane Strings ############
+SplitPane.leftButton.textAndMnemonic=left button
+SplitPane.rightButton.textAndMnemonic=right button
+# Used for Isindex
+IsindexView.prompt=This is a searchable index.  Enter search keywords:
+
+############ InternalFrameTitlePane Strings ############
+InternalFrameTitlePane.iconifyButtonAccessibleName=Iconify
+InternalFrameTitlePane.maximizeButtonAccessibleName=Maximize
+InternalFrameTitlePane.closeButtonAccessibleName=Close
--- a/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_de.properties	Mon Aug 06 13:31:40 2012 +0100
+++ b/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_de.properties	Mon Aug 06 14:20:32 2012 +0100
@@ -70,6 +70,9 @@
 FileChooser.helpButtonToolTip.textAndMnemonic=FileChooser-Hilfe
 FileChooser.directoryOpenButtonToolTip.textAndMnemonic=Ausgew\u00E4hltes Verzeichnis \u00F6ffnen
 
+FileChooser.filesListAccessibleName=Files List
+FileChooser.filesDetailsAccessibleName=Files Details
+
 ############ COLOR CHOOSER STRINGS #############
 ColorChooser.preview.textAndMnemonic=Vorschau
 ColorChooser.ok.textAndMnemonic=OK
--- a/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_es.properties	Mon Aug 06 13:31:40 2012 +0100
+++ b/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_es.properties	Mon Aug 06 14:20:32 2012 +0100
@@ -70,6 +70,9 @@
 FileChooser.helpButtonToolTip.textAndMnemonic=Ayuda del Selector de Archivos
 FileChooser.directoryOpenButtonToolTip.textAndMnemonic=Abrir directorio seleccionado
 
+FileChooser.filesListAccessibleName=Files List
+FileChooser.filesDetailsAccessibleName=Files Details
+
 ############ COLOR CHOOSER STRINGS #############
 ColorChooser.preview.textAndMnemonic=Vista Previa
 ColorChooser.ok.textAndMnemonic=Aceptar
--- a/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_fr.properties	Mon Aug 06 13:31:40 2012 +0100
+++ b/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_fr.properties	Mon Aug 06 14:20:32 2012 +0100
@@ -70,6 +70,9 @@
 FileChooser.helpButtonToolTip.textAndMnemonic=Aide du s\u00E9lecteur de fichiers
 FileChooser.directoryOpenButtonToolTip.textAndMnemonic=Ouvre le r\u00E9pertoire s\u00E9lectionn\u00E9
 
+FileChooser.filesListAccessibleName=Files List
+FileChooser.filesDetailsAccessibleName=Files Details
+
 ############ COLOR CHOOSER STRINGS #############
 ColorChooser.preview.textAndMnemonic=Aper\u00E7u
 ColorChooser.ok.textAndMnemonic=OK
--- a/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_it.properties	Mon Aug 06 13:31:40 2012 +0100
+++ b/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_it.properties	Mon Aug 06 14:20:32 2012 +0100
@@ -70,6 +70,9 @@
 FileChooser.helpButtonToolTip.textAndMnemonic=Guida FileChooser
 FileChooser.directoryOpenButtonToolTip.textAndMnemonic=Apre la directory selezionata
 
+FileChooser.filesListAccessibleName=Files List
+FileChooser.filesDetailsAccessibleName=Files Details
+
 ############ COLOR CHOOSER STRINGS #############
 ColorChooser.preview.textAndMnemonic=Anteprima
 ColorChooser.ok.textAndMnemonic=OK
--- a/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_ja.properties	Mon Aug 06 13:31:40 2012 +0100
+++ b/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_ja.properties	Mon Aug 06 14:20:32 2012 +0100
@@ -70,6 +70,9 @@
 FileChooser.helpButtonToolTip.textAndMnemonic=FileChooser\u306E\u30D8\u30EB\u30D7\u3067\u3059
 FileChooser.directoryOpenButtonToolTip.textAndMnemonic=\u9078\u629E\u3057\u305F\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3092\u958B\u304D\u307E\u3059
 
+FileChooser.filesListAccessibleName=Files List
+FileChooser.filesDetailsAccessibleName=Files Details
+
 ############ COLOR CHOOSER STRINGS #############
 ColorChooser.preview.textAndMnemonic=\u30D7\u30EC\u30D3\u30E5\u30FC
 ColorChooser.ok.textAndMnemonic=OK
--- a/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_ko.properties	Mon Aug 06 13:31:40 2012 +0100
+++ b/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_ko.properties	Mon Aug 06 14:20:32 2012 +0100
@@ -70,6 +70,9 @@
 FileChooser.helpButtonToolTip.textAndMnemonic=FileChooser \uB3C4\uC6C0\uB9D0
 FileChooser.directoryOpenButtonToolTip.textAndMnemonic=\uC120\uD0DD\uB41C \uB514\uB809\uD1A0\uB9AC \uC5F4\uAE30
 
+FileChooser.filesListAccessibleName=Files List
+FileChooser.filesDetailsAccessibleName=Files Details
+
 ############ COLOR CHOOSER STRINGS #############
 ColorChooser.preview.textAndMnemonic=\uBBF8\uB9AC\uBCF4\uAE30
 ColorChooser.ok.textAndMnemonic=\uD655\uC778
--- a/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_pt_BR.properties	Mon Aug 06 13:31:40 2012 +0100
+++ b/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_pt_BR.properties	Mon Aug 06 14:20:32 2012 +0100
@@ -70,6 +70,9 @@
 FileChooser.helpButtonToolTip.textAndMnemonic=Ajuda do FileChooser
 FileChooser.directoryOpenButtonToolTip.textAndMnemonic=Abrir diret\u00F3rio selecionado
 
+FileChooser.filesListAccessibleName=Files List
+FileChooser.filesDetailsAccessibleName=Files Details
+
 ############ COLOR CHOOSER STRINGS #############
 ColorChooser.preview.textAndMnemonic=Visualizar
 ColorChooser.ok.textAndMnemonic=OK
--- a/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_sv.properties	Mon Aug 06 13:31:40 2012 +0100
+++ b/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_sv.properties	Mon Aug 06 14:20:32 2012 +0100
@@ -70,6 +70,9 @@
 FileChooser.helpButtonToolTip.textAndMnemonic=Hj\u00E4lp - Filv\u00E4ljare
 FileChooser.directoryOpenButtonToolTip.textAndMnemonic=\u00D6ppna vald katalog
 
+FileChooser.filesListAccessibleName=Files List
+FileChooser.filesDetailsAccessibleName=Files Details
+
 ############ COLOR CHOOSER STRINGS #############
 ColorChooser.preview.textAndMnemonic=Granska
 ColorChooser.ok.textAndMnemonic=OK
--- a/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_zh_CN.properties	Mon Aug 06 13:31:40 2012 +0100
+++ b/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_zh_CN.properties	Mon Aug 06 14:20:32 2012 +0100
@@ -70,6 +70,9 @@
 FileChooser.helpButtonToolTip.textAndMnemonic=FileChooser \u5E2E\u52A9
 FileChooser.directoryOpenButtonToolTip.textAndMnemonic=\u6253\u5F00\u9009\u62E9\u7684\u76EE\u5F55
 
+FileChooser.filesListAccessibleName=Files List
+FileChooser.filesDetailsAccessibleName=Files Details
+
 ############ COLOR CHOOSER STRINGS #############
 ColorChooser.preview.textAndMnemonic=\u9884\u89C8
 ColorChooser.ok.textAndMnemonic=\u786E\u5B9A
--- a/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_zh_TW.properties	Mon Aug 06 13:31:40 2012 +0100
+++ b/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_zh_TW.properties	Mon Aug 06 14:20:32 2012 +0100
@@ -70,6 +70,9 @@
 FileChooser.helpButtonToolTip.textAndMnemonic=\u300C\u6A94\u6848\u9078\u64C7\u5668\u300D\u8AAA\u660E
 FileChooser.directoryOpenButtonToolTip.textAndMnemonic=\u958B\u555F\u9078\u53D6\u7684\u76EE\u9304
 
+FileChooser.filesListAccessibleName=Files List
+FileChooser.filesDetailsAccessibleName=Files Details
+
 ############ COLOR CHOOSER STRINGS #############
 ColorChooser.preview.textAndMnemonic=\u9810\u89BD
 ColorChooser.ok.textAndMnemonic=\u78BA\u5B9A
--- a/src/share/classes/java/net/InMemoryCookieStore.java	Mon Aug 06 13:31:40 2012 +0100
+++ b/src/share/classes/java/net/InMemoryCookieStore.java	Mon Aug 06 14:20:32 2012 +0100
@@ -91,8 +91,10 @@
                 if (cookie.getDomain() != null) {
                     addIndex(domainIndex, cookie.getDomain(), cookie);
                 }
-                // add it to uri index, too
-                addIndex(uriIndex, getEffectiveURI(uri), cookie);
+                if (uri != null) {
+                    // add it to uri index, too
+                    addIndex(uriIndex, getEffectiveURI(uri), cookie);
+                }
             }
         } finally {
             lock.unlock();
--- a/src/share/classes/java/util/concurrent/PriorityBlockingQueue.java	Mon Aug 06 13:31:40 2012 +0100
+++ b/src/share/classes/java/util/concurrent/PriorityBlockingQueue.java	Mon Aug 06 14:20:32 2012 +0100
@@ -35,7 +35,8 @@
 
 package java.util.concurrent;
 
-import java.util.concurrent.locks.*;
+import java.util.concurrent.locks.Condition;
+import java.util.concurrent.locks.ReentrantLock;
 import java.util.*;
 
 /**
@@ -110,7 +111,7 @@
      * java.util.PriorityQueue operations within a lock, as was done
      * in a previous version of this class. To maintain
      * interoperability, a plain PriorityQueue is still used during
-     * serialization, which maintains compatibility at the espense of
+     * serialization, which maintains compatibility at the expense of
      * transiently doubling overhead.
      */
 
@@ -307,14 +308,13 @@
     /**
      * Mechanics for poll().  Call only while holding lock.
      */
-    private E extract() {
-        E result;
+    private E dequeue() {
         int n = size - 1;
         if (n < 0)
-            result = null;
+            return null;
         else {
             Object[] array = queue;
-            result = (E) array[0];
+            E result = (E) array[0];
             E x = (E) array[n];
             array[n] = null;
             Comparator<? super E> cmp = comparator;
@@ -323,8 +323,8 @@
             else
                 siftDownUsingComparator(0, x, array, n, cmp);
             size = n;
+            return result;
         }
-        return result;
     }
 
     /**
@@ -381,39 +381,43 @@
      */
     private static <T> void siftDownComparable(int k, T x, Object[] array,
                                                int n) {
-        Comparable<? super T> key = (Comparable<? super T>)x;
-        int half = n >>> 1;           // loop while a non-leaf
-        while (k < half) {
-            int child = (k << 1) + 1; // assume left child is least
-            Object c = array[child];
-            int right = child + 1;
-            if (right < n &&
-                ((Comparable<? super T>) c).compareTo((T) array[right]) > 0)
-                c = array[child = right];
-            if (key.compareTo((T) c) <= 0)
-                break;
-            array[k] = c;
-            k = child;
+        if (n > 0) {
+            Comparable<? super T> key = (Comparable<? super T>)x;
+            int half = n >>> 1;           // loop while a non-leaf
+            while (k < half) {
+                int child = (k << 1) + 1; // assume left child is least
+                Object c = array[child];
+                int right = child + 1;
+                if (right < n &&
+                    ((Comparable<? super T>) c).compareTo((T) array[right]) > 0)
+                    c = array[child = right];
+                if (key.compareTo((T) c) <= 0)
+                    break;
+                array[k] = c;
+                k = child;
+            }
+            array[k] = key;
         }
-        array[k] = key;
     }
 
     private static <T> void siftDownUsingComparator(int k, T x, Object[] array,
                                                     int n,
                                                     Comparator<? super T> cmp) {
-        int half = n >>> 1;
-        while (k < half) {
-            int child = (k << 1) + 1;
-            Object c = array[child];
-            int right = child + 1;
-            if (right < n && cmp.compare((T) c, (T) array[right]) > 0)
-                c = array[child = right];
-            if (cmp.compare(x, (T) c) <= 0)
-                break;
-            array[k] = c;
-            k = child;
+        if (n > 0) {
+            int half = n >>> 1;
+            while (k < half) {
+                int child = (k << 1) + 1;
+                Object c = array[child];
+                int right = child + 1;
+                if (right < n && cmp.compare((T) c, (T) array[right]) > 0)
+                    c = array[child = right];
+                if (cmp.compare(x, (T) c) <= 0)
+                    break;
+                array[k] = c;
+                k = child;
+            }
+            array[k] = x;
         }
-        array[k] = x;
     }
 
     /**
@@ -519,13 +523,11 @@
     public E poll() {
         final ReentrantLock lock = this.lock;
         lock.lock();
-        E result;
         try {
-            result = extract();
+            return dequeue();
         } finally {
             lock.unlock();
         }
-        return result;
     }
 
     public E take() throws InterruptedException {
@@ -533,7 +535,7 @@
         lock.lockInterruptibly();
         E result;
         try {
-            while ( (result = extract()) == null)
+            while ( (result = dequeue()) == null)
                 notEmpty.await();
         } finally {
             lock.unlock();
@@ -547,7 +549,7 @@
         lock.lockInterruptibly();
         E result;
         try {
-            while ( (result = extract()) == null && nanos > 0)
+            while ( (result = dequeue()) == null && nanos > 0)
                 nanos = notEmpty.awaitNanos(nanos);
         } finally {
             lock.unlock();
@@ -558,13 +560,11 @@
     public E peek() {
         final ReentrantLock lock = this.lock;
         lock.lock();
-        E result;
         try {
-            result = size > 0 ? (E) queue[0] : null;
+            return (size == 0) ? null : (E) queue[0];
         } finally {
             lock.unlock();
         }
-        return result;
     }
 
     /**
@@ -648,32 +648,28 @@
      * @return {@code true} if this queue changed as a result of the call
      */
     public boolean remove(Object o) {
-        boolean removed = false;
         final ReentrantLock lock = this.lock;
         lock.lock();
         try {
             int i = indexOf(o);
-            if (i != -1) {
-                removeAt(i);
-                removed = true;
-            }
+            if (i == -1)
+                return false;
+            removeAt(i);
+            return true;
         } finally {
             lock.unlock();
         }
-        return removed;
     }
 
-
     /**
      * Identity-based version for use in Itr.remove
      */
-    private void removeEQ(Object o) {
+    void removeEQ(Object o) {
         final ReentrantLock lock = this.lock;
         lock.lock();
         try {
             Object[] array = queue;
-            int n = size;
-            for (int i = 0; i < n; i++) {
+            for (int i = 0, n = size; i < n; i++) {
                 if (o == array[i]) {
                     removeAt(i);
                     break;
@@ -693,15 +689,13 @@
      * @return {@code true} if this queue contains the specified element
      */
     public boolean contains(Object o) {
-        int index;
         final ReentrantLock lock = this.lock;
         lock.lock();
         try {
-            index = indexOf(o);
+            return indexOf(o) != -1;
         } finally {
             lock.unlock();
         }
-        return index != -1;
     }
 
     /**
@@ -727,7 +721,6 @@
         }
     }
 
-
     public String toString() {
         final ReentrantLock lock = this.lock;
         lock.lock();
@@ -738,7 +731,7 @@
             StringBuilder sb = new StringBuilder();
             sb.append('[');
             for (int i = 0; i < n; ++i) {
-                E e = (E)queue[i];
+                Object e = queue[i];
                 sb.append(e == this ? "(this Collection)" : e);
                 if (i != n - 1)
                     sb.append(',').append(' ');
@@ -756,23 +749,7 @@
      * @throws IllegalArgumentException      {@inheritDoc}
      */
     public int drainTo(Collection<? super E> c) {
-        if (c == null)
-            throw new NullPointerException();
-        if (c == this)
-            throw new IllegalArgumentException();
-        final ReentrantLock lock = this.lock;
-        lock.lock();
-        try {
-            int n = 0;
-            E e;
-            while ( (e = extract()) != null) {
-                c.add(e);
-                ++n;
-            }
-            return n;
-        } finally {
-            lock.unlock();
-        }
+        return drainTo(c, Integer.MAX_VALUE);
     }
 
     /**
@@ -791,11 +768,10 @@
         final ReentrantLock lock = this.lock;
         lock.lock();
         try {
-            int n = 0;
-            E e;
-            while (n < maxElements && (e = extract()) != null) {
-                c.add(e);
-                ++n;
+            int n = Math.min(size, maxElements);
+            for (int i = 0; i < n; i++) {
+                c.add((E) queue[0]); // In this order, in case add() throws.
+                dequeue();
             }
             return n;
         } finally {
@@ -843,8 +819,7 @@
      * The following code can be used to dump the queue into a newly
      * allocated array of {@code String}:
      *
-     * <pre>
-     *     String[] y = x.toArray(new String[0]);</pre>
+     *  <pre> {@code String[] y = x.toArray(new String[0]);}</pre>
      *
      * Note that {@code toArray(new Object[0])} is identical in function to
      * {@code toArray()}.
@@ -897,7 +872,7 @@
      */
     final class Itr implements Iterator<E> {
         final Object[] array; // Array of all elements
-        int cursor;           // index of next element to return;
+        int cursor;           // index of next element to return
         int lastRet;          // index of last element, or -1 if no such
 
         Itr(Object[] array) {
@@ -925,17 +900,18 @@
     }
 
     /**
-     * Saves the state to a stream (that is, serializes it).  For
-     * compatibility with previous version of this class,
-     * elements are first copied to a java.util.PriorityQueue,
-     * which is then serialized.
+     * Saves this queue to a stream (that is, serializes it).
+     *
+     * For compatibility with previous version of this class, elements
+     * are first copied to a java.util.PriorityQueue, which is then
+     * serialized.
      */
     private void writeObject(java.io.ObjectOutputStream s)
         throws java.io.IOException {
         lock.lock();
         try {
-            int n = size; // avoid zero capacity argument
-            q = new PriorityQueue<E>(n == 0 ? 1 : n, comparator);
+            // avoid zero capacity argument
+            q = new PriorityQueue<E>(Math.max(size, 1), comparator);
             q.addAll(this);
             s.defaultWriteObject();
         } finally {
@@ -945,10 +921,7 @@
     }
 
     /**
-     * Reconstitutes the {@code PriorityBlockingQueue} instance from a stream
-     * (that is, deserializes it).
-     *
-     * @param s the stream
+     * Reconstitutes this queue from a stream (that is, deserializes it).
      */
     private void readObject(java.io.ObjectInputStream s)
         throws java.io.IOException, ClassNotFoundException {
--- a/src/share/classes/javax/swing/text/DefaultCaret.java	Mon Aug 06 13:31:40 2012 +0100
+++ b/src/share/classes/javax/swing/text/DefaultCaret.java	Mon Aug 06 14:20:32 2012 +0100
@@ -403,6 +403,10 @@
      * @see MouseListener#mouseClicked
      */
     public void mouseClicked(MouseEvent e) {
+        if (getComponent() == null) {
+            return;
+        }
+
         int nclicks = SwingUtilities2.getAdjustedClickCount(getComponent(), e);
 
         if (! e.isConsumed()) {
--- a/src/share/classes/sun/awt/SunToolkit.java	Mon Aug 06 13:31:40 2012 +0100
+++ b/src/share/classes/sun/awt/SunToolkit.java	Mon Aug 06 14:20:32 2012 +0100
@@ -2096,25 +2096,41 @@
     private EventQueueItem queueTail = null;
     private final EventQueue eventQueue;
 
+    // For the case when queue is cleared but events are not posted
+    private volatile boolean isFlushing = false;
+
     PostEventQueue(EventQueue eq) {
         eventQueue = eq;
     }
 
     public synchronized boolean noEvents() {
-        return queueHead == null;
+        return queueHead == null && !isFlushing;
     }
 
     /*
      * Continually post pending AWTEvents to the Java EventQueue. The method
      * is synchronized to ensure the flush is completed before a new event
      * can be posted to this queue.
+     *
+     * 7177040: The method couldn't be wholly synchronized because of calls
+     * of EventQueue.postEvent() that uses pushPopLock, otherwise it could
+     * potentially lead to deadlock
      */
-    public synchronized void flush() {
-        EventQueueItem tempQueue = queueHead;
-        queueHead = queueTail = null;
-        while (tempQueue != null) {
-            eventQueue.postEvent(tempQueue.event);
-            tempQueue = tempQueue.next;
+    public void flush() {
+        EventQueueItem tempQueue;
+        synchronized (this) {
+            tempQueue = queueHead;
+            queueHead = queueTail = null;
+            isFlushing = (tempQueue != null);
+        }
+        try {
+            while (tempQueue != null) {
+                eventQueue.postEvent(tempQueue.event);
+                tempQueue = tempQueue.next;
+            }
+        }
+        finally {
+            isFlushing = false;
         }
     }
 
--- a/src/share/classes/sun/nio/ch/DatagramChannelImpl.java	Mon Aug 06 13:31:40 2012 +0100
+++ b/src/share/classes/sun/nio/ch/DatagramChannelImpl.java	Mon Aug 06 14:20:32 2012 +0100
@@ -749,7 +749,8 @@
                     if (sm != null)
                         sm.checkConnect(isa.getAddress().getHostAddress(),
                                         isa.getPort());
-                    disconnect0(fd);
+                    boolean isIPv6 = (family == StandardProtocolFamily.INET6);
+                    disconnect0(fd, isIPv6);
                     remoteAddress = null;
                     state = ST_UNCONNECTED;
 
@@ -1084,7 +1085,7 @@
 
     private static native void initIDs();
 
-    private static native void disconnect0(FileDescriptor fd)
+    private static native void disconnect0(FileDescriptor fd, boolean isIPv6)
         throws IOException;
 
     private native int receive0(FileDescriptor fd, long address, int len,
--- a/src/share/classes/sun/nio/ch/IOUtil.java	Mon Aug 06 13:31:40 2012 +0100
+++ b/src/share/classes/sun/nio/ch/IOUtil.java	Mon Aug 06 14:20:32 2012 +0100
@@ -36,6 +36,11 @@
 
 class IOUtil {
 
+    /**
+     * Max number of iovec structures that readv/writev supports
+     */
+    static final int IOV_MAX;
+
     private IOUtil() { }                // No instantiation
 
     static int write(FileDescriptor fd, ByteBuffer src, long position,
@@ -111,7 +116,8 @@
 
             // Iterate over buffers to populate native iovec array.
             int count = offset + length;
-            for (int i=offset; i<count; i++) {
+            int i = offset;
+            while (i < count && iov_len < IOV_MAX) {
                 ByteBuffer buf = bufs[i];
                 int pos = buf.position();
                 int lim = buf.limit();
@@ -135,6 +141,7 @@
                     vec.putLen(iov_len, rem);
                     iov_len++;
                 }
+                i++;
             }
             if (iov_len == 0)
                 return 0L;
@@ -240,7 +247,8 @@
 
             // Iterate over buffers to populate native iovec array.
             int count = offset + length;
-            for (int i=offset; i<count; i++) {
+            int i = offset;
+            while (i < count && iov_len < IOV_MAX) {
                 ByteBuffer buf = bufs[i];
                 if (buf.isReadOnly())
                     throw new IllegalArgumentException("Read-only buffer");
@@ -264,6 +272,7 @@
                     vec.putLen(iov_len, rem);
                     iov_len++;
                 }
+                i++;
             }
             if (iov_len == 0)
                 return 0L;
@@ -333,11 +342,14 @@
 
     static native void setfdVal(FileDescriptor fd, int value);
 
+    static native int iovMax();
+
     static native void initIDs();
 
     static {
         // Note that IOUtil.initIDs is called from within Util.load.
         Util.load();
+        IOV_MAX = iovMax();
     }
 
 }
--- a/src/share/classes/sun/nio/ch/Util.java	Mon Aug 06 13:31:40 2012 +0100
+++ b/src/share/classes/sun/nio/ch/Util.java	Mon Aug 06 14:20:32 2012 +0100
@@ -45,7 +45,7 @@
     // -- Caches --
 
     // The number of temp buffers in our pool
-    private static final int TEMP_BUF_POOL_SIZE = 8;
+    private static final int TEMP_BUF_POOL_SIZE = IOUtil.IOV_MAX;
 
     // Per-thread cache of temporary direct buffers
     private static ThreadLocal<BufferCache> bufferCache =
--- a/src/share/classes/sun/swing/FilePane.java	Mon Aug 06 13:31:40 2012 +0100
+++ b/src/share/classes/sun/swing/FilePane.java	Mon Aug 06 14:20:32 2012 +0100
@@ -35,6 +35,7 @@
 import java.util.List;
 import java.util.concurrent.Callable;
 
+import javax.accessibility.AccessibleContext;
 import javax.swing.*;
 import javax.swing.border.*;
 import javax.swing.event.*;
@@ -82,6 +83,9 @@
     private JPanel currentViewPanel;
     private String[] viewTypeActionNames;
 
+    private String filesListAccessibleName = null;
+    private String filesDetailsAccessibleName = null;
+
     private JPopupMenu contextMenu;
     private JMenu viewMenu;
 
@@ -450,6 +454,9 @@
         gigaByteString = UIManager.getString("FileChooser.fileSizeGigaBytes", l);
         fullRowSelection = UIManager.getBoolean("FileView.fullRowSelection");
 
+        filesListAccessibleName = UIManager.getString("FileChooser.filesListAccessibleName", l);
+        filesDetailsAccessibleName = UIManager.getString("FileChooser.filesDetailsAccessibleName", l);
+
         renameErrorTitleText = UIManager.getString("FileChooser.renameErrorTitleText", l);
         renameErrorText = UIManager.getString("FileChooser.renameErrorText", l);
         renameErrorFileExistsText = UIManager.getString("FileChooser.renameErrorFileExistsText", l);
@@ -634,6 +641,9 @@
         if (listViewBorder != null) {
             scrollpane.setBorder(listViewBorder);
         }
+
+        list.putClientProperty(AccessibleContext.ACCESSIBLE_NAME_PROPERTY, filesListAccessibleName);
+
         p.add(scrollpane, BorderLayout.CENTER);
         return p;
     }
@@ -1228,6 +1238,8 @@
 
         detailsTableModel.fireTableStructureChanged();
 
+        detailsTable.putClientProperty(AccessibleContext.ACCESSIBLE_NAME_PROPERTY, filesDetailsAccessibleName);
+
         return p;
     } // createDetailsView
 
--- a/src/share/native/sun/awt/medialib/mlib_types.h	Mon Aug 06 13:31:40 2012 +0100
+++ b/src/share/native/sun/awt/medialib/mlib_types.h	Mon Aug 06 14:20:32 2012 +0100
@@ -59,16 +59,8 @@
 
 #if defined(__SUNPRO_C) || defined(__SUNPRO_CC) || defined(__GNUC__)
 
-#if defined(MACOSX)
 #include <stddef.h>                     /* for ptrdiff_t */
 #include <stdint.h>                     /* for uintptr_t */
-#elif defined(__linux__)
-#include <stdint.h>                     /* for uintptr_t */
-#include <malloc.h>                     /* for ptrdiff_t */
-#else
-#include <link.h>                       /* for uintptr_t */
-#include <stddef.h>                     /* for ptrdiff_t */
-#endif  /* __linux__ */
 
 #if defined(MLIB_OS64BIT) || (defined(MACOSX) && defined(_LP64))
 
--- a/src/solaris/classes/sun/awt/X11/XTextAreaPeer.java	Mon Aug 06 13:31:40 2012 +0100
+++ b/src/solaris/classes/sun/awt/X11/XTextAreaPeer.java	Mon Aug 06 14:20:32 2012 +0100
@@ -105,7 +105,6 @@
         this.target = target;
 
         //ComponentAccessor.enableEvents(target,AWTEvent.MOUSE_WHEEL_EVENT_MASK);
-        target.enableInputMethods(true);
 
         firstChangeSkipped = false;
         String text = ((TextArea)target).getText();
@@ -113,7 +112,6 @@
         jtext.setWrapStyleWord(true);
         jtext.getDocument().addDocumentListener(jtext);
         XToolkit.specialPeerMap.put(jtext,this);
-        jtext.enableInputMethods(true);
         textPane = new AWTTextPane(jtext,this, target.getParent());
 
         setBounds(x, y, width, height, SET_BOUNDS);
--- a/src/solaris/classes/sun/awt/X11/XTextFieldPeer.java	Mon Aug 06 13:31:40 2012 +0100
+++ b/src/solaris/classes/sun/awt/X11/XTextFieldPeer.java	Mon Aug 06 14:20:32 2012 +0100
@@ -73,8 +73,6 @@
         xtext = new XAWTTextField(text,this, target.getParent());
         xtext.getDocument().addDocumentListener(xtext);
         xtext.setCursor(target.getCursor());
-        target.enableInputMethods(true);
-        xtext.enableInputMethods(true);
         XToolkit.specialPeerMap.put(xtext,this);
 
         TextField txt = (TextField) target;
--- a/src/solaris/classes/sun/nio/fs/LinuxUserDefinedFileAttributeView.java	Mon Aug 06 13:31:40 2012 +0100
+++ b/src/solaris/classes/sun/nio/fs/LinuxUserDefinedFileAttributeView.java	Mon Aug 06 14:20:32 2012 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2012, 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
@@ -55,7 +55,7 @@
         name = USER_NAMESPACE + name;
         byte[] bytes = name.getBytes();
         if (bytes.length > XATTR_NAME_MAX) {
-            throw new FileSystemException(file.getPathForExecptionMessage(),
+            throw new FileSystemException(file.getPathForExceptionMessage(),
                 null, "'" + name + "' is too big");
         }
         return bytes;
@@ -116,7 +116,7 @@
                         buffer = NativeBuffers.getNativeBuffer(size);
                         continue;
                     }
-                    throw new FileSystemException(file.getPathForExecptionMessage(),
+                    throw new FileSystemException(file.getPathForExceptionMessage(),
                         null, "Unable to get list of extended attributes: " +
                         x.getMessage());
                 }
@@ -138,7 +138,7 @@
             // fgetxattr returns size if called with size==0
             return fgetxattr(fd, nameAsBytes(file,name), 0L, 0);
         } catch (UnixException x) {
-            throw new FileSystemException(file.getPathForExecptionMessage(),
+            throw new FileSystemException(file.getPathForExceptionMessage(),
                 null, "Unable to get size of extended attribute '" + name +
                 "': " + x.getMessage());
         } finally {
@@ -191,7 +191,7 @@
             } catch (UnixException x) {
                 String msg = (x.errno() == ERANGE) ?
                     "Insufficient space in buffer" : x.getMessage();
-                throw new FileSystemException(file.getPathForExecptionMessage(),
+                throw new FileSystemException(file.getPathForExceptionMessage(),
                     null, "Error reading extended attribute '" + name + "': " + msg);
             } finally {
                 close(fd);
@@ -243,7 +243,7 @@
                 src.position(pos + rem);
                 return rem;
             } catch (UnixException x) {
-                throw new FileSystemException(file.getPathForExecptionMessage(),
+                throw new FileSystemException(file.getPathForExceptionMessage(),
                     null, "Error writing extended attribute '" + name + "': " +
                     x.getMessage());
             } finally {
@@ -264,7 +264,7 @@
         try {
             fremovexattr(fd, nameAsBytes(file,name));
         } catch (UnixException x) {
-            throw new FileSystemException(file.getPathForExecptionMessage(),
+            throw new FileSystemException(file.getPathForExceptionMessage(),
                 null, "Unable to delete extended attribute '" + name + "': " + x.getMessage());
         } finally {
             close(fd);
--- a/src/solaris/classes/sun/nio/fs/LinuxWatchService.java	Mon Aug 06 13:31:40 2012 +0100
+++ b/src/solaris/classes/sun/nio/fs/LinuxWatchService.java	Mon Aug 06 14:20:32 2012 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2012, 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
@@ -243,7 +243,7 @@
                 return x.asIOException(dir);
             }
             if (!attrs.isDirectory()) {
-                return new NotDirectoryException(dir.getPathForExecptionMessage());
+                return new NotDirectoryException(dir.getPathForExceptionMessage());
             }
 
             // register with inotify (replaces existing mask if already registered)
--- a/src/solaris/classes/sun/nio/fs/SolarisAclFileAttributeView.java	Mon Aug 06 13:31:40 2012 +0100
+++ b/src/solaris/classes/sun/nio/fs/SolarisAclFileAttributeView.java	Mon Aug 06 14:20:32 2012 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2012, 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
@@ -324,7 +324,7 @@
                 return decode(address, n);
             } catch (UnixException x) {
                 if ((x.errno() == ENOSYS) || !isAclsEnabled(fd)) {
-                    throw new FileSystemException(file.getPathForExecptionMessage(),
+                    throw new FileSystemException(file.getPathForExceptionMessage(),
                         null, x.getMessage() + " (file system does not support NFSv4 ACLs)");
                 }
                 x.rethrowAsIOException(file);
@@ -355,7 +355,7 @@
                 facl(fd, ACE_SETACL, n, address);
             } catch (UnixException x) {
                 if ((x.errno() == ENOSYS) || !isAclsEnabled(fd)) {
-                    throw new FileSystemException(file.getPathForExecptionMessage(),
+                    throw new FileSystemException(file.getPathForExceptionMessage(),
                         null, x.getMessage() + " (file system does not support NFSv4 ACLs)");
                 }
                 if (x.errno() == EINVAL && (n < 3))
--- a/src/solaris/classes/sun/nio/fs/SolarisUserDefinedFileAttributeView.java	Mon Aug 06 13:31:40 2012 +0100
+++ b/src/solaris/classes/sun/nio/fs/SolarisUserDefinedFileAttributeView.java	Mon Aug 06 14:20:32 2012 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2012, 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
@@ -49,7 +49,7 @@
             if (bytes.length <= 1 ||
                 (bytes.length == 2 && bytes[1] == '.'))
             {
-                throw new FileSystemException(file.getPathForExecptionMessage(),
+                throw new FileSystemException(file.getPathForExceptionMessage(),
                     null, "'" + name + "' is not a valid name");
             }
         }
@@ -96,7 +96,7 @@
                 }
                 return Collections.unmodifiableList(list);
             } catch (UnixException x) {
-                throw new FileSystemException(file.getPathForExecptionMessage(),
+                throw new FileSystemException(file.getPathForExceptionMessage(),
                     null, "Unable to get list of extended attributes: " +
                     x.getMessage());
             }
@@ -126,7 +126,7 @@
                     close(afd);
                 }
             } catch (UnixException x) {
-                throw new FileSystemException(file.getPathForExecptionMessage(),
+                throw new FileSystemException(file.getPathForExceptionMessage(),
                     null, "Unable to get size of extended attribute '" + name +
                     "': " + x.getMessage());
             }
@@ -165,7 +165,7 @@
                     fc.close();
                 }
             } catch (UnixException x) {
-                throw new FileSystemException(file.getPathForExecptionMessage(),
+                throw new FileSystemException(file.getPathForExceptionMessage(),
                     null, "Unable to read extended attribute '" + name +
                     "': " + x.getMessage());
             }
@@ -201,7 +201,7 @@
                     fc.close();
                 }
             } catch (UnixException x) {
-                throw new FileSystemException(file.getPathForExecptionMessage(),
+                throw new FileSystemException(file.getPathForExceptionMessage(),
                     null, "Unable to write extended attribute '" + name +
                     "': " + x.getMessage());
             }
@@ -224,7 +224,7 @@
                 close(dfd);
             }
         } catch (UnixException x) {
-            throw new FileSystemException(file.getPathForExecptionMessage(),
+            throw new FileSystemException(file.getPathForExceptionMessage(),
                 null, "Unable to delete extended attribute '" + name +
                 "': " + x.getMessage());
         } finally {
--- a/src/solaris/classes/sun/nio/fs/SolarisWatchService.java	Mon Aug 06 13:31:40 2012 +0100
+++ b/src/solaris/classes/sun/nio/fs/SolarisWatchService.java	Mon Aug 06 14:20:32 2012 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2012, 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
@@ -288,7 +288,7 @@
                 return x.asIOException(dir);
             }
             if (!attrs.isDirectory()) {
-                return new NotDirectoryException(dir.getPathForExecptionMessage());
+                return new NotDirectoryException(dir.getPathForExceptionMessage());
             }
 
             // return existing watch key after updating events if already
--- a/src/solaris/classes/sun/nio/fs/UnixChannelFactory.java	Mon Aug 06 13:31:40 2012 +0100
+++ b/src/solaris/classes/sun/nio/fs/UnixChannelFactory.java	Mon Aug 06 14:20:32 2012 +0100
@@ -36,8 +36,6 @@
 import sun.misc.SharedSecrets;
 import sun.misc.JavaIOFileDescriptorAccess;
 
-import com.sun.nio.file.ExtendedOpenOption;
-
 import static sun.nio.fs.UnixNativeDispatcher.*;
 import static sun.nio.fs.UnixConstants.*;
 
@@ -86,13 +84,13 @@
                     }
                     continue;
                 }
-                if (option == LinkOption.NOFOLLOW_LINKS) {
+                if (option == LinkOption.NOFOLLOW_LINKS && supportsNoFollowLinks()) {
                     flags.noFollowLinks = true;
                     continue;
                 }
                 if (option == null)
                     throw new NullPointerException();
-               throw new UnsupportedOperationException();
+               throw new UnsupportedOperationException(option + " not supported");
             }
             return flags;
         }
@@ -220,6 +218,15 @@
         // follow links by default
         boolean followLinks = true;
         if (!flags.createNew && (flags.noFollowLinks || flags.deleteOnClose)) {
+            if (flags.deleteOnClose && !supportsNoFollowLinks()) {
+                try {
+                    if (UnixFileAttributes.get(path, false).isSymbolicLink())
+                        throw new UnixException("DELETE_ON_CLOSE specified and file is a symbolic link");
+                } catch (UnixException x) {
+                    if (!flags.create || x.errno() != ENOENT)
+                        throw x;
+                }
+            }
             followLinks = false;
             oflags |= O_NOFOLLOW;
         }
--- a/src/solaris/classes/sun/nio/fs/UnixCopyFile.java	Mon Aug 06 13:31:40 2012 +0100
+++ b/src/solaris/classes/sun/nio/fs/UnixCopyFile.java	Mon Aug 06 14:20:32 2012 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2012, 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
@@ -383,8 +383,8 @@
             } catch (UnixException x) {
                 if (x.errno() == EXDEV) {
                     throw new AtomicMoveNotSupportedException(
-                        source.getPathForExecptionMessage(),
-                        target.getPathForExecptionMessage(),
+                        source.getPathForExceptionMessage(),
+                        target.getPathForExceptionMessage(),
                         x.errorString());
                 }
                 x.rethrowAsIOException(source, target);
@@ -420,7 +420,7 @@
                 return;  // nothing to do as files are identical
             if (!flags.replaceExisting) {
                 throw new FileAlreadyExistsException(
-                    target.getPathForExecptionMessage());
+                    target.getPathForExceptionMessage());
             }
 
             // attempt to delete target
@@ -436,7 +436,7 @@
                    (x.errno() == EEXIST || x.errno() == ENOTEMPTY))
                 {
                     throw new DirectoryNotEmptyException(
-                        target.getPathForExecptionMessage());
+                        target.getPathForExceptionMessage());
                 }
                 x.rethrowAsIOException(target);
             }
@@ -489,7 +489,7 @@
                 (x.errno() == EEXIST || x.errno() == ENOTEMPTY))
             {
                 throw new DirectoryNotEmptyException(
-                    source.getPathForExecptionMessage());
+                    source.getPathForExceptionMessage());
             }
             x.rethrowAsIOException(source);
         }
@@ -542,7 +542,7 @@
                 return;  // nothing to do as files are identical
             if (!flags.replaceExisting)
                 throw new FileAlreadyExistsException(
-                    target.getPathForExecptionMessage());
+                    target.getPathForExceptionMessage());
             try {
                 if (targetAttrs.isDirectory()) {
                     rmdir(target);
@@ -555,7 +555,7 @@
                    (x.errno() == EEXIST || x.errno() == ENOTEMPTY))
                 {
                     throw new DirectoryNotEmptyException(
-                        target.getPathForExecptionMessage());
+                        target.getPathForExceptionMessage());
                 }
                 x.rethrowAsIOException(target);
             }
--- a/src/solaris/classes/sun/nio/fs/UnixException.java	Mon Aug 06 13:31:40 2012 +0100
+++ b/src/solaris/classes/sun/nio/fs/UnixException.java	Mon Aug 06 14:20:32 2012 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2012, 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
@@ -97,8 +97,8 @@
     }
 
     void rethrowAsIOException(UnixPath file, UnixPath other) throws IOException {
-        String a = (file == null) ? null : file.getPathForExecptionMessage();
-        String b = (other == null) ? null : other.getPathForExecptionMessage();
+        String a = (file == null) ? null : file.getPathForExceptionMessage();
+        String b = (other == null) ? null : other.getPathForExceptionMessage();
         IOException x = translateToIOException(a, b);
         throw x;
     }
@@ -108,6 +108,6 @@
     }
 
     IOException asIOException(UnixPath file) {
-        return translateToIOException(file.getPathForExecptionMessage(), null);
+        return translateToIOException(file.getPathForExceptionMessage(), null);
     }
 }
--- a/src/solaris/classes/sun/nio/fs/UnixFileSystemProvider.java	Mon Aug 06 13:31:40 2012 +0100
+++ b/src/solaris/classes/sun/nio/fs/UnixFileSystemProvider.java	Mon Aug 06 14:20:32 2012 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2012, 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
@@ -238,7 +238,7 @@
             // DirectoryNotEmptyException if not empty
             if (attrs != null && attrs.isDirectory() &&
                 (x.errno() == EEXIST || x.errno() == ENOTEMPTY))
-                throw new DirectoryNotEmptyException(file.getPathForExecptionMessage());
+                throw new DirectoryNotEmptyException(file.getPathForExceptionMessage());
 
             x.rethrowAsIOException(file);
             return false;
@@ -395,13 +395,13 @@
 
         // can't return SecureDirectoryStream on kernels that don't support
         // openat, etc.
-        if (!supportsAtSysCalls()) {
+        if (!supportsAtSysCalls() || !supportsNoFollowLinks()) {
             try {
                 long ptr = opendir(dir);
                 return new UnixDirectoryStream(dir, ptr, filter);
             } catch (UnixException x) {
                 if (x.errno() == ENOTDIR)
-                    throw new NotDirectoryException(dir.getPathForExecptionMessage());
+                    throw new NotDirectoryException(dir.getPathForExceptionMessage());
                 x.rethrowAsIOException(dir);
             }
         }
@@ -421,7 +421,7 @@
             if (dfd2 != -1)
                 UnixNativeDispatcher.close(dfd2);
             if (x.errno() == UnixConstants.ENOTDIR)
-                throw new NotDirectoryException(dir.getPathForExecptionMessage());
+                throw new NotDirectoryException(dir.getPathForExceptionMessage());
             x.rethrowAsIOException(dir);
         }
         return new UnixSecureDirectoryStream(dir, dp, dfd2, filter);
@@ -490,7 +490,7 @@
             return new UnixPath(link.getFileSystem(), target);
         } catch (UnixException x) {
            if (x.errno() == UnixConstants.EINVAL)
-                throw new NotLinkException(link.getPathForExecptionMessage());
+                throw new NotLinkException(link.getPathForExceptionMessage());
             x.rethrowAsIOException(link);
             return null;    // keep compiler happy
         }
--- a/src/solaris/classes/sun/nio/fs/UnixNativeDispatcher.java	Mon Aug 06 13:31:40 2012 +0100
+++ b/src/solaris/classes/sun/nio/fs/UnixNativeDispatcher.java	Mon Aug 06 14:20:32 2012 +0100
@@ -548,6 +548,10 @@
         return hasAtSysCalls;
     }
 
+    static boolean supportsNoFollowLinks() {
+        return UnixConstants.O_NOFOLLOW != 0;
+    }
+
     // initialize syscalls and fieldIDs
     private static native int init();
 
--- a/src/solaris/classes/sun/nio/fs/UnixPath.java	Mon Aug 06 13:31:40 2012 +0100
+++ b/src/solaris/classes/sun/nio/fs/UnixPath.java	Mon Aug 06 14:20:32 2012 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2012, 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
@@ -179,7 +179,7 @@
     }
 
     // use this message when throwing exceptions
-    String getPathForExecptionMessage() {
+    String getPathForExceptionMessage() {
         return toString();
     }
 
@@ -767,8 +767,11 @@
     // package-private
     int openForAttributeAccess(boolean followLinks) throws IOException {
         int flags = O_RDONLY;
-        if (!followLinks)
+        if (!followLinks) {
+            if (!supportsNoFollowLinks())
+                throw new IOException("NOFOLLOW_LINKS is not supported on this platform");
             flags |= O_NOFOLLOW;
+        }
         try {
             return open(this, flags, 0);
         } catch (UnixException x) {
@@ -777,7 +780,7 @@
                 x.setError(ELOOP);
 
             if (x.errno() == ELOOP)
-                throw new FileSystemException(getPathForExecptionMessage(), null,
+                throw new FileSystemException(getPathForExceptionMessage(), null,
                     x.getMessage() + " or unable to access attributes of symbolic link");
 
             x.rethrowAsIOException(this);
--- a/src/solaris/native/java/net/Inet4AddressImpl.c	Mon Aug 06 13:31:40 2012 +0100
+++ b/src/solaris/native/java/net/Inet4AddressImpl.c	Mon Aug 06 14:20:32 2012 +0100
@@ -669,11 +669,11 @@
                  sizeof(struct sockaddr));
       if (n < 0 && errno != EINPROGRESS ) {
 #ifdef __linux__
-        if (errno != EINVAL)
+        if (errno != EINVAL && errno != EHOSTUNREACH)
           /*
            * On some Linuxes, when bound to the loopback interface, sendto
-           * will fail and errno will be set to EINVAL. When that happens,
-           * don't throw an exception, just return false.
+           * will fail and errno will be set to EINVAL or EHOSTUNREACH.
+           * When that happens, don't throw an exception, just return false.
            */
 #endif /*__linux__ */
           NET_ThrowNew(env, errno, "Can't send ICMP packet");
@@ -828,10 +828,11 @@
         case EADDRNOTAVAIL: /* address is not available on  the  remote machine */
 #ifdef __linux__
         case EINVAL:
+        case EHOSTUNREACH:
           /*
            * On some Linuxes, when bound to the loopback interface, connect
-           * will fail and errno will be set to EINVAL. When that happens,
-           * don't throw an exception, just return false.
+           * will fail and errno will be set to EINVAL or EHOSTUNREACH.
+           * When that happens, don't throw an exception, just return false.
            */
 #endif /* __linux__ */
           close(fd);
--- a/src/solaris/native/java/net/Inet6AddressImpl.c	Mon Aug 06 13:31:40 2012 +0100
+++ b/src/solaris/native/java/net/Inet6AddressImpl.c	Mon Aug 06 14:20:32 2012 +0100
@@ -512,11 +512,11 @@
       n = sendto(fd, sendbuf, plen, 0, (struct sockaddr*) him, sizeof(struct sockaddr_in6));
       if (n < 0 && errno != EINPROGRESS) {
 #ifdef __linux__
-        if (errno != EINVAL)
+        if (errno != EINVAL && errno != EHOSTUNREACH)
           /*
            * On some Linuxes, when bound to the loopback interface, sendto
-           * will fail and errno will be set to EINVAL. When that happens,
-           * don't throw an exception, just return false.
+           * will fail and errno will be set to EINVAL or EHOSTUNREACH.
+           * When that happens, don't throw an exception, just return false.
            */
 #endif /*__linux__ */
         NET_ThrowNew(env, errno, "Can't send ICMP packet");
@@ -680,10 +680,11 @@
         case EADDRNOTAVAIL: /* address is not available on  the  remote machine */
 #ifdef __linux__
         case EINVAL:
+        case EHOSTUNREACH:
           /*
            * On some Linuxes, when bound to the loopback interface, connect
-           * will fail and errno will be set to EINVAL. When that happens,
-           * don't throw an exception, just return false.
+           * will fail and errno will be set to EINVAL or EHOSTUNREACH.
+           * When that happens, don't throw an exception, just return false.
            */
 #endif /* __linux__ */
           close(fd);
--- a/src/solaris/native/sun/awt/splashscreen/splashscreen_config.h	Mon Aug 06 13:31:40 2012 +0100
+++ b/src/solaris/native/sun/awt/splashscreen/splashscreen_config.h	Mon Aug 06 14:20:32 2012 +0100
@@ -32,7 +32,7 @@
 #include <X11/Xutil.h>
 #include <X11/extensions/shape.h>
 #include <sys/types.h>
-#include <sys/unistd.h>
+#include <unistd.h>
 #include <pthread.h>
 #include <signal.h>
 #include <inttypes.h>
--- a/src/solaris/native/sun/nio/ch/DatagramChannelImpl.c	Mon Aug 06 13:31:40 2012 +0100
+++ b/src/solaris/native/sun/nio/ch/DatagramChannelImpl.c	Mon Aug 06 14:20:32 2012 +0100
@@ -77,7 +77,7 @@
 
 JNIEXPORT void JNICALL
 Java_sun_nio_ch_DatagramChannelImpl_disconnect0(JNIEnv *env, jobject this,
-                                                jobject fdo)
+                                                jobject fdo, jboolean isIPv6)
 {
     jint fd = fdval(env, fdo);
     int rv;
@@ -94,7 +94,7 @@
         memset(&sa, 0, sizeof(sa));
 
 #ifdef AF_INET6
-        if (ipv6_available()) {
+        if (isIPv6) {
             struct sockaddr_in6 *him6 = (struct sockaddr_in6 *)&sa;
 #if defined(_ALLBSD_SOURCE)
             him6->sin6_family = AF_INET6;
--- a/src/solaris/native/sun/nio/ch/FileDispatcherImpl.c	Mon Aug 06 13:31:40 2012 +0100
+++ b/src/solaris/native/sun/nio/ch/FileDispatcherImpl.c	Mon Aug 06 14:20:32 2012 +0100
@@ -94,9 +94,6 @@
 {
     jint fd = fdval(env, fdo);
     struct iovec *iov = (struct iovec *)jlong_to_ptr(address);
-    if (len > 16) {
-        len = 16;
-    }
     return convertLongReturnVal(env, readv(fd, iov, len), JNI_TRUE);
 }
 
@@ -126,9 +123,6 @@
 {
     jint fd = fdval(env, fdo);
     struct iovec *iov = (struct iovec *)jlong_to_ptr(address);
-    if (len > 16) {
-        len = 16;
-    }
     return convertLongReturnVal(env, writev(fd, iov, len), JNI_FALSE);
 }
 
@@ -206,7 +200,7 @@
     }
     lockResult = fcntl(fd, cmd, &fl);
     if (lockResult < 0) {
-        if ((cmd == F_SETLK64) && (errno == EAGAIN))
+        if ((cmd == F_SETLK64) && (errno == EAGAIN || errno == EACCES))
             return sun_nio_ch_FileDispatcherImpl_NO_LOCK;
         if (errno == EINTR)
             return sun_nio_ch_FileDispatcherImpl_INTERRUPTED;
--- a/src/solaris/native/sun/nio/ch/IOUtil.c	Mon Aug 06 13:31:40 2012 +0100
+++ b/src/solaris/native/sun/nio/ch/IOUtil.c	Mon Aug 06 14:20:32 2012 +0100
@@ -144,6 +144,16 @@
     }
 }
 
+JNIEXPORT jint JNICALL
+Java_sun_nio_ch_IOUtil_iovMax(JNIEnv *env, jclass this)
+{
+    jlong iov_max = sysconf(_SC_IOV_MAX);
+    if (iov_max == -1)
+        iov_max = 16;
+    return (jint)iov_max;
+}
+
+
 /* Declared in nio_util.h for use elsewhere in NIO */
 
 jlong
--- a/src/solaris/native/sun/nio/fs/genSolarisConstants.c	Mon Aug 06 13:31:40 2012 +0100
+++ b/src/solaris/native/sun/nio/fs/genSolarisConstants.c	Mon Aug 06 14:20:32 2012 +0100
@@ -27,7 +27,7 @@
 #include <errno.h>
 #include <unistd.h>
 #include <sys/acl.h>
-#include <sys/fcntl.h>
+#include <fcntl.h>
 #include <sys/stat.h>
 
 /**
--- a/src/solaris/native/sun/nio/fs/genUnixConstants.c	Mon Aug 06 13:31:40 2012 +0100
+++ b/src/solaris/native/sun/nio/fs/genUnixConstants.c	Mon Aug 06 14:20:32 2012 +0100
@@ -26,7 +26,7 @@
 #include <stdio.h>
 #include <errno.h>
 #include <unistd.h>
-#include <sys/fcntl.h>
+#include <fcntl.h>
 #include <sys/stat.h>
 
 /**
@@ -69,7 +69,12 @@
 #else
     DEFX(O_DSYNC);
 #endif
+#ifdef O_NOFOLLOW
     DEFX(O_NOFOLLOW);
+#else
+    // not supported (dummy values will not be used at runtime).
+    emitX("O_NOFOLLOW", 0x0);
+#endif
 
     // mode masks
     emitX("S_IAMB",
--- a/src/windows/native/sun/nio/ch/DatagramChannelImpl.c	Mon Aug 06 13:31:40 2012 +0100
+++ b/src/windows/native/sun/nio/ch/DatagramChannelImpl.c	Mon Aug 06 14:20:32 2012 +0100
@@ -108,7 +108,7 @@
 
 JNIEXPORT void JNICALL
 Java_sun_nio_ch_DatagramChannelImpl_disconnect0(JNIEnv *env, jobject this,
-                                                jobject fdo)
+                                                jobject fdo, jboolean isIPv6)
 {
     jint fd = fdval(env, fdo);
     int rv = 0;
--- a/src/windows/native/sun/nio/ch/IOUtil.c	Mon Aug 06 13:31:40 2012 +0100
+++ b/src/windows/native/sun/nio/ch/IOUtil.c	Mon Aug 06 14:20:32 2012 +0100
@@ -41,9 +41,6 @@
 /* field id for jint 'fd' in java.io.FileDescriptor used for socket fds */
 static jfieldID fd_fdID;
 
-/* false for 95/98/ME, true for NT/W2K */
-static jboolean onNT = JNI_FALSE;
-
 JNIEXPORT jboolean JNICALL
 Java_sun_security_provider_NativeSeedGenerator_nativeGenerateSeed
 (JNIEnv *env, jclass clazz, jbyteArray randArray);
@@ -55,13 +52,6 @@
 JNIEXPORT void JNICALL
 Java_sun_nio_ch_IOUtil_initIDs(JNIEnv *env, jclass clazz)
 {
-    OSVERSIONINFO ver;
-    ver.dwOSVersionInfoSize = sizeof(ver);
-    GetVersionEx(&ver);
-    if (ver.dwPlatformId == VER_PLATFORM_WIN32_NT) {
-        onNT = JNI_TRUE;
-    }
-
     clazz = (*env)->FindClass(env, "java/io/FileDescriptor");
     fd_fdID = (*env)->GetFieldID(env, clazz, "fd", "I");
     handle_fdID = (*env)->GetFieldID(env, clazz, "handle", "J");
@@ -80,6 +70,13 @@
                                                                     randArray);
 }
 
+JNIEXPORT jint JNICALL
+Java_sun_nio_ch_IOUtil_iovMax(JNIEnv *env, jclass this)
+{
+    return 16;
+}
+
+
 jint
 convertReturnVal(JNIEnv *env, jint n, jboolean reading)
 {
@@ -205,9 +202,3 @@
 {
     return (*env)->GetLongField(env, fdo, handle_fdID);
 }
-
-jboolean
-isNT()
-{
-    return onNT;
-}
--- a/src/windows/native/sun/nio/ch/SocketDispatcher.c	Mon Aug 06 13:31:40 2012 +0100
+++ b/src/windows/native/sun/nio/ch/SocketDispatcher.c	Mon Aug 06 14:20:32 2012 +0100
@@ -97,10 +97,6 @@
         return IOS_THROWN;
     }
 
-    if ((isNT() == JNI_FALSE) && (len > 16)) {
-        len = 16;
-    }
-
     /* copy iovec into WSABUF */
     for(i=0; i<len; i++) {
         jint iov_len = iovp[i].iov_len;
@@ -208,10 +204,6 @@
         return IOS_THROWN;
     }
 
-    if ((isNT() == JNI_FALSE) && (len > 16)) {
-        len = 16;
-    }
-
     /* copy iovec into WSABUF */
     for(i=0; i<len; i++) {
         jint iov_len = iovp[i].iov_len;
--- a/src/windows/native/sun/nio/ch/nio_util.h	Mon Aug 06 13:31:40 2012 +0100
+++ b/src/windows/native/sun/nio/ch/nio_util.h	Mon Aug 06 14:20:32 2012 +0100
@@ -35,7 +35,6 @@
 
 jint fdval(JNIEnv *env, jobject fdo);
 jlong handleval(JNIEnv *env, jobject fdo);
-jboolean isNT();
 jint convertReturnVal(JNIEnv *env, jint n, jboolean r);
 jlong convertLongReturnVal(JNIEnv *env, jlong n, jboolean r);
 jboolean purgeOutstandingICMP(JNIEnv *env, jclass clazz, jint fd);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/net/CookieHandler/NullUriCookieTest.java	Mon Aug 06 14:20:32 2012 +0100
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 6953455
+ * @summary CookieStore.add() cannot handle null URI parameter
+ */
+
+import java.net.CookieManager;
+import java.net.CookieStore;
+import java.net.HttpCookie;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.List;
+
+public class NullUriCookieTest {
+    static boolean fail = false;
+
+    public static void main(String[] args) throws Exception {
+        checkCookieNullUri();
+    }
+
+    static void checkCookieNullUri() throws Exception {
+        //get a cookie store implementation and add a cookie to the store with null URI
+        CookieStore cookieStore = (new CookieManager()).getCookieStore();
+        HttpCookie cookie = new HttpCookie("MY_COOKIE", "MY_COOKIE_VALUE");
+        cookie.setDomain("foo.com");
+        cookieStore.add(null, cookie);
+
+        //Retrieve added cookie
+        URI uri = new URI("http://foo.com");
+        List<HttpCookie> addedCookieList = cookieStore.get(uri);
+
+        //Verify CookieStore behaves well
+        if (addedCookieList.size() != 1) {
+           fail = true;
+        }
+        checkFail("Abnormal size of cookie jar");
+
+        for (HttpCookie chip : addedCookieList) {
+            if (!chip.equals(cookie)) {
+                 fail = true;
+            }
+        }
+        checkFail("Cookie not retrieved from Cookie Jar");
+        boolean ret = cookieStore.remove(null,cookie);
+        if (!ret) {
+            fail = true;
+        }
+        checkFail("Abnormal removal behaviour from Cookie Jar");
+    }
+
+    static void checkFail(String exp) {
+        if (fail) {
+            throw new RuntimeException(exp);
+        }
+    }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/nio/channels/DatagramChannel/Disconnect.java	Mon Aug 06 14:20:32 2012 +0100
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2012, 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 7132924
+ * @summary Test DatagramChannel.disconnect when DatagramChannel is connected to an IPv4 socket
+ * @run main Disconnect
+ * @run main/othervm -Djava.net.preferIPv4Stack=true Disconnect
+ */
+
+import java.net.*;
+import java.nio.*;
+import java.nio.channels.*;
+import java.io.IOException;
+
+public class Disconnect {
+    public static void main(String[] args) throws IOException {
+        // test with default protocol family
+        try (DatagramChannel dc = DatagramChannel.open()) {
+            test(dc);
+            test(dc);
+        }
+
+        // test with IPv4 only
+        try (DatagramChannel dc = DatagramChannel.open(StandardProtocolFamily.INET)) {
+            test(dc);
+            test(dc);
+        }
+    }
+
+    /**
+     * Connect DatagramChannel to a server, write a datagram and disconnect. Invoke
+     * a second or subsequent time with the same DatagramChannel instance to check
+     * that disconnect works as expected.
+     */
+    static void test(DatagramChannel dc) throws IOException {
+        try (DatagramChannel server = DatagramChannel.open()) {
+            server.bind(new InetSocketAddress(0));
+
+            InetAddress lh = InetAddress.getLocalHost();
+            dc.connect(new InetSocketAddress(lh, server.socket().getLocalPort()));
+
+            dc.write(ByteBuffer.wrap("hello".getBytes()));
+
+            ByteBuffer bb = ByteBuffer.allocate(100);
+            server.receive(bb);
+
+            dc.disconnect();
+
+            try {
+                dc.write(ByteBuffer.wrap("another message".getBytes()));
+                throw new RuntimeException("write should fail, not connected");
+            } catch (NotYetConnectedException expected) {
+            }
+        }
+    }
+}
--- a/test/java/util/concurrent/BlockingQueue/LastElement.java	Mon Aug 06 13:31:40 2012 +0100
+++ b/test/java/util/concurrent/BlockingQueue/LastElement.java	Mon Aug 06 14:20:32 2012 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2012, 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
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 6215625
+ * @bug 6215625 7161229
  * @summary Check correct behavior when last element is removed.
  * @author Martin Buchholz
  */
@@ -38,9 +38,7 @@
         testQueue(new ArrayBlockingQueue<Integer>(10, true));
         testQueue(new ArrayBlockingQueue<Integer>(10, false));
         testQueue(new LinkedTransferQueue<Integer>());
-
-        System.out.printf("%nPassed = %d, failed = %d%n%n", passed, failed);
-        if (failed > 0) throw new Exception("Some tests failed");
+        testQueue(new PriorityBlockingQueue<Integer>());
     }
 
     void testQueue(BlockingQueue<Integer> q) throws Throwable {
@@ -59,6 +57,7 @@
         try {check(q.take() == three);}
         catch (Throwable t) {unexpected(t);}
         check(q.isEmpty() && q.size() == 0);
+        check(noRetention(q));
 
         // iterator().remove()
         q.clear();
@@ -77,6 +76,26 @@
         check(q.isEmpty() && q.size() == 0);
     }
 
+    boolean noRetention(BlockingQueue<?> q) {
+        if (q instanceof PriorityBlockingQueue) {
+            PriorityBlockingQueue<?> pbq = (PriorityBlockingQueue) q;
+            try {
+                java.lang.reflect.Field queue =
+                    PriorityBlockingQueue.class.getDeclaredField("queue");
+                queue.setAccessible(true);
+                Object[] a = (Object[]) queue.get(pbq);
+                return a[0] == null;
+            }
+            catch (NoSuchFieldException e) {
+                unexpected(e);
+            }
+            catch (IllegalAccessException e) {
+                // ignore - security manager must be installed
+            }
+        }
+        return true;
+    }
+
     //--------------------- Infrastructure ---------------------------
     volatile int passed = 0, failed = 0;
     void pass() {passed++;}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/text/DefaultCaret/6938583/bug6938583.java	Mon Aug 06 14:20:32 2012 +0100
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2011 Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * Portions Copyright (c) 2011 IBM Corporation
+ */
+
+/*
+ * @test
+ * @bug 6938583
+ * @summary Unexpected NullPointerException when use CodeIM demo on windows
+ * @author LittleE
+ */
+
+import javax.swing.*;
+import javax.swing.text.DefaultCaret;
+import java.awt.event.MouseEvent;
+
+public class bug6938583 {
+    public static void main(String[] args) throws Exception {
+        SwingUtilities.invokeAndWait(new Runnable() {
+            public void run() {
+                JTextArea jta = new JTextArea();
+                DefaultCaret dc = new DefaultCaret();
+                jta.setCaret(dc);
+                dc.deinstall(jta);
+                dc.mouseClicked(new MouseEvent(jta, MouseEvent.MOUSE_CLICKED, 0, 0, 0, 0, 0, false));
+            }
+        });
+    }
+}
--- a/test/sun/security/util/Oid/S11N.sh	Mon Aug 06 13:31:40 2012 +0100
+++ b/test/sun/security/util/Oid/S11N.sh	Mon Aug 06 14:20:32 2012 +0100
@@ -71,7 +71,7 @@
       i[3-6]86 )
         PF="linux-i586"
         ;;
-      amd64* )
+      amd64* | x86_64 )
         PF="linux-amd64"
         ;;
       * )
@@ -97,15 +97,29 @@
     ;;
 esac
 
+echo "==================================================="
+echo "Try to set ALT_JAVA_RE_JDK if you see timeout error"
+echo "==================================================="
+
 # the test code
 
 ${TESTJAVA}${FS}bin${FS}javac -target 1.4 -source 1.4 \
         -d . ${TESTSRC}${FS}SerialTest.java || exit 10
 
+# You can set ALT_JAVA_RE_JDK to another location that contains the
+# binaries for older JDK releases. You can set it to a non-existent
+# directory to skip the interop tests between different versions.
+
+if [ "$ALT_JAVA_RE_JDK" = "" ]; then
+    JAVA_RE_JDK=/java/re/j2se
+else
+    JAVA_RE_JDK=$ALT_JAVA_RE_JDK
+fi
+
 OLDJAVA="
-    /java/re/j2se/1.6.0/latest/binaries/${PF}
-    /java/re/j2se/1.5.0/latest/binaries/${PF}
-    /java/re/j2se/1.4.2/latest/binaries/${PF}
+    $JAVA_RE_JDK/1.6.0/latest/binaries/${PF}
+    $JAVA_RE_JDK/1.5.0/latest/binaries/${PF}
+    $JAVA_RE_JDK/1.4.2/latest/binaries/${PF}
 "
 
 SMALL="
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/pack200/RepackTest.java	Mon Aug 06 14:20:32 2012 +0100
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+/*
+ * @test
+ * @bug 7184145
+ * @summary tests repacking of an orphaned jarfile
+ * @compile -XDignore.symbol.file Utils.java RepackTest.java
+ * @run main RepackTest
+ * @author ksrini
+ */
+public class RepackTest {
+
+    public static void main(String... args) throws Exception {
+        testRepack();
+    }
+
+    /*
+     * there are two cases we need to test, where the file in question is
+     * orpaned, ie. without a parent ie. not qualified by a parent path
+     * relative nor absolute
+     * case 1: src and dest are the same
+     * case 2: src and dest are different
+     */
+    static void testRepack() throws IOException {
+
+        // make a copy of the test speciment to local directory
+        File testFile = new File("src_tools.jar");
+        Utils.copyFile(Utils.locateJar("golden.jar"), testFile);
+        List<String> cmdsList = new ArrayList<>();
+
+        // case 1:
+        cmdsList.add(Utils.getPack200Cmd());
+        cmdsList.add("--repack");
+        cmdsList.add(testFile.getName());
+        Utils.runExec(cmdsList);
+
+        // case 2:
+        File dstFile = new File("dst_tools.jar");
+        cmdsList.clear();
+        cmdsList.add(Utils.getPack200Cmd());
+        cmdsList.add("--repack");
+        cmdsList.add(dstFile.getName());
+        cmdsList.add(testFile.getName());
+        Utils.runExec(cmdsList);
+
+        // tidy up
+        testFile.delete();
+        dstFile.delete();
+    }
+}