changeset 8159:fc75272dd0fe

Merge
author asaha
date Tue, 18 Nov 2014 08:41:14 -0800
parents ab61835a8ae8 17a3a77698ca
children 502e2ce03829
files .hgtags src/share/classes/sun/util/resources/TimeZoneNames_de.java src/share/classes/sun/util/resources/TimeZoneNames_es.java src/share/classes/sun/util/resources/TimeZoneNames_sv.java
diffstat 21 files changed, 607 insertions(+), 117 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags	Mon Nov 17 20:20:20 2014 +0300
+++ b/.hgtags	Tue Nov 18 08:41:14 2014 -0800
@@ -520,6 +520,7 @@
 e9596c6470c944ff19c5198cfeb7fd979aad9120 jdk7u75-b06
 e0afb6ec0633d18f360f074c5672fa4c2196ea39 jdk7u75-b07
 8268d82995af433655d3db9a51b549032c19537d jdk7u75-b08
+0a1fe04693dd9f65176c35dc0631652086795f01 jdk7u75-b09
 0666a58a7e584380c1b1dadb50ec67400110a9ab jdk7u76-b00
 182b3e8a732d6b0d21bd7d602361e5276f14b886 jdk7u76-b01
 3c743031578a431ccc1e27691b1958355d02caec jdk7u76-b02
@@ -533,5 +534,6 @@
 0000000000000000000000000000000000000000 jdk7u76-b08
 0000000000000000000000000000000000000000 jdk7u76-b08
 9c008aa88919f1ab6d4337b66546f594443680b2 jdk7u76-b08
+70371a63e6c9ff4a73a2bbb09315c4138cf25792 jdk7u76-b09
 45f30f5524d4eef7aa512e35d5399cc4d84af174 jdk7u79-b00
 
--- a/make/java/java/mapfile-vers	Mon Nov 17 20:20:20 2014 +0300
+++ b/make/java/java/mapfile-vers	Tue Nov 18 08:41:14 2014 -0800
@@ -275,6 +275,7 @@
 		Java_sun_misc_VM_latestUserDefinedLoader;
                 Java_sun_misc_VM_initialize;
 		Java_sun_misc_VMSupport_initAgentProperties;
+		Java_sun_misc_VMSupport_getVMTemporaryDirectory;
 
                 # ZipFile.c needs this one
 		throwFileNotFoundException;
--- a/src/share/classes/com/sun/java/swing/SwingUtilities3.java	Mon Nov 17 20:20:20 2014 +0300
+++ b/src/share/classes/com/sun/java/swing/SwingUtilities3.java	Tue Nov 18 08:41:14 2014 -0800
@@ -27,6 +27,8 @@
 
 import sun.awt.EventQueueDelegate;
 import sun.awt.AppContext;
+import sun.awt.SunToolkit;
+
 import java.util.Collections;
 import java.util.Map;
 import java.util.WeakHashMap;
