Merge
authoralanb
Wed, 25 May 2016 20:26:43 +0100
changeset 38566 6a1386b76fdd
parent 38565 e97761823da2 (current diff)
parent 38563 3ab5f00bd5a3 (diff)
child 38567 6d4c5a278fff
child 38997 737cce90a6d4
Merge
--- a/jdk/src/java.base/unix/native/libnet/Inet6AddressImpl.c	Wed May 25 20:12:32 2016 +0100
+++ b/jdk/src/java.base/unix/native/libnet/Inet6AddressImpl.c	Wed May 25 20:26:43 2016 +0100
@@ -158,7 +158,10 @@
     }
 
     name = (*env)->NewStringUTF(env, hostname);
-    CHECK_NULL_RETURN(name, NULL);
+    if (name == NULL) {
+        freeifaddrs(ifa);
+        return NULL;
+    }
 
     /* Iterate over the interfaces, and total up the number of IPv4 and IPv6
      * addresses we have. Also keep a count of loopback addresses. We need to
--- a/jdk/src/java.base/unix/native/libnet/NetworkInterface.c	Wed May 25 20:12:32 2016 +0100
+++ b/jdk/src/java.base/unix/native/libnet/NetworkInterface.c	Wed May 25 20:26:43 2016 +0100
@@ -243,6 +243,7 @@
     if (name_utf == NULL) {
        if (!(*env)->ExceptionCheck(env))
            JNU_ThrowOutOfMemoryError(env, NULL);
+       freeif(ifs);
        return NULL;
     }
 
@@ -519,7 +520,7 @@
     }
     if ((sock = openSocketWithFallback(env, name_utf)) < 0) {
        (*env)->ReleaseStringUTFChars(env, name, name_utf);
-       return JNI_FALSE;
+       return NULL;
     }
 
     if (!IS_NULL(addrArray)) {
@@ -664,7 +665,7 @@
     }
 
     // Create the array of InetAddresses
-    addrArr = (*env)->NewObjectArray(env, addr_count,  ia_class, NULL);
+    addrArr = (*env)->NewObjectArray(env, addr_count, ia_class, NULL);
     if (addrArr == NULL) {
         return NULL;
     }
@@ -1829,7 +1830,7 @@
     strncpy(if2.lifr_name, ifname, sizeof(if2.lifr_name) - 1);
 
     if (ioctl(sock, SIOCGLIFFLAGS, (char *)&if2) < 0) {
-         return -1;
+        return -1;
     }
 
     *flags = if2.lifr_flags;
@@ -1859,8 +1860,7 @@
                                               "IPV6 Socket creation failed");
                  return -1;
               }
-         }
-         else{ // errno is not NOSUPPORT
+         } else { // errno is not NOSUPPORT
              NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException",
                                           "IPV4 Socket creation failed");
              return -1;
--- a/jdk/src/java.base/unix/native/libnet/net_util_md.c	Wed May 25 20:12:32 2016 +0100
+++ b/jdk/src/java.base/unix/native/libnet/net_util_md.c	Wed May 25 20:26:43 2016 +0100
@@ -95,8 +95,8 @@
         CHECK_NULL(c);
         c = (*env)->NewGlobalRef(env, c);
         CHECK_NULL(c);
-        ni_defaultIndexID = (*env)->GetStaticFieldID(
-            env, c, "defaultIndex", "I");
+        ni_defaultIndexID = (*env)->GetStaticFieldID(env, c, "defaultIndex", "I");
+        CHECK_NULL(ni_defaultIndexID);
         ni_class = c;
     }
     int defaultIndex;
@@ -118,8 +118,8 @@
         CHECK_NULL_RETURN(c, 0);
         c = (*env)->NewGlobalRef(env, c);
         CHECK_NULL_RETURN(c, 0);
-        ni_defaultIndexID = (*env)->GetStaticFieldID(env, c,
-                                                     "defaultIndex", "I");
+        ni_defaultIndexID = (*env)->GetStaticFieldID(env, c, "defaultIndex", "I");
+        CHECK_NULL_RETURN(ni_defaultIndexID, 0);
         ni_class = c;
     }
     defaultIndex = (*env)->GetStaticIntField(env, ni_class,
--- a/jdk/src/jdk.unsupported/share/classes/sun/misc/Unsafe.java	Wed May 25 20:12:32 2016 +0100
+++ b/jdk/src/jdk.unsupported/share/classes/sun/misc/Unsafe.java	Wed May 25 20:26:43 2016 +0100
@@ -296,45 +296,6 @@
         theInternalUnsafe.putDouble(o, offset, x);
     }
 
-
-    // These read VM internal data.
-
-    /**
-     * Fetches an uncompressed reference value from a given native variable
-     * ignoring the VM's compressed references mode.
-     *
-     * @param address a memory address locating the variable
-     * @return the value fetched from the indicated native variable
-     */
-    @ForceInline
-    public Object getUncompressedObject(long address) {
-        return theInternalUnsafe.getUncompressedObject(address);
-    }
-
-    /**
-     * Fetches the {@link java.lang.Class} Java mirror for the given native
-     * metaspace {@code Klass} pointer.
-     *
-     * @param metaspaceKlass a native metaspace {@code Klass} pointer
-     * @return the {@link java.lang.Class} Java mirror
-     */
-    @ForceInline
-    public Class<?> getJavaMirror(long metaspaceKlass) {
-        return theInternalUnsafe.getJavaMirror(metaspaceKlass);
-    }
-
-    /**
-     * Fetches a native metaspace {@code Klass} pointer for the given Java
-     * object.
-     *
-     * @param o Java heap object for which to fetch the class pointer
-     * @return a native metaspace {@code Klass} pointer
-     */
-    @ForceInline
-    public long getKlassPointer(Object o) {
-        return theInternalUnsafe.getKlassPointer(o);
-    }
-
     // These work on values in the C heap.
 
     /**