@@ -117,8 +119,8 @@
     public static RepaintManager getDelegateRepaintManager(Component
                                                             component) {
         RepaintManager delegate = null;
-        if (Boolean.TRUE == AppContext.getAppContext().get(
-                                               DELEGATE_REPAINT_MANAGER_KEY)) {
+        if (Boolean.TRUE == SunToolkit.targetToAppContext(component)
+                                      .get(DELEGATE_REPAINT_MANAGER_KEY)) {
             while (delegate == null && component != null) {
                 while (component != null
                          && ! (component instanceof JComponent)) {
--- a/src/share/classes/java/awt/Component.java	Mon Nov 17 20:20:20 2014 +0300
+++ b/src/share/classes/java/awt/Component.java	Tue Nov 18 08:41:14 2014 -0800
@@ -3394,7 +3394,7 @@
                 (width > 0) && (height > 0)) {
                 PaintEvent e = new PaintEvent(this, PaintEvent.UPDATE,
                                               new Rectangle(x, y, width, height));
-                Toolkit.getEventQueue().postEvent(e);
+                SunToolkit.postEvent(SunToolkit.targetToAppContext(this), e);
             }
         }
     }
--- a/src/share/classes/java/lang/ConditionalSpecialCasing.java	Mon Nov 17 20:20:20 2014 +0300
+++ b/src/share/classes/java/lang/ConditionalSpecialCasing.java	Tue Nov 18 08:41:14 2014 -0800
@@ -62,6 +62,7 @@
         //# Conditional mappings
         //# ================================================================================
         new Entry(0x03A3, new char[]{0x03C2}, new char[]{0x03A3}, null, FINAL_CASED), // # GREEK CAPITAL LETTER SIGMA
+        new Entry(0x0130, new char[]{0x0069, 0x0307}, new char[]{0x0130}, null, 0), // # LATIN CAPITAL LETTER I WITH DOT ABOVE
 
         //# ================================================================================
         //# Locale-sensitive mappings
@@ -77,8 +78,8 @@
 
         //# ================================================================================
         //# Turkish and Azeri
-//      new Entry(0x0130, new char[]{0x0069}, new char[]{0x0130}, "tr", 0), // # LATIN CAPITAL LETTER I WITH DOT ABOVE
-//      new Entry(0x0130, new char[]{0x0069}, new char[]{0x0130}, "az", 0), // # LATIN CAPITAL LETTER I WITH DOT ABOVE
+        new Entry(0x0130, new char[]{0x0069}, new char[]{0x0130}, "tr", 0), // # LATIN CAPITAL LETTER I WITH DOT ABOVE
+        new Entry(0x0130, new char[]{0x0069}, new char[]{0x0130}, "az", 0), // # LATIN CAPITAL LETTER I WITH DOT ABOVE
         new Entry(0x0307, new char[]{}, new char[]{0x0307}, "tr", AFTER_I), // # COMBINING DOT ABOVE
         new Entry(0x0307, new char[]{}, new char[]{0x0307}, "az", AFTER_I), // # COMBINING DOT ABOVE
         new Entry(0x0049, new char[]{0x0131}, new char[]{0x0049}, "tr", NOT_BEFORE_DOT), // # LATIN CAPITAL LETTER I
@@ -148,21 +149,25 @@
 
     private static char[] lookUpTable(String src, int index, Locale locale, boolean bLowerCasing) {
         HashSet set = (HashSet)entryTable.get(new Integer(src.codePointAt(index)));
+        char[] ret = null;
 
         if (set != null) {
             Iterator iter = set.iterator();
             String currentLang = locale.getLanguage();
             while (iter.hasNext()) {
                 Entry entry = (Entry)iter.next();
-                String conditionLang= entry.getLanguage();
+                String conditionLang = entry.getLanguage();
                 if (((conditionLang == null) || (conditionLang.equals(currentLang))) &&
                         isConditionMet(src, index, locale, entry.getCondition())) {
-                    return (bLowerCasing ? entry.getLowerCase() : entry.getUpperCase());
+                    ret = bLowerCasing ? entry.getLowerCase() : entry.getUpperCase();
+                    if (conditionLang != null) {
+                        break;
+                    }
                 }
             }
         }
 
-        return null;
+        return ret;
     }
 
     private static boolean isConditionMet(String src, int index, Locale locale, int condition) {
--- a/src/share/classes/java/lang/String.java	Mon Nov 17 20:20:20 2014 +0300
+++ b/src/share/classes/java/lang/String.java	Tue Nov 18 08:41:14 2014 -0800
@@ -2459,7 +2459,9 @@
             } else {
                 srcCount = 1;
             }
-            if (localeDependent || srcChar == '\u03A3') { // GREEK CAPITAL LETTER SIGMA
+            if (localeDependent ||
+                srcChar == '\u03A3' || // GREEK CAPITAL LETTER SIGMA
+                srcChar == '\u0130') { // LATIN CAPITAL LETTER I WITH DOT ABOVE
                 lowerChar = ConditionalSpecialCasing.toLowerCaseEx(this, i, locale);
             } else {
                 lowerChar = Character.toLowerCase(srcChar);
--- a/src/share/classes/javax/swing/JComponent.java	Mon Nov 17 20:20:20 2014 +0300
+++ b/src/share/classes/javax/swing/JComponent.java	Tue Nov 18 08:41:14 2014 -0800
@@ -63,6 +63,7 @@
 import static javax.swing.ClientPropertyKey.*;
 import javax.accessibility.*;
 
+import sun.awt.SunToolkit;
 import sun.swing.SwingUtilities2;
 import sun.swing.UIClientPropertyKey;
 
@@ -4801,7 +4802,8 @@
      * @see RepaintManager#addDirtyRegion
      */
     public void repaint(long tm, int x, int y, int width, int height) {
-        RepaintManager.currentManager(this).addDirtyRegion(this, x, y, width, height);
+        RepaintManager.currentManager(SunToolkit.targetToAppContext(this))
+                      .addDirtyRegion(this, x, y, width, height);
     }
 
 
@@ -4856,7 +4858,7 @@
             // which was causing some people grief.
             return;
         }
-        if (SwingUtilities.isEventDispatchThread()) {
+        if (SunToolkit.isDispatchThreadForAppContext(this)) {
             invalidate();
             RepaintManager.currentManager(this).addInvalidComponent(this);
         }
@@ -4878,7 +4880,7 @@
                     revalidate();
                 }
             };
-            SwingUtilities.invokeLater(callRevalidate);
+            SunToolkit.executeOnEventHandlerThread(this, callRevalidate);
         }
     }
 
--- a/src/share/classes/sun/jvmstat/perfdata/monitor/protocol/local/PerfDataFile.java	Mon Nov 17 20:20:20 2014 +0300
+++ b/src/share/classes/sun/jvmstat/perfdata/monitor/protocol/local/PerfDataFile.java	Tue Nov 18 08:41:14 2014 -0800
@@ -233,8 +233,6 @@
      *               does not conform to the expected pattern
      */
     public static int getLocalVmId(File file) {
-        int lvmid = 0;
-
         try {
             // try 1.4.2 and later format first
             return Integer.parseInt(file.getName());
@@ -287,31 +285,13 @@
         return tmpDirName + dirNamePrefix + user + File.separator;
     }
 
-    /*
-     * this static initializer would not be necessary if the
-     * Solaris java.io.tmpdir property were set to /tmp by default
-     */
     static {
         /*
-         * Why is java.io.tmpdir on Solaris set to "/var/tmp/" when the
-         * HotSpot JVM os:get_temp_path() method returns "/tmp/"
-         *
-         * Why do Solaris and Windows return a string with a trailing
-         * file separator character where as Linix does not? (this change
-         * seems to have occurred sometime during hopper beta)
+         * For this to work, the target VM and this code need to use
+         * the same directory. Instead of guessing which directory the
+         * VM is using, we will ask.
          */
-        String tmpdir = System.getProperty("java.io.tmpdir");
-
-        if (tmpdir.compareTo("/var/tmp/") == 0) {
-             /*
-              * shared memory files are created in /tmp. Interestingly,
-              * java.io.tmpdir is set to "/var/tmp/" on Solaris and Linux,
-              * but os::get_temp_directory() is set to "/tmp/" on these
-              * platforms. the java.io.logging packages also makes reference
-              * to java.io.tmpdir.
-              */
-             tmpdir = "/tmp/";
-        }
+        String tmpdir = sun.misc.VMSupport.getVMTemporaryDirectory();
 
         /*
          * Assure that the string returned has a trailing File.separator
--- a/src/share/classes/sun/misc/VMSupport.java	Mon Nov 17 20:20:20 2014 +0300
+++ b/src/share/classes/sun/misc/VMSupport.java	Tue Nov 18 08:41:14 2014 -0800
@@ -97,4 +97,14 @@
             throw new RuntimeException(ioe.getMessage());
         }
     }
+
+    /*
+     * Return the temporary directory that the VM uses for the attach
+     * and perf data files.
+     *
+     * It is important that this directory is well-known and the
+     * same for all VM instances. It cannot be affected by configuration
+     * variables such as java.io.tmpdir.
+     */
+    public static native String getVMTemporaryDirectory();
 }
--- a/src/share/javavm/export/jvm.h	Mon Nov 17 20:20:20 2014 +0300
+++ b/src/share/javavm/export/jvm.h	Tue Nov 18 08:41:14 2014 -0800
@@ -1320,6 +1320,9 @@
 JNIEXPORT jobject JNICALL
 JVM_InitAgentProperties(JNIEnv *env, jobject agent_props);
 
+JNIEXPORT jstring JNICALL
+JVM_GetTemporaryDirectory(JNIEnv *env);
+
 /* Generics reflection support.
  *
  * Returns information about the given class's EnclosingMethod
--- a/src/share/native/sun/misc/VMSupport.c	Mon Nov 17 20:20:20 2014 +0300
+++ b/src/share/native/sun/misc/VMSupport.c	Tue Nov 18 08:41:14 2014 -0800
@@ -53,3 +53,9 @@
     }
     return (*InitAgentProperties_fp)(env, props);
 }
+
+JNIEXPORT jstring JNICALL
+Java_sun_misc_VMSupport_getVMTemporaryDirectory(JNIEnv *env, jclass cls)
+{
+    return JVM_GetTemporaryDirectory(env);
+}
--- a/src/windows/native/java/net/NetworkInterface.c	Mon Nov 17 20:20:20 2014 +0300
+++ b/src/windows/native/java/net/NetworkInterface.c	Tue Nov 18 08:41:14 2014 -0800
@@ -861,7 +861,7 @@
     MIB_IFROW *ifRowP;
     ifRowP = getIF(index);
     if (ifRowP != NULL) {
-      ret = ifRowP->dwAdminStatus == 1 &&
+      ret = ifRowP->dwAdminStatus == MIB_IF_ADMIN_STATUS_UP &&
             (ifRowP->dwOperStatus == MIB_IF_OPER_STATUS_OPERATIONAL ||
              ifRowP->dwOperStatus == MIB_IF_OPER_STATUS_CONNECTED);
       free(ifRowP);
--- a/src/windows/native/java/net/TwoStacksPlainDatagramSocketImpl.c	Mon Nov 17 20:20:20 2014 +0300
+++ b/src/windows/native/java/net/TwoStacksPlainDatagramSocketImpl.c	Tue Nov 18 08:41:14 2014 -0800
@@ -43,6 +43,7 @@
 #include "java_net_SocketOptions.h"
 #include "java_net_NetworkInterface.h"
 
+#include "NetworkInterface.h"
 #include "jvm.h"
 #include "jni_util.h"
 #include "net_util.h"
@@ -1638,6 +1639,33 @@
     return (*env)->GetIntField(env, nif, ni_indexID);
 }
 
+static int isAdapterIpv6Enabled(JNIEnv *env, int index) {
+  netif *ifList, *curr;
+  int ipv6Enabled = 0;
+  if (getAllInterfacesAndAddresses (env, &ifList) < 0) {
+      return ipv6Enabled;
+  }
+
+  /* search by index */
+  curr = ifList;
+  while (curr != NULL) {
+      if (index == curr->index) {
+          break;
+      }
+      curr = curr->next;
+  }
+
+  /* if found ipv6Index != 0 then interface is configured with IPV6 */
+  if ((curr != NULL) && (curr->ipv6Index !=0)) {
+      ipv6Enabled = 1;
+  }
+
+  /* release the interface list */
+  free_netif(ifList);
+
+  return ipv6Enabled;
+}
+
 /*
  * Sets the multicast interface.
  *
@@ -1697,7 +1725,6 @@
             struct in_addr in;
 
             in.s_addr = htonl(getInetAddress_addr(env, value));
-
             if (setsockopt(fd, IPPROTO_IP, IP_MULTICAST_IF,
                                (const char*)&in, sizeof(in)) < 0) {
                 NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException",
@@ -1728,19 +1755,20 @@
             }
             index = (*env)->GetIntField(env, value, ni_indexID);
 
-            if (setsockopt(fd1, IPPROTO_IPV6, IPV6_MULTICAST_IF,
+            if ( isAdapterIpv6Enabled(env, index) != 0 ) {
+                if (setsockopt(fd1, IPPROTO_IPV6, IPV6_MULTICAST_IF,
                                (const char*)&index, sizeof(index)) < 0) {
-                if (errno == EINVAL && index > 0) {
-                    JNU_ThrowByName(env, JNU_JAVANETPKG "SocketException",
-                        "IPV6_MULTICAST_IF failed (interface has IPv4 "
-                        "address only?)");
-                } else {
-                    NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException",
+                    if (errno == EINVAL && index > 0) {
+                        JNU_ThrowByName(env, JNU_JAVANETPKG "SocketException",
+                            "IPV6_MULTICAST_IF failed (interface has IPv4 "
+                            "address only?)");
+                    } else {
+                        NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException",
                                    "Error setting socket option");
+                    }
+                    return;
                 }
-                return;
             }
-
             /* If there are any IPv4 addresses on this interface then
              * repeat the operation on the IPv4 fd */
 
@@ -1791,7 +1819,6 @@
         char c;
     } optval;
     int ipv6_supported = ipv6_available();
-
     fd = getFD(env, this);
 
     if (ipv6_supported) {
@@ -1892,42 +1919,21 @@
 }
 
 /*
- * Return the multicast interface:
  *
- * SocketOptions.IP_MULTICAST_IF
- *      IPv4:   Query IPPROTO_IP/IP_MULTICAST_IF
- *              Create InetAddress
- *              IP_MULTICAST_IF returns struct ip_mreqn on 2.2
- *              kernel but struct in_addr on 2.4 kernel
- *      IPv6:   Query IPPROTO_IPV6 / IPV6_MULTICAST_IF or
- *              obtain from impl is Linux 2.2 kernel
- *              If index == 0 return InetAddress representing
- *              anyLocalAddress.
- *              If index > 0 query NetworkInterface by index
- *              and returns addrs[0]
+ * called by getMulticastInterface to retrieve a NetworkInterface
+ * configured for IPv4.
+ * The ipv4Mode parameter, is a closet boolean, which allows for a NULL return,
+ * or forces the creation of a NetworkInterface object with null data.
+ * It relates to its calling context in getMulticastInterface.
+ * ipv4Mode == 1, the context is IPV4 processing only.
+ * ipv4Mode == 0, the context is IPV6 processing
  *
- * SocketOptions.IP_MULTICAST_IF2
- *      IPv4:   Query IPPROTO_IP/IP_MULTICAST_IF
- *              Query NetworkInterface by IP address and
- *              return the NetworkInterface that the address
- *              is bound too.
- *      IPv6:   Query IPPROTO_IPV6 / IPV6_MULTICAST_IF
- *              (except Linux .2 kernel)
- *              Query NetworkInterface by index and
- *              return NetworkInterface.
  */
-jobject getMulticastInterface(JNIEnv *env, jobject this, int fd, int fd1, jint opt) {
-    jboolean isIPV4 = !ipv6_available() || fd1 == -1;
-
-    /*
-     * IPv4 implementation
-     */
-    if (isIPV4) {
+static jobject getIPv4NetworkInterface (JNIEnv *env, jobject this, int fd, jint opt, int ipv4Mode) {
         static jclass inet4_class;
         static jmethodID inet4_ctrID;
 
-        static jclass ni_class;
-        static jmethodID ni_ctrID;
+        static jclass ni_class; static jmethodID ni_ctrID;
         static jfieldID ni_indexID;
         static jfieldID ni_addrsID;
 
@@ -1938,7 +1944,6 @@
         struct in_addr in;
         struct in_addr *inP = &in;
         int len = sizeof(struct in_addr);
-
         if (getsockopt(fd, IPPROTO_IP, IP_MULTICAST_IF,
                            (char *)inP, &len) < 0) {
             NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException",
@@ -1990,24 +1995,58 @@
         if (ni) {
             return ni;
         }
+        if (ipv4Mode) {
+            ni = (*env)->NewObject(env, ni_class, ni_ctrID, 0);
+            CHECK_NULL_RETURN(ni, NULL);
 
-        /*
-         * The address doesn't appear to be bound at any known
-         * NetworkInterface. Therefore we construct a NetworkInterface
-         * with this address.
-         */
-        ni = (*env)->NewObject(env, ni_class, ni_ctrID, 0);
-        CHECK_NULL_RETURN(ni, NULL);
+            (*env)->SetIntField(env, ni, ni_indexID, -1);
+            addrArray = (*env)->NewObjectArray(env, 1, inet4_class, NULL);
+            CHECK_NULL_RETURN(addrArray, NULL);
+            (*env)->SetObjectArrayElement(env, addrArray, 0, addr);
+            (*env)->SetObjectField(env, ni, ni_addrsID, addrArray);
+        } else {
+            ni = NULL;
+        }
+        return ni;
+}
 
-        (*env)->SetIntField(env, ni, ni_indexID, -1);
-        addrArray = (*env)->NewObjectArray(env, 1, inet4_class, NULL);
-        CHECK_NULL_RETURN(addrArray, NULL);
-        (*env)->SetObjectArrayElement(env, addrArray, 0, addr);
-        (*env)->SetObjectField(env, ni, ni_addrsID, addrArray);
-        return ni;
+/*
+ * Return the multicast interface:
+ *
+ * SocketOptions.IP_MULTICAST_IF
+ *      IPv4:   Query IPPROTO_IP/IP_MULTICAST_IF
+ *              Create InetAddress
+ *              IP_MULTICAST_IF returns struct ip_mreqn on 2.2
+ *              kernel but struct in_addr on 2.4 kernel
+ *      IPv6:   Query IPPROTO_IPV6 / IPV6_MULTICAST_IF or
+ *              obtain from impl is Linux 2.2 kernel
+ *              If index == 0 return InetAddress representing
+ *              anyLocalAddress.
+ *              If index > 0 query NetworkInterface by index
+ *              and returns addrs[0]
+ *
+ * SocketOptions.IP_MULTICAST_IF2
+ *      IPv4:   Query IPPROTO_IP/IP_MULTICAST_IF
+ *              Query NetworkInterface by IP address and
+ *              return the NetworkInterface that the address
+ *              is bound too.
+ *      IPv6:   Query IPPROTO_IPV6 / IPV6_MULTICAST_IF
+ *              (except Linux .2 kernel)
+ *              Query NetworkInterface by index and
+ *              return NetworkInterface.
+ */
+jobject getMulticastInterface(JNIEnv *env, jobject this, int fd, int fd1, jint opt) {
+    jboolean isIPV4 = !ipv6_available() || fd1 == -1;
+
+    /*
+     * IPv4 implementation
+     */
+    if (isIPV4) {
+        jobject netObject = NULL; // return is either an addr or a netif
+        netObject = getIPv4NetworkInterface(env, this, fd, opt, 1);
+        return netObject;
     }
 
-
     /*
      * IPv6 implementation
      */
@@ -2097,6 +2136,13 @@
 
             addr = (*env)->GetObjectArrayElement(env, addrArray, 0);
             return addr;
+        } else if (index == 0) { // index == 0 typically means IPv6 not configured on the interfaces
+            // falling back to treat interface as configured for IPv4
+            jobject netObject = NULL;
+            netObject = getIPv4NetworkInterface(env, this, fd, opt, 0);
+            if (netObject != NULL) {
+                return netObject;
+            }
         }
 
         /*
@@ -2121,6 +2167,8 @@
     }
     return NULL;
 }
+
+
 /*
  * Returns relevant info as a jint.
  *
--- a/test/com/sun/tools/attach/BasicTests.java	Mon Nov 17 20:20:20 2014 +0300
+++ b/test/com/sun/tools/attach/BasicTests.java	Tue Nov 18 08:41:14 2014 -0800
@@ -38,7 +38,7 @@
  * @bug 6173612 6273707 6277253 6335921 6348630 6342019 6381757
  * @summary Basic unit tests for the VM attach mechanism.
  * @library /lib/testlibrary
- * @run build Agent BadAgent RedefineAgent Application Shutdown RedefineDummy
+ * @run build Agent BadAgent RedefineAgent Application Shutdown RedefineDummy RunnerUtil
  * @run main BasicTests
  *
  * This test will perform a number of basic attach tests.
@@ -238,19 +238,17 @@
             // Test 6 - list method should list the target VM
             System.out.println(" - Test: VirtualMachine.list");
             List<VirtualMachineDescriptor> l = VirtualMachine.list();
-            if (!l.isEmpty()) {
-                boolean found = false;
-                for (VirtualMachineDescriptor vmd: l) {
-                    if (vmd.id().equals(pid)) {
-                        found = true;
-                        break;
-                    }
+            boolean found = false;
+            for (VirtualMachineDescriptor vmd: l) {
+                if (vmd.id().equals(pid)) {
+                    found = true;
+                    break;
                 }
-                if (found) {
-                    System.out.println(" - " + pid + " found.");
-                } else {
-                    throw new RuntimeException(pid + " not found in VM list");
-                }
+            }
+            if (found) {
+                System.out.println(" - " + pid + " found.");
+            } else {
+                throw new RuntimeException(pid + " not found in VM list");
             }
 
             // test 7 - basic hashCode/equals tests
--- a/test/com/sun/tools/attach/RunnerUtil.java	Mon Nov 17 20:20:20 2014 +0300
+++ b/test/com/sun/tools/attach/RunnerUtil.java	Tue Nov 18 08:41:14 2014 -0800
@@ -24,12 +24,11 @@
 import java.io.IOException;
 import java.io.File;
 import java.nio.file.Files;
-import java.nio.file.Path;
 import java.util.Arrays;
 import java.util.regex.Pattern;
 import java.util.regex.Matcher;
+
 import jdk.testlibrary.OutputAnalyzer;
-import jdk.testlibrary.JDKToolLauncher;
 import jdk.testlibrary.ProcessTools;
 import jdk.testlibrary.Utils;
 import jdk.testlibrary.ProcessThread;
@@ -39,6 +38,7 @@
  * (Test runner = class that launch a test)
  */
 public class RunnerUtil {
+
     /**
      * The Application process must be run concurrently with our tests since
      * the tests will attach to the Application.
@@ -49,16 +49,31 @@
      *
      * The Application will write its pid and shutdownPort in the given outFile.
      */
-    public static ProcessThread startApplication(String outFile) throws Throwable {
+    public static ProcessThread startApplication(String outFile, String... additionalOpts) throws Throwable {
         String classpath = System.getProperty("test.class.path", ".");
-        String[] args = Utils.addTestJavaOpts(
-            "-Dattach.test=true", "-classpath", classpath, "Application", outFile);
+        String[] myArgs = concat(additionalOpts, new String [] { "-Dattach.test=true", "-classpath", classpath, "Application", outFile });
+        String[] args = Utils.addTestJavaOpts(myArgs);
         ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(args);
         ProcessThread pt = new ProcessThread("runApplication", pb);
         pt.start();
         return pt;
     }
 
+    public static String[] concat(String[] a, String[] b) {
+        if (a == null) {
+            return b;
+        }
+        if (b == null) {
+            return a;
+        }
+        int aLen = a.length;
+        int bLen = b.length;
+        String[] c = new String[aLen + bLen];
+        System.arraycopy(a, 0, c, 0, aLen);
+        System.arraycopy(b, 0, c, aLen, bLen);
+        return c;
+     }
+
     /**
      * Will stop the running Application.
      * First tries to shutdown nicely by connecting to the shut down port.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/com/sun/tools/attach/TempDirTest.java	Tue Nov 18 08:41:14 2014 -0800
@@ -0,0 +1,169 @@
+/*
+ * Copyright (c) 2014 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 com.sun.tools.attach.*;
+
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.util.Properties;
+import java.util.List;
+import java.io.File;
+
+import jdk.testlibrary.OutputAnalyzer;
+import jdk.testlibrary.ProcessTools;
+import jdk.testlibrary.ProcessThread;
+
+/*
+ * @test
+ * @bug 8033104
+ * @summary Test to make sure attach and jvmstat works correctly when java.io.tmpdir is set
+ * @library /lib/testlibrary
+ * @run build Application Shutdown RunnerUtil
+ * @run main/timeout=10 TempDirTest
+ */
+
+public class TempDirTest {
+
+    public static void main(String args[]) throws Throwable {
+
+        Path clientTmpDir = Files.createTempDirectory("TempDirTest-client");
+        clientTmpDir.toFile().deleteOnExit();
+        Path targetTmpDir = Files.createTempDirectory("TempDirTest-target");
+        targetTmpDir.toFile().deleteOnExit();
+
+        // run the test with all possible combinations of setting java.io.tmpdir
+        runExperiment(null, null);
+        runExperiment(clientTmpDir, null);
+        runExperiment(clientTmpDir, targetTmpDir);
+        runExperiment(null, targetTmpDir);
+
+    }
+
+    private static int counter = 0;
+
+    /*
+     * The actual test is in the nested class TestMain.
+     * The responsibility of this class is to:
+     * 1. Start the Application class in a separate process.
+     * 2. Find the pid and shutdown port of the running Application.
+     * 3. Launches the tests in nested class TestMain that will attach to the Application.
+     * 4. Shut down the Application.
+     */
+    public static void runExperiment(Path clientTmpDir, Path targetTmpDir) throws Throwable {
+
+        System.out.print("### Running tests with overridden tmpdir for");
+        System.out.print(" client: " + (clientTmpDir == null ? "no" : "yes"));
+        System.out.print(" target: " + (targetTmpDir == null ? "no" : "yes"));
+        System.out.println(" ###");
+
+        final String pidFile = "TempDirTest.Application.pid-" + counter++;
+        ProcessThread processThread = null;
+        RunnerUtil.ProcessInfo info = null;
+        try {
+            String[] tmpDirArg = null;
+            if (targetTmpDir != null) {
+                tmpDirArg = new String[] {"-Djava.io.tmpdir=" + targetTmpDir};
+            }
+            processThread = RunnerUtil.startApplication(pidFile, tmpDirArg);
+            info = RunnerUtil.readProcessInfo(pidFile);
+            launchTests(info.pid, clientTmpDir);
+        } catch (Throwable t) {
+            System.out.println("TempDirTest got unexpected exception: " + t);
+            t.printStackTrace();
+            throw t;
+        } finally {
+            // Make sure the Application process is stopped.
+            RunnerUtil.stopApplication(info.shutdownPort, processThread);
+        }
+    }
+
+    /**
+     * Runs the actual tests in nested class TestMain.
+     * The reason for running the tests in a separate process
+     * is that we need to modify the class path and
+     * the -Djava.io.tmpdir property.
+     */
+    private static void launchTests(int pid, Path clientTmpDir) throws Throwable {
+        final String sep = File.separator;
+
+        // Need to add jdk/lib/tools.jar to classpath.
+        String classpath =
+            System.getProperty("test.class.path", "") + File.pathSeparator +
+            System.getProperty("test.jdk", ".") + sep + "lib" + sep + "tools.jar";
+
+        String[] tmpDirArg = null;
+        if (clientTmpDir != null) {
+            tmpDirArg = new String [] {"-Djava.io.tmpdir=" + clientTmpDir};
+        }
+
+        // Arguments : [-Djava.io.tmpdir=] -classpath cp TempDirTest$TestMain pid
+        String[] args = RunnerUtil.concat(
+                tmpDirArg,
+                new String[] {
+                    "-classpath",
+                    classpath,
+                    "TempDirTest$TestMain",
+                    Integer.toString(pid) });
+        OutputAnalyzer output = ProcessTools.executeTestJvm(args);
+        output.shouldHaveExitValue(0);
+    }
+
+    /**
+     * This is the actual test. It will attach to the running Application
+     * and perform a number of basic attach tests.
+     */
+    public static class TestMain {
+        public static void main(String args[]) throws Exception {
+            String pid = args[0];
+
+            // Test 1 - list method should list the target VM
+            System.out.println(" - Test: VirtualMachine.list");
+            List<VirtualMachineDescriptor> l = VirtualMachine.list();
+            boolean found = false;
+            for (VirtualMachineDescriptor vmd: l) {
+                if (vmd.id().equals(pid)) {
+                    found = true;
+                    break;
+                }
+            }
+            if (found) {
+                System.out.println(" - " + pid + " found.");
+            } else {
+                throw new RuntimeException(pid + " not found in VM list");
+            }
+
+            // Test 2 - try to attach and verify connection
+
+            System.out.println(" - Attaching to application ...");
+            VirtualMachine vm = VirtualMachine.attach(pid);
+
+            System.out.println(" - Test: system properties in target VM");
+            Properties props = vm.getSystemProperties();
+            String value = props.getProperty("attach.test");
+            if (value == null || !value.equals("true")) {
+                throw new RuntimeException("attach.test property not set");
+            }
+            System.out.println(" - attach.test property set as expected");
+        }
+    }
+}
--- a/test/com/sun/tools/attach/java.policy.allow	Mon Nov 17 20:20:20 2014 +0300
+++ b/test/com/sun/tools/attach/java.policy.allow	Tue Nov 18 08:41:14 2014 -0800
@@ -13,7 +13,6 @@
     permission java.lang.RuntimePermission "accessClassInPackage.sun.jvmstat.monitor";
     permission java.lang.RuntimePermission "loadLibrary.attach";
     permission java.util.PropertyPermission "sun.jvmstat.*", "read";
-    permission java.util.PropertyPermission "java.io.tmpdir", "read";
 
     /* to read configuration file in META-INF/services, and write/delete .attach_pid<pid> */
     permission java.io.FilePermission "<<ALL FILES>>", "read,write,delete";
--- a/test/com/sun/tools/attach/java.policy.deny	Mon Nov 17 20:20:20 2014 +0300
+++ b/test/com/sun/tools/attach/java.policy.deny	Tue Nov 18 08:41:14 2014 -0800
@@ -11,7 +11,6 @@
     permission java.lang.RuntimePermission "accessClassInPackage.sun.tools.attach";
     permission java.lang.RuntimePermission "loadLibrary.attach";
     permission java.util.PropertyPermission "sun.jvmstat.*", "read";
-    permission java.util.PropertyPermission "java.io.tmpdir", "read";
 
     /* to read configuration file in META-INF/services, and write/delete .attach_pid<pid> */
     permission java.io.FilePermission "<<ALL FILES>>", "read,write,delete";
--- a/test/java/lang/String/ToLowerCase.java	Mon Nov 17 20:20:20 2014 +0300
+++ b/test/java/lang/String/ToLowerCase.java	Tue Nov 18 08:41:14 2014 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2014 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 4217441 4533872 4900935 8020037
+    @bug 4217441 4533872 4900935 8020037 8041791
     @summary toLowerCase should lower-case Greek Sigma correctly depending
              on the context (final/non-final).  Also it should handle
              Locale specific (lt, tr, and az) lowercasings and supplementary
@@ -72,8 +72,10 @@
         // I-dot tests
         test("\u0130", turkish, "i");
         test("\u0130", az, "i");
-        test("\u0130", lt, "i");
-        test("\u0130", Locale.US, "i");
+        test("\u0130", lt, "\u0069\u0307");
+        test("\u0130", Locale.US, "\u0069\u0307");
+        test("\u0130", Locale.JAPAN, "\u0069\u0307");
+        test("\u0130", Locale.ROOT, "\u0069\u0307");
 
         // Remove dot_above in the sequence I + dot_above (Turkish and Azeri)
         test("I\u0307", turkish, "i");
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/net/MulticastSocket/SetGetNetworkInterfaceTest.java	Tue Nov 18 08:41:14 2014 -0800
@@ -0,0 +1,125 @@
+/*
+ * Copyright (c) 2013, 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 6458027
+ * @summary Disabling IPv6 on a specific network interface causes problems.
+ *
+ */
+
+import java.io.IOException;
+import java.net.InetAddress;
+import java.net.MulticastSocket;
+import java.net.NetworkInterface;
+import java.net.SocketException;
+import java.util.Arrays;
+import java.util.Enumeration;
+
+
+public class SetGetNetworkInterfaceTest  {
+
+    public static void main(String[] args) throws Exception {
+
+        boolean passed = true;
+        try {
+            MulticastSocket ms = new MulticastSocket();
+            Enumeration<NetworkInterface> networkInterfaces = NetworkInterface
+                    .getNetworkInterfaces();
+            while (networkInterfaces.hasMoreElements()) {
+                NetworkInterface netIf = networkInterfaces.nextElement();
+                if (isNetworkInterfaceTestable(netIf)) {
+                    printNetIfDetails(netIf);
+                    ms.setNetworkInterface(netIf);
+                    NetworkInterface msNetIf = ms.getNetworkInterface();
+                    if (netIf.equals(msNetIf)) {
+                        System.out.println(" OK");
+                    } else {
+                        System.out.println("FAILED!!!");
+                        printNetIfDetails(msNetIf);
+                        passed = false;
+                    }
+                    System.out.println("------------------");
+                }
+            }
+        } catch (IOException e) {
+            e.printStackTrace();
+            passed = false;
+        }
+        if (!passed) {
+            throw new RuntimeException("Test Fail");
+        }
+        System.out.println("Test passed ");
+    }
+
+    private static boolean isNetworkInterfaceTestable(NetworkInterface netIf) throws Exception {
+        System.out.println("checking netif == " + netIf.getName());
+        return  (netIf.isUp() && netIf.supportsMulticast() && isIpAddrAvailable(netIf));
+    }
+
+    private static boolean isIpAddrAvailable (NetworkInterface netIf) {
+        boolean ipAddrAvailable = false;
+        byte[] nullIpAddr = {'0', '0', '0', '0'};
+        byte[] testIpAddr = null;
+
+        Enumeration<InetAddress> ipAddresses = netIf.getInetAddresses();
+        while (ipAddresses.hasMoreElements()) {
+            InetAddress testAddr = ipAddresses.nextElement();
+            testIpAddr = testAddr.getAddress();
+            if ((testIpAddr != null) && (!Arrays.equals(testIpAddr, nullIpAddr))) {
+                ipAddrAvailable = true;
+                break;
+            } else {
+                System.out.println("ignore netif " + netIf.getName());
+            }
+        }
+        return ipAddrAvailable;
+    }
+
+    private static void printNetIfDetails(NetworkInterface ni)
+            throws SocketException {
+        System.out.println("Name " + ni.getName() + " index " + ni.getIndex());
+        Enumeration<InetAddress> en = ni.getInetAddresses();
+        while (en.hasMoreElements()) {
+            System.out.println(" InetAdress: " + en.nextElement());
+        }
+        System.out.println("HardwareAddress: " + createMacAddrString(ni));
+        System.out.println("loopback: " + ni.isLoopback() + "; pointToPoint: "
+                + ni.isPointToPoint() + "; virtual: " + ni.isVirtual()
+                + "; MTU: " + ni.getMTU());
+    }
+
+    private static String createMacAddrString(NetworkInterface netIf)
+            throws SocketException {
+        byte[] macAddr = netIf.getHardwareAddress();
+        StringBuilder sb = new StringBuilder();
+        if (macAddr != null) {
+            for (int i = 0; i < macAddr.length; i++) {
+                sb.append(String.format("%02X%s", macAddr[i],
+                        (i < macAddr.length - 1) ? "-" : ""));
+            }
+        }
+        return sb.toString();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/javax/swing/JComponent/8043610/bug8043610.java	Tue Nov 18 08:41:14 2014 -0800
@@ -0,0 +1,122 @@
+/*
+ * Copyright (c) 2014, 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 8043610
+  @summary Tests that JComponent invalidate, revalidate and repaint methods could
+           be called from any thread
+  @author Petr Pchelko
+*/
+
+import sun.awt.SunToolkit;
+
+import javax.swing.*;
+import java.awt.*;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.atomic.AtomicReference;
+
+public class bug8043610 {
+    private static volatile JFrame frame;
+    private static volatile JComponent component;
+
+    public static void main(String[] args) throws Exception {
+        ThreadGroup stubTG = new ThreadGroup(getRootThreadGroup(), "Stub Thread Group");
+        ThreadGroup swingTG = new ThreadGroup(getRootThreadGroup(), "SwingTG");
+        try {
+            Thread stubThread = new Thread(stubTG, new Runnable() {
+                @Override
+                public void run() {
+                    SunToolkit.createNewAppContext();
+                }
+            });
+            stubThread.start();
+            stubThread.join();
+
+            final CountDownLatch startSwingLatch = new CountDownLatch(1);
+            new Thread(swingTG, new Runnable() {
+                @Override
+                public void run() {
+                    SunToolkit.createNewAppContext();
+                    SwingUtilities.invokeLater(new Runnable() {
+                        @Override
+                        public void run() {
+                            frame = new JFrame();
+                            component = new JLabel("Test Text");
+                            frame.add(component);
+                            frame.setBounds(100, 100, 100, 100);
+                            frame.setVisible(true);
+                            startSwingLatch.countDown();
+                        }
+                    });
+                }
+            }).start();
+            startSwingLatch.await();
+
+            final AtomicReference<Exception> caughtException = new AtomicReference<>();
+            Thread checkThread = new Thread(getRootThreadGroup(), new Runnable() {
+                @Override
+                public void run() {
+                    try {
+                        component.invalidate();
+                        component.revalidate();
+                        component.repaint(new Rectangle(0, 0, 0, 0));
+                    } catch (Exception e) {
+                        caughtException.set(e);
+                    }
+                }
+            });
+            checkThread.start();
+            checkThread.join();
+
+            if (caughtException.get() != null) {
+                throw new RuntimeException("Failed. Caught exception!", caughtException.get());
+            }
+        } finally {
+            new Thread(swingTG, new Runnable() {
+                @Override
+                public void run() {
+                    SwingUtilities.invokeLater(new Runnable() {
+                        @Override
+                        public void run() {
+                            if (frame != null) {
+                                frame.dispose();
+                            }
+                        }
+                    });
+                }
+            }).start();
+        }
+    }
+
+    private static ThreadGroup getRootThreadGroup() {
+        ThreadGroup currentTG = Thread.currentThread().getThreadGroup();
+        ThreadGroup parentTG = currentTG.getParent();
+        while (parentTG != null) {
+            currentTG = parentTG;
+            parentTG = currentTG.getParent();
+        }
+        return currentTG;
+    }
+}